diff --git a/services/recoveryservices/mgmt/2016-08-10/siterecovery/CHANGELOG.md b/services/recoveryservices/mgmt/2016-08-10/siterecovery/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/recoveryservices/mgmt/2016-08-10/siterecovery/CHANGELOG.md +++ b/services/recoveryservices/mgmt/2016-08-10/siterecovery/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/recoveryservices/mgmt/2016-08-10/siterecovery/_meta.json b/services/recoveryservices/mgmt/2016-08-10/siterecovery/_meta.json index a82fc9aaf449..60279e8737cf 100644 --- a/services/recoveryservices/mgmt/2016-08-10/siterecovery/_meta.json +++ b/services/recoveryservices/mgmt/2016-08-10/siterecovery/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "16f5f98c30852b877949ea63418f609233470bf7", "readme": "/_/azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.md", "tag": "package-2016-08", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/recoveryservices/mgmt/2018-01-10/siterecovery/CHANGELOG.md b/services/recoveryservices/mgmt/2018-01-10/siterecovery/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/recoveryservices/mgmt/2018-01-10/siterecovery/CHANGELOG.md +++ b/services/recoveryservices/mgmt/2018-01-10/siterecovery/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/recoveryservices/mgmt/2018-01-10/siterecovery/_meta.json b/services/recoveryservices/mgmt/2018-01-10/siterecovery/_meta.json index 7ffc775b6a28..6e5c526eeacb 100644 --- a/services/recoveryservices/mgmt/2018-01-10/siterecovery/_meta.json +++ b/services/recoveryservices/mgmt/2018-01-10/siterecovery/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "16f5f98c30852b877949ea63418f609233470bf7", "readme": "/_/azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.md", "tag": "package-2018-01", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/recoveryservices/mgmt/2018-07-10/siterecovery/CHANGELOG.md b/services/recoveryservices/mgmt/2018-07-10/siterecovery/CHANGELOG.md index 52911e4cc5e4..0e88c6b3e671 100644 --- a/services/recoveryservices/mgmt/2018-07-10/siterecovery/CHANGELOG.md +++ b/services/recoveryservices/mgmt/2018-07-10/siterecovery/CHANGELOG.md @@ -1,2 +1,30 @@ -# Change History +# Unreleased +## Additive Changes + +### New Constants + +1. ResourceTypeBasicRecoveryVirtualNetworkCustomDetails.ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew + +### New Funcs + +1. ExistingRecoveryVirtualNetwork.AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) +1. NewRecoveryVirtualNetwork.AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) +1. NewRecoveryVirtualNetwork.AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) +1. NewRecoveryVirtualNetwork.AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) +1. NewRecoveryVirtualNetwork.AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) +1. NewRecoveryVirtualNetwork.MarshalJSON() ([]byte, error) +1. RecoveryVirtualNetworkCustomDetails.AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) + +### Struct Changes + +#### New Structs + +1. NewRecoveryVirtualNetwork + +#### New Struct Fields + +1. HyperVReplicaAzureEnableProtectionInput.TargetAvailabilitySetID +1. HyperVReplicaAzureEnableProtectionInput.TargetVMSize +1. InMageAzureV2EnableProtectionInput.TargetAvailabilitySetID +1. InMageAzureV2EnableProtectionInput.TargetVMSize diff --git a/services/recoveryservices/mgmt/2018-07-10/siterecovery/_meta.json b/services/recoveryservices/mgmt/2018-07-10/siterecovery/_meta.json index 0e286665fff4..3845018e8bf8 100644 --- a/services/recoveryservices/mgmt/2018-07-10/siterecovery/_meta.json +++ b/services/recoveryservices/mgmt/2018-07-10/siterecovery/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "16f5f98c30852b877949ea63418f609233470bf7", "readme": "/_/azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.md", "tag": "package-2018-07", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/recoveryservices/mgmt/2018-07-10/siterecovery/enums.go b/services/recoveryservices/mgmt/2018-07-10/siterecovery/enums.go index edf9486380dd..f87f087cf8c0 100644 --- a/services/recoveryservices/mgmt/2018-07-10/siterecovery/enums.go +++ b/services/recoveryservices/mgmt/2018-07-10/siterecovery/enums.go @@ -1572,13 +1572,15 @@ type ResourceTypeBasicRecoveryVirtualNetworkCustomDetails string const ( // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting ... ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "Existing" + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "New" // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails ... ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "RecoveryVirtualNetworkCustomDetails" ) // PossibleResourceTypeBasicRecoveryVirtualNetworkCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryVirtualNetworkCustomDetails const type. func PossibleResourceTypeBasicRecoveryVirtualNetworkCustomDetailsValues() []ResourceTypeBasicRecoveryVirtualNetworkCustomDetails { - return []ResourceTypeBasicRecoveryVirtualNetworkCustomDetails{ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails} + return []ResourceTypeBasicRecoveryVirtualNetworkCustomDetails{ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew, ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails} } // ResourceTypeBasicStorageAccountCustomDetails enumerates the values for resource type basic storage account diff --git a/services/recoveryservices/mgmt/2018-07-10/siterecovery/models.go b/services/recoveryservices/mgmt/2018-07-10/siterecovery/models.go index b968bfcfe54c..13ae924da31e 100644 --- a/services/recoveryservices/mgmt/2018-07-10/siterecovery/models.go +++ b/services/recoveryservices/mgmt/2018-07-10/siterecovery/models.go @@ -5201,7 +5201,7 @@ type ExistingRecoveryVirtualNetwork struct { RecoveryVirtualNetworkID *string `json:"recoveryVirtualNetworkId,omitempty"` // RecoverySubnetName - The recovery subnet name. RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` - // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting' + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` } @@ -5226,6 +5226,11 @@ func (ervn ExistingRecoveryVirtualNetwork) AsExistingRecoveryVirtualNetwork() (* return &ervn, true } +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return nil, false +} + // AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. func (ervn ExistingRecoveryVirtualNetwork) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { return nil, false @@ -6666,6 +6671,10 @@ type HyperVReplicaAzureEnableProtectionInput struct { TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` // TargetProximityPlacementGroupID - The proximity placement group ARM Id. TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetAvailabilitySetID - The availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeSan' InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` } @@ -6722,6 +6731,12 @@ func (hvraepi HyperVReplicaAzureEnableProtectionInput) MarshalJSON() ([]byte, er if hvraepi.TargetProximityPlacementGroupID != nil { objectMap["targetProximityPlacementGroupId"] = hvraepi.TargetProximityPlacementGroupID } + if hvraepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = hvraepi.TargetAvailabilitySetID + } + if hvraepi.TargetVMSize != nil { + objectMap["targetVmSize"] = hvraepi.TargetVMSize + } if hvraepi.InstanceType != "" { objectMap["instanceType"] = hvraepi.InstanceType } @@ -9055,6 +9070,10 @@ type InMageAzureV2EnableProtectionInput struct { TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` // TargetProximityPlacementGroupID - The proximity placement group ARM Id. TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetAvailabilitySetID - The availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeSan' InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` } @@ -9117,6 +9136,12 @@ func (imavepi InMageAzureV2EnableProtectionInput) MarshalJSON() ([]byte, error) if imavepi.TargetProximityPlacementGroupID != nil { objectMap["targetProximityPlacementGroupId"] = imavepi.TargetProximityPlacementGroupID } + if imavepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imavepi.TargetAvailabilitySetID + } + if imavepi.TargetVMSize != nil { + objectMap["targetVmSize"] = imavepi.TargetVMSize + } if imavepi.InstanceType != "" { objectMap["instanceType"] = imavepi.InstanceType } @@ -14860,6 +14885,53 @@ func (npp NewProtectionProfile) AsBasicProtectionProfileCustomDetails() (BasicPr return &npp, true } +// NewRecoveryVirtualNetwork recovery virtual network input to create new virtual network from given source +// network. +type NewRecoveryVirtualNetwork struct { + // RecoveryVirtualNetworkResourceGroupName - The name of the resource group to be used to create the recovery virtual network. If absent, target network would be created in the same resource group as target VM. + RecoveryVirtualNetworkResourceGroupName *string `json:"recoveryVirtualNetworkResourceGroupName,omitempty"` + // RecoveryVirtualNetworkName - The recovery virtual network name. + RecoveryVirtualNetworkName *string `json:"recoveryVirtualNetworkName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) MarshalJSON() ([]byte, error) { + nrvn.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew + objectMap := make(map[string]interface{}) + if nrvn.RecoveryVirtualNetworkResourceGroupName != nil { + objectMap["recoveryVirtualNetworkResourceGroupName"] = nrvn.RecoveryVirtualNetworkResourceGroupName + } + if nrvn.RecoveryVirtualNetworkName != nil { + objectMap["recoveryVirtualNetworkName"] = nrvn.RecoveryVirtualNetworkName + } + if nrvn.ResourceType != "" { + objectMap["resourceType"] = nrvn.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return &nrvn, true +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &nrvn, true +} + // OperationsDiscovery operations discovery class. type OperationsDiscovery struct { // Name - Name of the API. The name of the operation being performed on this particular object. It should match the action name that appears in RBAC / the event service. Examples of operations include: * Microsoft.Compute/virtualMachine/capture/action * Microsoft.Compute/virtualMachine/restart/action * Microsoft.Compute/virtualMachine/write * Microsoft.Compute/virtualMachine/read * Microsoft.Compute/virtualMachine/delete Each action should include, in order: (1) Resource Provider Namespace (2) Type hierarchy for which the action applies (e.g. server/databases for a SQL Azure database) (3) Read, Write, Action or Delete indicating which type applies. If it is a PUT/PATCH on a collection or named value, Write should be used. If it is a GET, Read should be used. If it is a DELETE, Delete should be used. If it is a POST, Action should be used. As a note: all resource providers would need to include the "{Resource Provider Namespace}/register/action" operation in their response. This API is used to register for their service, and should include details about the operation (e.g. a localized name for the resource provider + any special considerations like PII release) @@ -19784,12 +19856,13 @@ type RecoveryServicesProviderProperties struct { // BasicRecoveryVirtualNetworkCustomDetails recovery Virtual network custom input. type BasicRecoveryVirtualNetworkCustomDetails interface { AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) + AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) } // RecoveryVirtualNetworkCustomDetails recovery Virtual network custom input. type RecoveryVirtualNetworkCustomDetails struct { - // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting' + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` } @@ -19805,6 +19878,10 @@ func unmarshalBasicRecoveryVirtualNetworkCustomDetails(body []byte) (BasicRecove var ervn ExistingRecoveryVirtualNetwork err := json.Unmarshal(body, &ervn) return ervn, err + case string(ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew): + var nrvn NewRecoveryVirtualNetwork + err := json.Unmarshal(body, &nrvn) + return nrvn, err default: var rvncd RecoveryVirtualNetworkCustomDetails err := json.Unmarshal(body, &rvncd) @@ -19845,6 +19922,11 @@ func (rvncd RecoveryVirtualNetworkCustomDetails) AsExistingRecoveryVirtualNetwor return nil, false } +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return nil, false +} + // AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. func (rvncd RecoveryVirtualNetworkCustomDetails) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { return &rvncd, true diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/CHANGELOG.md b/services/recoveryservices/mgmt/2021-02-10/siterecovery/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/_meta.json b/services/recoveryservices/mgmt/2021-02-10/siterecovery/_meta.json new file mode 100644 index 000000000000..83037e65c6b8 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "16f5f98c30852b877949ea63418f609233470bf7", + "readme": "/_/azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.md", + "tag": "package-2021-02", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-02 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/client.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/client.go new file mode 100644 index 000000000000..53fea8764099 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/client.go @@ -0,0 +1,45 @@ +// Package siterecovery implements the Azure ARM Siterecovery service API version 2021-02-10. +// +// +package siterecovery + +// 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. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Siterecovery + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Siterecovery. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string + ResourceGroupName string + ResourceName string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string, resourceGroupName string, resourceName string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + ResourceGroupName: resourceGroupName, + ResourceName: resourceName, + } +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/enums.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/enums.go new file mode 100644 index 000000000000..b2f89217d9a2 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/enums.go @@ -0,0 +1,1834 @@ +package siterecovery + +// 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. + +// A2ARecoveryAvailabilityType enumerates the values for a2a recovery availability type. +type A2ARecoveryAvailabilityType string + +const ( + // AvailabilitySet ... + AvailabilitySet A2ARecoveryAvailabilityType = "AvailabilitySet" + // AvailabilityZone ... + AvailabilityZone A2ARecoveryAvailabilityType = "AvailabilityZone" + // Single ... + Single A2ARecoveryAvailabilityType = "Single" +) + +// PossibleA2ARecoveryAvailabilityTypeValues returns an array of possible values for the A2ARecoveryAvailabilityType const type. +func PossibleA2ARecoveryAvailabilityTypeValues() []A2ARecoveryAvailabilityType { + return []A2ARecoveryAvailabilityType{AvailabilitySet, AvailabilityZone, Single} +} + +// A2ARpRecoveryPointType enumerates the values for a2a rp recovery point type. +type A2ARpRecoveryPointType string + +const ( + // Latest ... + Latest A2ARpRecoveryPointType = "Latest" + // LatestApplicationConsistent ... + LatestApplicationConsistent A2ARpRecoveryPointType = "LatestApplicationConsistent" + // LatestCrashConsistent ... + LatestCrashConsistent A2ARpRecoveryPointType = "LatestCrashConsistent" + // LatestProcessed ... + LatestProcessed A2ARpRecoveryPointType = "LatestProcessed" +) + +// PossibleA2ARpRecoveryPointTypeValues returns an array of possible values for the A2ARpRecoveryPointType const type. +func PossibleA2ARpRecoveryPointTypeValues() []A2ARpRecoveryPointType { + return []A2ARpRecoveryPointType{Latest, LatestApplicationConsistent, LatestCrashConsistent, LatestProcessed} +} + +// AgentAutoUpdateStatus enumerates the values for agent auto update status. +type AgentAutoUpdateStatus string + +const ( + // Disabled ... + Disabled AgentAutoUpdateStatus = "Disabled" + // Enabled ... + Enabled AgentAutoUpdateStatus = "Enabled" +) + +// PossibleAgentAutoUpdateStatusValues returns an array of possible values for the AgentAutoUpdateStatus const type. +func PossibleAgentAutoUpdateStatusValues() []AgentAutoUpdateStatus { + return []AgentAutoUpdateStatus{Disabled, Enabled} +} + +// AgentUpgradeBlockedReason enumerates the values for agent upgrade blocked reason. +type AgentUpgradeBlockedReason string + +const ( + // AgentNoHeartbeat ... + AgentNoHeartbeat AgentUpgradeBlockedReason = "AgentNoHeartbeat" + // AlreadyOnLatestVersion ... + AlreadyOnLatestVersion AgentUpgradeBlockedReason = "AlreadyOnLatestVersion" + // DistroIsNotReported ... + DistroIsNotReported AgentUpgradeBlockedReason = "DistroIsNotReported" + // DistroNotSupportedForUpgrade ... + DistroNotSupportedForUpgrade AgentUpgradeBlockedReason = "DistroNotSupportedForUpgrade" + // IncompatibleApplianceVersion ... + IncompatibleApplianceVersion AgentUpgradeBlockedReason = "IncompatibleApplianceVersion" + // InvalidAgentVersion ... + InvalidAgentVersion AgentUpgradeBlockedReason = "InvalidAgentVersion" + // InvalidDriverVersion ... + InvalidDriverVersion AgentUpgradeBlockedReason = "InvalidDriverVersion" + // MissingUpgradePath ... + MissingUpgradePath AgentUpgradeBlockedReason = "MissingUpgradePath" + // NotProtected ... + NotProtected AgentUpgradeBlockedReason = "NotProtected" + // ProcessServerNoHeartbeat ... + ProcessServerNoHeartbeat AgentUpgradeBlockedReason = "ProcessServerNoHeartbeat" + // RcmProxyNoHeartbeat ... + RcmProxyNoHeartbeat AgentUpgradeBlockedReason = "RcmProxyNoHeartbeat" + // RebootRequired ... + RebootRequired AgentUpgradeBlockedReason = "RebootRequired" + // Unknown ... + Unknown AgentUpgradeBlockedReason = "Unknown" + // UnsupportedProtectionScenario ... + UnsupportedProtectionScenario AgentUpgradeBlockedReason = "UnsupportedProtectionScenario" +) + +// PossibleAgentUpgradeBlockedReasonValues returns an array of possible values for the AgentUpgradeBlockedReason const type. +func PossibleAgentUpgradeBlockedReasonValues() []AgentUpgradeBlockedReason { + return []AgentUpgradeBlockedReason{AgentNoHeartbeat, AlreadyOnLatestVersion, DistroIsNotReported, DistroNotSupportedForUpgrade, IncompatibleApplianceVersion, InvalidAgentVersion, InvalidDriverVersion, MissingUpgradePath, NotProtected, ProcessServerNoHeartbeat, RcmProxyNoHeartbeat, RebootRequired, Unknown, UnsupportedProtectionScenario} +} + +// AgentVersionStatus enumerates the values for agent version status. +type AgentVersionStatus string + +const ( + // Deprecated ... + Deprecated AgentVersionStatus = "Deprecated" + // NotSupported ... + NotSupported AgentVersionStatus = "NotSupported" + // SecurityUpdateRequired ... + SecurityUpdateRequired AgentVersionStatus = "SecurityUpdateRequired" + // Supported ... + Supported AgentVersionStatus = "Supported" + // UpdateRequired ... + UpdateRequired AgentVersionStatus = "UpdateRequired" +) + +// PossibleAgentVersionStatusValues returns an array of possible values for the AgentVersionStatus const type. +func PossibleAgentVersionStatusValues() []AgentVersionStatus { + return []AgentVersionStatus{Deprecated, NotSupported, SecurityUpdateRequired, Supported, UpdateRequired} +} + +// AlternateLocationRecoveryOption enumerates the values for alternate location recovery option. +type AlternateLocationRecoveryOption string + +const ( + // CreateVMIfNotFound ... + CreateVMIfNotFound AlternateLocationRecoveryOption = "CreateVmIfNotFound" + // NoAction ... + NoAction AlternateLocationRecoveryOption = "NoAction" +) + +// PossibleAlternateLocationRecoveryOptionValues returns an array of possible values for the AlternateLocationRecoveryOption const type. +func PossibleAlternateLocationRecoveryOptionValues() []AlternateLocationRecoveryOption { + return []AlternateLocationRecoveryOption{CreateVMIfNotFound, NoAction} +} + +// AutoProtectionOfDataDisk enumerates the values for auto protection of data disk. +type AutoProtectionOfDataDisk string + +const ( + // AutoProtectionOfDataDiskDisabled ... + AutoProtectionOfDataDiskDisabled AutoProtectionOfDataDisk = "Disabled" + // AutoProtectionOfDataDiskEnabled ... + AutoProtectionOfDataDiskEnabled AutoProtectionOfDataDisk = "Enabled" +) + +// PossibleAutoProtectionOfDataDiskValues returns an array of possible values for the AutoProtectionOfDataDisk const type. +func PossibleAutoProtectionOfDataDiskValues() []AutoProtectionOfDataDisk { + return []AutoProtectionOfDataDisk{AutoProtectionOfDataDiskDisabled, AutoProtectionOfDataDiskEnabled} +} + +// DataSyncStatus enumerates the values for data sync status. +type DataSyncStatus string + +const ( + // ForDownTime ... + ForDownTime DataSyncStatus = "ForDownTime" + // ForSynchronization ... + ForSynchronization DataSyncStatus = "ForSynchronization" +) + +// PossibleDataSyncStatusValues returns an array of possible values for the DataSyncStatus const type. +func PossibleDataSyncStatusValues() []DataSyncStatus { + return []DataSyncStatus{ForDownTime, ForSynchronization} +} + +// DisableProtectionReason enumerates the values for disable protection reason. +type DisableProtectionReason string + +const ( + // MigrationComplete ... + MigrationComplete DisableProtectionReason = "MigrationComplete" + // NotSpecified ... + NotSpecified DisableProtectionReason = "NotSpecified" +) + +// PossibleDisableProtectionReasonValues returns an array of possible values for the DisableProtectionReason const type. +func PossibleDisableProtectionReasonValues() []DisableProtectionReason { + return []DisableProtectionReason{MigrationComplete, NotSpecified} +} + +// DiskAccountType enumerates the values for disk account type. +type DiskAccountType string + +const ( + // PremiumLRS ... + PremiumLRS DiskAccountType = "Premium_LRS" + // StandardLRS ... + StandardLRS DiskAccountType = "Standard_LRS" + // StandardSSDLRS ... + StandardSSDLRS DiskAccountType = "StandardSSD_LRS" +) + +// PossibleDiskAccountTypeValues returns an array of possible values for the DiskAccountType const type. +func PossibleDiskAccountTypeValues() []DiskAccountType { + return []DiskAccountType{PremiumLRS, StandardLRS, StandardSSDLRS} +} + +// DiskReplicationProgressHealth enumerates the values for disk replication progress health. +type DiskReplicationProgressHealth string + +const ( + // InProgress ... + InProgress DiskReplicationProgressHealth = "InProgress" + // None ... + None DiskReplicationProgressHealth = "None" + // NoProgress ... + NoProgress DiskReplicationProgressHealth = "NoProgress" + // Queued ... + Queued DiskReplicationProgressHealth = "Queued" + // SlowProgress ... + SlowProgress DiskReplicationProgressHealth = "SlowProgress" +) + +// PossibleDiskReplicationProgressHealthValues returns an array of possible values for the DiskReplicationProgressHealth const type. +func PossibleDiskReplicationProgressHealthValues() []DiskReplicationProgressHealth { + return []DiskReplicationProgressHealth{InProgress, None, NoProgress, Queued, SlowProgress} +} + +// EthernetAddressType enumerates the values for ethernet address type. +type EthernetAddressType string + +const ( + // Dynamic ... + Dynamic EthernetAddressType = "Dynamic" + // Static ... + Static EthernetAddressType = "Static" +) + +// PossibleEthernetAddressTypeValues returns an array of possible values for the EthernetAddressType const type. +func PossibleEthernetAddressTypeValues() []EthernetAddressType { + return []EthernetAddressType{Dynamic, Static} +} + +// ExportJobOutputSerializationType enumerates the values for export job output serialization type. +type ExportJobOutputSerializationType string + +const ( + // Excel ... + Excel ExportJobOutputSerializationType = "Excel" + // JSON ... + JSON ExportJobOutputSerializationType = "Json" + // XML ... + XML ExportJobOutputSerializationType = "Xml" +) + +// PossibleExportJobOutputSerializationTypeValues returns an array of possible values for the ExportJobOutputSerializationType const type. +func PossibleExportJobOutputSerializationTypeValues() []ExportJobOutputSerializationType { + return []ExportJobOutputSerializationType{Excel, JSON, XML} +} + +// FailoverDeploymentModel enumerates the values for failover deployment model. +type FailoverDeploymentModel string + +const ( + // Classic ... + Classic FailoverDeploymentModel = "Classic" + // NotApplicable ... + NotApplicable FailoverDeploymentModel = "NotApplicable" + // ResourceManager ... + ResourceManager FailoverDeploymentModel = "ResourceManager" +) + +// PossibleFailoverDeploymentModelValues returns an array of possible values for the FailoverDeploymentModel const type. +func PossibleFailoverDeploymentModelValues() []FailoverDeploymentModel { + return []FailoverDeploymentModel{Classic, NotApplicable, ResourceManager} +} + +// HealthErrorCategory enumerates the values for health error category. +type HealthErrorCategory string + +const ( + // HealthErrorCategoryAgentAutoUpdateArtifactDeleted ... + HealthErrorCategoryAgentAutoUpdateArtifactDeleted HealthErrorCategory = "AgentAutoUpdateArtifactDeleted" + // HealthErrorCategoryAgentAutoUpdateInfra ... + HealthErrorCategoryAgentAutoUpdateInfra HealthErrorCategory = "AgentAutoUpdateInfra" + // HealthErrorCategoryAgentAutoUpdateRunAsAccount ... + HealthErrorCategoryAgentAutoUpdateRunAsAccount HealthErrorCategory = "AgentAutoUpdateRunAsAccount" + // HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired ... + HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired HealthErrorCategory = "AgentAutoUpdateRunAsAccountExpired" + // HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry ... + HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry HealthErrorCategory = "AgentAutoUpdateRunAsAccountExpiry" + // HealthErrorCategoryConfiguration ... + HealthErrorCategoryConfiguration HealthErrorCategory = "Configuration" + // HealthErrorCategoryFabricInfrastructure ... + HealthErrorCategoryFabricInfrastructure HealthErrorCategory = "FabricInfrastructure" + // HealthErrorCategoryNone ... + HealthErrorCategoryNone HealthErrorCategory = "None" + // HealthErrorCategoryReplication ... + HealthErrorCategoryReplication HealthErrorCategory = "Replication" + // HealthErrorCategoryTestFailover ... + HealthErrorCategoryTestFailover HealthErrorCategory = "TestFailover" + // HealthErrorCategoryVersionExpiry ... + HealthErrorCategoryVersionExpiry HealthErrorCategory = "VersionExpiry" +) + +// PossibleHealthErrorCategoryValues returns an array of possible values for the HealthErrorCategory const type. +func PossibleHealthErrorCategoryValues() []HealthErrorCategory { + return []HealthErrorCategory{HealthErrorCategoryAgentAutoUpdateArtifactDeleted, HealthErrorCategoryAgentAutoUpdateInfra, HealthErrorCategoryAgentAutoUpdateRunAsAccount, HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired, HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry, HealthErrorCategoryConfiguration, HealthErrorCategoryFabricInfrastructure, HealthErrorCategoryNone, HealthErrorCategoryReplication, HealthErrorCategoryTestFailover, HealthErrorCategoryVersionExpiry} +} + +// HealthErrorCustomerResolvability enumerates the values for health error customer resolvability. +type HealthErrorCustomerResolvability string + +const ( + // Allowed ... + Allowed HealthErrorCustomerResolvability = "Allowed" + // NotAllowed ... + NotAllowed HealthErrorCustomerResolvability = "NotAllowed" +) + +// PossibleHealthErrorCustomerResolvabilityValues returns an array of possible values for the HealthErrorCustomerResolvability const type. +func PossibleHealthErrorCustomerResolvabilityValues() []HealthErrorCustomerResolvability { + return []HealthErrorCustomerResolvability{Allowed, NotAllowed} +} + +// HyperVReplicaAzureRpRecoveryPointType enumerates the values for hyper v replica azure rp recovery point +// type. +type HyperVReplicaAzureRpRecoveryPointType string + +const ( + // HyperVReplicaAzureRpRecoveryPointTypeLatest ... + HyperVReplicaAzureRpRecoveryPointTypeLatest HyperVReplicaAzureRpRecoveryPointType = "Latest" + // HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent ... + HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent HyperVReplicaAzureRpRecoveryPointType = "LatestApplicationConsistent" + // HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed ... + HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed HyperVReplicaAzureRpRecoveryPointType = "LatestProcessed" +) + +// PossibleHyperVReplicaAzureRpRecoveryPointTypeValues returns an array of possible values for the HyperVReplicaAzureRpRecoveryPointType const type. +func PossibleHyperVReplicaAzureRpRecoveryPointTypeValues() []HyperVReplicaAzureRpRecoveryPointType { + return []HyperVReplicaAzureRpRecoveryPointType{HyperVReplicaAzureRpRecoveryPointTypeLatest, HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent, HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed} +} + +// InMageRcmFailbackRecoveryPointType enumerates the values for in mage rcm failback recovery point type. +type InMageRcmFailbackRecoveryPointType string + +const ( + // ApplicationConsistent ... + ApplicationConsistent InMageRcmFailbackRecoveryPointType = "ApplicationConsistent" + // CrashConsistent ... + CrashConsistent InMageRcmFailbackRecoveryPointType = "CrashConsistent" +) + +// PossibleInMageRcmFailbackRecoveryPointTypeValues returns an array of possible values for the InMageRcmFailbackRecoveryPointType const type. +func PossibleInMageRcmFailbackRecoveryPointTypeValues() []InMageRcmFailbackRecoveryPointType { + return []InMageRcmFailbackRecoveryPointType{ApplicationConsistent, CrashConsistent} +} + +// InMageV2RpRecoveryPointType enumerates the values for in mage v2 rp recovery point type. +type InMageV2RpRecoveryPointType string + +const ( + // InMageV2RpRecoveryPointTypeLatest ... + InMageV2RpRecoveryPointTypeLatest InMageV2RpRecoveryPointType = "Latest" + // InMageV2RpRecoveryPointTypeLatestApplicationConsistent ... + InMageV2RpRecoveryPointTypeLatestApplicationConsistent InMageV2RpRecoveryPointType = "LatestApplicationConsistent" + // InMageV2RpRecoveryPointTypeLatestCrashConsistent ... + InMageV2RpRecoveryPointTypeLatestCrashConsistent InMageV2RpRecoveryPointType = "LatestCrashConsistent" + // InMageV2RpRecoveryPointTypeLatestProcessed ... + InMageV2RpRecoveryPointTypeLatestProcessed InMageV2RpRecoveryPointType = "LatestProcessed" +) + +// PossibleInMageV2RpRecoveryPointTypeValues returns an array of possible values for the InMageV2RpRecoveryPointType const type. +func PossibleInMageV2RpRecoveryPointTypeValues() []InMageV2RpRecoveryPointType { + return []InMageV2RpRecoveryPointType{InMageV2RpRecoveryPointTypeLatest, InMageV2RpRecoveryPointTypeLatestApplicationConsistent, InMageV2RpRecoveryPointTypeLatestCrashConsistent, InMageV2RpRecoveryPointTypeLatestProcessed} +} + +// InstanceType enumerates the values for instance type. +type InstanceType string + +const ( + // InstanceTypeA2A ... + InstanceTypeA2A InstanceType = "A2A" + // InstanceTypeAddDisksProviderSpecificInput ... + InstanceTypeAddDisksProviderSpecificInput InstanceType = "AddDisksProviderSpecificInput" +) + +// PossibleInstanceTypeValues returns an array of possible values for the InstanceType const type. +func PossibleInstanceTypeValues() []InstanceType { + return []InstanceType{InstanceTypeA2A, InstanceTypeAddDisksProviderSpecificInput} +} + +// InstanceTypeBasicApplyRecoveryPointProviderSpecificInput enumerates the values for instance type basic apply +// recovery point provider specific input. +type InstanceTypeBasicApplyRecoveryPointProviderSpecificInput string + +const ( + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "A2A" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "ApplyRecoveryPointProviderSpecificInput" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "InMageRcm" +) + +// PossibleInstanceTypeBasicApplyRecoveryPointProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicApplyRecoveryPointProviderSpecificInput const type. +func PossibleInstanceTypeBasicApplyRecoveryPointProviderSpecificInputValues() []InstanceTypeBasicApplyRecoveryPointProviderSpecificInput { + return []InstanceTypeBasicApplyRecoveryPointProviderSpecificInput{InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm} +} + +// InstanceTypeBasicConfigurationSettings enumerates the values for instance type basic configuration settings. +type InstanceTypeBasicConfigurationSettings string + +const ( + // InstanceTypeConfigurationSettings ... + InstanceTypeConfigurationSettings InstanceTypeBasicConfigurationSettings = "ConfigurationSettings" + // InstanceTypeHyperVVirtualMachine ... + InstanceTypeHyperVVirtualMachine InstanceTypeBasicConfigurationSettings = "HyperVVirtualMachine" + // InstanceTypeReplicationGroupDetails ... + InstanceTypeReplicationGroupDetails InstanceTypeBasicConfigurationSettings = "ReplicationGroupDetails" + // InstanceTypeVmmVirtualMachine ... + InstanceTypeVmmVirtualMachine InstanceTypeBasicConfigurationSettings = "VmmVirtualMachine" + // InstanceTypeVMwareVirtualMachine ... + InstanceTypeVMwareVirtualMachine InstanceTypeBasicConfigurationSettings = "VMwareVirtualMachine" +) + +// PossibleInstanceTypeBasicConfigurationSettingsValues returns an array of possible values for the InstanceTypeBasicConfigurationSettings const type. +func PossibleInstanceTypeBasicConfigurationSettingsValues() []InstanceTypeBasicConfigurationSettings { + return []InstanceTypeBasicConfigurationSettings{InstanceTypeConfigurationSettings, InstanceTypeHyperVVirtualMachine, InstanceTypeReplicationGroupDetails, InstanceTypeVmmVirtualMachine, InstanceTypeVMwareVirtualMachine} +} + +// InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails enumerates the values for instance type basic +// create protection intent provider specific details. +type InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails string + +const ( + // InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails = "A2A" + // InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails ... + InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails = "CreateProtectionIntentProviderSpecificDetails" +) + +// PossibleInstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails const type. +func PossibleInstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsValues() []InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails { + return []InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails{InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails} +} + +// InstanceTypeBasicDisableProtectionProviderSpecificInput enumerates the values for instance type basic +// disable protection provider specific input. +type InstanceTypeBasicDisableProtectionProviderSpecificInput string + +const ( + // InstanceTypeDisableProtectionProviderSpecificInput ... + InstanceTypeDisableProtectionProviderSpecificInput InstanceTypeBasicDisableProtectionProviderSpecificInput = "DisableProtectionProviderSpecificInput" + // InstanceTypeInMage ... + InstanceTypeInMage InstanceTypeBasicDisableProtectionProviderSpecificInput = "InMage" +) + +// PossibleInstanceTypeBasicDisableProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicDisableProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicDisableProtectionProviderSpecificInputValues() []InstanceTypeBasicDisableProtectionProviderSpecificInput { + return []InstanceTypeBasicDisableProtectionProviderSpecificInput{InstanceTypeDisableProtectionProviderSpecificInput, InstanceTypeInMage} +} + +// InstanceTypeBasicEnableMigrationProviderSpecificInput enumerates the values for instance type basic enable +// migration provider specific input. +type InstanceTypeBasicEnableMigrationProviderSpecificInput string + +const ( + // InstanceTypeEnableMigrationProviderSpecificInput ... + InstanceTypeEnableMigrationProviderSpecificInput InstanceTypeBasicEnableMigrationProviderSpecificInput = "EnableMigrationProviderSpecificInput" + // InstanceTypeVMwareCbt ... + InstanceTypeVMwareCbt InstanceTypeBasicEnableMigrationProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicEnableMigrationProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicEnableMigrationProviderSpecificInput const type. +func PossibleInstanceTypeBasicEnableMigrationProviderSpecificInputValues() []InstanceTypeBasicEnableMigrationProviderSpecificInput { + return []InstanceTypeBasicEnableMigrationProviderSpecificInput{InstanceTypeEnableMigrationProviderSpecificInput, InstanceTypeVMwareCbt} +} + +// InstanceTypeBasicEnableProtectionProviderSpecificInput enumerates the values for instance type basic enable +// protection provider specific input. +type InstanceTypeBasicEnableProtectionProviderSpecificInput string + +const ( + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A InstanceTypeBasicEnableProtectionProviderSpecificInput = "A2A" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicEnableProtectionProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput InstanceTypeBasicEnableProtectionProviderSpecificInput = "EnableProtectionProviderSpecificInput" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicEnableProtectionProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMage" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMageRcm" +) + +// PossibleInstanceTypeBasicEnableProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicEnableProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicEnableProtectionProviderSpecificInputValues() []InstanceTypeBasicEnableProtectionProviderSpecificInput { + return []InstanceTypeBasicEnableProtectionProviderSpecificInput{InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm} +} + +// InstanceTypeBasicEventProviderSpecificDetails enumerates the values for instance type basic event provider +// specific details. +type InstanceTypeBasicEventProviderSpecificDetails string + +const ( + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicEventProviderSpecificDetails = "A2A" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails InstanceTypeBasicEventProviderSpecificDetails = "EventProviderSpecificDetails" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplica2012" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplica2012R2" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplicaAzure" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplicaBaseEventDetails" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicEventProviderSpecificDetails = "InMageAzureV2" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicEventProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback InstanceTypeBasicEventProviderSpecificDetails = "InMageRcmFailback" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicEventProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicEventProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicEventProviderSpecificDetails const type. +func PossibleInstanceTypeBasicEventProviderSpecificDetailsValues() []InstanceTypeBasicEventProviderSpecificDetails { + return []InstanceTypeBasicEventProviderSpecificDetails{InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicEventSpecificDetails enumerates the values for instance type basic event specific details. +type InstanceTypeBasicEventSpecificDetails string + +const ( + // InstanceTypeEventSpecificDetails ... + InstanceTypeEventSpecificDetails InstanceTypeBasicEventSpecificDetails = "EventSpecificDetails" + // InstanceTypeJobStatus ... + InstanceTypeJobStatus InstanceTypeBasicEventSpecificDetails = "JobStatus" +) + +// PossibleInstanceTypeBasicEventSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicEventSpecificDetails const type. +func PossibleInstanceTypeBasicEventSpecificDetailsValues() []InstanceTypeBasicEventSpecificDetails { + return []InstanceTypeBasicEventSpecificDetails{InstanceTypeEventSpecificDetails, InstanceTypeJobStatus} +} + +// InstanceTypeBasicFabricSpecificCreateNetworkMappingInput enumerates the values for instance type basic +// fabric specific create network mapping input. +type InstanceTypeBasicFabricSpecificCreateNetworkMappingInput string + +const ( + // InstanceTypeAzureToAzure ... + InstanceTypeAzureToAzure InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "AzureToAzure" + // InstanceTypeFabricSpecificCreateNetworkMappingInput ... + InstanceTypeFabricSpecificCreateNetworkMappingInput InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "FabricSpecificCreateNetworkMappingInput" + // InstanceTypeVmmToAzure ... + InstanceTypeVmmToAzure InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "VmmToAzure" + // InstanceTypeVmmToVmm ... + InstanceTypeVmmToVmm InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "VmmToVmm" +) + +// PossibleInstanceTypeBasicFabricSpecificCreateNetworkMappingInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificCreateNetworkMappingInput const type. +func PossibleInstanceTypeBasicFabricSpecificCreateNetworkMappingInputValues() []InstanceTypeBasicFabricSpecificCreateNetworkMappingInput { + return []InstanceTypeBasicFabricSpecificCreateNetworkMappingInput{InstanceTypeAzureToAzure, InstanceTypeFabricSpecificCreateNetworkMappingInput, InstanceTypeVmmToAzure, InstanceTypeVmmToVmm} +} + +// InstanceTypeBasicFabricSpecificCreationInput enumerates the values for instance type basic fabric specific +// creation input. +type InstanceTypeBasicFabricSpecificCreationInput string + +const ( + // InstanceTypeAzure ... + InstanceTypeAzure InstanceTypeBasicFabricSpecificCreationInput = "Azure" + // InstanceTypeFabricSpecificCreationInput ... + InstanceTypeFabricSpecificCreationInput InstanceTypeBasicFabricSpecificCreationInput = "FabricSpecificCreationInput" + // InstanceTypeInMageRcm ... + InstanceTypeInMageRcm InstanceTypeBasicFabricSpecificCreationInput = "InMageRcm" + // InstanceTypeVMwareV2 ... + InstanceTypeVMwareV2 InstanceTypeBasicFabricSpecificCreationInput = "VMwareV2" +) + +// PossibleInstanceTypeBasicFabricSpecificCreationInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificCreationInput const type. +func PossibleInstanceTypeBasicFabricSpecificCreationInputValues() []InstanceTypeBasicFabricSpecificCreationInput { + return []InstanceTypeBasicFabricSpecificCreationInput{InstanceTypeAzure, InstanceTypeFabricSpecificCreationInput, InstanceTypeInMageRcm, InstanceTypeVMwareV2} +} + +// InstanceTypeBasicFabricSpecificDetails enumerates the values for instance type basic fabric specific +// details. +type InstanceTypeBasicFabricSpecificDetails string + +const ( + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure InstanceTypeBasicFabricSpecificDetails = "Azure" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails InstanceTypeBasicFabricSpecificDetails = "FabricSpecificDetails" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite InstanceTypeBasicFabricSpecificDetails = "HyperVSite" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicFabricSpecificDetails = "InMageRcm" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM InstanceTypeBasicFabricSpecificDetails = "VMM" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware InstanceTypeBasicFabricSpecificDetails = "VMware" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 InstanceTypeBasicFabricSpecificDetails = "VMwareV2" +) + +// PossibleInstanceTypeBasicFabricSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicFabricSpecificDetails const type. +func PossibleInstanceTypeBasicFabricSpecificDetailsValues() []InstanceTypeBasicFabricSpecificDetails { + return []InstanceTypeBasicFabricSpecificDetails{InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure, InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails, InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite, InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2} +} + +// InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput enumerates the values for instance type basic +// fabric specific update network mapping input. +type InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput string + +const ( + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "AzureToAzure" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "FabricSpecificUpdateNetworkMappingInput" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "VmmToAzure" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "VmmToVmm" +) + +// PossibleInstanceTypeBasicFabricSpecificUpdateNetworkMappingInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput const type. +func PossibleInstanceTypeBasicFabricSpecificUpdateNetworkMappingInputValues() []InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput { + return []InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput{InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm} +} + +// InstanceTypeBasicGroupTaskDetails enumerates the values for instance type basic group task details. +type InstanceTypeBasicGroupTaskDetails string + +const ( + // InstanceTypeGroupTaskDetails ... + InstanceTypeGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "GroupTaskDetails" + // InstanceTypeInlineWorkflowTaskDetails ... + InstanceTypeInlineWorkflowTaskDetails InstanceTypeBasicGroupTaskDetails = "InlineWorkflowTaskDetails" + // InstanceTypeRecoveryPlanGroupTaskDetails ... + InstanceTypeRecoveryPlanGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "RecoveryPlanGroupTaskDetails" + // InstanceTypeRecoveryPlanShutdownGroupTaskDetails ... + InstanceTypeRecoveryPlanShutdownGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "RecoveryPlanShutdownGroupTaskDetails" +) + +// PossibleInstanceTypeBasicGroupTaskDetailsValues returns an array of possible values for the InstanceTypeBasicGroupTaskDetails const type. +func PossibleInstanceTypeBasicGroupTaskDetailsValues() []InstanceTypeBasicGroupTaskDetails { + return []InstanceTypeBasicGroupTaskDetails{InstanceTypeGroupTaskDetails, InstanceTypeInlineWorkflowTaskDetails, InstanceTypeRecoveryPlanGroupTaskDetails, InstanceTypeRecoveryPlanShutdownGroupTaskDetails} +} + +// InstanceTypeBasicJobDetails enumerates the values for instance type basic job details. +type InstanceTypeBasicJobDetails string + +const ( + // InstanceTypeAsrJobDetails ... + InstanceTypeAsrJobDetails InstanceTypeBasicJobDetails = "AsrJobDetails" + // InstanceTypeExportJobDetails ... + InstanceTypeExportJobDetails InstanceTypeBasicJobDetails = "ExportJobDetails" + // InstanceTypeFailoverJobDetails ... + InstanceTypeFailoverJobDetails InstanceTypeBasicJobDetails = "FailoverJobDetails" + // InstanceTypeJobDetails ... + InstanceTypeJobDetails InstanceTypeBasicJobDetails = "JobDetails" + // InstanceTypeSwitchProtectionJobDetails ... + InstanceTypeSwitchProtectionJobDetails InstanceTypeBasicJobDetails = "SwitchProtectionJobDetails" + // InstanceTypeTestFailoverJobDetails ... + InstanceTypeTestFailoverJobDetails InstanceTypeBasicJobDetails = "TestFailoverJobDetails" +) + +// PossibleInstanceTypeBasicJobDetailsValues returns an array of possible values for the InstanceTypeBasicJobDetails const type. +func PossibleInstanceTypeBasicJobDetailsValues() []InstanceTypeBasicJobDetails { + return []InstanceTypeBasicJobDetails{InstanceTypeAsrJobDetails, InstanceTypeExportJobDetails, InstanceTypeFailoverJobDetails, InstanceTypeJobDetails, InstanceTypeSwitchProtectionJobDetails, InstanceTypeTestFailoverJobDetails} +} + +// InstanceTypeBasicMigrateProviderSpecificInput enumerates the values for instance type basic migrate provider +// specific input. +type InstanceTypeBasicMigrateProviderSpecificInput string + +const ( + // InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput ... + InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput InstanceTypeBasicMigrateProviderSpecificInput = "MigrateProviderSpecificInput" + // InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicMigrateProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicMigrateProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicMigrateProviderSpecificInput const type. +func PossibleInstanceTypeBasicMigrateProviderSpecificInputValues() []InstanceTypeBasicMigrateProviderSpecificInput { + return []InstanceTypeBasicMigrateProviderSpecificInput{InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput, InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicMigrationProviderSpecificSettings enumerates the values for instance type basic migration +// provider specific settings. +type InstanceTypeBasicMigrationProviderSpecificSettings string + +const ( + // InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings ... + InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings InstanceTypeBasicMigrationProviderSpecificSettings = "MigrationProviderSpecificSettings" + // InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt ... + InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt InstanceTypeBasicMigrationProviderSpecificSettings = "VMwareCbt" +) + +// PossibleInstanceTypeBasicMigrationProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicMigrationProviderSpecificSettings const type. +func PossibleInstanceTypeBasicMigrationProviderSpecificSettingsValues() []InstanceTypeBasicMigrationProviderSpecificSettings { + return []InstanceTypeBasicMigrationProviderSpecificSettings{InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings, InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicNetworkMappingFabricSpecificSettings enumerates the values for instance type basic network +// mapping fabric specific settings. +type InstanceTypeBasicNetworkMappingFabricSpecificSettings string + +const ( + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure InstanceTypeBasicNetworkMappingFabricSpecificSettings = "AzureToAzure" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings InstanceTypeBasicNetworkMappingFabricSpecificSettings = "NetworkMappingFabricSpecificSettings" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure InstanceTypeBasicNetworkMappingFabricSpecificSettings = "VmmToAzure" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm InstanceTypeBasicNetworkMappingFabricSpecificSettings = "VmmToVmm" +) + +// PossibleInstanceTypeBasicNetworkMappingFabricSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicNetworkMappingFabricSpecificSettings const type. +func PossibleInstanceTypeBasicNetworkMappingFabricSpecificSettingsValues() []InstanceTypeBasicNetworkMappingFabricSpecificSettings { + return []InstanceTypeBasicNetworkMappingFabricSpecificSettings{InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm} +} + +// InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput enumerates the values for instance type basic +// planned failover provider specific failover input. +type InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput string + +const ( + // InstanceTypeHyperVReplicaAzure ... + InstanceTypeHyperVReplicaAzure InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "HyperVReplicaAzure" + // InstanceTypeHyperVReplicaAzureFailback ... + InstanceTypeHyperVReplicaAzureFailback InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "HyperVReplicaAzureFailback" + // InstanceTypeInMageRcmFailback ... + InstanceTypeInMageRcmFailback InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "InMageRcmFailback" + // InstanceTypePlannedFailoverProviderSpecificFailoverInput ... + InstanceTypePlannedFailoverProviderSpecificFailoverInput InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "PlannedFailoverProviderSpecificFailoverInput" +) + +// PossibleInstanceTypeBasicPlannedFailoverProviderSpecificFailoverInputValues returns an array of possible values for the InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput const type. +func PossibleInstanceTypeBasicPlannedFailoverProviderSpecificFailoverInputValues() []InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput { + return []InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput{InstanceTypeHyperVReplicaAzure, InstanceTypeHyperVReplicaAzureFailback, InstanceTypeInMageRcmFailback, InstanceTypePlannedFailoverProviderSpecificFailoverInput} +} + +// InstanceTypeBasicPolicyProviderSpecificDetails enumerates the values for instance type basic policy provider +// specific details. +type InstanceTypeBasicPolicyProviderSpecificDetails string + +const ( + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicPolicyProviderSpecificDetails = "A2A" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplica2012" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplica2012R2" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplicaAzure" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplicaBasePolicyDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage InstanceTypeBasicPolicyProviderSpecificDetails = "InMage" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicPolicyProviderSpecificDetails = "InMageAzureV2" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails InstanceTypeBasicPolicyProviderSpecificDetails = "InMageBasePolicyDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicPolicyProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback InstanceTypeBasicPolicyProviderSpecificDetails = "InMageRcmFailback" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails InstanceTypeBasicPolicyProviderSpecificDetails = "PolicyProviderSpecificDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicPolicyProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicPolicyProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicPolicyProviderSpecificDetails const type. +func PossibleInstanceTypeBasicPolicyProviderSpecificDetailsValues() []InstanceTypeBasicPolicyProviderSpecificDetails { + return []InstanceTypeBasicPolicyProviderSpecificDetails{InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicPolicyProviderSpecificInput enumerates the values for instance type basic policy provider +// specific input. +type InstanceTypeBasicPolicyProviderSpecificInput string + +const ( + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A InstanceTypeBasicPolicyProviderSpecificInput = "A2A" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicPolicyProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplica2012" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplica2012R2" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage InstanceTypeBasicPolicyProviderSpecificInput = "InMage" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicPolicyProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicPolicyProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback InstanceTypeBasicPolicyProviderSpecificInput = "InMageRcmFailback" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput InstanceTypeBasicPolicyProviderSpecificInput = "PolicyProviderSpecificInput" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicPolicyProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicPolicyProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicPolicyProviderSpecificInput const type. +func PossibleInstanceTypeBasicPolicyProviderSpecificInputValues() []InstanceTypeBasicPolicyProviderSpecificInput { + return []InstanceTypeBasicPolicyProviderSpecificInput{InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails enumerates the values for instance type +// basic protection container mapping provider specific details. +type InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails string + +const ( + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "A2A" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "ProtectionContainerMappingProviderSpecificDetails" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails const type. +func PossibleInstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsValues() []InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails { + return []InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails{InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicProviderSpecificRecoveryPointDetails enumerates the values for instance type basic provider +// specific recovery point details. +type InstanceTypeBasicProviderSpecificRecoveryPointDetails string + +const ( + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A InstanceTypeBasicProviderSpecificRecoveryPointDetails = "A2A" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicProviderSpecificRecoveryPointDetails = "InMageAzureV2" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm InstanceTypeBasicProviderSpecificRecoveryPointDetails = "InMageRcm" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails InstanceTypeBasicProviderSpecificRecoveryPointDetails = "ProviderSpecificRecoveryPointDetails" +) + +// PossibleInstanceTypeBasicProviderSpecificRecoveryPointDetailsValues returns an array of possible values for the InstanceTypeBasicProviderSpecificRecoveryPointDetails const type. +func PossibleInstanceTypeBasicProviderSpecificRecoveryPointDetailsValues() []InstanceTypeBasicProviderSpecificRecoveryPointDetails { + return []InstanceTypeBasicProviderSpecificRecoveryPointDetails{InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails} +} + +// InstanceTypeBasicRecoveryPlanActionDetails enumerates the values for instance type basic recovery plan +// action details. +type InstanceTypeBasicRecoveryPlanActionDetails string + +const ( + // InstanceTypeAutomationRunbookActionDetails ... + InstanceTypeAutomationRunbookActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "AutomationRunbookActionDetails" + // InstanceTypeManualActionDetails ... + InstanceTypeManualActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "ManualActionDetails" + // InstanceTypeRecoveryPlanActionDetails ... + InstanceTypeRecoveryPlanActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "RecoveryPlanActionDetails" + // InstanceTypeScriptActionDetails ... + InstanceTypeScriptActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "ScriptActionDetails" +) + +// PossibleInstanceTypeBasicRecoveryPlanActionDetailsValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanActionDetails const type. +func PossibleInstanceTypeBasicRecoveryPlanActionDetailsValues() []InstanceTypeBasicRecoveryPlanActionDetails { + return []InstanceTypeBasicRecoveryPlanActionDetails{InstanceTypeAutomationRunbookActionDetails, InstanceTypeManualActionDetails, InstanceTypeRecoveryPlanActionDetails, InstanceTypeScriptActionDetails} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificDetails enumerates the values for instance type basic recovery +// plan provider specific details. +type InstanceTypeBasicRecoveryPlanProviderSpecificDetails string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificDetails = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails ... + InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails InstanceTypeBasicRecoveryPlanProviderSpecificDetails = "RecoveryPlanProviderSpecificDetails" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificDetails const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificDetailsValues() []InstanceTypeBasicRecoveryPlanProviderSpecificDetails { + return []InstanceTypeBasicRecoveryPlanProviderSpecificDetails{InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput enumerates the values for instance type basic +// recovery plan provider specific failover input. +type InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "HyperVReplicaAzure" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "HyperVReplicaAzureFailback" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMage" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageAzureV2" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageRcm" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageRcmFailback" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "RecoveryPlanProviderSpecificFailoverInput" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputValues() []InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput { + return []InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput{InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificInput enumerates the values for instance type basic recovery +// plan provider specific input. +type InstanceTypeBasicRecoveryPlanProviderSpecificInput string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificInput = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput ... + InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput InstanceTypeBasicRecoveryPlanProviderSpecificInput = "RecoveryPlanProviderSpecificInput" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificInput const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificInputValues() []InstanceTypeBasicRecoveryPlanProviderSpecificInput { + return []InstanceTypeBasicRecoveryPlanProviderSpecificInput{InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput} +} + +// InstanceTypeBasicRemoveDisksProviderSpecificInput enumerates the values for instance type basic remove disks +// provider specific input. +type InstanceTypeBasicRemoveDisksProviderSpecificInput string + +const ( + // InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A InstanceTypeBasicRemoveDisksProviderSpecificInput = "A2A" + // InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput ... + InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput InstanceTypeBasicRemoveDisksProviderSpecificInput = "RemoveDisksProviderSpecificInput" +) + +// PossibleInstanceTypeBasicRemoveDisksProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicRemoveDisksProviderSpecificInput const type. +func PossibleInstanceTypeBasicRemoveDisksProviderSpecificInputValues() []InstanceTypeBasicRemoveDisksProviderSpecificInput { + return []InstanceTypeBasicRemoveDisksProviderSpecificInput{InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput} +} + +// InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings enumerates the values for instance type +// basic replication protection intent provider specific settings. +type InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings string + +const ( + // InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A ... + InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings = "A2A" + // InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings ... + InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings = "ReplicationProtectionIntentProviderSpecificSettings" +) + +// PossibleInstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings const type. +func PossibleInstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsValues() []InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings { + return []InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings{InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A, InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings} +} + +// InstanceTypeBasicReplicationProviderSpecificContainerCreationInput enumerates the values for instance type +// basic replication provider specific container creation input. +type InstanceTypeBasicReplicationProviderSpecificContainerCreationInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "A2ACrossClusterMigration" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "ReplicationProviderSpecificContainerCreationInput" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificContainerCreationInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificContainerCreationInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificContainerCreationInputValues() []InstanceTypeBasicReplicationProviderSpecificContainerCreationInput { + return []InstanceTypeBasicReplicationProviderSpecificContainerCreationInput{InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReplicationProviderSpecificContainerMappingInput enumerates the values for instance type +// basic replication provider specific container mapping input. +type InstanceTypeBasicReplicationProviderSpecificContainerMappingInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "ReplicationProviderSpecificContainerMappingInput" + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificContainerMappingInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificContainerMappingInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificContainerMappingInputValues() []InstanceTypeBasicReplicationProviderSpecificContainerMappingInput { + return []InstanceTypeBasicReplicationProviderSpecificContainerMappingInput{InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput, InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReplicationProviderSpecificSettings enumerates the values for instance type basic +// replication provider specific settings. +type InstanceTypeBasicReplicationProviderSpecificSettings string + +const ( + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificSettings = "A2A" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration InstanceTypeBasicReplicationProviderSpecificSettings = "A2ACrossClusterMigration" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplica2012" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplica2012R2" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplicaAzure" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplicaBaseReplicationDetails" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage InstanceTypeBasicReplicationProviderSpecificSettings = "InMage" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 InstanceTypeBasicReplicationProviderSpecificSettings = "InMageAzureV2" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm InstanceTypeBasicReplicationProviderSpecificSettings = "InMageRcm" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback InstanceTypeBasicReplicationProviderSpecificSettings = "InMageRcmFailback" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings InstanceTypeBasicReplicationProviderSpecificSettings = "ReplicationProviderSpecificSettings" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificSettings const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificSettingsValues() []InstanceTypeBasicReplicationProviderSpecificSettings { + return []InstanceTypeBasicReplicationProviderSpecificSettings{InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings} +} + +// InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput enumerates the values for instance +// type basic replication provider specific update container mapping input. +type InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "InMageRcm" + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "ReplicationProviderSpecificUpdateContainerMappingInput" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputValues() []InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput { + return []InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput{InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm, InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput} +} + +// InstanceTypeBasicResyncProviderSpecificInput enumerates the values for instance type basic resync provider +// specific input. +type InstanceTypeBasicResyncProviderSpecificInput string + +const ( + // InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput ... + InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput InstanceTypeBasicResyncProviderSpecificInput = "ResyncProviderSpecificInput" + // InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicResyncProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicResyncProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicResyncProviderSpecificInput const type. +func PossibleInstanceTypeBasicResyncProviderSpecificInputValues() []InstanceTypeBasicResyncProviderSpecificInput { + return []InstanceTypeBasicResyncProviderSpecificInput{InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput, InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReverseReplicationProviderSpecificInput enumerates the values for instance type basic +// reverse replication provider specific input. +type InstanceTypeBasicReverseReplicationProviderSpecificInput string + +const ( + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A InstanceTypeBasicReverseReplicationProviderSpecificInput = "A2A" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicReverseReplicationProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMage" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageRcmFailback" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput InstanceTypeBasicReverseReplicationProviderSpecificInput = "ReverseReplicationProviderSpecificInput" +) + +// PossibleInstanceTypeBasicReverseReplicationProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicReverseReplicationProviderSpecificInput const type. +func PossibleInstanceTypeBasicReverseReplicationProviderSpecificInputValues() []InstanceTypeBasicReverseReplicationProviderSpecificInput { + return []InstanceTypeBasicReverseReplicationProviderSpecificInput{InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput} +} + +// InstanceTypeBasicSwitchProtectionProviderSpecificInput enumerates the values for instance type basic switch +// protection provider specific input. +type InstanceTypeBasicSwitchProtectionProviderSpecificInput string + +const ( + // InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A InstanceTypeBasicSwitchProtectionProviderSpecificInput = "A2A" + // InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput ... + InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput InstanceTypeBasicSwitchProtectionProviderSpecificInput = "SwitchProtectionProviderSpecificInput" +) + +// PossibleInstanceTypeBasicSwitchProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicSwitchProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicSwitchProtectionProviderSpecificInputValues() []InstanceTypeBasicSwitchProtectionProviderSpecificInput { + return []InstanceTypeBasicSwitchProtectionProviderSpecificInput{InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput} +} + +// InstanceTypeBasicTaskTypeDetails enumerates the values for instance type basic task type details. +type InstanceTypeBasicTaskTypeDetails string + +const ( + // InstanceTypeAutomationRunbookTaskDetails ... + InstanceTypeAutomationRunbookTaskDetails InstanceTypeBasicTaskTypeDetails = "AutomationRunbookTaskDetails" + // InstanceTypeConsistencyCheckTaskDetails ... + InstanceTypeConsistencyCheckTaskDetails InstanceTypeBasicTaskTypeDetails = "ConsistencyCheckTaskDetails" + // InstanceTypeFabricReplicationGroupTaskDetails ... + InstanceTypeFabricReplicationGroupTaskDetails InstanceTypeBasicTaskTypeDetails = "FabricReplicationGroupTaskDetails" + // InstanceTypeJobTaskDetails ... + InstanceTypeJobTaskDetails InstanceTypeBasicTaskTypeDetails = "JobTaskDetails" + // InstanceTypeManualActionTaskDetails ... + InstanceTypeManualActionTaskDetails InstanceTypeBasicTaskTypeDetails = "ManualActionTaskDetails" + // InstanceTypeScriptActionTaskDetails ... + InstanceTypeScriptActionTaskDetails InstanceTypeBasicTaskTypeDetails = "ScriptActionTaskDetails" + // InstanceTypeTaskTypeDetails ... + InstanceTypeTaskTypeDetails InstanceTypeBasicTaskTypeDetails = "TaskTypeDetails" + // InstanceTypeVirtualMachineTaskDetails ... + InstanceTypeVirtualMachineTaskDetails InstanceTypeBasicTaskTypeDetails = "VirtualMachineTaskDetails" + // InstanceTypeVMNicUpdatesTaskDetails ... + InstanceTypeVMNicUpdatesTaskDetails InstanceTypeBasicTaskTypeDetails = "VmNicUpdatesTaskDetails" +) + +// PossibleInstanceTypeBasicTaskTypeDetailsValues returns an array of possible values for the InstanceTypeBasicTaskTypeDetails const type. +func PossibleInstanceTypeBasicTaskTypeDetailsValues() []InstanceTypeBasicTaskTypeDetails { + return []InstanceTypeBasicTaskTypeDetails{InstanceTypeAutomationRunbookTaskDetails, InstanceTypeConsistencyCheckTaskDetails, InstanceTypeFabricReplicationGroupTaskDetails, InstanceTypeJobTaskDetails, InstanceTypeManualActionTaskDetails, InstanceTypeScriptActionTaskDetails, InstanceTypeTaskTypeDetails, InstanceTypeVirtualMachineTaskDetails, InstanceTypeVMNicUpdatesTaskDetails} +} + +// InstanceTypeBasicTestFailoverProviderSpecificInput enumerates the values for instance type basic test +// failover provider specific input. +type InstanceTypeBasicTestFailoverProviderSpecificInput string + +const ( + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A InstanceTypeBasicTestFailoverProviderSpecificInput = "A2A" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicTestFailoverProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage InstanceTypeBasicTestFailoverProviderSpecificInput = "InMage" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicTestFailoverProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicTestFailoverProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput InstanceTypeBasicTestFailoverProviderSpecificInput = "TestFailoverProviderSpecificInput" +) + +// PossibleInstanceTypeBasicTestFailoverProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicTestFailoverProviderSpecificInput const type. +func PossibleInstanceTypeBasicTestFailoverProviderSpecificInputValues() []InstanceTypeBasicTestFailoverProviderSpecificInput { + return []InstanceTypeBasicTestFailoverProviderSpecificInput{InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput} +} + +// InstanceTypeBasicTestMigrateProviderSpecificInput enumerates the values for instance type basic test migrate +// provider specific input. +type InstanceTypeBasicTestMigrateProviderSpecificInput string + +const ( + // InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput ... + InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput InstanceTypeBasicTestMigrateProviderSpecificInput = "TestMigrateProviderSpecificInput" + // InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicTestMigrateProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicTestMigrateProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicTestMigrateProviderSpecificInput const type. +func PossibleInstanceTypeBasicTestMigrateProviderSpecificInputValues() []InstanceTypeBasicTestMigrateProviderSpecificInput { + return []InstanceTypeBasicTestMigrateProviderSpecificInput{InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput, InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicUnplannedFailoverProviderSpecificInput enumerates the values for instance type basic +// unplanned failover provider specific input. +type InstanceTypeBasicUnplannedFailoverProviderSpecificInput string + +const ( + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "A2A" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMage" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "UnplannedFailoverProviderSpecificInput" +) + +// PossibleInstanceTypeBasicUnplannedFailoverProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUnplannedFailoverProviderSpecificInput const type. +func PossibleInstanceTypeBasicUnplannedFailoverProviderSpecificInputValues() []InstanceTypeBasicUnplannedFailoverProviderSpecificInput { + return []InstanceTypeBasicUnplannedFailoverProviderSpecificInput{InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput} +} + +// InstanceTypeBasicUpdateMigrationItemProviderSpecificInput enumerates the values for instance type basic +// update migration item provider specific input. +type InstanceTypeBasicUpdateMigrationItemProviderSpecificInput string + +const ( + // InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput ... + InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput InstanceTypeBasicUpdateMigrationItemProviderSpecificInput = "UpdateMigrationItemProviderSpecificInput" + // InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicUpdateMigrationItemProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicUpdateMigrationItemProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUpdateMigrationItemProviderSpecificInput const type. +func PossibleInstanceTypeBasicUpdateMigrationItemProviderSpecificInputValues() []InstanceTypeBasicUpdateMigrationItemProviderSpecificInput { + return []InstanceTypeBasicUpdateMigrationItemProviderSpecificInput{InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput, InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicUpdateReplicationProtectedItemProviderInput enumerates the values for instance type basic +// update replication protected item provider input. +type InstanceTypeBasicUpdateReplicationProtectedItemProviderInput string + +const ( + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "A2A" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "HyperVReplicaAzure" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "InMageAzureV2" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "InMageRcm" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "UpdateReplicationProtectedItemProviderInput" +) + +// PossibleInstanceTypeBasicUpdateReplicationProtectedItemProviderInputValues returns an array of possible values for the InstanceTypeBasicUpdateReplicationProtectedItemProviderInput const type. +func PossibleInstanceTypeBasicUpdateReplicationProtectedItemProviderInputValues() []InstanceTypeBasicUpdateReplicationProtectedItemProviderInput { + return []InstanceTypeBasicUpdateReplicationProtectedItemProviderInput{InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput} +} + +// LicenseType enumerates the values for license type. +type LicenseType string + +const ( + // LicenseTypeNoLicenseType ... + LicenseTypeNoLicenseType LicenseType = "NoLicenseType" + // LicenseTypeNotSpecified ... + LicenseTypeNotSpecified LicenseType = "NotSpecified" + // LicenseTypeWindowsServer ... + LicenseTypeWindowsServer LicenseType = "WindowsServer" +) + +// PossibleLicenseTypeValues returns an array of possible values for the LicenseType const type. +func PossibleLicenseTypeValues() []LicenseType { + return []LicenseType{LicenseTypeNoLicenseType, LicenseTypeNotSpecified, LicenseTypeWindowsServer} +} + +// MigrationItemOperation enumerates the values for migration item operation. +type MigrationItemOperation string + +const ( + // DisableMigration ... + DisableMigration MigrationItemOperation = "DisableMigration" + // Migrate ... + Migrate MigrationItemOperation = "Migrate" + // StartResync ... + StartResync MigrationItemOperation = "StartResync" + // TestMigrate ... + TestMigrate MigrationItemOperation = "TestMigrate" + // TestMigrateCleanup ... + TestMigrateCleanup MigrationItemOperation = "TestMigrateCleanup" +) + +// PossibleMigrationItemOperationValues returns an array of possible values for the MigrationItemOperation const type. +func PossibleMigrationItemOperationValues() []MigrationItemOperation { + return []MigrationItemOperation{DisableMigration, Migrate, StartResync, TestMigrate, TestMigrateCleanup} +} + +// MigrationRecoveryPointType enumerates the values for migration recovery point type. +type MigrationRecoveryPointType string + +const ( + // MigrationRecoveryPointTypeApplicationConsistent ... + MigrationRecoveryPointTypeApplicationConsistent MigrationRecoveryPointType = "ApplicationConsistent" + // MigrationRecoveryPointTypeCrashConsistent ... + MigrationRecoveryPointTypeCrashConsistent MigrationRecoveryPointType = "CrashConsistent" + // MigrationRecoveryPointTypeNotSpecified ... + MigrationRecoveryPointTypeNotSpecified MigrationRecoveryPointType = "NotSpecified" +) + +// PossibleMigrationRecoveryPointTypeValues returns an array of possible values for the MigrationRecoveryPointType const type. +func PossibleMigrationRecoveryPointTypeValues() []MigrationRecoveryPointType { + return []MigrationRecoveryPointType{MigrationRecoveryPointTypeApplicationConsistent, MigrationRecoveryPointTypeCrashConsistent, MigrationRecoveryPointTypeNotSpecified} +} + +// MigrationState enumerates the values for migration state. +type MigrationState string + +const ( + // MigrationStateDisableMigrationFailed ... + MigrationStateDisableMigrationFailed MigrationState = "DisableMigrationFailed" + // MigrationStateDisableMigrationInProgress ... + MigrationStateDisableMigrationInProgress MigrationState = "DisableMigrationInProgress" + // MigrationStateEnableMigrationFailed ... + MigrationStateEnableMigrationFailed MigrationState = "EnableMigrationFailed" + // MigrationStateEnableMigrationInProgress ... + MigrationStateEnableMigrationInProgress MigrationState = "EnableMigrationInProgress" + // MigrationStateInitialSeedingFailed ... + MigrationStateInitialSeedingFailed MigrationState = "InitialSeedingFailed" + // MigrationStateInitialSeedingInProgress ... + MigrationStateInitialSeedingInProgress MigrationState = "InitialSeedingInProgress" + // MigrationStateMigrationFailed ... + MigrationStateMigrationFailed MigrationState = "MigrationFailed" + // MigrationStateMigrationInProgress ... + MigrationStateMigrationInProgress MigrationState = "MigrationInProgress" + // MigrationStateMigrationSucceeded ... + MigrationStateMigrationSucceeded MigrationState = "MigrationSucceeded" + // MigrationStateNone ... + MigrationStateNone MigrationState = "None" + // MigrationStateReplicating ... + MigrationStateReplicating MigrationState = "Replicating" +) + +// PossibleMigrationStateValues returns an array of possible values for the MigrationState const type. +func PossibleMigrationStateValues() []MigrationState { + return []MigrationState{MigrationStateDisableMigrationFailed, MigrationStateDisableMigrationInProgress, MigrationStateEnableMigrationFailed, MigrationStateEnableMigrationInProgress, MigrationStateInitialSeedingFailed, MigrationStateInitialSeedingInProgress, MigrationStateMigrationFailed, MigrationStateMigrationInProgress, MigrationStateMigrationSucceeded, MigrationStateNone, MigrationStateReplicating} +} + +// MobilityAgentUpgradeState enumerates the values for mobility agent upgrade state. +type MobilityAgentUpgradeState string + +const ( + // MobilityAgentUpgradeStateCommit ... + MobilityAgentUpgradeStateCommit MobilityAgentUpgradeState = "Commit" + // MobilityAgentUpgradeStateCompleted ... + MobilityAgentUpgradeStateCompleted MobilityAgentUpgradeState = "Completed" + // MobilityAgentUpgradeStateNone ... + MobilityAgentUpgradeStateNone MobilityAgentUpgradeState = "None" + // MobilityAgentUpgradeStateStarted ... + MobilityAgentUpgradeStateStarted MobilityAgentUpgradeState = "Started" +) + +// PossibleMobilityAgentUpgradeStateValues returns an array of possible values for the MobilityAgentUpgradeState const type. +func PossibleMobilityAgentUpgradeStateValues() []MobilityAgentUpgradeState { + return []MobilityAgentUpgradeState{MobilityAgentUpgradeStateCommit, MobilityAgentUpgradeStateCompleted, MobilityAgentUpgradeStateNone, MobilityAgentUpgradeStateStarted} +} + +// MultiVMGroupCreateOption enumerates the values for multi vm group create option. +type MultiVMGroupCreateOption string + +const ( + // AutoCreated ... + AutoCreated MultiVMGroupCreateOption = "AutoCreated" + // UserSpecified ... + UserSpecified MultiVMGroupCreateOption = "UserSpecified" +) + +// PossibleMultiVMGroupCreateOptionValues returns an array of possible values for the MultiVMGroupCreateOption const type. +func PossibleMultiVMGroupCreateOptionValues() []MultiVMGroupCreateOption { + return []MultiVMGroupCreateOption{AutoCreated, UserSpecified} +} + +// MultiVMSyncPointOption enumerates the values for multi vm sync point option. +type MultiVMSyncPointOption string + +const ( + // UseMultiVMSyncRecoveryPoint ... + UseMultiVMSyncRecoveryPoint MultiVMSyncPointOption = "UseMultiVmSyncRecoveryPoint" + // UsePerVMRecoveryPoint ... + UsePerVMRecoveryPoint MultiVMSyncPointOption = "UsePerVmRecoveryPoint" +) + +// PossibleMultiVMSyncPointOptionValues returns an array of possible values for the MultiVMSyncPointOption const type. +func PossibleMultiVMSyncPointOptionValues() []MultiVMSyncPointOption { + return []MultiVMSyncPointOption{UseMultiVMSyncRecoveryPoint, UsePerVMRecoveryPoint} +} + +// PossibleOperationsDirections enumerates the values for possible operations directions. +type PossibleOperationsDirections string + +const ( + // PrimaryToRecovery ... + PrimaryToRecovery PossibleOperationsDirections = "PrimaryToRecovery" + // RecoveryToPrimary ... + RecoveryToPrimary PossibleOperationsDirections = "RecoveryToPrimary" +) + +// PossiblePossibleOperationsDirectionsValues returns an array of possible values for the PossibleOperationsDirections const type. +func PossiblePossibleOperationsDirectionsValues() []PossibleOperationsDirections { + return []PossibleOperationsDirections{PrimaryToRecovery, RecoveryToPrimary} +} + +// PresenceStatus enumerates the values for presence status. +type PresenceStatus string + +const ( + // PresenceStatusNotPresent ... + PresenceStatusNotPresent PresenceStatus = "NotPresent" + // PresenceStatusPresent ... + PresenceStatusPresent PresenceStatus = "Present" + // PresenceStatusUnknown ... + PresenceStatusUnknown PresenceStatus = "Unknown" +) + +// PossiblePresenceStatusValues returns an array of possible values for the PresenceStatus const type. +func PossiblePresenceStatusValues() []PresenceStatus { + return []PresenceStatus{PresenceStatusNotPresent, PresenceStatusPresent, PresenceStatusUnknown} +} + +// ProtectionHealth enumerates the values for protection health. +type ProtectionHealth string + +const ( + // ProtectionHealthCritical ... + ProtectionHealthCritical ProtectionHealth = "Critical" + // ProtectionHealthNone ... + ProtectionHealthNone ProtectionHealth = "None" + // ProtectionHealthNormal ... + ProtectionHealthNormal ProtectionHealth = "Normal" + // ProtectionHealthWarning ... + ProtectionHealthWarning ProtectionHealth = "Warning" +) + +// PossibleProtectionHealthValues returns an array of possible values for the ProtectionHealth const type. +func PossibleProtectionHealthValues() []ProtectionHealth { + return []ProtectionHealth{ProtectionHealthCritical, ProtectionHealthNone, ProtectionHealthNormal, ProtectionHealthWarning} +} + +// RcmComponentStatus enumerates the values for rcm component status. +type RcmComponentStatus string + +const ( + // RcmComponentStatusCritical ... + RcmComponentStatusCritical RcmComponentStatus = "Critical" + // RcmComponentStatusHealthy ... + RcmComponentStatusHealthy RcmComponentStatus = "Healthy" + // RcmComponentStatusUnknown ... + RcmComponentStatusUnknown RcmComponentStatus = "Unknown" + // RcmComponentStatusWarning ... + RcmComponentStatusWarning RcmComponentStatus = "Warning" +) + +// PossibleRcmComponentStatusValues returns an array of possible values for the RcmComponentStatus const type. +func PossibleRcmComponentStatusValues() []RcmComponentStatus { + return []RcmComponentStatus{RcmComponentStatusCritical, RcmComponentStatusHealthy, RcmComponentStatusUnknown, RcmComponentStatusWarning} +} + +// RecoveryPlanActionLocation enumerates the values for recovery plan action location. +type RecoveryPlanActionLocation string + +const ( + // Primary ... + Primary RecoveryPlanActionLocation = "Primary" + // Recovery ... + Recovery RecoveryPlanActionLocation = "Recovery" +) + +// PossibleRecoveryPlanActionLocationValues returns an array of possible values for the RecoveryPlanActionLocation const type. +func PossibleRecoveryPlanActionLocationValues() []RecoveryPlanActionLocation { + return []RecoveryPlanActionLocation{Primary, Recovery} +} + +// RecoveryPlanGroupType enumerates the values for recovery plan group type. +type RecoveryPlanGroupType string + +const ( + // Boot ... + Boot RecoveryPlanGroupType = "Boot" + // Failover ... + Failover RecoveryPlanGroupType = "Failover" + // Shutdown ... + Shutdown RecoveryPlanGroupType = "Shutdown" +) + +// PossibleRecoveryPlanGroupTypeValues returns an array of possible values for the RecoveryPlanGroupType const type. +func PossibleRecoveryPlanGroupTypeValues() []RecoveryPlanGroupType { + return []RecoveryPlanGroupType{Boot, Failover, Shutdown} +} + +// RecoveryPlanPointType enumerates the values for recovery plan point type. +type RecoveryPlanPointType string + +const ( + // RecoveryPlanPointTypeLatest ... + RecoveryPlanPointTypeLatest RecoveryPlanPointType = "Latest" + // RecoveryPlanPointTypeLatestApplicationConsistent ... + RecoveryPlanPointTypeLatestApplicationConsistent RecoveryPlanPointType = "LatestApplicationConsistent" + // RecoveryPlanPointTypeLatestCrashConsistent ... + RecoveryPlanPointTypeLatestCrashConsistent RecoveryPlanPointType = "LatestCrashConsistent" + // RecoveryPlanPointTypeLatestProcessed ... + RecoveryPlanPointTypeLatestProcessed RecoveryPlanPointType = "LatestProcessed" +) + +// PossibleRecoveryPlanPointTypeValues returns an array of possible values for the RecoveryPlanPointType const type. +func PossibleRecoveryPlanPointTypeValues() []RecoveryPlanPointType { + return []RecoveryPlanPointType{RecoveryPlanPointTypeLatest, RecoveryPlanPointTypeLatestApplicationConsistent, RecoveryPlanPointTypeLatestCrashConsistent, RecoveryPlanPointTypeLatestProcessed} +} + +// RecoveryPointSyncType enumerates the values for recovery point sync type. +type RecoveryPointSyncType string + +const ( + // MultiVMSyncRecoveryPoint ... + MultiVMSyncRecoveryPoint RecoveryPointSyncType = "MultiVmSyncRecoveryPoint" + // PerVMRecoveryPoint ... + PerVMRecoveryPoint RecoveryPointSyncType = "PerVmRecoveryPoint" +) + +// PossibleRecoveryPointSyncTypeValues returns an array of possible values for the RecoveryPointSyncType const type. +func PossibleRecoveryPointSyncTypeValues() []RecoveryPointSyncType { + return []RecoveryPointSyncType{MultiVMSyncRecoveryPoint, PerVMRecoveryPoint} +} + +// RecoveryPointType enumerates the values for recovery point type. +type RecoveryPointType string + +const ( + // Custom ... + Custom RecoveryPointType = "Custom" + // LatestTag ... + LatestTag RecoveryPointType = "LatestTag" + // LatestTime ... + LatestTime RecoveryPointType = "LatestTime" +) + +// PossibleRecoveryPointTypeValues returns an array of possible values for the RecoveryPointType const type. +func PossibleRecoveryPointTypeValues() []RecoveryPointType { + return []RecoveryPointType{Custom, LatestTag, LatestTime} +} + +// ReplicationProtectedItemOperation enumerates the values for replication protected item operation. +type ReplicationProtectedItemOperation string + +const ( + // CancelFailover ... + CancelFailover ReplicationProtectedItemOperation = "CancelFailover" + // ChangePit ... + ChangePit ReplicationProtectedItemOperation = "ChangePit" + // Commit ... + Commit ReplicationProtectedItemOperation = "Commit" + // CompleteMigration ... + CompleteMigration ReplicationProtectedItemOperation = "CompleteMigration" + // DisableProtection ... + DisableProtection ReplicationProtectedItemOperation = "DisableProtection" + // Failback ... + Failback ReplicationProtectedItemOperation = "Failback" + // FinalizeFailback ... + FinalizeFailback ReplicationProtectedItemOperation = "FinalizeFailback" + // PlannedFailover ... + PlannedFailover ReplicationProtectedItemOperation = "PlannedFailover" + // RepairReplication ... + RepairReplication ReplicationProtectedItemOperation = "RepairReplication" + // ReverseReplicate ... + ReverseReplicate ReplicationProtectedItemOperation = "ReverseReplicate" + // SwitchProtection ... + SwitchProtection ReplicationProtectedItemOperation = "SwitchProtection" + // TestFailover ... + TestFailover ReplicationProtectedItemOperation = "TestFailover" + // TestFailoverCleanup ... + TestFailoverCleanup ReplicationProtectedItemOperation = "TestFailoverCleanup" + // UnplannedFailover ... + UnplannedFailover ReplicationProtectedItemOperation = "UnplannedFailover" +) + +// PossibleReplicationProtectedItemOperationValues returns an array of possible values for the ReplicationProtectedItemOperation const type. +func PossibleReplicationProtectedItemOperationValues() []ReplicationProtectedItemOperation { + return []ReplicationProtectedItemOperation{CancelFailover, ChangePit, Commit, CompleteMigration, DisableProtection, Failback, FinalizeFailback, PlannedFailover, RepairReplication, ReverseReplicate, SwitchProtection, TestFailover, TestFailoverCleanup, UnplannedFailover} +} + +// ResourceType enumerates the values for resource type. +type ResourceType string + +const ( + // ResourceTypeExisting ... + ResourceTypeExisting ResourceType = "Existing" + // ResourceTypeNew ... + ResourceTypeNew ResourceType = "New" + // ResourceTypeProtectionProfileCustomDetails ... + ResourceTypeProtectionProfileCustomDetails ResourceType = "ProtectionProfileCustomDetails" +) + +// PossibleResourceTypeValues returns an array of possible values for the ResourceType const type. +func PossibleResourceTypeValues() []ResourceType { + return []ResourceType{ResourceTypeExisting, ResourceTypeNew, ResourceTypeProtectionProfileCustomDetails} +} + +// ResourceTypeBasicRecoveryAvailabilitySetCustomDetails enumerates the values for resource type basic recovery +// availability set custom details. +type ResourceTypeBasicRecoveryAvailabilitySetCustomDetails string + +const ( + // ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryAvailabilitySetCustomDetails = "Existing" + // ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails ... + ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails ResourceTypeBasicRecoveryAvailabilitySetCustomDetails = "RecoveryAvailabilitySetCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryAvailabilitySetCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryAvailabilitySetCustomDetails const type. +func PossibleResourceTypeBasicRecoveryAvailabilitySetCustomDetailsValues() []ResourceTypeBasicRecoveryAvailabilitySetCustomDetails { + return []ResourceTypeBasicRecoveryAvailabilitySetCustomDetails{ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails} +} + +// ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails enumerates the values for resource type basic +// recovery proximity placement group custom details. +type ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails string + +const ( + // ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails = "Existing" + // ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails ... + ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails = "RecoveryProximityPlacementGroupCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails const type. +func PossibleResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsValues() []ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails { + return []ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails{ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails} +} + +// ResourceTypeBasicRecoveryResourceGroupCustomDetails enumerates the values for resource type basic recovery +// resource group custom details. +type ResourceTypeBasicRecoveryResourceGroupCustomDetails string + +const ( + // ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryResourceGroupCustomDetails = "Existing" + // ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails ... + ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails ResourceTypeBasicRecoveryResourceGroupCustomDetails = "RecoveryResourceGroupCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryResourceGroupCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryResourceGroupCustomDetails const type. +func PossibleResourceTypeBasicRecoveryResourceGroupCustomDetailsValues() []ResourceTypeBasicRecoveryResourceGroupCustomDetails { + return []ResourceTypeBasicRecoveryResourceGroupCustomDetails{ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails} +} + +// ResourceTypeBasicRecoveryVirtualNetworkCustomDetails enumerates the values for resource type basic recovery +// virtual network custom details. +type ResourceTypeBasicRecoveryVirtualNetworkCustomDetails string + +const ( + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "Existing" + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "New" + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "RecoveryVirtualNetworkCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryVirtualNetworkCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryVirtualNetworkCustomDetails const type. +func PossibleResourceTypeBasicRecoveryVirtualNetworkCustomDetailsValues() []ResourceTypeBasicRecoveryVirtualNetworkCustomDetails { + return []ResourceTypeBasicRecoveryVirtualNetworkCustomDetails{ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew, ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails} +} + +// ResourceTypeBasicStorageAccountCustomDetails enumerates the values for resource type basic storage account +// custom details. +type ResourceTypeBasicStorageAccountCustomDetails string + +const ( + // ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting ... + ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting ResourceTypeBasicStorageAccountCustomDetails = "Existing" + // ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails ... + ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails ResourceTypeBasicStorageAccountCustomDetails = "StorageAccountCustomDetails" +) + +// PossibleResourceTypeBasicStorageAccountCustomDetailsValues returns an array of possible values for the ResourceTypeBasicStorageAccountCustomDetails const type. +func PossibleResourceTypeBasicStorageAccountCustomDetailsValues() []ResourceTypeBasicStorageAccountCustomDetails { + return []ResourceTypeBasicStorageAccountCustomDetails{ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting, ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails} +} + +// ResyncState enumerates the values for resync state. +type ResyncState string + +const ( + // ResyncStateNone ... + ResyncStateNone ResyncState = "None" + // ResyncStatePreparedForResynchronization ... + ResyncStatePreparedForResynchronization ResyncState = "PreparedForResynchronization" + // ResyncStateStartedResynchronization ... + ResyncStateStartedResynchronization ResyncState = "StartedResynchronization" +) + +// PossibleResyncStateValues returns an array of possible values for the ResyncState const type. +func PossibleResyncStateValues() []ResyncState { + return []ResyncState{ResyncStateNone, ResyncStatePreparedForResynchronization, ResyncStateStartedResynchronization} +} + +// RpInMageRecoveryPointType enumerates the values for rp in mage recovery point type. +type RpInMageRecoveryPointType string + +const ( + // RpInMageRecoveryPointTypeCustom ... + RpInMageRecoveryPointTypeCustom RpInMageRecoveryPointType = "Custom" + // RpInMageRecoveryPointTypeLatestTag ... + RpInMageRecoveryPointTypeLatestTag RpInMageRecoveryPointType = "LatestTag" + // RpInMageRecoveryPointTypeLatestTime ... + RpInMageRecoveryPointTypeLatestTime RpInMageRecoveryPointType = "LatestTime" +) + +// PossibleRpInMageRecoveryPointTypeValues returns an array of possible values for the RpInMageRecoveryPointType const type. +func PossibleRpInMageRecoveryPointTypeValues() []RpInMageRecoveryPointType { + return []RpInMageRecoveryPointType{RpInMageRecoveryPointTypeCustom, RpInMageRecoveryPointTypeLatestTag, RpInMageRecoveryPointTypeLatestTime} +} + +// SetMultiVMSyncStatus enumerates the values for set multi vm sync status. +type SetMultiVMSyncStatus string + +const ( + // Disable ... + Disable SetMultiVMSyncStatus = "Disable" + // Enable ... + Enable SetMultiVMSyncStatus = "Enable" +) + +// PossibleSetMultiVMSyncStatusValues returns an array of possible values for the SetMultiVMSyncStatus const type. +func PossibleSetMultiVMSyncStatusValues() []SetMultiVMSyncStatus { + return []SetMultiVMSyncStatus{Disable, Enable} +} + +// Severity enumerates the values for severity. +type Severity string + +const ( + // Error ... + Error Severity = "Error" + // Info ... + Info Severity = "Info" + // NONE ... + NONE Severity = "NONE" + // Warning ... + Warning Severity = "Warning" +) + +// PossibleSeverityValues returns an array of possible values for the Severity const type. +func PossibleSeverityValues() []Severity { + return []Severity{Error, Info, NONE, Warning} +} + +// SourceSiteOperations enumerates the values for source site operations. +type SourceSiteOperations string + +const ( + // NotRequired ... + NotRequired SourceSiteOperations = "NotRequired" + // Required ... + Required SourceSiteOperations = "Required" +) + +// PossibleSourceSiteOperationsValues returns an array of possible values for the SourceSiteOperations const type. +func PossibleSourceSiteOperationsValues() []SourceSiteOperations { + return []SourceSiteOperations{NotRequired, Required} +} + +// SQLServerLicenseType enumerates the values for sql server license type. +type SQLServerLicenseType string + +const ( + // SQLServerLicenseTypeAHUB ... + SQLServerLicenseTypeAHUB SQLServerLicenseType = "AHUB" + // SQLServerLicenseTypeNoLicenseType ... + SQLServerLicenseTypeNoLicenseType SQLServerLicenseType = "NoLicenseType" + // SQLServerLicenseTypeNotSpecified ... + SQLServerLicenseTypeNotSpecified SQLServerLicenseType = "NotSpecified" + // SQLServerLicenseTypePAYG ... + SQLServerLicenseTypePAYG SQLServerLicenseType = "PAYG" +) + +// PossibleSQLServerLicenseTypeValues returns an array of possible values for the SQLServerLicenseType const type. +func PossibleSQLServerLicenseTypeValues() []SQLServerLicenseType { + return []SQLServerLicenseType{SQLServerLicenseTypeAHUB, SQLServerLicenseTypeNoLicenseType, SQLServerLicenseTypeNotSpecified, SQLServerLicenseTypePAYG} +} + +// TestMigrationState enumerates the values for test migration state. +type TestMigrationState string + +const ( + // TestMigrationStateNone ... + TestMigrationStateNone TestMigrationState = "None" + // TestMigrationStateTestMigrationCleanupInProgress ... + TestMigrationStateTestMigrationCleanupInProgress TestMigrationState = "TestMigrationCleanupInProgress" + // TestMigrationStateTestMigrationFailed ... + TestMigrationStateTestMigrationFailed TestMigrationState = "TestMigrationFailed" + // TestMigrationStateTestMigrationInProgress ... + TestMigrationStateTestMigrationInProgress TestMigrationState = "TestMigrationInProgress" + // TestMigrationStateTestMigrationSucceeded ... + TestMigrationStateTestMigrationSucceeded TestMigrationState = "TestMigrationSucceeded" +) + +// PossibleTestMigrationStateValues returns an array of possible values for the TestMigrationState const type. +func PossibleTestMigrationStateValues() []TestMigrationState { + return []TestMigrationState{TestMigrationStateNone, TestMigrationStateTestMigrationCleanupInProgress, TestMigrationStateTestMigrationFailed, TestMigrationStateTestMigrationInProgress, TestMigrationStateTestMigrationSucceeded} +} + +// VMEncryptionType enumerates the values for vm encryption type. +type VMEncryptionType string + +const ( + // NotEncrypted ... + NotEncrypted VMEncryptionType = "NotEncrypted" + // OnePassEncrypted ... + OnePassEncrypted VMEncryptionType = "OnePassEncrypted" + // TwoPassEncrypted ... + TwoPassEncrypted VMEncryptionType = "TwoPassEncrypted" +) + +// PossibleVMEncryptionTypeValues returns an array of possible values for the VMEncryptionType const type. +func PossibleVMEncryptionTypeValues() []VMEncryptionType { + return []VMEncryptionType{NotEncrypted, OnePassEncrypted, TwoPassEncrypted} +} + +// VMReplicationProgressHealth enumerates the values for vm replication progress health. +type VMReplicationProgressHealth string + +const ( + // VMReplicationProgressHealthInProgress ... + VMReplicationProgressHealthInProgress VMReplicationProgressHealth = "InProgress" + // VMReplicationProgressHealthNone ... + VMReplicationProgressHealthNone VMReplicationProgressHealth = "None" + // VMReplicationProgressHealthNoProgress ... + VMReplicationProgressHealthNoProgress VMReplicationProgressHealth = "NoProgress" + // VMReplicationProgressHealthSlowProgress ... + VMReplicationProgressHealthSlowProgress VMReplicationProgressHealth = "SlowProgress" +) + +// PossibleVMReplicationProgressHealthValues returns an array of possible values for the VMReplicationProgressHealth const type. +func PossibleVMReplicationProgressHealthValues() []VMReplicationProgressHealth { + return []VMReplicationProgressHealth{VMReplicationProgressHealthInProgress, VMReplicationProgressHealthNone, VMReplicationProgressHealthNoProgress, VMReplicationProgressHealthSlowProgress} +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/migrationrecoverypoints.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/migrationrecoverypoints.go new file mode 100644 index 000000000000..1b32b49a5642 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/migrationrecoverypoints.go @@ -0,0 +1,236 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// MigrationRecoveryPointsClient is the client for the MigrationRecoveryPoints methods of the Siterecovery service. +type MigrationRecoveryPointsClient struct { + BaseClient +} + +// NewMigrationRecoveryPointsClient creates an instance of the MigrationRecoveryPointsClient client. +func NewMigrationRecoveryPointsClient(subscriptionID string, resourceGroupName string, resourceName string) MigrationRecoveryPointsClient { + return NewMigrationRecoveryPointsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewMigrationRecoveryPointsClientWithBaseURI creates an instance of the MigrationRecoveryPointsClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewMigrationRecoveryPointsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) MigrationRecoveryPointsClient { + return MigrationRecoveryPointsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get sends the get request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// migrationRecoveryPointName - the migration recovery point name. +func (client MigrationRecoveryPointsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (result MigrationRecoveryPoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, migrationItemName, migrationRecoveryPointName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client MigrationRecoveryPointsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "migrationRecoveryPointName": autorest.Encode("path", migrationRecoveryPointName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints/{migrationRecoveryPointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client MigrationRecoveryPointsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client MigrationRecoveryPointsClient) GetResponder(resp *http.Response) (result MigrationRecoveryPoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationMigrationItems sends the list by replication migration items request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItems(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationRecoveryPointCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.ListByReplicationMigrationItems") + defer func() { + sc := -1 + if result.mrpc.Response.Response != nil { + sc = result.mrpc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationMigrationItemsNextResults + req, err := client.ListByReplicationMigrationItemsPreparer(ctx, fabricName, protectionContainerName, migrationItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationMigrationItemsSender(req) + if err != nil { + result.mrpc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", resp, "Failure sending request") + return + } + + result.mrpc, err = client.ListByReplicationMigrationItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", resp, "Failure responding to request") + return + } + if result.mrpc.hasNextLink() && result.mrpc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationMigrationItemsPreparer prepares the ListByReplicationMigrationItems request. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationMigrationItemsSender sends the ListByReplicationMigrationItems request. The method will close the +// http.Response Body if it receives an error. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationMigrationItemsResponder handles the response to the ListByReplicationMigrationItems request. The method always +// closes the http.Response Body. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsResponder(resp *http.Response) (result MigrationRecoveryPointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationMigrationItemsNextResults retrieves the next set of results, if any. +func (client MigrationRecoveryPointsClient) listByReplicationMigrationItemsNextResults(ctx context.Context, lastResults MigrationRecoveryPointCollection) (result MigrationRecoveryPointCollection, err error) { + req, err := lastResults.migrationRecoveryPointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationMigrationItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationMigrationItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationMigrationItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationRecoveryPointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.ListByReplicationMigrationItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationMigrationItems(ctx, fabricName, protectionContainerName, migrationItemName) + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/models.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/models.go new file mode 100644 index 000000000000..a560cc322f86 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/models.go @@ -0,0 +1,31979 @@ +package siterecovery + +// 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. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-02-10/siterecovery" + +// A2AAddDisksInput a2A add disk(s) input. +type A2AAddDisksInput struct { + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeAddDisksProviderSpecificInput', 'InstanceTypeA2A' + InstanceType InstanceType `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AAddDisksInput. +func (aadi A2AAddDisksInput) MarshalJSON() ([]byte, error) { + aadi.InstanceType = InstanceTypeA2A + objectMap := make(map[string]interface{}) + if aadi.VMDisks != nil { + objectMap["vmDisks"] = aadi.VMDisks + } + if aadi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aadi.VMManagedDisks + } + if aadi.InstanceType != "" { + objectMap["instanceType"] = aadi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AAddDisksInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsA2AAddDisksInput() (*A2AAddDisksInput, bool) { + return &aadi, true +} + +// AsAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsBasicAddDisksProviderSpecificInput() (BasicAddDisksProviderSpecificInput, bool) { + return &aadi, true +} + +// A2AApplyRecoveryPointInput applyRecoveryPoint input specific to A2A provider. +type A2AApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + aarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aarpi.InstanceType != "" { + objectMap["instanceType"] = aarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return &aarpi, true +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &aarpi, true +} + +// A2AContainerCreationInput a2A cloud creation input. +type A2AContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) MarshalJSON() ([]byte, error) { + acci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acci.InstanceType != "" { + objectMap["instanceType"] = acci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return &acci, true +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &acci, true +} + +// A2AContainerMappingInput a2A container mapping input. +type A2AContainerMappingInput struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) MarshalJSON() ([]byte, error) { + acmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acmi.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = acmi.AgentAutoUpdateStatus + } + if acmi.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = acmi.AutomationAccountArmID + } + if acmi.InstanceType != "" { + objectMap["instanceType"] = acmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return &acmi, true +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &acmi, true +} + +// A2ACreateProtectionIntentInput a2A create protection intent input. +type A2ACreateProtectionIntentInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryLocation - The primary location for the virtual machine. + PrimaryLocation *string `json:"primaryLocation,omitempty"` + // RecoveryLocation - The recovery location for the virtual machine. + RecoveryLocation *string `json:"recoveryLocation,omitempty"` + // RecoverySubscriptionID - The recovery subscription Id of the virtual machine. + RecoverySubscriptionID *string `json:"recoverySubscriptionId,omitempty"` + // RecoveryAvailabilityType - The recovery availability type of the virtual machine. Possible values include: 'Single', 'AvailabilitySet', 'AvailabilityZone' + RecoveryAvailabilityType A2ARecoveryAvailabilityType `json:"recoveryAvailabilityType,omitempty"` + // ProtectionProfileCustomInput - The protection profile custom inputs. + ProtectionProfileCustomInput BasicProtectionProfileCustomDetails `json:"protectionProfileCustomInput,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` + // RecoveryAvailabilitySetCustomInput - The recovery availability set input. + RecoveryAvailabilitySetCustomInput BasicRecoveryAvailabilitySetCustomDetails `json:"recoveryAvailabilitySetCustomInput,omitempty"` + // RecoveryVirtualNetworkCustomInput - The recovery virtual network input. + RecoveryVirtualNetworkCustomInput BasicRecoveryVirtualNetworkCustomDetails `json:"recoveryVirtualNetworkCustomInput,omitempty"` + // RecoveryProximityPlacementGroupCustomInput - The recovery proximity placement group custom input. + RecoveryProximityPlacementGroupCustomInput BasicRecoveryProximityPlacementGroupCustomDetails `json:"recoveryProximityPlacementGroupCustomInput,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // VMDisks - The list of vm disk inputs. + VMDisks *[]A2AProtectionIntentDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk inputs. + VMManagedDisks *[]A2AProtectionIntentManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccount - The boot diagnostic storage account. + RecoveryBootDiagStorageAccount BasicStorageAccountCustomDetails `json:"recoveryBootDiagStorageAccount,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails', 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) MarshalJSON() ([]byte, error) { + acpii.InstanceType = InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acpii.FabricObjectID != nil { + objectMap["fabricObjectId"] = acpii.FabricObjectID + } + if acpii.PrimaryLocation != nil { + objectMap["primaryLocation"] = acpii.PrimaryLocation + } + if acpii.RecoveryLocation != nil { + objectMap["recoveryLocation"] = acpii.RecoveryLocation + } + if acpii.RecoverySubscriptionID != nil { + objectMap["recoverySubscriptionId"] = acpii.RecoverySubscriptionID + } + if acpii.RecoveryAvailabilityType != "" { + objectMap["recoveryAvailabilityType"] = acpii.RecoveryAvailabilityType + } + objectMap["protectionProfileCustomInput"] = acpii.ProtectionProfileCustomInput + if acpii.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = acpii.RecoveryResourceGroupID + } + objectMap["primaryStagingStorageAccountCustomInput"] = acpii.PrimaryStagingStorageAccountCustomInput + objectMap["recoveryAvailabilitySetCustomInput"] = acpii.RecoveryAvailabilitySetCustomInput + objectMap["recoveryVirtualNetworkCustomInput"] = acpii.RecoveryVirtualNetworkCustomInput + objectMap["recoveryProximityPlacementGroupCustomInput"] = acpii.RecoveryProximityPlacementGroupCustomInput + if acpii.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = acpii.AutoProtectionOfDataDisk + } + if acpii.VMDisks != nil { + objectMap["vmDisks"] = acpii.VMDisks + } + if acpii.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = acpii.VMManagedDisks + } + if acpii.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = acpii.MultiVMGroupName + } + if acpii.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = acpii.MultiVMGroupID + } + objectMap["recoveryBootDiagStorageAccount"] = acpii.RecoveryBootDiagStorageAccount + if acpii.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = acpii.DiskEncryptionInfo + } + if acpii.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = acpii.RecoveryAvailabilityZone + } + if acpii.InstanceType != "" { + objectMap["instanceType"] = acpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACreateProtectionIntentInput is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) { + return &acpii, true +} + +// AsCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsBasicCreateProtectionIntentProviderSpecificDetails() (BasicCreateProtectionIntentProviderSpecificDetails, bool) { + return &acpii, true +} + +// UnmarshalJSON is the custom unmarshaler for A2ACreateProtectionIntentInput struct. +func (acpii *A2ACreateProtectionIntentInput) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "fabricObjectId": + if v != nil { + var fabricObjectID string + err = json.Unmarshal(*v, &fabricObjectID) + if err != nil { + return err + } + acpii.FabricObjectID = &fabricObjectID + } + case "primaryLocation": + if v != nil { + var primaryLocation string + err = json.Unmarshal(*v, &primaryLocation) + if err != nil { + return err + } + acpii.PrimaryLocation = &primaryLocation + } + case "recoveryLocation": + if v != nil { + var recoveryLocation string + err = json.Unmarshal(*v, &recoveryLocation) + if err != nil { + return err + } + acpii.RecoveryLocation = &recoveryLocation + } + case "recoverySubscriptionId": + if v != nil { + var recoverySubscriptionID string + err = json.Unmarshal(*v, &recoverySubscriptionID) + if err != nil { + return err + } + acpii.RecoverySubscriptionID = &recoverySubscriptionID + } + case "recoveryAvailabilityType": + if v != nil { + var recoveryAvailabilityType A2ARecoveryAvailabilityType + err = json.Unmarshal(*v, &recoveryAvailabilityType) + if err != nil { + return err + } + acpii.RecoveryAvailabilityType = recoveryAvailabilityType + } + case "protectionProfileCustomInput": + if v != nil { + protectionProfileCustomInput, err := unmarshalBasicProtectionProfileCustomDetails(*v) + if err != nil { + return err + } + acpii.ProtectionProfileCustomInput = protectionProfileCustomInput + } + case "recoveryResourceGroupId": + if v != nil { + var recoveryResourceGroupID string + err = json.Unmarshal(*v, &recoveryResourceGroupID) + if err != nil { + return err + } + acpii.RecoveryResourceGroupID = &recoveryResourceGroupID + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + acpii.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + case "recoveryAvailabilitySetCustomInput": + if v != nil { + recoveryAvailabilitySetCustomInput, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryAvailabilitySetCustomInput = recoveryAvailabilitySetCustomInput + } + case "recoveryVirtualNetworkCustomInput": + if v != nil { + recoveryVirtualNetworkCustomInput, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryVirtualNetworkCustomInput = recoveryVirtualNetworkCustomInput + } + case "recoveryProximityPlacementGroupCustomInput": + if v != nil { + recoveryProximityPlacementGroupCustomInput, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryProximityPlacementGroupCustomInput = recoveryProximityPlacementGroupCustomInput + } + case "autoProtectionOfDataDisk": + if v != nil { + var autoProtectionOfDataDisk AutoProtectionOfDataDisk + err = json.Unmarshal(*v, &autoProtectionOfDataDisk) + if err != nil { + return err + } + acpii.AutoProtectionOfDataDisk = autoProtectionOfDataDisk + } + case "vmDisks": + if v != nil { + var VMDisks []A2AProtectionIntentDiskInputDetails + err = json.Unmarshal(*v, &VMDisks) + if err != nil { + return err + } + acpii.VMDisks = &VMDisks + } + case "vmManagedDisks": + if v != nil { + var VMManagedDisks []A2AProtectionIntentManagedDiskInputDetails + err = json.Unmarshal(*v, &VMManagedDisks) + if err != nil { + return err + } + acpii.VMManagedDisks = &VMManagedDisks + } + case "multiVmGroupName": + if v != nil { + var multiVMGroupName string + err = json.Unmarshal(*v, &multiVMGroupName) + if err != nil { + return err + } + acpii.MultiVMGroupName = &multiVMGroupName + } + case "multiVmGroupId": + if v != nil { + var multiVMGroupID string + err = json.Unmarshal(*v, &multiVMGroupID) + if err != nil { + return err + } + acpii.MultiVMGroupID = &multiVMGroupID + } + case "recoveryBootDiagStorageAccount": + if v != nil { + recoveryBootDiagStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryBootDiagStorageAccount = recoveryBootDiagStorageAccount + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + acpii.DiskEncryptionInfo = &diskEncryptionInfo + } + case "recoveryAvailabilityZone": + if v != nil { + var recoveryAvailabilityZone string + err = json.Unmarshal(*v, &recoveryAvailabilityZone) + if err != nil { + return err + } + acpii.RecoveryAvailabilityZone = &recoveryAvailabilityZone + } + case "instanceType": + if v != nil { + var instanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails + err = json.Unmarshal(*v, &instanceType) + if err != nil { + return err + } + acpii.InstanceType = instanceType + } + } + } + + return nil +} + +// A2ACrossClusterMigrationApplyRecoveryPointInput applyRecoveryPoint input specific to +// A2ACrossClusterMigration provider. +type A2ACrossClusterMigrationApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + accmarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmarpi.InstanceType != "" { + objectMap["instanceType"] = accmarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return &accmarpi, true +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &accmarpi, true +} + +// A2ACrossClusterMigrationContainerCreationInput a2ACrossClusterMigration cloud creation input. +type A2ACrossClusterMigrationContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) MarshalJSON() ([]byte, error) { + accmcci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmcci.InstanceType != "" { + objectMap["instanceType"] = accmcci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return &accmcci, true +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &accmcci, true +} + +// A2ACrossClusterMigrationEnableProtectionInput a2A Cross-Cluster Migration enable protection input. +type A2ACrossClusterMigrationEnableProtectionInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) MarshalJSON() ([]byte, error) { + accmepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmepi.FabricObjectID != nil { + objectMap["fabricObjectId"] = accmepi.FabricObjectID + } + if accmepi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = accmepi.RecoveryContainerID + } + if accmepi.InstanceType != "" { + objectMap["instanceType"] = accmepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return &accmepi, true +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &accmepi, true +} + +// A2ACrossClusterMigrationPolicyCreationInput a2A Cross-Cluster Migration Policy creation input. +type A2ACrossClusterMigrationPolicyCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) MarshalJSON() ([]byte, error) { + accmpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmpci.InstanceType != "" { + objectMap["instanceType"] = accmpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return &accmpci, true +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &accmpci, true +} + +// A2ACrossClusterMigrationReplicationDetails a2A provider specific settings. +type A2ACrossClusterMigrationReplicationDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryFabricLocation - Primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // OsType - The type of operating system. + OsType *string `json:"osType,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // LifecycleID - An id associated with the PE 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 item even though other internal Ids/ARM Id might be changing. + LifecycleID *string `json:"lifecycleId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) MarshalJSON() ([]byte, error) { + accmrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmrd.FabricObjectID != nil { + objectMap["fabricObjectId"] = accmrd.FabricObjectID + } + if accmrd.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = accmrd.PrimaryFabricLocation + } + if accmrd.OsType != nil { + objectMap["osType"] = accmrd.OsType + } + if accmrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = accmrd.VMProtectionState + } + if accmrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = accmrd.VMProtectionStateDescription + } + if accmrd.LifecycleID != nil { + objectMap["lifecycleId"] = accmrd.LifecycleID + } + if accmrd.InstanceType != "" { + objectMap["instanceType"] = accmrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return &accmrd, true +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &accmrd, true +} + +// A2AEnableProtectionInput a2A enable protection input. +type A2AEnableProtectionInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryAzureNetworkID - The recovery Azure virtual network ARM id. + RecoveryAzureNetworkID *string `json:"recoveryAzureNetworkId,omitempty"` + // RecoverySubnetName - The recovery subnet name. + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + // RecoveryVirtualMachineScaleSetID - The virtual machine scale set Id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) MarshalJSON() ([]byte, error) { + aepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aepi.FabricObjectID != nil { + objectMap["fabricObjectId"] = aepi.FabricObjectID + } + if aepi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = aepi.RecoveryContainerID + } + if aepi.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aepi.RecoveryResourceGroupID + } + if aepi.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aepi.RecoveryCloudServiceID + } + if aepi.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = aepi.RecoveryAvailabilitySetID + } + if aepi.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aepi.RecoveryProximityPlacementGroupID + } + if aepi.VMDisks != nil { + objectMap["vmDisks"] = aepi.VMDisks + } + if aepi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aepi.VMManagedDisks + } + if aepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = aepi.MultiVMGroupName + } + if aepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = aepi.MultiVMGroupID + } + if aepi.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aepi.RecoveryBootDiagStorageAccountID + } + if aepi.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aepi.DiskEncryptionInfo + } + if aepi.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = aepi.RecoveryAvailabilityZone + } + if aepi.RecoveryAzureNetworkID != nil { + objectMap["recoveryAzureNetworkId"] = aepi.RecoveryAzureNetworkID + } + if aepi.RecoverySubnetName != nil { + objectMap["recoverySubnetName"] = aepi.RecoverySubnetName + } + if aepi.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aepi.RecoveryVirtualMachineScaleSetID + } + if aepi.InstanceType != "" { + objectMap["instanceType"] = aepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return &aepi, true +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &aepi, true +} + +// A2AEventDetails model class for event details of a A2A event. +type A2AEventDetails struct { + // ProtectedItemName - The protected item arm name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // FabricObjectID - The azure vm arm id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // FabricName - Fabric arm name. + FabricName *string `json:"fabricName,omitempty"` + // FabricLocation - The fabric location. + FabricLocation *string `json:"fabricLocation,omitempty"` + // RemoteFabricName - Remote fabric arm name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // RemoteFabricLocation - Remote fabric location. + RemoteFabricLocation *string `json:"remoteFabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AEventDetails. +func (aed A2AEventDetails) MarshalJSON() ([]byte, error) { + aed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aed.ProtectedItemName != nil { + objectMap["protectedItemName"] = aed.ProtectedItemName + } + if aed.FabricObjectID != nil { + objectMap["fabricObjectId"] = aed.FabricObjectID + } + if aed.FabricName != nil { + objectMap["fabricName"] = aed.FabricName + } + if aed.FabricLocation != nil { + objectMap["fabricLocation"] = aed.FabricLocation + } + if aed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = aed.RemoteFabricName + } + if aed.RemoteFabricLocation != nil { + objectMap["remoteFabricLocation"] = aed.RemoteFabricLocation + } + if aed.InstanceType != "" { + objectMap["instanceType"] = aed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return &aed, true +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &aed, true +} + +// A2APolicyCreationInput a2A Policy creation input. +type A2APolicyCreationInput struct { + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) MarshalJSON() ([]byte, error) { + apci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apci.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = apci.RecoveryPointHistory + } + if apci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = apci.CrashConsistentFrequencyInMinutes + } + if apci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = apci.AppConsistentFrequencyInMinutes + } + if apci.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = apci.MultiVMSyncStatus + } + if apci.InstanceType != "" { + objectMap["instanceType"] = apci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return &apci, true +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &apci, true +} + +// A2APolicyDetails a2A specific policy details. +type A2APolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2APolicyDetails. +func (apd A2APolicyDetails) MarshalJSON() ([]byte, error) { + apd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = apd.RecoveryPointThresholdInMinutes + } + if apd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = apd.RecoveryPointHistory + } + if apd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = apd.AppConsistentFrequencyInMinutes + } + if apd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = apd.MultiVMSyncStatus + } + if apd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = apd.CrashConsistentFrequencyInMinutes + } + if apd.InstanceType != "" { + objectMap["instanceType"] = apd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return &apd, true +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &apd, true +} + +// A2AProtectedDiskDetails a2A protected disk details. +type A2AProtectedDiskDetails struct { + // DiskURI - The disk uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountID - The recovery disk storage account. + RecoveryAzureStorageAccountID *string `json:"recoveryAzureStorageAccountId,omitempty"` + // PrimaryDiskAzureStorageAccountID - The primary disk storage account. + PrimaryDiskAzureStorageAccountID *string `json:"primaryDiskAzureStorageAccountId,omitempty"` + // RecoveryDiskURI - Recovery disk uri. + RecoveryDiskURI *string `json:"recoveryDiskUri,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // DiskType - The type of disk. + DiskType *string `json:"diskType,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *bool `json:"resyncRequired,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // DataPendingInStagingStorageAccountInMB - The data pending for replication in MB at staging account. + DataPendingInStagingStorageAccountInMB *float64 `json:"dataPendingInStagingStorageAccountInMB,omitempty"` + // DataPendingAtSourceAgentInMB - The data pending at source virtual machine in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // DiskState - The disk state. + DiskState *string `json:"diskState,omitempty"` + // AllowedDiskLevelOperation - The disk level operations list. + AllowedDiskLevelOperation *[]string `json:"allowedDiskLevelOperation,omitempty"` + // IsDiskEncrypted - A value indicating whether vm has encrypted os disk or not. + IsDiskEncrypted *bool `json:"isDiskEncrypted,omitempty"` + // SecretIdentifier - The secret URL / identifier (BEK). + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // DekKeyVaultArmID - The KeyVault resource id for secret (BEK). + DekKeyVaultArmID *string `json:"dekKeyVaultArmId,omitempty"` + // IsDiskKeyEncrypted - A value indicating whether disk key got encrypted or not. + IsDiskKeyEncrypted *bool `json:"isDiskKeyEncrypted,omitempty"` + // KeyIdentifier - The key URL / identifier (KEK). + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KekKeyVaultArmID - The KeyVault resource id for key (KEK). + KekKeyVaultArmID *string `json:"kekKeyVaultArmId,omitempty"` + // FailoverDiskName - The failover name for the managed disk. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The test failover name for the managed disk. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AProtectedManagedDiskDetails a2A protected managed disk details. +type A2AProtectedManagedDiskDetails struct { + // DiskID - The managed disk Arm id. + DiskID *string `json:"diskId,omitempty"` + // RecoveryResourceGroupID - The recovery disk resource group Arm Id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryTargetDiskID - Recovery target disk Arm Id. + RecoveryTargetDiskID *string `json:"recoveryTargetDiskId,omitempty"` + // RecoveryReplicaDiskID - Recovery replica disk Arm Id. + RecoveryReplicaDiskID *string `json:"recoveryReplicaDiskId,omitempty"` + // RecoveryOrignalTargetDiskID - Recovery original target disk Arm Id. + RecoveryOrignalTargetDiskID *string `json:"recoveryOrignalTargetDiskId,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // PrimaryDiskEncryptionSetID - The primary disk encryption set Id. + PrimaryDiskEncryptionSetID *string `json:"primaryDiskEncryptionSetId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // DiskType - The type of disk. + DiskType *string `json:"diskType,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *bool `json:"resyncRequired,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // DataPendingInStagingStorageAccountInMB - The data pending for replication in MB at staging account. + DataPendingInStagingStorageAccountInMB *float64 `json:"dataPendingInStagingStorageAccountInMB,omitempty"` + // DataPendingAtSourceAgentInMB - The data pending at source virtual machine in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // DiskState - The disk state. + DiskState *string `json:"diskState,omitempty"` + // AllowedDiskLevelOperation - The disk level operations list. + AllowedDiskLevelOperation *[]string `json:"allowedDiskLevelOperation,omitempty"` + // IsDiskEncrypted - A value indicating whether vm has encrypted os disk or not. + IsDiskEncrypted *bool `json:"isDiskEncrypted,omitempty"` + // SecretIdentifier - The secret URL / identifier (BEK). + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // DekKeyVaultArmID - The KeyVault resource id for secret (BEK). + DekKeyVaultArmID *string `json:"dekKeyVaultArmId,omitempty"` + // IsDiskKeyEncrypted - A value indicating whether disk key got encrypted or not. + IsDiskKeyEncrypted *bool `json:"isDiskKeyEncrypted,omitempty"` + // KeyIdentifier - The key URL / identifier (KEK). + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KekKeyVaultArmID - The KeyVault resource id for key (KEK). + KekKeyVaultArmID *string `json:"kekKeyVaultArmId,omitempty"` + // FailoverDiskName - The failover name for the managed disk. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The test failover name for the managed disk. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AProtectionContainerMappingDetails a2A provider specific settings. +type A2AProtectionContainerMappingDetails struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // ScheduleName - The schedule arm name. + ScheduleName *string `json:"scheduleName,omitempty"` + // JobScheduleName - The job schedule arm name. + JobScheduleName *string `json:"jobScheduleName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + apcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apcmd.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = apcmd.AgentAutoUpdateStatus + } + if apcmd.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = apcmd.AutomationAccountArmID + } + if apcmd.ScheduleName != nil { + objectMap["scheduleName"] = apcmd.ScheduleName + } + if apcmd.JobScheduleName != nil { + objectMap["jobScheduleName"] = apcmd.JobScheduleName + } + if apcmd.InstanceType != "" { + objectMap["instanceType"] = apcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return &apcmd, true +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &apcmd, true +} + +// A2AProtectionIntentDiskInputDetails azure VM unmanaged disk input details. +type A2AProtectionIntentDiskInputDetails struct { + // DiskURI - The disk Uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountCustomInput - The recovery VHD storage account input. + RecoveryAzureStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"recoveryAzureStorageAccountCustomInput,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for A2AProtectionIntentDiskInputDetails struct. +func (apidid *A2AProtectionIntentDiskInputDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "diskUri": + if v != nil { + var diskURI string + err = json.Unmarshal(*v, &diskURI) + if err != nil { + return err + } + apidid.DiskURI = &diskURI + } + case "recoveryAzureStorageAccountCustomInput": + if v != nil { + recoveryAzureStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apidid.RecoveryAzureStorageAccountCustomInput = recoveryAzureStorageAccountCustomInput + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apidid.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + } + } + + return nil +} + +// A2AProtectionIntentManagedDiskInputDetails azure VM managed disk input details. +type A2AProtectionIntentManagedDiskInputDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` + // RecoveryResourceGroupCustomInput - The recovery resource group input. + RecoveryResourceGroupCustomInput BasicRecoveryResourceGroupCustomDetails `json:"recoveryResourceGroupCustomInput,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for one / single pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for A2AProtectionIntentManagedDiskInputDetails struct. +func (apimdid *A2AProtectionIntentManagedDiskInputDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "diskId": + if v != nil { + var diskID string + err = json.Unmarshal(*v, &diskID) + if err != nil { + return err + } + apimdid.DiskID = &diskID + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apimdid.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + case "recoveryResourceGroupCustomInput": + if v != nil { + recoveryResourceGroupCustomInput, err := unmarshalBasicRecoveryResourceGroupCustomDetails(*v) + if err != nil { + return err + } + apimdid.RecoveryResourceGroupCustomInput = recoveryResourceGroupCustomInput + } + case "recoveryReplicaDiskAccountType": + if v != nil { + var recoveryReplicaDiskAccountType string + err = json.Unmarshal(*v, &recoveryReplicaDiskAccountType) + if err != nil { + return err + } + apimdid.RecoveryReplicaDiskAccountType = &recoveryReplicaDiskAccountType + } + case "recoveryTargetDiskAccountType": + if v != nil { + var recoveryTargetDiskAccountType string + err = json.Unmarshal(*v, &recoveryTargetDiskAccountType) + if err != nil { + return err + } + apimdid.RecoveryTargetDiskAccountType = &recoveryTargetDiskAccountType + } + case "recoveryDiskEncryptionSetId": + if v != nil { + var recoveryDiskEncryptionSetID string + err = json.Unmarshal(*v, &recoveryDiskEncryptionSetID) + if err != nil { + return err + } + apimdid.RecoveryDiskEncryptionSetID = &recoveryDiskEncryptionSetID + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + apimdid.DiskEncryptionInfo = &diskEncryptionInfo + } + } + } + + return nil +} + +// A2ARecoveryPointDetails a2A provider specific recovery point details. +type A2ARecoveryPointDetails struct { + // RecoveryPointSyncType - A value indicating whether the recovery point is multi VM consistent. Possible values include: 'MultiVMSyncRecoveryPoint', 'PerVMRecoveryPoint' + RecoveryPointSyncType RecoveryPointSyncType `json:"recoveryPointSyncType,omitempty"` + // Disks - List of disk ids representing a recovery point. + Disks *[]string `json:"disks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) MarshalJSON() ([]byte, error) { + arpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if arpd.RecoveryPointSyncType != "" { + objectMap["recoveryPointSyncType"] = arpd.RecoveryPointSyncType + } + if arpd.Disks != nil { + objectMap["disks"] = arpd.Disks + } + if arpd.InstanceType != "" { + objectMap["instanceType"] = arpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return &arpd, true +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &arpd, true +} + +// A2ARemoveDisksInput a2A remove disk(s) input. +type A2ARemoveDisksInput struct { + // VMDisksUris - The list of vm disk vhd URIs. + VMDisksUris *[]string `json:"vmDisksUris,omitempty"` + // VMManagedDisksIds - The list of vm managed disk Ids. + VMManagedDisksIds *[]string `json:"vmManagedDisksIds,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput', 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRemoveDisksProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) MarshalJSON() ([]byte, error) { + ardi.InstanceType = InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ardi.VMDisksUris != nil { + objectMap["vmDisksUris"] = ardi.VMDisksUris + } + if ardi.VMManagedDisksIds != nil { + objectMap["vmManagedDisksIds"] = ardi.VMManagedDisksIds + } + if ardi.InstanceType != "" { + objectMap["instanceType"] = ardi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARemoveDisksInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) { + return &ardi, true +} + +// AsRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsBasicRemoveDisksProviderSpecificInput() (BasicRemoveDisksProviderSpecificInput, bool) { + return &ardi, true +} + +// A2AReplicationDetails a2A provider specific settings. +type A2AReplicationDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // InitialPrimaryZone - READ-ONLY; The initial primary availability zone. + InitialPrimaryZone *string `json:"initialPrimaryZone,omitempty"` + // InitialPrimaryFabricLocation - READ-ONLY; The initial primary fabric location. + InitialPrimaryFabricLocation *string `json:"initialPrimaryFabricLocation,omitempty"` + // InitialRecoveryZone - READ-ONLY; The initial recovery availability zone. + InitialRecoveryZone *string `json:"initialRecoveryZone,omitempty"` + // InitialRecoveryFabricLocation - READ-ONLY; The initial recovery fabric location. + InitialRecoveryFabricLocation *string `json:"initialRecoveryFabricLocation,omitempty"` + // MultiVMGroupID - The multi vm group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupCreateOption - Whether Multi VM group is auto created or specified by user. Possible values include: 'AutoCreated', 'UserSpecified' + MultiVMGroupCreateOption MultiVMGroupCreateOption `json:"multiVmGroupCreateOption,omitempty"` + // ManagementID - The management Id. + ManagementID *string `json:"managementId,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]A2AProtectedDiskDetails `json:"protectedDisks,omitempty"` + // UnprotectedDisks - The list of unprotected disks. + UnprotectedDisks *[]A2AUnprotectedDiskDetails `json:"unprotectedDisks,omitempty"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]A2AProtectedManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // RecoveryBootDiagStorageAccountID - The recovery boot diagnostic storage account Arm Id. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // PrimaryFabricLocation - Primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // RecoveryFabricLocation - The recovery fabric location. + RecoveryFabricLocation *string `json:"recoveryFabricLocation,omitempty"` + // OsType - The type of operating system. + OsType *string `json:"osType,omitempty"` + // RecoveryAzureVMSize - The size of recovery virtual machine. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureVMName - The name of recovery virtual machine. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureResourceGroupID - The recovery resource group. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryCloudService - The recovery cloud service. + RecoveryCloudService *string `json:"recoveryCloudService,omitempty"` + // RecoveryAvailabilitySet - The recovery availability set. + RecoveryAvailabilitySet *string `json:"recoveryAvailabilitySet,omitempty"` + // SelectedRecoveryAzureNetworkID - The recovery virtual network. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The test failover virtual network. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // VMNics - The virtual machine nic details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMSyncedConfigDetails - The synced configuration details. + VMSyncedConfigDetails *AzureToAzureVMSyncedConfigDetails `json:"vmSyncedConfigDetails,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // IsReplicationAgentUpdateRequired - A value indicating whether replication agent update is required. + IsReplicationAgentUpdateRequired *bool `json:"isReplicationAgentUpdateRequired,omitempty"` + // AgentCertificateExpiryDate - READ-ONLY; Agent certificate expiry date. + AgentCertificateExpiryDate *date.Time `json:"agentCertificateExpiryDate,omitempty"` + // IsReplicationAgentCertificateUpdateRequired - A value indicating whether agent certificate update is required. + IsReplicationAgentCertificateUpdateRequired *bool `json:"isReplicationAgentCertificateUpdateRequired,omitempty"` + // RecoveryFabricObjectID - The recovery fabric object Id. + RecoveryFabricObjectID *string `json:"recoveryFabricObjectId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // LifecycleID - An id associated with the PE 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 item even though other internal Ids/ARM Id might be changing. + LifecycleID *string `json:"lifecycleId,omitempty"` + // TestFailoverRecoveryFabricObjectID - The test failover fabric object Id. + TestFailoverRecoveryFabricObjectID *string `json:"testFailoverRecoveryFabricObjectId,omitempty"` + // RpoInSeconds - The last RPO value in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // LastRpoCalculatedTime - The time (in UTC) when the last RPO value was calculated by Protection Service. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // PrimaryAvailabilityZone - The primary availability zone. + PrimaryAvailabilityZone *string `json:"primaryAvailabilityZone,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // VMEncryptionType - READ-ONLY; The encryption type of the VM. Possible values include: 'NotEncrypted', 'OnePassEncrypted', 'TwoPassEncrypted' + VMEncryptionType VMEncryptionType `json:"vmEncryptionType,omitempty"` + // TfoAzureVMName - The test failover vm name. + TfoAzureVMName *string `json:"tfoAzureVMName,omitempty"` + // RecoveryAzureGeneration - READ-ONLY; The recovery azure generation. + RecoveryAzureGeneration *string `json:"recoveryAzureGeneration,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // RecoveryVirtualMachineScaleSetID - The recovery virtual machine scale set id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReplicationDetails. +func (ard A2AReplicationDetails) MarshalJSON() ([]byte, error) { + ard.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ard.FabricObjectID != nil { + objectMap["fabricObjectId"] = ard.FabricObjectID + } + if ard.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = ard.MultiVMGroupID + } + if ard.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = ard.MultiVMGroupName + } + if ard.MultiVMGroupCreateOption != "" { + objectMap["multiVmGroupCreateOption"] = ard.MultiVMGroupCreateOption + } + if ard.ManagementID != nil { + objectMap["managementId"] = ard.ManagementID + } + if ard.ProtectedDisks != nil { + objectMap["protectedDisks"] = ard.ProtectedDisks + } + if ard.UnprotectedDisks != nil { + objectMap["unprotectedDisks"] = ard.UnprotectedDisks + } + if ard.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = ard.ProtectedManagedDisks + } + if ard.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = ard.RecoveryBootDiagStorageAccountID + } + if ard.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = ard.PrimaryFabricLocation + } + if ard.RecoveryFabricLocation != nil { + objectMap["recoveryFabricLocation"] = ard.RecoveryFabricLocation + } + if ard.OsType != nil { + objectMap["osType"] = ard.OsType + } + if ard.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = ard.RecoveryAzureVMSize + } + if ard.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVMName"] = ard.RecoveryAzureVMName + } + if ard.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = ard.RecoveryAzureResourceGroupID + } + if ard.RecoveryCloudService != nil { + objectMap["recoveryCloudService"] = ard.RecoveryCloudService + } + if ard.RecoveryAvailabilitySet != nil { + objectMap["recoveryAvailabilitySet"] = ard.RecoveryAvailabilitySet + } + if ard.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = ard.SelectedRecoveryAzureNetworkID + } + if ard.SelectedTfoAzureNetworkID != nil { + objectMap["selectedTfoAzureNetworkId"] = ard.SelectedTfoAzureNetworkID + } + if ard.VMNics != nil { + objectMap["vmNics"] = ard.VMNics + } + if ard.VMSyncedConfigDetails != nil { + objectMap["vmSyncedConfigDetails"] = ard.VMSyncedConfigDetails + } + if ard.MonitoringPercentageCompletion != nil { + objectMap["monitoringPercentageCompletion"] = ard.MonitoringPercentageCompletion + } + if ard.MonitoringJobType != nil { + objectMap["monitoringJobType"] = ard.MonitoringJobType + } + if ard.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = ard.LastHeartbeat + } + if ard.AgentVersion != nil { + objectMap["agentVersion"] = ard.AgentVersion + } + if ard.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = ard.AgentExpiryDate + } + if ard.IsReplicationAgentUpdateRequired != nil { + objectMap["isReplicationAgentUpdateRequired"] = ard.IsReplicationAgentUpdateRequired + } + if ard.IsReplicationAgentCertificateUpdateRequired != nil { + objectMap["isReplicationAgentCertificateUpdateRequired"] = ard.IsReplicationAgentCertificateUpdateRequired + } + if ard.RecoveryFabricObjectID != nil { + objectMap["recoveryFabricObjectId"] = ard.RecoveryFabricObjectID + } + if ard.VMProtectionState != nil { + objectMap["vmProtectionState"] = ard.VMProtectionState + } + if ard.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = ard.VMProtectionStateDescription + } + if ard.LifecycleID != nil { + objectMap["lifecycleId"] = ard.LifecycleID + } + if ard.TestFailoverRecoveryFabricObjectID != nil { + objectMap["testFailoverRecoveryFabricObjectId"] = ard.TestFailoverRecoveryFabricObjectID + } + if ard.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = ard.RpoInSeconds + } + if ard.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = ard.LastRpoCalculatedTime + } + if ard.PrimaryAvailabilityZone != nil { + objectMap["primaryAvailabilityZone"] = ard.PrimaryAvailabilityZone + } + if ard.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = ard.RecoveryAvailabilityZone + } + if ard.TfoAzureVMName != nil { + objectMap["tfoAzureVMName"] = ard.TfoAzureVMName + } + if ard.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = ard.RecoveryProximityPlacementGroupID + } + if ard.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = ard.AutoProtectionOfDataDisk + } + if ard.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = ard.RecoveryVirtualMachineScaleSetID + } + if ard.InstanceType != "" { + objectMap["instanceType"] = ard.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return &ard, true +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &ard, true +} + +// A2AReplicationIntentDetails a2A provider specific settings. +type A2AReplicationIntentDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryLocation - The primary location for the virtual machine. + PrimaryLocation *string `json:"primaryLocation,omitempty"` + // RecoveryLocation - The recovery location for the virtual machine. + RecoveryLocation *string `json:"recoveryLocation,omitempty"` + // RecoverySubscriptionID - The recovery subscription Id of the virtual machine. + RecoverySubscriptionID *string `json:"recoverySubscriptionId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AProtectionIntentDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AProtectionIntentManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ProtectionProfile - The protection profile custom details. + ProtectionProfile BasicProtectionProfileCustomDetails `json:"protectionProfile,omitempty"` + // PrimaryStagingStorageAccount - The primary staging storage account details. + PrimaryStagingStorageAccount BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccount,omitempty"` + // RecoveryAvailabilitySet - The recovery availability set details. + RecoveryAvailabilitySet BasicRecoveryAvailabilitySetCustomDetails `json:"recoveryAvailabilitySet,omitempty"` + // RecoveryVirtualNetwork - The recovery virtual network details. + RecoveryVirtualNetwork BasicRecoveryVirtualNetworkCustomDetails `json:"recoveryVirtualNetwork,omitempty"` + // RecoveryProximityPlacementGroup - The recovery proximity placement group custom details. + RecoveryProximityPlacementGroup BasicRecoveryProximityPlacementGroupCustomDetails `json:"recoveryProximityPlacementGroup,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccount - The boot diagnostic storage account. + RecoveryBootDiagStorageAccount BasicStorageAccountCustomDetails `json:"recoveryBootDiagStorageAccount,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryAvailabilityType - The recovery availability type of the virtual machine. + RecoveryAvailabilityType *string `json:"recoveryAvailabilityType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings', 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A' + InstanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) MarshalJSON() ([]byte, error) { + arid.InstanceType = InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if arid.FabricObjectID != nil { + objectMap["fabricObjectId"] = arid.FabricObjectID + } + if arid.PrimaryLocation != nil { + objectMap["primaryLocation"] = arid.PrimaryLocation + } + if arid.RecoveryLocation != nil { + objectMap["recoveryLocation"] = arid.RecoveryLocation + } + if arid.RecoverySubscriptionID != nil { + objectMap["recoverySubscriptionId"] = arid.RecoverySubscriptionID + } + if arid.VMDisks != nil { + objectMap["vmDisks"] = arid.VMDisks + } + if arid.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = arid.VMManagedDisks + } + if arid.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = arid.RecoveryResourceGroupID + } + objectMap["protectionProfile"] = arid.ProtectionProfile + objectMap["primaryStagingStorageAccount"] = arid.PrimaryStagingStorageAccount + objectMap["recoveryAvailabilitySet"] = arid.RecoveryAvailabilitySet + objectMap["recoveryVirtualNetwork"] = arid.RecoveryVirtualNetwork + objectMap["recoveryProximityPlacementGroup"] = arid.RecoveryProximityPlacementGroup + if arid.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = arid.AutoProtectionOfDataDisk + } + if arid.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = arid.MultiVMGroupName + } + if arid.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = arid.MultiVMGroupID + } + objectMap["recoveryBootDiagStorageAccount"] = arid.RecoveryBootDiagStorageAccount + if arid.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = arid.DiskEncryptionInfo + } + if arid.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = arid.RecoveryAvailabilityZone + } + if arid.RecoveryAvailabilityType != nil { + objectMap["recoveryAvailabilityType"] = arid.RecoveryAvailabilityType + } + if arid.InstanceType != "" { + objectMap["instanceType"] = arid.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReplicationIntentDetails is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) { + return &arid, true +} + +// AsReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsBasicReplicationProtectionIntentProviderSpecificSettings() (BasicReplicationProtectionIntentProviderSpecificSettings, bool) { + return &arid, true +} + +// UnmarshalJSON is the custom unmarshaler for A2AReplicationIntentDetails struct. +func (arid *A2AReplicationIntentDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "fabricObjectId": + if v != nil { + var fabricObjectID string + err = json.Unmarshal(*v, &fabricObjectID) + if err != nil { + return err + } + arid.FabricObjectID = &fabricObjectID + } + case "primaryLocation": + if v != nil { + var primaryLocation string + err = json.Unmarshal(*v, &primaryLocation) + if err != nil { + return err + } + arid.PrimaryLocation = &primaryLocation + } + case "recoveryLocation": + if v != nil { + var recoveryLocation string + err = json.Unmarshal(*v, &recoveryLocation) + if err != nil { + return err + } + arid.RecoveryLocation = &recoveryLocation + } + case "recoverySubscriptionId": + if v != nil { + var recoverySubscriptionID string + err = json.Unmarshal(*v, &recoverySubscriptionID) + if err != nil { + return err + } + arid.RecoverySubscriptionID = &recoverySubscriptionID + } + case "vmDisks": + if v != nil { + var VMDisks []A2AProtectionIntentDiskInputDetails + err = json.Unmarshal(*v, &VMDisks) + if err != nil { + return err + } + arid.VMDisks = &VMDisks + } + case "vmManagedDisks": + if v != nil { + var VMManagedDisks []A2AProtectionIntentManagedDiskInputDetails + err = json.Unmarshal(*v, &VMManagedDisks) + if err != nil { + return err + } + arid.VMManagedDisks = &VMManagedDisks + } + case "recoveryResourceGroupId": + if v != nil { + var recoveryResourceGroupID string + err = json.Unmarshal(*v, &recoveryResourceGroupID) + if err != nil { + return err + } + arid.RecoveryResourceGroupID = &recoveryResourceGroupID + } + case "protectionProfile": + if v != nil { + protectionProfile, err := unmarshalBasicProtectionProfileCustomDetails(*v) + if err != nil { + return err + } + arid.ProtectionProfile = protectionProfile + } + case "primaryStagingStorageAccount": + if v != nil { + primaryStagingStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + arid.PrimaryStagingStorageAccount = primaryStagingStorageAccount + } + case "recoveryAvailabilitySet": + if v != nil { + recoveryAvailabilitySet, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryAvailabilitySet = recoveryAvailabilitySet + } + case "recoveryVirtualNetwork": + if v != nil { + recoveryVirtualNetwork, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryVirtualNetwork = recoveryVirtualNetwork + } + case "recoveryProximityPlacementGroup": + if v != nil { + recoveryProximityPlacementGroup, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryProximityPlacementGroup = recoveryProximityPlacementGroup + } + case "autoProtectionOfDataDisk": + if v != nil { + var autoProtectionOfDataDisk AutoProtectionOfDataDisk + err = json.Unmarshal(*v, &autoProtectionOfDataDisk) + if err != nil { + return err + } + arid.AutoProtectionOfDataDisk = autoProtectionOfDataDisk + } + case "multiVmGroupName": + if v != nil { + var multiVMGroupName string + err = json.Unmarshal(*v, &multiVMGroupName) + if err != nil { + return err + } + arid.MultiVMGroupName = &multiVMGroupName + } + case "multiVmGroupId": + if v != nil { + var multiVMGroupID string + err = json.Unmarshal(*v, &multiVMGroupID) + if err != nil { + return err + } + arid.MultiVMGroupID = &multiVMGroupID + } + case "recoveryBootDiagStorageAccount": + if v != nil { + recoveryBootDiagStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryBootDiagStorageAccount = recoveryBootDiagStorageAccount + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + arid.DiskEncryptionInfo = &diskEncryptionInfo + } + case "recoveryAvailabilityZone": + if v != nil { + var recoveryAvailabilityZone string + err = json.Unmarshal(*v, &recoveryAvailabilityZone) + if err != nil { + return err + } + arid.RecoveryAvailabilityZone = &recoveryAvailabilityZone + } + case "recoveryAvailabilityType": + if v != nil { + var recoveryAvailabilityType string + err = json.Unmarshal(*v, &recoveryAvailabilityType) + if err != nil { + return err + } + arid.RecoveryAvailabilityType = &recoveryAvailabilityType + } + case "instanceType": + if v != nil { + var instanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings + err = json.Unmarshal(*v, &instanceType) + if err != nil { + return err + } + arid.InstanceType = instanceType + } + } + } + + return nil +} + +// A2AReprotectInput azure specific reprotect input. +type A2AReprotectInput struct { + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReprotectInput. +func (ari A2AReprotectInput) MarshalJSON() ([]byte, error) { + ari.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ari.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = ari.RecoveryContainerID + } + if ari.VMDisks != nil { + objectMap["vmDisks"] = ari.VMDisks + } + if ari.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = ari.RecoveryResourceGroupID + } + if ari.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = ari.RecoveryCloudServiceID + } + if ari.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = ari.RecoveryAvailabilitySetID + } + if ari.PolicyID != nil { + objectMap["policyId"] = ari.PolicyID + } + if ari.InstanceType != "" { + objectMap["instanceType"] = ari.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return &ari, true +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &ari, true +} + +// A2ASwitchProtectionInput a2A specific switch protection input. +type A2ASwitchProtectionInput struct { + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // RecoveryVirtualMachineScaleSetID - The virtual machine scale set id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput', 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicSwitchProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) MarshalJSON() ([]byte, error) { + aspi.InstanceType = InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aspi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = aspi.RecoveryContainerID + } + if aspi.VMDisks != nil { + objectMap["vmDisks"] = aspi.VMDisks + } + if aspi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aspi.VMManagedDisks + } + if aspi.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aspi.RecoveryResourceGroupID + } + if aspi.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aspi.RecoveryCloudServiceID + } + if aspi.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = aspi.RecoveryAvailabilitySetID + } + if aspi.PolicyID != nil { + objectMap["policyId"] = aspi.PolicyID + } + if aspi.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aspi.RecoveryBootDiagStorageAccountID + } + if aspi.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = aspi.RecoveryAvailabilityZone + } + if aspi.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aspi.RecoveryProximityPlacementGroupID + } + if aspi.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aspi.RecoveryVirtualMachineScaleSetID + } + if aspi.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aspi.DiskEncryptionInfo + } + if aspi.InstanceType != "" { + objectMap["instanceType"] = aspi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ASwitchProtectionInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) { + return &aspi, true +} + +// AsSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsBasicSwitchProtectionProviderSpecificInput() (BasicSwitchProtectionProviderSpecificInput, bool) { + return &aspi, true +} + +// A2ATestFailoverInput a2A provider specific input for test failover. +type A2ATestFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for TFO or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) MarshalJSON() ([]byte, error) { + atfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if atfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = atfi.RecoveryPointID + } + if atfi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = atfi.CloudServiceCreationOption + } + if atfi.InstanceType != "" { + objectMap["instanceType"] = atfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return &atfi, true +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &atfi, true +} + +// A2AUnplannedFailoverInput a2A provider specific input for unplanned failover. +type A2AUnplannedFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for failover or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + aufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = aufi.RecoveryPointID + } + if aufi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = aufi.CloudServiceCreationOption + } + if aufi.InstanceType != "" { + objectMap["instanceType"] = aufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return &aufi, true +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &aufi, true +} + +// A2AUnprotectedDiskDetails a2A unprotected disk details. +type A2AUnprotectedDiskDetails struct { + // DiskLunID - The source lun Id for the data disk. + DiskLunID *int32 `json:"diskLunId,omitempty"` + // DiskAutoProtectionStatus - A value indicating whether the disk auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + DiskAutoProtectionStatus AutoProtectionOfDataDisk `json:"diskAutoProtectionStatus,omitempty"` +} + +// A2AUpdateContainerMappingInput a2A update protection container mapping. +type A2AUpdateContainerMappingInput struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + aucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aucmi.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = aucmi.AgentAutoUpdateStatus + } + if aucmi.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = aucmi.AutomationAccountArmID + } + if aucmi.InstanceType != "" { + objectMap["instanceType"] = aucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return &aucmi, true +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &aucmi, true +} + +// A2AUpdateReplicationProtectedItemInput inMage Azure V2 input to update replication protected item. +type A2AUpdateReplicationProtectedItemInput struct { + // RecoveryCloudServiceID - The target cloud service ARM Id (for V1). + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryResourceGroupID - The target resource group ARM Id (for V2). + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ManagedDiskUpdateDetails - Managed disk update details. + ManagedDiskUpdateDetails *[]A2AVMManagedDiskUpdateDetails `json:"managedDiskUpdateDetails,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // DiskEncryptionInfo - The recovery os disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // TfoAzureVMName - The user given name for Test Failover VM. + TfoAzureVMName *string `json:"tfoAzureVMName,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // RecoveryVirtualMachineScaleSetID - The recovery virtual machine scale set Id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + aurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aurpii.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aurpii.RecoveryCloudServiceID + } + if aurpii.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aurpii.RecoveryResourceGroupID + } + if aurpii.ManagedDiskUpdateDetails != nil { + objectMap["managedDiskUpdateDetails"] = aurpii.ManagedDiskUpdateDetails + } + if aurpii.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aurpii.RecoveryBootDiagStorageAccountID + } + if aurpii.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aurpii.DiskEncryptionInfo + } + if aurpii.TfoAzureVMName != nil { + objectMap["tfoAzureVMName"] = aurpii.TfoAzureVMName + } + if aurpii.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aurpii.RecoveryProximityPlacementGroupID + } + if aurpii.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aurpii.RecoveryVirtualMachineScaleSetID + } + if aurpii.InstanceType != "" { + objectMap["instanceType"] = aurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return &aurpii, true +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &aurpii, true +} + +// A2AVMDiskInputDetails a2A disk input details. +type A2AVMDiskInputDetails struct { + // DiskURI - The disk Uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountID - The recovery VHD storage account Id. + RecoveryAzureStorageAccountID *string `json:"recoveryAzureStorageAccountId,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account Id. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` +} + +// A2AVMManagedDiskInputDetails a2A managed disk input details. +type A2AVMManagedDiskInputDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account Arm Id. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // RecoveryResourceGroupID - The target resource group Arm Id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for one / single pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` +} + +// A2AVMManagedDiskUpdateDetails a2A Vm managed disk update details. +type A2AVMManagedDiskUpdateDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type before failover. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type before failover. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // DiskEncryptionInfo - The recovery os disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // FailoverDiskName - The target disk name for unplanned failover operation. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The target disk name for test failover operation. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AZoneDetails zone details data. +type A2AZoneDetails struct { + // Source - Source zone info. + Source *string `json:"source,omitempty"` + // Target - The target zone info. + Target *string `json:"target,omitempty"` +} + +// AddDisksInput input for add disk(s) operation. +type AddDisksInput struct { + // Properties - Add disks input properties. + Properties *AddDisksInputProperties `json:"properties,omitempty"` +} + +// AddDisksInputProperties add Disks input properties. +type AddDisksInputProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicAddDisksProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AddDisksInputProperties struct. +func (adip *AddDisksInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicAddDisksProviderSpecificInput(*v) + if err != nil { + return err + } + adip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicAddDisksProviderSpecificInput add Disks provider specific input. +type BasicAddDisksProviderSpecificInput interface { + AsA2AAddDisksInput() (*A2AAddDisksInput, bool) + AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) +} + +// AddDisksProviderSpecificInput add Disks provider specific input. +type AddDisksProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeAddDisksProviderSpecificInput', 'InstanceTypeA2A' + InstanceType InstanceType `json:"instanceType,omitempty"` +} + +func unmarshalBasicAddDisksProviderSpecificInput(body []byte) (BasicAddDisksProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeA2A): + var aadi A2AAddDisksInput + err := json.Unmarshal(body, &aadi) + return aadi, err + default: + var adpsi AddDisksProviderSpecificInput + err := json.Unmarshal(body, &adpsi) + return adpsi, err + } +} +func unmarshalBasicAddDisksProviderSpecificInputArray(body []byte) ([]BasicAddDisksProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + adpsiArray := make([]BasicAddDisksProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + adpsi, err := unmarshalBasicAddDisksProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + adpsiArray[index] = adpsi + } + return adpsiArray, nil +} + +// MarshalJSON is the custom marshaler for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) MarshalJSON() ([]byte, error) { + adpsi.InstanceType = InstanceTypeAddDisksProviderSpecificInput + objectMap := make(map[string]interface{}) + if adpsi.InstanceType != "" { + objectMap["instanceType"] = adpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AAddDisksInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsA2AAddDisksInput() (*A2AAddDisksInput, bool) { + return nil, false +} + +// AsAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) { + return &adpsi, true +} + +// AsBasicAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsBasicAddDisksProviderSpecificInput() (BasicAddDisksProviderSpecificInput, bool) { + return &adpsi, true +} + +// AddRecoveryServicesProviderInput input required to add a provider. +type AddRecoveryServicesProviderInput struct { + // Properties - The properties of an add provider request. + Properties *AddRecoveryServicesProviderInputProperties `json:"properties,omitempty"` +} + +// AddRecoveryServicesProviderInputProperties the properties of an add provider request. +type AddRecoveryServicesProviderInputProperties struct { + // MachineName - The name of the machine where the provider is getting added. + MachineName *string `json:"machineName,omitempty"` + // MachineID - The Id of the machine where the provider is getting added. + MachineID *string `json:"machineId,omitempty"` + // BiosID - The Bios Id of the machine. + BiosID *string `json:"biosId,omitempty"` + // AuthenticationIdentityInput - The identity provider input for DRA authentication. + AuthenticationIdentityInput *IdentityProviderInput `json:"authenticationIdentityInput,omitempty"` + // ResourceAccessIdentityInput - The identity provider input for resource access. + ResourceAccessIdentityInput *IdentityProviderInput `json:"resourceAccessIdentityInput,omitempty"` + // DataPlaneAuthenticationIdentityInput - The identity provider input for data plane authentication. + DataPlaneAuthenticationIdentityInput *IdentityProviderInput `json:"dataPlaneAuthenticationIdentityInput,omitempty"` +} + +// AddVCenterRequest input required to add vCenter. +type AddVCenterRequest struct { + // Properties - The properties of an add vCenter request. + Properties *AddVCenterRequestProperties `json:"properties,omitempty"` +} + +// AddVCenterRequestProperties the properties of an add vCenter request. +type AddVCenterRequestProperties struct { + // FriendlyName - The friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the vCenter to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // ProcessServerID - The process server Id from where the discovery is orchestrated. + ProcessServerID *string `json:"processServerId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The account Id which has privileges to discover the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// AgentDetails agent details. +type AgentDetails struct { + // AgentID - READ-ONLY; The Id of the agent running on the server. + AgentID *string `json:"agentId,omitempty"` + // MachineID - READ-ONLY; The Id of the machine to which the agent is registered. + MachineID *string `json:"machineId,omitempty"` + // BiosID - READ-ONLY; The machine BIOS Id. + BiosID *string `json:"biosId,omitempty"` + // Fqdn - READ-ONLY; The machine FQDN. + Fqdn *string `json:"fqdn,omitempty"` + // Disks - READ-ONLY; The disks. + Disks *[]AgentDiskDetails `json:"disks,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentDetails. +func (ad AgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AgentDiskDetails agent disk details. +type AgentDiskDetails struct { + // DiskID - READ-ONLY; The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LunID - READ-ONLY; The lun of disk. + LunID *int32 `json:"lunId,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentDiskDetails. +func (add AgentDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Alert implements the Alert class. +type Alert struct { + autorest.Response `json:"-"` + // Properties - Alert related data. + Properties *AlertProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Alert. +func (a Alert) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.Properties != nil { + objectMap["properties"] = a.Properties + } + if a.Location != nil { + objectMap["location"] = a.Location + } + return json.Marshal(objectMap) +} + +// AlertCollection collection of alerts. +type AlertCollection struct { + autorest.Response `json:"-"` + // Value - The list of alerts. + Value *[]Alert `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// AlertCollectionIterator provides access to a complete listing of Alert values. +type AlertCollectionIterator struct { + i int + page AlertCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AlertCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AlertCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AlertCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AlertCollectionIterator) Response() AlertCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AlertCollectionIterator) Value() Alert { + if !iter.page.NotDone() { + return Alert{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AlertCollectionIterator type. +func NewAlertCollectionIterator(page AlertCollectionPage) AlertCollectionIterator { + return AlertCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ac AlertCollection) IsEmpty() bool { + return ac.Value == nil || len(*ac.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ac AlertCollection) hasNextLink() bool { + return ac.NextLink != nil && len(*ac.NextLink) != 0 +} + +// alertCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ac AlertCollection) alertCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ac.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ac.NextLink))) +} + +// AlertCollectionPage contains a page of Alert values. +type AlertCollectionPage struct { + fn func(context.Context, AlertCollection) (AlertCollection, error) + ac AlertCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AlertCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ac) + if err != nil { + return err + } + page.ac = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AlertCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AlertCollectionPage) NotDone() bool { + return !page.ac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AlertCollectionPage) Response() AlertCollection { + return page.ac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AlertCollectionPage) Values() []Alert { + if page.ac.IsEmpty() { + return nil + } + return *page.ac.Value +} + +// Creates a new instance of the AlertCollectionPage type. +func NewAlertCollectionPage(cur AlertCollection, getNextPage func(context.Context, AlertCollection) (AlertCollection, error)) AlertCollectionPage { + return AlertCollectionPage{ + fn: getNextPage, + ac: cur, + } +} + +// AlertProperties the properties of an alert. +type AlertProperties struct { + // SendToOwners - A value indicating whether to send email to subscription administrator. + SendToOwners *string `json:"sendToOwners,omitempty"` + // CustomEmailAddresses - The custom email address for sending emails. + CustomEmailAddresses *[]string `json:"customEmailAddresses,omitempty"` + // Locale - The locale for the email notification. + Locale *string `json:"locale,omitempty"` +} + +// ApplyRecoveryPointInput input to apply recovery point. +type ApplyRecoveryPointInput struct { + // Properties - The input properties to apply recovery point. + Properties *ApplyRecoveryPointInputProperties `json:"properties,omitempty"` +} + +// ApplyRecoveryPointInputProperties input properties to apply recovery point. +type ApplyRecoveryPointInputProperties struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // ProviderSpecificDetails - Provider specific input for applying recovery point. + ProviderSpecificDetails BasicApplyRecoveryPointProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ApplyRecoveryPointInputProperties struct. +func (arpip *ApplyRecoveryPointInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryPointId": + if v != nil { + var recoveryPointID string + err = json.Unmarshal(*v, &recoveryPointID) + if err != nil { + return err + } + arpip.RecoveryPointID = &recoveryPointID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicApplyRecoveryPointProviderSpecificInput(*v) + if err != nil { + return err + } + arpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicApplyRecoveryPointProviderSpecificInput provider specific input for apply recovery point. +type BasicApplyRecoveryPointProviderSpecificInput interface { + AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) + AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) + AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) + AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) + AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) + AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) +} + +// ApplyRecoveryPointProviderSpecificInput provider specific input for apply recovery point. +type ApplyRecoveryPointProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicApplyRecoveryPointProviderSpecificInput(body []byte) (BasicApplyRecoveryPointProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A): + var aarpi A2AApplyRecoveryPointInput + err := json.Unmarshal(body, &aarpi) + return aarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput + err := json.Unmarshal(body, &accmarpi) + return accmarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraarpi HyperVReplicaAzureApplyRecoveryPointInput + err := json.Unmarshal(body, &hvraarpi) + return hvraarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2): + var imavarpi InMageAzureV2ApplyRecoveryPointInput + err := json.Unmarshal(body, &imavarpi) + return imavarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm): + var imrarpi InMageRcmApplyRecoveryPointInput + err := json.Unmarshal(body, &imrarpi) + return imrarpi, err + default: + var arppsi ApplyRecoveryPointProviderSpecificInput + err := json.Unmarshal(body, &arppsi) + return arppsi, err + } +} +func unmarshalBasicApplyRecoveryPointProviderSpecificInputArray(body []byte) ([]BasicApplyRecoveryPointProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + arppsiArray := make([]BasicApplyRecoveryPointProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + arppsi, err := unmarshalBasicApplyRecoveryPointProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + arppsiArray[index] = arppsi + } + return arppsiArray, nil +} + +// MarshalJSON is the custom marshaler for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) MarshalJSON() ([]byte, error) { + arppsi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput + objectMap := make(map[string]interface{}) + if arppsi.InstanceType != "" { + objectMap["instanceType"] = arppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return &arppsi, true +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &arppsi, true +} + +// AsrJobDetails this class represents job details based on specific job type. +type AsrJobDetails struct { + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AsrJobDetails. +func (ajd AsrJobDetails) MarshalJSON() ([]byte, error) { + ajd.InstanceType = InstanceTypeAsrJobDetails + objectMap := make(map[string]interface{}) + if ajd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = ajd.AffectedObjectDetails + } + if ajd.InstanceType != "" { + objectMap["instanceType"] = ajd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return &ajd, true +} + +// AsExportJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &ajd, true +} + +// ASRTask task of the Job. +type ASRTask struct { + // TaskID - The Id. + TaskID *string `json:"taskId,omitempty"` + // Name - The unique Task name. + Name *string `json:"name,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // AllowedActions - The state/actions applicable on this task. + AllowedActions *[]string `json:"allowedActions,omitempty"` + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // State - The State. It is one of these values - NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or Other. + State *string `json:"state,omitempty"` + // StateDescription - The description of the task state. For example - For Succeeded state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. + StateDescription *string `json:"stateDescription,omitempty"` + // TaskType - The type of task. Details in CustomDetails property depend on this type. + TaskType *string `json:"taskType,omitempty"` + // CustomDetails - The custom task details based on the task type. + CustomDetails BasicTaskTypeDetails `json:"customDetails,omitempty"` + // GroupTaskCustomDetails - The custom task details based on the task type, if the task type is GroupTaskDetails or one of the types derived from it. + GroupTaskCustomDetails BasicGroupTaskDetails `json:"groupTaskCustomDetails,omitempty"` + // Errors - The task error details. + Errors *[]JobErrorDetails `json:"errors,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ASRTask struct. +func (at *ASRTask) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "taskId": + if v != nil { + var taskID string + err = json.Unmarshal(*v, &taskID) + if err != nil { + return err + } + at.TaskID = &taskID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + at.Name = &name + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + at.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + at.EndTime = &endTime + } + case "allowedActions": + if v != nil { + var allowedActions []string + err = json.Unmarshal(*v, &allowedActions) + if err != nil { + return err + } + at.AllowedActions = &allowedActions + } + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + at.FriendlyName = &friendlyName + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + at.State = &state + } + case "stateDescription": + if v != nil { + var stateDescription string + err = json.Unmarshal(*v, &stateDescription) + if err != nil { + return err + } + at.StateDescription = &stateDescription + } + case "taskType": + if v != nil { + var taskType string + err = json.Unmarshal(*v, &taskType) + if err != nil { + return err + } + at.TaskType = &taskType + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicTaskTypeDetails(*v) + if err != nil { + return err + } + at.CustomDetails = customDetails + } + case "groupTaskCustomDetails": + if v != nil { + groupTaskCustomDetails, err := unmarshalBasicGroupTaskDetails(*v) + if err != nil { + return err + } + at.GroupTaskCustomDetails = groupTaskCustomDetails + } + case "errors": + if v != nil { + var errorsVar []JobErrorDetails + err = json.Unmarshal(*v, &errorsVar) + if err != nil { + return err + } + at.Errors = &errorsVar + } + } + } + + return nil +} + +// AutomationRunbookTaskDetails this class represents the task details for an automation runbook. +type AutomationRunbookTaskDetails struct { + // Name - The recovery plan task name. + Name *string `json:"name,omitempty"` + // CloudServiceName - The cloud service of the automation runbook account. + CloudServiceName *string `json:"cloudServiceName,omitempty"` + // SubscriptionID - The subscription Id of the automation runbook account. + SubscriptionID *string `json:"subscriptionId,omitempty"` + // AccountName - The automation account name of the runbook. + AccountName *string `json:"accountName,omitempty"` + // RunbookID - The runbook Id. + RunbookID *string `json:"runbookId,omitempty"` + // RunbookName - The runbook name. + RunbookName *string `json:"runbookName,omitempty"` + // JobID - The job Id of the runbook execution. + JobID *string `json:"jobId,omitempty"` + // JobOutput - The execution output of the runbook. + JobOutput *string `json:"jobOutput,omitempty"` + // IsPrimarySideScript - A value indicating whether it is a primary side script or not. + IsPrimarySideScript *bool `json:"isPrimarySideScript,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) MarshalJSON() ([]byte, error) { + artd.InstanceType = InstanceTypeAutomationRunbookTaskDetails + objectMap := make(map[string]interface{}) + if artd.Name != nil { + objectMap["name"] = artd.Name + } + if artd.CloudServiceName != nil { + objectMap["cloudServiceName"] = artd.CloudServiceName + } + if artd.SubscriptionID != nil { + objectMap["subscriptionId"] = artd.SubscriptionID + } + if artd.AccountName != nil { + objectMap["accountName"] = artd.AccountName + } + if artd.RunbookID != nil { + objectMap["runbookId"] = artd.RunbookID + } + if artd.RunbookName != nil { + objectMap["runbookName"] = artd.RunbookName + } + if artd.JobID != nil { + objectMap["jobId"] = artd.JobID + } + if artd.JobOutput != nil { + objectMap["jobOutput"] = artd.JobOutput + } + if artd.IsPrimarySideScript != nil { + objectMap["isPrimarySideScript"] = artd.IsPrimarySideScript + } + if artd.InstanceType != "" { + objectMap["instanceType"] = artd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return &artd, true +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &artd, true +} + +// AzureFabricCreationInput fabric provider specific settings. +type AzureFabricCreationInput struct { + // Location - The Location. + Location *string `json:"location,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreationInput', 'InstanceTypeAzure', 'InstanceTypeInMageRcm', 'InstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) MarshalJSON() ([]byte, error) { + afci.InstanceType = InstanceTypeAzure + objectMap := make(map[string]interface{}) + if afci.Location != nil { + objectMap["location"] = afci.Location + } + if afci.InstanceType != "" { + objectMap["instanceType"] = afci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return &afci, true +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &afci, true +} + +// AzureFabricSpecificDetails azure Fabric Specific Details. +type AzureFabricSpecificDetails struct { + // Location - The Location for the Azure fabric. + Location *string `json:"location,omitempty"` + // ContainerIds - The container Ids for the Azure fabric. + ContainerIds *[]string `json:"containerIds,omitempty"` + // Zones - The zones. + Zones *[]A2AZoneDetails `json:"zones,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) MarshalJSON() ([]byte, error) { + afsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure + objectMap := make(map[string]interface{}) + if afsd.Location != nil { + objectMap["location"] = afsd.Location + } + if afsd.ContainerIds != nil { + objectMap["containerIds"] = afsd.ContainerIds + } + if afsd.Zones != nil { + objectMap["zones"] = afsd.Zones + } + if afsd.InstanceType != "" { + objectMap["instanceType"] = afsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return &afsd, true +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &afsd, true +} + +// AzureToAzureCreateNetworkMappingInput create network mappings input properties/behavior specific to +// Azure to Azure Network mapping. +type AzureToAzureCreateNetworkMappingInput struct { + // PrimaryNetworkID - The primary azure vnet Id. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + atacnmi.InstanceType = InstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if atacnmi.PrimaryNetworkID != nil { + objectMap["primaryNetworkId"] = atacnmi.PrimaryNetworkID + } + if atacnmi.InstanceType != "" { + objectMap["instanceType"] = atacnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return &atacnmi, true +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &atacnmi, true +} + +// AzureToAzureNetworkMappingSettings a2A Network Mapping fabric specific settings. +type AzureToAzureNetworkMappingSettings struct { + // PrimaryFabricLocation - The primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // RecoveryFabricLocation - The recovery fabric location. + RecoveryFabricLocation *string `json:"recoveryFabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) MarshalJSON() ([]byte, error) { + atanms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if atanms.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = atanms.PrimaryFabricLocation + } + if atanms.RecoveryFabricLocation != nil { + objectMap["recoveryFabricLocation"] = atanms.RecoveryFabricLocation + } + if atanms.InstanceType != "" { + objectMap["instanceType"] = atanms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return &atanms, true +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &atanms, true +} + +// AzureToAzureUpdateNetworkMappingInput updates network mappings input. +type AzureToAzureUpdateNetworkMappingInput struct { + // PrimaryNetworkID - The primary azure vnet Id. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + ataunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if ataunmi.PrimaryNetworkID != nil { + objectMap["primaryNetworkId"] = ataunmi.PrimaryNetworkID + } + if ataunmi.InstanceType != "" { + objectMap["instanceType"] = ataunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return &ataunmi, true +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &ataunmi, true +} + +// AzureToAzureVMSyncedConfigDetails azure to Azure VM synced configuration details. +type AzureToAzureVMSyncedConfigDetails struct { + // Tags - The Azure VM tags. + Tags map[string]*string `json:"tags"` + // InputEndpoints - The Azure VM input endpoints. + InputEndpoints *[]InputEndpoint `json:"inputEndpoints,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureVMSyncedConfigDetails. +func (atavscd AzureToAzureVMSyncedConfigDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if atavscd.Tags != nil { + objectMap["tags"] = atavscd.Tags + } + if atavscd.InputEndpoints != nil { + objectMap["inputEndpoints"] = atavscd.InputEndpoints + } + return json.Marshal(objectMap) +} + +// AzureVMDiskDetails disk details for E2A provider. +type AzureVMDiskDetails struct { + // VhdType - VHD type. + VhdType *string `json:"vhdType,omitempty"` + // VhdID - The VHD id. + VhdID *string `json:"vhdId,omitempty"` + // DiskID - The disk resource id. + DiskID *string `json:"diskId,omitempty"` + // VhdName - VHD name. + VhdName *string `json:"vhdName,omitempty"` + // MaxSizeMB - Max side in MB. + MaxSizeMB *string `json:"maxSizeMB,omitempty"` + // TargetDiskLocation - Blob uri of the Azure disk. + TargetDiskLocation *string `json:"targetDiskLocation,omitempty"` + // TargetDiskName - The target Azure disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` + // LunID - Ordinal\LunId of the disk for the Azure VM. + LunID *string `json:"lunId,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// ComputeSizeErrorDetails represents the error used to indicate why the target compute size is not +// applicable. +type ComputeSizeErrorDetails struct { + // Message - The error message. + Message *string `json:"message,omitempty"` + // Severity - The severity of the error. + Severity *string `json:"severity,omitempty"` +} + +// BasicConfigurationSettings replication provider specific settings. +type BasicConfigurationSettings interface { + AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) + AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) + AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) + AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) + AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) + AsConfigurationSettings() (*ConfigurationSettings, bool) +} + +// ConfigurationSettings replication provider specific settings. +type ConfigurationSettings struct { + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicConfigurationSettings(body []byte) (BasicConfigurationSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeHyperVVirtualMachine): + var hvvmd HyperVVirtualMachineDetails + err := json.Unmarshal(body, &hvvmd) + return hvvmd, err + case string(InstanceTypeReplicationGroupDetails): + var rgd ReplicationGroupDetails + err := json.Unmarshal(body, &rgd) + return rgd, err + case string(InstanceTypeVmmVirtualMachine): + var vvmd VmmVirtualMachineDetails + err := json.Unmarshal(body, &vvmd) + return vvmd, err + case string(InstanceTypeVMwareVirtualMachine): + var vmvmd VMwareVirtualMachineDetails + err := json.Unmarshal(body, &vmvmd) + return vmvmd, err + default: + var cs ConfigurationSettings + err := json.Unmarshal(body, &cs) + return cs, err + } +} +func unmarshalBasicConfigurationSettingsArray(body []byte) ([]BasicConfigurationSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + csArray := make([]BasicConfigurationSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cs, err := unmarshalBasicConfigurationSettings(*rawMessage) + if err != nil { + return nil, err + } + csArray[index] = cs + } + return csArray, nil +} + +// MarshalJSON is the custom marshaler for ConfigurationSettings. +func (cs ConfigurationSettings) MarshalJSON() ([]byte, error) { + cs.InstanceType = InstanceTypeConfigurationSettings + objectMap := make(map[string]interface{}) + if cs.InstanceType != "" { + objectMap["instanceType"] = cs.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return &cs, true +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &cs, true +} + +// ConfigureAlertRequest request to configure alerts for the system. +type ConfigureAlertRequest struct { + // Properties - The properties of a configure alert request. + Properties *ConfigureAlertRequestProperties `json:"properties,omitempty"` +} + +// ConfigureAlertRequestProperties properties of a configure alert request. +type ConfigureAlertRequestProperties struct { + // SendToOwners - A value indicating whether to send email to subscription administrator. + SendToOwners *string `json:"sendToOwners,omitempty"` + // CustomEmailAddresses - The custom email address for sending emails. + CustomEmailAddresses *[]string `json:"customEmailAddresses,omitempty"` + // Locale - The locale for the email notification. + Locale *string `json:"locale,omitempty"` +} + +// ConsistencyCheckTaskDetails this class contains monitoring details of all the inconsistent Protected +// Entities in Vmm. +type ConsistencyCheckTaskDetails struct { + // VMDetails - The list of inconsistent Vm details. + VMDetails *[]InconsistentVMDetails `json:"vmDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) MarshalJSON() ([]byte, error) { + cctd.InstanceType = InstanceTypeConsistencyCheckTaskDetails + objectMap := make(map[string]interface{}) + if cctd.VMDetails != nil { + objectMap["vmDetails"] = cctd.VMDetails + } + if cctd.InstanceType != "" { + objectMap["instanceType"] = cctd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return &cctd, true +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &cctd, true +} + +// CreateNetworkMappingInput create network mappings input. +type CreateNetworkMappingInput struct { + // Properties - Input properties for creating network mapping. + Properties *CreateNetworkMappingInputProperties `json:"properties,omitempty"` +} + +// CreateNetworkMappingInputProperties common input details for network mapping operation. +type CreateNetworkMappingInputProperties struct { + // RecoveryFabricName - Recovery fabric Name. + RecoveryFabricName *string `json:"recoveryFabricName,omitempty"` + // RecoveryNetworkID - Recovery network Id. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // FabricSpecificDetails - Fabric specific input properties. + FabricSpecificDetails BasicFabricSpecificCreateNetworkMappingInput `json:"fabricSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateNetworkMappingInputProperties struct. +func (cnmip *CreateNetworkMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryFabricName": + if v != nil { + var recoveryFabricName string + err = json.Unmarshal(*v, &recoveryFabricName) + if err != nil { + return err + } + cnmip.RecoveryFabricName = &recoveryFabricName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + cnmip.RecoveryNetworkID = &recoveryNetworkID + } + case "fabricSpecificDetails": + if v != nil { + fabricSpecificDetails, err := unmarshalBasicFabricSpecificCreateNetworkMappingInput(*v) + if err != nil { + return err + } + cnmip.FabricSpecificDetails = fabricSpecificDetails + } + } + } + + return nil +} + +// CreatePolicyInput protection Policy input. +type CreatePolicyInput struct { + // Properties - Policy creation properties. + Properties *CreatePolicyInputProperties `json:"properties,omitempty"` +} + +// CreatePolicyInputProperties policy creation properties. +type CreatePolicyInputProperties struct { + // ProviderSpecificInput - The ReplicationProviderSettings. + ProviderSpecificInput BasicPolicyProviderSpecificInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreatePolicyInputProperties struct. +func (cpip *CreatePolicyInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicPolicyProviderSpecificInput(*v) + if err != nil { + return err + } + cpip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionContainerInput create protection container input. +type CreateProtectionContainerInput struct { + // Properties - Create protection container input properties. + Properties *CreateProtectionContainerInputProperties `json:"properties,omitempty"` +} + +// CreateProtectionContainerInputProperties create protection container input properties. +type CreateProtectionContainerInputProperties struct { + // ProviderSpecificInput - Provider specific inputs for container creation. + ProviderSpecificInput *[]BasicReplicationProviderSpecificContainerCreationInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionContainerInputProperties struct. +func (cpcip *CreateProtectionContainerInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificContainerCreationInputArray(*v) + if err != nil { + return err + } + cpcip.ProviderSpecificInput = &providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionContainerMappingInput configure pairing input. +type CreateProtectionContainerMappingInput struct { + // Properties - Configure protection input properties. + Properties *CreateProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// CreateProtectionContainerMappingInputProperties configure pairing input properties. +type CreateProtectionContainerMappingInputProperties struct { + // TargetProtectionContainerID - The target unique protection container name. + TargetProtectionContainerID *string `json:"targetProtectionContainerId,omitempty"` + // PolicyID - Applicable policy. + PolicyID *string `json:"policyId,omitempty"` + // ProviderSpecificInput - Provider specific input for pairing. + ProviderSpecificInput BasicReplicationProviderSpecificContainerMappingInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionContainerMappingInputProperties struct. +func (cpcmip *CreateProtectionContainerMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetProtectionContainerId": + if v != nil { + var targetProtectionContainerID string + err = json.Unmarshal(*v, &targetProtectionContainerID) + if err != nil { + return err + } + cpcmip.TargetProtectionContainerID = &targetProtectionContainerID + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + cpcmip.PolicyID = &policyID + } + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificContainerMappingInput(*v) + if err != nil { + return err + } + cpcmip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionIntentInput create protection intent input. +type CreateProtectionIntentInput struct { + // Properties - Create protection intent input properties. + Properties *CreateProtectionIntentProperties `json:"properties,omitempty"` +} + +// CreateProtectionIntentProperties create protection intent input properties. +type CreateProtectionIntentProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For A2A provider, it will be A2ACreateProtectionIntentInput object. + ProviderSpecificDetails BasicCreateProtectionIntentProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionIntentProperties struct. +func (cpip *CreateProtectionIntentProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicCreateProtectionIntentProviderSpecificDetails(*v) + if err != nil { + return err + } + cpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicCreateProtectionIntentProviderSpecificDetails create protection intent provider specific input. +type BasicCreateProtectionIntentProviderSpecificDetails interface { + AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) + AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) +} + +// CreateProtectionIntentProviderSpecificDetails create protection intent provider specific input. +type CreateProtectionIntentProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails', 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicCreateProtectionIntentProviderSpecificDetails(body []byte) (BasicCreateProtectionIntentProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A): + var acpii A2ACreateProtectionIntentInput + err := json.Unmarshal(body, &acpii) + return acpii, err + default: + var cpipsd CreateProtectionIntentProviderSpecificDetails + err := json.Unmarshal(body, &cpipsd) + return cpipsd, err + } +} +func unmarshalBasicCreateProtectionIntentProviderSpecificDetailsArray(body []byte) ([]BasicCreateProtectionIntentProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + cpipsdArray := make([]BasicCreateProtectionIntentProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cpipsd, err := unmarshalBasicCreateProtectionIntentProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + cpipsdArray[index] = cpipsd + } + return cpipsdArray, nil +} + +// MarshalJSON is the custom marshaler for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) MarshalJSON() ([]byte, error) { + cpipsd.InstanceType = InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails + objectMap := make(map[string]interface{}) + if cpipsd.InstanceType != "" { + objectMap["instanceType"] = cpipsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACreateProtectionIntentInput is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) { + return nil, false +} + +// AsCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) { + return &cpipsd, true +} + +// AsBasicCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsBasicCreateProtectionIntentProviderSpecificDetails() (BasicCreateProtectionIntentProviderSpecificDetails, bool) { + return &cpipsd, true +} + +// CreateRecoveryPlanInput create recovery plan input class. +type CreateRecoveryPlanInput struct { + // Properties - Recovery plan creation properties. + Properties *CreateRecoveryPlanInputProperties `json:"properties,omitempty"` +} + +// CreateRecoveryPlanInputProperties recovery plan creation properties. +type CreateRecoveryPlanInputProperties struct { + // PrimaryFabricID - The primary fabric Id. + PrimaryFabricID *string `json:"primaryFabricId,omitempty"` + // RecoveryFabricID - The recovery fabric Id. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // FailoverDeploymentModel - The failover deployment model. Possible values include: 'NotApplicable', 'Classic', 'ResourceManager' + FailoverDeploymentModel FailoverDeploymentModel `json:"failoverDeploymentModel,omitempty"` + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` + // ProviderSpecificInput - The provider specific input. + ProviderSpecificInput *[]BasicRecoveryPlanProviderSpecificInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateRecoveryPlanInputProperties struct. +func (crpip *CreateRecoveryPlanInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "primaryFabricId": + if v != nil { + var primaryFabricID string + err = json.Unmarshal(*v, &primaryFabricID) + if err != nil { + return err + } + crpip.PrimaryFabricID = &primaryFabricID + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + crpip.RecoveryFabricID = &recoveryFabricID + } + case "failoverDeploymentModel": + if v != nil { + var failoverDeploymentModel FailoverDeploymentModel + err = json.Unmarshal(*v, &failoverDeploymentModel) + if err != nil { + return err + } + crpip.FailoverDeploymentModel = failoverDeploymentModel + } + case "groups": + if v != nil { + var groups []RecoveryPlanGroup + err = json.Unmarshal(*v, &groups) + if err != nil { + return err + } + crpip.Groups = &groups + } + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicRecoveryPlanProviderSpecificInputArray(*v) + if err != nil { + return err + } + crpip.ProviderSpecificInput = &providerSpecificInput + } + } + } + + return nil +} + +// CurrentJobDetails current job details of the migration item. +type CurrentJobDetails struct { + // JobName - READ-ONLY; The job name. + JobName *string `json:"jobName,omitempty"` + // JobID - READ-ONLY; The ARM Id of the job being executed. + JobID *string `json:"jobId,omitempty"` + // StartTime - READ-ONLY; The start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for CurrentJobDetails. +func (cjd CurrentJobDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CurrentScenarioDetails current scenario details of the protected entity. +type CurrentScenarioDetails struct { + // ScenarioName - Scenario name. + ScenarioName *string `json:"scenarioName,omitempty"` + // JobID - ARM Id of the job being executed. + JobID *string `json:"jobId,omitempty"` + // StartTime - Start time of the workflow. + StartTime *date.Time `json:"startTime,omitempty"` +} + +// DataStore the datastore details of the MT. +type DataStore struct { + // SymbolicName - The symbolic name of data store. + SymbolicName *string `json:"symbolicName,omitempty"` + // UUID - The uuid of data store. + UUID *string `json:"uuid,omitempty"` + // Capacity - The capacity of data store in GBs. + Capacity *string `json:"capacity,omitempty"` + // FreeSpace - The free space of data store in GBs. + FreeSpace *string `json:"freeSpace,omitempty"` + // Type - The type of data store. + Type *string `json:"type,omitempty"` +} + +// DisableProtectionInput disable protection input. +type DisableProtectionInput struct { + // Properties - Disable protection input properties. + Properties *DisableProtectionInputProperties `json:"properties,omitempty"` +} + +// DisableProtectionInputProperties disable protection input properties. +type DisableProtectionInputProperties struct { + // DisableProtectionReason - Disable protection reason. It can have values NotSpecified/MigrationComplete. Possible values include: 'NotSpecified', 'MigrationComplete' + DisableProtectionReason DisableProtectionReason `json:"disableProtectionReason,omitempty"` + // ReplicationProviderInput - Replication provider specific input. + ReplicationProviderInput BasicDisableProtectionProviderSpecificInput `json:"replicationProviderInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DisableProtectionInputProperties struct. +func (dpip *DisableProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "disableProtectionReason": + if v != nil { + var disableProtectionReason DisableProtectionReason + err = json.Unmarshal(*v, &disableProtectionReason) + if err != nil { + return err + } + dpip.DisableProtectionReason = disableProtectionReason + } + case "replicationProviderInput": + if v != nil { + replicationProviderInput, err := unmarshalBasicDisableProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + dpip.ReplicationProviderInput = replicationProviderInput + } + } + } + + return nil +} + +// BasicDisableProtectionProviderSpecificInput disable protection provider specific input. +type BasicDisableProtectionProviderSpecificInput interface { + AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) + AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) +} + +// DisableProtectionProviderSpecificInput disable protection provider specific input. +type DisableProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeDisableProtectionProviderSpecificInput', 'InstanceTypeInMage' + InstanceType InstanceTypeBasicDisableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicDisableProtectionProviderSpecificInput(body []byte) (BasicDisableProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInMage): + var imdppsi InMageDisableProtectionProviderSpecificInput + err := json.Unmarshal(body, &imdppsi) + return imdppsi, err + default: + var dppsi DisableProtectionProviderSpecificInput + err := json.Unmarshal(body, &dppsi) + return dppsi, err + } +} +func unmarshalBasicDisableProtectionProviderSpecificInputArray(body []byte) ([]BasicDisableProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dppsiArray := make([]BasicDisableProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + dppsi, err := unmarshalBasicDisableProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + dppsiArray[index] = dppsi + } + return dppsiArray, nil +} + +// MarshalJSON is the custom marshaler for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + dppsi.InstanceType = InstanceTypeDisableProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if dppsi.InstanceType != "" { + objectMap["instanceType"] = dppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) { + return &dppsi, true +} + +// AsBasicDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsBasicDisableProtectionProviderSpecificInput() (BasicDisableProtectionProviderSpecificInput, bool) { + return &dppsi, true +} + +// DiscoverProtectableItemRequest request to add a physical machine as a protectable item in a container. +type DiscoverProtectableItemRequest struct { + // Properties - The properties of a discover protectable item request. + Properties *DiscoverProtectableItemRequestProperties `json:"properties,omitempty"` +} + +// DiscoverProtectableItemRequestProperties discover protectable item properties. +type DiscoverProtectableItemRequestProperties struct { + // FriendlyName - The friendly name of the physical machine. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the physical machine to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // OsType - The OS type on the physical machine. + OsType *string `json:"osType,omitempty"` +} + +// DiskDetails onprem disk details data. +type DiskDetails struct { + // MaxSizeMB - The hard disk max size in MB. + MaxSizeMB *int64 `json:"maxSizeMB,omitempty"` + // VhdType - The type of the volume. + VhdType *string `json:"vhdType,omitempty"` + // VhdID - The VHD Id. + VhdID *string `json:"vhdId,omitempty"` + // VhdName - The VHD name. + VhdName *string `json:"vhdName,omitempty"` +} + +// DiskEncryptionInfo recovery disk encryption info (BEK and KEK). +type DiskEncryptionInfo struct { + // DiskEncryptionKeyInfo - The recovery KeyVault reference for secret. + DiskEncryptionKeyInfo *DiskEncryptionKeyInfo `json:"diskEncryptionKeyInfo,omitempty"` + // KeyEncryptionKeyInfo - The recovery KeyVault reference for key. + KeyEncryptionKeyInfo *KeyEncryptionKeyInfo `json:"keyEncryptionKeyInfo,omitempty"` +} + +// DiskEncryptionKeyInfo disk Encryption Key Information (BitLocker Encryption Key (BEK) on Windows). +type DiskEncryptionKeyInfo struct { + // SecretIdentifier - The secret url / identifier. + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // KeyVaultResourceArmID - The KeyVault resource ARM id for secret. + KeyVaultResourceArmID *string `json:"keyVaultResourceArmId,omitempty"` +} + +// DiskVolumeDetails volume details. +type DiskVolumeDetails struct { + // Label - The volume label. + Label *string `json:"label,omitempty"` + // Name - The volume name. + Name *string `json:"name,omitempty"` +} + +// Display contains the localized display information for this particular operation / action. These value +// will be used by several clients for (1) custom role definitions for RBAC; (2) complex query filters for +// the event service; and (3) audit history / records for management operations. +type Display struct { + // Provider - The provider. The localized friendly form of the resource provider name - it is expected to also include the publisher/company responsible. It should use Title Casing and begin with "Microsoft" for 1st party services. e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". + Provider *string `json:"provider,omitempty"` + // Resource - The resource. The localized friendly form of the resource related to this action/operation - it should match the public documentation for the resource provider. It should use Title Casing. This value should be unique for a particular URL type (e.g. nested types should *not* reuse their parent's display.resource field). e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual Machine VM Sizes" or "Scheduler Jobs". + Resource *string `json:"resource,omitempty"` + // Operation - The operation. The localized friendly name for the operation, as it should be shown to the user. It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use Title Casing. Prescriptive guidance: Read Create or Update Delete 'ActionName'. + Operation *string `json:"operation,omitempty"` + // Description - The description. The localized friendly description for the operation, as it should be shown to the user. It should be thorough, yet concise - it will be used in tool tips and detailed views. Prescriptive guidance for namespaces: Read any 'display.provider' resource Create or Update any 'display.provider' resource Delete any 'display.provider' resource Perform any other action on any 'display.provider' resource Prescriptive guidance for namespaces: Read any 'display.resource' Create or Update any 'display.resource' Delete any 'display.resource' 'ActionName' any 'display.resources'. + Description *string `json:"description,omitempty"` +} + +// DraDetails DRA details. +type DraDetails struct { + // ID - READ-ONLY; The DRA Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The DRA name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The DRA Bios Id. + BiosID *string `json:"biosId,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the DRA. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for DraDetails. +func (dd DraDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// EnableMigrationInput enable migration input. +type EnableMigrationInput struct { + // Properties - Enable migration input properties. + Properties *EnableMigrationInputProperties `json:"properties,omitempty"` +} + +// EnableMigrationInputProperties enable migration input properties. +type EnableMigrationInputProperties struct { + // PolicyID - The policy Id. + PolicyID *string `json:"policyId,omitempty"` + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicEnableMigrationProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EnableMigrationInputProperties struct. +func (emip *EnableMigrationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + emip.PolicyID = &policyID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEnableMigrationProviderSpecificInput(*v) + if err != nil { + return err + } + emip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicEnableMigrationProviderSpecificInput enable migration provider specific input. +type BasicEnableMigrationProviderSpecificInput interface { + AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) + AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) +} + +// EnableMigrationProviderSpecificInput enable migration provider specific input. +type EnableMigrationProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeEnableMigrationProviderSpecificInput', 'InstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEnableMigrationProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicEnableMigrationProviderSpecificInput(body []byte) (BasicEnableMigrationProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeVMwareCbt): + var vmcemi VMwareCbtEnableMigrationInput + err := json.Unmarshal(body, &vmcemi) + return vmcemi, err + default: + var empsi EnableMigrationProviderSpecificInput + err := json.Unmarshal(body, &empsi) + return empsi, err + } +} +func unmarshalBasicEnableMigrationProviderSpecificInputArray(body []byte) ([]BasicEnableMigrationProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + empsiArray := make([]BasicEnableMigrationProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + empsi, err := unmarshalBasicEnableMigrationProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + empsiArray[index] = empsi + } + return empsiArray, nil +} + +// MarshalJSON is the custom marshaler for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) MarshalJSON() ([]byte, error) { + empsi.InstanceType = InstanceTypeEnableMigrationProviderSpecificInput + objectMap := make(map[string]interface{}) + if empsi.InstanceType != "" { + objectMap["instanceType"] = empsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtEnableMigrationInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) { + return nil, false +} + +// AsEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) { + return &empsi, true +} + +// AsBasicEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsBasicEnableMigrationProviderSpecificInput() (BasicEnableMigrationProviderSpecificInput, bool) { + return &empsi, true +} + +// EnableProtectionInput enable protection input. +type EnableProtectionInput struct { + // Properties - Enable protection input properties. + Properties *EnableProtectionInputProperties `json:"properties,omitempty"` +} + +// EnableProtectionInputProperties enable protection input properties. +type EnableProtectionInputProperties struct { + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // ProtectableItemID - The protectable item Id. + ProtectableItemID *string `json:"protectableItemId,omitempty"` + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicEnableProtectionProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EnableProtectionInputProperties struct. +func (epip *EnableProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + epip.PolicyID = &policyID + } + case "protectableItemId": + if v != nil { + var protectableItemID string + err = json.Unmarshal(*v, &protectableItemID) + if err != nil { + return err + } + epip.ProtectableItemID = &protectableItemID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEnableProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + epip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicEnableProtectionProviderSpecificInput enable protection provider specific input. +type BasicEnableProtectionProviderSpecificInput interface { + AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) + AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) + AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) + AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) + AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) + AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) + AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) +} + +// EnableProtectionProviderSpecificInput enable protection provider specific input. +type EnableProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicEnableProtectionProviderSpecificInput(body []byte) (BasicEnableProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmepi A2ACrossClusterMigrationEnableProtectionInput + err := json.Unmarshal(body, &accmepi) + return accmepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A): + var aepi A2AEnableProtectionInput + err := json.Unmarshal(body, &aepi) + return aepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraepi HyperVReplicaAzureEnableProtectionInput + err := json.Unmarshal(body, &hvraepi) + return hvraepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2): + var imavepi InMageAzureV2EnableProtectionInput + err := json.Unmarshal(body, &imavepi) + return imavepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage): + var imepi InMageEnableProtectionInput + err := json.Unmarshal(body, &imepi) + return imepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm): + var imrepi InMageRcmEnableProtectionInput + err := json.Unmarshal(body, &imrepi) + return imrepi, err + default: + var eppsi EnableProtectionProviderSpecificInput + err := json.Unmarshal(body, &eppsi) + return eppsi, err + } +} +func unmarshalBasicEnableProtectionProviderSpecificInputArray(body []byte) ([]BasicEnableProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + eppsiArray := make([]BasicEnableProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + eppsi, err := unmarshalBasicEnableProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + eppsiArray[index] = eppsi + } + return eppsiArray, nil +} + +// MarshalJSON is the custom marshaler for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + eppsi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if eppsi.InstanceType != "" { + objectMap["instanceType"] = eppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return &eppsi, true +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &eppsi, true +} + +// EncryptionDetails encryption details for the fabric. +type EncryptionDetails struct { + // KekState - The key encryption key state for the Vmm. + KekState *string `json:"kekState,omitempty"` + // KekCertThumbprint - The key encryption key certificate thumbprint. + KekCertThumbprint *string `json:"kekCertThumbprint,omitempty"` + // KekCertExpiryDate - The key encryption key certificate expiry date. + KekCertExpiryDate *date.Time `json:"kekCertExpiryDate,omitempty"` +} + +// Event implements the Event class. +type Event struct { + autorest.Response `json:"-"` + // Properties - Event related data. + Properties *EventProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Event. +func (e Event) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if e.Properties != nil { + objectMap["properties"] = e.Properties + } + if e.Location != nil { + objectMap["location"] = e.Location + } + return json.Marshal(objectMap) +} + +// EventCollection collection of fabric details. +type EventCollection struct { + autorest.Response `json:"-"` + // Value - The list of events. + Value *[]Event `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// EventCollectionIterator provides access to a complete listing of Event values. +type EventCollectionIterator struct { + i int + page EventCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *EventCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EventCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *EventCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EventCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter EventCollectionIterator) Response() EventCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter EventCollectionIterator) Value() Event { + if !iter.page.NotDone() { + return Event{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the EventCollectionIterator type. +func NewEventCollectionIterator(page EventCollectionPage) EventCollectionIterator { + return EventCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ec EventCollection) IsEmpty() bool { + return ec.Value == nil || len(*ec.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ec EventCollection) hasNextLink() bool { + return ec.NextLink != nil && len(*ec.NextLink) != 0 +} + +// eventCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ec EventCollection) eventCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ec.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ec.NextLink))) +} + +// EventCollectionPage contains a page of Event values. +type EventCollectionPage struct { + fn func(context.Context, EventCollection) (EventCollection, error) + ec EventCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *EventCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EventCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ec) + if err != nil { + return err + } + page.ec = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *EventCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EventCollectionPage) NotDone() bool { + return !page.ec.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EventCollectionPage) Response() EventCollection { + return page.ec +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EventCollectionPage) Values() []Event { + if page.ec.IsEmpty() { + return nil + } + return *page.ec.Value +} + +// Creates a new instance of the EventCollectionPage type. +func NewEventCollectionPage(cur EventCollection, getNextPage func(context.Context, EventCollection) (EventCollection, error)) EventCollectionPage { + return EventCollectionPage{ + fn: getNextPage, + ec: cur, + } +} + +// EventProperties the properties of a monitoring event. +type EventProperties struct { + // EventCode - The Id of the monitoring event. + EventCode *string `json:"eventCode,omitempty"` + // Description - The event name. + Description *string `json:"description,omitempty"` + // EventType - The type of the event. for example: VM Health, Server Health, Job Failure etc. + EventType *string `json:"eventType,omitempty"` + // AffectedObjectFriendlyName - The friendly name of the source of the event on which it is raised (for example, VM, VMM etc). + AffectedObjectFriendlyName *string `json:"affectedObjectFriendlyName,omitempty"` + // AffectedObjectCorrelationID - The affected object correlationId for the event. + AffectedObjectCorrelationID *string `json:"affectedObjectCorrelationId,omitempty"` + // Severity - The severity of the event. + Severity *string `json:"severity,omitempty"` + // TimeOfOccurrence - The time of occurrence of the event. + TimeOfOccurrence *date.Time `json:"timeOfOccurrence,omitempty"` + // FabricID - The ARM ID of the fabric. + FabricID *string `json:"fabricId,omitempty"` + // ProviderSpecificDetails - The provider specific settings. + ProviderSpecificDetails BasicEventProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` + // EventSpecificDetails - The event specific settings. + EventSpecificDetails BasicEventSpecificDetails `json:"eventSpecificDetails,omitempty"` + // HealthErrors - The list of errors / warnings capturing details associated with the issue(s). + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EventProperties struct. +func (ep *EventProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "eventCode": + if v != nil { + var eventCode string + err = json.Unmarshal(*v, &eventCode) + if err != nil { + return err + } + ep.EventCode = &eventCode + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ep.Description = &description + } + case "eventType": + if v != nil { + var eventType string + err = json.Unmarshal(*v, &eventType) + if err != nil { + return err + } + ep.EventType = &eventType + } + case "affectedObjectFriendlyName": + if v != nil { + var affectedObjectFriendlyName string + err = json.Unmarshal(*v, &affectedObjectFriendlyName) + if err != nil { + return err + } + ep.AffectedObjectFriendlyName = &affectedObjectFriendlyName + } + case "affectedObjectCorrelationId": + if v != nil { + var affectedObjectCorrelationID string + err = json.Unmarshal(*v, &affectedObjectCorrelationID) + if err != nil { + return err + } + ep.AffectedObjectCorrelationID = &affectedObjectCorrelationID + } + case "severity": + if v != nil { + var severity string + err = json.Unmarshal(*v, &severity) + if err != nil { + return err + } + ep.Severity = &severity + } + case "timeOfOccurrence": + if v != nil { + var timeOfOccurrence date.Time + err = json.Unmarshal(*v, &timeOfOccurrence) + if err != nil { + return err + } + ep.TimeOfOccurrence = &timeOfOccurrence + } + case "fabricId": + if v != nil { + var fabricID string + err = json.Unmarshal(*v, &fabricID) + if err != nil { + return err + } + ep.FabricID = &fabricID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEventProviderSpecificDetails(*v) + if err != nil { + return err + } + ep.ProviderSpecificDetails = providerSpecificDetails + } + case "eventSpecificDetails": + if v != nil { + eventSpecificDetails, err := unmarshalBasicEventSpecificDetails(*v) + if err != nil { + return err + } + ep.EventSpecificDetails = eventSpecificDetails + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + ep.HealthErrors = &healthErrors + } + } + } + + return nil +} + +// BasicEventProviderSpecificDetails model class for provider specific details for an event. +type BasicEventProviderSpecificDetails interface { + AsA2AEventDetails() (*A2AEventDetails, bool) + AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) + AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) + AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) + AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) + AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) + AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) + AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) + AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) + AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) +} + +// EventProviderSpecificDetails model class for provider specific details for an event. +type EventProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicEventProviderSpecificDetails(body []byte) (BasicEventProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A): + var aed A2AEventDetails + err := json.Unmarshal(body, &aed) + return aed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012): + var hvr2ed HyperVReplica2012EventDetails + err := json.Unmarshal(body, &hvr2ed) + return hvr2ed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2): + var hvr2ed HyperVReplica2012R2EventDetails + err := json.Unmarshal(body, &hvr2ed) + return hvr2ed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure): + var hvraed HyperVReplicaAzureEventDetails + err := json.Unmarshal(body, &hvraed) + return hvraed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails): + var hvrbed HyperVReplicaBaseEventDetails + err := json.Unmarshal(body, &hvrbed) + return hvrbed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2): + var imaved InMageAzureV2EventDetails + err := json.Unmarshal(body, &imaved) + return imaved, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm): + var imred InMageRcmEventDetails + err := json.Unmarshal(body, &imred) + return imred, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback): + var imrfed InMageRcmFailbackEventDetails + err := json.Unmarshal(body, &imrfed) + return imrfed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt): + var vmced VMwareCbtEventDetails + err := json.Unmarshal(body, &vmced) + return vmced, err + default: + var epsd EventProviderSpecificDetails + err := json.Unmarshal(body, &epsd) + return epsd, err + } +} +func unmarshalBasicEventProviderSpecificDetailsArray(body []byte) ([]BasicEventProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + epsdArray := make([]BasicEventProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + epsd, err := unmarshalBasicEventProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + epsdArray[index] = epsd + } + return epsdArray, nil +} + +// MarshalJSON is the custom marshaler for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) MarshalJSON() ([]byte, error) { + epsd.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails + objectMap := make(map[string]interface{}) + if epsd.InstanceType != "" { + objectMap["instanceType"] = epsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return &epsd, true +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &epsd, true +} + +// EventQueryParameter implements the event query parameter. +type EventQueryParameter struct { + // EventCode - The source id of the events to be queried. + EventCode *string `json:"eventCode,omitempty"` + // Severity - The severity of the events to be queried. + Severity *string `json:"severity,omitempty"` + // EventType - The type of the events to be queried. + EventType *string `json:"eventType,omitempty"` + // FabricName - The affected object server id of the events to be queried. + FabricName *string `json:"fabricName,omitempty"` + // AffectedObjectFriendlyName - The affected object name of the events to be queried. + AffectedObjectFriendlyName *string `json:"affectedObjectFriendlyName,omitempty"` + // AffectedObjectCorrelationID - The affected object correlationId for the events to be queried. + AffectedObjectCorrelationID *string `json:"affectedObjectCorrelationId,omitempty"` + // StartTime - The start time of the time range within which the events are to be queried. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time of the time range within which the events are to be queried. + EndTime *date.Time `json:"endTime,omitempty"` +} + +// BasicEventSpecificDetails model class for event specific details for an event. +type BasicEventSpecificDetails interface { + AsJobStatusEventDetails() (*JobStatusEventDetails, bool) + AsEventSpecificDetails() (*EventSpecificDetails, bool) +} + +// EventSpecificDetails model class for event specific details for an event. +type EventSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeEventSpecificDetails', 'InstanceTypeJobStatus' + InstanceType InstanceTypeBasicEventSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicEventSpecificDetails(body []byte) (BasicEventSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeJobStatus): + var jsed JobStatusEventDetails + err := json.Unmarshal(body, &jsed) + return jsed, err + default: + var esd EventSpecificDetails + err := json.Unmarshal(body, &esd) + return esd, err + } +} +func unmarshalBasicEventSpecificDetailsArray(body []byte) ([]BasicEventSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + esdArray := make([]BasicEventSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + esd, err := unmarshalBasicEventSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + esdArray[index] = esd + } + return esdArray, nil +} + +// MarshalJSON is the custom marshaler for EventSpecificDetails. +func (esd EventSpecificDetails) MarshalJSON() ([]byte, error) { + esd.InstanceType = InstanceTypeEventSpecificDetails + objectMap := make(map[string]interface{}) + if esd.InstanceType != "" { + objectMap["instanceType"] = esd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsJobStatusEventDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsJobStatusEventDetails() (*JobStatusEventDetails, bool) { + return nil, false +} + +// AsEventSpecificDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsEventSpecificDetails() (*EventSpecificDetails, bool) { + return &esd, true +} + +// AsBasicEventSpecificDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsBasicEventSpecificDetails() (BasicEventSpecificDetails, bool) { + return &esd, true +} + +// ExistingProtectionProfile existing storage account input. +type ExistingProtectionProfile struct { + // ProtectionProfileID - The protection profile Arm Id. Throw error, if resource does not exists. + ProtectionProfileID *string `json:"protectionProfileId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) MarshalJSON() ([]byte, error) { + epp.ResourceType = ResourceTypeExisting + objectMap := make(map[string]interface{}) + if epp.ProtectionProfileID != nil { + objectMap["protectionProfileId"] = epp.ProtectionProfileID + } + if epp.ResourceType != "" { + objectMap["resourceType"] = epp.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return &epp, true +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return nil, false +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return nil, false +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &epp, true +} + +// ExistingRecoveryAvailabilitySet existing recovery availability set input. +type ExistingRecoveryAvailabilitySet struct { + // RecoveryAvailabilitySetID - The recovery availability set Id. Will throw error, if resource does not exist. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails', 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryAvailabilitySetCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) MarshalJSON() ([]byte, error) { + eras.ResourceType = ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if eras.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = eras.RecoveryAvailabilitySetID + } + if eras.ResourceType != "" { + objectMap["resourceType"] = eras.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryAvailabilitySet is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) { + return &eras, true +} + +// AsRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsBasicRecoveryAvailabilitySetCustomDetails() (BasicRecoveryAvailabilitySetCustomDetails, bool) { + return &eras, true +} + +// ExistingRecoveryProximityPlacementGroup existing recovery proximity placement group input. +type ExistingRecoveryProximityPlacementGroup struct { + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. Will throw error, if resource does not exist. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails', 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) MarshalJSON() ([]byte, error) { + erppg.ResourceType = ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if erppg.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = erppg.RecoveryProximityPlacementGroupID + } + if erppg.ResourceType != "" { + objectMap["resourceType"] = erppg.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryProximityPlacementGroup is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) { + return &erppg, true +} + +// AsRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsBasicRecoveryProximityPlacementGroupCustomDetails() (BasicRecoveryProximityPlacementGroupCustomDetails, bool) { + return &erppg, true +} + +// ExistingRecoveryRecoveryResourceGroup existing recovery resource group input. +type ExistingRecoveryRecoveryResourceGroup struct { + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails', 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryResourceGroupCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) MarshalJSON() ([]byte, error) { + errrg.ResourceType = ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if errrg.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = errrg.RecoveryResourceGroupID + } + if errrg.ResourceType != "" { + objectMap["resourceType"] = errrg.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryRecoveryResourceGroup is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) { + return &errrg, true +} + +// AsRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsBasicRecoveryResourceGroupCustomDetails() (BasicRecoveryResourceGroupCustomDetails, bool) { + return &errrg, true +} + +// ExistingRecoveryVirtualNetwork existing recovery virtual network input. +type ExistingRecoveryVirtualNetwork struct { + // RecoveryVirtualNetworkID - The recovery virtual network Id. Will throw error, if resource does not exist. + RecoveryVirtualNetworkID *string `json:"recoveryVirtualNetworkId,omitempty"` + // RecoverySubnetName - The recovery subnet name. + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) MarshalJSON() ([]byte, error) { + ervn.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if ervn.RecoveryVirtualNetworkID != nil { + objectMap["recoveryVirtualNetworkId"] = ervn.RecoveryVirtualNetworkID + } + if ervn.RecoverySubnetName != nil { + objectMap["recoverySubnetName"] = ervn.RecoverySubnetName + } + if ervn.ResourceType != "" { + objectMap["resourceType"] = ervn.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return &ervn, true +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &ervn, true +} + +// ExistingStorageAccount existing storage account input. +type ExistingStorageAccount struct { + // AzureStorageAccountID - The storage account Arm Id. Throw error, if resource does not exists. + AzureStorageAccountID *string `json:"azureStorageAccountId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails', 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicStorageAccountCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingStorageAccount. +func (esa ExistingStorageAccount) MarshalJSON() ([]byte, error) { + esa.ResourceType = ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if esa.AzureStorageAccountID != nil { + objectMap["azureStorageAccountId"] = esa.AzureStorageAccountID + } + if esa.ResourceType != "" { + objectMap["resourceType"] = esa.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingStorageAccount is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsExistingStorageAccount() (*ExistingStorageAccount, bool) { + return &esa, true +} + +// AsStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) { + return nil, false +} + +// AsBasicStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsBasicStorageAccountCustomDetails() (BasicStorageAccountCustomDetails, bool) { + return &esa, true +} + +// ExportJobDetails this class represents details for export jobs workflow. +type ExportJobDetails struct { + // BlobURI - BlobUri of the exported jobs. + BlobURI *string `json:"blobUri,omitempty"` + // SasToken - The sas token to access blob. + SasToken *string `json:"sasToken,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExportJobDetails. +func (ejd ExportJobDetails) MarshalJSON() ([]byte, error) { + ejd.InstanceType = InstanceTypeExportJobDetails + objectMap := make(map[string]interface{}) + if ejd.BlobURI != nil { + objectMap["blobUri"] = ejd.BlobURI + } + if ejd.SasToken != nil { + objectMap["sasToken"] = ejd.SasToken + } + if ejd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = ejd.AffectedObjectDetails + } + if ejd.InstanceType != "" { + objectMap["instanceType"] = ejd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return &ejd, true +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &ejd, true +} + +// Fabric fabric definition. +type Fabric struct { + autorest.Response `json:"-"` + // Properties - Fabric related data. + Properties *FabricProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Fabric. +func (f Fabric) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if f.Properties != nil { + objectMap["properties"] = f.Properties + } + if f.Location != nil { + objectMap["location"] = f.Location + } + return json.Marshal(objectMap) +} + +// FabricCollection collection of fabric details. +type FabricCollection struct { + autorest.Response `json:"-"` + // Value - The fabric details. + Value *[]Fabric `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// FabricCollectionIterator provides access to a complete listing of Fabric values. +type FabricCollectionIterator struct { + i int + page FabricCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *FabricCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FabricCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *FabricCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter FabricCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter FabricCollectionIterator) Response() FabricCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter FabricCollectionIterator) Value() Fabric { + if !iter.page.NotDone() { + return Fabric{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the FabricCollectionIterator type. +func NewFabricCollectionIterator(page FabricCollectionPage) FabricCollectionIterator { + return FabricCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (fc FabricCollection) IsEmpty() bool { + return fc.Value == nil || len(*fc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (fc FabricCollection) hasNextLink() bool { + return fc.NextLink != nil && len(*fc.NextLink) != 0 +} + +// fabricCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (fc FabricCollection) fabricCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !fc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(fc.NextLink))) +} + +// FabricCollectionPage contains a page of Fabric values. +type FabricCollectionPage struct { + fn func(context.Context, FabricCollection) (FabricCollection, error) + fc FabricCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *FabricCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FabricCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.fc) + if err != nil { + return err + } + page.fc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *FabricCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page FabricCollectionPage) NotDone() bool { + return !page.fc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page FabricCollectionPage) Response() FabricCollection { + return page.fc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page FabricCollectionPage) Values() []Fabric { + if page.fc.IsEmpty() { + return nil + } + return *page.fc.Value +} + +// Creates a new instance of the FabricCollectionPage type. +func NewFabricCollectionPage(cur FabricCollection, getNextPage func(context.Context, FabricCollection) (FabricCollection, error)) FabricCollectionPage { + return FabricCollectionPage{ + fn: getNextPage, + fc: cur, + } +} + +// FabricCreationInput site details provided during the time of site creation. +type FabricCreationInput struct { + // Properties - Fabric creation input. + Properties *FabricCreationInputProperties `json:"properties,omitempty"` +} + +// FabricCreationInputProperties properties of site details provided during the time of site creation. +type FabricCreationInputProperties struct { + // CustomDetails - Fabric provider specific creation input. + CustomDetails BasicFabricSpecificCreationInput `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for FabricCreationInputProperties struct. +func (fcip *FabricCreationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicFabricSpecificCreationInput(*v) + if err != nil { + return err + } + fcip.CustomDetails = customDetails + } + } + } + + return nil +} + +// FabricProperties fabric properties. +type FabricProperties struct { + // FriendlyName - Friendly name of the fabric. + FriendlyName *string `json:"friendlyName,omitempty"` + // EncryptionDetails - Encryption details for the fabric. + EncryptionDetails *EncryptionDetails `json:"encryptionDetails,omitempty"` + // RolloverEncryptionDetails - Rollover encryption details for the fabric. + RolloverEncryptionDetails *EncryptionDetails `json:"rolloverEncryptionDetails,omitempty"` + // InternalIdentifier - Dra Registration Id. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // BcdrState - BCDR state of the fabric. + BcdrState *string `json:"bcdrState,omitempty"` + // CustomDetails - Fabric specific settings. + CustomDetails BasicFabricSpecificDetails `json:"customDetails,omitempty"` + // HealthErrorDetails - Fabric health error details. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // Health - Health of fabric. + Health *string `json:"health,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for FabricProperties struct. +func (fp *FabricProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + fp.FriendlyName = &friendlyName + } + case "encryptionDetails": + if v != nil { + var encryptionDetails EncryptionDetails + err = json.Unmarshal(*v, &encryptionDetails) + if err != nil { + return err + } + fp.EncryptionDetails = &encryptionDetails + } + case "rolloverEncryptionDetails": + if v != nil { + var rolloverEncryptionDetails EncryptionDetails + err = json.Unmarshal(*v, &rolloverEncryptionDetails) + if err != nil { + return err + } + fp.RolloverEncryptionDetails = &rolloverEncryptionDetails + } + case "internalIdentifier": + if v != nil { + var internalIdentifier string + err = json.Unmarshal(*v, &internalIdentifier) + if err != nil { + return err + } + fp.InternalIdentifier = &internalIdentifier + } + case "bcdrState": + if v != nil { + var bcdrState string + err = json.Unmarshal(*v, &bcdrState) + if err != nil { + return err + } + fp.BcdrState = &bcdrState + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicFabricSpecificDetails(*v) + if err != nil { + return err + } + fp.CustomDetails = customDetails + } + case "healthErrorDetails": + if v != nil { + var healthErrorDetails []HealthError + err = json.Unmarshal(*v, &healthErrorDetails) + if err != nil { + return err + } + fp.HealthErrorDetails = &healthErrorDetails + } + case "health": + if v != nil { + var health string + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + fp.Health = &health + } + } + } + + return nil +} + +// FabricQueryParameter query parameter to get fabric. +type FabricQueryParameter struct { + // ZoneToZoneMappings - A value indicating whether the zone to zone mappings are to be returned. + ZoneToZoneMappings *string `json:"zoneToZoneMappings,omitempty"` + // FetchAgentDetails - A value indicating whether the agent details are to be fetched. + FetchAgentDetails *string `json:"fetchAgentDetails,omitempty"` + // BiosID - The BIOS Id to be used for fetching agent details. + BiosID *string `json:"biosId,omitempty"` + // Fqdn - The FQDN to be used for fetching agent details. + Fqdn *string `json:"fqdn,omitempty"` + // DiscoveryType - The type of the discovered machine to be used for fetching agent details. + DiscoveryType *string `json:"discoveryType,omitempty"` + // OsType - The OS type to be used for fetching agent details. + OsType *string `json:"osType,omitempty"` +} + +// FabricReplicationGroupTaskDetails this class represents the fabric replication group task details. +type FabricReplicationGroupTaskDetails struct { + // SkippedReason - The skipped reason. + SkippedReason *string `json:"skippedReason,omitempty"` + // SkippedReasonString - The skipped reason string. + SkippedReasonString *string `json:"skippedReasonString,omitempty"` + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) MarshalJSON() ([]byte, error) { + frgtd.InstanceType = InstanceTypeFabricReplicationGroupTaskDetails + objectMap := make(map[string]interface{}) + if frgtd.SkippedReason != nil { + objectMap["skippedReason"] = frgtd.SkippedReason + } + if frgtd.SkippedReasonString != nil { + objectMap["skippedReasonString"] = frgtd.SkippedReasonString + } + if frgtd.JobTask != nil { + objectMap["jobTask"] = frgtd.JobTask + } + if frgtd.InstanceType != "" { + objectMap["instanceType"] = frgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return &frgtd, true +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &frgtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &frgtd, true +} + +// BasicFabricSpecificCreateNetworkMappingInput input details specific to fabrics during Network Mapping. +type BasicFabricSpecificCreateNetworkMappingInput interface { + AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) + AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) + AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) + AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) +} + +// FabricSpecificCreateNetworkMappingInput input details specific to fabrics during Network Mapping. +type FabricSpecificCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificCreateNetworkMappingInput(body []byte) (BasicFabricSpecificCreateNetworkMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAzureToAzure): + var atacnmi AzureToAzureCreateNetworkMappingInput + err := json.Unmarshal(body, &atacnmi) + return atacnmi, err + case string(InstanceTypeVmmToAzure): + var vtacnmi VmmToAzureCreateNetworkMappingInput + err := json.Unmarshal(body, &vtacnmi) + return vtacnmi, err + case string(InstanceTypeVmmToVmm): + var vtvcnmi VmmToVmmCreateNetworkMappingInput + err := json.Unmarshal(body, &vtvcnmi) + return vtvcnmi, err + default: + var fscnmi FabricSpecificCreateNetworkMappingInput + err := json.Unmarshal(body, &fscnmi) + return fscnmi, err + } +} +func unmarshalBasicFabricSpecificCreateNetworkMappingInputArray(body []byte) ([]BasicFabricSpecificCreateNetworkMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fscnmiArray := make([]BasicFabricSpecificCreateNetworkMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fscnmi, err := unmarshalBasicFabricSpecificCreateNetworkMappingInput(*rawMessage) + if err != nil { + return nil, err + } + fscnmiArray[index] = fscnmi + } + return fscnmiArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + fscnmi.InstanceType = InstanceTypeFabricSpecificCreateNetworkMappingInput + objectMap := make(map[string]interface{}) + if fscnmi.InstanceType != "" { + objectMap["instanceType"] = fscnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return &fscnmi, true +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &fscnmi, true +} + +// BasicFabricSpecificCreationInput fabric provider specific settings. +type BasicFabricSpecificCreationInput interface { + AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) + AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) + AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) + AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) +} + +// FabricSpecificCreationInput fabric provider specific settings. +type FabricSpecificCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreationInput', 'InstanceTypeAzure', 'InstanceTypeInMageRcm', 'InstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificCreationInput(body []byte) (BasicFabricSpecificCreationInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAzure): + var afci AzureFabricCreationInput + err := json.Unmarshal(body, &afci) + return afci, err + case string(InstanceTypeInMageRcm): + var imrfci InMageRcmFabricCreationInput + err := json.Unmarshal(body, &imrfci) + return imrfci, err + case string(InstanceTypeVMwareV2): + var vmvfci VMwareV2FabricCreationInput + err := json.Unmarshal(body, &vmvfci) + return vmvfci, err + default: + var fsci FabricSpecificCreationInput + err := json.Unmarshal(body, &fsci) + return fsci, err + } +} +func unmarshalBasicFabricSpecificCreationInputArray(body []byte) ([]BasicFabricSpecificCreationInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsciArray := make([]BasicFabricSpecificCreationInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsci, err := unmarshalBasicFabricSpecificCreationInput(*rawMessage) + if err != nil { + return nil, err + } + fsciArray[index] = fsci + } + return fsciArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) MarshalJSON() ([]byte, error) { + fsci.InstanceType = InstanceTypeFabricSpecificCreationInput + objectMap := make(map[string]interface{}) + if fsci.InstanceType != "" { + objectMap["instanceType"] = fsci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return &fsci, true +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &fsci, true +} + +// BasicFabricSpecificDetails fabric specific details. +type BasicFabricSpecificDetails interface { + AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) + AsHyperVSiteDetails() (*HyperVSiteDetails, bool) + AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) + AsVmmDetails() (*VmmDetails, bool) + AsVMwareDetails() (*VMwareDetails, bool) + AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) + AsFabricSpecificDetails() (*FabricSpecificDetails, bool) +} + +// FabricSpecificDetails fabric specific details. +type FabricSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificDetails(body []byte) (BasicFabricSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure): + var afsd AzureFabricSpecificDetails + err := json.Unmarshal(body, &afsd) + return afsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite): + var hvsd HyperVSiteDetails + err := json.Unmarshal(body, &hvsd) + return hvsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm): + var imrfsd InMageRcmFabricSpecificDetails + err := json.Unmarshal(body, &imrfsd) + return imrfsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM): + var vd VmmDetails + err := json.Unmarshal(body, &vd) + return vd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware): + var vmd VMwareDetails + err := json.Unmarshal(body, &vmd) + return vmd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2): + var vmvfsd VMwareV2FabricSpecificDetails + err := json.Unmarshal(body, &vmvfsd) + return vmvfsd, err + default: + var fsd FabricSpecificDetails + err := json.Unmarshal(body, &fsd) + return fsd, err + } +} +func unmarshalBasicFabricSpecificDetailsArray(body []byte) ([]BasicFabricSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsdArray := make([]BasicFabricSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsd, err := unmarshalBasicFabricSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + fsdArray[index] = fsd + } + return fsdArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificDetails. +func (fsd FabricSpecificDetails) MarshalJSON() ([]byte, error) { + fsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails + objectMap := make(map[string]interface{}) + if fsd.InstanceType != "" { + objectMap["instanceType"] = fsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return &fsd, true +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &fsd, true +} + +// BasicFabricSpecificUpdateNetworkMappingInput input details specific to fabrics during Network Mapping. +type BasicFabricSpecificUpdateNetworkMappingInput interface { + AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) + AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) + AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) + AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) +} + +// FabricSpecificUpdateNetworkMappingInput input details specific to fabrics during Network Mapping. +type FabricSpecificUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificUpdateNetworkMappingInput(body []byte) (BasicFabricSpecificUpdateNetworkMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure): + var ataunmi AzureToAzureUpdateNetworkMappingInput + err := json.Unmarshal(body, &ataunmi) + return ataunmi, err + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure): + var vtaunmi VmmToAzureUpdateNetworkMappingInput + err := json.Unmarshal(body, &vtaunmi) + return vtaunmi, err + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm): + var vtvunmi VmmToVmmUpdateNetworkMappingInput + err := json.Unmarshal(body, &vtvunmi) + return vtvunmi, err + default: + var fsunmi FabricSpecificUpdateNetworkMappingInput + err := json.Unmarshal(body, &fsunmi) + return fsunmi, err + } +} +func unmarshalBasicFabricSpecificUpdateNetworkMappingInputArray(body []byte) ([]BasicFabricSpecificUpdateNetworkMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsunmiArray := make([]BasicFabricSpecificUpdateNetworkMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsunmi, err := unmarshalBasicFabricSpecificUpdateNetworkMappingInput(*rawMessage) + if err != nil { + return nil, err + } + fsunmiArray[index] = fsunmi + } + return fsunmiArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + fsunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput + objectMap := make(map[string]interface{}) + if fsunmi.InstanceType != "" { + objectMap["instanceType"] = fsunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return &fsunmi, true +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &fsunmi, true +} + +// FailoverJobDetails this class represents the details for a failover job. +type FailoverJobDetails struct { + // ProtectedItemDetails - The test VM details. + ProtectedItemDetails *[]FailoverReplicationProtectedItemDetails `json:"protectedItemDetails,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for FailoverJobDetails. +func (fjd FailoverJobDetails) MarshalJSON() ([]byte, error) { + fjd.InstanceType = InstanceTypeFailoverJobDetails + objectMap := make(map[string]interface{}) + if fjd.ProtectedItemDetails != nil { + objectMap["protectedItemDetails"] = fjd.ProtectedItemDetails + } + if fjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = fjd.AffectedObjectDetails + } + if fjd.InstanceType != "" { + objectMap["instanceType"] = fjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return &fjd, true +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &fjd, true +} + +// FailoverProcessServerRequest request to failover a process server. +type FailoverProcessServerRequest struct { + // Properties - The properties of the PS Failover request. + Properties *FailoverProcessServerRequestProperties `json:"properties,omitempty"` +} + +// FailoverProcessServerRequestProperties the properties of the Failover Process Server request. +type FailoverProcessServerRequestProperties struct { + // ContainerName - The container identifier. + ContainerName *string `json:"containerName,omitempty"` + // SourceProcessServerID - The source process server. + SourceProcessServerID *string `json:"sourceProcessServerId,omitempty"` + // TargetProcessServerID - The new process server. + TargetProcessServerID *string `json:"targetProcessServerId,omitempty"` + // VmsToMigrate - The VMS to migrate. + VmsToMigrate *[]string `json:"vmsToMigrate,omitempty"` + // UpdateType - A value for failover type. It can be systemlevel/serverlevel. + UpdateType *string `json:"updateType,omitempty"` +} + +// FailoverReplicationProtectedItemDetails failover details for a replication protected item. +type FailoverReplicationProtectedItemDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // FriendlyName - The friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // TestVMName - The test Vm name. + TestVMName *string `json:"testVmName,omitempty"` + // TestVMFriendlyName - The test Vm friendly name. + TestVMFriendlyName *string `json:"testVmFriendlyName,omitempty"` + // NetworkConnectionStatus - The network connection status. + NetworkConnectionStatus *string `json:"networkConnectionStatus,omitempty"` + // NetworkFriendlyName - The network friendly name. + NetworkFriendlyName *string `json:"networkFriendlyName,omitempty"` + // Subnet - The network subnet. + Subnet *string `json:"subnet,omitempty"` + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // RecoveryPointTime - The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` +} + +// BasicGroupTaskDetails this class represents the group task details when parent child relationship exists in the +// drill down. +type BasicGroupTaskDetails interface { + AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) + AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) + AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) + AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) + AsGroupTaskDetails() (*GroupTaskDetails, bool) +} + +// GroupTaskDetails this class represents the group task details when parent child relationship exists in the +// drill down. +type GroupTaskDetails struct { + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicGroupTaskDetails(body []byte) (BasicGroupTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInlineWorkflowTaskDetails): + var iwtd InlineWorkflowTaskDetails + err := json.Unmarshal(body, &iwtd) + return iwtd, err + case string(InstanceTypeRecoveryPlanGroupTaskDetails): + var rpgtd RecoveryPlanGroupTaskDetails + err := json.Unmarshal(body, &rpgtd) + return rpgtd, err + case string(InstanceTypeRecoveryPlanShutdownGroupTaskDetails): + var rpsgtd RecoveryPlanShutdownGroupTaskDetails + err := json.Unmarshal(body, &rpsgtd) + return rpsgtd, err + default: + var gtd GroupTaskDetails + err := json.Unmarshal(body, >d) + return gtd, err + } +} +func unmarshalBasicGroupTaskDetailsArray(body []byte) ([]BasicGroupTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + gtdArray := make([]BasicGroupTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + gtd, err := unmarshalBasicGroupTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + gtdArray[index] = gtd + } + return gtdArray, nil +} + +// MarshalJSON is the custom marshaler for GroupTaskDetails. +func (gtd GroupTaskDetails) MarshalJSON() ([]byte, error) { + gtd.InstanceType = InstanceTypeGroupTaskDetails + objectMap := make(map[string]interface{}) + if gtd.ChildTasks != nil { + objectMap["childTasks"] = gtd.ChildTasks + } + if gtd.InstanceType != "" { + objectMap["instanceType"] = gtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return >d, true +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return >d, true +} + +// HealthError health Error. +type HealthError struct { + // InnerHealthErrors - The inner health errors. HealthError having a list of HealthError as child errors is problematic. InnerHealthError is used because this will prevent an infinite loop of structures when Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health errors and all API consumers can utilize this in the same fashion as Exception -> InnerException. + InnerHealthErrors *[]InnerHealthError `json:"innerHealthErrors,omitempty"` + // ErrorSource - Source of error. + ErrorSource *string `json:"errorSource,omitempty"` + // ErrorType - Type of error. + ErrorType *string `json:"errorType,omitempty"` + // ErrorLevel - Level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // ErrorCategory - Category of error. + ErrorCategory *string `json:"errorCategory,omitempty"` + // ErrorCode - Error code. + ErrorCode *string `json:"errorCode,omitempty"` + // SummaryMessage - Summary message of the entity. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // ErrorMessage - Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // CreationTimeUtc - Error creation time (UTC). + CreationTimeUtc *date.Time `json:"creationTimeUtc,omitempty"` + // RecoveryProviderErrorMessage - DRA error message. + RecoveryProviderErrorMessage *string `json:"recoveryProviderErrorMessage,omitempty"` + // EntityID - ID of the entity. + EntityID *string `json:"entityId,omitempty"` + // ErrorID - The health error unique id. + ErrorID *string `json:"errorId,omitempty"` + // CustomerResolvability - Value indicating whether the health error is customer resolvable. Possible values include: 'Allowed', 'NotAllowed' + CustomerResolvability HealthErrorCustomerResolvability `json:"customerResolvability,omitempty"` +} + +// HealthErrorSummary class to define the summary of the health error details. +type HealthErrorSummary struct { + // SummaryCode - The code of the health error. + SummaryCode *string `json:"summaryCode,omitempty"` + // Category - The category of the health error. Possible values include: 'HealthErrorCategoryNone', 'HealthErrorCategoryReplication', 'HealthErrorCategoryTestFailover', 'HealthErrorCategoryConfiguration', 'HealthErrorCategoryFabricInfrastructure', 'HealthErrorCategoryVersionExpiry', 'HealthErrorCategoryAgentAutoUpdateInfra', 'HealthErrorCategoryAgentAutoUpdateArtifactDeleted', 'HealthErrorCategoryAgentAutoUpdateRunAsAccount', 'HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry', 'HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired' + Category HealthErrorCategory `json:"category,omitempty"` + // Severity - Severity of error. Possible values include: 'NONE', 'Warning', 'Error', 'Info' + Severity Severity `json:"severity,omitempty"` + // SummaryMessage - The summary message of the health error. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // AffectedResourceType - The type of affected ARM resource. + AffectedResourceType *string `json:"affectedResourceType,omitempty"` + // AffectedResourceSubtype - The sub type of any subcomponent within the ARM resource that this might be applicable. Value remains null if not applicable. + AffectedResourceSubtype *string `json:"affectedResourceSubtype,omitempty"` + // AffectedResourceCorrelationIds - The list of affected resource correlation Ids. This can be used to uniquely identify the count of items affected by a specific category and severity as well as count of item affected by an specific issue. + AffectedResourceCorrelationIds *[]string `json:"affectedResourceCorrelationIds,omitempty"` +} + +// HyperVHostDetails hyper-V host details. +type HyperVHostDetails struct { + // ID - READ-ONLY; The Hyper-V host Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The Hyper-V host name. + Name *string `json:"name,omitempty"` + // MarsAgentVersion - READ-ONLY; The Mars agent version. + MarsAgentVersion *string `json:"marsAgentVersion,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVHostDetails. +func (hvhd HyperVHostDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// HyperVReplica2012EventDetails model class for event details of a HyperVReplica E2E event. +type HyperVReplica2012EventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) MarshalJSON() ([]byte, error) { + hvr2ed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvr2ed.ContainerName != nil { + objectMap["containerName"] = hvr2ed.ContainerName + } + if hvr2ed.FabricName != nil { + objectMap["fabricName"] = hvr2ed.FabricName + } + if hvr2ed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvr2ed.RemoteContainerName + } + if hvr2ed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvr2ed.RemoteFabricName + } + if hvr2ed.InstanceType != "" { + objectMap["instanceType"] = hvr2ed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return &hvr2ed, true +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvr2ed, true +} + +// HyperVReplica2012R2EventDetails model class for event details of a HyperVReplica blue E2E event. +type HyperVReplica2012R2EventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) MarshalJSON() ([]byte, error) { + hvr2ed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvr2ed.ContainerName != nil { + objectMap["containerName"] = hvr2ed.ContainerName + } + if hvr2ed.FabricName != nil { + objectMap["fabricName"] = hvr2ed.FabricName + } + if hvr2ed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvr2ed.RemoteContainerName + } + if hvr2ed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvr2ed.RemoteFabricName + } + if hvr2ed.InstanceType != "" { + objectMap["instanceType"] = hvr2ed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return &hvr2ed, true +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvr2ed, true +} + +// HyperVReplicaAzureApplyRecoveryPointInput applyRecoveryPoint input specific to HyperVReplicaAzure +// provider. +type HyperVReplicaAzureApplyRecoveryPointInput struct { + // PrimaryKekCertificatePfx - The primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - The secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + hvraarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraarpi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvraarpi.PrimaryKekCertificatePfx + } + if hvraarpi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvraarpi.SecondaryKekCertificatePfx + } + if hvraarpi.InstanceType != "" { + objectMap["instanceType"] = hvraarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return &hvraarpi, true +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &hvraarpi, true +} + +// HyperVReplicaAzureDiskInputDetails disk input details. +type HyperVReplicaAzureDiskInputDetails struct { + // DiskID - The DiskId. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The LogStorageAccountId. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// HyperVReplicaAzureEnableProtectionInput hyperVReplicaAzure specific enable protection input. +type HyperVReplicaAzureEnableProtectionInput struct { + // HvHostVMID - The Hyper-V host VM Id. + HvHostVMID *string `json:"hvHostVmId,omitempty"` + // VMName - The VM Name. + VMName *string `json:"vmName,omitempty"` + // OsType - The OS type associated with VM. + OsType *string `json:"osType,omitempty"` + // VhdID - The OS disk VHD id associated with VM. + VhdID *string `json:"vhdId,omitempty"` + // TargetStorageAccountID - The storage account Id. + TargetStorageAccountID *string `json:"targetStorageAccountId,omitempty"` + // TargetAzureNetworkID - The selected target Azure network Id. + TargetAzureNetworkID *string `json:"targetAzureNetworkId,omitempty"` + // TargetAzureSubnetID - The selected target Azure subnet Id. + TargetAzureSubnetID *string `json:"targetAzureSubnetId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // TargetAzureVMName - The target azure VM Name. + TargetAzureVMName *string `json:"targetAzureVmName,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DisksToInclude - The list of VHD Ids of disks to be protected. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // TargetAzureV1ResourceGroupID - The Id of the target resource group (for classic deployment) in which the failover VM is to be created. + TargetAzureV1ResourceGroupID *string `json:"targetAzureV1ResourceGroupId,omitempty"` + // TargetAzureV2ResourceGroupID - The Id of the target resource group (for resource manager deployment) in which the failover VM is to be created. + TargetAzureV2ResourceGroupID *string `json:"targetAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id for resource manager deployment. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetProximityPlacementGroupID - The proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisksForReplication - A value indicating whether managed disks should be used during replication. + UseManagedDisksForReplication *string `json:"useManagedDisksForReplication,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DisksToIncludeForManagedDisks - The disks to include list for managed disks. + DisksToIncludeForManagedDisks *[]HyperVReplicaAzureDiskInputDetails `json:"disksToIncludeForManagedDisks,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) MarshalJSON() ([]byte, error) { + hvraepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraepi.HvHostVMID != nil { + objectMap["hvHostVmId"] = hvraepi.HvHostVMID + } + if hvraepi.VMName != nil { + objectMap["vmName"] = hvraepi.VMName + } + if hvraepi.OsType != nil { + objectMap["osType"] = hvraepi.OsType + } + if hvraepi.VhdID != nil { + objectMap["vhdId"] = hvraepi.VhdID + } + if hvraepi.TargetStorageAccountID != nil { + objectMap["targetStorageAccountId"] = hvraepi.TargetStorageAccountID + } + if hvraepi.TargetAzureNetworkID != nil { + objectMap["targetAzureNetworkId"] = hvraepi.TargetAzureNetworkID + } + if hvraepi.TargetAzureSubnetID != nil { + objectMap["targetAzureSubnetId"] = hvraepi.TargetAzureSubnetID + } + if hvraepi.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = hvraepi.EnableRdpOnTargetOption + } + if hvraepi.TargetAzureVMName != nil { + objectMap["targetAzureVmName"] = hvraepi.TargetAzureVMName + } + if hvraepi.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = hvraepi.LogStorageAccountID + } + if hvraepi.DisksToInclude != nil { + objectMap["disksToInclude"] = hvraepi.DisksToInclude + } + if hvraepi.TargetAzureV1ResourceGroupID != nil { + objectMap["targetAzureV1ResourceGroupId"] = hvraepi.TargetAzureV1ResourceGroupID + } + if hvraepi.TargetAzureV2ResourceGroupID != nil { + objectMap["targetAzureV2ResourceGroupId"] = hvraepi.TargetAzureV2ResourceGroupID + } + if hvraepi.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvraepi.UseManagedDisks + } + if hvraepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = hvraepi.TargetAvailabilitySetID + } + if hvraepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvraepi.TargetAvailabilityZone + } + if hvraepi.LicenseType != "" { + objectMap["licenseType"] = hvraepi.LicenseType + } + if hvraepi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = hvraepi.SQLServerLicenseType + } + if hvraepi.TargetVMSize != nil { + objectMap["targetVmSize"] = hvraepi.TargetVMSize + } + if hvraepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvraepi.TargetProximityPlacementGroupID + } + if hvraepi.UseManagedDisksForReplication != nil { + objectMap["useManagedDisksForReplication"] = hvraepi.UseManagedDisksForReplication + } + if hvraepi.DiskType != "" { + objectMap["diskType"] = hvraepi.DiskType + } + if hvraepi.DisksToIncludeForManagedDisks != nil { + objectMap["disksToIncludeForManagedDisks"] = hvraepi.DisksToIncludeForManagedDisks + } + if hvraepi.DiskEncryptionSetID != nil { + objectMap["diskEncryptionSetId"] = hvraepi.DiskEncryptionSetID + } + if hvraepi.TargetVMTags != nil { + objectMap["targetVmTags"] = hvraepi.TargetVMTags + } + if hvraepi.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = hvraepi.SeedManagedDiskTags + } + if hvraepi.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvraepi.TargetManagedDiskTags + } + if hvraepi.TargetNicTags != nil { + objectMap["targetNicTags"] = hvraepi.TargetNicTags + } + if hvraepi.InstanceType != "" { + objectMap["instanceType"] = hvraepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return &hvraepi, true +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &hvraepi, true +} + +// HyperVReplicaAzureEventDetails model class for event details of a HyperVReplica E2A event. +type HyperVReplicaAzureEventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) MarshalJSON() ([]byte, error) { + hvraed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraed.ContainerName != nil { + objectMap["containerName"] = hvraed.ContainerName + } + if hvraed.FabricName != nil { + objectMap["fabricName"] = hvraed.FabricName + } + if hvraed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvraed.RemoteContainerName + } + if hvraed.InstanceType != "" { + objectMap["instanceType"] = hvraed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return &hvraed, true +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvraed, true +} + +// HyperVReplicaAzureFailbackProviderInput hyperVReplicaAzureFailback specific planned failover input. +type HyperVReplicaAzureFailbackProviderInput struct { + // DataSyncOption - Data sync option. + DataSyncOption *string `json:"dataSyncOption,omitempty"` + // RecoveryVMCreationOption - ALR options to create alternate recovery. + RecoveryVMCreationOption *string `json:"recoveryVmCreationOption,omitempty"` + // ProviderIDForAlternateRecovery - Provider Id for alternate location. + ProviderIDForAlternateRecovery *string `json:"providerIdForAlternateRecovery,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) MarshalJSON() ([]byte, error) { + hvrafpi.InstanceType = InstanceTypeHyperVReplicaAzureFailback + objectMap := make(map[string]interface{}) + if hvrafpi.DataSyncOption != nil { + objectMap["dataSyncOption"] = hvrafpi.DataSyncOption + } + if hvrafpi.RecoveryVMCreationOption != nil { + objectMap["recoveryVmCreationOption"] = hvrafpi.RecoveryVMCreationOption + } + if hvrafpi.ProviderIDForAlternateRecovery != nil { + objectMap["providerIdForAlternateRecovery"] = hvrafpi.ProviderIDForAlternateRecovery + } + if hvrafpi.InstanceType != "" { + objectMap["instanceType"] = hvrafpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return &hvrafpi, true +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &hvrafpi, true +} + +// HyperVReplicaAzureManagedDiskDetails hyper-V Managed disk details. +type HyperVReplicaAzureManagedDiskDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // SeedManagedDiskID - Seed managed disk Id. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // ReplicaDiskType - The replica disk type. + ReplicaDiskType *string `json:"replicaDiskType,omitempty"` + // DiskEncryptionSetID - The disk encryption set ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// HyperVReplicaAzurePlannedFailoverProviderInput hyperVReplicaAzure specific planned failover input. +type HyperVReplicaAzurePlannedFailoverProviderInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) MarshalJSON() ([]byte, error) { + hvrapfpi.InstanceType = InstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapfpi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvrapfpi.PrimaryKekCertificatePfx + } + if hvrapfpi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvrapfpi.SecondaryKekCertificatePfx + } + if hvrapfpi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvrapfpi.RecoveryPointID + } + if hvrapfpi.InstanceType != "" { + objectMap["instanceType"] = hvrapfpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return &hvrapfpi, true +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &hvrapfpi, true +} + +// HyperVReplicaAzurePolicyDetails hyper-V Replica Azure specific protection profile details. +type HyperVReplicaAzurePolicyDetails struct { + // RecoveryPointHistoryDurationInHours - The duration (in hours) to which point the recovery history needs to be maintained. + RecoveryPointHistoryDurationInHours *int32 `json:"recoveryPointHistoryDurationInHours,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - The interval (in hours) at which Hyper-V Replica should create an application consistent snapshot within the VM. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // ReplicationInterval - The replication interval. + ReplicationInterval *int32 `json:"replicationInterval,omitempty"` + // OnlineReplicationStartTime - The scheduled start time for the initial replication. If this parameter is Null, the initial replication starts immediately. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // Encryption - A value indicating whether encryption is enabled for virtual machines in this cloud. + Encryption *string `json:"encryption,omitempty"` + // ActiveStorageAccountID - The active storage account Id. + ActiveStorageAccountID *string `json:"activeStorageAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) MarshalJSON() ([]byte, error) { + hvrapd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapd.RecoveryPointHistoryDurationInHours != nil { + objectMap["recoveryPointHistoryDurationInHours"] = hvrapd.RecoveryPointHistoryDurationInHours + } + if hvrapd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrapd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrapd.ReplicationInterval != nil { + objectMap["replicationInterval"] = hvrapd.ReplicationInterval + } + if hvrapd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrapd.OnlineReplicationStartTime + } + if hvrapd.Encryption != nil { + objectMap["encryption"] = hvrapd.Encryption + } + if hvrapd.ActiveStorageAccountID != nil { + objectMap["activeStorageAccountId"] = hvrapd.ActiveStorageAccountID + } + if hvrapd.InstanceType != "" { + objectMap["instanceType"] = hvrapd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return &hvrapd, true +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrapd, true +} + +// HyperVReplicaAzurePolicyInput hyper-V Replica Azure specific input for creating a protection profile. +type HyperVReplicaAzurePolicyInput struct { + // RecoveryPointHistoryDuration - The duration (in hours) to which point the recovery history needs to be maintained. + RecoveryPointHistoryDuration *int32 `json:"recoveryPointHistoryDuration,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - The interval (in hours) at which Hyper-V Replica should create an application consistent snapshot within the VM. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // ReplicationInterval - The replication interval. + ReplicationInterval *int32 `json:"replicationInterval,omitempty"` + // OnlineReplicationStartTime - The scheduled start time for the initial replication. If this parameter is Null, the initial replication starts immediately. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // StorageAccounts - The list of storage accounts to which the VMs in the primary cloud can replicate to. + StorageAccounts *[]string `json:"storageAccounts,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) MarshalJSON() ([]byte, error) { + hvrapi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapi.RecoveryPointHistoryDuration != nil { + objectMap["recoveryPointHistoryDuration"] = hvrapi.RecoveryPointHistoryDuration + } + if hvrapi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrapi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrapi.ReplicationInterval != nil { + objectMap["replicationInterval"] = hvrapi.ReplicationInterval + } + if hvrapi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrapi.OnlineReplicationStartTime + } + if hvrapi.StorageAccounts != nil { + objectMap["storageAccounts"] = hvrapi.StorageAccounts + } + if hvrapi.InstanceType != "" { + objectMap["instanceType"] = hvrapi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return &hvrapi, true +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrapi, true +} + +// HyperVReplicaAzureReplicationDetails hyper V Replica Azure provider specific settings. +type HyperVReplicaAzureReplicationDetails struct { + // AzureVMDiskDetails - Azure VM Disk details. + AzureVMDiskDetails *[]AzureVMDiskDetails `json:"azureVmDiskDetails,omitempty"` + // RecoveryAzureVMName - Recovery Azure given name. + RecoveryAzureVMName *string `json:"recoveryAzureVmName,omitempty"` + // RecoveryAzureVMSize - The Recovery Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureStorageAccount - The recovery Azure storage account. + RecoveryAzureStorageAccount *string `json:"recoveryAzureStorageAccount,omitempty"` + // RecoveryAzureLogStorageAccountID - The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. + RecoveryAzureLogStorageAccountID *string `json:"recoveryAzureLogStorageAccountId,omitempty"` + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // RpoInSeconds - Last RPO value. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // SelectedRecoveryAzureNetworkID - The selected recovery azure network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // Encryption - The encryption info. + Encryption *string `json:"encryption,omitempty"` + // OSDetails - The operating system info. + OSDetails *OSDetails `json:"oSDetails,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // RecoveryAzureResourceGroupID - The target resource group Id. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]HyperVReplicaAzureManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) MarshalJSON() ([]byte, error) { + hvrard.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrard.AzureVMDiskDetails != nil { + objectMap["azureVmDiskDetails"] = hvrard.AzureVMDiskDetails + } + if hvrard.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVmName"] = hvrard.RecoveryAzureVMName + } + if hvrard.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = hvrard.RecoveryAzureVMSize + } + if hvrard.RecoveryAzureStorageAccount != nil { + objectMap["recoveryAzureStorageAccount"] = hvrard.RecoveryAzureStorageAccount + } + if hvrard.RecoveryAzureLogStorageAccountID != nil { + objectMap["recoveryAzureLogStorageAccountId"] = hvrard.RecoveryAzureLogStorageAccountID + } + if hvrard.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrard.LastReplicatedTime + } + if hvrard.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = hvrard.RpoInSeconds + } + if hvrard.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = hvrard.LastRpoCalculatedTime + } + if hvrard.VMID != nil { + objectMap["vmId"] = hvrard.VMID + } + if hvrard.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrard.VMProtectionState + } + if hvrard.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrard.VMProtectionStateDescription + } + if hvrard.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrard.InitialReplicationDetails + } + if hvrard.VMNics != nil { + objectMap["vmNics"] = hvrard.VMNics + } + if hvrard.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = hvrard.SelectedRecoveryAzureNetworkID + } + if hvrard.SelectedSourceNicID != nil { + objectMap["selectedSourceNicId"] = hvrard.SelectedSourceNicID + } + if hvrard.Encryption != nil { + objectMap["encryption"] = hvrard.Encryption + } + if hvrard.OSDetails != nil { + objectMap["oSDetails"] = hvrard.OSDetails + } + if hvrard.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = hvrard.SourceVMRAMSizeInMB + } + if hvrard.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = hvrard.SourceVMCPUCount + } + if hvrard.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = hvrard.EnableRdpOnTargetOption + } + if hvrard.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = hvrard.RecoveryAzureResourceGroupID + } + if hvrard.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = hvrard.RecoveryAvailabilitySetID + } + if hvrard.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvrard.TargetAvailabilityZone + } + if hvrard.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvrard.TargetProximityPlacementGroupID + } + if hvrard.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvrard.UseManagedDisks + } + if hvrard.LicenseType != nil { + objectMap["licenseType"] = hvrard.LicenseType + } + if hvrard.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = hvrard.SQLServerLicenseType + } + if hvrard.TargetVMTags != nil { + objectMap["targetVmTags"] = hvrard.TargetVMTags + } + if hvrard.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = hvrard.SeedManagedDiskTags + } + if hvrard.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvrard.TargetManagedDiskTags + } + if hvrard.TargetNicTags != nil { + objectMap["targetNicTags"] = hvrard.TargetNicTags + } + if hvrard.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = hvrard.ProtectedManagedDisks + } + if hvrard.InstanceType != "" { + objectMap["instanceType"] = hvrard.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return &hvrard, true +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrard, true +} + +// HyperVReplicaAzureReprotectInput azure specific reprotect input. +type HyperVReplicaAzureReprotectInput struct { + // HvHostVMID - The Hyper-V host Vm Id. + HvHostVMID *string `json:"hvHostVmId,omitempty"` + // VMName - The Vm Name. + VMName *string `json:"vmName,omitempty"` + // OsType - The OS type associated with vm. + OsType *string `json:"osType,omitempty"` + // VHDID - The OS disk VHD id associated with vm. + VHDID *string `json:"vHDId,omitempty"` + // StorageAccountID - The storage account name. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) MarshalJSON() ([]byte, error) { + hvrari.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrari.HvHostVMID != nil { + objectMap["hvHostVmId"] = hvrari.HvHostVMID + } + if hvrari.VMName != nil { + objectMap["vmName"] = hvrari.VMName + } + if hvrari.OsType != nil { + objectMap["osType"] = hvrari.OsType + } + if hvrari.VHDID != nil { + objectMap["vHDId"] = hvrari.VHDID + } + if hvrari.StorageAccountID != nil { + objectMap["storageAccountId"] = hvrari.StorageAccountID + } + if hvrari.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = hvrari.LogStorageAccountID + } + if hvrari.InstanceType != "" { + objectMap["instanceType"] = hvrari.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return &hvrari, true +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &hvrari, true +} + +// HyperVReplicaAzureTestFailoverInput hvrA provider specific input for test failover. +type HyperVReplicaAzureTestFailoverInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) MarshalJSON() ([]byte, error) { + hvratfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvratfi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvratfi.PrimaryKekCertificatePfx + } + if hvratfi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvratfi.SecondaryKekCertificatePfx + } + if hvratfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvratfi.RecoveryPointID + } + if hvratfi.InstanceType != "" { + objectMap["instanceType"] = hvratfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return &hvratfi, true +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &hvratfi, true +} + +// HyperVReplicaAzureUnplannedFailoverInput hvrA provider specific input for unplanned failover. +type HyperVReplicaAzureUnplannedFailoverInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + hvraufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraufi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvraufi.PrimaryKekCertificatePfx + } + if hvraufi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvraufi.SecondaryKekCertificatePfx + } + if hvraufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvraufi.RecoveryPointID + } + if hvraufi.InstanceType != "" { + objectMap["instanceType"] = hvraufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return &hvraufi, true +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &hvraufi, true +} + +// HyperVReplicaAzureUpdateReplicationProtectedItemInput hyperV replica Azure input to update replication +// protected item. +type HyperVReplicaAzureUpdateReplicationProtectedItemInput struct { + // RecoveryAzureV1ResourceGroupID - The recovery Azure resource group Id for classic deployment. + RecoveryAzureV1ResourceGroupID *string `json:"recoveryAzureV1ResourceGroupId,omitempty"` + // RecoveryAzureV2ResourceGroupID - The recovery Azure resource group Id for resource manager deployment. + RecoveryAzureV2ResourceGroupID *string `json:"recoveryAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // DiskIDToDiskEncryptionMap - The dictionary of disk resource Id to disk encryption set ARM Id. + DiskIDToDiskEncryptionMap map[string]*string `json:"diskIdToDiskEncryptionMap"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + hvraurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraurpii.RecoveryAzureV1ResourceGroupID != nil { + objectMap["recoveryAzureV1ResourceGroupId"] = hvraurpii.RecoveryAzureV1ResourceGroupID + } + if hvraurpii.RecoveryAzureV2ResourceGroupID != nil { + objectMap["recoveryAzureV2ResourceGroupId"] = hvraurpii.RecoveryAzureV2ResourceGroupID + } + if hvraurpii.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvraurpii.UseManagedDisks + } + if hvraurpii.DiskIDToDiskEncryptionMap != nil { + objectMap["diskIdToDiskEncryptionMap"] = hvraurpii.DiskIDToDiskEncryptionMap + } + if hvraurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvraurpii.TargetProximityPlacementGroupID + } + if hvraurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvraurpii.TargetAvailabilityZone + } + if hvraurpii.TargetVMTags != nil { + objectMap["targetVmTags"] = hvraurpii.TargetVMTags + } + if hvraurpii.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvraurpii.TargetManagedDiskTags + } + if hvraurpii.TargetNicTags != nil { + objectMap["targetNicTags"] = hvraurpii.TargetNicTags + } + if hvraurpii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = hvraurpii.SQLServerLicenseType + } + if hvraurpii.InstanceType != "" { + objectMap["instanceType"] = hvraurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return &hvraurpii, true +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &hvraurpii, true +} + +// HyperVReplicaBaseEventDetails abstract model class for event details of a HyperVReplica E2E event. +type HyperVReplicaBaseEventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) MarshalJSON() ([]byte, error) { + hvrbed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails + objectMap := make(map[string]interface{}) + if hvrbed.ContainerName != nil { + objectMap["containerName"] = hvrbed.ContainerName + } + if hvrbed.FabricName != nil { + objectMap["fabricName"] = hvrbed.FabricName + } + if hvrbed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvrbed.RemoteContainerName + } + if hvrbed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvrbed.RemoteFabricName + } + if hvrbed.InstanceType != "" { + objectMap["instanceType"] = hvrbed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return &hvrbed, true +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvrbed, true +} + +// HyperVReplicaBasePolicyDetails base class for HyperVReplica policy details. +type HyperVReplicaBasePolicyDetails struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud. + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) MarshalJSON() ([]byte, error) { + hvrbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails + objectMap := make(map[string]interface{}) + if hvrbpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpd.RecoveryPoints + } + if hvrbpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpd.Compression != nil { + objectMap["compression"] = hvrbpd.Compression + } + if hvrbpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpd.InitialReplicationMethod + } + if hvrbpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpd.OnlineReplicationStartTime + } + if hvrbpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpd.OfflineReplicationImportPath + } + if hvrbpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpd.OfflineReplicationExportPath + } + if hvrbpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpd.ReplicationPort + } + if hvrbpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpd.AllowedAuthenticationType + } + if hvrbpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrbpd.ReplicaDeletionOption + } + if hvrbpd.InstanceType != "" { + objectMap["instanceType"] = hvrbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return &hvrbpd, true +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrbpd, true +} + +// HyperVReplicaBaseReplicationDetails hyper V replica provider specific settings base class. +type HyperVReplicaBaseReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) MarshalJSON() ([]byte, error) { + hvrbrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails + objectMap := make(map[string]interface{}) + if hvrbrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrbrd.LastReplicatedTime + } + if hvrbrd.VMNics != nil { + objectMap["vmNics"] = hvrbrd.VMNics + } + if hvrbrd.VMID != nil { + objectMap["vmId"] = hvrbrd.VMID + } + if hvrbrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrbrd.VMProtectionState + } + if hvrbrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrbrd.VMProtectionStateDescription + } + if hvrbrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrbrd.InitialReplicationDetails + } + if hvrbrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrbrd.VMDiskDetails + } + if hvrbrd.InstanceType != "" { + objectMap["instanceType"] = hvrbrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return &hvrbrd, true +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrbrd, true +} + +// HyperVReplicaBluePolicyDetails hyper-V Replica Blue specific protection profile details. +type HyperVReplicaBluePolicyDetails struct { + // ReplicationFrequencyInSeconds - A value indicating the replication interval. + ReplicationFrequencyInSeconds *int32 `json:"replicationFrequencyInSeconds,omitempty"` + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) MarshalJSON() ([]byte, error) { + hvrbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbpd.ReplicationFrequencyInSeconds != nil { + objectMap["replicationFrequencyInSeconds"] = hvrbpd.ReplicationFrequencyInSeconds + } + if hvrbpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpd.RecoveryPoints + } + if hvrbpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpd.Compression != nil { + objectMap["compression"] = hvrbpd.Compression + } + if hvrbpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpd.InitialReplicationMethod + } + if hvrbpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpd.OnlineReplicationStartTime + } + if hvrbpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpd.OfflineReplicationImportPath + } + if hvrbpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpd.OfflineReplicationExportPath + } + if hvrbpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpd.ReplicationPort + } + if hvrbpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpd.AllowedAuthenticationType + } + if hvrbpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrbpd.ReplicaDeletionOption + } + if hvrbpd.InstanceType != "" { + objectMap["instanceType"] = hvrbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return &hvrbpd, true +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrbpd, true +} + +// HyperVReplicaBluePolicyInput hyperV Replica Blue policy input. +type HyperVReplicaBluePolicyInput struct { + // ReplicationFrequencyInSeconds - A value indicating the replication interval. + ReplicationFrequencyInSeconds *int32 `json:"replicationFrequencyInSeconds,omitempty"` + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletion - A value indicating whether the VM has to be auto deleted. + ReplicaDeletion *string `json:"replicaDeletion,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) MarshalJSON() ([]byte, error) { + hvrbpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbpi.ReplicationFrequencyInSeconds != nil { + objectMap["replicationFrequencyInSeconds"] = hvrbpi.ReplicationFrequencyInSeconds + } + if hvrbpi.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpi.RecoveryPoints + } + if hvrbpi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpi.Compression != nil { + objectMap["compression"] = hvrbpi.Compression + } + if hvrbpi.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpi.InitialReplicationMethod + } + if hvrbpi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpi.OnlineReplicationStartTime + } + if hvrbpi.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpi.OfflineReplicationImportPath + } + if hvrbpi.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpi.OfflineReplicationExportPath + } + if hvrbpi.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpi.ReplicationPort + } + if hvrbpi.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpi.AllowedAuthenticationType + } + if hvrbpi.ReplicaDeletion != nil { + objectMap["replicaDeletion"] = hvrbpi.ReplicaDeletion + } + if hvrbpi.InstanceType != "" { + objectMap["instanceType"] = hvrbpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return &hvrbpi, true +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return &hvrbpi, true +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrbpi, true +} + +// HyperVReplicaBlueReplicationDetails hyperV replica 2012 R2 (Blue) replication details. +type HyperVReplicaBlueReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) MarshalJSON() ([]byte, error) { + hvrbrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrbrd.LastReplicatedTime + } + if hvrbrd.VMNics != nil { + objectMap["vmNics"] = hvrbrd.VMNics + } + if hvrbrd.VMID != nil { + objectMap["vmId"] = hvrbrd.VMID + } + if hvrbrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrbrd.VMProtectionState + } + if hvrbrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrbrd.VMProtectionStateDescription + } + if hvrbrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrbrd.InitialReplicationDetails + } + if hvrbrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrbrd.VMDiskDetails + } + if hvrbrd.InstanceType != "" { + objectMap["instanceType"] = hvrbrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return &hvrbrd, true +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrbrd, true +} + +// HyperVReplicaPolicyDetails hyper-V Replica Blue specific protection profile details. +type HyperVReplicaPolicyDetails struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) MarshalJSON() ([]byte, error) { + hvrpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrpd.RecoveryPoints + } + if hvrpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrpd.Compression != nil { + objectMap["compression"] = hvrpd.Compression + } + if hvrpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrpd.InitialReplicationMethod + } + if hvrpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrpd.OnlineReplicationStartTime + } + if hvrpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrpd.OfflineReplicationImportPath + } + if hvrpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrpd.OfflineReplicationExportPath + } + if hvrpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrpd.ReplicationPort + } + if hvrpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrpd.AllowedAuthenticationType + } + if hvrpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrpd.ReplicaDeletionOption + } + if hvrpd.InstanceType != "" { + objectMap["instanceType"] = hvrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return &hvrpd, true +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrpd, true +} + +// BasicHyperVReplicaPolicyInput hyper-V Replica specific policy Input. +type BasicHyperVReplicaPolicyInput interface { + AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) + AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) +} + +// HyperVReplicaPolicyInput hyper-V Replica specific policy Input. +type HyperVReplicaPolicyInput struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletion - A value indicating whether the VM has to be auto deleted. + ReplicaDeletion *string `json:"replicaDeletion,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicHyperVReplicaPolicyInput(body []byte) (BasicHyperVReplicaPolicyInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2): + var hvrbpi HyperVReplicaBluePolicyInput + err := json.Unmarshal(body, &hvrbpi) + return hvrbpi, err + default: + var hvrpi HyperVReplicaPolicyInput + err := json.Unmarshal(body, &hvrpi) + return hvrpi, err + } +} +func unmarshalBasicHyperVReplicaPolicyInputArray(body []byte) ([]BasicHyperVReplicaPolicyInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + hvrpiArray := make([]BasicHyperVReplicaPolicyInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + hvrpi, err := unmarshalBasicHyperVReplicaPolicyInput(*rawMessage) + if err != nil { + return nil, err + } + hvrpiArray[index] = hvrpi + } + return hvrpiArray, nil +} + +// MarshalJSON is the custom marshaler for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) MarshalJSON() ([]byte, error) { + hvrpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrpi.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrpi.RecoveryPoints + } + if hvrpi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrpi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrpi.Compression != nil { + objectMap["compression"] = hvrpi.Compression + } + if hvrpi.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrpi.InitialReplicationMethod + } + if hvrpi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrpi.OnlineReplicationStartTime + } + if hvrpi.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrpi.OfflineReplicationImportPath + } + if hvrpi.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrpi.OfflineReplicationExportPath + } + if hvrpi.ReplicationPort != nil { + objectMap["replicationPort"] = hvrpi.ReplicationPort + } + if hvrpi.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrpi.AllowedAuthenticationType + } + if hvrpi.ReplicaDeletion != nil { + objectMap["replicaDeletion"] = hvrpi.ReplicaDeletion + } + if hvrpi.InstanceType != "" { + objectMap["instanceType"] = hvrpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return &hvrpi, true +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return &hvrpi, true +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrpi, true +} + +// HyperVReplicaReplicationDetails hyperV replica 2012 replication details. +type HyperVReplicaReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) MarshalJSON() ([]byte, error) { + hvrrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrrd.LastReplicatedTime + } + if hvrrd.VMNics != nil { + objectMap["vmNics"] = hvrrd.VMNics + } + if hvrrd.VMID != nil { + objectMap["vmId"] = hvrrd.VMID + } + if hvrrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrrd.VMProtectionState + } + if hvrrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrrd.VMProtectionStateDescription + } + if hvrrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrrd.InitialReplicationDetails + } + if hvrrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrrd.VMDiskDetails + } + if hvrrd.InstanceType != "" { + objectMap["instanceType"] = hvrrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return &hvrrd, true +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrrd, true +} + +// HyperVSiteDetails hyperVSite fabric specific details. +type HyperVSiteDetails struct { + // HyperVHosts - The list of Hyper-V hosts associated with the fabric. + HyperVHosts *[]HyperVHostDetails `json:"hyperVHosts,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) MarshalJSON() ([]byte, error) { + hvsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite + objectMap := make(map[string]interface{}) + if hvsd.HyperVHosts != nil { + objectMap["hyperVHosts"] = hvsd.HyperVHosts + } + if hvsd.InstanceType != "" { + objectMap["instanceType"] = hvsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return &hvsd, true +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &hvsd, true +} + +// BasicHyperVVirtualMachineDetails single Host fabric provider specific VM settings. +type BasicHyperVVirtualMachineDetails interface { + AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) + AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) +} + +// HyperVVirtualMachineDetails single Host fabric provider specific VM settings. +type HyperVVirtualMachineDetails struct { + // SourceItemID - The source id of the object. + SourceItemID *string `json:"sourceItemId,omitempty"` + // Generation - The id of the object in fabric. + Generation *string `json:"generation,omitempty"` + // OsDetails - The Last replication time. + OsDetails *OSDetails `json:"osDetails,omitempty"` + // DiskDetails - The Last successful failover time. + DiskDetails *[]DiskDetails `json:"diskDetails,omitempty"` + // HasPhysicalDisk - A value indicating whether the VM has a physical disk attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasPhysicalDisk PresenceStatus `json:"hasPhysicalDisk,omitempty"` + // HasFibreChannelAdapter - A value indicating whether the VM has a fibre channel adapter attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasFibreChannelAdapter PresenceStatus `json:"hasFibreChannelAdapter,omitempty"` + // HasSharedVhd - A value indicating whether the VM has a shared VHD attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasSharedVhd PresenceStatus `json:"hasSharedVhd,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicHyperVVirtualMachineDetails(body []byte) (BasicHyperVVirtualMachineDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeVmmVirtualMachine): + var vvmd VmmVirtualMachineDetails + err := json.Unmarshal(body, &vvmd) + return vvmd, err + default: + var hvvmd HyperVVirtualMachineDetails + err := json.Unmarshal(body, &hvvmd) + return hvvmd, err + } +} +func unmarshalBasicHyperVVirtualMachineDetailsArray(body []byte) ([]BasicHyperVVirtualMachineDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + hvvmdArray := make([]BasicHyperVVirtualMachineDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + hvvmd, err := unmarshalBasicHyperVVirtualMachineDetails(*rawMessage) + if err != nil { + return nil, err + } + hvvmdArray[index] = hvvmd + } + return hvvmdArray, nil +} + +// MarshalJSON is the custom marshaler for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) MarshalJSON() ([]byte, error) { + hvvmd.InstanceType = InstanceTypeHyperVVirtualMachine + objectMap := make(map[string]interface{}) + if hvvmd.SourceItemID != nil { + objectMap["sourceItemId"] = hvvmd.SourceItemID + } + if hvvmd.Generation != nil { + objectMap["generation"] = hvvmd.Generation + } + if hvvmd.OsDetails != nil { + objectMap["osDetails"] = hvvmd.OsDetails + } + if hvvmd.DiskDetails != nil { + objectMap["diskDetails"] = hvvmd.DiskDetails + } + if hvvmd.HasPhysicalDisk != "" { + objectMap["hasPhysicalDisk"] = hvvmd.HasPhysicalDisk + } + if hvvmd.HasFibreChannelAdapter != "" { + objectMap["hasFibreChannelAdapter"] = hvvmd.HasFibreChannelAdapter + } + if hvvmd.HasSharedVhd != "" { + objectMap["hasSharedVhd"] = hvvmd.HasSharedVhd + } + if hvvmd.InstanceType != "" { + objectMap["instanceType"] = hvvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return &hvvmd, true +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return &hvvmd, true +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &hvvmd, true +} + +// IdentityProviderDetails identity provider details. +type IdentityProviderDetails struct { + // TenantID - The tenant Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + TenantID *string `json:"tenantId,omitempty"` + // ApplicationID - The application/client Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ApplicationID *string `json:"applicationId,omitempty"` + // ObjectID - The object Id of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ObjectID *string `json:"objectId,omitempty"` + // Audience - The intended Audience of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + Audience *string `json:"audience,omitempty"` + // AadAuthority - The base authority for Azure Active Directory authentication. + AadAuthority *string `json:"aadAuthority,omitempty"` +} + +// IdentityProviderInput identity provider input. +type IdentityProviderInput struct { + // TenantID - The tenant Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + TenantID *string `json:"tenantId,omitempty"` + // ApplicationID - The application/client Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ApplicationID *string `json:"applicationId,omitempty"` + // ObjectID - The object Id of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ObjectID *string `json:"objectId,omitempty"` + // Audience - The intended Audience of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + Audience *string `json:"audience,omitempty"` + // AadAuthority - The base authority for Azure Active Directory authentication. + AadAuthority *string `json:"aadAuthority,omitempty"` +} + +// InconsistentVMDetails this class stores the monitoring details for consistency check of inconsistent +// Protected Entity. +type InconsistentVMDetails struct { + // VMName - The Vm name. + VMName *string `json:"vmName,omitempty"` + // CloudName - The Cloud name. + CloudName *string `json:"cloudName,omitempty"` + // Details - The list of details regarding state of the Protected Entity in SRS and On prem. + Details *[]string `json:"details,omitempty"` + // ErrorIds - The list of error ids. + ErrorIds *[]string `json:"errorIds,omitempty"` +} + +// InitialReplicationDetails initial replication details. +type InitialReplicationDetails struct { + // InitialReplicationType - Initial replication type. + InitialReplicationType *string `json:"initialReplicationType,omitempty"` + // InitialReplicationProgressPercentage - The initial replication progress percentage. + InitialReplicationProgressPercentage *string `json:"initialReplicationProgressPercentage,omitempty"` +} + +// InlineWorkflowTaskDetails this class represents the inline workflow task details. +type InlineWorkflowTaskDetails struct { + // WorkflowIds - The list of child workflow ids. + WorkflowIds *[]string `json:"workflowIds,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) MarshalJSON() ([]byte, error) { + iwtd.InstanceType = InstanceTypeInlineWorkflowTaskDetails + objectMap := make(map[string]interface{}) + if iwtd.WorkflowIds != nil { + objectMap["workflowIds"] = iwtd.WorkflowIds + } + if iwtd.ChildTasks != nil { + objectMap["childTasks"] = iwtd.ChildTasks + } + if iwtd.InstanceType != "" { + objectMap["instanceType"] = iwtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return &iwtd, true +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &iwtd, true +} + +// InMageAgentDetails the details of the InMage agent. +type InMageAgentDetails struct { + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentUpdateStatus - A value indicating whether installed agent needs to be updated. + AgentUpdateStatus *string `json:"agentUpdateStatus,omitempty"` + // PostUpdateRebootStatus - A value indicating whether reboot is required after update is applied. + PostUpdateRebootStatus *string `json:"postUpdateRebootStatus,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` +} + +// InMageAzureV2ApplyRecoveryPointInput applyRecoveryPoint input specific to InMageAzureV2 provider. +type InMageAzureV2ApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + imavarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavarpi.InstanceType != "" { + objectMap["instanceType"] = imavarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return &imavarpi, true +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &imavarpi, true +} + +// InMageAzureV2DiskInputDetails disk input details. +type InMageAzureV2DiskInputDetails struct { + // DiskID - The DiskId. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The LogStorageAccountId. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageAzureV2EnableProtectionInput vMware Azure specific enable protection input. +type InMageAzureV2EnableProtectionInput struct { + // MasterTargetID - The Master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // StorageAccountID - The storage account Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // MultiVMGroupID - The multi VM group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]InMageAzureV2DiskInputDetails `json:"disksToInclude,omitempty"` + // TargetAzureNetworkID - The selected target Azure network Id. + TargetAzureNetworkID *string `json:"targetAzureNetworkId,omitempty"` + // TargetAzureSubnetID - The selected target Azure subnet Id. + TargetAzureSubnetID *string `json:"targetAzureSubnetId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target VM after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // TargetAzureVMName - The target azure VM Name. + TargetAzureVMName *string `json:"targetAzureVmName,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // TargetAzureV1ResourceGroupID - The Id of the target resource group (for classic deployment) in which the failover VM is to be created. + TargetAzureV1ResourceGroupID *string `json:"targetAzureV1ResourceGroupId,omitempty"` + // TargetAzureV2ResourceGroupID - The Id of the target resource group (for resource manager deployment) in which the failover VM is to be created. + TargetAzureV2ResourceGroupID *string `json:"targetAzureV2ResourceGroupId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id for resource manager deployment. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) MarshalJSON() ([]byte, error) { + imavepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavepi.MasterTargetID != nil { + objectMap["masterTargetId"] = imavepi.MasterTargetID + } + if imavepi.ProcessServerID != nil { + objectMap["processServerId"] = imavepi.ProcessServerID + } + if imavepi.StorageAccountID != nil { + objectMap["storageAccountId"] = imavepi.StorageAccountID + } + if imavepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imavepi.RunAsAccountID + } + if imavepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imavepi.MultiVMGroupID + } + if imavepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imavepi.MultiVMGroupName + } + if imavepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imavepi.DisksToInclude + } + if imavepi.TargetAzureNetworkID != nil { + objectMap["targetAzureNetworkId"] = imavepi.TargetAzureNetworkID + } + if imavepi.TargetAzureSubnetID != nil { + objectMap["targetAzureSubnetId"] = imavepi.TargetAzureSubnetID + } + if imavepi.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = imavepi.EnableRdpOnTargetOption + } + if imavepi.TargetAzureVMName != nil { + objectMap["targetAzureVmName"] = imavepi.TargetAzureVMName + } + if imavepi.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imavepi.LogStorageAccountID + } + if imavepi.TargetAzureV1ResourceGroupID != nil { + objectMap["targetAzureV1ResourceGroupId"] = imavepi.TargetAzureV1ResourceGroupID + } + if imavepi.TargetAzureV2ResourceGroupID != nil { + objectMap["targetAzureV2ResourceGroupId"] = imavepi.TargetAzureV2ResourceGroupID + } + if imavepi.DiskType != "" { + objectMap["diskType"] = imavepi.DiskType + } + if imavepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imavepi.TargetAvailabilitySetID + } + if imavepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavepi.TargetAvailabilityZone + } + if imavepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavepi.TargetProximityPlacementGroupID + } + if imavepi.LicenseType != "" { + objectMap["licenseType"] = imavepi.LicenseType + } + if imavepi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = imavepi.SQLServerLicenseType + } + if imavepi.TargetVMSize != nil { + objectMap["targetVmSize"] = imavepi.TargetVMSize + } + if imavepi.DiskEncryptionSetID != nil { + objectMap["diskEncryptionSetId"] = imavepi.DiskEncryptionSetID + } + if imavepi.TargetVMTags != nil { + objectMap["targetVmTags"] = imavepi.TargetVMTags + } + if imavepi.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = imavepi.SeedManagedDiskTags + } + if imavepi.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavepi.TargetManagedDiskTags + } + if imavepi.TargetNicTags != nil { + objectMap["targetNicTags"] = imavepi.TargetNicTags + } + if imavepi.InstanceType != "" { + objectMap["instanceType"] = imavepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return &imavepi, true +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imavepi, true +} + +// InMageAzureV2EventDetails model class for event details of a VMwareAzureV2 event. +type InMageAzureV2EventDetails struct { + // EventType - InMage Event type. Takes one of the values of InMageDataContract.InMageMonitoringEventType. + EventType *string `json:"eventType,omitempty"` + // Category - InMage Event Category. + Category *string `json:"category,omitempty"` + // Component - InMage Event Component. + Component *string `json:"component,omitempty"` + // CorrectiveAction - Corrective Action string for the event. + CorrectiveAction *string `json:"correctiveAction,omitempty"` + // Details - InMage Event Details. + Details *string `json:"details,omitempty"` + // Summary - InMage Event Summary. + Summary *string `json:"summary,omitempty"` + // SiteName - VMware Site name. + SiteName *string `json:"siteName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) MarshalJSON() ([]byte, error) { + imaved.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imaved.EventType != nil { + objectMap["eventType"] = imaved.EventType + } + if imaved.Category != nil { + objectMap["category"] = imaved.Category + } + if imaved.Component != nil { + objectMap["component"] = imaved.Component + } + if imaved.CorrectiveAction != nil { + objectMap["correctiveAction"] = imaved.CorrectiveAction + } + if imaved.Details != nil { + objectMap["details"] = imaved.Details + } + if imaved.Summary != nil { + objectMap["summary"] = imaved.Summary + } + if imaved.SiteName != nil { + objectMap["siteName"] = imaved.SiteName + } + if imaved.InstanceType != "" { + objectMap["instanceType"] = imaved.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return &imaved, true +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imaved, true +} + +// InMageAzureV2ManagedDiskDetails inMageAzureV2 Managed disk details. +type InMageAzureV2ManagedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // SeedManagedDiskID - Seed managed disk Id. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // ReplicaDiskType - The replica disk type. + ReplicaDiskType *string `json:"replicaDiskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageAzureV2PolicyDetails inMage Azure v2 specific protection profile details. +type InMageAzureV2PolicyDetails struct { + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) MarshalJSON() ([]byte, error) { + imavpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imavpd.CrashConsistentFrequencyInMinutes + } + if imavpd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imavpd.RecoveryPointThresholdInMinutes + } + if imavpd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imavpd.RecoveryPointHistory + } + if imavpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imavpd.AppConsistentFrequencyInMinutes + } + if imavpd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imavpd.MultiVMSyncStatus + } + if imavpd.InstanceType != "" { + objectMap["instanceType"] = imavpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return &imavpd, true +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imavpd, true +} + +// InMageAzureV2PolicyInput vMWare Azure specific policy Input. +type InMageAzureV2PolicyInput struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) MarshalJSON() ([]byte, error) { + imavpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavpi.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imavpi.RecoveryPointThresholdInMinutes + } + if imavpi.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imavpi.RecoveryPointHistory + } + if imavpi.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imavpi.CrashConsistentFrequencyInMinutes + } + if imavpi.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imavpi.AppConsistentFrequencyInMinutes + } + if imavpi.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = imavpi.MultiVMSyncStatus + } + if imavpi.InstanceType != "" { + objectMap["instanceType"] = imavpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return &imavpi, true +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imavpi, true +} + +// InMageAzureV2ProtectedDiskDetails inMageAzureV2 protected disk details. +type InMageAzureV2ProtectedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // HealthErrorCode - The health error code for the disk. + HealthErrorCode *string `json:"healthErrorCode,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncDurationInSeconds - The resync duration in seconds. + ResyncDurationInSeconds *int64 `json:"resyncDurationInSeconds,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // FileSystemCapacityInBytes - The disk file system capacity in bytes. + FileSystemCapacityInBytes *int64 `json:"fileSystemCapacityInBytes,omitempty"` + // SourceDataInMegaBytes - The source data transit in MB. + SourceDataInMegaBytes *float64 `json:"sourceDataInMegaBytes,omitempty"` + // PsDataInMegaBytes - The PS data transit in MB. + PsDataInMegaBytes *float64 `json:"psDataInMegaBytes,omitempty"` + // TargetDataInMegaBytes - The target data transit in MB. + TargetDataInMegaBytes *float64 `json:"targetDataInMegaBytes,omitempty"` + // DiskResized - A value indicating whether disk is resized. + DiskResized *string `json:"diskResized,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // ResyncProcessedBytes - The resync processed bytes. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTotalTransferredBytes - The resync total transferred bytes. + ResyncTotalTransferredBytes *int64 `json:"resyncTotalTransferredBytes,omitempty"` + // ResyncLast15MinutesTransferredBytes - The resync last 15 minutes transferred bytes. + ResyncLast15MinutesTransferredBytes *int64 `json:"resyncLast15MinutesTransferredBytes,omitempty"` + // ResyncLastDataTransferTimeUTC - The last data transfer time in UTC. + ResyncLastDataTransferTimeUTC *date.Time `json:"resyncLastDataTransferTimeUTC,omitempty"` + // ResyncStartTime - The resync start time. + ResyncStartTime *date.Time `json:"resyncStartTime,omitempty"` + // ProgressHealth - The Progress Health. + ProgressHealth *string `json:"progressHealth,omitempty"` + // ProgressStatus - The Progress Status. + ProgressStatus *string `json:"progressStatus,omitempty"` +} + +// InMageAzureV2RecoveryPointDetails inMage Azure V2 provider specific recovery point details. +type InMageAzureV2RecoveryPointDetails struct { + // IsMultiVMSyncPoint - A value indicating whether the recovery point is multi VM consistent. + IsMultiVMSyncPoint *string `json:"isMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) MarshalJSON() ([]byte, error) { + imavrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavrpd.IsMultiVMSyncPoint != nil { + objectMap["isMultiVmSyncPoint"] = imavrpd.IsMultiVMSyncPoint + } + if imavrpd.InstanceType != "" { + objectMap["instanceType"] = imavrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return &imavrpd, true +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &imavrpd, true +} + +// InMageAzureV2ReplicationDetails inMageAzureV2 provider specific settings. +type InMageAzureV2ReplicationDetails struct { + // InfrastructureVMID - The infrastructure VM Id. + InfrastructureVMID *string `json:"infrastructureVmId,omitempty"` + // VCenterInfrastructureID - The vCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // CompressedDataRateInMB - The compressed data change rate in MB. + CompressedDataRateInMB *float64 `json:"compressedDataRateInMB,omitempty"` + // UncompressedDataRateInMB - The uncompressed data change rate in MB. + UncompressedDataRateInMB *float64 `json:"uncompressedDataRateInMB,omitempty"` + // IPAddress - The source IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // IsAgentUpdateRequired - A value indicating whether installed agent needs to be updated. + IsAgentUpdateRequired *string `json:"isAgentUpdateRequired,omitempty"` + // IsRebootAfterUpdateRequired - A value indicating whether the source server requires a restart after update. + IsRebootAfterUpdateRequired *string `json:"isRebootAfterUpdateRequired,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // ProcessServerName - The process server name. + ProcessServerName *string `json:"processServerName,omitempty"` + // MultiVMGroupID - The multi vm group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi vm sync is enabled or disabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageAzureV2ProtectedDiskDetails `json:"protectedDisks,omitempty"` + // DiskResized - A value indicating whether any disk is resized for this VM. + DiskResized *string `json:"diskResized,omitempty"` + // MasterTargetID - The master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // OsType - The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // VhdName - The OS disk VHD name. + VhdName *string `json:"vhdName,omitempty"` + // OsDiskID - The id of the disk containing the OS. + OsDiskID *string `json:"osDiskId,omitempty"` + // AzureVMDiskDetails - Azure VM Disk details. + AzureVMDiskDetails *[]AzureVMDiskDetails `json:"azureVMDiskDetails,omitempty"` + // RecoveryAzureVMName - Recovery Azure given name. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureVMSize - The Recovery Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureStorageAccount - The recovery Azure storage account. + RecoveryAzureStorageAccount *string `json:"recoveryAzureStorageAccount,omitempty"` + // RecoveryAzureLogStorageAccountID - The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. + RecoveryAzureLogStorageAccountID *string `json:"recoveryAzureLogStorageAccountId,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // SelectedRecoveryAzureNetworkID - The selected recovery azure network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The test failover virtual network. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. Value can be vCenter or physical. + DiscoveryType *string `json:"discoveryType,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // Datastores - The datastores of the on-premise machine. Value can be list of strings that contain datastore names. + Datastores *[]string `json:"datastores,omitempty"` + // TargetVMID - The ARM Id of the target Azure VM. This value will be null until the VM is failed over. Only after failure it will be populated with the ARM Id of the Azure VM. + TargetVMID *string `json:"targetVmId,omitempty"` + // RecoveryAzureResourceGroupID - The target resource group Id. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // ValidationErrors - The validation errors of the on-premise machine Value can be list of validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastUpdateReceivedTime - The last update time received from on-prem components. + LastUpdateReceivedTime *date.Time `json:"lastUpdateReceivedTime,omitempty"` + // ReplicaID - The replica id of the protected item. + ReplicaID *string `json:"replicaId,omitempty"` + // OsVersion - The OS Version of the protected item. + OsVersion *string `json:"osVersion,omitempty"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]InMageAzureV2ManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // FirmwareType - The firmware type of this protected item. + FirmwareType *string `json:"firmwareType,omitempty"` + // AzureVMGeneration - The target generation for this protected item. + AzureVMGeneration *string `json:"azureVmGeneration,omitempty"` + // IsAdditionalStatsAvailable - A value indicating whether additional IR stats are available or not. + IsAdditionalStatsAvailable *bool `json:"isAdditionalStatsAvailable,omitempty"` + // TotalDataTransferred - The total transferred data in bytes. + TotalDataTransferred *int64 `json:"totalDataTransferred,omitempty"` + // TotalProgressHealth - The progress health. + TotalProgressHealth *string `json:"totalProgressHealth,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) MarshalJSON() ([]byte, error) { + imavrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavrd.InfrastructureVMID != nil { + objectMap["infrastructureVmId"] = imavrd.InfrastructureVMID + } + if imavrd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = imavrd.VCenterInfrastructureID + } + if imavrd.ProtectionStage != nil { + objectMap["protectionStage"] = imavrd.ProtectionStage + } + if imavrd.VMID != nil { + objectMap["vmId"] = imavrd.VMID + } + if imavrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = imavrd.VMProtectionState + } + if imavrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = imavrd.VMProtectionStateDescription + } + if imavrd.ResyncProgressPercentage != nil { + objectMap["resyncProgressPercentage"] = imavrd.ResyncProgressPercentage + } + if imavrd.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = imavrd.RpoInSeconds + } + if imavrd.CompressedDataRateInMB != nil { + objectMap["compressedDataRateInMB"] = imavrd.CompressedDataRateInMB + } + if imavrd.UncompressedDataRateInMB != nil { + objectMap["uncompressedDataRateInMB"] = imavrd.UncompressedDataRateInMB + } + if imavrd.IPAddress != nil { + objectMap["ipAddress"] = imavrd.IPAddress + } + if imavrd.AgentVersion != nil { + objectMap["agentVersion"] = imavrd.AgentVersion + } + if imavrd.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = imavrd.AgentExpiryDate + } + if imavrd.IsAgentUpdateRequired != nil { + objectMap["isAgentUpdateRequired"] = imavrd.IsAgentUpdateRequired + } + if imavrd.IsRebootAfterUpdateRequired != nil { + objectMap["isRebootAfterUpdateRequired"] = imavrd.IsRebootAfterUpdateRequired + } + if imavrd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = imavrd.LastHeartbeat + } + if imavrd.ProcessServerID != nil { + objectMap["processServerId"] = imavrd.ProcessServerID + } + if imavrd.ProcessServerName != nil { + objectMap["processServerName"] = imavrd.ProcessServerName + } + if imavrd.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imavrd.MultiVMGroupID + } + if imavrd.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imavrd.MultiVMGroupName + } + if imavrd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imavrd.MultiVMSyncStatus + } + if imavrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imavrd.ProtectedDisks + } + if imavrd.DiskResized != nil { + objectMap["diskResized"] = imavrd.DiskResized + } + if imavrd.MasterTargetID != nil { + objectMap["masterTargetId"] = imavrd.MasterTargetID + } + if imavrd.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = imavrd.SourceVMCPUCount + } + if imavrd.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = imavrd.SourceVMRAMSizeInMB + } + if imavrd.OsType != nil { + objectMap["osType"] = imavrd.OsType + } + if imavrd.VhdName != nil { + objectMap["vhdName"] = imavrd.VhdName + } + if imavrd.OsDiskID != nil { + objectMap["osDiskId"] = imavrd.OsDiskID + } + if imavrd.AzureVMDiskDetails != nil { + objectMap["azureVMDiskDetails"] = imavrd.AzureVMDiskDetails + } + if imavrd.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVMName"] = imavrd.RecoveryAzureVMName + } + if imavrd.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = imavrd.RecoveryAzureVMSize + } + if imavrd.RecoveryAzureStorageAccount != nil { + objectMap["recoveryAzureStorageAccount"] = imavrd.RecoveryAzureStorageAccount + } + if imavrd.RecoveryAzureLogStorageAccountID != nil { + objectMap["recoveryAzureLogStorageAccountId"] = imavrd.RecoveryAzureLogStorageAccountID + } + if imavrd.VMNics != nil { + objectMap["vmNics"] = imavrd.VMNics + } + if imavrd.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = imavrd.SelectedRecoveryAzureNetworkID + } + if imavrd.SelectedTfoAzureNetworkID != nil { + objectMap["selectedTfoAzureNetworkId"] = imavrd.SelectedTfoAzureNetworkID + } + if imavrd.SelectedSourceNicID != nil { + objectMap["selectedSourceNicId"] = imavrd.SelectedSourceNicID + } + if imavrd.DiscoveryType != nil { + objectMap["discoveryType"] = imavrd.DiscoveryType + } + if imavrd.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = imavrd.EnableRdpOnTargetOption + } + if imavrd.Datastores != nil { + objectMap["datastores"] = imavrd.Datastores + } + if imavrd.TargetVMID != nil { + objectMap["targetVmId"] = imavrd.TargetVMID + } + if imavrd.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = imavrd.RecoveryAzureResourceGroupID + } + if imavrd.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = imavrd.RecoveryAvailabilitySetID + } + if imavrd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavrd.TargetAvailabilityZone + } + if imavrd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavrd.TargetProximityPlacementGroupID + } + if imavrd.UseManagedDisks != nil { + objectMap["useManagedDisks"] = imavrd.UseManagedDisks + } + if imavrd.LicenseType != nil { + objectMap["licenseType"] = imavrd.LicenseType + } + if imavrd.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = imavrd.SQLServerLicenseType + } + if imavrd.ValidationErrors != nil { + objectMap["validationErrors"] = imavrd.ValidationErrors + } + if imavrd.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = imavrd.LastRpoCalculatedTime + } + if imavrd.LastUpdateReceivedTime != nil { + objectMap["lastUpdateReceivedTime"] = imavrd.LastUpdateReceivedTime + } + if imavrd.ReplicaID != nil { + objectMap["replicaId"] = imavrd.ReplicaID + } + if imavrd.OsVersion != nil { + objectMap["osVersion"] = imavrd.OsVersion + } + if imavrd.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = imavrd.ProtectedManagedDisks + } + if imavrd.FirmwareType != nil { + objectMap["firmwareType"] = imavrd.FirmwareType + } + if imavrd.AzureVMGeneration != nil { + objectMap["azureVmGeneration"] = imavrd.AzureVMGeneration + } + if imavrd.IsAdditionalStatsAvailable != nil { + objectMap["isAdditionalStatsAvailable"] = imavrd.IsAdditionalStatsAvailable + } + if imavrd.TotalDataTransferred != nil { + objectMap["totalDataTransferred"] = imavrd.TotalDataTransferred + } + if imavrd.TotalProgressHealth != nil { + objectMap["totalProgressHealth"] = imavrd.TotalProgressHealth + } + if imavrd.TargetVMTags != nil { + objectMap["targetVmTags"] = imavrd.TargetVMTags + } + if imavrd.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = imavrd.SeedManagedDiskTags + } + if imavrd.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavrd.TargetManagedDiskTags + } + if imavrd.TargetNicTags != nil { + objectMap["targetNicTags"] = imavrd.TargetNicTags + } + if imavrd.InstanceType != "" { + objectMap["instanceType"] = imavrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return &imavrd, true +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imavrd, true +} + +// InMageAzureV2ReprotectInput inMageAzureV2 specific provider input. +type InMageAzureV2ReprotectInput struct { + // MasterTargetID - The Master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // StorageAccountID - The storage account id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) MarshalJSON() ([]byte, error) { + imavri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavri.MasterTargetID != nil { + objectMap["masterTargetId"] = imavri.MasterTargetID + } + if imavri.ProcessServerID != nil { + objectMap["processServerId"] = imavri.ProcessServerID + } + if imavri.StorageAccountID != nil { + objectMap["storageAccountId"] = imavri.StorageAccountID + } + if imavri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imavri.RunAsAccountID + } + if imavri.PolicyID != nil { + objectMap["policyId"] = imavri.PolicyID + } + if imavri.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imavri.LogStorageAccountID + } + if imavri.DisksToInclude != nil { + objectMap["disksToInclude"] = imavri.DisksToInclude + } + if imavri.InstanceType != "" { + objectMap["instanceType"] = imavri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return &imavri, true +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imavri, true +} + +// InMageAzureV2TestFailoverInput inMageAzureV2 provider specific input for test failover. +type InMageAzureV2TestFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) MarshalJSON() ([]byte, error) { + imavtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imavtfi.RecoveryPointID + } + if imavtfi.InstanceType != "" { + objectMap["instanceType"] = imavtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return &imavtfi, true +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imavtfi, true +} + +// InMageAzureV2UnplannedFailoverInput inMageAzureV2 provider specific input for unplanned failover. +type InMageAzureV2UnplannedFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imavufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imavufi.RecoveryPointID + } + if imavufi.InstanceType != "" { + objectMap["instanceType"] = imavufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return &imavufi, true +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imavufi, true +} + +// InMageAzureV2UpdateReplicationProtectedItemInput inMage Azure V2 input to update replication protected +// item. +type InMageAzureV2UpdateReplicationProtectedItemInput struct { + // RecoveryAzureV1ResourceGroupID - The recovery Azure resource group Id for classic deployment. + RecoveryAzureV1ResourceGroupID *string `json:"recoveryAzureV1ResourceGroupId,omitempty"` + // RecoveryAzureV2ResourceGroupID - The recovery Azure resource group Id for resource manager deployment. + RecoveryAzureV2ResourceGroupID *string `json:"recoveryAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imavurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavurpii.RecoveryAzureV1ResourceGroupID != nil { + objectMap["recoveryAzureV1ResourceGroupId"] = imavurpii.RecoveryAzureV1ResourceGroupID + } + if imavurpii.RecoveryAzureV2ResourceGroupID != nil { + objectMap["recoveryAzureV2ResourceGroupId"] = imavurpii.RecoveryAzureV2ResourceGroupID + } + if imavurpii.UseManagedDisks != nil { + objectMap["useManagedDisks"] = imavurpii.UseManagedDisks + } + if imavurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavurpii.TargetProximityPlacementGroupID + } + if imavurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavurpii.TargetAvailabilityZone + } + if imavurpii.TargetVMTags != nil { + objectMap["targetVmTags"] = imavurpii.TargetVMTags + } + if imavurpii.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavurpii.TargetManagedDiskTags + } + if imavurpii.TargetNicTags != nil { + objectMap["targetNicTags"] = imavurpii.TargetNicTags + } + if imavurpii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = imavurpii.SQLServerLicenseType + } + if imavurpii.InstanceType != "" { + objectMap["instanceType"] = imavurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return &imavurpii, true +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &imavurpii, true +} + +// InMageBasePolicyDetails base class for the policies of providers using InMage replication. +type InMageBasePolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) MarshalJSON() ([]byte, error) { + imbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails + objectMap := make(map[string]interface{}) + if imbpd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imbpd.RecoveryPointThresholdInMinutes + } + if imbpd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imbpd.RecoveryPointHistory + } + if imbpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imbpd.AppConsistentFrequencyInMinutes + } + if imbpd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imbpd.MultiVMSyncStatus + } + if imbpd.InstanceType != "" { + objectMap["instanceType"] = imbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return &imbpd, true +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imbpd, true +} + +// InMageDisableProtectionProviderSpecificInput inMage disable protection provider specific input. +type InMageDisableProtectionProviderSpecificInput struct { + // ReplicaVMDeletionStatus - A value indicating whether the replica VM should be destroyed or retained. Values from Delete and Retain. + ReplicaVMDeletionStatus *string `json:"replicaVmDeletionStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeDisableProtectionProviderSpecificInput', 'InstanceTypeInMage' + InstanceType InstanceTypeBasicDisableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + imdppsi.InstanceType = InstanceTypeInMage + objectMap := make(map[string]interface{}) + if imdppsi.ReplicaVMDeletionStatus != nil { + objectMap["replicaVmDeletionStatus"] = imdppsi.ReplicaVMDeletionStatus + } + if imdppsi.InstanceType != "" { + objectMap["instanceType"] = imdppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) { + return &imdppsi, true +} + +// AsDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsBasicDisableProtectionProviderSpecificInput() (BasicDisableProtectionProviderSpecificInput, bool) { + return &imdppsi, true +} + +// InMageDiskDetails vMware/Physical specific Disk Details. +type InMageDiskDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskSizeInMB - The disk size in MB. + DiskSizeInMB *string `json:"diskSizeInMB,omitempty"` + // DiskType - Whether disk is system disk or data disk. + DiskType *string `json:"diskType,omitempty"` + // DiskConfiguration - Whether disk is dynamic disk or basic disk. + DiskConfiguration *string `json:"diskConfiguration,omitempty"` + // VolumeList - Volumes of the disk. + VolumeList *[]DiskVolumeDetails `json:"volumeList,omitempty"` +} + +// InMageDiskExclusionInput diskExclusionInput when doing enable protection of virtual machine in InMage +// provider. +type InMageDiskExclusionInput struct { + // VolumeOptions - The volume label based option for disk exclusion. + VolumeOptions *[]InMageVolumeExclusionOptions `json:"volumeOptions,omitempty"` + // DiskSignatureOptions - The guest disk signature based option for disk exclusion. + DiskSignatureOptions *[]InMageDiskSignatureExclusionOptions `json:"diskSignatureOptions,omitempty"` +} + +// InMageDiskSignatureExclusionOptions guest disk signature based disk exclusion option when doing enable +// protection of virtual machine in InMage provider. +type InMageDiskSignatureExclusionOptions struct { + // DiskSignature - The guest signature of disk to be excluded from replication. + DiskSignature *string `json:"diskSignature,omitempty"` +} + +// InMageEnableProtectionInput vMware Azure specific enable protection input. +type InMageEnableProtectionInput struct { + // VMFriendlyName - The VM Name. + VMFriendlyName *string `json:"vmFriendlyName,omitempty"` + // MasterTargetID - The Master Target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RetentionDrive - The retention drive to use on the MT. + RetentionDrive *string `json:"retentionDrive,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // MultiVMGroupID - The multi VM group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // DiskExclusionInput - The enable disk exclusion input. + DiskExclusionInput *InMageDiskExclusionInput `json:"diskExclusionInput,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) MarshalJSON() ([]byte, error) { + imepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imepi.VMFriendlyName != nil { + objectMap["vmFriendlyName"] = imepi.VMFriendlyName + } + if imepi.MasterTargetID != nil { + objectMap["masterTargetId"] = imepi.MasterTargetID + } + if imepi.ProcessServerID != nil { + objectMap["processServerId"] = imepi.ProcessServerID + } + if imepi.RetentionDrive != nil { + objectMap["retentionDrive"] = imepi.RetentionDrive + } + if imepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imepi.RunAsAccountID + } + if imepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imepi.MultiVMGroupID + } + if imepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imepi.MultiVMGroupName + } + if imepi.DatastoreName != nil { + objectMap["datastoreName"] = imepi.DatastoreName + } + if imepi.DiskExclusionInput != nil { + objectMap["diskExclusionInput"] = imepi.DiskExclusionInput + } + if imepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imepi.DisksToInclude + } + if imepi.InstanceType != "" { + objectMap["instanceType"] = imepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return &imepi, true +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imepi, true +} + +// InMagePolicyDetails inMage specific protection profile details. +type InMagePolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMagePolicyDetails. +func (impd InMagePolicyDetails) MarshalJSON() ([]byte, error) { + impd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage + objectMap := make(map[string]interface{}) + if impd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = impd.RecoveryPointThresholdInMinutes + } + if impd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = impd.RecoveryPointHistory + } + if impd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = impd.AppConsistentFrequencyInMinutes + } + if impd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = impd.MultiVMSyncStatus + } + if impd.InstanceType != "" { + objectMap["instanceType"] = impd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return &impd, true +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &impd, true +} + +// InMagePolicyInput vMWare Azure specific protection profile Input. +type InMagePolicyInput struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMagePolicyInput. +func (impi InMagePolicyInput) MarshalJSON() ([]byte, error) { + impi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if impi.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = impi.RecoveryPointThresholdInMinutes + } + if impi.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = impi.RecoveryPointHistory + } + if impi.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = impi.AppConsistentFrequencyInMinutes + } + if impi.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = impi.MultiVMSyncStatus + } + if impi.InstanceType != "" { + objectMap["instanceType"] = impi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return &impi, true +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &impi, true +} + +// InMageProtectedDiskDetails inMage protected disk details. +type InMageProtectedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // HealthErrorCode - The health error code for the disk. + HealthErrorCode *string `json:"healthErrorCode,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncDurationInSeconds - The resync duration in seconds. + ResyncDurationInSeconds *int64 `json:"resyncDurationInSeconds,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // FileSystemCapacityInBytes - The file system capacity in bytes. + FileSystemCapacityInBytes *int64 `json:"fileSystemCapacityInBytes,omitempty"` + // SourceDataInMB - The source data transit in MB. + SourceDataInMB *float64 `json:"sourceDataInMB,omitempty"` + // PsDataInMB - The PS data transit in MB. + PsDataInMB *float64 `json:"psDataInMB,omitempty"` + // TargetDataInMB - The target data transit in MB. + TargetDataInMB *float64 `json:"targetDataInMB,omitempty"` + // DiskResized - A value indicating whether disk is resized. + DiskResized *string `json:"diskResized,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // ResyncProcessedBytes - The resync processed bytes. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTotalTransferredBytes - The resync total transferred bytes. + ResyncTotalTransferredBytes *int64 `json:"resyncTotalTransferredBytes,omitempty"` + // ResyncLast15MinutesTransferredBytes - The resync last 15 minutes transferred bytes. + ResyncLast15MinutesTransferredBytes *int64 `json:"resyncLast15MinutesTransferredBytes,omitempty"` + // ResyncLastDataTransferTimeUTC - The last data transfer time in UTC. + ResyncLastDataTransferTimeUTC *date.Time `json:"resyncLastDataTransferTimeUTC,omitempty"` + // ResyncStartTime - The resync start time. + ResyncStartTime *date.Time `json:"resyncStartTime,omitempty"` + // ProgressHealth - The Progress Health. + ProgressHealth *string `json:"progressHealth,omitempty"` + // ProgressStatus - The Progress Status. + ProgressStatus *string `json:"progressStatus,omitempty"` +} + +// InMageRcmAgentUpgradeBlockingErrorDetails inMageRcm source agent upgrade blocking error details. +type InMageRcmAgentUpgradeBlockingErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageRcmAgentUpgradeBlockingErrorDetails. +func (imraubed InMageRcmAgentUpgradeBlockingErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmApplyRecoveryPointInput applyRecoveryPoint input specific to InMageRcm provider. +type InMageRcmApplyRecoveryPointInput struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + imrarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrarpi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrarpi.RecoveryPointID + } + if imrarpi.InstanceType != "" { + objectMap["instanceType"] = imrarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return &imrarpi, true +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &imrarpi, true +} + +// InMageRcmDiskInput inMageRcm disk input. +type InMageRcmDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageRcmDisksDefaultInput inMageRcm disk input. +type InMageRcmDisksDefaultInput struct { + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageRcmEnableProtectionInput inMageRcm specific enable protection input. +type InMageRcmEnableProtectionInput struct { + // FabricDiscoveryMachineID - The ARM Id of discovered machine. + FabricDiscoveryMachineID *string `json:"fabricDiscoveryMachineId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]InMageRcmDiskInput `json:"disksToInclude,omitempty"` + // DisksDefault - The default disk input. + DisksDefault *InMageRcmDisksDefaultInput `json:"disksDefault,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetNetworkID - The selected target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The selected test network ARM Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // TargetSubnetName - The selected target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TestSubnetName - The selected test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // RunAsAccountID - The run-as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) MarshalJSON() ([]byte, error) { + imrepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrepi.FabricDiscoveryMachineID != nil { + objectMap["fabricDiscoveryMachineId"] = imrepi.FabricDiscoveryMachineID + } + if imrepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imrepi.DisksToInclude + } + if imrepi.DisksDefault != nil { + objectMap["disksDefault"] = imrepi.DisksDefault + } + if imrepi.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrepi.TargetResourceGroupID + } + if imrepi.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrepi.TargetNetworkID + } + if imrepi.TestNetworkID != nil { + objectMap["testNetworkId"] = imrepi.TestNetworkID + } + if imrepi.TargetSubnetName != nil { + objectMap["targetSubnetName"] = imrepi.TargetSubnetName + } + if imrepi.TestSubnetName != nil { + objectMap["testSubnetName"] = imrepi.TestSubnetName + } + if imrepi.TargetVMName != nil { + objectMap["targetVmName"] = imrepi.TargetVMName + } + if imrepi.TargetVMSize != nil { + objectMap["targetVmSize"] = imrepi.TargetVMSize + } + if imrepi.LicenseType != "" { + objectMap["licenseType"] = imrepi.LicenseType + } + if imrepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrepi.TargetAvailabilitySetID + } + if imrepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrepi.TargetAvailabilityZone + } + if imrepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrepi.TargetProximityPlacementGroupID + } + if imrepi.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrepi.TargetBootDiagnosticsStorageAccountID + } + if imrepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imrepi.RunAsAccountID + } + if imrepi.ProcessServerID != nil { + objectMap["processServerId"] = imrepi.ProcessServerID + } + if imrepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imrepi.MultiVMGroupName + } + if imrepi.InstanceType != "" { + objectMap["instanceType"] = imrepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return &imrepi, true +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imrepi, true +} + +// InMageRcmEventDetails event details for InMageRcm provider. +type InMageRcmEventDetails struct { + // ProtectedItemName - READ-ONLY; The protected item name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // VMName - READ-ONLY; The protected item name. + VMName *string `json:"vmName,omitempty"` + // LatestAgentVersion - READ-ONLY; The latest agent version. + LatestAgentVersion *string `json:"latestAgentVersion,omitempty"` + // JobID - READ-ONLY; The job Id. + JobID *string `json:"jobId,omitempty"` + // FabricName - READ-ONLY; The fabric name. + FabricName *string `json:"fabricName,omitempty"` + // ApplianceName - READ-ONLY; The appliance name. + ApplianceName *string `json:"applianceName,omitempty"` + // ServerType - READ-ONLY; The server type. + ServerType *string `json:"serverType,omitempty"` + // ComponentDisplayName - READ-ONLY; The component display name. + ComponentDisplayName *string `json:"componentDisplayName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) MarshalJSON() ([]byte, error) { + imred.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imred.InstanceType != "" { + objectMap["instanceType"] = imred.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return &imred, true +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imred, true +} + +// InMageRcmFabricCreationInput inMageRcm fabric provider specific settings. +type InMageRcmFabricCreationInput struct { + // VmwareSiteID - The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // SourceAgentIdentity - The identity provider input for source agent authentication. + SourceAgentIdentity *IdentityProviderInput `json:"sourceAgentIdentity,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreationInput', 'InstanceTypeAzure', 'InstanceTypeInMageRcm', 'InstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) MarshalJSON() ([]byte, error) { + imrfci.InstanceType = InstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrfci.VmwareSiteID != nil { + objectMap["vmwareSiteId"] = imrfci.VmwareSiteID + } + if imrfci.PhysicalSiteID != nil { + objectMap["physicalSiteId"] = imrfci.PhysicalSiteID + } + if imrfci.SourceAgentIdentity != nil { + objectMap["sourceAgentIdentity"] = imrfci.SourceAgentIdentity + } + if imrfci.InstanceType != "" { + objectMap["instanceType"] = imrfci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return &imrfci, true +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &imrfci, true +} + +// InMageRcmFabricSpecificDetails inMageRcm fabric specific details. +type InMageRcmFabricSpecificDetails struct { + // VmwareSiteID - READ-ONLY; The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - READ-ONLY; The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // ServiceEndpoint - READ-ONLY; The service endpoint. + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` + // ServiceResourceID - READ-ONLY; The service resource Id. + ServiceResourceID *string `json:"serviceResourceId,omitempty"` + // ServiceContainerID - READ-ONLY; The service container Id. + ServiceContainerID *string `json:"serviceContainerId,omitempty"` + // DataPlaneURI - READ-ONLY; The data plane Uri. + DataPlaneURI *string `json:"dataPlaneUri,omitempty"` + // ControlPlaneURI - READ-ONLY; The control plane Uri. + ControlPlaneURI *string `json:"controlPlaneUri,omitempty"` + // ProcessServers - READ-ONLY; The list of process servers. + ProcessServers *[]ProcessServerDetails `json:"processServers,omitempty"` + // RcmProxies - READ-ONLY; The list of RCM proxies. + RcmProxies *[]RcmProxyDetails `json:"rcmProxies,omitempty"` + // PushInstallers - READ-ONLY; The list of push installers. + PushInstallers *[]PushInstallerDetails `json:"pushInstallers,omitempty"` + // ReplicationAgents - READ-ONLY; The list of replication agents. + ReplicationAgents *[]ReplicationAgentDetails `json:"replicationAgents,omitempty"` + // ReprotectAgents - READ-ONLY; The list of reprotect agents. + ReprotectAgents *[]ReprotectAgentDetails `json:"reprotectAgents,omitempty"` + // MarsAgents - READ-ONLY; The list of Mars agents. + MarsAgents *[]MarsAgentDetails `json:"marsAgents,omitempty"` + // Dras - READ-ONLY; The list of DRAs. + Dras *[]DraDetails `json:"dras,omitempty"` + // AgentDetails - READ-ONLY; The list of agent details. + AgentDetails *[]AgentDetails `json:"agentDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) MarshalJSON() ([]byte, error) { + imrfsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrfsd.InstanceType != "" { + objectMap["instanceType"] = imrfsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return &imrfsd, true +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &imrfsd, true +} + +// InMageRcmFailbackEventDetails event details for InMageRcmFailback provider. +type InMageRcmFailbackEventDetails struct { + // ProtectedItemName - READ-ONLY; The protected item name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) MarshalJSON() ([]byte, error) { + imrfed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfed.InstanceType != "" { + objectMap["instanceType"] = imrfed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return &imrfed, true +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imrfed, true +} + +// InMageRcmFailbackMobilityAgentDetails inMageRcmFailback mobility agent details. +type InMageRcmFailbackMobilityAgentDetails struct { + // Version - READ-ONLY; The agent version. + Version *string `json:"version,omitempty"` + // LatestVersion - READ-ONLY; The latest agent version available. + LatestVersion *string `json:"latestVersion,omitempty"` + // DriverVersion - READ-ONLY; The driver version. + DriverVersion *string `json:"driverVersion,omitempty"` + // LatestUpgradableVersionWithoutReboot - READ-ONLY; The latest upgradeable version available without reboot. + LatestUpgradableVersionWithoutReboot *string `json:"latestUpgradableVersionWithoutReboot,omitempty"` + // AgentVersionExpiryDate - READ-ONLY; The agent version expiry date. + AgentVersionExpiryDate *date.Time `json:"agentVersionExpiryDate,omitempty"` + // DriverVersionExpiryDate - READ-ONLY; The driver version expiry date. + DriverVersionExpiryDate *date.Time `json:"driverVersionExpiryDate,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The time of the last heartbeat received from the agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // ReasonsBlockingUpgrade - READ-ONLY; The whether update is possible or not. + ReasonsBlockingUpgrade *[]AgentUpgradeBlockedReason `json:"reasonsBlockingUpgrade,omitempty"` + // IsUpgradeable - READ-ONLY; A value indicating whether agent is upgradeable or not. + IsUpgradeable *string `json:"isUpgradeable,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackMobilityAgentDetails. +func (imrfmad InMageRcmFailbackMobilityAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackNicDetails inMageRcmFailback NIC details. +type InMageRcmFailbackNicDetails struct { + // MacAddress - READ-ONLY; The mac address. + MacAddress *string `json:"macAddress,omitempty"` + // NetworkName - READ-ONLY; The network name. + NetworkName *string `json:"networkName,omitempty"` + // AdapterType - READ-ONLY; The adapter type. + AdapterType *string `json:"adapterType,omitempty"` + // SourceIPAddress - READ-ONLY; The IP address. + SourceIPAddress *string `json:"sourceIpAddress,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackNicDetails. +func (imrfnd InMageRcmFailbackNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackPlannedFailoverProviderInput provider specific input for InMageRcmFailback failover. +type InMageRcmFailbackPlannedFailoverProviderInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'ApplicationConsistent', 'CrashConsistent' + RecoveryPointType InMageRcmFailbackRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) MarshalJSON() ([]byte, error) { + imrfpfpi.InstanceType = InstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpfpi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imrfpfpi.RecoveryPointType + } + if imrfpfpi.InstanceType != "" { + objectMap["instanceType"] = imrfpfpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return &imrfpfpi, true +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &imrfpfpi, true +} + +// InMageRcmFailbackPolicyCreationInput inMageRcmFailback policy creation input. +type InMageRcmFailbackPolicyCreationInput struct { + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) MarshalJSON() ([]byte, error) { + imrfpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrfpci.CrashConsistentFrequencyInMinutes + } + if imrfpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrfpci.AppConsistentFrequencyInMinutes + } + if imrfpci.InstanceType != "" { + objectMap["instanceType"] = imrfpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return &imrfpci, true +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imrfpci, true +} + +// InMageRcmFailbackPolicyDetails inMageRcm failback specific policy details. +type InMageRcmFailbackPolicyDetails struct { + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) MarshalJSON() ([]byte, error) { + imrfpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrfpd.AppConsistentFrequencyInMinutes + } + if imrfpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrfpd.CrashConsistentFrequencyInMinutes + } + if imrfpd.InstanceType != "" { + objectMap["instanceType"] = imrfpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return &imrfpd, true +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imrfpd, true +} + +// InMageRcmFailbackProtectedDiskDetails inMageRcmFailback protected disk details. +type InMageRcmFailbackProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk Id (reported by source agent). + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // DiskUUID - READ-ONLY; The disk Uuid (reported by vCenter). + DiskUUID *string `json:"diskUuid,omitempty"` + // DataPendingInLogDataStoreInMB - READ-ONLY; The data pending in log data store in MB. + DataPendingInLogDataStoreInMB *float64 `json:"dataPendingInLogDataStoreInMB,omitempty"` + // DataPendingAtSourceAgentInMB - READ-ONLY; The data pending at source agent in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // IsInitialReplicationComplete - READ-ONLY; A value indicating whether initial replication is complete or not. + IsInitialReplicationComplete *string `json:"isInitialReplicationComplete,omitempty"` + // IrDetails - The initial replication details. + IrDetails *InMageRcmFailbackSyncDetails `json:"irDetails,omitempty"` + // ResyncDetails - The resync details. + ResyncDetails *InMageRcmFailbackSyncDetails `json:"resyncDetails,omitempty"` + // LastSyncTime - READ-ONLY; The last sync time. + LastSyncTime *date.Time `json:"lastSyncTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackProtectedDiskDetails. +func (imrfpdd InMageRcmFailbackProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrfpdd.IrDetails != nil { + objectMap["irDetails"] = imrfpdd.IrDetails + } + if imrfpdd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrfpdd.ResyncDetails + } + return json.Marshal(objectMap) +} + +// InMageRcmFailbackReplicationDetails inMageRcmFailback provider specific details. +type InMageRcmFailbackReplicationDetails struct { + // InternalIdentifier - READ-ONLY; The virtual machine internal identifier. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // AzureVirtualMachineID - READ-ONLY; The ARM Id of the azure VM. + AzureVirtualMachineID *string `json:"azureVirtualMachineId,omitempty"` + // MultiVMGroupName - READ-ONLY; The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // ReprotectAgentID - READ-ONLY; The reprotect agent Id. + ReprotectAgentID *string `json:"reprotectAgentId,omitempty"` + // ReprotectAgentName - READ-ONLY; The reprotect agent name. + ReprotectAgentName *string `json:"reprotectAgentName,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // TargetvCenterID - READ-ONLY; The target vCenter Id. + TargetvCenterID *string `json:"targetvCenterId,omitempty"` + // TargetDataStoreName - READ-ONLY; The target datastore name. + TargetDataStoreName *string `json:"targetDataStoreName,omitempty"` + // TargetVMName - READ-ONLY; The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // InitialReplicationProgressPercentage - READ-ONLY; The initial replication progress percentage. + InitialReplicationProgressPercentage *int32 `json:"initialReplicationProgressPercentage,omitempty"` + // InitialReplicationProcessedBytes - READ-ONLY; The initial replication processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + InitialReplicationProcessedBytes *int64 `json:"initialReplicationProcessedBytes,omitempty"` + // InitialReplicationTransferredBytes - READ-ONLY; The initial replication transferred bytes from source VM to target for all selected disks on source VM. + InitialReplicationTransferredBytes *int64 `json:"initialReplicationTransferredBytes,omitempty"` + // InitialReplicationProgressHealth - READ-ONLY; The initial replication progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + InitialReplicationProgressHealth VMReplicationProgressHealth `json:"initialReplicationProgressHealth,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncProcessedBytes - READ-ONLY; The resync processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTransferredBytes - READ-ONLY; The resync transferred bytes from source VM to target for all selected disks on source VM. + ResyncTransferredBytes *int64 `json:"resyncTransferredBytes,omitempty"` + // ResyncProgressHealth - READ-ONLY; The resync progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + ResyncProgressHealth VMReplicationProgressHealth `json:"resyncProgressHealth,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageRcmFailbackProtectedDiskDetails `json:"protectedDisks,omitempty"` + // MobilityAgentDetails - The mobility agent information. + MobilityAgentDetails *InMageRcmFailbackMobilityAgentDetails `json:"mobilityAgentDetails,omitempty"` + // VMNics - The network details. + VMNics *[]InMageRcmFailbackNicDetails `json:"vmNics,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) MarshalJSON() ([]byte, error) { + imrfrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrfrd.ProtectedDisks + } + if imrfrd.MobilityAgentDetails != nil { + objectMap["mobilityAgentDetails"] = imrfrd.MobilityAgentDetails + } + if imrfrd.VMNics != nil { + objectMap["vmNics"] = imrfrd.VMNics + } + if imrfrd.InstanceType != "" { + objectMap["instanceType"] = imrfrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return &imrfrd, true +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrfrd, true +} + +// InMageRcmFailbackReprotectInput inMageRcmFailback specific provider input. +type InMageRcmFailbackReprotectInput struct { + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RunAsAccountID - The run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) MarshalJSON() ([]byte, error) { + imrfri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfri.ProcessServerID != nil { + objectMap["processServerId"] = imrfri.ProcessServerID + } + if imrfri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imrfri.RunAsAccountID + } + if imrfri.PolicyID != nil { + objectMap["policyId"] = imrfri.PolicyID + } + if imrfri.InstanceType != "" { + objectMap["instanceType"] = imrfri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return &imrfri, true +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imrfri, true +} + +// InMageRcmFailbackSyncDetails inMageRcmFailback disk level sync details. +type InMageRcmFailbackSyncDetails struct { + // ProgressHealth - READ-ONLY; The progress health. Possible values include: 'None', 'InProgress', 'SlowProgress', 'NoProgress', 'Queued' + ProgressHealth DiskReplicationProgressHealth `json:"progressHealth,omitempty"` + // TransferredBytes - READ-ONLY; The transferred bytes from source VM to azure for the disk. + TransferredBytes *int64 `json:"transferredBytes,omitempty"` + // Last15MinutesTransferredBytes - READ-ONLY; The bytes transferred in last 15 minutes from source VM to target. + Last15MinutesTransferredBytes *int64 `json:"last15MinutesTransferredBytes,omitempty"` + // LastDataTransferTimeUtc - READ-ONLY; The time of the last data transfer from source VM to target. + LastDataTransferTimeUtc *string `json:"lastDataTransferTimeUtc,omitempty"` + // ProcessedBytes - READ-ONLY; The total processed bytes. This includes bytes that are transferred from source VM to target and matched bytes. + ProcessedBytes *int64 `json:"processedBytes,omitempty"` + // StartTime - READ-ONLY; The start time. + StartTime *string `json:"startTime,omitempty"` + // LastRefreshTime - READ-ONLY; The last refresh time. + LastRefreshTime *string `json:"lastRefreshTime,omitempty"` + // ProgressPercentage - READ-ONLY; Progress in percentage. Progress percentage is calculated based on processed bytes. + ProgressPercentage *int32 `json:"progressPercentage,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackSyncDetails. +func (imrfsd InMageRcmFailbackSyncDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmLastAgentUpgradeErrorDetails inMageRcm last source agent upgrade error details. +type InMageRcmLastAgentUpgradeErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageRcmLastAgentUpgradeErrorDetails. +func (imrlaued InMageRcmLastAgentUpgradeErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmMobilityAgentDetails inMageRcm mobility agent details. +type InMageRcmMobilityAgentDetails struct { + // Version - READ-ONLY; The agent version. + Version *string `json:"version,omitempty"` + // LatestVersion - READ-ONLY; The latest agent version available. + LatestVersion *string `json:"latestVersion,omitempty"` + // LatestAgentReleaseDate - READ-ONLY; The latest agent version release date. + LatestAgentReleaseDate *string `json:"latestAgentReleaseDate,omitempty"` + // DriverVersion - READ-ONLY; The driver version. + DriverVersion *string `json:"driverVersion,omitempty"` + // LatestUpgradableVersionWithoutReboot - READ-ONLY; The latest upgradeable version available without reboot. + LatestUpgradableVersionWithoutReboot *string `json:"latestUpgradableVersionWithoutReboot,omitempty"` + // AgentVersionExpiryDate - READ-ONLY; The agent version expiry date. + AgentVersionExpiryDate *date.Time `json:"agentVersionExpiryDate,omitempty"` + // DriverVersionExpiryDate - READ-ONLY; The driver version expiry date. + DriverVersionExpiryDate *date.Time `json:"driverVersionExpiryDate,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The time of the last heartbeat received from the agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // ReasonsBlockingUpgrade - READ-ONLY; The whether update is possible or not. + ReasonsBlockingUpgrade *[]AgentUpgradeBlockedReason `json:"reasonsBlockingUpgrade,omitempty"` + // IsUpgradeable - READ-ONLY; A value indicating whether agent is upgradeable or not. + IsUpgradeable *string `json:"isUpgradeable,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmMobilityAgentDetails. +func (imrmad InMageRcmMobilityAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmNicDetails inMageRcm NIC details. +type InMageRcmNicDetails struct { + // NicID - READ-ONLY; The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // IsSelectedForFailover - A value indicating whether this NIC is selected for failover. + IsSelectedForFailover *string `json:"isSelectedForFailover,omitempty"` + // SourceIPAddress - READ-ONLY; The source IP address. + SourceIPAddress *string `json:"sourceIPAddress,omitempty"` + // SourceIPAddressType - READ-ONLY; The source IP address type. Possible values include: 'Dynamic', 'Static' + SourceIPAddressType EthernetAddressType `json:"sourceIPAddressType,omitempty"` + // SourceNetworkID - READ-ONLY; Source network Id. + SourceNetworkID *string `json:"sourceNetworkId,omitempty"` + // SourceSubnetName - READ-ONLY; Source subnet name. + SourceSubnetName *string `json:"sourceSubnetName,omitempty"` + // TargetIPAddress - The target IP address. + TargetIPAddress *string `json:"targetIPAddress,omitempty"` + // TargetIPAddressType - The target IP address type. Possible values include: 'Dynamic', 'Static' + TargetIPAddressType EthernetAddressType `json:"targetIPAddressType,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TestSubnetName - Test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TestIPAddress - The test IP address. + TestIPAddress *string `json:"testIPAddress,omitempty"` + // TestIPAddressType - The test IP address type. Possible values include: 'Dynamic', 'Static' + TestIPAddressType EthernetAddressType `json:"testIPAddressType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmNicDetails. +func (imrnd InMageRcmNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrnd.IsPrimaryNic != nil { + objectMap["isPrimaryNic"] = imrnd.IsPrimaryNic + } + if imrnd.IsSelectedForFailover != nil { + objectMap["isSelectedForFailover"] = imrnd.IsSelectedForFailover + } + if imrnd.TargetIPAddress != nil { + objectMap["targetIPAddress"] = imrnd.TargetIPAddress + } + if imrnd.TargetIPAddressType != "" { + objectMap["targetIPAddressType"] = imrnd.TargetIPAddressType + } + if imrnd.TargetSubnetName != nil { + objectMap["targetSubnetName"] = imrnd.TargetSubnetName + } + if imrnd.TestSubnetName != nil { + objectMap["testSubnetName"] = imrnd.TestSubnetName + } + if imrnd.TestIPAddress != nil { + objectMap["testIPAddress"] = imrnd.TestIPAddress + } + if imrnd.TestIPAddressType != "" { + objectMap["testIPAddressType"] = imrnd.TestIPAddressType + } + return json.Marshal(objectMap) +} + +// InMageRcmNicInput inMageRcm NIC input. +type InMageRcmNicInput struct { + // NicID - The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // IsSelectedForFailover - A value indicating whether this NIC is selected for failover. + IsSelectedForFailover *string `json:"isSelectedForFailover,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetStaticIPAddress - The target static IP address. + TargetStaticIPAddress *string `json:"targetStaticIPAddress,omitempty"` + // TestSubnetName - The test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TestStaticIPAddress - The test static IP address. + TestStaticIPAddress *string `json:"testStaticIPAddress,omitempty"` +} + +// InMageRcmPolicyCreationInput inMageRcm policy creation input. +type InMageRcmPolicyCreationInput struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // EnableMultiVMSync - A value indicating whether multi-VM sync has to be enabled. + EnableMultiVMSync *string `json:"enableMultiVmSync,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) MarshalJSON() ([]byte, error) { + imrpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpci.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = imrpci.RecoveryPointHistoryInMinutes + } + if imrpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrpci.CrashConsistentFrequencyInMinutes + } + if imrpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrpci.AppConsistentFrequencyInMinutes + } + if imrpci.EnableMultiVMSync != nil { + objectMap["enableMultiVmSync"] = imrpci.EnableMultiVMSync + } + if imrpci.InstanceType != "" { + objectMap["instanceType"] = imrpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return &imrpci, true +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imrpci, true +} + +// InMageRcmPolicyDetails inMageRcm specific policy details. +type InMageRcmPolicyDetails struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // EnableMultiVMSync - A value indicating whether multi-VM sync has to be enabled. + EnableMultiVMSync *string `json:"enableMultiVmSync,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) MarshalJSON() ([]byte, error) { + imrpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpd.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = imrpd.RecoveryPointHistoryInMinutes + } + if imrpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrpd.AppConsistentFrequencyInMinutes + } + if imrpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrpd.CrashConsistentFrequencyInMinutes + } + if imrpd.EnableMultiVMSync != nil { + objectMap["enableMultiVmSync"] = imrpd.EnableMultiVMSync + } + if imrpd.InstanceType != "" { + objectMap["instanceType"] = imrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return &imrpd, true +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imrpd, true +} + +// InMageRcmProtectedDiskDetails inMageRcm protected disk details. +type InMageRcmProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskEncryptionSetID - READ-ONLY; The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // SeedManagedDiskID - READ-ONLY; The ARM Id of the seed managed disk. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // TargetManagedDiskID - READ-ONLY; The ARM Id of the target managed disk. + TargetManagedDiskID *string `json:"targetManagedDiskId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DataPendingInLogDataStoreInMB - READ-ONLY; The data pending in log data store in MB. + DataPendingInLogDataStoreInMB *float64 `json:"dataPendingInLogDataStoreInMB,omitempty"` + // DataPendingAtSourceAgentInMB - READ-ONLY; The data pending at source agent in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // IsInitialReplicationComplete - READ-ONLY; A value indicating whether initial replication is complete or not. + IsInitialReplicationComplete *string `json:"isInitialReplicationComplete,omitempty"` + // IrDetails - The initial replication details. + IrDetails *InMageRcmSyncDetails `json:"irDetails,omitempty"` + // ResyncDetails - The resync details. + ResyncDetails *InMageRcmSyncDetails `json:"resyncDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmProtectedDiskDetails. +func (imrpdd InMageRcmProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrpdd.DiskType != "" { + objectMap["diskType"] = imrpdd.DiskType + } + if imrpdd.IrDetails != nil { + objectMap["irDetails"] = imrpdd.IrDetails + } + if imrpdd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrpdd.ResyncDetails + } + return json.Marshal(objectMap) +} + +// InMageRcmProtectionContainerMappingDetails inMageRcm provider specific container mapping details. +type InMageRcmProtectionContainerMappingDetails struct { + // EnableAgentAutoUpgrade - READ-ONLY; A value indicating whether the flag for enable agent auto upgrade. + EnableAgentAutoUpgrade *string `json:"enableAgentAutoUpgrade,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + imrpcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpcmd.InstanceType != "" { + objectMap["instanceType"] = imrpcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return &imrpcmd, true +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &imrpcmd, true +} + +// InMageRcmRecoveryPointDetails inMageRcm provider specific recovery point details. +type InMageRcmRecoveryPointDetails struct { + // IsMultiVMSyncPoint - READ-ONLY; A value indicating whether the recovery point is multi VM consistent. + IsMultiVMSyncPoint *string `json:"isMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) MarshalJSON() ([]byte, error) { + imrrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrrpd.InstanceType != "" { + objectMap["instanceType"] = imrrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return &imrrpd, true +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &imrrpd, true +} + +// InMageRcmReplicationDetails inMageRcm provider specific details. +type InMageRcmReplicationDetails struct { + // InternalIdentifier - READ-ONLY; The virtual machine internal identifier. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // FabricDiscoveryMachineID - READ-ONLY; The ARM Id of the discovered VM. + FabricDiscoveryMachineID *string `json:"fabricDiscoveryMachineId,omitempty"` + // MultiVMGroupName - READ-ONLY; The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DiscoveryType - READ-ONLY; The type of the discovered VM. + DiscoveryType *string `json:"discoveryType,omitempty"` + // ProcessServerID - READ-ONLY; The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // ProcessorCoreCount - READ-ONLY; The processor core count. + ProcessorCoreCount *int32 `json:"processorCoreCount,omitempty"` + // AllocatedMemoryInMB - READ-ONLY; The allocated memory in MB. + AllocatedMemoryInMB *float64 `json:"allocatedMemoryInMB,omitempty"` + // ProcessServerName - READ-ONLY; The process server name. + ProcessServerName *string `json:"processServerName,omitempty"` + // RunAsAccountID - READ-ONLY; The run-as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // FirmwareType - READ-ONLY; The firmware type. + FirmwareType *string `json:"firmwareType,omitempty"` + // PrimaryNicIPAddress - READ-ONLY; The IP address of the primary network interface. + PrimaryNicIPAddress *string `json:"primaryNicIpAddress,omitempty"` + // TargetGeneration - READ-ONLY; The target generation. + TargetGeneration *string `json:"targetGeneration,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // TargetVMName - Target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetLocation - The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // TargetAvailabilitySetID - The target availability set Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The test network Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // FailoverRecoveryPointID - READ-ONLY; The recovery point Id to which the VM was failed over. + FailoverRecoveryPointID *string `json:"failoverRecoveryPointId,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // LastRpoInSeconds - READ-ONLY; The last recovery point objective value. + LastRpoInSeconds *int64 `json:"lastRpoInSeconds,omitempty"` + // LastRpoCalculatedTime - READ-ONLY; The last recovery point objective calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastRecoveryPointID - READ-ONLY; The last recovery point Id. + LastRecoveryPointID *string `json:"lastRecoveryPointId,omitempty"` + // InitialReplicationProgressPercentage - READ-ONLY; The initial replication progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + InitialReplicationProgressPercentage *int32 `json:"initialReplicationProgressPercentage,omitempty"` + // InitialReplicationProcessedBytes - READ-ONLY; The initial replication processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + InitialReplicationProcessedBytes *int64 `json:"initialReplicationProcessedBytes,omitempty"` + // InitialReplicationTransferredBytes - READ-ONLY; The initial replication transferred bytes from source VM to azure for all selected disks on source VM. + InitialReplicationTransferredBytes *int64 `json:"initialReplicationTransferredBytes,omitempty"` + // InitialReplicationProgressHealth - READ-ONLY; The initial replication progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + InitialReplicationProgressHealth VMReplicationProgressHealth `json:"initialReplicationProgressHealth,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncProcessedBytes - READ-ONLY; The resync processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTransferredBytes - READ-ONLY; The resync transferred bytes from source VM to azure for all selected disks on source VM. + ResyncTransferredBytes *int64 `json:"resyncTransferredBytes,omitempty"` + // ResyncProgressHealth - READ-ONLY; The resync progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + ResyncProgressHealth VMReplicationProgressHealth `json:"resyncProgressHealth,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // AgentUpgradeState - READ-ONLY; The agent auto upgrade state. Possible values include: 'MobilityAgentUpgradeStateNone', 'MobilityAgentUpgradeStateStarted', 'MobilityAgentUpgradeStateCompleted', 'MobilityAgentUpgradeStateCommit' + AgentUpgradeState MobilityAgentUpgradeState `json:"agentUpgradeState,omitempty"` + // LastAgentUpgradeType - READ-ONLY; The last agent upgrade type. + LastAgentUpgradeType *string `json:"lastAgentUpgradeType,omitempty"` + // AgentUpgradeJobID - READ-ONLY; The agent upgrade job Id. + AgentUpgradeJobID *string `json:"agentUpgradeJobId,omitempty"` + // AgentUpgradeAttemptToVersion - READ-ONLY; The agent version to which last agent upgrade was attempted. + AgentUpgradeAttemptToVersion *string `json:"agentUpgradeAttemptToVersion,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageRcmProtectedDiskDetails `json:"protectedDisks,omitempty"` + // IsLastUpgradeSuccessful - READ-ONLY; A value indicating whether last agent upgrade was successful or not. + IsLastUpgradeSuccessful *string `json:"isLastUpgradeSuccessful,omitempty"` + // MobilityAgentDetails - The mobility agent information. + MobilityAgentDetails *InMageRcmMobilityAgentDetails `json:"mobilityAgentDetails,omitempty"` + // LastAgentUpgradeErrorDetails - The last agent upgrade error information. + LastAgentUpgradeErrorDetails *[]InMageRcmLastAgentUpgradeErrorDetails `json:"lastAgentUpgradeErrorDetails,omitempty"` + // AgentUpgradeBlockingErrorDetails - The agent upgrade blocking error information. + AgentUpgradeBlockingErrorDetails *[]InMageRcmAgentUpgradeBlockingErrorDetails `json:"agentUpgradeBlockingErrorDetails,omitempty"` + // VMNics - The network details. + VMNics *[]InMageRcmNicDetails `json:"vmNics,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) MarshalJSON() ([]byte, error) { + imrrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrrd.LicenseType != nil { + objectMap["licenseType"] = imrrd.LicenseType + } + if imrrd.TargetVMName != nil { + objectMap["targetVmName"] = imrrd.TargetVMName + } + if imrrd.TargetVMSize != nil { + objectMap["targetVmSize"] = imrrd.TargetVMSize + } + if imrrd.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrrd.TargetResourceGroupID + } + if imrrd.TargetLocation != nil { + objectMap["targetLocation"] = imrrd.TargetLocation + } + if imrrd.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrrd.TargetAvailabilitySetID + } + if imrrd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrrd.TargetAvailabilityZone + } + if imrrd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrrd.TargetProximityPlacementGroupID + } + if imrrd.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrrd.TargetBootDiagnosticsStorageAccountID + } + if imrrd.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrrd.TargetNetworkID + } + if imrrd.TestNetworkID != nil { + objectMap["testNetworkId"] = imrrd.TestNetworkID + } + if imrrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrrd.ProtectedDisks + } + if imrrd.MobilityAgentDetails != nil { + objectMap["mobilityAgentDetails"] = imrrd.MobilityAgentDetails + } + if imrrd.LastAgentUpgradeErrorDetails != nil { + objectMap["lastAgentUpgradeErrorDetails"] = imrrd.LastAgentUpgradeErrorDetails + } + if imrrd.AgentUpgradeBlockingErrorDetails != nil { + objectMap["agentUpgradeBlockingErrorDetails"] = imrrd.AgentUpgradeBlockingErrorDetails + } + if imrrd.VMNics != nil { + objectMap["vmNics"] = imrrd.VMNics + } + if imrrd.InstanceType != "" { + objectMap["instanceType"] = imrrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return &imrrd, true +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrrd, true +} + +// InMageRcmReprotectInput inMageRcm specific provider input. +type InMageRcmReprotectInput struct { + // ReprotectAgentID - The reprotect agent Id. + ReprotectAgentID *string `json:"reprotectAgentId,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) MarshalJSON() ([]byte, error) { + imrri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrri.ReprotectAgentID != nil { + objectMap["reprotectAgentId"] = imrri.ReprotectAgentID + } + if imrri.DatastoreName != nil { + objectMap["datastoreName"] = imrri.DatastoreName + } + if imrri.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imrri.LogStorageAccountID + } + if imrri.PolicyID != nil { + objectMap["policyId"] = imrri.PolicyID + } + if imrri.InstanceType != "" { + objectMap["instanceType"] = imrri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return &imrri, true +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imrri, true +} + +// InMageRcmSyncDetails inMageRcm disk level sync details. +type InMageRcmSyncDetails struct { + // ProgressHealth - READ-ONLY; The progress health. Possible values include: 'None', 'InProgress', 'SlowProgress', 'NoProgress', 'Queued' + ProgressHealth DiskReplicationProgressHealth `json:"progressHealth,omitempty"` + // TransferredBytes - READ-ONLY; The transferred bytes from source VM to azure for the disk. + TransferredBytes *int64 `json:"transferredBytes,omitempty"` + // Last15MinutesTransferredBytes - READ-ONLY; The bytes transferred in last 15 minutes from source VM to azure. + Last15MinutesTransferredBytes *int64 `json:"last15MinutesTransferredBytes,omitempty"` + // LastDataTransferTimeUtc - READ-ONLY; The time of the last data transfer from source VM to azure. + LastDataTransferTimeUtc *string `json:"lastDataTransferTimeUtc,omitempty"` + // ProcessedBytes - READ-ONLY; The total processed bytes. This includes bytes that are transferred from source VM to azure and matched bytes. + ProcessedBytes *int64 `json:"processedBytes,omitempty"` + // StartTime - READ-ONLY; The start time. + StartTime *string `json:"startTime,omitempty"` + // LastRefreshTime - READ-ONLY; The last refresh time. + LastRefreshTime *string `json:"lastRefreshTime,omitempty"` + // ProgressPercentage - READ-ONLY; Progress in percentage. Progress percentage is calculated based on processed bytes. + ProgressPercentage *int32 `json:"progressPercentage,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmSyncDetails. +func (imrsd InMageRcmSyncDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmTestFailoverInput inMageRcm provider specific input for test failover. +type InMageRcmTestFailoverInput struct { + // NetworkID - The test network Id. + NetworkID *string `json:"networkId,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) MarshalJSON() ([]byte, error) { + imrtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrtfi.NetworkID != nil { + objectMap["networkId"] = imrtfi.NetworkID + } + if imrtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrtfi.RecoveryPointID + } + if imrtfi.InstanceType != "" { + objectMap["instanceType"] = imrtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return &imrtfi, true +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imrtfi, true +} + +// InMageRcmUnplannedFailoverInput inMageRcm provider specific input for unplanned failover. +type InMageRcmUnplannedFailoverInput struct { + // PerformShutdown - A value indicating whether VM is to be shutdown. + PerformShutdown *string `json:"performShutdown,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imrufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrufi.PerformShutdown != nil { + objectMap["performShutdown"] = imrufi.PerformShutdown + } + if imrufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrufi.RecoveryPointID + } + if imrufi.InstanceType != "" { + objectMap["instanceType"] = imrufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return &imrufi, true +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imrufi, true +} + +// InMageRcmUpdateContainerMappingInput inMageRcm update protection container mapping. +type InMageRcmUpdateContainerMappingInput struct { + // EnableAgentAutoUpgrade - A value indicating whether agent auto upgrade has to be enabled. + EnableAgentAutoUpgrade *string `json:"enableAgentAutoUpgrade,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + imrucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrucmi.EnableAgentAutoUpgrade != nil { + objectMap["enableAgentAutoUpgrade"] = imrucmi.EnableAgentAutoUpgrade + } + if imrucmi.InstanceType != "" { + objectMap["instanceType"] = imrucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return &imrucmi, true +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &imrucmi, true +} + +// InMageRcmUpdateReplicationProtectedItemInput inMageRcm provider specific input to update replication +// protected item. +type InMageRcmUpdateReplicationProtectedItemInput struct { + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The test network ARM Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // VMNics - The list of NIC details. + VMNics *[]InMageRcmNicInput `json:"vmNics,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imrurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrurpii.TargetVMName != nil { + objectMap["targetVmName"] = imrurpii.TargetVMName + } + if imrurpii.TargetVMSize != nil { + objectMap["targetVmSize"] = imrurpii.TargetVMSize + } + if imrurpii.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrurpii.TargetResourceGroupID + } + if imrurpii.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrurpii.TargetAvailabilitySetID + } + if imrurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrurpii.TargetAvailabilityZone + } + if imrurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrurpii.TargetProximityPlacementGroupID + } + if imrurpii.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrurpii.TargetBootDiagnosticsStorageAccountID + } + if imrurpii.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrurpii.TargetNetworkID + } + if imrurpii.TestNetworkID != nil { + objectMap["testNetworkId"] = imrurpii.TestNetworkID + } + if imrurpii.VMNics != nil { + objectMap["vmNics"] = imrurpii.VMNics + } + if imrurpii.LicenseType != "" { + objectMap["licenseType"] = imrurpii.LicenseType + } + if imrurpii.InstanceType != "" { + objectMap["instanceType"] = imrurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return &imrurpii, true +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &imrurpii, true +} + +// InMageReplicationDetails inMage provider specific settings. +type InMageReplicationDetails struct { + // ActiveSiteType - The active location of the VM. If the VM is being protected from Azure, this field will take values from { Azure, OnPrem }. If the VM is being protected between two data-centers, this field will be OnPrem always. + ActiveSiteType *string `json:"activeSiteType,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // OsDetails - The OS details. + OsDetails *OSDiskDetails `json:"osDetails,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // ResyncDetails - The resync details of the machine. + ResyncDetails *InitialReplicationDetails `json:"resyncDetails,omitempty"` + // RetentionWindowStart - The retention window start time. + RetentionWindowStart *date.Time `json:"retentionWindowStart,omitempty"` + // RetentionWindowEnd - The retention window end time. + RetentionWindowEnd *date.Time `json:"retentionWindowEnd,omitempty"` + // CompressedDataRateInMB - The compressed data change rate in MB. + CompressedDataRateInMB *float64 `json:"compressedDataRateInMB,omitempty"` + // UncompressedDataRateInMB - The uncompressed data change rate in MB. + UncompressedDataRateInMB *float64 `json:"uncompressedDataRateInMB,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageProtectedDiskDetails `json:"protectedDisks,omitempty"` + // IPAddress - The source IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // MasterTargetID - The master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ConsistencyPoints - The collection of Consistency points. + ConsistencyPoints map[string]*date.Time `json:"consistencyPoints"` + // DiskResized - A value indicating whether any disk is resized for this VM. + DiskResized *string `json:"diskResized,omitempty"` + // RebootAfterUpdateStatus - A value indicating whether the source server requires a restart after update. + RebootAfterUpdateStatus *string `json:"rebootAfterUpdateStatus,omitempty"` + // MultiVMGroupID - The multi vm group Id, if any. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name, if any. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMSyncStatus - A value indicating whether the multi vm sync is enabled or disabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // AgentDetails - The agent details. + AgentDetails *InMageAgentDetails `json:"agentDetails,omitempty"` + // VCenterInfrastructureID - The vCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // InfrastructureVMID - The infrastructure VM Id. + InfrastructureVMID *string `json:"infrastructureVmId,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. + DiscoveryType *string `json:"discoveryType,omitempty"` + // AzureStorageAccountID - A value indicating the underlying Azure storage account. If the VM is not running in Azure, this value shall be set to null. + AzureStorageAccountID *string `json:"azureStorageAccountId,omitempty"` + // Datastores - The datastores of the on-premise machine Value can be list of strings that contain datastore names. + Datastores *[]string `json:"datastores,omitempty"` + // ValidationErrors - The validation errors of the on-premise machine Value can be list of validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastUpdateReceivedTime - The last update time received from on-prem components. + LastUpdateReceivedTime *date.Time `json:"lastUpdateReceivedTime,omitempty"` + // ReplicaID - The replica id of the protected item. + ReplicaID *string `json:"replicaId,omitempty"` + // OsVersion - The OS Version of the protected item. + OsVersion *string `json:"osVersion,omitempty"` + // IsAdditionalStatsAvailable - A value indicating whether additional IR stats are available or not. + IsAdditionalStatsAvailable *bool `json:"isAdditionalStatsAvailable,omitempty"` + // TotalDataTransferred - The total transferred data in bytes. + TotalDataTransferred *int64 `json:"totalDataTransferred,omitempty"` + // TotalProgressHealth - The progress health. + TotalProgressHealth *string `json:"totalProgressHealth,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageReplicationDetails. +func (imrd InMageReplicationDetails) MarshalJSON() ([]byte, error) { + imrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imrd.ActiveSiteType != nil { + objectMap["activeSiteType"] = imrd.ActiveSiteType + } + if imrd.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = imrd.SourceVMCPUCount + } + if imrd.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = imrd.SourceVMRAMSizeInMB + } + if imrd.OsDetails != nil { + objectMap["osDetails"] = imrd.OsDetails + } + if imrd.ProtectionStage != nil { + objectMap["protectionStage"] = imrd.ProtectionStage + } + if imrd.VMID != nil { + objectMap["vmId"] = imrd.VMID + } + if imrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = imrd.VMProtectionState + } + if imrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = imrd.VMProtectionStateDescription + } + if imrd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrd.ResyncDetails + } + if imrd.RetentionWindowStart != nil { + objectMap["retentionWindowStart"] = imrd.RetentionWindowStart + } + if imrd.RetentionWindowEnd != nil { + objectMap["retentionWindowEnd"] = imrd.RetentionWindowEnd + } + if imrd.CompressedDataRateInMB != nil { + objectMap["compressedDataRateInMB"] = imrd.CompressedDataRateInMB + } + if imrd.UncompressedDataRateInMB != nil { + objectMap["uncompressedDataRateInMB"] = imrd.UncompressedDataRateInMB + } + if imrd.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = imrd.RpoInSeconds + } + if imrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrd.ProtectedDisks + } + if imrd.IPAddress != nil { + objectMap["ipAddress"] = imrd.IPAddress + } + if imrd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = imrd.LastHeartbeat + } + if imrd.ProcessServerID != nil { + objectMap["processServerId"] = imrd.ProcessServerID + } + if imrd.MasterTargetID != nil { + objectMap["masterTargetId"] = imrd.MasterTargetID + } + if imrd.ConsistencyPoints != nil { + objectMap["consistencyPoints"] = imrd.ConsistencyPoints + } + if imrd.DiskResized != nil { + objectMap["diskResized"] = imrd.DiskResized + } + if imrd.RebootAfterUpdateStatus != nil { + objectMap["rebootAfterUpdateStatus"] = imrd.RebootAfterUpdateStatus + } + if imrd.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imrd.MultiVMGroupID + } + if imrd.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imrd.MultiVMGroupName + } + if imrd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imrd.MultiVMSyncStatus + } + if imrd.AgentDetails != nil { + objectMap["agentDetails"] = imrd.AgentDetails + } + if imrd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = imrd.VCenterInfrastructureID + } + if imrd.InfrastructureVMID != nil { + objectMap["infrastructureVmId"] = imrd.InfrastructureVMID + } + if imrd.VMNics != nil { + objectMap["vmNics"] = imrd.VMNics + } + if imrd.DiscoveryType != nil { + objectMap["discoveryType"] = imrd.DiscoveryType + } + if imrd.AzureStorageAccountID != nil { + objectMap["azureStorageAccountId"] = imrd.AzureStorageAccountID + } + if imrd.Datastores != nil { + objectMap["datastores"] = imrd.Datastores + } + if imrd.ValidationErrors != nil { + objectMap["validationErrors"] = imrd.ValidationErrors + } + if imrd.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = imrd.LastRpoCalculatedTime + } + if imrd.LastUpdateReceivedTime != nil { + objectMap["lastUpdateReceivedTime"] = imrd.LastUpdateReceivedTime + } + if imrd.ReplicaID != nil { + objectMap["replicaId"] = imrd.ReplicaID + } + if imrd.OsVersion != nil { + objectMap["osVersion"] = imrd.OsVersion + } + if imrd.IsAdditionalStatsAvailable != nil { + objectMap["isAdditionalStatsAvailable"] = imrd.IsAdditionalStatsAvailable + } + if imrd.TotalDataTransferred != nil { + objectMap["totalDataTransferred"] = imrd.TotalDataTransferred + } + if imrd.TotalProgressHealth != nil { + objectMap["totalProgressHealth"] = imrd.TotalProgressHealth + } + if imrd.InstanceType != "" { + objectMap["instanceType"] = imrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return &imrd, true +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrd, true +} + +// InMageReprotectInput inMageAzureV2 specific provider input. +type InMageReprotectInput struct { + // MasterTargetID - The Master Target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RetentionDrive - The retention drive to use on the MT. + RetentionDrive *string `json:"retentionDrive,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // DiskExclusionInput - The enable disk exclusion input. + DiskExclusionInput *InMageDiskExclusionInput `json:"diskExclusionInput,omitempty"` + // ProfileID - The Policy Id. + ProfileID *string `json:"profileId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageReprotectInput. +func (imri InMageReprotectInput) MarshalJSON() ([]byte, error) { + imri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imri.MasterTargetID != nil { + objectMap["masterTargetId"] = imri.MasterTargetID + } + if imri.ProcessServerID != nil { + objectMap["processServerId"] = imri.ProcessServerID + } + if imri.RetentionDrive != nil { + objectMap["retentionDrive"] = imri.RetentionDrive + } + if imri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imri.RunAsAccountID + } + if imri.DatastoreName != nil { + objectMap["datastoreName"] = imri.DatastoreName + } + if imri.DiskExclusionInput != nil { + objectMap["diskExclusionInput"] = imri.DiskExclusionInput + } + if imri.ProfileID != nil { + objectMap["profileId"] = imri.ProfileID + } + if imri.DisksToInclude != nil { + objectMap["disksToInclude"] = imri.DisksToInclude + } + if imri.InstanceType != "" { + objectMap["instanceType"] = imri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return &imri, true +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imri, true +} + +// InMageTestFailoverInput provider specific input for InMage test failover. +type InMageTestFailoverInput struct { + // RecoveryPointType - The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. Possible values include: 'LatestTime', 'LatestTag', 'Custom' + RecoveryPointType RecoveryPointType `json:"recoveryPointType,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) MarshalJSON() ([]byte, error) { + imtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imtfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imtfi.RecoveryPointType + } + if imtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imtfi.RecoveryPointID + } + if imtfi.InstanceType != "" { + objectMap["instanceType"] = imtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return &imtfi, true +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imtfi, true +} + +// InMageUnplannedFailoverInput provider specific input for InMage unplanned failover. +type InMageUnplannedFailoverInput struct { + // RecoveryPointType - The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. Possible values include: 'LatestTime', 'LatestTag', 'Custom' + RecoveryPointType RecoveryPointType `json:"recoveryPointType,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imufi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imufi.RecoveryPointType + } + if imufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imufi.RecoveryPointID + } + if imufi.InstanceType != "" { + objectMap["instanceType"] = imufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return &imufi, true +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imufi, true +} + +// InMageVolumeExclusionOptions guest disk signature based disk exclusion option when doing enable +// protection of virtual machine in InMage provider. +type InMageVolumeExclusionOptions struct { + // VolumeLabel - The volume label. The disk having any volume with this label will be excluded from replication. + VolumeLabel *string `json:"volumeLabel,omitempty"` + // OnlyExcludeIfSingleVolume - The value indicating whether to exclude multi volume disk or not. If a disk has multiple volumes and one of the volume has label matching with VolumeLabel this disk will be excluded from replication if OnlyExcludeIfSingleVolume is false. + OnlyExcludeIfSingleVolume *string `json:"onlyExcludeIfSingleVolume,omitempty"` +} + +// InnerHealthError implements InnerHealthError class. HealthError object has a list of InnerHealthErrors +// as child errors. InnerHealthError is used because this will prevent an infinite loop of structures when +// Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health +// errors and all API consumers can utilize this in the same fashion as Exception -> InnerException. +type InnerHealthError struct { + // ErrorSource - Source of error. + ErrorSource *string `json:"errorSource,omitempty"` + // ErrorType - Type of error. + ErrorType *string `json:"errorType,omitempty"` + // ErrorLevel - Level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // ErrorCategory - Category of error. + ErrorCategory *string `json:"errorCategory,omitempty"` + // ErrorCode - Error code. + ErrorCode *string `json:"errorCode,omitempty"` + // SummaryMessage - Summary message of the entity. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // ErrorMessage - Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // CreationTimeUtc - Error creation time (UTC). + CreationTimeUtc *date.Time `json:"creationTimeUtc,omitempty"` + // RecoveryProviderErrorMessage - DRA error message. + RecoveryProviderErrorMessage *string `json:"recoveryProviderErrorMessage,omitempty"` + // EntityID - ID of the entity. + EntityID *string `json:"entityId,omitempty"` + // ErrorID - The health error unique id. + ErrorID *string `json:"errorId,omitempty"` + // CustomerResolvability - Value indicating whether the health error is customer resolvable. Possible values include: 'Allowed', 'NotAllowed' + CustomerResolvability HealthErrorCustomerResolvability `json:"customerResolvability,omitempty"` +} + +// InputEndpoint ... +type InputEndpoint struct { + EndpointName *string `json:"endpointName,omitempty"` + PrivatePort *int32 `json:"privatePort,omitempty"` + PublicPort *int32 `json:"publicPort,omitempty"` + Protocol *string `json:"protocol,omitempty"` +} + +// IPConfigDetails ... +type IPConfigDetails struct { + Name *string `json:"name,omitempty"` + IsPrimary *bool `json:"isPrimary,omitempty"` + SubnetName *string `json:"subnetName,omitempty"` + StaticIPAddress *string `json:"staticIPAddress,omitempty"` + IPAddressType *string `json:"ipAddressType,omitempty"` + IsSeletedForFailover *bool `json:"isSeletedForFailover,omitempty"` + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + RecoveryStaticIPAddress *string `json:"recoveryStaticIPAddress,omitempty"` + RecoveryIPAddressType *string `json:"recoveryIPAddressType,omitempty"` + RecoveryPublicIPAddressID *string `json:"recoveryPublicIPAddressId,omitempty"` + RecoveryLBBackendAddressPoolIds *[]string `json:"recoveryLBBackendAddressPoolIds,omitempty"` + TfoSubnetName *string `json:"tfoSubnetName,omitempty"` + TfoStaticIPAddress *string `json:"tfoStaticIPAddress,omitempty"` + TfoPublicIPAddressID *string `json:"tfoPublicIPAddressId,omitempty"` + TfoLBBackendAddressPoolIds *[]string `json:"tfoLBBackendAddressPoolIds,omitempty"` +} + +// IPConfigInputDetails ... +type IPConfigInputDetails struct { + IPConfigName *string `json:"ipConfigName,omitempty"` + IsPrimary *bool `json:"isPrimary,omitempty"` + IsSeletedForFailover *bool `json:"isSeletedForFailover,omitempty"` + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + RecoveryStaticIPAddress *string `json:"recoveryStaticIPAddress,omitempty"` + RecoveryPublicIPAddressID *string `json:"recoveryPublicIPAddressId,omitempty"` + RecoveryLBBackendAddressPoolIds *[]string `json:"recoveryLBBackendAddressPoolIds,omitempty"` + TfoSubnetName *string `json:"tfoSubnetName,omitempty"` + TfoStaticIPAddress *string `json:"tfoStaticIPAddress,omitempty"` + TfoPublicIPAddressID *string `json:"tfoPublicIPAddressId,omitempty"` + TfoLBBackendAddressPoolIds *[]string `json:"tfoLBBackendAddressPoolIds,omitempty"` +} + +// Job job details. +type Job struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *JobProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if j.Properties != nil { + objectMap["properties"] = j.Properties + } + if j.Location != nil { + objectMap["location"] = j.Location + } + return json.Marshal(objectMap) +} + +// JobCollection collection of jobs. +type JobCollection struct { + autorest.Response `json:"-"` + // Value - The list of jobs. + Value *[]Job `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// JobCollectionIterator provides access to a complete listing of Job values. +type JobCollectionIterator struct { + i int + page JobCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *JobCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *JobCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter JobCollectionIterator) Response() JobCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter JobCollectionIterator) Value() Job { + if !iter.page.NotDone() { + return Job{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the JobCollectionIterator type. +func NewJobCollectionIterator(page JobCollectionPage) JobCollectionIterator { + return JobCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (jc JobCollection) IsEmpty() bool { + return jc.Value == nil || len(*jc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (jc JobCollection) hasNextLink() bool { + return jc.NextLink != nil && len(*jc.NextLink) != 0 +} + +// jobCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jc JobCollection) jobCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !jc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jc.NextLink))) +} + +// JobCollectionPage contains a page of Job values. +type JobCollectionPage struct { + fn func(context.Context, JobCollection) (JobCollection, error) + jc JobCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *JobCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.jc) + if err != nil { + return err + } + page.jc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *JobCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobCollectionPage) NotDone() bool { + return !page.jc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobCollectionPage) Response() JobCollection { + return page.jc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobCollectionPage) Values() []Job { + if page.jc.IsEmpty() { + return nil + } + return *page.jc.Value +} + +// Creates a new instance of the JobCollectionPage type. +func NewJobCollectionPage(cur JobCollection, getNextPage func(context.Context, JobCollection) (JobCollection, error)) JobCollectionPage { + return JobCollectionPage{ + fn: getNextPage, + jc: cur, + } +} + +// BasicJobDetails job details based on specific job type. +type BasicJobDetails interface { + AsAsrJobDetails() (*AsrJobDetails, bool) + AsExportJobDetails() (*ExportJobDetails, bool) + AsFailoverJobDetails() (*FailoverJobDetails, bool) + AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) + AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) + AsJobDetails() (*JobDetails, bool) +} + +// JobDetails job details based on specific job type. +type JobDetails struct { + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicJobDetails(body []byte) (BasicJobDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAsrJobDetails): + var ajd AsrJobDetails + err := json.Unmarshal(body, &ajd) + return ajd, err + case string(InstanceTypeExportJobDetails): + var ejd ExportJobDetails + err := json.Unmarshal(body, &ejd) + return ejd, err + case string(InstanceTypeFailoverJobDetails): + var fjd FailoverJobDetails + err := json.Unmarshal(body, &fjd) + return fjd, err + case string(InstanceTypeSwitchProtectionJobDetails): + var spjd SwitchProtectionJobDetails + err := json.Unmarshal(body, &spjd) + return spjd, err + case string(InstanceTypeTestFailoverJobDetails): + var tfjd TestFailoverJobDetails + err := json.Unmarshal(body, &tfjd) + return tfjd, err + default: + var jd JobDetails + err := json.Unmarshal(body, &jd) + return jd, err + } +} +func unmarshalBasicJobDetailsArray(body []byte) ([]BasicJobDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jdArray := make([]BasicJobDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + jd, err := unmarshalBasicJobDetails(*rawMessage) + if err != nil { + return nil, err + } + jdArray[index] = jd + } + return jdArray, nil +} + +// MarshalJSON is the custom marshaler for JobDetails. +func (jd JobDetails) MarshalJSON() ([]byte, error) { + jd.InstanceType = InstanceTypeJobDetails + objectMap := make(map[string]interface{}) + if jd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = jd.AffectedObjectDetails + } + if jd.InstanceType != "" { + objectMap["instanceType"] = jd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsJobDetails() (*JobDetails, bool) { + return &jd, true +} + +// AsBasicJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &jd, true +} + +// JobEntity this class contains the minimal job details required to navigate to the desired drill down. +type JobEntity struct { + // JobID - The job id. + JobID *string `json:"jobId,omitempty"` + // JobFriendlyName - The job display name. + JobFriendlyName *string `json:"jobFriendlyName,omitempty"` + // TargetObjectID - The object id. + TargetObjectID *string `json:"targetObjectId,omitempty"` + // TargetObjectName - The object name. + TargetObjectName *string `json:"targetObjectName,omitempty"` + // TargetInstanceType - The workflow affected object type. + TargetInstanceType *string `json:"targetInstanceType,omitempty"` + // JobScenarioName - The job name. Enum type ScenarioName. + JobScenarioName *string `json:"jobScenarioName,omitempty"` +} + +// JobErrorDetails this class contains the error details per object. +type JobErrorDetails struct { + // ServiceErrorDetails - The Service error details. + ServiceErrorDetails *ServiceError `json:"serviceErrorDetails,omitempty"` + // ProviderErrorDetails - The Provider error details. + ProviderErrorDetails *ProviderError `json:"providerErrorDetails,omitempty"` + // ErrorLevel - Error level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // CreationTime - The creation time of job error. + CreationTime *date.Time `json:"creationTime,omitempty"` + // TaskID - The Id of the task. + TaskID *string `json:"taskId,omitempty"` +} + +// JobProperties job custom data details. +type JobProperties struct { + // ActivityID - The activity id. + ActivityID *string `json:"activityId,omitempty"` + // ScenarioName - The ScenarioName. + ScenarioName *string `json:"scenarioName,omitempty"` + // FriendlyName - The DisplayName. + FriendlyName *string `json:"friendlyName,omitempty"` + // State - The status of the Job. It is one of these values - NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or Other. + State *string `json:"state,omitempty"` + // StateDescription - The description of the state of the Job. For e.g. - For Succeeded state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. + StateDescription *string `json:"stateDescription,omitempty"` + // Tasks - The tasks. + Tasks *[]ASRTask `json:"tasks,omitempty"` + // Errors - The errors. + Errors *[]JobErrorDetails `json:"errors,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // AllowedActions - The Allowed action the job. + AllowedActions *[]string `json:"allowedActions,omitempty"` + // TargetObjectID - The affected Object Id. + TargetObjectID *string `json:"targetObjectId,omitempty"` + // TargetObjectName - The name of the affected object. + TargetObjectName *string `json:"targetObjectName,omitempty"` + // TargetInstanceType - The type of the affected object which is of Microsoft.Azure.SiteRecovery.V2015_11_10.AffectedObjectType class. + TargetInstanceType *string `json:"targetInstanceType,omitempty"` + // CustomDetails - The custom job details like test failover job details. + CustomDetails BasicJobDetails `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for JobProperties struct. +func (jp *JobProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "activityId": + if v != nil { + var activityID string + err = json.Unmarshal(*v, &activityID) + if err != nil { + return err + } + jp.ActivityID = &activityID + } + case "scenarioName": + if v != nil { + var scenarioName string + err = json.Unmarshal(*v, &scenarioName) + if err != nil { + return err + } + jp.ScenarioName = &scenarioName + } + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + jp.FriendlyName = &friendlyName + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + jp.State = &state + } + case "stateDescription": + if v != nil { + var stateDescription string + err = json.Unmarshal(*v, &stateDescription) + if err != nil { + return err + } + jp.StateDescription = &stateDescription + } + case "tasks": + if v != nil { + var tasks []ASRTask + err = json.Unmarshal(*v, &tasks) + if err != nil { + return err + } + jp.Tasks = &tasks + } + case "errors": + if v != nil { + var errorsVar []JobErrorDetails + err = json.Unmarshal(*v, &errorsVar) + if err != nil { + return err + } + jp.Errors = &errorsVar + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + jp.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + jp.EndTime = &endTime + } + case "allowedActions": + if v != nil { + var allowedActions []string + err = json.Unmarshal(*v, &allowedActions) + if err != nil { + return err + } + jp.AllowedActions = &allowedActions + } + case "targetObjectId": + if v != nil { + var targetObjectID string + err = json.Unmarshal(*v, &targetObjectID) + if err != nil { + return err + } + jp.TargetObjectID = &targetObjectID + } + case "targetObjectName": + if v != nil { + var targetObjectName string + err = json.Unmarshal(*v, &targetObjectName) + if err != nil { + return err + } + jp.TargetObjectName = &targetObjectName + } + case "targetInstanceType": + if v != nil { + var targetInstanceType string + err = json.Unmarshal(*v, &targetInstanceType) + if err != nil { + return err + } + jp.TargetInstanceType = &targetInstanceType + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicJobDetails(*v) + if err != nil { + return err + } + jp.CustomDetails = customDetails + } + } + } + + return nil +} + +// JobQueryParameter query parameter to enumerate jobs. +type JobQueryParameter struct { + // StartTime - Date time to get jobs from. + StartTime *string `json:"startTime,omitempty"` + // EndTime - Date time to get jobs upto. + EndTime *string `json:"endTime,omitempty"` + // FabricID - The Id of the fabric to search jobs under. + FabricID *string `json:"fabricId,omitempty"` + // AffectedObjectTypes - The type of objects. + AffectedObjectTypes *string `json:"affectedObjectTypes,omitempty"` + // JobStatus - The states of the job to be filtered can be in. + JobStatus *string `json:"jobStatus,omitempty"` + // JobOutputType - The output type of the jobs. Possible values include: 'JSON', 'XML', 'Excel' + JobOutputType ExportJobOutputSerializationType `json:"jobOutputType,omitempty"` + // JobName - The job Name. + JobName *string `json:"jobName,omitempty"` + // TimezoneOffset - The timezone offset for the location of the request (in minutes). + TimezoneOffset *float64 `json:"timezoneOffset,omitempty"` +} + +// JobStatusEventDetails model class for event details of a job status event. +type JobStatusEventDetails struct { + // JobID - Job arm id for the event. + JobID *string `json:"jobId,omitempty"` + // JobFriendlyName - JobName for the Event. + JobFriendlyName *string `json:"jobFriendlyName,omitempty"` + // JobStatus - JobStatus for the Event. + JobStatus *string `json:"jobStatus,omitempty"` + // AffectedObjectType - AffectedObjectType for the event. + AffectedObjectType *string `json:"affectedObjectType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeEventSpecificDetails', 'InstanceTypeJobStatus' + InstanceType InstanceTypeBasicEventSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobStatusEventDetails. +func (jsed JobStatusEventDetails) MarshalJSON() ([]byte, error) { + jsed.InstanceType = InstanceTypeJobStatus + objectMap := make(map[string]interface{}) + if jsed.JobID != nil { + objectMap["jobId"] = jsed.JobID + } + if jsed.JobFriendlyName != nil { + objectMap["jobFriendlyName"] = jsed.JobFriendlyName + } + if jsed.JobStatus != nil { + objectMap["jobStatus"] = jsed.JobStatus + } + if jsed.AffectedObjectType != nil { + objectMap["affectedObjectType"] = jsed.AffectedObjectType + } + if jsed.InstanceType != "" { + objectMap["instanceType"] = jsed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsJobStatusEventDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsJobStatusEventDetails() (*JobStatusEventDetails, bool) { + return &jsed, true +} + +// AsEventSpecificDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsEventSpecificDetails() (*EventSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventSpecificDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsBasicEventSpecificDetails() (BasicEventSpecificDetails, bool) { + return &jsed, true +} + +// BasicJobTaskDetails this class represents a task which is actually a workflow so that one can navigate to its +// individual drill down. +type BasicJobTaskDetails interface { + AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) + AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) + AsJobTaskDetails() (*JobTaskDetails, bool) +} + +// JobTaskDetails this class represents a task which is actually a workflow so that one can navigate to its +// individual drill down. +type JobTaskDetails struct { + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicJobTaskDetails(body []byte) (BasicJobTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeFabricReplicationGroupTaskDetails): + var frgtd FabricReplicationGroupTaskDetails + err := json.Unmarshal(body, &frgtd) + return frgtd, err + case string(InstanceTypeVirtualMachineTaskDetails): + var vmtd VirtualMachineTaskDetails + err := json.Unmarshal(body, &vmtd) + return vmtd, err + default: + var jtd JobTaskDetails + err := json.Unmarshal(body, &jtd) + return jtd, err + } +} +func unmarshalBasicJobTaskDetailsArray(body []byte) ([]BasicJobTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jtdArray := make([]BasicJobTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + jtd, err := unmarshalBasicJobTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + jtdArray[index] = jtd + } + return jtdArray, nil +} + +// MarshalJSON is the custom marshaler for JobTaskDetails. +func (jtd JobTaskDetails) MarshalJSON() ([]byte, error) { + jtd.InstanceType = InstanceTypeJobTaskDetails + objectMap := make(map[string]interface{}) + if jtd.JobTask != nil { + objectMap["jobTask"] = jtd.JobTask + } + if jtd.InstanceType != "" { + objectMap["instanceType"] = jtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return &jtd, true +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &jtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &jtd, true +} + +// KeyEncryptionKeyInfo key Encryption Key (KEK) information. +type KeyEncryptionKeyInfo struct { + // KeyIdentifier - The key URL / identifier. + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KeyVaultResourceArmID - The KeyVault resource ARM Id for key. + KeyVaultResourceArmID *string `json:"keyVaultResourceArmId,omitempty"` +} + +// LogicalNetwork logical network data model. +type LogicalNetwork struct { + autorest.Response `json:"-"` + // Properties - The Logical Network Properties. + Properties *LogicalNetworkProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for LogicalNetwork. +func (ln LogicalNetwork) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ln.Properties != nil { + objectMap["properties"] = ln.Properties + } + if ln.Location != nil { + objectMap["location"] = ln.Location + } + return json.Marshal(objectMap) +} + +// LogicalNetworkCollection list of logical networks. +type LogicalNetworkCollection struct { + autorest.Response `json:"-"` + // Value - The Logical Networks list details. + Value *[]LogicalNetwork `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// LogicalNetworkCollectionIterator provides access to a complete listing of LogicalNetwork values. +type LogicalNetworkCollectionIterator struct { + i int + page LogicalNetworkCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *LogicalNetworkCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LogicalNetworkCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *LogicalNetworkCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter LogicalNetworkCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter LogicalNetworkCollectionIterator) Response() LogicalNetworkCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter LogicalNetworkCollectionIterator) Value() LogicalNetwork { + if !iter.page.NotDone() { + return LogicalNetwork{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the LogicalNetworkCollectionIterator type. +func NewLogicalNetworkCollectionIterator(page LogicalNetworkCollectionPage) LogicalNetworkCollectionIterator { + return LogicalNetworkCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lnc LogicalNetworkCollection) IsEmpty() bool { + return lnc.Value == nil || len(*lnc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (lnc LogicalNetworkCollection) hasNextLink() bool { + return lnc.NextLink != nil && len(*lnc.NextLink) != 0 +} + +// logicalNetworkCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lnc LogicalNetworkCollection) logicalNetworkCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !lnc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lnc.NextLink))) +} + +// LogicalNetworkCollectionPage contains a page of LogicalNetwork values. +type LogicalNetworkCollectionPage struct { + fn func(context.Context, LogicalNetworkCollection) (LogicalNetworkCollection, error) + lnc LogicalNetworkCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *LogicalNetworkCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LogicalNetworkCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.lnc) + if err != nil { + return err + } + page.lnc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *LogicalNetworkCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page LogicalNetworkCollectionPage) NotDone() bool { + return !page.lnc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page LogicalNetworkCollectionPage) Response() LogicalNetworkCollection { + return page.lnc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page LogicalNetworkCollectionPage) Values() []LogicalNetwork { + if page.lnc.IsEmpty() { + return nil + } + return *page.lnc.Value +} + +// Creates a new instance of the LogicalNetworkCollectionPage type. +func NewLogicalNetworkCollectionPage(cur LogicalNetworkCollection, getNextPage func(context.Context, LogicalNetworkCollection) (LogicalNetworkCollection, error)) LogicalNetworkCollectionPage { + return LogicalNetworkCollectionPage{ + fn: getNextPage, + lnc: cur, + } +} + +// LogicalNetworkProperties logical Network Properties. +type LogicalNetworkProperties struct { + // FriendlyName - The Friendly Name. + FriendlyName *string `json:"friendlyName,omitempty"` + // NetworkVirtualizationStatus - A value indicating whether Network Virtualization is enabled for the logical network. + NetworkVirtualizationStatus *string `json:"networkVirtualizationStatus,omitempty"` + // LogicalNetworkUsage - A value indicating whether logical network is used as private test network by test failover. + LogicalNetworkUsage *string `json:"logicalNetworkUsage,omitempty"` + // LogicalNetworkDefinitionsStatus - A value indicating whether logical network definitions are isolated. + LogicalNetworkDefinitionsStatus *string `json:"logicalNetworkDefinitionsStatus,omitempty"` +} + +// ManualActionTaskDetails this class represents the manual action task details. +type ManualActionTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // Instructions - The instructions. + Instructions *string `json:"instructions,omitempty"` + // Observation - The observation. + Observation *string `json:"observation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) MarshalJSON() ([]byte, error) { + matd.InstanceType = InstanceTypeManualActionTaskDetails + objectMap := make(map[string]interface{}) + if matd.Name != nil { + objectMap["name"] = matd.Name + } + if matd.Instructions != nil { + objectMap["instructions"] = matd.Instructions + } + if matd.Observation != nil { + objectMap["observation"] = matd.Observation + } + if matd.InstanceType != "" { + objectMap["instanceType"] = matd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return &matd, true +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &matd, true +} + +// MarsAgentDetails mars agent details. +type MarsAgentDetails struct { + // ID - READ-ONLY; The Mars agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The Mars agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The Mars agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The Mars agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the Mars agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the Mars agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for MarsAgentDetails. +func (mad MarsAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MasterTargetServer details of a Master Target Server. +type MasterTargetServer struct { + // ID - The server Id. + ID *string `json:"id,omitempty"` + // IPAddress - The IP address of the server. + IPAddress *string `json:"ipAddress,omitempty"` + // Name - The server name. + Name *string `json:"name,omitempty"` + // OsType - The OS type of the server. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The version of the scout component on the server. + AgentVersion *string `json:"agentVersion,omitempty"` + // LastHeartbeat - The last heartbeat received from the server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // RetentionVolumes - The retention volumes of Master target Server. + RetentionVolumes *[]RetentionVolume `json:"retentionVolumes,omitempty"` + // DataStores - The list of data stores in the fabric. + DataStores *[]DataStore `json:"dataStores,omitempty"` + // ValidationErrors - Validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // HealthErrors - Health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // DiskCount - Disk count of the master target. + DiskCount *int32 `json:"diskCount,omitempty"` + // OsVersion - OS Version of the master target. + OsVersion *string `json:"osVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // MarsAgentVersion - MARS agent version. + MarsAgentVersion *string `json:"marsAgentVersion,omitempty"` + // MarsAgentExpiryDate - MARS agent expiry date. + MarsAgentExpiryDate *date.Time `json:"marsAgentExpiryDate,omitempty"` + // AgentVersionDetails - Agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // MarsAgentVersionDetails - Mars agent version details. + MarsAgentVersionDetails *VersionDetails `json:"marsAgentVersionDetails,omitempty"` +} + +// MigrateInput input for migrate. +type MigrateInput struct { + // Properties - Migrate input properties. + Properties *MigrateInputProperties `json:"properties,omitempty"` +} + +// MigrateInputProperties migrate input properties. +type MigrateInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicMigrateProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for MigrateInputProperties struct. +func (mip *MigrateInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicMigrateProviderSpecificInput(*v) + if err != nil { + return err + } + mip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicMigrateProviderSpecificInput migrate provider specific input. +type BasicMigrateProviderSpecificInput interface { + AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) + AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) +} + +// MigrateProviderSpecificInput migrate provider specific input. +type MigrateProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput', 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicMigrateProviderSpecificInput(body []byte) (BasicMigrateProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt): + var vmcmi VMwareCbtMigrateInput + err := json.Unmarshal(body, &vmcmi) + return vmcmi, err + default: + var mpsi MigrateProviderSpecificInput + err := json.Unmarshal(body, &mpsi) + return mpsi, err + } +} +func unmarshalBasicMigrateProviderSpecificInputArray(body []byte) ([]BasicMigrateProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + mpsiArray := make([]BasicMigrateProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + mpsi, err := unmarshalBasicMigrateProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + mpsiArray[index] = mpsi + } + return mpsiArray, nil +} + +// MarshalJSON is the custom marshaler for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) MarshalJSON() ([]byte, error) { + mpsi.InstanceType = InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput + objectMap := make(map[string]interface{}) + if mpsi.InstanceType != "" { + objectMap["instanceType"] = mpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrateInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) { + return nil, false +} + +// AsMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) { + return &mpsi, true +} + +// AsBasicMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsBasicMigrateProviderSpecificInput() (BasicMigrateProviderSpecificInput, bool) { + return &mpsi, true +} + +// MigrationItem migration item. +type MigrationItem struct { + autorest.Response `json:"-"` + // Properties - The migration item properties. + Properties *MigrationItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationItem. +func (mi MigrationItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mi.Properties != nil { + objectMap["properties"] = mi.Properties + } + if mi.Location != nil { + objectMap["location"] = mi.Location + } + return json.Marshal(objectMap) +} + +// MigrationItemCollection migration item collection. +type MigrationItemCollection struct { + autorest.Response `json:"-"` + // Value - The list of migration items. + Value *[]MigrationItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MigrationItemCollectionIterator provides access to a complete listing of MigrationItem values. +type MigrationItemCollectionIterator struct { + i int + page MigrationItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *MigrationItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *MigrationItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MigrationItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter MigrationItemCollectionIterator) Response() MigrationItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter MigrationItemCollectionIterator) Value() MigrationItem { + if !iter.page.NotDone() { + return MigrationItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the MigrationItemCollectionIterator type. +func NewMigrationItemCollectionIterator(page MigrationItemCollectionPage) MigrationItemCollectionIterator { + return MigrationItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mic MigrationItemCollection) IsEmpty() bool { + return mic.Value == nil || len(*mic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mic MigrationItemCollection) hasNextLink() bool { + return mic.NextLink != nil && len(*mic.NextLink) != 0 +} + +// migrationItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mic MigrationItemCollection) migrationItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !mic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mic.NextLink))) +} + +// MigrationItemCollectionPage contains a page of MigrationItem values. +type MigrationItemCollectionPage struct { + fn func(context.Context, MigrationItemCollection) (MigrationItemCollection, error) + mic MigrationItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *MigrationItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.mic) + if err != nil { + return err + } + page.mic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *MigrationItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MigrationItemCollectionPage) NotDone() bool { + return !page.mic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MigrationItemCollectionPage) Response() MigrationItemCollection { + return page.mic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MigrationItemCollectionPage) Values() []MigrationItem { + if page.mic.IsEmpty() { + return nil + } + return *page.mic.Value +} + +// Creates a new instance of the MigrationItemCollectionPage type. +func NewMigrationItemCollectionPage(cur MigrationItemCollection, getNextPage func(context.Context, MigrationItemCollection) (MigrationItemCollection, error)) MigrationItemCollectionPage { + return MigrationItemCollectionPage{ + fn: getNextPage, + mic: cur, + } +} + +// MigrationItemProperties migration item properties. +type MigrationItemProperties struct { + // MachineName - READ-ONLY; The on-premise virtual machine name. + MachineName *string `json:"machineName,omitempty"` + // PolicyID - READ-ONLY; The ARM Id of policy governing this item. + PolicyID *string `json:"policyId,omitempty"` + // PolicyFriendlyName - READ-ONLY; The name of policy governing this item. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` + // MigrationState - READ-ONLY; The migration status. Possible values include: 'MigrationStateNone', 'MigrationStateEnableMigrationInProgress', 'MigrationStateEnableMigrationFailed', 'MigrationStateDisableMigrationInProgress', 'MigrationStateDisableMigrationFailed', 'MigrationStateInitialSeedingInProgress', 'MigrationStateInitialSeedingFailed', 'MigrationStateReplicating', 'MigrationStateMigrationInProgress', 'MigrationStateMigrationSucceeded', 'MigrationStateMigrationFailed' + MigrationState MigrationState `json:"migrationState,omitempty"` + // MigrationStateDescription - READ-ONLY; The migration state description. + MigrationStateDescription *string `json:"migrationStateDescription,omitempty"` + // LastTestMigrationTime - READ-ONLY; The last test migration time. + LastTestMigrationTime *date.Time `json:"lastTestMigrationTime,omitempty"` + // LastTestMigrationStatus - READ-ONLY; The status of the last test migration. + LastTestMigrationStatus *string `json:"lastTestMigrationStatus,omitempty"` + // TestMigrateState - READ-ONLY; The test migrate state. Possible values include: 'TestMigrationStateNone', 'TestMigrationStateTestMigrationInProgress', 'TestMigrationStateTestMigrationSucceeded', 'TestMigrationStateTestMigrationFailed', 'TestMigrationStateTestMigrationCleanupInProgress' + TestMigrateState TestMigrationState `json:"testMigrateState,omitempty"` + // TestMigrateStateDescription - READ-ONLY; The test migrate state description. + TestMigrateStateDescription *string `json:"testMigrateStateDescription,omitempty"` + // Health - READ-ONLY; The consolidated health. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The list of health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // AllowedOperations - READ-ONLY; The allowed operations on the migration item based on the current migration state of the item. + AllowedOperations *[]MigrationItemOperation `json:"allowedOperations,omitempty"` + // CurrentJob - READ-ONLY; The current job details. + CurrentJob *CurrentJobDetails `json:"currentJob,omitempty"` + // EventCorrelationID - READ-ONLY; The correlation Id for events associated with this migration item. + EventCorrelationID *string `json:"eventCorrelationId,omitempty"` + // ProviderSpecificDetails - The migration provider custom settings. + ProviderSpecificDetails BasicMigrationProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationItemProperties. +func (mip MigrationItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["providerSpecificDetails"] = mip.ProviderSpecificDetails + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MigrationItemProperties struct. +func (mip *MigrationItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "machineName": + if v != nil { + var machineName string + err = json.Unmarshal(*v, &machineName) + if err != nil { + return err + } + mip.MachineName = &machineName + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + mip.PolicyID = &policyID + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + mip.PolicyFriendlyName = &policyFriendlyName + } + case "migrationState": + if v != nil { + var migrationState MigrationState + err = json.Unmarshal(*v, &migrationState) + if err != nil { + return err + } + mip.MigrationState = migrationState + } + case "migrationStateDescription": + if v != nil { + var migrationStateDescription string + err = json.Unmarshal(*v, &migrationStateDescription) + if err != nil { + return err + } + mip.MigrationStateDescription = &migrationStateDescription + } + case "lastTestMigrationTime": + if v != nil { + var lastTestMigrationTime date.Time + err = json.Unmarshal(*v, &lastTestMigrationTime) + if err != nil { + return err + } + mip.LastTestMigrationTime = &lastTestMigrationTime + } + case "lastTestMigrationStatus": + if v != nil { + var lastTestMigrationStatus string + err = json.Unmarshal(*v, &lastTestMigrationStatus) + if err != nil { + return err + } + mip.LastTestMigrationStatus = &lastTestMigrationStatus + } + case "testMigrateState": + if v != nil { + var testMigrateState TestMigrationState + err = json.Unmarshal(*v, &testMigrateState) + if err != nil { + return err + } + mip.TestMigrateState = testMigrateState + } + case "testMigrateStateDescription": + if v != nil { + var testMigrateStateDescription string + err = json.Unmarshal(*v, &testMigrateStateDescription) + if err != nil { + return err + } + mip.TestMigrateStateDescription = &testMigrateStateDescription + } + case "health": + if v != nil { + var health ProtectionHealth + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + mip.Health = health + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + mip.HealthErrors = &healthErrors + } + case "allowedOperations": + if v != nil { + var allowedOperations []MigrationItemOperation + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + mip.AllowedOperations = &allowedOperations + } + case "currentJob": + if v != nil { + var currentJob CurrentJobDetails + err = json.Unmarshal(*v, ¤tJob) + if err != nil { + return err + } + mip.CurrentJob = ¤tJob + } + case "eventCorrelationId": + if v != nil { + var eventCorrelationID string + err = json.Unmarshal(*v, &eventCorrelationID) + if err != nil { + return err + } + mip.EventCorrelationID = &eventCorrelationID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicMigrationProviderSpecificSettings(*v) + if err != nil { + return err + } + mip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// MigrationItemsQueryParameter query parameter to enumerate migration items. +type MigrationItemsQueryParameter struct { + // SourceFabricName - The source fabric name filter. + SourceFabricName *string `json:"sourceFabricName,omitempty"` + // SourceContainerName - The source container name filter. + SourceContainerName *string `json:"sourceContainerName,omitempty"` + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` +} + +// BasicMigrationProviderSpecificSettings migration provider specific settings. +type BasicMigrationProviderSpecificSettings interface { + AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) + AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) +} + +// MigrationProviderSpecificSettings migration provider specific settings. +type MigrationProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings', 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicMigrationProviderSpecificSettings(body []byte) (BasicMigrationProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt): + var vmcmd VMwareCbtMigrationDetails + err := json.Unmarshal(body, &vmcmd) + return vmcmd, err + default: + var mpss MigrationProviderSpecificSettings + err := json.Unmarshal(body, &mpss) + return mpss, err + } +} +func unmarshalBasicMigrationProviderSpecificSettingsArray(body []byte) ([]BasicMigrationProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + mpssArray := make([]BasicMigrationProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + mpss, err := unmarshalBasicMigrationProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + mpssArray[index] = mpss + } + return mpssArray, nil +} + +// MarshalJSON is the custom marshaler for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) MarshalJSON() ([]byte, error) { + mpss.InstanceType = InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings + objectMap := make(map[string]interface{}) + if mpss.InstanceType != "" { + objectMap["instanceType"] = mpss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrationDetails is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) { + return nil, false +} + +// AsMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) { + return &mpss, true +} + +// AsBasicMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsBasicMigrationProviderSpecificSettings() (BasicMigrationProviderSpecificSettings, bool) { + return &mpss, true +} + +// MigrationRecoveryPoint recovery point for a migration item. +type MigrationRecoveryPoint struct { + autorest.Response `json:"-"` + // Properties - Recovery point properties. + Properties *MigrationRecoveryPointProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationRecoveryPoint. +func (mrp MigrationRecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mrp.Properties != nil { + objectMap["properties"] = mrp.Properties + } + if mrp.Location != nil { + objectMap["location"] = mrp.Location + } + return json.Marshal(objectMap) +} + +// MigrationRecoveryPointCollection collection of migration recovery points. +type MigrationRecoveryPointCollection struct { + autorest.Response `json:"-"` + // Value - The migration recovery point details. + Value *[]MigrationRecoveryPoint `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MigrationRecoveryPointCollectionIterator provides access to a complete listing of MigrationRecoveryPoint +// values. +type MigrationRecoveryPointCollectionIterator struct { + i int + page MigrationRecoveryPointCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *MigrationRecoveryPointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *MigrationRecoveryPointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MigrationRecoveryPointCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter MigrationRecoveryPointCollectionIterator) Response() MigrationRecoveryPointCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter MigrationRecoveryPointCollectionIterator) Value() MigrationRecoveryPoint { + if !iter.page.NotDone() { + return MigrationRecoveryPoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the MigrationRecoveryPointCollectionIterator type. +func NewMigrationRecoveryPointCollectionIterator(page MigrationRecoveryPointCollectionPage) MigrationRecoveryPointCollectionIterator { + return MigrationRecoveryPointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mrpc MigrationRecoveryPointCollection) IsEmpty() bool { + return mrpc.Value == nil || len(*mrpc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mrpc MigrationRecoveryPointCollection) hasNextLink() bool { + return mrpc.NextLink != nil && len(*mrpc.NextLink) != 0 +} + +// migrationRecoveryPointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mrpc MigrationRecoveryPointCollection) migrationRecoveryPointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !mrpc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mrpc.NextLink))) +} + +// MigrationRecoveryPointCollectionPage contains a page of MigrationRecoveryPoint values. +type MigrationRecoveryPointCollectionPage struct { + fn func(context.Context, MigrationRecoveryPointCollection) (MigrationRecoveryPointCollection, error) + mrpc MigrationRecoveryPointCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *MigrationRecoveryPointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.mrpc) + if err != nil { + return err + } + page.mrpc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *MigrationRecoveryPointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MigrationRecoveryPointCollectionPage) NotDone() bool { + return !page.mrpc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MigrationRecoveryPointCollectionPage) Response() MigrationRecoveryPointCollection { + return page.mrpc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MigrationRecoveryPointCollectionPage) Values() []MigrationRecoveryPoint { + if page.mrpc.IsEmpty() { + return nil + } + return *page.mrpc.Value +} + +// Creates a new instance of the MigrationRecoveryPointCollectionPage type. +func NewMigrationRecoveryPointCollectionPage(cur MigrationRecoveryPointCollection, getNextPage func(context.Context, MigrationRecoveryPointCollection) (MigrationRecoveryPointCollection, error)) MigrationRecoveryPointCollectionPage { + return MigrationRecoveryPointCollectionPage{ + fn: getNextPage, + mrpc: cur, + } +} + +// MigrationRecoveryPointProperties migration item recovery point properties. +type MigrationRecoveryPointProperties struct { + // RecoveryPointTime - READ-ONLY; The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointType - READ-ONLY; The recovery point type. Possible values include: 'MigrationRecoveryPointTypeNotSpecified', 'MigrationRecoveryPointTypeApplicationConsistent', 'MigrationRecoveryPointTypeCrashConsistent' + RecoveryPointType MigrationRecoveryPointType `json:"recoveryPointType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationRecoveryPointProperties. +func (mrpp MigrationRecoveryPointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MobilityServiceUpdate the Mobility Service update details. +type MobilityServiceUpdate struct { + // Version - The version of the latest update. + Version *string `json:"version,omitempty"` + // RebootStatus - The reboot status of the update - whether it is required or not. + RebootStatus *string `json:"rebootStatus,omitempty"` + // OsType - The OS type. + OsType *string `json:"osType,omitempty"` +} + +// Network network model. +type Network struct { + autorest.Response `json:"-"` + // Properties - The Network Properties. + Properties *NetworkProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Network. +func (n Network) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if n.Properties != nil { + objectMap["properties"] = n.Properties + } + if n.Location != nil { + objectMap["location"] = n.Location + } + return json.Marshal(objectMap) +} + +// NetworkCollection list of networks. +type NetworkCollection struct { + autorest.Response `json:"-"` + // Value - The Networks list details. + Value *[]Network `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// NetworkCollectionIterator provides access to a complete listing of Network values. +type NetworkCollectionIterator struct { + i int + page NetworkCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *NetworkCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *NetworkCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter NetworkCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter NetworkCollectionIterator) Response() NetworkCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter NetworkCollectionIterator) Value() Network { + if !iter.page.NotDone() { + return Network{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the NetworkCollectionIterator type. +func NewNetworkCollectionIterator(page NetworkCollectionPage) NetworkCollectionIterator { + return NetworkCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (nc NetworkCollection) IsEmpty() bool { + return nc.Value == nil || len(*nc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (nc NetworkCollection) hasNextLink() bool { + return nc.NextLink != nil && len(*nc.NextLink) != 0 +} + +// networkCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (nc NetworkCollection) networkCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !nc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(nc.NextLink))) +} + +// NetworkCollectionPage contains a page of Network values. +type NetworkCollectionPage struct { + fn func(context.Context, NetworkCollection) (NetworkCollection, error) + nc NetworkCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *NetworkCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.nc) + if err != nil { + return err + } + page.nc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *NetworkCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page NetworkCollectionPage) NotDone() bool { + return !page.nc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page NetworkCollectionPage) Response() NetworkCollection { + return page.nc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page NetworkCollectionPage) Values() []Network { + if page.nc.IsEmpty() { + return nil + } + return *page.nc.Value +} + +// Creates a new instance of the NetworkCollectionPage type. +func NewNetworkCollectionPage(cur NetworkCollection, getNextPage func(context.Context, NetworkCollection) (NetworkCollection, error)) NetworkCollectionPage { + return NetworkCollectionPage{ + fn: getNextPage, + nc: cur, + } +} + +// NetworkMapping network Mapping model. Ideally it should have been possible to inherit this class from +// prev version in InheritedModels as long as there is no difference in structure or method signature. +// Since there were no base Models for certain fields and methods viz NetworkMappingProperties and Load +// with required return type, the class has been introduced in its entirety with references to base models +// to facilitate extensions in subsequent versions. +type NetworkMapping struct { + autorest.Response `json:"-"` + // Properties - The Network Mapping Properties. + Properties *NetworkMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for NetworkMapping. +func (nm NetworkMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if nm.Properties != nil { + objectMap["properties"] = nm.Properties + } + if nm.Location != nil { + objectMap["location"] = nm.Location + } + return json.Marshal(objectMap) +} + +// NetworkMappingCollection list of network mappings. As with NetworkMapping, it should be possible to +// reuse a prev version of this class. It doesn't seem likely this class could be anything more than a +// slightly bespoke collection of NetworkMapping. Hence it makes sense to override Load with +// Base.NetworkMapping instead of existing CurrentVersion.NetworkMapping. +type NetworkMappingCollection struct { + autorest.Response `json:"-"` + // Value - The Network Mappings list. + Value *[]NetworkMapping `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// NetworkMappingCollectionIterator provides access to a complete listing of NetworkMapping values. +type NetworkMappingCollectionIterator struct { + i int + page NetworkMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *NetworkMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *NetworkMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter NetworkMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter NetworkMappingCollectionIterator) Response() NetworkMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter NetworkMappingCollectionIterator) Value() NetworkMapping { + if !iter.page.NotDone() { + return NetworkMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the NetworkMappingCollectionIterator type. +func NewNetworkMappingCollectionIterator(page NetworkMappingCollectionPage) NetworkMappingCollectionIterator { + return NetworkMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (nmc NetworkMappingCollection) IsEmpty() bool { + return nmc.Value == nil || len(*nmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (nmc NetworkMappingCollection) hasNextLink() bool { + return nmc.NextLink != nil && len(*nmc.NextLink) != 0 +} + +// networkMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (nmc NetworkMappingCollection) networkMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !nmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(nmc.NextLink))) +} + +// NetworkMappingCollectionPage contains a page of NetworkMapping values. +type NetworkMappingCollectionPage struct { + fn func(context.Context, NetworkMappingCollection) (NetworkMappingCollection, error) + nmc NetworkMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *NetworkMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.nmc) + if err != nil { + return err + } + page.nmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *NetworkMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page NetworkMappingCollectionPage) NotDone() bool { + return !page.nmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page NetworkMappingCollectionPage) Response() NetworkMappingCollection { + return page.nmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page NetworkMappingCollectionPage) Values() []NetworkMapping { + if page.nmc.IsEmpty() { + return nil + } + return *page.nmc.Value +} + +// Creates a new instance of the NetworkMappingCollectionPage type. +func NewNetworkMappingCollectionPage(cur NetworkMappingCollection, getNextPage func(context.Context, NetworkMappingCollection) (NetworkMappingCollection, error)) NetworkMappingCollectionPage { + return NetworkMappingCollectionPage{ + fn: getNextPage, + nmc: cur, + } +} + +// BasicNetworkMappingFabricSpecificSettings network Mapping fabric specific settings. +type BasicNetworkMappingFabricSpecificSettings interface { + AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) + AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) + AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) + AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) +} + +// NetworkMappingFabricSpecificSettings network Mapping fabric specific settings. +type NetworkMappingFabricSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicNetworkMappingFabricSpecificSettings(body []byte) (BasicNetworkMappingFabricSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure): + var atanms AzureToAzureNetworkMappingSettings + err := json.Unmarshal(body, &atanms) + return atanms, err + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure): + var vtanms VmmToAzureNetworkMappingSettings + err := json.Unmarshal(body, &vtanms) + return vtanms, err + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm): + var vtvnms VmmToVmmNetworkMappingSettings + err := json.Unmarshal(body, &vtvnms) + return vtvnms, err + default: + var nmfss NetworkMappingFabricSpecificSettings + err := json.Unmarshal(body, &nmfss) + return nmfss, err + } +} +func unmarshalBasicNetworkMappingFabricSpecificSettingsArray(body []byte) ([]BasicNetworkMappingFabricSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + nmfssArray := make([]BasicNetworkMappingFabricSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + nmfss, err := unmarshalBasicNetworkMappingFabricSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + nmfssArray[index] = nmfss + } + return nmfssArray, nil +} + +// MarshalJSON is the custom marshaler for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) MarshalJSON() ([]byte, error) { + nmfss.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings + objectMap := make(map[string]interface{}) + if nmfss.InstanceType != "" { + objectMap["instanceType"] = nmfss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return &nmfss, true +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &nmfss, true +} + +// NetworkMappingProperties network Mapping Properties. +type NetworkMappingProperties struct { + // State - The pairing state for network mapping. + State *string `json:"state,omitempty"` + // PrimaryNetworkFriendlyName - The primary network friendly name. + PrimaryNetworkFriendlyName *string `json:"primaryNetworkFriendlyName,omitempty"` + // PrimaryNetworkID - The primary network id for network mapping. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // PrimaryFabricFriendlyName - The primary fabric friendly name. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // RecoveryNetworkFriendlyName - The recovery network friendly name. + RecoveryNetworkFriendlyName *string `json:"recoveryNetworkFriendlyName,omitempty"` + // RecoveryNetworkID - The recovery network id for network mapping. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // RecoveryFabricArmID - The recovery fabric ARM id. + RecoveryFabricArmID *string `json:"recoveryFabricArmId,omitempty"` + // RecoveryFabricFriendlyName - The recovery fabric friendly name. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // FabricSpecificSettings - The fabric specific settings. + FabricSpecificSettings BasicNetworkMappingFabricSpecificSettings `json:"fabricSpecificSettings,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for NetworkMappingProperties struct. +func (nmp *NetworkMappingProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + nmp.State = &state + } + case "primaryNetworkFriendlyName": + if v != nil { + var primaryNetworkFriendlyName string + err = json.Unmarshal(*v, &primaryNetworkFriendlyName) + if err != nil { + return err + } + nmp.PrimaryNetworkFriendlyName = &primaryNetworkFriendlyName + } + case "primaryNetworkId": + if v != nil { + var primaryNetworkID string + err = json.Unmarshal(*v, &primaryNetworkID) + if err != nil { + return err + } + nmp.PrimaryNetworkID = &primaryNetworkID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + nmp.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "recoveryNetworkFriendlyName": + if v != nil { + var recoveryNetworkFriendlyName string + err = json.Unmarshal(*v, &recoveryNetworkFriendlyName) + if err != nil { + return err + } + nmp.RecoveryNetworkFriendlyName = &recoveryNetworkFriendlyName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + nmp.RecoveryNetworkID = &recoveryNetworkID + } + case "recoveryFabricArmId": + if v != nil { + var recoveryFabricArmID string + err = json.Unmarshal(*v, &recoveryFabricArmID) + if err != nil { + return err + } + nmp.RecoveryFabricArmID = &recoveryFabricArmID + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + nmp.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "fabricSpecificSettings": + if v != nil { + fabricSpecificSettings, err := unmarshalBasicNetworkMappingFabricSpecificSettings(*v) + if err != nil { + return err + } + nmp.FabricSpecificSettings = fabricSpecificSettings + } + } + } + + return nil +} + +// NetworkProperties network Properties. +type NetworkProperties struct { + // FabricType - The Fabric Type. + FabricType *string `json:"fabricType,omitempty"` + // Subnets - The List of subnets. + Subnets *[]Subnet `json:"subnets,omitempty"` + // FriendlyName - The Friendly Name. + FriendlyName *string `json:"friendlyName,omitempty"` + // NetworkType - The Network Type. + NetworkType *string `json:"networkType,omitempty"` +} + +// NewProtectionProfile new Protection profile input. +type NewProtectionProfile struct { + // PolicyName - The protection profile input. + PolicyName *string `json:"policyName,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for NewProtectionProfile. +func (npp NewProtectionProfile) MarshalJSON() ([]byte, error) { + npp.ResourceType = ResourceTypeNew + objectMap := make(map[string]interface{}) + if npp.PolicyName != nil { + objectMap["policyName"] = npp.PolicyName + } + if npp.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = npp.RecoveryPointHistory + } + if npp.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = npp.CrashConsistentFrequencyInMinutes + } + if npp.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = npp.AppConsistentFrequencyInMinutes + } + if npp.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = npp.MultiVMSyncStatus + } + if npp.ResourceType != "" { + objectMap["resourceType"] = npp.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return nil, false +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return &npp, true +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return nil, false +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &npp, true +} + +// NewRecoveryVirtualNetwork recovery virtual network input to create new virtual network from given source +// network. +type NewRecoveryVirtualNetwork struct { + // RecoveryVirtualNetworkResourceGroupName - The name of the resource group to be used to create the recovery virtual network. If absent, target network would be created in the same resource group as target VM. + RecoveryVirtualNetworkResourceGroupName *string `json:"recoveryVirtualNetworkResourceGroupName,omitempty"` + // RecoveryVirtualNetworkName - The recovery virtual network name. + RecoveryVirtualNetworkName *string `json:"recoveryVirtualNetworkName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) MarshalJSON() ([]byte, error) { + nrvn.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew + objectMap := make(map[string]interface{}) + if nrvn.RecoveryVirtualNetworkResourceGroupName != nil { + objectMap["recoveryVirtualNetworkResourceGroupName"] = nrvn.RecoveryVirtualNetworkResourceGroupName + } + if nrvn.RecoveryVirtualNetworkName != nil { + objectMap["recoveryVirtualNetworkName"] = nrvn.RecoveryVirtualNetworkName + } + if nrvn.ResourceType != "" { + objectMap["resourceType"] = nrvn.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return &nrvn, true +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &nrvn, true +} + +// OperationsDiscovery operations discovery class. +type OperationsDiscovery struct { + // Name - Name of the API. The name of the operation being performed on this particular object. It should match the action name that appears in RBAC / the event service. Examples of operations include: * Microsoft.Compute/virtualMachine/capture/action * Microsoft.Compute/virtualMachine/restart/action * Microsoft.Compute/virtualMachine/write * Microsoft.Compute/virtualMachine/read * Microsoft.Compute/virtualMachine/delete Each action should include, in order: (1) Resource Provider Namespace (2) Type hierarchy for which the action applies (e.g. server/databases for a SQL Azure database) (3) Read, Write, Action or Delete indicating which type applies. If it is a PUT/PATCH on a collection or named value, Write should be used. If it is a GET, Read should be used. If it is a DELETE, Delete should be used. If it is a POST, Action should be used. As a note: all resource providers would need to include the "{Resource Provider Namespace}/register/action" operation in their response. This API is used to register for their service, and should include details about the operation (e.g. a localized name for the resource provider + any special considerations like PII release). + Name *string `json:"name,omitempty"` + // Display - Object type. + Display *Display `json:"display,omitempty"` + // Origin - Origin. The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. Default value is "user,system". + Origin *string `json:"origin,omitempty"` + // Properties - Properties. Reserved for future use. + Properties interface{} `json:"properties,omitempty"` +} + +// OperationsDiscoveryCollection collection of ClientDiscovery details. +type OperationsDiscoveryCollection struct { + autorest.Response `json:"-"` + // Value - The ClientDiscovery details. + Value *[]OperationsDiscovery `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationsDiscoveryCollectionIterator provides access to a complete listing of OperationsDiscovery +// values. +type OperationsDiscoveryCollectionIterator struct { + i int + page OperationsDiscoveryCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationsDiscoveryCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsDiscoveryCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationsDiscoveryCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationsDiscoveryCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationsDiscoveryCollectionIterator) Response() OperationsDiscoveryCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationsDiscoveryCollectionIterator) Value() OperationsDiscovery { + if !iter.page.NotDone() { + return OperationsDiscovery{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationsDiscoveryCollectionIterator type. +func NewOperationsDiscoveryCollectionIterator(page OperationsDiscoveryCollectionPage) OperationsDiscoveryCollectionIterator { + return OperationsDiscoveryCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (odc OperationsDiscoveryCollection) IsEmpty() bool { + return odc.Value == nil || len(*odc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (odc OperationsDiscoveryCollection) hasNextLink() bool { + return odc.NextLink != nil && len(*odc.NextLink) != 0 +} + +// operationsDiscoveryCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (odc OperationsDiscoveryCollection) operationsDiscoveryCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !odc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(odc.NextLink))) +} + +// OperationsDiscoveryCollectionPage contains a page of OperationsDiscovery values. +type OperationsDiscoveryCollectionPage struct { + fn func(context.Context, OperationsDiscoveryCollection) (OperationsDiscoveryCollection, error) + odc OperationsDiscoveryCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationsDiscoveryCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsDiscoveryCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.odc) + if err != nil { + return err + } + page.odc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationsDiscoveryCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationsDiscoveryCollectionPage) NotDone() bool { + return !page.odc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationsDiscoveryCollectionPage) Response() OperationsDiscoveryCollection { + return page.odc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationsDiscoveryCollectionPage) Values() []OperationsDiscovery { + if page.odc.IsEmpty() { + return nil + } + return *page.odc.Value +} + +// Creates a new instance of the OperationsDiscoveryCollectionPage type. +func NewOperationsDiscoveryCollectionPage(cur OperationsDiscoveryCollection, getNextPage func(context.Context, OperationsDiscoveryCollection) (OperationsDiscoveryCollection, error)) OperationsDiscoveryCollectionPage { + return OperationsDiscoveryCollectionPage{ + fn: getNextPage, + odc: cur, + } +} + +// OSDetails disk Details. +type OSDetails struct { + // OsType - VM Disk details. + OsType *string `json:"osType,omitempty"` + // ProductType - Product type. + ProductType *string `json:"productType,omitempty"` + // OsEdition - The OSEdition. + OsEdition *string `json:"osEdition,omitempty"` + // OSVersion - The OS Version. + OSVersion *string `json:"oSVersion,omitempty"` + // OSMajorVersion - The OS Major Version. + OSMajorVersion *string `json:"oSMajorVersion,omitempty"` + // OSMinorVersion - The OS Minor Version. + OSMinorVersion *string `json:"oSMinorVersion,omitempty"` +} + +// OSDiskDetails details of the OS Disk. +type OSDiskDetails struct { + // OsVhdID - The id of the disk containing the OS. + OsVhdID *string `json:"osVhdId,omitempty"` + // OsType - The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // VhdName - The OS disk VHD name. + VhdName *string `json:"vhdName,omitempty"` +} + +// OSVersionWrapper wrapper model for OSVersion to include version and service pack info. +type OSVersionWrapper struct { + // Version - The version. + Version *string `json:"version,omitempty"` + // ServicePack - The service pack. + ServicePack *string `json:"servicePack,omitempty"` +} + +// PlannedFailoverInput input definition for planned failover. +type PlannedFailoverInput struct { + // Properties - Planned failover input properties. + Properties *PlannedFailoverInputProperties `json:"properties,omitempty"` +} + +// PlannedFailoverInputProperties input definition for planned failover input properties. +type PlannedFailoverInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicPlannedFailoverProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for PlannedFailoverInputProperties struct. +func (pfip *PlannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + pfip.FailoverDirection = &failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(*v) + if err != nil { + return err + } + pfip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicPlannedFailoverProviderSpecificFailoverInput provider specific failover input. +type BasicPlannedFailoverProviderSpecificFailoverInput interface { + AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) + AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) + AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) + AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) +} + +// PlannedFailoverProviderSpecificFailoverInput provider specific failover input. +type PlannedFailoverProviderSpecificFailoverInput struct { + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(body []byte) (BasicPlannedFailoverProviderSpecificFailoverInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeHyperVReplicaAzureFailback): + var hvrafpi HyperVReplicaAzureFailbackProviderInput + err := json.Unmarshal(body, &hvrafpi) + return hvrafpi, err + case string(InstanceTypeHyperVReplicaAzure): + var hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput + err := json.Unmarshal(body, &hvrapfpi) + return hvrapfpi, err + case string(InstanceTypeInMageRcmFailback): + var imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput + err := json.Unmarshal(body, &imrfpfpi) + return imrfpfpi, err + default: + var pfpsfi PlannedFailoverProviderSpecificFailoverInput + err := json.Unmarshal(body, &pfpsfi) + return pfpsfi, err + } +} +func unmarshalBasicPlannedFailoverProviderSpecificFailoverInputArray(body []byte) ([]BasicPlannedFailoverProviderSpecificFailoverInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pfpsfiArray := make([]BasicPlannedFailoverProviderSpecificFailoverInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pfpsfi, err := unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(*rawMessage) + if err != nil { + return nil, err + } + pfpsfiArray[index] = pfpsfi + } + return pfpsfiArray, nil +} + +// MarshalJSON is the custom marshaler for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) MarshalJSON() ([]byte, error) { + pfpsfi.InstanceType = InstanceTypePlannedFailoverProviderSpecificFailoverInput + objectMap := make(map[string]interface{}) + if pfpsfi.InstanceType != "" { + objectMap["instanceType"] = pfpsfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return &pfpsfi, true +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &pfpsfi, true +} + +// Policy protection profile details. +type Policy struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *PolicyProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Policy. +func (p Policy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.Properties != nil { + objectMap["properties"] = p.Properties + } + if p.Location != nil { + objectMap["location"] = p.Location + } + return json.Marshal(objectMap) +} + +// PolicyCollection protection Profile Collection details. +type PolicyCollection struct { + autorest.Response `json:"-"` + // Value - The policy details. + Value *[]Policy `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// PolicyCollectionIterator provides access to a complete listing of Policy values. +type PolicyCollectionIterator struct { + i int + page PolicyCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PolicyCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PolicyCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PolicyCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PolicyCollectionIterator) Response() PolicyCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PolicyCollectionIterator) Value() Policy { + if !iter.page.NotDone() { + return Policy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PolicyCollectionIterator type. +func NewPolicyCollectionIterator(page PolicyCollectionPage) PolicyCollectionIterator { + return PolicyCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pc PolicyCollection) IsEmpty() bool { + return pc.Value == nil || len(*pc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pc PolicyCollection) hasNextLink() bool { + return pc.NextLink != nil && len(*pc.NextLink) != 0 +} + +// policyCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pc PolicyCollection) policyCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pc.NextLink))) +} + +// PolicyCollectionPage contains a page of Policy values. +type PolicyCollectionPage struct { + fn func(context.Context, PolicyCollection) (PolicyCollection, error) + pc PolicyCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PolicyCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pc) + if err != nil { + return err + } + page.pc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PolicyCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PolicyCollectionPage) NotDone() bool { + return !page.pc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PolicyCollectionPage) Response() PolicyCollection { + return page.pc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PolicyCollectionPage) Values() []Policy { + if page.pc.IsEmpty() { + return nil + } + return *page.pc.Value +} + +// Creates a new instance of the PolicyCollectionPage type. +func NewPolicyCollectionPage(cur PolicyCollection, getNextPage func(context.Context, PolicyCollection) (PolicyCollection, error)) PolicyCollectionPage { + return PolicyCollectionPage{ + fn: getNextPage, + pc: cur, + } +} + +// PolicyProperties protection profile custom data details. +type PolicyProperties struct { + // FriendlyName - The FriendlyName. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProviderSpecificDetails - The ReplicationChannelSetting. + ProviderSpecificDetails BasicPolicyProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for PolicyProperties struct. +func (pp *PolicyProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + pp.FriendlyName = &friendlyName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicPolicyProviderSpecificDetails(*v) + if err != nil { + return err + } + pp.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicPolicyProviderSpecificDetails base class for Provider specific details for policies. +type BasicPolicyProviderSpecificDetails interface { + AsA2APolicyDetails() (*A2APolicyDetails, bool) + AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) + AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) + AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) + AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) + AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) + AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) + AsInMagePolicyDetails() (*InMagePolicyDetails, bool) + AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) + AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) + AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) + AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) +} + +// PolicyProviderSpecificDetails base class for Provider specific details for policies. +type PolicyProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicPolicyProviderSpecificDetails(body []byte) (BasicPolicyProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A): + var apd A2APolicyDetails + err := json.Unmarshal(body, &apd) + return apd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure): + var hvrapd HyperVReplicaAzurePolicyDetails + err := json.Unmarshal(body, &hvrapd) + return hvrapd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails): + var hvrbpd HyperVReplicaBasePolicyDetails + err := json.Unmarshal(body, &hvrbpd) + return hvrbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2): + var hvrbpd HyperVReplicaBluePolicyDetails + err := json.Unmarshal(body, &hvrbpd) + return hvrbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012): + var hvrpd HyperVReplicaPolicyDetails + err := json.Unmarshal(body, &hvrpd) + return hvrpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2): + var imavpd InMageAzureV2PolicyDetails + err := json.Unmarshal(body, &imavpd) + return imavpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails): + var imbpd InMageBasePolicyDetails + err := json.Unmarshal(body, &imbpd) + return imbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage): + var impd InMagePolicyDetails + err := json.Unmarshal(body, &impd) + return impd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback): + var imrfpd InMageRcmFailbackPolicyDetails + err := json.Unmarshal(body, &imrfpd) + return imrfpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm): + var imrpd InMageRcmPolicyDetails + err := json.Unmarshal(body, &imrpd) + return imrpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt): + var vcpd VmwareCbtPolicyDetails + err := json.Unmarshal(body, &vcpd) + return vcpd, err + default: + var ppsd PolicyProviderSpecificDetails + err := json.Unmarshal(body, &ppsd) + return ppsd, err + } +} +func unmarshalBasicPolicyProviderSpecificDetailsArray(body []byte) ([]BasicPolicyProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppsdArray := make([]BasicPolicyProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppsd, err := unmarshalBasicPolicyProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + ppsdArray[index] = ppsd + } + return ppsdArray, nil +} + +// MarshalJSON is the custom marshaler for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) MarshalJSON() ([]byte, error) { + ppsd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails + objectMap := make(map[string]interface{}) + if ppsd.InstanceType != "" { + objectMap["instanceType"] = ppsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return &ppsd, true +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &ppsd, true +} + +// BasicPolicyProviderSpecificInput base class for provider specific input. +type BasicPolicyProviderSpecificInput interface { + AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) + AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) + AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) + AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) + AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) + AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) + AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) + AsInMagePolicyInput() (*InMagePolicyInput, bool) + AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) + AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) + AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) + AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) +} + +// PolicyProviderSpecificInput base class for provider specific input. +type PolicyProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicPolicyProviderSpecificInput(body []byte) (BasicPolicyProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmpci A2ACrossClusterMigrationPolicyCreationInput + err := json.Unmarshal(body, &accmpci) + return accmpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A): + var apci A2APolicyCreationInput + err := json.Unmarshal(body, &apci) + return apci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvrapi HyperVReplicaAzurePolicyInput + err := json.Unmarshal(body, &hvrapi) + return hvrapi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2): + var hvrbpi HyperVReplicaBluePolicyInput + err := json.Unmarshal(body, &hvrbpi) + return hvrbpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012): + var hvrpi HyperVReplicaPolicyInput + err := json.Unmarshal(body, &hvrpi) + return hvrpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2): + var imavpi InMageAzureV2PolicyInput + err := json.Unmarshal(body, &imavpi) + return imavpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage): + var impi InMagePolicyInput + err := json.Unmarshal(body, &impi) + return impi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback): + var imrfpci InMageRcmFailbackPolicyCreationInput + err := json.Unmarshal(body, &imrfpci) + return imrfpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm): + var imrpci InMageRcmPolicyCreationInput + err := json.Unmarshal(body, &imrpci) + return imrpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt): + var vmcpci VMwareCbtPolicyCreationInput + err := json.Unmarshal(body, &vmcpci) + return vmcpci, err + default: + var ppsi PolicyProviderSpecificInput + err := json.Unmarshal(body, &ppsi) + return ppsi, err + } +} +func unmarshalBasicPolicyProviderSpecificInputArray(body []byte) ([]BasicPolicyProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppsiArray := make([]BasicPolicyProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppsi, err := unmarshalBasicPolicyProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + ppsiArray[index] = ppsi + } + return ppsiArray, nil +} + +// MarshalJSON is the custom marshaler for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) MarshalJSON() ([]byte, error) { + ppsi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput + objectMap := make(map[string]interface{}) + if ppsi.InstanceType != "" { + objectMap["instanceType"] = ppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return &ppsi, true +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &ppsi, true +} + +// ProcessServer details of the Process Server. +type ProcessServer struct { + // FriendlyName - The Process Server's friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ID - The Process Server Id. + ID *string `json:"id,omitempty"` + // IPAddress - The IP address of the server. + IPAddress *string `json:"ipAddress,omitempty"` + // OsType - The OS type of the server. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The version of the scout component on the server. + AgentVersion *string `json:"agentVersion,omitempty"` + // LastHeartbeat - The last heartbeat received from the server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // MobilityServiceUpdates - The list of the mobility service updates available on the Process Server. + MobilityServiceUpdates *[]MobilityServiceUpdate `json:"mobilityServiceUpdates,omitempty"` + // HostID - The agent generated Id. + HostID *string `json:"hostId,omitempty"` + // MachineCount - The servers configured with this PS. + MachineCount *string `json:"machineCount,omitempty"` + // ReplicationPairCount - The number of replication pairs configured in this PS. + ReplicationPairCount *string `json:"replicationPairCount,omitempty"` + // SystemLoad - The percentage of the system load. + SystemLoad *string `json:"systemLoad,omitempty"` + // SystemLoadStatus - The system load status. + SystemLoadStatus *string `json:"systemLoadStatus,omitempty"` + // CPULoad - The percentage of the CPU load. + CPULoad *string `json:"cpuLoad,omitempty"` + // CPULoadStatus - The CPU load status. + CPULoadStatus *string `json:"cpuLoadStatus,omitempty"` + // TotalMemoryInBytes - The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // MemoryUsageStatus - The memory usage status. + MemoryUsageStatus *string `json:"memoryUsageStatus,omitempty"` + // TotalSpaceInBytes - The total space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - The available space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // SpaceUsageStatus - The space usage status. + SpaceUsageStatus *string `json:"spaceUsageStatus,omitempty"` + // PsServiceStatus - The PS service status. + PsServiceStatus *string `json:"psServiceStatus,omitempty"` + // SslCertExpiryDate - The PS SSL cert expiry date. + SslCertExpiryDate *date.Time `json:"sslCertExpiryDate,omitempty"` + // SslCertExpiryRemainingDays - CS SSL cert expiry date. + SslCertExpiryRemainingDays *int32 `json:"sslCertExpiryRemainingDays,omitempty"` + // OsVersion - OS Version of the process server. Note: This will get populated if user has CS version greater than 9.12.0.0. + OsVersion *string `json:"osVersion,omitempty"` + // HealthErrors - Health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // AgentVersionDetails - The agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // Health - READ-ONLY; The health of Process Server. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // PsStatsRefreshTime - READ-ONLY; The process server stats refresh time. + PsStatsRefreshTime *date.Time `json:"psStatsRefreshTime,omitempty"` + // ThroughputUploadPendingDataInBytes - READ-ONLY; The uploading pending data in bytes. + ThroughputUploadPendingDataInBytes *int64 `json:"throughputUploadPendingDataInBytes,omitempty"` + // ThroughputInMBps - READ-ONLY; The throughput in MBps. + ThroughputInMBps *int64 `json:"throughputInMBps,omitempty"` + // ThroughputInBytes - READ-ONLY; The throughput in bytes. + ThroughputInBytes *int64 `json:"throughputInBytes,omitempty"` + // ThroughputStatus - READ-ONLY; The throughput status. + ThroughputStatus *string `json:"throughputStatus,omitempty"` + // MarsCommunicationStatus - READ-ONLY; The MARS communication status. + MarsCommunicationStatus *string `json:"marsCommunicationStatus,omitempty"` + // MarsRegistrationStatus - READ-ONLY; The MARS registration status. + MarsRegistrationStatus *string `json:"marsRegistrationStatus,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessServer. +func (ps ProcessServer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ps.FriendlyName != nil { + objectMap["friendlyName"] = ps.FriendlyName + } + if ps.ID != nil { + objectMap["id"] = ps.ID + } + if ps.IPAddress != nil { + objectMap["ipAddress"] = ps.IPAddress + } + if ps.OsType != nil { + objectMap["osType"] = ps.OsType + } + if ps.AgentVersion != nil { + objectMap["agentVersion"] = ps.AgentVersion + } + if ps.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = ps.LastHeartbeat + } + if ps.VersionStatus != nil { + objectMap["versionStatus"] = ps.VersionStatus + } + if ps.MobilityServiceUpdates != nil { + objectMap["mobilityServiceUpdates"] = ps.MobilityServiceUpdates + } + if ps.HostID != nil { + objectMap["hostId"] = ps.HostID + } + if ps.MachineCount != nil { + objectMap["machineCount"] = ps.MachineCount + } + if ps.ReplicationPairCount != nil { + objectMap["replicationPairCount"] = ps.ReplicationPairCount + } + if ps.SystemLoad != nil { + objectMap["systemLoad"] = ps.SystemLoad + } + if ps.SystemLoadStatus != nil { + objectMap["systemLoadStatus"] = ps.SystemLoadStatus + } + if ps.CPULoad != nil { + objectMap["cpuLoad"] = ps.CPULoad + } + if ps.CPULoadStatus != nil { + objectMap["cpuLoadStatus"] = ps.CPULoadStatus + } + if ps.TotalMemoryInBytes != nil { + objectMap["totalMemoryInBytes"] = ps.TotalMemoryInBytes + } + if ps.AvailableMemoryInBytes != nil { + objectMap["availableMemoryInBytes"] = ps.AvailableMemoryInBytes + } + if ps.MemoryUsageStatus != nil { + objectMap["memoryUsageStatus"] = ps.MemoryUsageStatus + } + if ps.TotalSpaceInBytes != nil { + objectMap["totalSpaceInBytes"] = ps.TotalSpaceInBytes + } + if ps.AvailableSpaceInBytes != nil { + objectMap["availableSpaceInBytes"] = ps.AvailableSpaceInBytes + } + if ps.SpaceUsageStatus != nil { + objectMap["spaceUsageStatus"] = ps.SpaceUsageStatus + } + if ps.PsServiceStatus != nil { + objectMap["psServiceStatus"] = ps.PsServiceStatus + } + if ps.SslCertExpiryDate != nil { + objectMap["sslCertExpiryDate"] = ps.SslCertExpiryDate + } + if ps.SslCertExpiryRemainingDays != nil { + objectMap["sslCertExpiryRemainingDays"] = ps.SslCertExpiryRemainingDays + } + if ps.OsVersion != nil { + objectMap["osVersion"] = ps.OsVersion + } + if ps.HealthErrors != nil { + objectMap["healthErrors"] = ps.HealthErrors + } + if ps.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = ps.AgentExpiryDate + } + if ps.AgentVersionDetails != nil { + objectMap["agentVersionDetails"] = ps.AgentVersionDetails + } + return json.Marshal(objectMap) +} + +// ProcessServerDetails process server details. +type ProcessServerDetails struct { + // ID - READ-ONLY; The process server Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The process server name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The process server Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The process server Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the process server. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // TotalMemoryInBytes - READ-ONLY; The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - READ-ONLY; The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // UsedMemoryInBytes - READ-ONLY; The used memory. + UsedMemoryInBytes *int64 `json:"usedMemoryInBytes,omitempty"` + // MemoryUsagePercentage - READ-ONLY; The memory usage percentage. + MemoryUsagePercentage *float64 `json:"memoryUsagePercentage,omitempty"` + // TotalSpaceInBytes - READ-ONLY; The total disk space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - READ-ONLY; The available disk space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // UsedSpaceInBytes - READ-ONLY; The used disk space. + UsedSpaceInBytes *int64 `json:"usedSpaceInBytes,omitempty"` + // FreeSpacePercentage - READ-ONLY; The free disk space percentage. + FreeSpacePercentage *float64 `json:"freeSpacePercentage,omitempty"` + // ThroughputUploadPendingDataInBytes - READ-ONLY; The uploading pending data in bytes. + ThroughputUploadPendingDataInBytes *int64 `json:"throughputUploadPendingDataInBytes,omitempty"` + // ThroughputInBytes - READ-ONLY; The throughput in bytes. + ThroughputInBytes *int64 `json:"throughputInBytes,omitempty"` + // ProcessorUsagePercentage - READ-ONLY; The processor usage percentage. + ProcessorUsagePercentage *float64 `json:"processorUsagePercentage,omitempty"` + // ThroughputStatus - READ-ONLY; The throughput status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + ThroughputStatus RcmComponentStatus `json:"throughputStatus,omitempty"` + // SystemLoad - READ-ONLY; The system load. + SystemLoad *int64 `json:"systemLoad,omitempty"` + // SystemLoadStatus - READ-ONLY; The system load status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + SystemLoadStatus RcmComponentStatus `json:"systemLoadStatus,omitempty"` + // DiskUsageStatus - READ-ONLY; The disk usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + DiskUsageStatus RcmComponentStatus `json:"diskUsageStatus,omitempty"` + // MemoryUsageStatus - READ-ONLY; The memory usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + MemoryUsageStatus RcmComponentStatus `json:"memoryUsageStatus,omitempty"` + // ProcessorUsageStatus - READ-ONLY; The processor usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + ProcessorUsageStatus RcmComponentStatus `json:"processorUsageStatus,omitempty"` + // Health - READ-ONLY; The health of the process server. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // HistoricHealth - READ-ONLY; The historic health of the process server based on the health in last 24 hours. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + HistoricHealth ProtectionHealth `json:"historicHealth,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessServerDetails. +func (psd ProcessServerDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ProtectableItem replication protected item. +type ProtectableItem struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectableItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectableItem. +func (pi ProtectableItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pi.Properties != nil { + objectMap["properties"] = pi.Properties + } + if pi.Location != nil { + objectMap["location"] = pi.Location + } + return json.Marshal(objectMap) +} + +// ProtectableItemCollection protectable item collection. +type ProtectableItemCollection struct { + autorest.Response `json:"-"` + // Value - The Protectable item details. + Value *[]ProtectableItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectableItemCollectionIterator provides access to a complete listing of ProtectableItem values. +type ProtectableItemCollectionIterator struct { + i int + page ProtectableItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectableItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectableItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectableItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectableItemCollectionIterator) Response() ProtectableItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectableItemCollectionIterator) Value() ProtectableItem { + if !iter.page.NotDone() { + return ProtectableItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectableItemCollectionIterator type. +func NewProtectableItemCollectionIterator(page ProtectableItemCollectionPage) ProtectableItemCollectionIterator { + return ProtectableItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pic ProtectableItemCollection) IsEmpty() bool { + return pic.Value == nil || len(*pic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pic ProtectableItemCollection) hasNextLink() bool { + return pic.NextLink != nil && len(*pic.NextLink) != 0 +} + +// protectableItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pic ProtectableItemCollection) protectableItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pic.NextLink))) +} + +// ProtectableItemCollectionPage contains a page of ProtectableItem values. +type ProtectableItemCollectionPage struct { + fn func(context.Context, ProtectableItemCollection) (ProtectableItemCollection, error) + pic ProtectableItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectableItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pic) + if err != nil { + return err + } + page.pic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectableItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectableItemCollectionPage) NotDone() bool { + return !page.pic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectableItemCollectionPage) Response() ProtectableItemCollection { + return page.pic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectableItemCollectionPage) Values() []ProtectableItem { + if page.pic.IsEmpty() { + return nil + } + return *page.pic.Value +} + +// Creates a new instance of the ProtectableItemCollectionPage type. +func NewProtectableItemCollectionPage(cur ProtectableItemCollection, getNextPage func(context.Context, ProtectableItemCollection) (ProtectableItemCollection, error)) ProtectableItemCollectionPage { + return ProtectableItemCollectionPage{ + fn: getNextPage, + pic: cur, + } +} + +// ProtectableItemProperties replication protected item custom data details. +type ProtectableItemProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionStatus - The protection status. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ReplicationProtectedItemID - The ARM resource of protected items. + ReplicationProtectedItemID *string `json:"replicationProtectedItemId,omitempty"` + // RecoveryServicesProviderID - The recovery provider ARM Id. + RecoveryServicesProviderID *string `json:"recoveryServicesProviderId,omitempty"` + // ProtectionReadinessErrors - The Current protection readiness errors. + ProtectionReadinessErrors *[]string `json:"protectionReadinessErrors,omitempty"` + // SupportedReplicationProviders - The list of replication providers supported for the protectable item. + SupportedReplicationProviders *[]string `json:"supportedReplicationProviders,omitempty"` + // CustomDetails - The Replication provider custom settings. + CustomDetails BasicConfigurationSettings `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ProtectableItemProperties struct. +func (pip *ProtectableItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + pip.FriendlyName = &friendlyName + } + case "protectionStatus": + if v != nil { + var protectionStatus string + err = json.Unmarshal(*v, &protectionStatus) + if err != nil { + return err + } + pip.ProtectionStatus = &protectionStatus + } + case "replicationProtectedItemId": + if v != nil { + var replicationProtectedItemID string + err = json.Unmarshal(*v, &replicationProtectedItemID) + if err != nil { + return err + } + pip.ReplicationProtectedItemID = &replicationProtectedItemID + } + case "recoveryServicesProviderId": + if v != nil { + var recoveryServicesProviderID string + err = json.Unmarshal(*v, &recoveryServicesProviderID) + if err != nil { + return err + } + pip.RecoveryServicesProviderID = &recoveryServicesProviderID + } + case "protectionReadinessErrors": + if v != nil { + var protectionReadinessErrors []string + err = json.Unmarshal(*v, &protectionReadinessErrors) + if err != nil { + return err + } + pip.ProtectionReadinessErrors = &protectionReadinessErrors + } + case "supportedReplicationProviders": + if v != nil { + var supportedReplicationProviders []string + err = json.Unmarshal(*v, &supportedReplicationProviders) + if err != nil { + return err + } + pip.SupportedReplicationProviders = &supportedReplicationProviders + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicConfigurationSettings(*v) + if err != nil { + return err + } + pip.CustomDetails = customDetails + } + } + } + + return nil +} + +// ProtectableItemQueryParameter query parameter to enumerate Protectable items. +type ProtectableItemQueryParameter struct { + // State - State of the Protectable item query filter. + State *string `json:"state,omitempty"` +} + +// ProtectedItemsQueryParameter query parameter to enumerate protected items. +type ProtectedItemsQueryParameter struct { + // SourceFabricName - The source fabric name filter. + SourceFabricName *string `json:"sourceFabricName,omitempty"` + // RecoveryPlanName - The recovery plan filter. + RecoveryPlanName *string `json:"recoveryPlanName,omitempty"` + // VCenterName - The vCenter name filter. + VCenterName *string `json:"vCenterName,omitempty"` + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` + // MultiVMGroupCreateOption - Whether Multi VM group is auto created or specified by user. Possible values include: 'AutoCreated', 'UserSpecified' + MultiVMGroupCreateOption MultiVMGroupCreateOption `json:"multiVmGroupCreateOption,omitempty"` + // ProcessServerID - The process server Id filter. + ProcessServerID *string `json:"processServerId,omitempty"` +} + +// ProtectionContainer protection container details. +type ProtectionContainer struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectionContainerProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainer. +func (pc ProtectionContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pc.Properties != nil { + objectMap["properties"] = pc.Properties + } + if pc.Location != nil { + objectMap["location"] = pc.Location + } + return json.Marshal(objectMap) +} + +// ProtectionContainerCollection protection Container collection. +type ProtectionContainerCollection struct { + autorest.Response `json:"-"` + // Value - The Protection Container details. + Value *[]ProtectionContainer `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectionContainerCollectionIterator provides access to a complete listing of ProtectionContainer +// values. +type ProtectionContainerCollectionIterator struct { + i int + page ProtectionContainerCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectionContainerCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionContainerCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionContainerCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectionContainerCollectionIterator) Response() ProtectionContainerCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectionContainerCollectionIterator) Value() ProtectionContainer { + if !iter.page.NotDone() { + return ProtectionContainer{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectionContainerCollectionIterator type. +func NewProtectionContainerCollectionIterator(page ProtectionContainerCollectionPage) ProtectionContainerCollectionIterator { + return ProtectionContainerCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcc ProtectionContainerCollection) IsEmpty() bool { + return pcc.Value == nil || len(*pcc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pcc ProtectionContainerCollection) hasNextLink() bool { + return pcc.NextLink != nil && len(*pcc.NextLink) != 0 +} + +// protectionContainerCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcc ProtectionContainerCollection) protectionContainerCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pcc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcc.NextLink))) +} + +// ProtectionContainerCollectionPage contains a page of ProtectionContainer values. +type ProtectionContainerCollectionPage struct { + fn func(context.Context, ProtectionContainerCollection) (ProtectionContainerCollection, error) + pcc ProtectionContainerCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectionContainerCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pcc) + if err != nil { + return err + } + page.pcc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionContainerCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionContainerCollectionPage) NotDone() bool { + return !page.pcc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionContainerCollectionPage) Response() ProtectionContainerCollection { + return page.pcc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionContainerCollectionPage) Values() []ProtectionContainer { + if page.pcc.IsEmpty() { + return nil + } + return *page.pcc.Value +} + +// Creates a new instance of the ProtectionContainerCollectionPage type. +func NewProtectionContainerCollectionPage(cur ProtectionContainerCollection, getNextPage func(context.Context, ProtectionContainerCollection) (ProtectionContainerCollection, error)) ProtectionContainerCollectionPage { + return ProtectionContainerCollectionPage{ + fn: getNextPage, + pcc: cur, + } +} + +// ProtectionContainerFabricSpecificDetails base class for fabric specific details of container. +type ProtectionContainerFabricSpecificDetails struct { + // InstanceType - READ-ONLY; Gets the class type. Overridden in derived classes. + InstanceType *string `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainerFabricSpecificDetails. +func (pcfsd ProtectionContainerFabricSpecificDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ProtectionContainerMapping protection container mapping object. +type ProtectionContainerMapping struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectionContainerMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainerMapping. +func (pcm ProtectionContainerMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pcm.Properties != nil { + objectMap["properties"] = pcm.Properties + } + if pcm.Location != nil { + objectMap["location"] = pcm.Location + } + return json.Marshal(objectMap) +} + +// ProtectionContainerMappingCollection protection container mapping collection class. +type ProtectionContainerMappingCollection struct { + autorest.Response `json:"-"` + // Value - List of container mappings. + Value *[]ProtectionContainerMapping `json:"value,omitempty"` + // NextLink - Link to fetch rest of the data. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectionContainerMappingCollectionIterator provides access to a complete listing of +// ProtectionContainerMapping values. +type ProtectionContainerMappingCollectionIterator struct { + i int + page ProtectionContainerMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectionContainerMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionContainerMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionContainerMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectionContainerMappingCollectionIterator) Response() ProtectionContainerMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectionContainerMappingCollectionIterator) Value() ProtectionContainerMapping { + if !iter.page.NotDone() { + return ProtectionContainerMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectionContainerMappingCollectionIterator type. +func NewProtectionContainerMappingCollectionIterator(page ProtectionContainerMappingCollectionPage) ProtectionContainerMappingCollectionIterator { + return ProtectionContainerMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcmc ProtectionContainerMappingCollection) IsEmpty() bool { + return pcmc.Value == nil || len(*pcmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pcmc ProtectionContainerMappingCollection) hasNextLink() bool { + return pcmc.NextLink != nil && len(*pcmc.NextLink) != 0 +} + +// protectionContainerMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcmc ProtectionContainerMappingCollection) protectionContainerMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pcmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcmc.NextLink))) +} + +// ProtectionContainerMappingCollectionPage contains a page of ProtectionContainerMapping values. +type ProtectionContainerMappingCollectionPage struct { + fn func(context.Context, ProtectionContainerMappingCollection) (ProtectionContainerMappingCollection, error) + pcmc ProtectionContainerMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectionContainerMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pcmc) + if err != nil { + return err + } + page.pcmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionContainerMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionContainerMappingCollectionPage) NotDone() bool { + return !page.pcmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionContainerMappingCollectionPage) Response() ProtectionContainerMappingCollection { + return page.pcmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionContainerMappingCollectionPage) Values() []ProtectionContainerMapping { + if page.pcmc.IsEmpty() { + return nil + } + return *page.pcmc.Value +} + +// Creates a new instance of the ProtectionContainerMappingCollectionPage type. +func NewProtectionContainerMappingCollectionPage(cur ProtectionContainerMappingCollection, getNextPage func(context.Context, ProtectionContainerMappingCollection) (ProtectionContainerMappingCollection, error)) ProtectionContainerMappingCollectionPage { + return ProtectionContainerMappingCollectionPage{ + fn: getNextPage, + pcmc: cur, + } +} + +// ProtectionContainerMappingProperties protection container mapping properties. +type ProtectionContainerMappingProperties struct { + // TargetProtectionContainerID - Paired protection container ARM ID. + TargetProtectionContainerID *string `json:"targetProtectionContainerId,omitempty"` + // TargetProtectionContainerFriendlyName - Friendly name of paired container. + TargetProtectionContainerFriendlyName *string `json:"targetProtectionContainerFriendlyName,omitempty"` + // ProviderSpecificDetails - Provider specific provider details. + ProviderSpecificDetails BasicProtectionContainerMappingProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` + // Health - Health of pairing. + Health *string `json:"health,omitempty"` + // HealthErrorDetails - Health error. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // PolicyID - Policy ARM Id. + PolicyID *string `json:"policyId,omitempty"` + // State - Association Status. + State *string `json:"state,omitempty"` + // SourceProtectionContainerFriendlyName - Friendly name of source protection container. + SourceProtectionContainerFriendlyName *string `json:"sourceProtectionContainerFriendlyName,omitempty"` + // SourceFabricFriendlyName - Friendly name of source fabric. + SourceFabricFriendlyName *string `json:"sourceFabricFriendlyName,omitempty"` + // TargetFabricFriendlyName - Friendly name of target fabric. + TargetFabricFriendlyName *string `json:"targetFabricFriendlyName,omitempty"` + // PolicyFriendlyName - Friendly name of replication policy. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ProtectionContainerMappingProperties struct. +func (pcmp *ProtectionContainerMappingProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetProtectionContainerId": + if v != nil { + var targetProtectionContainerID string + err = json.Unmarshal(*v, &targetProtectionContainerID) + if err != nil { + return err + } + pcmp.TargetProtectionContainerID = &targetProtectionContainerID + } + case "targetProtectionContainerFriendlyName": + if v != nil { + var targetProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &targetProtectionContainerFriendlyName) + if err != nil { + return err + } + pcmp.TargetProtectionContainerFriendlyName = &targetProtectionContainerFriendlyName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicProtectionContainerMappingProviderSpecificDetails(*v) + if err != nil { + return err + } + pcmp.ProviderSpecificDetails = providerSpecificDetails + } + case "health": + if v != nil { + var health string + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + pcmp.Health = &health + } + case "healthErrorDetails": + if v != nil { + var healthErrorDetails []HealthError + err = json.Unmarshal(*v, &healthErrorDetails) + if err != nil { + return err + } + pcmp.HealthErrorDetails = &healthErrorDetails + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + pcmp.PolicyID = &policyID + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + pcmp.State = &state + } + case "sourceProtectionContainerFriendlyName": + if v != nil { + var sourceProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &sourceProtectionContainerFriendlyName) + if err != nil { + return err + } + pcmp.SourceProtectionContainerFriendlyName = &sourceProtectionContainerFriendlyName + } + case "sourceFabricFriendlyName": + if v != nil { + var sourceFabricFriendlyName string + err = json.Unmarshal(*v, &sourceFabricFriendlyName) + if err != nil { + return err + } + pcmp.SourceFabricFriendlyName = &sourceFabricFriendlyName + } + case "targetFabricFriendlyName": + if v != nil { + var targetFabricFriendlyName string + err = json.Unmarshal(*v, &targetFabricFriendlyName) + if err != nil { + return err + } + pcmp.TargetFabricFriendlyName = &targetFabricFriendlyName + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + pcmp.PolicyFriendlyName = &policyFriendlyName + } + } + } + + return nil +} + +// BasicProtectionContainerMappingProviderSpecificDetails container mapping provider specific details. +type BasicProtectionContainerMappingProviderSpecificDetails interface { + AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) + AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) + AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) + AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) +} + +// ProtectionContainerMappingProviderSpecificDetails container mapping provider specific details. +type ProtectionContainerMappingProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicProtectionContainerMappingProviderSpecificDetails(body []byte) (BasicProtectionContainerMappingProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A): + var apcmd A2AProtectionContainerMappingDetails + err := json.Unmarshal(body, &apcmd) + return apcmd, err + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm): + var imrpcmd InMageRcmProtectionContainerMappingDetails + err := json.Unmarshal(body, &imrpcmd) + return imrpcmd, err + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt): + var vmcpcmd VMwareCbtProtectionContainerMappingDetails + err := json.Unmarshal(body, &vmcpcmd) + return vmcpcmd, err + default: + var pcmpsd ProtectionContainerMappingProviderSpecificDetails + err := json.Unmarshal(body, &pcmpsd) + return pcmpsd, err + } +} +func unmarshalBasicProtectionContainerMappingProviderSpecificDetailsArray(body []byte) ([]BasicProtectionContainerMappingProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pcmpsdArray := make([]BasicProtectionContainerMappingProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pcmpsd, err := unmarshalBasicProtectionContainerMappingProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + pcmpsdArray[index] = pcmpsd + } + return pcmpsdArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) MarshalJSON() ([]byte, error) { + pcmpsd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails + objectMap := make(map[string]interface{}) + if pcmpsd.InstanceType != "" { + objectMap["instanceType"] = pcmpsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return &pcmpsd, true +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &pcmpsd, true +} + +// ProtectionContainerProperties protection profile custom data details. +type ProtectionContainerProperties struct { + // FabricFriendlyName - Fabric friendly name. + FabricFriendlyName *string `json:"fabricFriendlyName,omitempty"` + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // FabricType - The fabric type. + FabricType *string `json:"fabricType,omitempty"` + // ProtectedItemCount - Number of protected PEs. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // PairingStatus - The pairing status of this cloud. + PairingStatus *string `json:"pairingStatus,omitempty"` + // Role - The role of this cloud. + Role *string `json:"role,omitempty"` + // FabricSpecificDetails - Fabric specific details. + FabricSpecificDetails *ProtectionContainerFabricSpecificDetails `json:"fabricSpecificDetails,omitempty"` +} + +// BasicProtectionProfileCustomDetails protection Profile custom input. +type BasicProtectionProfileCustomDetails interface { + AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) + AsNewProtectionProfile() (*NewProtectionProfile, bool) + AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) +} + +// ProtectionProfileCustomDetails protection Profile custom input. +type ProtectionProfileCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +func unmarshalBasicProtectionProfileCustomDetails(body []byte) (BasicProtectionProfileCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeExisting): + var epp ExistingProtectionProfile + err := json.Unmarshal(body, &epp) + return epp, err + case string(ResourceTypeNew): + var npp NewProtectionProfile + err := json.Unmarshal(body, &npp) + return npp, err + default: + var ppcd ProtectionProfileCustomDetails + err := json.Unmarshal(body, &ppcd) + return ppcd, err + } +} +func unmarshalBasicProtectionProfileCustomDetailsArray(body []byte) ([]BasicProtectionProfileCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppcdArray := make([]BasicProtectionProfileCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppcd, err := unmarshalBasicProtectionProfileCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + ppcdArray[index] = ppcd + } + return ppcdArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) MarshalJSON() ([]byte, error) { + ppcd.ResourceType = ResourceTypeProtectionProfileCustomDetails + objectMap := make(map[string]interface{}) + if ppcd.ResourceType != "" { + objectMap["resourceType"] = ppcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return nil, false +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return nil, false +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return &ppcd, true +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &ppcd, true +} + +// ProviderError this class contains the error details per object. +type ProviderError struct { + // ErrorCode - The Error code. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorMessage - The Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // ErrorID - The Provider error Id. + ErrorID *string `json:"errorId,omitempty"` + // PossibleCauses - The possible causes for the error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - The recommended action to resolve the error. + RecommendedAction *string `json:"recommendedAction,omitempty"` +} + +// BasicProviderSpecificRecoveryPointDetails replication provider specific recovery point details. +type BasicProviderSpecificRecoveryPointDetails interface { + AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) + AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) + AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) + AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) +} + +// ProviderSpecificRecoveryPointDetails replication provider specific recovery point details. +type ProviderSpecificRecoveryPointDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicProviderSpecificRecoveryPointDetails(body []byte) (BasicProviderSpecificRecoveryPointDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A): + var arpd A2ARecoveryPointDetails + err := json.Unmarshal(body, &arpd) + return arpd, err + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2): + var imavrpd InMageAzureV2RecoveryPointDetails + err := json.Unmarshal(body, &imavrpd) + return imavrpd, err + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm): + var imrrpd InMageRcmRecoveryPointDetails + err := json.Unmarshal(body, &imrrpd) + return imrrpd, err + default: + var psrpd ProviderSpecificRecoveryPointDetails + err := json.Unmarshal(body, &psrpd) + return psrpd, err + } +} +func unmarshalBasicProviderSpecificRecoveryPointDetailsArray(body []byte) ([]BasicProviderSpecificRecoveryPointDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + psrpdArray := make([]BasicProviderSpecificRecoveryPointDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + psrpd, err := unmarshalBasicProviderSpecificRecoveryPointDetails(*rawMessage) + if err != nil { + return nil, err + } + psrpdArray[index] = psrpd + } + return psrpdArray, nil +} + +// MarshalJSON is the custom marshaler for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) MarshalJSON() ([]byte, error) { + psrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails + objectMap := make(map[string]interface{}) + if psrpd.InstanceType != "" { + objectMap["instanceType"] = psrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return &psrpd, true +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &psrpd, true +} + +// PushInstallerDetails push installer details. +type PushInstallerDetails struct { + // ID - READ-ONLY; The push installer Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The push installer name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The push installer Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The push installer Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the push installer. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the push installer. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for PushInstallerDetails. +func (pid PushInstallerDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RcmProxyDetails RCM proxy details. +type RcmProxyDetails struct { + // ID - READ-ONLY; The RCM proxy Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The RCM proxy name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The RCM proxy Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The RCM proxy Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the RCM proxy. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the RCM proxy. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for RcmProxyDetails. +func (rpd RcmProxyDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// BasicRecoveryAvailabilitySetCustomDetails recovery Availability Set custom input. +type BasicRecoveryAvailabilitySetCustomDetails interface { + AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) + AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) +} + +// RecoveryAvailabilitySetCustomDetails recovery Availability Set custom input. +type RecoveryAvailabilitySetCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails', 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryAvailabilitySetCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryAvailabilitySetCustomDetails(body []byte) (BasicRecoveryAvailabilitySetCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting): + var eras ExistingRecoveryAvailabilitySet + err := json.Unmarshal(body, &eras) + return eras, err + default: + var rascd RecoveryAvailabilitySetCustomDetails + err := json.Unmarshal(body, &rascd) + return rascd, err + } +} +func unmarshalBasicRecoveryAvailabilitySetCustomDetailsArray(body []byte) ([]BasicRecoveryAvailabilitySetCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rascdArray := make([]BasicRecoveryAvailabilitySetCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rascd, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rascdArray[index] = rascd + } + return rascdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) MarshalJSON() ([]byte, error) { + rascd.ResourceType = ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails + objectMap := make(map[string]interface{}) + if rascd.ResourceType != "" { + objectMap["resourceType"] = rascd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryAvailabilitySet is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) { + return nil, false +} + +// AsRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) { + return &rascd, true +} + +// AsBasicRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsBasicRecoveryAvailabilitySetCustomDetails() (BasicRecoveryAvailabilitySetCustomDetails, bool) { + return &rascd, true +} + +// RecoveryPlan recovery plan details. +type RecoveryPlan struct { + autorest.Response `json:"-"` + // Properties - The custom details. + Properties *RecoveryPlanProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlan. +func (rp RecoveryPlan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.Properties != nil { + objectMap["properties"] = rp.Properties + } + if rp.Location != nil { + objectMap["location"] = rp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryPlanA2ADetails recovery plan A2A specific details. +type RecoveryPlanA2ADetails struct { + // PrimaryZone - The primary zone. + PrimaryZone *string `json:"primaryZone,omitempty"` + // RecoveryZone - The recovery zone. + RecoveryZone *string `json:"recoveryZone,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails', 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) MarshalJSON() ([]byte, error) { + rpad.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpad.PrimaryZone != nil { + objectMap["primaryZone"] = rpad.PrimaryZone + } + if rpad.RecoveryZone != nil { + objectMap["recoveryZone"] = rpad.RecoveryZone + } + if rpad.InstanceType != "" { + objectMap["instanceType"] = rpad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2ADetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) { + return &rpad, true +} + +// AsRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsBasicRecoveryPlanProviderSpecificDetails() (BasicRecoveryPlanProviderSpecificDetails, bool) { + return &rpad, true +} + +// RecoveryPlanA2AFailoverInput recovery plan A2A failover input. +type RecoveryPlanA2AFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'Latest', 'LatestApplicationConsistent', 'LatestCrashConsistent', 'LatestProcessed' + RecoveryPointType A2ARpRecoveryPointType `json:"recoveryPointType,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for TFO or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // MultiVMSyncPointOption - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. Possible values include: 'UseMultiVMSyncRecoveryPoint', 'UsePerVMRecoveryPoint' + MultiVMSyncPointOption MultiVMSyncPointOption `json:"multiVmSyncPointOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) MarshalJSON() ([]byte, error) { + rpafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpafi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpafi.RecoveryPointType + } + if rpafi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = rpafi.CloudServiceCreationOption + } + if rpafi.MultiVMSyncPointOption != "" { + objectMap["multiVmSyncPointOption"] = rpafi.MultiVMSyncPointOption + } + if rpafi.InstanceType != "" { + objectMap["instanceType"] = rpafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return &rpafi, true +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpafi, true +} + +// RecoveryPlanA2AInput recovery plan A2A input. +type RecoveryPlanA2AInput struct { + // PrimaryZone - The primary zone. + PrimaryZone *string `json:"primaryZone,omitempty"` + // RecoveryZone - The recovery zone. + RecoveryZone *string `json:"recoveryZone,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) MarshalJSON() ([]byte, error) { + rpai.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpai.PrimaryZone != nil { + objectMap["primaryZone"] = rpai.PrimaryZone + } + if rpai.RecoveryZone != nil { + objectMap["recoveryZone"] = rpai.RecoveryZone + } + if rpai.InstanceType != "" { + objectMap["instanceType"] = rpai.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) { + return &rpai, true +} + +// AsRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsBasicRecoveryPlanProviderSpecificInput() (BasicRecoveryPlanProviderSpecificInput, bool) { + return &rpai, true +} + +// RecoveryPlanAction recovery plan action details. +type RecoveryPlanAction struct { + // ActionName - The action name. + ActionName *string `json:"actionName,omitempty"` + // FailoverTypes - The list of failover types. + FailoverTypes *[]ReplicationProtectedItemOperation `json:"failoverTypes,omitempty"` + // FailoverDirections - The list of failover directions. + FailoverDirections *[]PossibleOperationsDirections `json:"failoverDirections,omitempty"` + // CustomDetails - The custom details. + CustomDetails BasicRecoveryPlanActionDetails `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanAction struct. +func (rpa *RecoveryPlanAction) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "actionName": + if v != nil { + var actionName string + err = json.Unmarshal(*v, &actionName) + if err != nil { + return err + } + rpa.ActionName = &actionName + } + case "failoverTypes": + if v != nil { + var failoverTypes []ReplicationProtectedItemOperation + err = json.Unmarshal(*v, &failoverTypes) + if err != nil { + return err + } + rpa.FailoverTypes = &failoverTypes + } + case "failoverDirections": + if v != nil { + var failoverDirections []PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirections) + if err != nil { + return err + } + rpa.FailoverDirections = &failoverDirections + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicRecoveryPlanActionDetails(*v) + if err != nil { + return err + } + rpa.CustomDetails = customDetails + } + } + } + + return nil +} + +// BasicRecoveryPlanActionDetails recovery plan action custom details. +type BasicRecoveryPlanActionDetails interface { + AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) + AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) + AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) + AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) +} + +// RecoveryPlanActionDetails recovery plan action custom details. +type RecoveryPlanActionDetails struct { + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanActionDetails(body []byte) (BasicRecoveryPlanActionDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAutomationRunbookActionDetails): + var rparad RecoveryPlanAutomationRunbookActionDetails + err := json.Unmarshal(body, &rparad) + return rparad, err + case string(InstanceTypeManualActionDetails): + var rpmad RecoveryPlanManualActionDetails + err := json.Unmarshal(body, &rpmad) + return rpmad, err + case string(InstanceTypeScriptActionDetails): + var rpsad RecoveryPlanScriptActionDetails + err := json.Unmarshal(body, &rpsad) + return rpsad, err + default: + var rpad RecoveryPlanActionDetails + err := json.Unmarshal(body, &rpad) + return rpad, err + } +} +func unmarshalBasicRecoveryPlanActionDetailsArray(body []byte) ([]BasicRecoveryPlanActionDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpadArray := make([]BasicRecoveryPlanActionDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpad, err := unmarshalBasicRecoveryPlanActionDetails(*rawMessage) + if err != nil { + return nil, err + } + rpadArray[index] = rpad + } + return rpadArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) MarshalJSON() ([]byte, error) { + rpad.InstanceType = InstanceTypeRecoveryPlanActionDetails + objectMap := make(map[string]interface{}) + if rpad.InstanceType != "" { + objectMap["instanceType"] = rpad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return &rpad, true +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpad, true +} + +// RecoveryPlanAutomationRunbookActionDetails recovery plan Automation runbook action details. +type RecoveryPlanAutomationRunbookActionDetails struct { + // RunbookID - The runbook ARM Id. + RunbookID *string `json:"runbookId,omitempty"` + // Timeout - The runbook timeout. + Timeout *string `json:"timeout,omitempty"` + // FabricLocation - The fabric location. Possible values include: 'Primary', 'Recovery' + FabricLocation RecoveryPlanActionLocation `json:"fabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) MarshalJSON() ([]byte, error) { + rparad.InstanceType = InstanceTypeAutomationRunbookActionDetails + objectMap := make(map[string]interface{}) + if rparad.RunbookID != nil { + objectMap["runbookId"] = rparad.RunbookID + } + if rparad.Timeout != nil { + objectMap["timeout"] = rparad.Timeout + } + if rparad.FabricLocation != "" { + objectMap["fabricLocation"] = rparad.FabricLocation + } + if rparad.InstanceType != "" { + objectMap["instanceType"] = rparad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return &rparad, true +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rparad, true +} + +// RecoveryPlanCollection recovery plan collection details. +type RecoveryPlanCollection struct { + autorest.Response `json:"-"` + // Value - The list of recovery plans. + Value *[]RecoveryPlan `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryPlanCollectionIterator provides access to a complete listing of RecoveryPlan values. +type RecoveryPlanCollectionIterator struct { + i int + page RecoveryPlanCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryPlanCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPlanCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryPlanCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryPlanCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryPlanCollectionIterator) Response() RecoveryPlanCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryPlanCollectionIterator) Value() RecoveryPlan { + if !iter.page.NotDone() { + return RecoveryPlan{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryPlanCollectionIterator type. +func NewRecoveryPlanCollectionIterator(page RecoveryPlanCollectionPage) RecoveryPlanCollectionIterator { + return RecoveryPlanCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (RPCVar RecoveryPlanCollection) IsEmpty() bool { + return RPCVar.Value == nil || len(*RPCVar.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (RPCVar RecoveryPlanCollection) hasNextLink() bool { + return RPCVar.NextLink != nil && len(*RPCVar.NextLink) != 0 +} + +// recoveryPlanCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (RPCVar RecoveryPlanCollection) recoveryPlanCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !RPCVar.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(RPCVar.NextLink))) +} + +// RecoveryPlanCollectionPage contains a page of RecoveryPlan values. +type RecoveryPlanCollectionPage struct { + fn func(context.Context, RecoveryPlanCollection) (RecoveryPlanCollection, error) + RPCVar RecoveryPlanCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryPlanCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPlanCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.RPCVar) + if err != nil { + return err + } + page.RPCVar = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryPlanCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryPlanCollectionPage) NotDone() bool { + return !page.RPCVar.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryPlanCollectionPage) Response() RecoveryPlanCollection { + return page.RPCVar +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryPlanCollectionPage) Values() []RecoveryPlan { + if page.RPCVar.IsEmpty() { + return nil + } + return *page.RPCVar.Value +} + +// Creates a new instance of the RecoveryPlanCollectionPage type. +func NewRecoveryPlanCollectionPage(cur RecoveryPlanCollection, getNextPage func(context.Context, RecoveryPlanCollection) (RecoveryPlanCollection, error)) RecoveryPlanCollectionPage { + return RecoveryPlanCollectionPage{ + fn: getNextPage, + RPCVar: cur, + } +} + +// RecoveryPlanGroup recovery plan group details. +type RecoveryPlanGroup struct { + // GroupType - The group type. Possible values include: 'Shutdown', 'Boot', 'Failover' + GroupType RecoveryPlanGroupType `json:"groupType,omitempty"` + // ReplicationProtectedItems - The list of protected items. + ReplicationProtectedItems *[]RecoveryPlanProtectedItem `json:"replicationProtectedItems,omitempty"` + // StartGroupActions - The start group actions. + StartGroupActions *[]RecoveryPlanAction `json:"startGroupActions,omitempty"` + // EndGroupActions - The end group actions. + EndGroupActions *[]RecoveryPlanAction `json:"endGroupActions,omitempty"` +} + +// BasicRecoveryPlanGroupTaskDetails this class represents the recovery plan group task. +type BasicRecoveryPlanGroupTaskDetails interface { + AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) + AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) +} + +// RecoveryPlanGroupTaskDetails this class represents the recovery plan group task. +type RecoveryPlanGroupTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // GroupID - The group identifier. + GroupID *string `json:"groupId,omitempty"` + // RpGroupType - The group type. + RpGroupType *string `json:"rpGroupType,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanGroupTaskDetails(body []byte) (BasicRecoveryPlanGroupTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeRecoveryPlanShutdownGroupTaskDetails): + var rpsgtd RecoveryPlanShutdownGroupTaskDetails + err := json.Unmarshal(body, &rpsgtd) + return rpsgtd, err + default: + var rpgtd RecoveryPlanGroupTaskDetails + err := json.Unmarshal(body, &rpgtd) + return rpgtd, err + } +} +func unmarshalBasicRecoveryPlanGroupTaskDetailsArray(body []byte) ([]BasicRecoveryPlanGroupTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpgtdArray := make([]BasicRecoveryPlanGroupTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpgtd, err := unmarshalBasicRecoveryPlanGroupTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + rpgtdArray[index] = rpgtd + } + return rpgtdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) MarshalJSON() ([]byte, error) { + rpgtd.InstanceType = InstanceTypeRecoveryPlanGroupTaskDetails + objectMap := make(map[string]interface{}) + if rpgtd.Name != nil { + objectMap["name"] = rpgtd.Name + } + if rpgtd.GroupID != nil { + objectMap["groupId"] = rpgtd.GroupID + } + if rpgtd.RpGroupType != nil { + objectMap["rpGroupType"] = rpgtd.RpGroupType + } + if rpgtd.ChildTasks != nil { + objectMap["childTasks"] = rpgtd.ChildTasks + } + if rpgtd.InstanceType != "" { + objectMap["instanceType"] = rpgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return &rpgtd, true +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return &rpgtd, true +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &rpgtd, true +} + +// RecoveryPlanHyperVReplicaAzureFailbackInput recovery plan HVR Azure failback input. +type RecoveryPlanHyperVReplicaAzureFailbackInput struct { + // DataSyncOption - The data sync option. Possible values include: 'ForDownTime', 'ForSynchronization' + DataSyncOption DataSyncStatus `json:"dataSyncOption,omitempty"` + // RecoveryVMCreationOption - The ALR option. Possible values include: 'CreateVMIfNotFound', 'NoAction' + RecoveryVMCreationOption AlternateLocationRecoveryOption `json:"recoveryVmCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) MarshalJSON() ([]byte, error) { + rphvrafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback + objectMap := make(map[string]interface{}) + if rphvrafi.DataSyncOption != "" { + objectMap["dataSyncOption"] = rphvrafi.DataSyncOption + } + if rphvrafi.RecoveryVMCreationOption != "" { + objectMap["recoveryVmCreationOption"] = rphvrafi.RecoveryVMCreationOption + } + if rphvrafi.InstanceType != "" { + objectMap["instanceType"] = rphvrafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return &rphvrafi, true +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rphvrafi, true +} + +// RecoveryPlanHyperVReplicaAzureFailoverInput recovery plan HVR Azure failover input. +type RecoveryPlanHyperVReplicaAzureFailoverInput struct { + // PrimaryKekCertificatePfx - The primary KEK certificate PFX. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - The secondary KEK certificate PFX. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointType - The recovery point type. Possible values include: 'HyperVReplicaAzureRpRecoveryPointTypeLatest', 'HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent', 'HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed' + RecoveryPointType HyperVReplicaAzureRpRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) MarshalJSON() ([]byte, error) { + rphvrafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if rphvrafi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = rphvrafi.PrimaryKekCertificatePfx + } + if rphvrafi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = rphvrafi.SecondaryKekCertificatePfx + } + if rphvrafi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rphvrafi.RecoveryPointType + } + if rphvrafi.InstanceType != "" { + objectMap["instanceType"] = rphvrafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return &rphvrafi, true +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rphvrafi, true +} + +// RecoveryPlanInMageAzureV2FailoverInput recovery plan InMageAzureV2 failover input. +type RecoveryPlanInMageAzureV2FailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'InMageV2RpRecoveryPointTypeLatest', 'InMageV2RpRecoveryPointTypeLatestApplicationConsistent', 'InMageV2RpRecoveryPointTypeLatestCrashConsistent', 'InMageV2RpRecoveryPointTypeLatestProcessed' + RecoveryPointType InMageV2RpRecoveryPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) MarshalJSON() ([]byte, error) { + rpimavfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if rpimavfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimavfi.RecoveryPointType + } + if rpimavfi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimavfi.UseMultiVMSyncPoint + } + if rpimavfi.InstanceType != "" { + objectMap["instanceType"] = rpimavfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return &rpimavfi, true +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimavfi, true +} + +// RecoveryPlanInMageFailoverInput recovery plan InMage failover input. +type RecoveryPlanInMageFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'RpInMageRecoveryPointTypeLatestTime', 'RpInMageRecoveryPointTypeLatestTag', 'RpInMageRecoveryPointTypeCustom' + RecoveryPointType RpInMageRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) MarshalJSON() ([]byte, error) { + rpimfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if rpimfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimfi.RecoveryPointType + } + if rpimfi.InstanceType != "" { + objectMap["instanceType"] = rpimfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return &rpimfi, true +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimfi, true +} + +// RecoveryPlanInMageRcmFailbackFailoverInput recovery plan InMageRcmFailback failover input. +type RecoveryPlanInMageRcmFailbackFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'ApplicationConsistent', 'CrashConsistent' + RecoveryPointType InMageRcmFailbackRecoveryPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) MarshalJSON() ([]byte, error) { + rpimrffi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if rpimrffi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimrffi.RecoveryPointType + } + if rpimrffi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimrffi.UseMultiVMSyncPoint + } + if rpimrffi.InstanceType != "" { + objectMap["instanceType"] = rpimrffi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return &rpimrffi, true +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimrffi, true +} + +// RecoveryPlanInMageRcmFailoverInput recovery plan InMageRcm failover input. +type RecoveryPlanInMageRcmFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'RecoveryPlanPointTypeLatest', 'RecoveryPlanPointTypeLatestApplicationConsistent', 'RecoveryPlanPointTypeLatestCrashConsistent', 'RecoveryPlanPointTypeLatestProcessed' + RecoveryPointType RecoveryPlanPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) MarshalJSON() ([]byte, error) { + rpimrfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if rpimrfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimrfi.RecoveryPointType + } + if rpimrfi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimrfi.UseMultiVMSyncPoint + } + if rpimrfi.InstanceType != "" { + objectMap["instanceType"] = rpimrfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return &rpimrfi, true +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimrfi, true +} + +// RecoveryPlanManualActionDetails recovery plan manual action details. +type RecoveryPlanManualActionDetails struct { + // Description - The manual action description. + Description *string `json:"description,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) MarshalJSON() ([]byte, error) { + rpmad.InstanceType = InstanceTypeManualActionDetails + objectMap := make(map[string]interface{}) + if rpmad.Description != nil { + objectMap["description"] = rpmad.Description + } + if rpmad.InstanceType != "" { + objectMap["instanceType"] = rpmad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return &rpmad, true +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpmad, true +} + +// RecoveryPlanPlannedFailoverInput recovery plan planned failover input. +type RecoveryPlanPlannedFailoverInput struct { + // Properties - The recovery plan planned failover input properties. + Properties *RecoveryPlanPlannedFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanPlannedFailoverInputProperties recovery plan planned failover input properties. +type RecoveryPlanPlannedFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanPlannedFailoverInputProperties struct. +func (rppfip *RecoveryPlanPlannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rppfip.FailoverDirection = failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rppfip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanProperties recovery plan properties. +type RecoveryPlanProperties struct { + // FriendlyName - The friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // PrimaryFabricID - The primary fabric Id. + PrimaryFabricID *string `json:"primaryFabricId,omitempty"` + // PrimaryFabricFriendlyName - The primary fabric friendly name. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // RecoveryFabricID - The recovery fabric Id. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // RecoveryFabricFriendlyName - The recovery fabric friendly name. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // FailoverDeploymentModel - The failover deployment model. + FailoverDeploymentModel *string `json:"failoverDeploymentModel,omitempty"` + // ReplicationProviders - The list of replication providers. + ReplicationProviders *[]string `json:"replicationProviders,omitempty"` + // AllowedOperations - The list of allowed operations. + AllowedOperations *[]string `json:"allowedOperations,omitempty"` + // LastPlannedFailoverTime - The start time of the last planned failover. + LastPlannedFailoverTime *date.Time `json:"lastPlannedFailoverTime,omitempty"` + // LastUnplannedFailoverTime - The start time of the last unplanned failover. + LastUnplannedFailoverTime *date.Time `json:"lastUnplannedFailoverTime,omitempty"` + // LastTestFailoverTime - The start time of the last test failover. + LastTestFailoverTime *date.Time `json:"lastTestFailoverTime,omitempty"` + // CurrentScenario - The current scenario details. + CurrentScenario *CurrentScenarioDetails `json:"currentScenario,omitempty"` + // CurrentScenarioStatus - The recovery plan status. + CurrentScenarioStatus *string `json:"currentScenarioStatus,omitempty"` + // CurrentScenarioStatusDescription - The recovery plan status description. + CurrentScenarioStatusDescription *string `json:"currentScenarioStatusDescription,omitempty"` + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` + // ProviderSpecificDetails - The provider id and provider specific details. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanProperties struct. +func (rpp *RecoveryPlanProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpp.FriendlyName = &friendlyName + } + case "primaryFabricId": + if v != nil { + var primaryFabricID string + err = json.Unmarshal(*v, &primaryFabricID) + if err != nil { + return err + } + rpp.PrimaryFabricID = &primaryFabricID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + rpp.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + rpp.RecoveryFabricID = &recoveryFabricID + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + rpp.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "failoverDeploymentModel": + if v != nil { + var failoverDeploymentModel string + err = json.Unmarshal(*v, &failoverDeploymentModel) + if err != nil { + return err + } + rpp.FailoverDeploymentModel = &failoverDeploymentModel + } + case "replicationProviders": + if v != nil { + var replicationProviders []string + err = json.Unmarshal(*v, &replicationProviders) + if err != nil { + return err + } + rpp.ReplicationProviders = &replicationProviders + } + case "allowedOperations": + if v != nil { + var allowedOperations []string + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + rpp.AllowedOperations = &allowedOperations + } + case "lastPlannedFailoverTime": + if v != nil { + var lastPlannedFailoverTime date.Time + err = json.Unmarshal(*v, &lastPlannedFailoverTime) + if err != nil { + return err + } + rpp.LastPlannedFailoverTime = &lastPlannedFailoverTime + } + case "lastUnplannedFailoverTime": + if v != nil { + var lastUnplannedFailoverTime date.Time + err = json.Unmarshal(*v, &lastUnplannedFailoverTime) + if err != nil { + return err + } + rpp.LastUnplannedFailoverTime = &lastUnplannedFailoverTime + } + case "lastTestFailoverTime": + if v != nil { + var lastTestFailoverTime date.Time + err = json.Unmarshal(*v, &lastTestFailoverTime) + if err != nil { + return err + } + rpp.LastTestFailoverTime = &lastTestFailoverTime + } + case "currentScenario": + if v != nil { + var currentScenario CurrentScenarioDetails + err = json.Unmarshal(*v, ¤tScenario) + if err != nil { + return err + } + rpp.CurrentScenario = ¤tScenario + } + case "currentScenarioStatus": + if v != nil { + var currentScenarioStatus string + err = json.Unmarshal(*v, ¤tScenarioStatus) + if err != nil { + return err + } + rpp.CurrentScenarioStatus = ¤tScenarioStatus + } + case "currentScenarioStatusDescription": + if v != nil { + var currentScenarioStatusDescription string + err = json.Unmarshal(*v, ¤tScenarioStatusDescription) + if err != nil { + return err + } + rpp.CurrentScenarioStatusDescription = ¤tScenarioStatusDescription + } + case "groups": + if v != nil { + var groups []RecoveryPlanGroup + err = json.Unmarshal(*v, &groups) + if err != nil { + return err + } + rpp.Groups = &groups + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificDetailsArray(*v) + if err != nil { + return err + } + rpp.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanProtectedItem recovery plan protected item. +type RecoveryPlanProtectedItem struct { + // ID - The ARM Id of the recovery plan protected item. + ID *string `json:"id,omitempty"` + // VirtualMachineID - The virtual machine Id. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` +} + +// BasicRecoveryPlanProviderSpecificDetails recovery plan provider specific details. +type BasicRecoveryPlanProviderSpecificDetails interface { + AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) + AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) +} + +// RecoveryPlanProviderSpecificDetails recovery plan provider specific details. +type RecoveryPlanProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails', 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificDetails(body []byte) (BasicRecoveryPlanProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A): + var rpad RecoveryPlanA2ADetails + err := json.Unmarshal(body, &rpad) + return rpad, err + default: + var rppsd RecoveryPlanProviderSpecificDetails + err := json.Unmarshal(body, &rppsd) + return rppsd, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificDetailsArray(body []byte) ([]BasicRecoveryPlanProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsdArray := make([]BasicRecoveryPlanProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsd, err := unmarshalBasicRecoveryPlanProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + rppsdArray[index] = rppsd + } + return rppsdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) MarshalJSON() ([]byte, error) { + rppsd.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails + objectMap := make(map[string]interface{}) + if rppsd.InstanceType != "" { + objectMap["instanceType"] = rppsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2ADetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) { + return &rppsd, true +} + +// AsBasicRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsBasicRecoveryPlanProviderSpecificDetails() (BasicRecoveryPlanProviderSpecificDetails, bool) { + return &rppsd, true +} + +// BasicRecoveryPlanProviderSpecificFailoverInput recovery plan provider specific failover input. +type BasicRecoveryPlanProviderSpecificFailoverInput interface { + AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) + AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) + AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) + AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) + AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) + AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) + AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) + AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) +} + +// RecoveryPlanProviderSpecificFailoverInput recovery plan provider specific failover input. +type RecoveryPlanProviderSpecificFailoverInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificFailoverInput(body []byte) (BasicRecoveryPlanProviderSpecificFailoverInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A): + var rpafi RecoveryPlanA2AFailoverInput + err := json.Unmarshal(body, &rpafi) + return rpafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback): + var rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput + err := json.Unmarshal(body, &rphvrafi) + return rphvrafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure): + var rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput + err := json.Unmarshal(body, &rphvrafi) + return rphvrafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2): + var rpimavfi RecoveryPlanInMageAzureV2FailoverInput + err := json.Unmarshal(body, &rpimavfi) + return rpimavfi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage): + var rpimfi RecoveryPlanInMageFailoverInput + err := json.Unmarshal(body, &rpimfi) + return rpimfi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback): + var rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput + err := json.Unmarshal(body, &rpimrffi) + return rpimrffi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm): + var rpimrfi RecoveryPlanInMageRcmFailoverInput + err := json.Unmarshal(body, &rpimrfi) + return rpimrfi, err + default: + var rppsfi RecoveryPlanProviderSpecificFailoverInput + err := json.Unmarshal(body, &rppsfi) + return rppsfi, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(body []byte) ([]BasicRecoveryPlanProviderSpecificFailoverInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsfiArray := make([]BasicRecoveryPlanProviderSpecificFailoverInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsfi, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInput(*rawMessage) + if err != nil { + return nil, err + } + rppsfiArray[index] = rppsfi + } + return rppsfiArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) MarshalJSON() ([]byte, error) { + rppsfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput + objectMap := make(map[string]interface{}) + if rppsfi.InstanceType != "" { + objectMap["instanceType"] = rppsfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return &rppsfi, true +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rppsfi, true +} + +// BasicRecoveryPlanProviderSpecificInput recovery plan provider specific input base class. +type BasicRecoveryPlanProviderSpecificInput interface { + AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) + AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) +} + +// RecoveryPlanProviderSpecificInput recovery plan provider specific input base class. +type RecoveryPlanProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificInput(body []byte) (BasicRecoveryPlanProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A): + var rpai RecoveryPlanA2AInput + err := json.Unmarshal(body, &rpai) + return rpai, err + default: + var rppsi RecoveryPlanProviderSpecificInput + err := json.Unmarshal(body, &rppsi) + return rppsi, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificInputArray(body []byte) ([]BasicRecoveryPlanProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsiArray := make([]BasicRecoveryPlanProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsi, err := unmarshalBasicRecoveryPlanProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rppsiArray[index] = rppsi + } + return rppsiArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) MarshalJSON() ([]byte, error) { + rppsi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput + objectMap := make(map[string]interface{}) + if rppsi.InstanceType != "" { + objectMap["instanceType"] = rppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) { + return &rppsi, true +} + +// AsBasicRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsBasicRecoveryPlanProviderSpecificInput() (BasicRecoveryPlanProviderSpecificInput, bool) { + return &rppsi, true +} + +// RecoveryPlanScriptActionDetails recovery plan script action details. +type RecoveryPlanScriptActionDetails struct { + // Path - The script path. + Path *string `json:"path,omitempty"` + // Timeout - The script timeout. + Timeout *string `json:"timeout,omitempty"` + // FabricLocation - The fabric location. Possible values include: 'Primary', 'Recovery' + FabricLocation RecoveryPlanActionLocation `json:"fabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) MarshalJSON() ([]byte, error) { + rpsad.InstanceType = InstanceTypeScriptActionDetails + objectMap := make(map[string]interface{}) + if rpsad.Path != nil { + objectMap["path"] = rpsad.Path + } + if rpsad.Timeout != nil { + objectMap["timeout"] = rpsad.Timeout + } + if rpsad.FabricLocation != "" { + objectMap["fabricLocation"] = rpsad.FabricLocation + } + if rpsad.InstanceType != "" { + objectMap["instanceType"] = rpsad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return &rpsad, true +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpsad, true +} + +// RecoveryPlanShutdownGroupTaskDetails this class represents the recovery plan shutdown group task +// details. +type RecoveryPlanShutdownGroupTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // GroupID - The group identifier. + GroupID *string `json:"groupId,omitempty"` + // RpGroupType - The group type. + RpGroupType *string `json:"rpGroupType,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) MarshalJSON() ([]byte, error) { + rpsgtd.InstanceType = InstanceTypeRecoveryPlanShutdownGroupTaskDetails + objectMap := make(map[string]interface{}) + if rpsgtd.Name != nil { + objectMap["name"] = rpsgtd.Name + } + if rpsgtd.GroupID != nil { + objectMap["groupId"] = rpsgtd.GroupID + } + if rpsgtd.RpGroupType != nil { + objectMap["rpGroupType"] = rpsgtd.RpGroupType + } + if rpsgtd.ChildTasks != nil { + objectMap["childTasks"] = rpsgtd.ChildTasks + } + if rpsgtd.InstanceType != "" { + objectMap["instanceType"] = rpsgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// RecoveryPlanTestFailoverCleanupInput recovery plan test failover cleanup input. +type RecoveryPlanTestFailoverCleanupInput struct { + // Properties - The recovery plan test failover cleanup input properties. + Properties *RecoveryPlanTestFailoverCleanupInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanTestFailoverCleanupInputProperties recovery plan test failover cleanup input properties. +type RecoveryPlanTestFailoverCleanupInputProperties struct { + // Comments - The test failover cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// RecoveryPlanTestFailoverInput recovery plan test failover input. +type RecoveryPlanTestFailoverInput struct { + // Properties - The recovery plan test failover input properties. + Properties *RecoveryPlanTestFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanTestFailoverInputProperties recovery plan test failover input properties. +type RecoveryPlanTestFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // NetworkType - The network type to be used for test failover. + NetworkType *string `json:"networkType,omitempty"` + // NetworkID - The Id of the network to be used for test failover. + NetworkID *string `json:"networkId,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanTestFailoverInputProperties struct. +func (rptfip *RecoveryPlanTestFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rptfip.FailoverDirection = failoverDirection + } + case "networkType": + if v != nil { + var networkType string + err = json.Unmarshal(*v, &networkType) + if err != nil { + return err + } + rptfip.NetworkType = &networkType + } + case "networkId": + if v != nil { + var networkID string + err = json.Unmarshal(*v, &networkID) + if err != nil { + return err + } + rptfip.NetworkID = &networkID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rptfip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanUnplannedFailoverInput recovery plan unplanned failover input. +type RecoveryPlanUnplannedFailoverInput struct { + // Properties - The recovery plan unplanned failover input properties. + Properties *RecoveryPlanUnplannedFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanUnplannedFailoverInputProperties recovery plan unplanned failover input properties. +type RecoveryPlanUnplannedFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // SourceSiteOperations - A value indicating whether source site operations are required. Possible values include: 'Required', 'NotRequired' + SourceSiteOperations SourceSiteOperations `json:"sourceSiteOperations,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanUnplannedFailoverInputProperties struct. +func (rpufip *RecoveryPlanUnplannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rpufip.FailoverDirection = failoverDirection + } + case "sourceSiteOperations": + if v != nil { + var sourceSiteOperations SourceSiteOperations + err = json.Unmarshal(*v, &sourceSiteOperations) + if err != nil { + return err + } + rpufip.SourceSiteOperations = sourceSiteOperations + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rpufip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPoint recovery point. +type RecoveryPoint struct { + autorest.Response `json:"-"` + // Properties - The recovery point properties. + Properties *RecoveryPointProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPoint. +func (rp RecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.Properties != nil { + objectMap["properties"] = rp.Properties + } + if rp.Location != nil { + objectMap["location"] = rp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryPointCollection collection of recovery point details. +type RecoveryPointCollection struct { + autorest.Response `json:"-"` + // Value - The recovery point details. + Value *[]RecoveryPoint `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryPointCollectionIterator provides access to a complete listing of RecoveryPoint values. +type RecoveryPointCollectionIterator struct { + i int + page RecoveryPointCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryPointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryPointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryPointCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryPointCollectionIterator) Response() RecoveryPointCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryPointCollectionIterator) Value() RecoveryPoint { + if !iter.page.NotDone() { + return RecoveryPoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryPointCollectionIterator type. +func NewRecoveryPointCollectionIterator(page RecoveryPointCollectionPage) RecoveryPointCollectionIterator { + return RecoveryPointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (RPCVar RecoveryPointCollection) IsEmpty() bool { + return RPCVar.Value == nil || len(*RPCVar.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (RPCVar RecoveryPointCollection) hasNextLink() bool { + return RPCVar.NextLink != nil && len(*RPCVar.NextLink) != 0 +} + +// recoveryPointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (RPCVar RecoveryPointCollection) recoveryPointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !RPCVar.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(RPCVar.NextLink))) +} + +// RecoveryPointCollectionPage contains a page of RecoveryPoint values. +type RecoveryPointCollectionPage struct { + fn func(context.Context, RecoveryPointCollection) (RecoveryPointCollection, error) + RPCVar RecoveryPointCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryPointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.RPCVar) + if err != nil { + return err + } + page.RPCVar = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryPointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryPointCollectionPage) NotDone() bool { + return !page.RPCVar.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryPointCollectionPage) Response() RecoveryPointCollection { + return page.RPCVar +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryPointCollectionPage) Values() []RecoveryPoint { + if page.RPCVar.IsEmpty() { + return nil + } + return *page.RPCVar.Value +} + +// Creates a new instance of the RecoveryPointCollectionPage type. +func NewRecoveryPointCollectionPage(cur RecoveryPointCollection, getNextPage func(context.Context, RecoveryPointCollection) (RecoveryPointCollection, error)) RecoveryPointCollectionPage { + return RecoveryPointCollectionPage{ + fn: getNextPage, + RPCVar: cur, + } +} + +// RecoveryPointProperties recovery point properties. +type RecoveryPointProperties struct { + // RecoveryPointTime - The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointType - The recovery point type: ApplicationConsistent, CrashConsistent. + RecoveryPointType *string `json:"recoveryPointType,omitempty"` + // ProviderSpecificDetails - The provider specific details for the recovery point. + ProviderSpecificDetails BasicProviderSpecificRecoveryPointDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPointProperties struct. +func (rpp *RecoveryPointProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryPointTime": + if v != nil { + var recoveryPointTime date.Time + err = json.Unmarshal(*v, &recoveryPointTime) + if err != nil { + return err + } + rpp.RecoveryPointTime = &recoveryPointTime + } + case "recoveryPointType": + if v != nil { + var recoveryPointType string + err = json.Unmarshal(*v, &recoveryPointType) + if err != nil { + return err + } + rpp.RecoveryPointType = &recoveryPointType + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicProviderSpecificRecoveryPointDetails(*v) + if err != nil { + return err + } + rpp.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicRecoveryProximityPlacementGroupCustomDetails recovery Proximity placement group custom input. +type BasicRecoveryProximityPlacementGroupCustomDetails interface { + AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) + AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) +} + +// RecoveryProximityPlacementGroupCustomDetails recovery Proximity placement group custom input. +type RecoveryProximityPlacementGroupCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails', 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(body []byte) (BasicRecoveryProximityPlacementGroupCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting): + var erppg ExistingRecoveryProximityPlacementGroup + err := json.Unmarshal(body, &erppg) + return erppg, err + default: + var rppgcd RecoveryProximityPlacementGroupCustomDetails + err := json.Unmarshal(body, &rppgcd) + return rppgcd, err + } +} +func unmarshalBasicRecoveryProximityPlacementGroupCustomDetailsArray(body []byte) ([]BasicRecoveryProximityPlacementGroupCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppgcdArray := make([]BasicRecoveryProximityPlacementGroupCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppgcd, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rppgcdArray[index] = rppgcd + } + return rppgcdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) MarshalJSON() ([]byte, error) { + rppgcd.ResourceType = ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails + objectMap := make(map[string]interface{}) + if rppgcd.ResourceType != "" { + objectMap["resourceType"] = rppgcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryProximityPlacementGroup is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) { + return nil, false +} + +// AsRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) { + return &rppgcd, true +} + +// AsBasicRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsBasicRecoveryProximityPlacementGroupCustomDetails() (BasicRecoveryProximityPlacementGroupCustomDetails, bool) { + return &rppgcd, true +} + +// BasicRecoveryResourceGroupCustomDetails recovery Resource Group custom input. +type BasicRecoveryResourceGroupCustomDetails interface { + AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) + AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) +} + +// RecoveryResourceGroupCustomDetails recovery Resource Group custom input. +type RecoveryResourceGroupCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails', 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryResourceGroupCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryResourceGroupCustomDetails(body []byte) (BasicRecoveryResourceGroupCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting): + var errrg ExistingRecoveryRecoveryResourceGroup + err := json.Unmarshal(body, &errrg) + return errrg, err + default: + var rrgcd RecoveryResourceGroupCustomDetails + err := json.Unmarshal(body, &rrgcd) + return rrgcd, err + } +} +func unmarshalBasicRecoveryResourceGroupCustomDetailsArray(body []byte) ([]BasicRecoveryResourceGroupCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rrgcdArray := make([]BasicRecoveryResourceGroupCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rrgcd, err := unmarshalBasicRecoveryResourceGroupCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rrgcdArray[index] = rrgcd + } + return rrgcdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) MarshalJSON() ([]byte, error) { + rrgcd.ResourceType = ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails + objectMap := make(map[string]interface{}) + if rrgcd.ResourceType != "" { + objectMap["resourceType"] = rrgcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryRecoveryResourceGroup is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) { + return nil, false +} + +// AsRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) { + return &rrgcd, true +} + +// AsBasicRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsBasicRecoveryResourceGroupCustomDetails() (BasicRecoveryResourceGroupCustomDetails, bool) { + return &rrgcd, true +} + +// RecoveryServicesProvider provider details. +type RecoveryServicesProvider struct { + autorest.Response `json:"-"` + // Properties - Provider properties. + Properties *RecoveryServicesProviderProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryServicesProvider. +func (rsp RecoveryServicesProvider) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rsp.Properties != nil { + objectMap["properties"] = rsp.Properties + } + if rsp.Location != nil { + objectMap["location"] = rsp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryServicesProviderCollection collection of providers. +type RecoveryServicesProviderCollection struct { + autorest.Response `json:"-"` + // Value - The Servers details. + Value *[]RecoveryServicesProvider `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryServicesProviderCollectionIterator provides access to a complete listing of +// RecoveryServicesProvider values. +type RecoveryServicesProviderCollectionIterator struct { + i int + page RecoveryServicesProviderCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryServicesProviderCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryServicesProviderCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryServicesProviderCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryServicesProviderCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryServicesProviderCollectionIterator) Response() RecoveryServicesProviderCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryServicesProviderCollectionIterator) Value() RecoveryServicesProvider { + if !iter.page.NotDone() { + return RecoveryServicesProvider{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryServicesProviderCollectionIterator type. +func NewRecoveryServicesProviderCollectionIterator(page RecoveryServicesProviderCollectionPage) RecoveryServicesProviderCollectionIterator { + return RecoveryServicesProviderCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rspc RecoveryServicesProviderCollection) IsEmpty() bool { + return rspc.Value == nil || len(*rspc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rspc RecoveryServicesProviderCollection) hasNextLink() bool { + return rspc.NextLink != nil && len(*rspc.NextLink) != 0 +} + +// recoveryServicesProviderCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rspc RecoveryServicesProviderCollection) recoveryServicesProviderCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rspc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rspc.NextLink))) +} + +// RecoveryServicesProviderCollectionPage contains a page of RecoveryServicesProvider values. +type RecoveryServicesProviderCollectionPage struct { + fn func(context.Context, RecoveryServicesProviderCollection) (RecoveryServicesProviderCollection, error) + rspc RecoveryServicesProviderCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryServicesProviderCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryServicesProviderCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rspc) + if err != nil { + return err + } + page.rspc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryServicesProviderCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryServicesProviderCollectionPage) NotDone() bool { + return !page.rspc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryServicesProviderCollectionPage) Response() RecoveryServicesProviderCollection { + return page.rspc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryServicesProviderCollectionPage) Values() []RecoveryServicesProvider { + if page.rspc.IsEmpty() { + return nil + } + return *page.rspc.Value +} + +// Creates a new instance of the RecoveryServicesProviderCollectionPage type. +func NewRecoveryServicesProviderCollectionPage(cur RecoveryServicesProviderCollection, getNextPage func(context.Context, RecoveryServicesProviderCollection) (RecoveryServicesProviderCollection, error)) RecoveryServicesProviderCollectionPage { + return RecoveryServicesProviderCollectionPage{ + fn: getNextPage, + rspc: cur, + } +} + +// RecoveryServicesProviderProperties recovery services provider properties. +type RecoveryServicesProviderProperties struct { + // FabricType - Type of the site. + FabricType *string `json:"fabricType,omitempty"` + // FriendlyName - Friendly name of the DRA. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProviderVersion - The provider version. + ProviderVersion *string `json:"providerVersion,omitempty"` + // ServerVersion - The fabric provider. + ServerVersion *string `json:"serverVersion,omitempty"` + // ProviderVersionState - DRA version status. + ProviderVersionState *string `json:"providerVersionState,omitempty"` + // ProviderVersionExpiryDate - Expiry date of the version. + ProviderVersionExpiryDate *date.Time `json:"providerVersionExpiryDate,omitempty"` + // FabricFriendlyName - The fabric friendly name. + FabricFriendlyName *string `json:"fabricFriendlyName,omitempty"` + // LastHeartBeat - Time when last heartbeat was sent by the DRA. + LastHeartBeat *date.Time `json:"lastHeartBeat,omitempty"` + // ConnectionStatus - A value indicating whether DRA is responsive. + ConnectionStatus *string `json:"connectionStatus,omitempty"` + // ProtectedItemCount - Number of protected VMs currently managed by the DRA. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // AllowedScenarios - The scenarios allowed on this provider. + AllowedScenarios *[]string `json:"allowedScenarios,omitempty"` + // HealthErrorDetails - The recovery services provider health error details. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // DraIdentifier - The DRA Id. + DraIdentifier *string `json:"draIdentifier,omitempty"` + // MachineID - The machine Id. + MachineID *string `json:"machineId,omitempty"` + // MachineName - The machine name. + MachineName *string `json:"machineName,omitempty"` + // BiosID - The Bios Id. + BiosID *string `json:"biosId,omitempty"` + // AuthenticationIdentityDetails - The authentication identity details. + AuthenticationIdentityDetails *IdentityProviderDetails `json:"authenticationIdentityDetails,omitempty"` + // ResourceAccessIdentityDetails - The resource access identity details. + ResourceAccessIdentityDetails *IdentityProviderDetails `json:"resourceAccessIdentityDetails,omitempty"` + // DataPlaneAuthenticationIdentityDetails - The data plane authentication identity details. + DataPlaneAuthenticationIdentityDetails *IdentityProviderDetails `json:"dataPlaneAuthenticationIdentityDetails,omitempty"` + // ProviderVersionDetails - The provider version details. + ProviderVersionDetails *VersionDetails `json:"providerVersionDetails,omitempty"` +} + +// BasicRecoveryVirtualNetworkCustomDetails recovery Virtual network custom input. +type BasicRecoveryVirtualNetworkCustomDetails interface { + AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) + AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) + AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) +} + +// RecoveryVirtualNetworkCustomDetails recovery Virtual network custom input. +type RecoveryVirtualNetworkCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryVirtualNetworkCustomDetails(body []byte) (BasicRecoveryVirtualNetworkCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting): + var ervn ExistingRecoveryVirtualNetwork + err := json.Unmarshal(body, &ervn) + return ervn, err + case string(ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew): + var nrvn NewRecoveryVirtualNetwork + err := json.Unmarshal(body, &nrvn) + return nrvn, err + default: + var rvncd RecoveryVirtualNetworkCustomDetails + err := json.Unmarshal(body, &rvncd) + return rvncd, err + } +} +func unmarshalBasicRecoveryVirtualNetworkCustomDetailsArray(body []byte) ([]BasicRecoveryVirtualNetworkCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rvncdArray := make([]BasicRecoveryVirtualNetworkCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rvncd, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rvncdArray[index] = rvncd + } + return rvncdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) MarshalJSON() ([]byte, error) { + rvncd.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails + objectMap := make(map[string]interface{}) + if rvncd.ResourceType != "" { + objectMap["resourceType"] = rvncd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return &rvncd, true +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &rvncd, true +} + +// RemoveDisksInput input for remove disk(s) operation. +type RemoveDisksInput struct { + // Properties - Remove disk input properties. + Properties *RemoveDisksInputProperties `json:"properties,omitempty"` +} + +// RemoveDisksInputProperties remove Disk input properties. +type RemoveDisksInputProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicRemoveDisksProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RemoveDisksInputProperties struct. +func (rdip *RemoveDisksInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRemoveDisksProviderSpecificInput(*v) + if err != nil { + return err + } + rdip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicRemoveDisksProviderSpecificInput remove Disk provider specific input. +type BasicRemoveDisksProviderSpecificInput interface { + AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) + AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) +} + +// RemoveDisksProviderSpecificInput remove Disk provider specific input. +type RemoveDisksProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput', 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRemoveDisksProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRemoveDisksProviderSpecificInput(body []byte) (BasicRemoveDisksProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A): + var ardi A2ARemoveDisksInput + err := json.Unmarshal(body, &ardi) + return ardi, err + default: + var rdpsi RemoveDisksProviderSpecificInput + err := json.Unmarshal(body, &rdpsi) + return rdpsi, err + } +} +func unmarshalBasicRemoveDisksProviderSpecificInputArray(body []byte) ([]BasicRemoveDisksProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rdpsiArray := make([]BasicRemoveDisksProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rdpsi, err := unmarshalBasicRemoveDisksProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rdpsiArray[index] = rdpsi + } + return rdpsiArray, nil +} + +// MarshalJSON is the custom marshaler for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) MarshalJSON() ([]byte, error) { + rdpsi.InstanceType = InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput + objectMap := make(map[string]interface{}) + if rdpsi.InstanceType != "" { + objectMap["instanceType"] = rdpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARemoveDisksInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) { + return nil, false +} + +// AsRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) { + return &rdpsi, true +} + +// AsBasicRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsBasicRemoveDisksProviderSpecificInput() (BasicRemoveDisksProviderSpecificInput, bool) { + return &rdpsi, true +} + +// RemoveProtectionContainerMappingInput container unpairing input. +type RemoveProtectionContainerMappingInput struct { + // Properties - Configure protection input properties. + Properties *RemoveProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// RemoveProtectionContainerMappingInputProperties unpairing input properties. +type RemoveProtectionContainerMappingInputProperties struct { + // ProviderSpecificInput - Provider specific input for unpairing. + ProviderSpecificInput *ReplicationProviderContainerUnmappingInput `json:"providerSpecificInput,omitempty"` +} + +// RenewCertificateInput certificate renewal input. +type RenewCertificateInput struct { + // Properties - Renew certificate input properties. + Properties *RenewCertificateInputProperties `json:"properties,omitempty"` +} + +// RenewCertificateInputProperties renew Certificate input properties. +type RenewCertificateInputProperties struct { + // RenewCertificateType - Renew certificate type. + RenewCertificateType *string `json:"renewCertificateType,omitempty"` +} + +// ReplicationAgentDetails replication agent details. +type ReplicationAgentDetails struct { + // ID - READ-ONLY; The replication agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The replication agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The replication agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The replication agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the replication agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the replication agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationAgentDetails. +func (rad ReplicationAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ReplicationEligibilityResults replication eligibility results response model. +type ReplicationEligibilityResults struct { + autorest.Response `json:"-"` + // Name - READ-ONLY; Gets the name of this object. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets the object type. + Type *string `json:"type,omitempty"` + // ID - READ-ONLY; Gets Unique ARM identifier for this object. + ID *string `json:"id,omitempty"` + // Properties - READ-ONLY; Gets properties model for replication eligibility results API. + Properties *ReplicationEligibilityResultsProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResults. +func (rer ReplicationEligibilityResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ReplicationEligibilityResultsCollection replication eligibility results collection response model. +type ReplicationEligibilityResultsCollection struct { + autorest.Response `json:"-"` + // Value - The replication eligibility results details. + Value *[]ReplicationEligibilityResults `json:"value,omitempty"` +} + +// ReplicationEligibilityResultsErrorInfo error model that can be exposed to the user. +type ReplicationEligibilityResultsErrorInfo struct { + // Code - The error code. + Code *string `json:"code,omitempty"` + // Message - The error message. + Message *string `json:"message,omitempty"` + // PossibleCauses - The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // Status - READ-ONLY; The error status. + Status *string `json:"status,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResultsErrorInfo. +func (rerei ReplicationEligibilityResultsErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rerei.Code != nil { + objectMap["code"] = rerei.Code + } + if rerei.Message != nil { + objectMap["message"] = rerei.Message + } + if rerei.PossibleCauses != nil { + objectMap["possibleCauses"] = rerei.PossibleCauses + } + if rerei.RecommendedAction != nil { + objectMap["recommendedAction"] = rerei.RecommendedAction + } + return json.Marshal(objectMap) +} + +// ReplicationEligibilityResultsProperties properties model for replication eligibility results API. +type ReplicationEligibilityResultsProperties struct { + // ClientRequestID - READ-ONLY; The client request Id. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // Errors - The error details. + Errors *[]ReplicationEligibilityResultsErrorInfo `json:"errors,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResultsProperties. +func (rerp ReplicationEligibilityResultsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rerp.Errors != nil { + objectMap["errors"] = rerp.Errors + } + return json.Marshal(objectMap) +} + +// ReplicationFabricsCheckConsistencyFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsCheckConsistencyFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsCheckConsistencyFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsCheckConsistencyFuture.Result. +func (future *ReplicationFabricsCheckConsistencyFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCheckConsistencyFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsCheckConsistencyFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.CheckConsistencyResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCheckConsistencyFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsCreateFuture.Result. +func (future *ReplicationFabricsCreateFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.CreateResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCreateFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsDeleteFuture.Result. +func (future *ReplicationFabricsDeleteFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsMigrateToAadFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsMigrateToAadFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsMigrateToAadFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsMigrateToAadFuture.Result. +func (future *ReplicationFabricsMigrateToAadFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsMigrateToAadFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsMigrateToAadFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsPurgeFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationFabricsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsPurgeFuture.Result. +func (future *ReplicationFabricsPurgeFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsReassociateGatewayFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsReassociateGatewayFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsReassociateGatewayFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsReassociateGatewayFuture.Result. +func (future *ReplicationFabricsReassociateGatewayFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsReassociateGatewayFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsReassociateGatewayFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.ReassociateGatewayResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsReassociateGatewayFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsRenewCertificateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsRenewCertificateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsRenewCertificateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsRenewCertificateFuture.Result. +func (future *ReplicationFabricsRenewCertificateFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsRenewCertificateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsRenewCertificateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.RenewCertificateResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsRenewCertificateFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationGroupDetails replication group details. This will be used in case of San. +type ReplicationGroupDetails struct { + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) MarshalJSON() ([]byte, error) { + rgd.InstanceType = InstanceTypeReplicationGroupDetails + objectMap := make(map[string]interface{}) + if rgd.InstanceType != "" { + objectMap["instanceType"] = rgd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return &rgd, true +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &rgd, true +} + +// ReplicationJobsCancelFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsCancelFuture.Result. +func (future *ReplicationJobsCancelFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.CancelResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsCancelFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsExportFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsExportFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsExportFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsExportFuture.Result. +func (future *ReplicationJobsExportFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsExportFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsExportFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.ExportResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsExportFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsRestartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsRestartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsRestartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsRestartFuture.Result. +func (future *ReplicationJobsRestartFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsRestartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsRestartFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.RestartResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsRestartFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsResumeFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsResumeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsResumeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsResumeFuture.Result. +func (future *ReplicationJobsResumeFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsResumeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsResumeFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.ResumeResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsResumeFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsCreateFuture.Result. +func (future *ReplicationMigrationItemsCreateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.CreateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsCreateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsDeleteFuture.Result. +func (future *ReplicationMigrationItemsDeleteFuture) result(client ReplicationMigrationItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationMigrationItemsMigrateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsMigrateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsMigrateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsMigrateFuture.Result. +func (future *ReplicationMigrationItemsMigrateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsMigrateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsMigrateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.MigrateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsMigrateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsResyncFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsResyncFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsResyncFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsResyncFuture.Result. +func (future *ReplicationMigrationItemsResyncFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsResyncFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsResyncFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.ResyncResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsResyncFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsTestMigrateCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationMigrationItemsTestMigrateCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsTestMigrateCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsTestMigrateCleanupFuture.Result. +func (future *ReplicationMigrationItemsTestMigrateCleanupFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.TestMigrateCleanupResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsTestMigrateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsTestMigrateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsTestMigrateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsTestMigrateFuture.Result. +func (future *ReplicationMigrationItemsTestMigrateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsTestMigrateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.TestMigrateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsUpdateFuture.Result. +func (future *ReplicationMigrationItemsUpdateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.UpdateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsUpdateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationNetworkMappingsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (NetworkMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsCreateFuture.Result. +func (future *ReplicationNetworkMappingsCreateFuture) result(client ReplicationNetworkMappingsClient) (nm NetworkMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + nm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nm.Response.Response, err = future.GetResult(sender); err == nil && nm.Response.Response.StatusCode != http.StatusNoContent { + nm, err = client.CreateResponder(nm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsCreateFuture", "Result", nm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationNetworkMappingsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsDeleteFuture.Result. +func (future *ReplicationNetworkMappingsDeleteFuture) result(client ReplicationNetworkMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationNetworkMappingsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (NetworkMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsUpdateFuture.Result. +func (future *ReplicationNetworkMappingsUpdateFuture) result(client ReplicationNetworkMappingsClient) (nm NetworkMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + nm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nm.Response.Response, err = future.GetResult(sender); err == nil && nm.Response.Response.StatusCode != http.StatusNoContent { + nm, err = client.UpdateResponder(nm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsUpdateFuture", "Result", nm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationPoliciesCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (Policy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesCreateFuture.Result. +func (future *ReplicationPoliciesCreateFuture) result(client ReplicationPoliciesClient) (p Policy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + p.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.CreateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesCreateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesDeleteFuture.Result. +func (future *ReplicationPoliciesDeleteFuture) result(client ReplicationPoliciesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationPoliciesUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (Policy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesUpdateFuture.Result. +func (future *ReplicationPoliciesUpdateFuture) result(client ReplicationPoliciesClient) (p Policy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + p.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.UpdateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesUpdateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItem replication protected item. +type ReplicationProtectedItem struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ReplicationProtectedItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectedItem. +func (rpi ReplicationProtectedItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpi.Properties != nil { + objectMap["properties"] = rpi.Properties + } + if rpi.Location != nil { + objectMap["location"] = rpi.Location + } + return json.Marshal(objectMap) +} + +// ReplicationProtectedItemCollection replication protected item collection. +type ReplicationProtectedItemCollection struct { + autorest.Response `json:"-"` + // Value - The Replication protected item details. + Value *[]ReplicationProtectedItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ReplicationProtectedItemCollectionIterator provides access to a complete listing of +// ReplicationProtectedItem values. +type ReplicationProtectedItemCollectionIterator struct { + i int + page ReplicationProtectedItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ReplicationProtectedItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ReplicationProtectedItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ReplicationProtectedItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ReplicationProtectedItemCollectionIterator) Response() ReplicationProtectedItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ReplicationProtectedItemCollectionIterator) Value() ReplicationProtectedItem { + if !iter.page.NotDone() { + return ReplicationProtectedItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ReplicationProtectedItemCollectionIterator type. +func NewReplicationProtectedItemCollectionIterator(page ReplicationProtectedItemCollectionPage) ReplicationProtectedItemCollectionIterator { + return ReplicationProtectedItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rpic ReplicationProtectedItemCollection) IsEmpty() bool { + return rpic.Value == nil || len(*rpic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rpic ReplicationProtectedItemCollection) hasNextLink() bool { + return rpic.NextLink != nil && len(*rpic.NextLink) != 0 +} + +// replicationProtectedItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rpic ReplicationProtectedItemCollection) replicationProtectedItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rpic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rpic.NextLink))) +} + +// ReplicationProtectedItemCollectionPage contains a page of ReplicationProtectedItem values. +type ReplicationProtectedItemCollectionPage struct { + fn func(context.Context, ReplicationProtectedItemCollection) (ReplicationProtectedItemCollection, error) + rpic ReplicationProtectedItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ReplicationProtectedItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rpic) + if err != nil { + return err + } + page.rpic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ReplicationProtectedItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ReplicationProtectedItemCollectionPage) NotDone() bool { + return !page.rpic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ReplicationProtectedItemCollectionPage) Response() ReplicationProtectedItemCollection { + return page.rpic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ReplicationProtectedItemCollectionPage) Values() []ReplicationProtectedItem { + if page.rpic.IsEmpty() { + return nil + } + return *page.rpic.Value +} + +// Creates a new instance of the ReplicationProtectedItemCollectionPage type. +func NewReplicationProtectedItemCollectionPage(cur ReplicationProtectedItemCollection, getNextPage func(context.Context, ReplicationProtectedItemCollection) (ReplicationProtectedItemCollection, error)) ReplicationProtectedItemCollectionPage { + return ReplicationProtectedItemCollectionPage{ + fn: getNextPage, + rpic: cur, + } +} + +// ReplicationProtectedItemProperties replication protected item custom data details. +type ReplicationProtectedItemProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectedItemType - The type of protected item type. + ProtectedItemType *string `json:"protectedItemType,omitempty"` + // ProtectableItemID - The protected item ARM Id. + ProtectableItemID *string `json:"protectableItemId,omitempty"` + // RecoveryServicesProviderID - The recovery provider ARM Id. + RecoveryServicesProviderID *string `json:"recoveryServicesProviderId,omitempty"` + // PrimaryFabricFriendlyName - The friendly name of the primary fabric. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // PrimaryFabricProvider - The fabric provider of the primary fabric. + PrimaryFabricProvider *string `json:"primaryFabricProvider,omitempty"` + // RecoveryFabricFriendlyName - The friendly name of recovery fabric. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // RecoveryFabricID - The Arm Id of recovery fabric. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // PrimaryProtectionContainerFriendlyName - The name of primary protection container friendly name. + PrimaryProtectionContainerFriendlyName *string `json:"primaryProtectionContainerFriendlyName,omitempty"` + // RecoveryProtectionContainerFriendlyName - The name of recovery container friendly name. + RecoveryProtectionContainerFriendlyName *string `json:"recoveryProtectionContainerFriendlyName,omitempty"` + // ProtectionState - The protection status. + ProtectionState *string `json:"protectionState,omitempty"` + // ProtectionStateDescription - The protection state description. + ProtectionStateDescription *string `json:"protectionStateDescription,omitempty"` + // ActiveLocation - The Current active location of the PE. + ActiveLocation *string `json:"activeLocation,omitempty"` + // TestFailoverState - The Test failover state. + TestFailoverState *string `json:"testFailoverState,omitempty"` + // TestFailoverStateDescription - The Test failover state description. + TestFailoverStateDescription *string `json:"testFailoverStateDescription,omitempty"` + // AllowedOperations - The allowed operations on the Replication protected item. + AllowedOperations *[]string `json:"allowedOperations,omitempty"` + // ReplicationHealth - 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 `json:"replicationHealth,omitempty"` + // FailoverHealth - The consolidated failover health for the VM. + FailoverHealth *string `json:"failoverHealth,omitempty"` + // HealthErrors - List of health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // PolicyID - The ID of Policy governing this PE. + PolicyID *string `json:"policyId,omitempty"` + // PolicyFriendlyName - The name of Policy governing this PE. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` + // LastSuccessfulFailoverTime - The Last successful failover time. + LastSuccessfulFailoverTime *date.Time `json:"lastSuccessfulFailoverTime,omitempty"` + // LastSuccessfulTestFailoverTime - The Last successful test failover time. + LastSuccessfulTestFailoverTime *date.Time `json:"lastSuccessfulTestFailoverTime,omitempty"` + // CurrentScenario - The current scenario. + CurrentScenario *CurrentScenarioDetails `json:"currentScenario,omitempty"` + // FailoverRecoveryPointID - The recovery point ARM Id to which the Vm was failed over. + FailoverRecoveryPointID *string `json:"failoverRecoveryPointId,omitempty"` + // ProviderSpecificDetails - The Replication provider custom settings. + ProviderSpecificDetails BasicReplicationProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // EventCorrelationID - The correlation Id for events associated with this protected item. + EventCorrelationID *string `json:"eventCorrelationId,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ReplicationProtectedItemProperties struct. +func (rpip *ReplicationProtectedItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpip.FriendlyName = &friendlyName + } + case "protectedItemType": + if v != nil { + var protectedItemType string + err = json.Unmarshal(*v, &protectedItemType) + if err != nil { + return err + } + rpip.ProtectedItemType = &protectedItemType + } + case "protectableItemId": + if v != nil { + var protectableItemID string + err = json.Unmarshal(*v, &protectableItemID) + if err != nil { + return err + } + rpip.ProtectableItemID = &protectableItemID + } + case "recoveryServicesProviderId": + if v != nil { + var recoveryServicesProviderID string + err = json.Unmarshal(*v, &recoveryServicesProviderID) + if err != nil { + return err + } + rpip.RecoveryServicesProviderID = &recoveryServicesProviderID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + rpip.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "primaryFabricProvider": + if v != nil { + var primaryFabricProvider string + err = json.Unmarshal(*v, &primaryFabricProvider) + if err != nil { + return err + } + rpip.PrimaryFabricProvider = &primaryFabricProvider + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + rpip.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + rpip.RecoveryFabricID = &recoveryFabricID + } + case "primaryProtectionContainerFriendlyName": + if v != nil { + var primaryProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &primaryProtectionContainerFriendlyName) + if err != nil { + return err + } + rpip.PrimaryProtectionContainerFriendlyName = &primaryProtectionContainerFriendlyName + } + case "recoveryProtectionContainerFriendlyName": + if v != nil { + var recoveryProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &recoveryProtectionContainerFriendlyName) + if err != nil { + return err + } + rpip.RecoveryProtectionContainerFriendlyName = &recoveryProtectionContainerFriendlyName + } + case "protectionState": + if v != nil { + var protectionState string + err = json.Unmarshal(*v, &protectionState) + if err != nil { + return err + } + rpip.ProtectionState = &protectionState + } + case "protectionStateDescription": + if v != nil { + var protectionStateDescription string + err = json.Unmarshal(*v, &protectionStateDescription) + if err != nil { + return err + } + rpip.ProtectionStateDescription = &protectionStateDescription + } + case "activeLocation": + if v != nil { + var activeLocation string + err = json.Unmarshal(*v, &activeLocation) + if err != nil { + return err + } + rpip.ActiveLocation = &activeLocation + } + case "testFailoverState": + if v != nil { + var testFailoverState string + err = json.Unmarshal(*v, &testFailoverState) + if err != nil { + return err + } + rpip.TestFailoverState = &testFailoverState + } + case "testFailoverStateDescription": + if v != nil { + var testFailoverStateDescription string + err = json.Unmarshal(*v, &testFailoverStateDescription) + if err != nil { + return err + } + rpip.TestFailoverStateDescription = &testFailoverStateDescription + } + case "allowedOperations": + if v != nil { + var allowedOperations []string + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + rpip.AllowedOperations = &allowedOperations + } + case "replicationHealth": + if v != nil { + var replicationHealth string + err = json.Unmarshal(*v, &replicationHealth) + if err != nil { + return err + } + rpip.ReplicationHealth = &replicationHealth + } + case "failoverHealth": + if v != nil { + var failoverHealth string + err = json.Unmarshal(*v, &failoverHealth) + if err != nil { + return err + } + rpip.FailoverHealth = &failoverHealth + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + rpip.HealthErrors = &healthErrors + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + rpip.PolicyID = &policyID + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + rpip.PolicyFriendlyName = &policyFriendlyName + } + case "lastSuccessfulFailoverTime": + if v != nil { + var lastSuccessfulFailoverTime date.Time + err = json.Unmarshal(*v, &lastSuccessfulFailoverTime) + if err != nil { + return err + } + rpip.LastSuccessfulFailoverTime = &lastSuccessfulFailoverTime + } + case "lastSuccessfulTestFailoverTime": + if v != nil { + var lastSuccessfulTestFailoverTime date.Time + err = json.Unmarshal(*v, &lastSuccessfulTestFailoverTime) + if err != nil { + return err + } + rpip.LastSuccessfulTestFailoverTime = &lastSuccessfulTestFailoverTime + } + case "currentScenario": + if v != nil { + var currentScenario CurrentScenarioDetails + err = json.Unmarshal(*v, ¤tScenario) + if err != nil { + return err + } + rpip.CurrentScenario = ¤tScenario + } + case "failoverRecoveryPointId": + if v != nil { + var failoverRecoveryPointID string + err = json.Unmarshal(*v, &failoverRecoveryPointID) + if err != nil { + return err + } + rpip.FailoverRecoveryPointID = &failoverRecoveryPointID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReplicationProviderSpecificSettings(*v) + if err != nil { + return err + } + rpip.ProviderSpecificDetails = providerSpecificDetails + } + case "recoveryContainerId": + if v != nil { + var recoveryContainerID string + err = json.Unmarshal(*v, &recoveryContainerID) + if err != nil { + return err + } + rpip.RecoveryContainerID = &recoveryContainerID + } + case "eventCorrelationId": + if v != nil { + var eventCorrelationID string + err = json.Unmarshal(*v, &eventCorrelationID) + if err != nil { + return err + } + rpip.EventCorrelationID = &eventCorrelationID + } + } + } + + return nil +} + +// ReplicationProtectedItemsAddDisksFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsAddDisksFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsAddDisksFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsAddDisksFuture.Result. +func (future *ReplicationProtectedItemsAddDisksFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsAddDisksFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsAddDisksFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.AddDisksResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsAddDisksFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsApplyRecoveryPointFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsApplyRecoveryPointFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsApplyRecoveryPointFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsApplyRecoveryPointFuture.Result. +func (future *ReplicationProtectedItemsApplyRecoveryPointFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ApplyRecoveryPointResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsCreateFuture.Result. +func (future *ReplicationProtectedItemsCreateFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.CreateResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsCreateFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsDeleteFuture.Result. +func (future *ReplicationProtectedItemsDeleteFuture) result(client ReplicationProtectedItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectedItemsFailoverCancelFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsFailoverCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsFailoverCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsFailoverCancelFuture.Result. +func (future *ReplicationProtectedItemsFailoverCancelFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsFailoverCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.FailoverCancelResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCancelFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsFailoverCommitFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsFailoverCommitFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsFailoverCommitFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsFailoverCommitFuture.Result. +func (future *ReplicationProtectedItemsFailoverCommitFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCommitFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsFailoverCommitFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.FailoverCommitResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCommitFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsPlannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsPlannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsPlannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsPlannedFailoverFuture.Result. +func (future *ReplicationProtectedItemsPlannedFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPlannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsPlannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.PlannedFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPlannedFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsPurgeFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsPurgeFuture.Result. +func (future *ReplicationProtectedItemsPurgeFuture) result(client ReplicationProtectedItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectedItemsRemoveDisksFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsRemoveDisksFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsRemoveDisksFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsRemoveDisksFuture.Result. +func (future *ReplicationProtectedItemsRemoveDisksFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRemoveDisksFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsRemoveDisksFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.RemoveDisksResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRemoveDisksFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsRepairReplicationFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsRepairReplicationFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsRepairReplicationFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsRepairReplicationFuture.Result. +func (future *ReplicationProtectedItemsRepairReplicationFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRepairReplicationFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsRepairReplicationFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.RepairReplicationResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRepairReplicationFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsReprotectFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsReprotectFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsReprotectFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsReprotectFuture.Result. +func (future *ReplicationProtectedItemsReprotectFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsReprotectFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsReprotectFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ReprotectResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsReprotectFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsResolveHealthErrorsFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsResolveHealthErrorsFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsResolveHealthErrorsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsResolveHealthErrorsFuture.Result. +func (future *ReplicationProtectedItemsResolveHealthErrorsFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ResolveHealthErrorsResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsTestFailoverCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsTestFailoverCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsTestFailoverCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsTestFailoverCleanupFuture.Result. +func (future *ReplicationProtectedItemsTestFailoverCleanupFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.TestFailoverCleanupResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsTestFailoverFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectedItemsTestFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsTestFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsTestFailoverFuture.Result. +func (future *ReplicationProtectedItemsTestFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsTestFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.TestFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUnplannedFailoverFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsUnplannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUnplannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUnplannedFailoverFuture.Result. +func (future *ReplicationProtectedItemsUnplannedFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UnplannedFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateFuture.Result. +func (future *ReplicationProtectedItemsUpdateFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateMobilityServiceFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsUpdateMobilityServiceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateMobilityServiceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateMobilityServiceFuture.Result. +func (future *ReplicationProtectedItemsUpdateMobilityServiceFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateMobilityServiceResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainerMappingsCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (ProtectionContainerMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsCreateFuture.Result. +func (future *ReplicationProtectionContainerMappingsCreateFuture) result(client ReplicationProtectionContainerMappingsClient) (pcm ProtectionContainerMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pcm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pcm.Response.Response, err = future.GetResult(sender); err == nil && pcm.Response.Response.StatusCode != http.StatusNoContent { + pcm, err = client.CreateResponder(pcm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsCreateFuture", "Result", pcm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainerMappingsDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsDeleteFuture.Result. +func (future *ReplicationProtectionContainerMappingsDeleteFuture) result(client ReplicationProtectionContainerMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainerMappingsPurgeFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsPurgeFuture.Result. +func (future *ReplicationProtectionContainerMappingsPurgeFuture) result(client ReplicationProtectionContainerMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainerMappingsUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (ProtectionContainerMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsUpdateFuture.Result. +func (future *ReplicationProtectionContainerMappingsUpdateFuture) result(client ReplicationProtectionContainerMappingsClient) (pcm ProtectionContainerMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pcm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pcm.Response.Response, err = future.GetResult(sender); err == nil && pcm.Response.Response.StatusCode != http.StatusNoContent { + pcm, err = client.UpdateResponder(pcm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsUpdateFuture", "Result", pcm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersCreateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectionContainersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersCreateFuture.Result. +func (future *ReplicationProtectionContainersCreateFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.CreateResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersCreateFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersDeleteFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectionContainersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersDeleteFuture.Result. +func (future *ReplicationProtectionContainersDeleteFuture) result(client ReplicationProtectionContainersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainersDiscoverProtectableItemFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type ReplicationProtectionContainersDiscoverProtectableItemFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersDiscoverProtectableItemFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersDiscoverProtectableItemFuture.Result. +func (future *ReplicationProtectionContainersDiscoverProtectableItemFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.DiscoverProtectableItemResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersSwitchProtectionFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainersSwitchProtectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersSwitchProtectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersSwitchProtectionFuture.Result. +func (future *ReplicationProtectionContainersSwitchProtectionFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersSwitchProtectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersSwitchProtectionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.SwitchProtectionResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersSwitchProtectionFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionIntent replication protection intent. +type ReplicationProtectionIntent struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ReplicationProtectionIntentProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntent. +func (rpi ReplicationProtectionIntent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpi.Properties != nil { + objectMap["properties"] = rpi.Properties + } + if rpi.Location != nil { + objectMap["location"] = rpi.Location + } + return json.Marshal(objectMap) +} + +// ReplicationProtectionIntentCollection replication protection intent objects collection. +type ReplicationProtectionIntentCollection struct { + autorest.Response `json:"-"` + // Value - The Replication protection intent details. + Value *[]ReplicationProtectionIntent `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ReplicationProtectionIntentCollectionIterator provides access to a complete listing of +// ReplicationProtectionIntent values. +type ReplicationProtectionIntentCollectionIterator struct { + i int + page ReplicationProtectionIntentCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ReplicationProtectionIntentCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ReplicationProtectionIntentCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ReplicationProtectionIntentCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ReplicationProtectionIntentCollectionIterator) Response() ReplicationProtectionIntentCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ReplicationProtectionIntentCollectionIterator) Value() ReplicationProtectionIntent { + if !iter.page.NotDone() { + return ReplicationProtectionIntent{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ReplicationProtectionIntentCollectionIterator type. +func NewReplicationProtectionIntentCollectionIterator(page ReplicationProtectionIntentCollectionPage) ReplicationProtectionIntentCollectionIterator { + return ReplicationProtectionIntentCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rpic ReplicationProtectionIntentCollection) IsEmpty() bool { + return rpic.Value == nil || len(*rpic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rpic ReplicationProtectionIntentCollection) hasNextLink() bool { + return rpic.NextLink != nil && len(*rpic.NextLink) != 0 +} + +// replicationProtectionIntentCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rpic ReplicationProtectionIntentCollection) replicationProtectionIntentCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rpic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rpic.NextLink))) +} + +// ReplicationProtectionIntentCollectionPage contains a page of ReplicationProtectionIntent values. +type ReplicationProtectionIntentCollectionPage struct { + fn func(context.Context, ReplicationProtectionIntentCollection) (ReplicationProtectionIntentCollection, error) + rpic ReplicationProtectionIntentCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ReplicationProtectionIntentCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rpic) + if err != nil { + return err + } + page.rpic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ReplicationProtectionIntentCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ReplicationProtectionIntentCollectionPage) NotDone() bool { + return !page.rpic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ReplicationProtectionIntentCollectionPage) Response() ReplicationProtectionIntentCollection { + return page.rpic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ReplicationProtectionIntentCollectionPage) Values() []ReplicationProtectionIntent { + if page.rpic.IsEmpty() { + return nil + } + return *page.rpic.Value +} + +// Creates a new instance of the ReplicationProtectionIntentCollectionPage type. +func NewReplicationProtectionIntentCollectionPage(cur ReplicationProtectionIntentCollection, getNextPage func(context.Context, ReplicationProtectionIntentCollection) (ReplicationProtectionIntentCollection, error)) ReplicationProtectionIntentCollectionPage { + return ReplicationProtectionIntentCollectionPage{ + fn: getNextPage, + rpic: cur, + } +} + +// ReplicationProtectionIntentProperties replication protection intent custom data details. +type ReplicationProtectionIntentProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // JobID - READ-ONLY; The job Id. + JobID *string `json:"jobId,omitempty"` + // JobState - READ-ONLY; The job state. + JobState *string `json:"jobState,omitempty"` + // IsActive - READ-ONLY; A value indicating whether the intent object is active. + IsActive *bool `json:"isActive,omitempty"` + // CreationTimeUTC - READ-ONLY; The creation time in UTC. + CreationTimeUTC *string `json:"creationTimeUTC,omitempty"` + // ProviderSpecificDetails - The Replication provider custom settings. + ProviderSpecificDetails BasicReplicationProtectionIntentProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntentProperties. +func (rpip ReplicationProtectionIntentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpip.FriendlyName != nil { + objectMap["friendlyName"] = rpip.FriendlyName + } + objectMap["providerSpecificDetails"] = rpip.ProviderSpecificDetails + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ReplicationProtectionIntentProperties struct. +func (rpip *ReplicationProtectionIntentProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpip.FriendlyName = &friendlyName + } + case "jobId": + if v != nil { + var jobID string + err = json.Unmarshal(*v, &jobID) + if err != nil { + return err + } + rpip.JobID = &jobID + } + case "jobState": + if v != nil { + var jobState string + err = json.Unmarshal(*v, &jobState) + if err != nil { + return err + } + rpip.JobState = &jobState + } + case "isActive": + if v != nil { + var isActive bool + err = json.Unmarshal(*v, &isActive) + if err != nil { + return err + } + rpip.IsActive = &isActive + } + case "creationTimeUTC": + if v != nil { + var creationTimeUTC string + err = json.Unmarshal(*v, &creationTimeUTC) + if err != nil { + return err + } + rpip.CreationTimeUTC = &creationTimeUTC + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(*v) + if err != nil { + return err + } + rpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicReplicationProtectionIntentProviderSpecificSettings replication provider specific settings. +type BasicReplicationProtectionIntentProviderSpecificSettings interface { + AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) + AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) +} + +// ReplicationProtectionIntentProviderSpecificSettings replication provider specific settings. +type ReplicationProtectionIntentProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings', 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A' + InstanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(body []byte) (BasicReplicationProtectionIntentProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A): + var arid A2AReplicationIntentDetails + err := json.Unmarshal(body, &arid) + return arid, err + default: + var rpipss ReplicationProtectionIntentProviderSpecificSettings + err := json.Unmarshal(body, &rpipss) + return rpipss, err + } +} +func unmarshalBasicReplicationProtectionIntentProviderSpecificSettingsArray(body []byte) ([]BasicReplicationProtectionIntentProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpipssArray := make([]BasicReplicationProtectionIntentProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpipss, err := unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + rpipssArray[index] = rpipss + } + return rpipssArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) MarshalJSON() ([]byte, error) { + rpipss.InstanceType = InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings + objectMap := make(map[string]interface{}) + if rpipss.InstanceType != "" { + objectMap["instanceType"] = rpipss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReplicationIntentDetails is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) { + return nil, false +} + +// AsReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) { + return &rpipss, true +} + +// AsBasicReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsBasicReplicationProtectionIntentProviderSpecificSettings() (BasicReplicationProtectionIntentProviderSpecificSettings, bool) { + return &rpipss, true +} + +// ReplicationProviderContainerUnmappingInput provider specific input for unpairing operations. +type ReplicationProviderContainerUnmappingInput struct { + // InstanceType - The class type. + InstanceType *string `json:"instanceType,omitempty"` +} + +// BasicReplicationProviderSpecificContainerCreationInput provider specific input for container creation operation. +type BasicReplicationProviderSpecificContainerCreationInput interface { + AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) + AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) + AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) + AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) +} + +// ReplicationProviderSpecificContainerCreationInput provider specific input for container creation operation. +type ReplicationProviderSpecificContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificContainerCreationInput(body []byte) (BasicReplicationProviderSpecificContainerCreationInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A): + var acci A2AContainerCreationInput + err := json.Unmarshal(body, &acci) + return acci, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration): + var accmcci A2ACrossClusterMigrationContainerCreationInput + err := json.Unmarshal(body, &accmcci) + return accmcci, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt): + var vmccci VMwareCbtContainerCreationInput + err := json.Unmarshal(body, &vmccci) + return vmccci, err + default: + var rpscci ReplicationProviderSpecificContainerCreationInput + err := json.Unmarshal(body, &rpscci) + return rpscci, err + } +} +func unmarshalBasicReplicationProviderSpecificContainerCreationInputArray(body []byte) ([]BasicReplicationProviderSpecificContainerCreationInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpscciArray := make([]BasicReplicationProviderSpecificContainerCreationInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpscci, err := unmarshalBasicReplicationProviderSpecificContainerCreationInput(*rawMessage) + if err != nil { + return nil, err + } + rpscciArray[index] = rpscci + } + return rpscciArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) MarshalJSON() ([]byte, error) { + rpscci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput + objectMap := make(map[string]interface{}) + if rpscci.InstanceType != "" { + objectMap["instanceType"] = rpscci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return &rpscci, true +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &rpscci, true +} + +// BasicReplicationProviderSpecificContainerMappingInput provider specific input for pairing operations. +type BasicReplicationProviderSpecificContainerMappingInput interface { + AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) + AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) + AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) +} + +// ReplicationProviderSpecificContainerMappingInput provider specific input for pairing operations. +type ReplicationProviderSpecificContainerMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificContainerMappingInput(body []byte) (BasicReplicationProviderSpecificContainerMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A): + var acmi A2AContainerMappingInput + err := json.Unmarshal(body, &acmi) + return acmi, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt): + var vmccmi VMwareCbtContainerMappingInput + err := json.Unmarshal(body, &vmccmi) + return vmccmi, err + default: + var rpscmi ReplicationProviderSpecificContainerMappingInput + err := json.Unmarshal(body, &rpscmi) + return rpscmi, err + } +} +func unmarshalBasicReplicationProviderSpecificContainerMappingInputArray(body []byte) ([]BasicReplicationProviderSpecificContainerMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpscmiArray := make([]BasicReplicationProviderSpecificContainerMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpscmi, err := unmarshalBasicReplicationProviderSpecificContainerMappingInput(*rawMessage) + if err != nil { + return nil, err + } + rpscmiArray[index] = rpscmi + } + return rpscmiArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) MarshalJSON() ([]byte, error) { + rpscmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput + objectMap := make(map[string]interface{}) + if rpscmi.InstanceType != "" { + objectMap["instanceType"] = rpscmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return &rpscmi, true +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &rpscmi, true +} + +// BasicReplicationProviderSpecificSettings replication provider specific settings. +type BasicReplicationProviderSpecificSettings interface { + AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) + AsA2AReplicationDetails() (*A2AReplicationDetails, bool) + AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) + AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) + AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) + AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) + AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) + AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) + AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) + AsInMageReplicationDetails() (*InMageReplicationDetails, bool) + AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) +} + +// ReplicationProviderSpecificSettings replication provider specific settings. +type ReplicationProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificSettings(body []byte) (BasicReplicationProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration): + var accmrd A2ACrossClusterMigrationReplicationDetails + err := json.Unmarshal(body, &accmrd) + return accmrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A): + var ard A2AReplicationDetails + err := json.Unmarshal(body, &ard) + return ard, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure): + var hvrard HyperVReplicaAzureReplicationDetails + err := json.Unmarshal(body, &hvrard) + return hvrard, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails): + var hvrbrd HyperVReplicaBaseReplicationDetails + err := json.Unmarshal(body, &hvrbrd) + return hvrbrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2): + var hvrbrd HyperVReplicaBlueReplicationDetails + err := json.Unmarshal(body, &hvrbrd) + return hvrbrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012): + var hvrrd HyperVReplicaReplicationDetails + err := json.Unmarshal(body, &hvrrd) + return hvrrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2): + var imavrd InMageAzureV2ReplicationDetails + err := json.Unmarshal(body, &imavrd) + return imavrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback): + var imrfrd InMageRcmFailbackReplicationDetails + err := json.Unmarshal(body, &imrfrd) + return imrfrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm): + var imrrd InMageRcmReplicationDetails + err := json.Unmarshal(body, &imrrd) + return imrrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage): + var imrd InMageReplicationDetails + err := json.Unmarshal(body, &imrd) + return imrd, err + default: + var rpss ReplicationProviderSpecificSettings + err := json.Unmarshal(body, &rpss) + return rpss, err + } +} +func unmarshalBasicReplicationProviderSpecificSettingsArray(body []byte) ([]BasicReplicationProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpssArray := make([]BasicReplicationProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpss, err := unmarshalBasicReplicationProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + rpssArray[index] = rpss + } + return rpssArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) MarshalJSON() ([]byte, error) { + rpss.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings + objectMap := make(map[string]interface{}) + if rpss.InstanceType != "" { + objectMap["instanceType"] = rpss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return &rpss, true +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &rpss, true +} + +// BasicReplicationProviderSpecificUpdateContainerMappingInput provider specific input for update pairing operations. +type BasicReplicationProviderSpecificUpdateContainerMappingInput interface { + AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) + AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) + AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) +} + +// ReplicationProviderSpecificUpdateContainerMappingInput provider specific input for update pairing +// operations. +type ReplicationProviderSpecificUpdateContainerMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(body []byte) (BasicReplicationProviderSpecificUpdateContainerMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A): + var aucmi A2AUpdateContainerMappingInput + err := json.Unmarshal(body, &aucmi) + return aucmi, err + case string(InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm): + var imrucmi InMageRcmUpdateContainerMappingInput + err := json.Unmarshal(body, &imrucmi) + return imrucmi, err + default: + var rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput + err := json.Unmarshal(body, &rpsucmi) + return rpsucmi, err + } +} +func unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInputArray(body []byte) ([]BasicReplicationProviderSpecificUpdateContainerMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpsucmiArray := make([]BasicReplicationProviderSpecificUpdateContainerMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpsucmi, err := unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(*rawMessage) + if err != nil { + return nil, err + } + rpsucmiArray[index] = rpsucmi + } + return rpsucmiArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + rpsucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput + objectMap := make(map[string]interface{}) + if rpsucmi.InstanceType != "" { + objectMap["instanceType"] = rpsucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &rpsucmi, true +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &rpsucmi, true +} + +// ReplicationRecoveryPlansCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansCreateFuture.Result. +func (future *ReplicationRecoveryPlansCreateFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.CreateResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansCreateFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansDeleteFuture.Result. +func (future *ReplicationRecoveryPlansDeleteFuture) result(client ReplicationRecoveryPlansClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryPlansFailoverCancelFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationRecoveryPlansFailoverCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansFailoverCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansFailoverCancelFuture.Result. +func (future *ReplicationRecoveryPlansFailoverCancelFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansFailoverCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.FailoverCancelResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCancelFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansFailoverCommitFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationRecoveryPlansFailoverCommitFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansFailoverCommitFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansFailoverCommitFuture.Result. +func (future *ReplicationRecoveryPlansFailoverCommitFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCommitFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansFailoverCommitFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.FailoverCommitResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCommitFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansPlannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryPlansPlannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansPlannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansPlannedFailoverFuture.Result. +func (future *ReplicationRecoveryPlansPlannedFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.PlannedFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansReprotectFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansReprotectFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansReprotectFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansReprotectFuture.Result. +func (future *ReplicationRecoveryPlansReprotectFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansReprotectFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansReprotectFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.ReprotectResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansReprotectFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansTestFailoverCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryPlansTestFailoverCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansTestFailoverCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansTestFailoverCleanupFuture.Result. +func (future *ReplicationRecoveryPlansTestFailoverCleanupFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.TestFailoverCleanupResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansTestFailoverFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansTestFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansTestFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansTestFailoverFuture.Result. +func (future *ReplicationRecoveryPlansTestFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansTestFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.TestFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansUnplannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryPlansUnplannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansUnplannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansUnplannedFailoverFuture.Result. +func (future *ReplicationRecoveryPlansUnplannedFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.UnplannedFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansUpdateFuture.Result. +func (future *ReplicationRecoveryPlansUpdateFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.UpdateResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUpdateFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryServicesProvidersCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryServicesProvidersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (RecoveryServicesProvider, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersCreateFuture.Result. +func (future *ReplicationRecoveryServicesProvidersCreateFuture) result(client ReplicationRecoveryServicesProvidersClient) (rsp RecoveryServicesProvider, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rsp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rsp.Response.Response, err = future.GetResult(sender); err == nil && rsp.Response.Response.StatusCode != http.StatusNoContent { + rsp, err = client.CreateResponder(rsp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersCreateFuture", "Result", rsp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryServicesProvidersDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryServicesProvidersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersDeleteFuture.Result. +func (future *ReplicationRecoveryServicesProvidersDeleteFuture) result(client ReplicationRecoveryServicesProvidersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryServicesProvidersPurgeFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryServicesProvidersPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersPurgeFuture.Result. +func (future *ReplicationRecoveryServicesProvidersPurgeFuture) result(client ReplicationRecoveryServicesProvidersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryServicesProvidersRefreshProviderFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type ReplicationRecoveryServicesProvidersRefreshProviderFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (RecoveryServicesProvider, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersRefreshProviderFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersRefreshProviderFuture.Result. +func (future *ReplicationRecoveryServicesProvidersRefreshProviderFuture) result(client ReplicationRecoveryServicesProvidersClient) (rsp RecoveryServicesProvider, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rsp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rsp.Response.Response, err = future.GetResult(sender); err == nil && rsp.Response.Response.StatusCode != http.StatusNoContent { + rsp, err = client.RefreshProviderResponder(rsp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture", "Result", rsp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationStorageClassificationMappingsCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationStorageClassificationMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationStorageClassificationMappingsClient) (StorageClassificationMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationStorageClassificationMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationStorageClassificationMappingsCreateFuture.Result. +func (future *ReplicationStorageClassificationMappingsCreateFuture) result(client ReplicationStorageClassificationMappingsClient) (scm StorageClassificationMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + scm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationStorageClassificationMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if scm.Response.Response, err = future.GetResult(sender); err == nil && scm.Response.Response.StatusCode != http.StatusNoContent { + scm, err = client.CreateResponder(scm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsCreateFuture", "Result", scm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationStorageClassificationMappingsDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationStorageClassificationMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationStorageClassificationMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationStorageClassificationMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationStorageClassificationMappingsDeleteFuture.Result. +func (future *ReplicationStorageClassificationMappingsDeleteFuture) result(client ReplicationStorageClassificationMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationStorageClassificationMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationVaultHealthRefreshFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationVaultHealthRefreshFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationVaultHealthClient) (VaultHealthDetails, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationVaultHealthRefreshFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationVaultHealthRefreshFuture.Result. +func (future *ReplicationVaultHealthRefreshFuture) result(client ReplicationVaultHealthClient) (vhd VaultHealthDetails, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthRefreshFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vhd.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationVaultHealthRefreshFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vhd.Response.Response, err = future.GetResult(sender); err == nil && vhd.Response.Response.StatusCode != http.StatusNoContent { + vhd, err = client.RefreshResponder(vhd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthRefreshFuture", "Result", vhd.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationVaultSettingCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationVaultSettingCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationVaultSettingClient) (VaultSetting, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationVaultSettingCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationVaultSettingCreateFuture.Result. +func (future *ReplicationVaultSettingCreateFuture) result(client ReplicationVaultSettingClient) (vs VaultSetting, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vs.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationVaultSettingCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vs.Response.Response, err = future.GetResult(sender); err == nil && vs.Response.Response.StatusCode != http.StatusNoContent { + vs, err = client.CreateResponder(vs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingCreateFuture", "Result", vs.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationvCentersCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (VCenter, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersCreateFuture.Result. +func (future *ReplicationvCentersCreateFuture) result(client ReplicationvCentersClient) (vc VCenter, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent { + vc, err = client.CreateResponder(vc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersCreateFuture", "Result", vc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationvCentersDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersDeleteFuture.Result. +func (future *ReplicationvCentersDeleteFuture) result(client ReplicationvCentersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationvCentersUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (VCenter, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersUpdateFuture.Result. +func (future *ReplicationvCentersUpdateFuture) result(client ReplicationvCentersClient) (vc VCenter, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent { + vc, err = client.UpdateResponder(vc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersUpdateFuture", "Result", vc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReprotectAgentDetails reprotect agent details. +type ReprotectAgentDetails struct { + // ID - READ-ONLY; The reprotect agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The reprotect agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The reprotect agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The reprotect agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the reprotect agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the reprotect agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReprotectAgentDetails. +func (rad ReprotectAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResolveHealthError resolve health errors input properties. +type ResolveHealthError struct { + // HealthErrorID - Health error id. + HealthErrorID *string `json:"healthErrorId,omitempty"` +} + +// ResolveHealthInput resolve health input. +type ResolveHealthInput struct { + // Properties - Disable resolve health input properties. + Properties *ResolveHealthInputProperties `json:"properties,omitempty"` +} + +// ResolveHealthInputProperties resolve health input properties. +type ResolveHealthInputProperties struct { + // HealthErrors - Health errors. + HealthErrors *[]ResolveHealthError `json:"healthErrors,omitempty"` +} + +// Resource azure resource. +type Resource struct { + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location + } + return json.Marshal(objectMap) +} + +// ResourceHealthSummary base class to define the health summary of the resources contained under an Arm +// resource. +type ResourceHealthSummary struct { + // ResourceCount - The count of total resources under the container. + ResourceCount *int32 `json:"resourceCount,omitempty"` + // Issues - The list of summary of health errors across the resources under the container. + Issues *[]HealthErrorSummary `json:"issues,omitempty"` + // CategorizedResourceCounts - The categorized resource counts. + CategorizedResourceCounts map[string]*int32 `json:"categorizedResourceCounts"` +} + +// MarshalJSON is the custom marshaler for ResourceHealthSummary. +func (RHS ResourceHealthSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if RHS.ResourceCount != nil { + objectMap["resourceCount"] = RHS.ResourceCount + } + if RHS.Issues != nil { + objectMap["issues"] = RHS.Issues + } + if RHS.CategorizedResourceCounts != nil { + objectMap["categorizedResourceCounts"] = RHS.CategorizedResourceCounts + } + return json.Marshal(objectMap) +} + +// ResumeJobParams resume job params. +type ResumeJobParams struct { + // Properties - Resume job properties. + Properties *ResumeJobParamsProperties `json:"properties,omitempty"` +} + +// ResumeJobParamsProperties resume job properties. +type ResumeJobParamsProperties struct { + // Comments - Resume job comments. + Comments *string `json:"comments,omitempty"` +} + +// ResyncInput resync input. +type ResyncInput struct { + // Properties - Resync input properties. + Properties *ResyncInputProperties `json:"properties,omitempty"` +} + +// ResyncInputProperties resync input properties. +type ResyncInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicResyncProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ResyncInputProperties struct. +func (rip *ResyncInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicResyncProviderSpecificInput(*v) + if err != nil { + return err + } + rip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicResyncProviderSpecificInput resync provider specific input. +type BasicResyncProviderSpecificInput interface { + AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) + AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) +} + +// ResyncProviderSpecificInput resync provider specific input. +type ResyncProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput', 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicResyncProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicResyncProviderSpecificInput(body []byte) (BasicResyncProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt): + var vmcri VMwareCbtResyncInput + err := json.Unmarshal(body, &vmcri) + return vmcri, err + default: + var rpsi ResyncProviderSpecificInput + err := json.Unmarshal(body, &rpsi) + return rpsi, err + } +} +func unmarshalBasicResyncProviderSpecificInputArray(body []byte) ([]BasicResyncProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpsiArray := make([]BasicResyncProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpsi, err := unmarshalBasicResyncProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rpsiArray[index] = rpsi + } + return rpsiArray, nil +} + +// MarshalJSON is the custom marshaler for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) MarshalJSON() ([]byte, error) { + rpsi.InstanceType = InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput + objectMap := make(map[string]interface{}) + if rpsi.InstanceType != "" { + objectMap["instanceType"] = rpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtResyncInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) { + return nil, false +} + +// AsResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) { + return &rpsi, true +} + +// AsBasicResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsBasicResyncProviderSpecificInput() (BasicResyncProviderSpecificInput, bool) { + return &rpsi, true +} + +// RetentionVolume the retention details of the MT. +type RetentionVolume struct { + // VolumeName - The volume name. + VolumeName *string `json:"volumeName,omitempty"` + // CapacityInBytes - The volume capacity. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // FreeSpaceInBytes - The free space available in this volume. + FreeSpaceInBytes *int64 `json:"freeSpaceInBytes,omitempty"` + // ThresholdPercentage - The threshold percentage. + ThresholdPercentage *int32 `json:"thresholdPercentage,omitempty"` +} + +// ReverseReplicationInput reverse replication input. +type ReverseReplicationInput struct { + // Properties - Reverse replication properties. + Properties *ReverseReplicationInputProperties `json:"properties,omitempty"` +} + +// ReverseReplicationInputProperties reverse replication input properties. +type ReverseReplicationInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - Provider specific reverse replication input. + ProviderSpecificDetails BasicReverseReplicationProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ReverseReplicationInputProperties struct. +func (rrip *ReverseReplicationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rrip.FailoverDirection = &failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReverseReplicationProviderSpecificInput(*v) + if err != nil { + return err + } + rrip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicReverseReplicationProviderSpecificInput provider specific reverse replication input. +type BasicReverseReplicationProviderSpecificInput interface { + AsA2AReprotectInput() (*A2AReprotectInput, bool) + AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) + AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) + AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) + AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) + AsInMageReprotectInput() (*InMageReprotectInput, bool) + AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) +} + +// ReverseReplicationProviderSpecificInput provider specific reverse replication input. +type ReverseReplicationProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReverseReplicationProviderSpecificInput(body []byte) (BasicReverseReplicationProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A): + var ari A2AReprotectInput + err := json.Unmarshal(body, &ari) + return ari, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvrari HyperVReplicaAzureReprotectInput + err := json.Unmarshal(body, &hvrari) + return hvrari, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2): + var imavri InMageAzureV2ReprotectInput + err := json.Unmarshal(body, &imavri) + return imavri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback): + var imrfri InMageRcmFailbackReprotectInput + err := json.Unmarshal(body, &imrfri) + return imrfri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm): + var imrri InMageRcmReprotectInput + err := json.Unmarshal(body, &imrri) + return imrri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage): + var imri InMageReprotectInput + err := json.Unmarshal(body, &imri) + return imri, err + default: + var rrpsi ReverseReplicationProviderSpecificInput + err := json.Unmarshal(body, &rrpsi) + return rrpsi, err + } +} +func unmarshalBasicReverseReplicationProviderSpecificInputArray(body []byte) ([]BasicReverseReplicationProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rrpsiArray := make([]BasicReverseReplicationProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rrpsi, err := unmarshalBasicReverseReplicationProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rrpsiArray[index] = rrpsi + } + return rrpsiArray, nil +} + +// MarshalJSON is the custom marshaler for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) MarshalJSON() ([]byte, error) { + rrpsi.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput + objectMap := make(map[string]interface{}) + if rrpsi.InstanceType != "" { + objectMap["instanceType"] = rrpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return &rrpsi, true +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &rrpsi, true +} + +// RoleAssignment azure role assignment details. +type RoleAssignment struct { + // ID - The ARM Id of the role assignment. + ID *string `json:"id,omitempty"` + // Name - The name of the role assignment. + Name *string `json:"name,omitempty"` + // Scope - Role assignment scope. + Scope *string `json:"scope,omitempty"` + // PrincipalID - Principal Id. + PrincipalID *string `json:"principalId,omitempty"` + // RoleDefinitionID - Role definition id. + RoleDefinitionID *string `json:"roleDefinitionId,omitempty"` +} + +// RunAsAccount CS Accounts Details. +type RunAsAccount struct { + // AccountID - The CS RunAs account Id. + AccountID *string `json:"accountId,omitempty"` + // AccountName - The CS RunAs account name. + AccountName *string `json:"accountName,omitempty"` +} + +// ScriptActionTaskDetails this class represents the script action task details. +type ScriptActionTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // Path - The path. + Path *string `json:"path,omitempty"` + // Output - The output. + Output *string `json:"output,omitempty"` + // IsPrimarySideScript - A value indicating whether it is a primary side script or not. + IsPrimarySideScript *bool `json:"isPrimarySideScript,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) MarshalJSON() ([]byte, error) { + satd.InstanceType = InstanceTypeScriptActionTaskDetails + objectMap := make(map[string]interface{}) + if satd.Name != nil { + objectMap["name"] = satd.Name + } + if satd.Path != nil { + objectMap["path"] = satd.Path + } + if satd.Output != nil { + objectMap["output"] = satd.Output + } + if satd.IsPrimarySideScript != nil { + objectMap["isPrimarySideScript"] = satd.IsPrimarySideScript + } + if satd.InstanceType != "" { + objectMap["instanceType"] = satd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return &satd, true +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &satd, true +} + +// ServiceError ASR error model. +type ServiceError struct { + // Code - Error code. + Code *string `json:"code,omitempty"` + // Message - Error message. + Message *string `json:"message,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ActivityID - Activity Id. + ActivityID *string `json:"activityId,omitempty"` +} + +// BasicStorageAccountCustomDetails storage account custom input. +type BasicStorageAccountCustomDetails interface { + AsExistingStorageAccount() (*ExistingStorageAccount, bool) + AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) +} + +// StorageAccountCustomDetails storage account custom input. +type StorageAccountCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails', 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicStorageAccountCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicStorageAccountCustomDetails(body []byte) (BasicStorageAccountCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting): + var esa ExistingStorageAccount + err := json.Unmarshal(body, &esa) + return esa, err + default: + var sacd StorageAccountCustomDetails + err := json.Unmarshal(body, &sacd) + return sacd, err + } +} +func unmarshalBasicStorageAccountCustomDetailsArray(body []byte) ([]BasicStorageAccountCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sacdArray := make([]BasicStorageAccountCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sacd, err := unmarshalBasicStorageAccountCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + sacdArray[index] = sacd + } + return sacdArray, nil +} + +// MarshalJSON is the custom marshaler for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) MarshalJSON() ([]byte, error) { + sacd.ResourceType = ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails + objectMap := make(map[string]interface{}) + if sacd.ResourceType != "" { + objectMap["resourceType"] = sacd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingStorageAccount is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsExistingStorageAccount() (*ExistingStorageAccount, bool) { + return nil, false +} + +// AsStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) { + return &sacd, true +} + +// AsBasicStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsBasicStorageAccountCustomDetails() (BasicStorageAccountCustomDetails, bool) { + return &sacd, true +} + +// StorageClassification storage object definition. +type StorageClassification struct { + autorest.Response `json:"-"` + // Properties - Properties of the storage object. + Properties *StorageClassificationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageClassification. +func (sc StorageClassification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sc.Properties != nil { + objectMap["properties"] = sc.Properties + } + if sc.Location != nil { + objectMap["location"] = sc.Location + } + return json.Marshal(objectMap) +} + +// StorageClassificationCollection collection of storage details. +type StorageClassificationCollection struct { + autorest.Response `json:"-"` + // Value - The storage details. + Value *[]StorageClassification `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// StorageClassificationCollectionIterator provides access to a complete listing of StorageClassification +// values. +type StorageClassificationCollectionIterator struct { + i int + page StorageClassificationCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StorageClassificationCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StorageClassificationCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StorageClassificationCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StorageClassificationCollectionIterator) Response() StorageClassificationCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StorageClassificationCollectionIterator) Value() StorageClassification { + if !iter.page.NotDone() { + return StorageClassification{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StorageClassificationCollectionIterator type. +func NewStorageClassificationCollectionIterator(page StorageClassificationCollectionPage) StorageClassificationCollectionIterator { + return StorageClassificationCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scc StorageClassificationCollection) IsEmpty() bool { + return scc.Value == nil || len(*scc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scc StorageClassificationCollection) hasNextLink() bool { + return scc.NextLink != nil && len(*scc.NextLink) != 0 +} + +// storageClassificationCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scc StorageClassificationCollection) storageClassificationCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !scc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scc.NextLink))) +} + +// StorageClassificationCollectionPage contains a page of StorageClassification values. +type StorageClassificationCollectionPage struct { + fn func(context.Context, StorageClassificationCollection) (StorageClassificationCollection, error) + scc StorageClassificationCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StorageClassificationCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.scc) + if err != nil { + return err + } + page.scc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StorageClassificationCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StorageClassificationCollectionPage) NotDone() bool { + return !page.scc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StorageClassificationCollectionPage) Response() StorageClassificationCollection { + return page.scc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StorageClassificationCollectionPage) Values() []StorageClassification { + if page.scc.IsEmpty() { + return nil + } + return *page.scc.Value +} + +// Creates a new instance of the StorageClassificationCollectionPage type. +func NewStorageClassificationCollectionPage(cur StorageClassificationCollection, getNextPage func(context.Context, StorageClassificationCollection) (StorageClassificationCollection, error)) StorageClassificationCollectionPage { + return StorageClassificationCollectionPage{ + fn: getNextPage, + scc: cur, + } +} + +// StorageClassificationMapping storage mapping object. +type StorageClassificationMapping struct { + autorest.Response `json:"-"` + // Properties - Properties of the storage mapping object. + Properties *StorageClassificationMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageClassificationMapping. +func (scm StorageClassificationMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scm.Properties != nil { + objectMap["properties"] = scm.Properties + } + if scm.Location != nil { + objectMap["location"] = scm.Location + } + return json.Marshal(objectMap) +} + +// StorageClassificationMappingCollection collection of storage mapping details. +type StorageClassificationMappingCollection struct { + autorest.Response `json:"-"` + // Value - The storage details. + Value *[]StorageClassificationMapping `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// StorageClassificationMappingCollectionIterator provides access to a complete listing of +// StorageClassificationMapping values. +type StorageClassificationMappingCollectionIterator struct { + i int + page StorageClassificationMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StorageClassificationMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StorageClassificationMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StorageClassificationMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StorageClassificationMappingCollectionIterator) Response() StorageClassificationMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StorageClassificationMappingCollectionIterator) Value() StorageClassificationMapping { + if !iter.page.NotDone() { + return StorageClassificationMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StorageClassificationMappingCollectionIterator type. +func NewStorageClassificationMappingCollectionIterator(page StorageClassificationMappingCollectionPage) StorageClassificationMappingCollectionIterator { + return StorageClassificationMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scmc StorageClassificationMappingCollection) IsEmpty() bool { + return scmc.Value == nil || len(*scmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scmc StorageClassificationMappingCollection) hasNextLink() bool { + return scmc.NextLink != nil && len(*scmc.NextLink) != 0 +} + +// storageClassificationMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scmc StorageClassificationMappingCollection) storageClassificationMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !scmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scmc.NextLink))) +} + +// StorageClassificationMappingCollectionPage contains a page of StorageClassificationMapping values. +type StorageClassificationMappingCollectionPage struct { + fn func(context.Context, StorageClassificationMappingCollection) (StorageClassificationMappingCollection, error) + scmc StorageClassificationMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StorageClassificationMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.scmc) + if err != nil { + return err + } + page.scmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StorageClassificationMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StorageClassificationMappingCollectionPage) NotDone() bool { + return !page.scmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StorageClassificationMappingCollectionPage) Response() StorageClassificationMappingCollection { + return page.scmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StorageClassificationMappingCollectionPage) Values() []StorageClassificationMapping { + if page.scmc.IsEmpty() { + return nil + } + return *page.scmc.Value +} + +// Creates a new instance of the StorageClassificationMappingCollectionPage type. +func NewStorageClassificationMappingCollectionPage(cur StorageClassificationMappingCollection, getNextPage func(context.Context, StorageClassificationMappingCollection) (StorageClassificationMappingCollection, error)) StorageClassificationMappingCollectionPage { + return StorageClassificationMappingCollectionPage{ + fn: getNextPage, + scmc: cur, + } +} + +// StorageClassificationMappingInput storage mapping input. +type StorageClassificationMappingInput struct { + // Properties - Storage mapping input properties. + Properties *StorageMappingInputProperties `json:"properties,omitempty"` +} + +// StorageClassificationMappingProperties storage mapping properties. +type StorageClassificationMappingProperties struct { + // TargetStorageClassificationID - Target storage object Id. + TargetStorageClassificationID *string `json:"targetStorageClassificationId,omitempty"` +} + +// StorageClassificationProperties storage object properties. +type StorageClassificationProperties struct { + // FriendlyName - Friendly name of the Storage classification. + FriendlyName *string `json:"friendlyName,omitempty"` +} + +// StorageMappingInputProperties storage mapping input properties. +type StorageMappingInputProperties struct { + // TargetStorageClassificationID - The ID of the storage object. + TargetStorageClassificationID *string `json:"targetStorageClassificationId,omitempty"` +} + +// Subnet subnets of the network. +type Subnet struct { + // Name - The subnet name. + Name *string `json:"name,omitempty"` + // FriendlyName - The subnet friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // AddressList - The list of addresses for the subnet. + AddressList *[]string `json:"addressList,omitempty"` +} + +// SupportedOperatingSystems supported operating systems. +type SupportedOperatingSystems struct { + autorest.Response `json:"-"` + // Properties - The supported operating systems properties. + Properties *SupportedOSProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for SupportedOperatingSystems. +func (sos SupportedOperatingSystems) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sos.Properties != nil { + objectMap["properties"] = sos.Properties + } + if sos.Location != nil { + objectMap["location"] = sos.Location + } + return json.Marshal(objectMap) +} + +// SupportedOSDetails supported operating system details. +type SupportedOSDetails struct { + // OsName - The name. + OsName *string `json:"osName,omitempty"` + // OsType - The type. + OsType *string `json:"osType,omitempty"` + // OsVersions - The list of version for operating system. + OsVersions *[]OSVersionWrapper `json:"osVersions,omitempty"` +} + +// SupportedOSProperties supported operating systems properties. +type SupportedOSProperties struct { + // SupportedOsList - The supported operating systems property list. + SupportedOsList *[]SupportedOSProperty `json:"supportedOsList,omitempty"` +} + +// SupportedOSProperty supported operating systems property. +type SupportedOSProperty struct { + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` + // SupportedOs - The list of supported operating systems. + SupportedOs *[]SupportedOSDetails `json:"supportedOs,omitempty"` +} + +// SwitchProtectionInput switch protection input. +type SwitchProtectionInput struct { + // Properties - Switch protection properties. + Properties *SwitchProtectionInputProperties `json:"properties,omitempty"` +} + +// SwitchProtectionInputProperties switch protection input properties. +type SwitchProtectionInputProperties struct { + // ReplicationProtectedItemName - The unique replication protected item name. + ReplicationProtectedItemName *string `json:"replicationProtectedItemName,omitempty"` + // ProviderSpecificDetails - Provider specific switch protection input. + ProviderSpecificDetails BasicSwitchProtectionProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SwitchProtectionInputProperties struct. +func (spip *SwitchProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "replicationProtectedItemName": + if v != nil { + var replicationProtectedItemName string + err = json.Unmarshal(*v, &replicationProtectedItemName) + if err != nil { + return err + } + spip.ReplicationProtectedItemName = &replicationProtectedItemName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicSwitchProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + spip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// SwitchProtectionJobDetails this class represents details for switch protection job. +type SwitchProtectionJobDetails struct { + // NewReplicationProtectedItemID - ARM Id of the new replication protected item. + NewReplicationProtectedItemID *string `json:"newReplicationProtectedItemId,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) MarshalJSON() ([]byte, error) { + spjd.InstanceType = InstanceTypeSwitchProtectionJobDetails + objectMap := make(map[string]interface{}) + if spjd.NewReplicationProtectedItemID != nil { + objectMap["newReplicationProtectedItemId"] = spjd.NewReplicationProtectedItemID + } + if spjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = spjd.AffectedObjectDetails + } + if spjd.InstanceType != "" { + objectMap["instanceType"] = spjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return &spjd, true +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &spjd, true +} + +// BasicSwitchProtectionProviderSpecificInput provider specific switch protection input. +type BasicSwitchProtectionProviderSpecificInput interface { + AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) + AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) +} + +// SwitchProtectionProviderSpecificInput provider specific switch protection input. +type SwitchProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput', 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicSwitchProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicSwitchProtectionProviderSpecificInput(body []byte) (BasicSwitchProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A): + var aspi A2ASwitchProtectionInput + err := json.Unmarshal(body, &aspi) + return aspi, err + default: + var sppsi SwitchProtectionProviderSpecificInput + err := json.Unmarshal(body, &sppsi) + return sppsi, err + } +} +func unmarshalBasicSwitchProtectionProviderSpecificInputArray(body []byte) ([]BasicSwitchProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sppsiArray := make([]BasicSwitchProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sppsi, err := unmarshalBasicSwitchProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + sppsiArray[index] = sppsi + } + return sppsiArray, nil +} + +// MarshalJSON is the custom marshaler for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + sppsi.InstanceType = InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if sppsi.InstanceType != "" { + objectMap["instanceType"] = sppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ASwitchProtectionInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) { + return nil, false +} + +// AsSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) { + return &sppsi, true +} + +// AsBasicSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsBasicSwitchProtectionProviderSpecificInput() (BasicSwitchProtectionProviderSpecificInput, bool) { + return &sppsi, true +} + +// TargetComputeSize represents applicable recovery vm sizes. +type TargetComputeSize struct { + // ID - The Id. + ID *string `json:"id,omitempty"` + // Name - The name. + Name *string `json:"name,omitempty"` + // Type - The Type of the object. + Type *string `json:"type,omitempty"` + // Properties - The custom data. + Properties *TargetComputeSizeProperties `json:"properties,omitempty"` +} + +// TargetComputeSizeCollection target compute size collection. +type TargetComputeSizeCollection struct { + autorest.Response `json:"-"` + // Value - The list of target compute sizes. + Value *[]TargetComputeSize `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// TargetComputeSizeCollectionIterator provides access to a complete listing of TargetComputeSize values. +type TargetComputeSizeCollectionIterator struct { + i int + page TargetComputeSizeCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *TargetComputeSizeCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizeCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *TargetComputeSizeCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TargetComputeSizeCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter TargetComputeSizeCollectionIterator) Response() TargetComputeSizeCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter TargetComputeSizeCollectionIterator) Value() TargetComputeSize { + if !iter.page.NotDone() { + return TargetComputeSize{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the TargetComputeSizeCollectionIterator type. +func NewTargetComputeSizeCollectionIterator(page TargetComputeSizeCollectionPage) TargetComputeSizeCollectionIterator { + return TargetComputeSizeCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (tcsc TargetComputeSizeCollection) IsEmpty() bool { + return tcsc.Value == nil || len(*tcsc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (tcsc TargetComputeSizeCollection) hasNextLink() bool { + return tcsc.NextLink != nil && len(*tcsc.NextLink) != 0 +} + +// targetComputeSizeCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tcsc TargetComputeSizeCollection) targetComputeSizeCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !tcsc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(tcsc.NextLink))) +} + +// TargetComputeSizeCollectionPage contains a page of TargetComputeSize values. +type TargetComputeSizeCollectionPage struct { + fn func(context.Context, TargetComputeSizeCollection) (TargetComputeSizeCollection, error) + tcsc TargetComputeSizeCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *TargetComputeSizeCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizeCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.tcsc) + if err != nil { + return err + } + page.tcsc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *TargetComputeSizeCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TargetComputeSizeCollectionPage) NotDone() bool { + return !page.tcsc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TargetComputeSizeCollectionPage) Response() TargetComputeSizeCollection { + return page.tcsc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TargetComputeSizeCollectionPage) Values() []TargetComputeSize { + if page.tcsc.IsEmpty() { + return nil + } + return *page.tcsc.Value +} + +// Creates a new instance of the TargetComputeSizeCollectionPage type. +func NewTargetComputeSizeCollectionPage(cur TargetComputeSizeCollection, getNextPage func(context.Context, TargetComputeSizeCollection) (TargetComputeSizeCollection, error)) TargetComputeSizeCollectionPage { + return TargetComputeSizeCollectionPage{ + fn: getNextPage, + tcsc: cur, + } +} + +// TargetComputeSizeProperties represents applicable recovery vm sizes properties. +type TargetComputeSizeProperties struct { + // Name - Target compute size name. + Name *string `json:"name,omitempty"` + // FriendlyName - Target compute size display name. + FriendlyName *string `json:"friendlyName,omitempty"` + // CPUCoresCount - The maximum cpu cores count supported by target compute size. + CPUCoresCount *int32 `json:"cpuCoresCount,omitempty"` + // VCPUsAvailable - READ-ONLY; The Available vCPUs supported by target compute size. + VCPUsAvailable *int32 `json:"vCPUsAvailable,omitempty"` + // MemoryInGB - The maximum memory in GB supported by target compute size. + MemoryInGB *float64 `json:"memoryInGB,omitempty"` + // MaxDataDiskCount - The maximum data disks count supported by target compute size. + MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` + // MaxNicsCount - The maximum Nics count supported by target compute size. + MaxNicsCount *int32 `json:"maxNicsCount,omitempty"` + // Errors - The reasons why the target compute size is not applicable for the protected item. + Errors *[]ComputeSizeErrorDetails `json:"errors,omitempty"` + // HighIopsSupported - The value indicating whether the target compute size supports high Iops. + HighIopsSupported *string `json:"highIopsSupported,omitempty"` + // HyperVGenerations - The supported HyperV Generations. + HyperVGenerations *[]string `json:"hyperVGenerations,omitempty"` +} + +// MarshalJSON is the custom marshaler for TargetComputeSizeProperties. +func (tcsp TargetComputeSizeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tcsp.Name != nil { + objectMap["name"] = tcsp.Name + } + if tcsp.FriendlyName != nil { + objectMap["friendlyName"] = tcsp.FriendlyName + } + if tcsp.CPUCoresCount != nil { + objectMap["cpuCoresCount"] = tcsp.CPUCoresCount + } + if tcsp.MemoryInGB != nil { + objectMap["memoryInGB"] = tcsp.MemoryInGB + } + if tcsp.MaxDataDiskCount != nil { + objectMap["maxDataDiskCount"] = tcsp.MaxDataDiskCount + } + if tcsp.MaxNicsCount != nil { + objectMap["maxNicsCount"] = tcsp.MaxNicsCount + } + if tcsp.Errors != nil { + objectMap["errors"] = tcsp.Errors + } + if tcsp.HighIopsSupported != nil { + objectMap["highIopsSupported"] = tcsp.HighIopsSupported + } + if tcsp.HyperVGenerations != nil { + objectMap["hyperVGenerations"] = tcsp.HyperVGenerations + } + return json.Marshal(objectMap) +} + +// BasicTaskTypeDetails task details based on specific task type. +type BasicTaskTypeDetails interface { + AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) + AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) + AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) + AsJobTaskDetails() (*JobTaskDetails, bool) + AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) + AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) + AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) + AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) + AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) + AsTaskTypeDetails() (*TaskTypeDetails, bool) +} + +// TaskTypeDetails task details based on specific task type. +type TaskTypeDetails struct { + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicTaskTypeDetails(body []byte) (BasicTaskTypeDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAutomationRunbookTaskDetails): + var artd AutomationRunbookTaskDetails + err := json.Unmarshal(body, &artd) + return artd, err + case string(InstanceTypeConsistencyCheckTaskDetails): + var cctd ConsistencyCheckTaskDetails + err := json.Unmarshal(body, &cctd) + return cctd, err + case string(InstanceTypeFabricReplicationGroupTaskDetails): + var frgtd FabricReplicationGroupTaskDetails + err := json.Unmarshal(body, &frgtd) + return frgtd, err + case string(InstanceTypeJobTaskDetails): + var jtd JobTaskDetails + err := json.Unmarshal(body, &jtd) + return jtd, err + case string(InstanceTypeManualActionTaskDetails): + var matd ManualActionTaskDetails + err := json.Unmarshal(body, &matd) + return matd, err + case string(InstanceTypeScriptActionTaskDetails): + var satd ScriptActionTaskDetails + err := json.Unmarshal(body, &satd) + return satd, err + case string(InstanceTypeVirtualMachineTaskDetails): + var vmtd VirtualMachineTaskDetails + err := json.Unmarshal(body, &vmtd) + return vmtd, err + case string(InstanceTypeVMNicUpdatesTaskDetails): + var vnutd VMNicUpdatesTaskDetails + err := json.Unmarshal(body, &vnutd) + return vnutd, err + default: + var ttd TaskTypeDetails + err := json.Unmarshal(body, &ttd) + return ttd, err + } +} +func unmarshalBasicTaskTypeDetailsArray(body []byte) ([]BasicTaskTypeDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ttdArray := make([]BasicTaskTypeDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ttd, err := unmarshalBasicTaskTypeDetails(*rawMessage) + if err != nil { + return nil, err + } + ttdArray[index] = ttd + } + return ttdArray, nil +} + +// MarshalJSON is the custom marshaler for TaskTypeDetails. +func (ttd TaskTypeDetails) MarshalJSON() ([]byte, error) { + ttd.InstanceType = InstanceTypeTaskTypeDetails + objectMap := make(map[string]interface{}) + if ttd.InstanceType != "" { + objectMap["instanceType"] = ttd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return &ttd, true +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &ttd, true +} + +// TestFailoverCleanupInput input definition for test failover cleanup. +type TestFailoverCleanupInput struct { + // Properties - Test failover cleanup input properties. + Properties *TestFailoverCleanupInputProperties `json:"properties,omitempty"` +} + +// TestFailoverCleanupInputProperties input definition for test failover cleanup input properties. +type TestFailoverCleanupInputProperties struct { + // Comments - Test failover cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// TestFailoverInput input definition for test failover. +type TestFailoverInput struct { + // Properties - Test failover input properties. + Properties *TestFailoverInputProperties `json:"properties,omitempty"` +} + +// TestFailoverInputProperties input definition for test failover input properties. +type TestFailoverInputProperties struct { + // FailoverDirection - Test failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // NetworkType - Network type to be used for test failover. + NetworkType *string `json:"networkType,omitempty"` + // NetworkID - The id of the network to be used for test failover. + NetworkID *string `json:"networkId,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicTestFailoverProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TestFailoverInputProperties struct. +func (tfip *TestFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + tfip.FailoverDirection = &failoverDirection + } + case "networkType": + if v != nil { + var networkType string + err = json.Unmarshal(*v, &networkType) + if err != nil { + return err + } + tfip.NetworkType = &networkType + } + case "networkId": + if v != nil { + var networkID string + err = json.Unmarshal(*v, &networkID) + if err != nil { + return err + } + tfip.NetworkID = &networkID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicTestFailoverProviderSpecificInput(*v) + if err != nil { + return err + } + tfip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// TestFailoverJobDetails this class represents the details for a test failover job. +type TestFailoverJobDetails struct { + // TestFailoverStatus - The test failover status. + TestFailoverStatus *string `json:"testFailoverStatus,omitempty"` + // Comments - The test failover comments. + Comments *string `json:"comments,omitempty"` + // NetworkName - The test network name. + NetworkName *string `json:"networkName,omitempty"` + // NetworkFriendlyName - The test network friendly name. + NetworkFriendlyName *string `json:"networkFriendlyName,omitempty"` + // NetworkType - The test network type (see TestFailoverInput enum for possible values). + NetworkType *string `json:"networkType,omitempty"` + // ProtectedItemDetails - The test VM details. + ProtectedItemDetails *[]FailoverReplicationProtectedItemDetails `json:"protectedItemDetails,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) MarshalJSON() ([]byte, error) { + tfjd.InstanceType = InstanceTypeTestFailoverJobDetails + objectMap := make(map[string]interface{}) + if tfjd.TestFailoverStatus != nil { + objectMap["testFailoverStatus"] = tfjd.TestFailoverStatus + } + if tfjd.Comments != nil { + objectMap["comments"] = tfjd.Comments + } + if tfjd.NetworkName != nil { + objectMap["networkName"] = tfjd.NetworkName + } + if tfjd.NetworkFriendlyName != nil { + objectMap["networkFriendlyName"] = tfjd.NetworkFriendlyName + } + if tfjd.NetworkType != nil { + objectMap["networkType"] = tfjd.NetworkType + } + if tfjd.ProtectedItemDetails != nil { + objectMap["protectedItemDetails"] = tfjd.ProtectedItemDetails + } + if tfjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = tfjd.AffectedObjectDetails + } + if tfjd.InstanceType != "" { + objectMap["instanceType"] = tfjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return &tfjd, true +} + +// AsJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &tfjd, true +} + +// BasicTestFailoverProviderSpecificInput provider specific test failover input. +type BasicTestFailoverProviderSpecificInput interface { + AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) + AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) + AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) + AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) + AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) + AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) +} + +// TestFailoverProviderSpecificInput provider specific test failover input. +type TestFailoverProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicTestFailoverProviderSpecificInput(body []byte) (BasicTestFailoverProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A): + var atfi A2ATestFailoverInput + err := json.Unmarshal(body, &atfi) + return atfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvratfi HyperVReplicaAzureTestFailoverInput + err := json.Unmarshal(body, &hvratfi) + return hvratfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2): + var imavtfi InMageAzureV2TestFailoverInput + err := json.Unmarshal(body, &imavtfi) + return imavtfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm): + var imrtfi InMageRcmTestFailoverInput + err := json.Unmarshal(body, &imrtfi) + return imrtfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage): + var imtfi InMageTestFailoverInput + err := json.Unmarshal(body, &imtfi) + return imtfi, err + default: + var tfpsi TestFailoverProviderSpecificInput + err := json.Unmarshal(body, &tfpsi) + return tfpsi, err + } +} +func unmarshalBasicTestFailoverProviderSpecificInputArray(body []byte) ([]BasicTestFailoverProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tfpsiArray := make([]BasicTestFailoverProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + tfpsi, err := unmarshalBasicTestFailoverProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + tfpsiArray[index] = tfpsi + } + return tfpsiArray, nil +} + +// MarshalJSON is the custom marshaler for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) MarshalJSON() ([]byte, error) { + tfpsi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput + objectMap := make(map[string]interface{}) + if tfpsi.InstanceType != "" { + objectMap["instanceType"] = tfpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return &tfpsi, true +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &tfpsi, true +} + +// TestMigrateCleanupInput input for test migrate cleanup. +type TestMigrateCleanupInput struct { + // Properties - Test migrate cleanup input properties. + Properties *TestMigrateCleanupInputProperties `json:"properties,omitempty"` +} + +// TestMigrateCleanupInputProperties test migrate cleanup input properties. +type TestMigrateCleanupInputProperties struct { + // Comments - Test migrate cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// TestMigrateInput input for test migrate. +type TestMigrateInput struct { + // Properties - Test migrate input properties. + Properties *TestMigrateInputProperties `json:"properties,omitempty"` +} + +// TestMigrateInputProperties test migrate input properties. +type TestMigrateInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicTestMigrateProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TestMigrateInputProperties struct. +func (tmip *TestMigrateInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicTestMigrateProviderSpecificInput(*v) + if err != nil { + return err + } + tmip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicTestMigrateProviderSpecificInput test migrate provider specific input. +type BasicTestMigrateProviderSpecificInput interface { + AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) + AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) +} + +// TestMigrateProviderSpecificInput test migrate provider specific input. +type TestMigrateProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput', 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicTestMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicTestMigrateProviderSpecificInput(body []byte) (BasicTestMigrateProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt): + var vmctmi VMwareCbtTestMigrateInput + err := json.Unmarshal(body, &vmctmi) + return vmctmi, err + default: + var tmpsi TestMigrateProviderSpecificInput + err := json.Unmarshal(body, &tmpsi) + return tmpsi, err + } +} +func unmarshalBasicTestMigrateProviderSpecificInputArray(body []byte) ([]BasicTestMigrateProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tmpsiArray := make([]BasicTestMigrateProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + tmpsi, err := unmarshalBasicTestMigrateProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + tmpsiArray[index] = tmpsi + } + return tmpsiArray, nil +} + +// MarshalJSON is the custom marshaler for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) MarshalJSON() ([]byte, error) { + tmpsi.InstanceType = InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput + objectMap := make(map[string]interface{}) + if tmpsi.InstanceType != "" { + objectMap["instanceType"] = tmpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtTestMigrateInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) { + return nil, false +} + +// AsTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) { + return &tmpsi, true +} + +// AsBasicTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsBasicTestMigrateProviderSpecificInput() (BasicTestMigrateProviderSpecificInput, bool) { + return &tmpsi, true +} + +// UnplannedFailoverInput input definition for unplanned failover. +type UnplannedFailoverInput struct { + // Properties - Unplanned failover input properties. + Properties *UnplannedFailoverInputProperties `json:"properties,omitempty"` +} + +// UnplannedFailoverInputProperties input definition for unplanned failover input properties. +type UnplannedFailoverInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // SourceSiteOperations - Source site operations status. + SourceSiteOperations *string `json:"sourceSiteOperations,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicUnplannedFailoverProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UnplannedFailoverInputProperties struct. +func (ufip *UnplannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + ufip.FailoverDirection = &failoverDirection + } + case "sourceSiteOperations": + if v != nil { + var sourceSiteOperations string + err = json.Unmarshal(*v, &sourceSiteOperations) + if err != nil { + return err + } + ufip.SourceSiteOperations = &sourceSiteOperations + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUnplannedFailoverProviderSpecificInput(*v) + if err != nil { + return err + } + ufip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUnplannedFailoverProviderSpecificInput provider specific unplanned failover input. +type BasicUnplannedFailoverProviderSpecificInput interface { + AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) + AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) + AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) + AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) + AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) + AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) +} + +// UnplannedFailoverProviderSpecificInput provider specific unplanned failover input. +type UnplannedFailoverProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUnplannedFailoverProviderSpecificInput(body []byte) (BasicUnplannedFailoverProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A): + var aufi A2AUnplannedFailoverInput + err := json.Unmarshal(body, &aufi) + return aufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraufi HyperVReplicaAzureUnplannedFailoverInput + err := json.Unmarshal(body, &hvraufi) + return hvraufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2): + var imavufi InMageAzureV2UnplannedFailoverInput + err := json.Unmarshal(body, &imavufi) + return imavufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm): + var imrufi InMageRcmUnplannedFailoverInput + err := json.Unmarshal(body, &imrufi) + return imrufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage): + var imufi InMageUnplannedFailoverInput + err := json.Unmarshal(body, &imufi) + return imufi, err + default: + var ufpsi UnplannedFailoverProviderSpecificInput + err := json.Unmarshal(body, &ufpsi) + return ufpsi, err + } +} +func unmarshalBasicUnplannedFailoverProviderSpecificInputArray(body []byte) ([]BasicUnplannedFailoverProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ufpsiArray := make([]BasicUnplannedFailoverProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ufpsi, err := unmarshalBasicUnplannedFailoverProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + ufpsiArray[index] = ufpsi + } + return ufpsiArray, nil +} + +// MarshalJSON is the custom marshaler for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) MarshalJSON() ([]byte, error) { + ufpsi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput + objectMap := make(map[string]interface{}) + if ufpsi.InstanceType != "" { + objectMap["instanceType"] = ufpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return &ufpsi, true +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &ufpsi, true +} + +// UpdateMigrationItemInput update migration item input. +type UpdateMigrationItemInput struct { + // Properties - Update migration item input properties. + Properties *UpdateMigrationItemInputProperties `json:"properties,omitempty"` +} + +// UpdateMigrationItemInputProperties update migration item input properties. +type UpdateMigrationItemInputProperties struct { + // ProviderSpecificDetails - The provider specific input to update migration item. + ProviderSpecificDetails BasicUpdateMigrationItemProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateMigrationItemInputProperties struct. +func (umiip *UpdateMigrationItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateMigrationItemProviderSpecificInput(*v) + if err != nil { + return err + } + umiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateMigrationItemProviderSpecificInput update migration item provider specific input. +type BasicUpdateMigrationItemProviderSpecificInput interface { + AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) + AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) +} + +// UpdateMigrationItemProviderSpecificInput update migration item provider specific input. +type UpdateMigrationItemProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput', 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicUpdateMigrationItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateMigrationItemProviderSpecificInput(body []byte) (BasicUpdateMigrationItemProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt): + var vmcumii VMwareCbtUpdateMigrationItemInput + err := json.Unmarshal(body, &vmcumii) + return vmcumii, err + default: + var umipsi UpdateMigrationItemProviderSpecificInput + err := json.Unmarshal(body, &umipsi) + return umipsi, err + } +} +func unmarshalBasicUpdateMigrationItemProviderSpecificInputArray(body []byte) ([]BasicUpdateMigrationItemProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + umipsiArray := make([]BasicUpdateMigrationItemProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + umipsi, err := unmarshalBasicUpdateMigrationItemProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + umipsiArray[index] = umipsi + } + return umipsiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) MarshalJSON() ([]byte, error) { + umipsi.InstanceType = InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput + objectMap := make(map[string]interface{}) + if umipsi.InstanceType != "" { + objectMap["instanceType"] = umipsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtUpdateMigrationItemInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) { + return nil, false +} + +// AsUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) { + return &umipsi, true +} + +// AsBasicUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsBasicUpdateMigrationItemProviderSpecificInput() (BasicUpdateMigrationItemProviderSpecificInput, bool) { + return &umipsi, true +} + +// UpdateMobilityServiceRequest request to update the mobility service on a protected item. +type UpdateMobilityServiceRequest struct { + // Properties - The properties of the update mobility service request. + Properties *UpdateMobilityServiceRequestProperties `json:"properties,omitempty"` +} + +// UpdateMobilityServiceRequestProperties the properties of an update mobility service request. +type UpdateMobilityServiceRequestProperties struct { + // RunAsAccountID - The CS run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// UpdateNetworkMappingInput update network mapping input. +type UpdateNetworkMappingInput struct { + // Properties - The input properties needed to update network mapping. + Properties *UpdateNetworkMappingInputProperties `json:"properties,omitempty"` +} + +// UpdateNetworkMappingInputProperties common input details for network mapping operation. +type UpdateNetworkMappingInputProperties struct { + // RecoveryFabricName - Recovery fabric name. + RecoveryFabricName *string `json:"recoveryFabricName,omitempty"` + // RecoveryNetworkID - Recovery network Id. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // FabricSpecificDetails - Fabrics specific input network Id. + FabricSpecificDetails BasicFabricSpecificUpdateNetworkMappingInput `json:"fabricSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateNetworkMappingInputProperties struct. +func (unmip *UpdateNetworkMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryFabricName": + if v != nil { + var recoveryFabricName string + err = json.Unmarshal(*v, &recoveryFabricName) + if err != nil { + return err + } + unmip.RecoveryFabricName = &recoveryFabricName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + unmip.RecoveryNetworkID = &recoveryNetworkID + } + case "fabricSpecificDetails": + if v != nil { + fabricSpecificDetails, err := unmarshalBasicFabricSpecificUpdateNetworkMappingInput(*v) + if err != nil { + return err + } + unmip.FabricSpecificDetails = fabricSpecificDetails + } + } + } + + return nil +} + +// UpdatePolicyInput update policy input. +type UpdatePolicyInput struct { + // Properties - The ReplicationProviderSettings. + Properties *UpdatePolicyInputProperties `json:"properties,omitempty"` +} + +// UpdatePolicyInputProperties policy update properties. +type UpdatePolicyInputProperties struct { + // ReplicationProviderSettings - The ReplicationProviderSettings. + ReplicationProviderSettings BasicPolicyProviderSpecificInput `json:"replicationProviderSettings,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdatePolicyInputProperties struct. +func (upip *UpdatePolicyInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "replicationProviderSettings": + if v != nil { + replicationProviderSettings, err := unmarshalBasicPolicyProviderSpecificInput(*v) + if err != nil { + return err + } + upip.ReplicationProviderSettings = replicationProviderSettings + } + } + } + + return nil +} + +// UpdateProtectionContainerMappingInput container pairing update input. +type UpdateProtectionContainerMappingInput struct { + // Properties - Update protection container mapping input properties. + Properties *UpdateProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// UpdateProtectionContainerMappingInputProperties container pairing update input. +type UpdateProtectionContainerMappingInputProperties struct { + // ProviderSpecificInput - Provider specific input for updating protection container mapping. + ProviderSpecificInput BasicReplicationProviderSpecificUpdateContainerMappingInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateProtectionContainerMappingInputProperties struct. +func (upcmip *UpdateProtectionContainerMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(*v) + if err != nil { + return err + } + upcmip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// UpdateRecoveryPlanInput update recovery plan input class. +type UpdateRecoveryPlanInput struct { + // Properties - Recovery plan update properties. + Properties *UpdateRecoveryPlanInputProperties `json:"properties,omitempty"` +} + +// UpdateRecoveryPlanInputProperties recovery plan update properties. +type UpdateRecoveryPlanInputProperties struct { + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` +} + +// UpdateReplicationProtectedItemInput update replication protected item input. +type UpdateReplicationProtectedItemInput struct { + // Properties - Update replication protected item properties. + Properties *UpdateReplicationProtectedItemInputProperties `json:"properties,omitempty"` +} + +// UpdateReplicationProtectedItemInputProperties update protected item input properties. +type UpdateReplicationProtectedItemInputProperties struct { + // RecoveryAzureVMName - Target Azure VM name given by the user. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureVMSize - Target Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // SelectedRecoveryAzureNetworkID - Target Azure Network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The Azure Network Id for test failover. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // VMNics - The list of VM nic details. + VMNics *[]VMNicInputDetails `json:"vmNics,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // RecoveryAvailabilitySetID - The target availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // ProviderSpecificDetails - The provider specific input to update replication protected item. + ProviderSpecificDetails BasicUpdateReplicationProtectedItemProviderInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateReplicationProtectedItemInputProperties struct. +func (urpiip *UpdateReplicationProtectedItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryAzureVMName": + if v != nil { + var recoveryAzureVMName string + err = json.Unmarshal(*v, &recoveryAzureVMName) + if err != nil { + return err + } + urpiip.RecoveryAzureVMName = &recoveryAzureVMName + } + case "recoveryAzureVMSize": + if v != nil { + var recoveryAzureVMSize string + err = json.Unmarshal(*v, &recoveryAzureVMSize) + if err != nil { + return err + } + urpiip.RecoveryAzureVMSize = &recoveryAzureVMSize + } + case "selectedRecoveryAzureNetworkId": + if v != nil { + var selectedRecoveryAzureNetworkID string + err = json.Unmarshal(*v, &selectedRecoveryAzureNetworkID) + if err != nil { + return err + } + urpiip.SelectedRecoveryAzureNetworkID = &selectedRecoveryAzureNetworkID + } + case "selectedTfoAzureNetworkId": + if v != nil { + var selectedTfoAzureNetworkID string + err = json.Unmarshal(*v, &selectedTfoAzureNetworkID) + if err != nil { + return err + } + urpiip.SelectedTfoAzureNetworkID = &selectedTfoAzureNetworkID + } + case "selectedSourceNicId": + if v != nil { + var selectedSourceNicID string + err = json.Unmarshal(*v, &selectedSourceNicID) + if err != nil { + return err + } + urpiip.SelectedSourceNicID = &selectedSourceNicID + } + case "enableRdpOnTargetOption": + if v != nil { + var enableRdpOnTargetOption string + err = json.Unmarshal(*v, &enableRdpOnTargetOption) + if err != nil { + return err + } + urpiip.EnableRdpOnTargetOption = &enableRdpOnTargetOption + } + case "vmNics": + if v != nil { + var VMNics []VMNicInputDetails + err = json.Unmarshal(*v, &VMNics) + if err != nil { + return err + } + urpiip.VMNics = &VMNics + } + case "licenseType": + if v != nil { + var licenseType LicenseType + err = json.Unmarshal(*v, &licenseType) + if err != nil { + return err + } + urpiip.LicenseType = licenseType + } + case "recoveryAvailabilitySetId": + if v != nil { + var recoveryAvailabilitySetID string + err = json.Unmarshal(*v, &recoveryAvailabilitySetID) + if err != nil { + return err + } + urpiip.RecoveryAvailabilitySetID = &recoveryAvailabilitySetID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateReplicationProtectedItemProviderInput(*v) + if err != nil { + return err + } + urpiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateReplicationProtectedItemProviderInput update replication protected item provider specific input. +type BasicUpdateReplicationProtectedItemProviderInput interface { + AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) + AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) + AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) + AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) + AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) +} + +// UpdateReplicationProtectedItemProviderInput update replication protected item provider specific input. +type UpdateReplicationProtectedItemProviderInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateReplicationProtectedItemProviderInput(body []byte) (BasicUpdateReplicationProtectedItemProviderInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A): + var aurpii A2AUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &aurpii) + return aurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure): + var hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &hvraurpii) + return hvraurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2): + var imavurpii InMageAzureV2UpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &imavurpii) + return imavurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm): + var imrurpii InMageRcmUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &imrurpii) + return imrurpii, err + default: + var urpipi UpdateReplicationProtectedItemProviderInput + err := json.Unmarshal(body, &urpipi) + return urpipi, err + } +} +func unmarshalBasicUpdateReplicationProtectedItemProviderInputArray(body []byte) ([]BasicUpdateReplicationProtectedItemProviderInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + urpipiArray := make([]BasicUpdateReplicationProtectedItemProviderInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + urpipi, err := unmarshalBasicUpdateReplicationProtectedItemProviderInput(*rawMessage) + if err != nil { + return nil, err + } + urpipiArray[index] = urpipi + } + return urpipiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) MarshalJSON() ([]byte, error) { + urpipi.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput + objectMap := make(map[string]interface{}) + if urpipi.InstanceType != "" { + objectMap["instanceType"] = urpipi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return &urpipi, true +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &urpipi, true +} + +// UpdateVCenterRequest input required to update vCenter. +type UpdateVCenterRequest struct { + // Properties - The update VCenter Request Properties. + Properties *UpdateVCenterRequestProperties `json:"properties,omitempty"` +} + +// UpdateVCenterRequestProperties the properties of an update vCenter request. +type UpdateVCenterRequestProperties struct { + // FriendlyName - The friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the vCenter to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // ProcessServerID - The process server Id from where the update can be orchestrated. + ProcessServerID *string `json:"processServerId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The CS account Id which has privileges to update the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// VaultHealthDetails vault health details definition. +type VaultHealthDetails struct { + autorest.Response `json:"-"` + // Properties - The vault health related data. + Properties *VaultHealthProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VaultHealthDetails. +func (vhd VaultHealthDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vhd.Properties != nil { + objectMap["properties"] = vhd.Properties + } + if vhd.Location != nil { + objectMap["location"] = vhd.Location + } + return json.Marshal(objectMap) +} + +// VaultHealthProperties class to define the health summary of the Vault. +type VaultHealthProperties struct { + // VaultErrors - The list of errors on the vault. + VaultErrors *[]HealthError `json:"vaultErrors,omitempty"` + // ProtectedItemsHealth - The list of the health detail of the protected items in the vault. + ProtectedItemsHealth *ResourceHealthSummary `json:"protectedItemsHealth,omitempty"` + // FabricsHealth - The list of the health detail of the fabrics in the vault. + FabricsHealth *ResourceHealthSummary `json:"fabricsHealth,omitempty"` + // ContainersHealth - The list of the health detail of the containers in the vault. + ContainersHealth *ResourceHealthSummary `json:"containersHealth,omitempty"` +} + +// VaultSetting vault setting. +type VaultSetting struct { + autorest.Response `json:"-"` + // Properties - The vault setting properties. + Properties *VaultSettingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VaultSetting. +func (vs VaultSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vs.Properties != nil { + objectMap["properties"] = vs.Properties + } + if vs.Location != nil { + objectMap["location"] = vs.Location + } + return json.Marshal(objectMap) +} + +// VaultSettingCollection vault setting collection. +type VaultSettingCollection struct { + autorest.Response `json:"-"` + // Value - The list of vault setting. + Value *[]VaultSetting `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// VaultSettingCollectionIterator provides access to a complete listing of VaultSetting values. +type VaultSettingCollectionIterator struct { + i int + page VaultSettingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VaultSettingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VaultSettingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VaultSettingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VaultSettingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VaultSettingCollectionIterator) Response() VaultSettingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VaultSettingCollectionIterator) Value() VaultSetting { + if !iter.page.NotDone() { + return VaultSetting{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VaultSettingCollectionIterator type. +func NewVaultSettingCollectionIterator(page VaultSettingCollectionPage) VaultSettingCollectionIterator { + return VaultSettingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vsc VaultSettingCollection) IsEmpty() bool { + return vsc.Value == nil || len(*vsc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vsc VaultSettingCollection) hasNextLink() bool { + return vsc.NextLink != nil && len(*vsc.NextLink) != 0 +} + +// vaultSettingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vsc VaultSettingCollection) vaultSettingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !vsc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vsc.NextLink))) +} + +// VaultSettingCollectionPage contains a page of VaultSetting values. +type VaultSettingCollectionPage struct { + fn func(context.Context, VaultSettingCollection) (VaultSettingCollection, error) + vsc VaultSettingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VaultSettingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VaultSettingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vsc) + if err != nil { + return err + } + page.vsc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VaultSettingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VaultSettingCollectionPage) NotDone() bool { + return !page.vsc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VaultSettingCollectionPage) Response() VaultSettingCollection { + return page.vsc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VaultSettingCollectionPage) Values() []VaultSetting { + if page.vsc.IsEmpty() { + return nil + } + return *page.vsc.Value +} + +// Creates a new instance of the VaultSettingCollectionPage type. +func NewVaultSettingCollectionPage(cur VaultSettingCollection, getNextPage func(context.Context, VaultSettingCollection) (VaultSettingCollection, error)) VaultSettingCollectionPage { + return VaultSettingCollectionPage{ + fn: getNextPage, + vsc: cur, + } +} + +// VaultSettingCreationInput input to create vault setting. +type VaultSettingCreationInput struct { + // Properties - Vault setting creation input properties. + Properties *VaultSettingCreationInputProperties `json:"properties,omitempty"` +} + +// VaultSettingCreationInputProperties input to create vault setting. +type VaultSettingCreationInputProperties struct { + // MigrationSolutionID - The migration solution Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` +} + +// VaultSettingProperties vault setting properties. +type VaultSettingProperties struct { + // MigrationSolutionID - The migration solution ARM Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` +} + +// VCenter vCenter definition. +type VCenter struct { + autorest.Response `json:"-"` + // Properties - VCenter related data. + Properties *VCenterProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VCenter. +func (vc VCenter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vc.Properties != nil { + objectMap["properties"] = vc.Properties + } + if vc.Location != nil { + objectMap["location"] = vc.Location + } + return json.Marshal(objectMap) +} + +// VCenterCollection collection of vCenter details. +type VCenterCollection struct { + autorest.Response `json:"-"` + // Value - The vCenter details. + Value *[]VCenter `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// VCenterCollectionIterator provides access to a complete listing of VCenter values. +type VCenterCollectionIterator struct { + i int + page VCenterCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VCenterCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VCenterCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VCenterCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VCenterCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VCenterCollectionIterator) Response() VCenterCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VCenterCollectionIterator) Value() VCenter { + if !iter.page.NotDone() { + return VCenter{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VCenterCollectionIterator type. +func NewVCenterCollectionIterator(page VCenterCollectionPage) VCenterCollectionIterator { + return VCenterCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vcc VCenterCollection) IsEmpty() bool { + return vcc.Value == nil || len(*vcc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vcc VCenterCollection) hasNextLink() bool { + return vcc.NextLink != nil && len(*vcc.NextLink) != 0 +} + +// vCenterCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vcc VCenterCollection) vCenterCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !vcc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vcc.NextLink))) +} + +// VCenterCollectionPage contains a page of VCenter values. +type VCenterCollectionPage struct { + fn func(context.Context, VCenterCollection) (VCenterCollection, error) + vcc VCenterCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VCenterCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VCenterCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vcc) + if err != nil { + return err + } + page.vcc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VCenterCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VCenterCollectionPage) NotDone() bool { + return !page.vcc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VCenterCollectionPage) Response() VCenterCollection { + return page.vcc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VCenterCollectionPage) Values() []VCenter { + if page.vcc.IsEmpty() { + return nil + } + return *page.vcc.Value +} + +// Creates a new instance of the VCenterCollectionPage type. +func NewVCenterCollectionPage(cur VCenterCollection, getNextPage func(context.Context, VCenterCollection) (VCenterCollection, error)) VCenterCollectionPage { + return VCenterCollectionPage{ + fn: getNextPage, + vcc: cur, + } +} + +// VCenterProperties vCenter properties. +type VCenterProperties struct { + // FriendlyName - Friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // InternalID - VCenter internal ID. + InternalID *string `json:"internalId,omitempty"` + // LastHeartbeat - The time when the last heartbeat was received by vCenter. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // DiscoveryStatus - The VCenter discovery status. + DiscoveryStatus *string `json:"discoveryStatus,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // IPAddress - The IP address of the vCenter. + IPAddress *string `json:"ipAddress,omitempty"` + // InfrastructureID - The infrastructure Id of vCenter. + InfrastructureID *string `json:"infrastructureId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The account Id which has privileges to discover the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // FabricArmResourceName - The ARM resource name of the fabric containing this VCenter. + FabricArmResourceName *string `json:"fabricArmResourceName,omitempty"` + // HealthErrors - The health errors for this VCenter. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// VersionDetails version related details. +type VersionDetails struct { + // Version - The agent version. + Version *string `json:"version,omitempty"` + // ExpiryDate - Version expiry date. + ExpiryDate *date.Time `json:"expiryDate,omitempty"` + // Status - A value indicating whether security update required. Possible values include: 'Supported', 'NotSupported', 'Deprecated', 'UpdateRequired', 'SecurityUpdateRequired' + Status AgentVersionStatus `json:"status,omitempty"` +} + +// VirtualMachineTaskDetails this class represents the virtual machine task details. +type VirtualMachineTaskDetails struct { + // SkippedReason - The skipped reason. + SkippedReason *string `json:"skippedReason,omitempty"` + // SkippedReasonString - The skipped reason string. + SkippedReasonString *string `json:"skippedReasonString,omitempty"` + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) MarshalJSON() ([]byte, error) { + vmtd.InstanceType = InstanceTypeVirtualMachineTaskDetails + objectMap := make(map[string]interface{}) + if vmtd.SkippedReason != nil { + objectMap["skippedReason"] = vmtd.SkippedReason + } + if vmtd.SkippedReasonString != nil { + objectMap["skippedReasonString"] = vmtd.SkippedReasonString + } + if vmtd.JobTask != nil { + objectMap["jobTask"] = vmtd.JobTask + } + if vmtd.InstanceType != "" { + objectMap["instanceType"] = vmtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &vmtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return &vmtd, true +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &vmtd, true +} + +// VmmDetails VMM fabric specific details. +type VmmDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmDetails. +func (vd VmmDetails) MarshalJSON() ([]byte, error) { + vd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM + objectMap := make(map[string]interface{}) + if vd.InstanceType != "" { + objectMap["instanceType"] = vd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVmmDetails() (*VmmDetails, bool) { + return &vd, true +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vd, true +} + +// VmmToAzureCreateNetworkMappingInput create network mappings input properties/behavior specific to Vmm to +// Azure Network mapping. +type VmmToAzureCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtacnmi.InstanceType = InstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtacnmi.InstanceType != "" { + objectMap["instanceType"] = vtacnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return &vtacnmi, true +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &vtacnmi, true +} + +// VmmToAzureNetworkMappingSettings e2A Network Mapping fabric specific settings. +type VmmToAzureNetworkMappingSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) MarshalJSON() ([]byte, error) { + vtanms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtanms.InstanceType != "" { + objectMap["instanceType"] = vtanms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return &vtanms, true +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &vtanms, true +} + +// VmmToAzureUpdateNetworkMappingInput update network mappings input properties/behavior specific to vmm to +// azure. +type VmmToAzureUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtaunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtaunmi.InstanceType != "" { + objectMap["instanceType"] = vtaunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return &vtaunmi, true +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &vtaunmi, true +} + +// VmmToVmmCreateNetworkMappingInput create network mappings input properties/behavior specific to vmm to +// vmm Network mapping. +type VmmToVmmCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtvcnmi.InstanceType = InstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvcnmi.InstanceType != "" { + objectMap["instanceType"] = vtvcnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return &vtvcnmi, true +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &vtvcnmi, true +} + +// VmmToVmmNetworkMappingSettings e2E Network Mapping fabric specific settings. +type VmmToVmmNetworkMappingSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) MarshalJSON() ([]byte, error) { + vtvnms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvnms.InstanceType != "" { + objectMap["instanceType"] = vtvnms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return &vtvnms, true +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &vtvnms, true +} + +// VmmToVmmUpdateNetworkMappingInput update network mappings input properties/behavior specific to vmm to +// vmm. +type VmmToVmmUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtvunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvunmi.InstanceType != "" { + objectMap["instanceType"] = vtvunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return &vtvunmi, true +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &vtvunmi, true +} + +// VmmVirtualMachineDetails VMM fabric provider specific VM settings. +type VmmVirtualMachineDetails struct { + // SourceItemID - The source id of the object. + SourceItemID *string `json:"sourceItemId,omitempty"` + // Generation - The id of the object in fabric. + Generation *string `json:"generation,omitempty"` + // OsDetails - The Last replication time. + OsDetails *OSDetails `json:"osDetails,omitempty"` + // DiskDetails - The Last successful failover time. + DiskDetails *[]DiskDetails `json:"diskDetails,omitempty"` + // HasPhysicalDisk - A value indicating whether the VM has a physical disk attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasPhysicalDisk PresenceStatus `json:"hasPhysicalDisk,omitempty"` + // HasFibreChannelAdapter - A value indicating whether the VM has a fibre channel adapter attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasFibreChannelAdapter PresenceStatus `json:"hasFibreChannelAdapter,omitempty"` + // HasSharedVhd - A value indicating whether the VM has a shared VHD attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasSharedVhd PresenceStatus `json:"hasSharedVhd,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) MarshalJSON() ([]byte, error) { + vvmd.InstanceType = InstanceTypeVmmVirtualMachine + objectMap := make(map[string]interface{}) + if vvmd.SourceItemID != nil { + objectMap["sourceItemId"] = vvmd.SourceItemID + } + if vvmd.Generation != nil { + objectMap["generation"] = vvmd.Generation + } + if vvmd.OsDetails != nil { + objectMap["osDetails"] = vvmd.OsDetails + } + if vvmd.DiskDetails != nil { + objectMap["diskDetails"] = vvmd.DiskDetails + } + if vvmd.HasPhysicalDisk != "" { + objectMap["hasPhysicalDisk"] = vvmd.HasPhysicalDisk + } + if vvmd.HasFibreChannelAdapter != "" { + objectMap["hasFibreChannelAdapter"] = vvmd.HasFibreChannelAdapter + } + if vvmd.HasSharedVhd != "" { + objectMap["hasSharedVhd"] = vvmd.HasSharedVhd + } + if vvmd.InstanceType != "" { + objectMap["instanceType"] = vvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return &vvmd, true +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return &vvmd, true +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &vvmd, true +} + +// VMNicDetails hyper V VM network details. +type VMNicDetails struct { + // NicID - The nic Id. + NicID *string `json:"nicId,omitempty"` + // ReplicaNicID - The replica nic Id. + ReplicaNicID *string `json:"replicaNicId,omitempty"` + // SourceNicArmID - The source nic ARM Id. + SourceNicArmID *string `json:"sourceNicArmId,omitempty"` + // VMNetworkName - VM network name. + VMNetworkName *string `json:"vMNetworkName,omitempty"` + // RecoveryVMNetworkID - Recovery VM network Id. + RecoveryVMNetworkID *string `json:"recoveryVMNetworkId,omitempty"` + // IPConfigs - The IP configurations of the NIC. + IPConfigs *[]IPConfigDetails `json:"ipConfigs,omitempty"` + // SelectionType - Selection type for failover. + SelectionType *string `json:"selectionType,omitempty"` + // RecoveryNetworkSecurityGroupID - The id of the NSG associated with the NIC. + RecoveryNetworkSecurityGroupID *string `json:"recoveryNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnRecovery - A value indicating whether the NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnRecovery *bool `json:"enableAcceleratedNetworkingOnRecovery,omitempty"` + // TfoVMNetworkID - The network to be used by NIC during test failover. + TfoVMNetworkID *string `json:"tfoVMNetworkId,omitempty"` + // TfoNetworkSecurityGroupID - The NSG to be used by NIC during test failover. + TfoNetworkSecurityGroupID *string `json:"tfoNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnTfo - Whether the TFO NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnTfo *bool `json:"enableAcceleratedNetworkingOnTfo,omitempty"` + // RecoveryNicName - The name of the NIC to be used when creating target NICs. + RecoveryNicName *string `json:"recoveryNicName,omitempty"` + // RecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs. + RecoveryNicResourceGroupName *string `json:"recoveryNicResourceGroupName,omitempty"` + // ReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during failover subject to availability. + ReuseExistingNic *bool `json:"reuseExistingNic,omitempty"` + // TfoRecoveryNicName - The name of the NIC to be used when creating target NICs in TFO. + TfoRecoveryNicName *string `json:"tfoRecoveryNicName,omitempty"` + // TfoRecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs in TFO. + TfoRecoveryNicResourceGroupName *string `json:"tfoRecoveryNicResourceGroupName,omitempty"` + // TfoReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during test failover subject to availability. + TfoReuseExistingNic *bool `json:"tfoReuseExistingNic,omitempty"` +} + +// VMNicInputDetails hyper V VM network input details. +type VMNicInputDetails struct { + // NicID - The nic Id. + NicID *string `json:"nicId,omitempty"` + // IPConfigs - The IP configurations to be used by NIC during test failover and failover. + IPConfigs *[]IPConfigInputDetails `json:"ipConfigs,omitempty"` + // SelectionType - Selection type for failover. + SelectionType *string `json:"selectionType,omitempty"` + // RecoveryNetworkSecurityGroupID - The id of the NSG associated with the NIC. + RecoveryNetworkSecurityGroupID *string `json:"recoveryNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnRecovery - Whether the NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnRecovery *bool `json:"enableAcceleratedNetworkingOnRecovery,omitempty"` + // TfoNetworkSecurityGroupID - The NSG to be used by NIC during test failover. + TfoNetworkSecurityGroupID *string `json:"tfoNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnTfo - Whether the test NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnTfo *bool `json:"enableAcceleratedNetworkingOnTfo,omitempty"` + // RecoveryNicName - The name of the NIC to be used when creating target NICs. + RecoveryNicName *string `json:"recoveryNicName,omitempty"` + // RecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs. + RecoveryNicResourceGroupName *string `json:"recoveryNicResourceGroupName,omitempty"` + // ReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during failover subject to availability. + ReuseExistingNic *bool `json:"reuseExistingNic,omitempty"` + // TfoNicName - The name of the NIC to be used when creating target NICs in TFO. + TfoNicName *string `json:"tfoNicName,omitempty"` + // TfoNicResourceGroupName - The resource group of the NIC to be used when creating target NICs in TFO. + TfoNicResourceGroupName *string `json:"tfoNicResourceGroupName,omitempty"` + // TfoReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during test failover subject to availability. + TfoReuseExistingNic *bool `json:"tfoReuseExistingNic,omitempty"` +} + +// VMNicUpdatesTaskDetails this class represents the vm NicUpdates task details. +type VMNicUpdatesTaskDetails struct { + // VMID - Virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // NicID - Nic Id. + NicID *string `json:"nicId,omitempty"` + // Name - Name of the Nic. + Name *string `json:"name,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) MarshalJSON() ([]byte, error) { + vnutd.InstanceType = InstanceTypeVMNicUpdatesTaskDetails + objectMap := make(map[string]interface{}) + if vnutd.VMID != nil { + objectMap["vmId"] = vnutd.VMID + } + if vnutd.NicID != nil { + objectMap["nicId"] = vnutd.NicID + } + if vnutd.Name != nil { + objectMap["name"] = vnutd.Name + } + if vnutd.InstanceType != "" { + objectMap["instanceType"] = vnutd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return &vnutd, true +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &vnutd, true +} + +// VMwareCbtContainerCreationInput vMwareCbt container creation input. +type VMwareCbtContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) MarshalJSON() ([]byte, error) { + vmccci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmccci.InstanceType != "" { + objectMap["instanceType"] = vmccci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return &vmccci, true +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &vmccci, true +} + +// VMwareCbtContainerMappingInput vMwareCbt container mapping input. +type VMwareCbtContainerMappingInput struct { + // KeyVaultID - The target key vault ARM Id. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyVaultURI - The target key vault URL. + KeyVaultURI *string `json:"keyVaultUri,omitempty"` + // StorageAccountID - The storage account ARM Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // StorageAccountSasSecretName - The secret name of the storage account. + StorageAccountSasSecretName *string `json:"storageAccountSasSecretName,omitempty"` + // ServiceBusConnectionStringSecretName - The secret name of the service bus connection string. + ServiceBusConnectionStringSecretName *string `json:"serviceBusConnectionStringSecretName,omitempty"` + // TargetLocation - The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) MarshalJSON() ([]byte, error) { + vmccmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmccmi.KeyVaultID != nil { + objectMap["keyVaultId"] = vmccmi.KeyVaultID + } + if vmccmi.KeyVaultURI != nil { + objectMap["keyVaultUri"] = vmccmi.KeyVaultURI + } + if vmccmi.StorageAccountID != nil { + objectMap["storageAccountId"] = vmccmi.StorageAccountID + } + if vmccmi.StorageAccountSasSecretName != nil { + objectMap["storageAccountSasSecretName"] = vmccmi.StorageAccountSasSecretName + } + if vmccmi.ServiceBusConnectionStringSecretName != nil { + objectMap["serviceBusConnectionStringSecretName"] = vmccmi.ServiceBusConnectionStringSecretName + } + if vmccmi.TargetLocation != nil { + objectMap["targetLocation"] = vmccmi.TargetLocation + } + if vmccmi.InstanceType != "" { + objectMap["instanceType"] = vmccmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return &vmccmi, true +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &vmccmi, true +} + +// VMwareCbtDiskInput vMwareCbt disk input. +type VMwareCbtDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // IsOSDisk - A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // LogStorageAccountSasSecretName - The key vault secret name of the log storage account. + LogStorageAccountSasSecretName *string `json:"logStorageAccountSasSecretName,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// VMwareCbtEnableMigrationInput vMwareCbt specific enable migration input. +type VMwareCbtEnableMigrationInput struct { + // VmwareMachineID - The ARM Id of the VM discovered in VMware. + VmwareMachineID *string `json:"vmwareMachineId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]VMwareCbtDiskInput `json:"disksToInclude,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // DataMoverRunAsAccountID - The data mover run as account Id. + DataMoverRunAsAccountID *string `json:"dataMoverRunAsAccountId,omitempty"` + // SnapshotRunAsAccountID - The snapshot run as account Id. + SnapshotRunAsAccountID *string `json:"snapshotRunAsAccountId,omitempty"` + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TargetSubnetName - The target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedDiskTags - The tags for the seed disks. + SeedDiskTags map[string]*string `json:"seedDiskTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeEnableMigrationProviderSpecificInput', 'InstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEnableMigrationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) MarshalJSON() ([]byte, error) { + vmcemi.InstanceType = InstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcemi.VmwareMachineID != nil { + objectMap["vmwareMachineId"] = vmcemi.VmwareMachineID + } + if vmcemi.DisksToInclude != nil { + objectMap["disksToInclude"] = vmcemi.DisksToInclude + } + if vmcemi.LicenseType != "" { + objectMap["licenseType"] = vmcemi.LicenseType + } + if vmcemi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = vmcemi.SQLServerLicenseType + } + if vmcemi.DataMoverRunAsAccountID != nil { + objectMap["dataMoverRunAsAccountId"] = vmcemi.DataMoverRunAsAccountID + } + if vmcemi.SnapshotRunAsAccountID != nil { + objectMap["snapshotRunAsAccountId"] = vmcemi.SnapshotRunAsAccountID + } + if vmcemi.TargetVMName != nil { + objectMap["targetVmName"] = vmcemi.TargetVMName + } + if vmcemi.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcemi.TargetVMSize + } + if vmcemi.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcemi.TargetResourceGroupID + } + if vmcemi.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcemi.TargetNetworkID + } + if vmcemi.TargetSubnetName != nil { + objectMap["targetSubnetName"] = vmcemi.TargetSubnetName + } + if vmcemi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcemi.TargetAvailabilitySetID + } + if vmcemi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcemi.TargetAvailabilityZone + } + if vmcemi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcemi.TargetProximityPlacementGroupID + } + if vmcemi.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcemi.TargetBootDiagnosticsStorageAccountID + } + if vmcemi.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcemi.PerformAutoResync + } + if vmcemi.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcemi.TargetVMTags + } + if vmcemi.SeedDiskTags != nil { + objectMap["seedDiskTags"] = vmcemi.SeedDiskTags + } + if vmcemi.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcemi.TargetDiskTags + } + if vmcemi.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcemi.TargetNicTags + } + if vmcemi.InstanceType != "" { + objectMap["instanceType"] = vmcemi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtEnableMigrationInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) { + return &vmcemi, true +} + +// AsEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsBasicEnableMigrationProviderSpecificInput() (BasicEnableMigrationProviderSpecificInput, bool) { + return &vmcemi, true +} + +// VMwareCbtEventDetails event details for VMwareCbt provider. +type VMwareCbtEventDetails struct { + // MigrationItemName - READ-ONLY; The migration item name. + MigrationItemName *string `json:"migrationItemName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) MarshalJSON() ([]byte, error) { + vmced.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmced.InstanceType != "" { + objectMap["instanceType"] = vmced.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return &vmced, true +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &vmced, true +} + +// VMwareCbtMigrateInput vMwareCbt specific migrate input. +type VMwareCbtMigrateInput struct { + // PerformShutdown - A value indicating whether VM is to be shutdown. + PerformShutdown *string `json:"performShutdown,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput', 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) MarshalJSON() ([]byte, error) { + vmcmi.InstanceType = InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcmi.PerformShutdown != nil { + objectMap["performShutdown"] = vmcmi.PerformShutdown + } + if vmcmi.InstanceType != "" { + objectMap["instanceType"] = vmcmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrateInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) { + return &vmcmi, true +} + +// AsMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsBasicMigrateProviderSpecificInput() (BasicMigrateProviderSpecificInput, bool) { + return &vmcmi, true +} + +// VMwareCbtMigrationDetails vMwareCbt provider specific settings. +type VMwareCbtMigrationDetails struct { + // VmwareMachineID - READ-ONLY; The ARM Id of the VM discovered in VMware. + VmwareMachineID *string `json:"vmwareMachineId,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // FirmwareType - READ-ONLY; The firmware type. + FirmwareType *string `json:"firmwareType,omitempty"` + // TargetGeneration - READ-ONLY; The target generation. + TargetGeneration *string `json:"targetGeneration,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // DataMoverRunAsAccountID - READ-ONLY; The data mover run as account Id. + DataMoverRunAsAccountID *string `json:"dataMoverRunAsAccountId,omitempty"` + // SnapshotRunAsAccountID - READ-ONLY; The snapshot run as account Id. + SnapshotRunAsAccountID *string `json:"snapshotRunAsAccountId,omitempty"` + // TargetVMName - Target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetLocation - READ-ONLY; The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // TargetResourceGroupID - The target resource group Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]VMwareCbtProtectedDiskDetails `json:"protectedDisks,omitempty"` + // TargetNetworkID - The target network Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // VMNics - The network details. + VMNics *[]VMwareCbtNicDetails `json:"vmNics,omitempty"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // MigrationRecoveryPointID - READ-ONLY; The recovery point Id to which the VM was migrated. + MigrationRecoveryPointID *string `json:"migrationRecoveryPointId,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // LastRecoveryPointID - READ-ONLY; The last recovery point Id. + LastRecoveryPointID *string `json:"lastRecoveryPointId,omitempty"` + // InitialSeedingProgressPercentage - READ-ONLY; The initial seeding progress percentage. + InitialSeedingProgressPercentage *int32 `json:"initialSeedingProgressPercentage,omitempty"` + // MigrationProgressPercentage - READ-ONLY; The migration progress percentage. + MigrationProgressPercentage *int32 `json:"migrationProgressPercentage,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // InitialSeedingRetryCount - READ-ONLY; The initial seeding retry count. + InitialSeedingRetryCount *int64 `json:"initialSeedingRetryCount,omitempty"` + // ResyncRetryCount - READ-ONLY; The resync retry count. + ResyncRetryCount *int64 `json:"resyncRetryCount,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // SeedDiskTags - The tags for the seed disks. + SeedDiskTags map[string]*string `json:"seedDiskTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings', 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) MarshalJSON() ([]byte, error) { + vmcmd.InstanceType = InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcmd.LicenseType != nil { + objectMap["licenseType"] = vmcmd.LicenseType + } + if vmcmd.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = vmcmd.SQLServerLicenseType + } + if vmcmd.TargetVMName != nil { + objectMap["targetVmName"] = vmcmd.TargetVMName + } + if vmcmd.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcmd.TargetVMSize + } + if vmcmd.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcmd.TargetResourceGroupID + } + if vmcmd.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcmd.TargetAvailabilitySetID + } + if vmcmd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcmd.TargetAvailabilityZone + } + if vmcmd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcmd.TargetProximityPlacementGroupID + } + if vmcmd.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcmd.TargetBootDiagnosticsStorageAccountID + } + if vmcmd.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcmd.TargetVMTags + } + if vmcmd.ProtectedDisks != nil { + objectMap["protectedDisks"] = vmcmd.ProtectedDisks + } + if vmcmd.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcmd.TargetNetworkID + } + if vmcmd.VMNics != nil { + objectMap["vmNics"] = vmcmd.VMNics + } + if vmcmd.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcmd.TargetNicTags + } + if vmcmd.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcmd.PerformAutoResync + } + if vmcmd.SeedDiskTags != nil { + objectMap["seedDiskTags"] = vmcmd.SeedDiskTags + } + if vmcmd.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcmd.TargetDiskTags + } + if vmcmd.InstanceType != "" { + objectMap["instanceType"] = vmcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrationDetails is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) { + return &vmcmd, true +} + +// AsMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsBasicMigrationProviderSpecificSettings() (BasicMigrationProviderSpecificSettings, bool) { + return &vmcmd, true +} + +// VMwareCbtNicDetails vMwareCbt NIC details. +type VMwareCbtNicDetails struct { + // NicID - READ-ONLY; The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // SourceIPAddress - READ-ONLY; The source IP address. + SourceIPAddress *string `json:"sourceIPAddress,omitempty"` + // SourceIPAddressType - READ-ONLY; The source IP address type. Possible values include: 'Dynamic', 'Static' + SourceIPAddressType EthernetAddressType `json:"sourceIPAddressType,omitempty"` + // SourceNetworkID - READ-ONLY; Source network Id. + SourceNetworkID *string `json:"sourceNetworkId,omitempty"` + // TargetIPAddress - The target IP address. + TargetIPAddress *string `json:"targetIPAddress,omitempty"` + // TargetIPAddressType - The target IP address type. Possible values include: 'Dynamic', 'Static' + TargetIPAddressType EthernetAddressType `json:"targetIPAddressType,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` + // IsSelectedForMigration - A value indicating whether this NIC is selected for migration. + IsSelectedForMigration *string `json:"isSelectedForMigration,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtNicDetails. +func (vmcnd VMwareCbtNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmcnd.IsPrimaryNic != nil { + objectMap["isPrimaryNic"] = vmcnd.IsPrimaryNic + } + if vmcnd.TargetIPAddress != nil { + objectMap["targetIPAddress"] = vmcnd.TargetIPAddress + } + if vmcnd.TargetIPAddressType != "" { + objectMap["targetIPAddressType"] = vmcnd.TargetIPAddressType + } + if vmcnd.TargetSubnetName != nil { + objectMap["targetSubnetName"] = vmcnd.TargetSubnetName + } + if vmcnd.TargetNicName != nil { + objectMap["targetNicName"] = vmcnd.TargetNicName + } + if vmcnd.IsSelectedForMigration != nil { + objectMap["isSelectedForMigration"] = vmcnd.IsSelectedForMigration + } + return json.Marshal(objectMap) +} + +// VMwareCbtNicInput vMwareCbt NIC input. +type VMwareCbtNicInput struct { + // NicID - The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetStaticIPAddress - The static IP address. + TargetStaticIPAddress *string `json:"targetStaticIPAddress,omitempty"` + // IsSelectedForMigration - A value indicating whether this NIC is selected for migration. + IsSelectedForMigration *string `json:"isSelectedForMigration,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` +} + +// VMwareCbtPolicyCreationInput vMware Cbt policy creation input. +type VMwareCbtPolicyCreationInput struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) MarshalJSON() ([]byte, error) { + vmcpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcpci.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = vmcpci.RecoveryPointHistoryInMinutes + } + if vmcpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = vmcpci.CrashConsistentFrequencyInMinutes + } + if vmcpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = vmcpci.AppConsistentFrequencyInMinutes + } + if vmcpci.InstanceType != "" { + objectMap["instanceType"] = vmcpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return &vmcpci, true +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &vmcpci, true +} + +// VmwareCbtPolicyDetails vMware Cbt specific policy details. +type VmwareCbtPolicyDetails struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) MarshalJSON() ([]byte, error) { + vcpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vcpd.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = vcpd.RecoveryPointHistoryInMinutes + } + if vcpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = vcpd.AppConsistentFrequencyInMinutes + } + if vcpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = vcpd.CrashConsistentFrequencyInMinutes + } + if vcpd.InstanceType != "" { + objectMap["instanceType"] = vcpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return &vcpd, true +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &vcpd, true +} + +// VMwareCbtProtectedDiskDetails vMwareCbt protected disk details. +type VMwareCbtProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskPath - READ-ONLY; The disk path. + DiskPath *string `json:"diskPath,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // LogStorageAccountSasSecretName - READ-ONLY; The key vault secret name of the log storage account. + LogStorageAccountSasSecretName *string `json:"logStorageAccountSasSecretName,omitempty"` + // DiskEncryptionSetID - READ-ONLY; The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // SeedManagedDiskID - READ-ONLY; The ARM Id of the seed managed disk. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // TargetManagedDiskID - READ-ONLY; The ARM Id of the target managed disk. + TargetManagedDiskID *string `json:"targetManagedDiskId,omitempty"` + // TargetDiskName - The name for the target managed disk. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtProtectedDiskDetails. +func (vmcpdd VMwareCbtProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmcpdd.DiskType != "" { + objectMap["diskType"] = vmcpdd.DiskType + } + if vmcpdd.TargetDiskName != nil { + objectMap["targetDiskName"] = vmcpdd.TargetDiskName + } + return json.Marshal(objectMap) +} + +// VMwareCbtProtectionContainerMappingDetails vMwareCbt provider specific container mapping details. +type VMwareCbtProtectionContainerMappingDetails struct { + // KeyVaultID - READ-ONLY; The target key vault ARM Id. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyVaultURI - READ-ONLY; The target key vault URI. + KeyVaultURI *string `json:"keyVaultUri,omitempty"` + // StorageAccountID - READ-ONLY; The storage account ARM Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // StorageAccountSasSecretName - READ-ONLY; The secret name of the storage account. + StorageAccountSasSecretName *string `json:"storageAccountSasSecretName,omitempty"` + // ServiceBusConnectionStringSecretName - READ-ONLY; The secret name of the service bus connection string. + ServiceBusConnectionStringSecretName *string `json:"serviceBusConnectionStringSecretName,omitempty"` + // TargetLocation - READ-ONLY; The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + vmcpcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcpcmd.InstanceType != "" { + objectMap["instanceType"] = vmcpcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return &vmcpcmd, true +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &vmcpcmd, true +} + +// VMwareCbtResyncInput vMwareCbt specific resync input. +type VMwareCbtResyncInput struct { + // SkipCbtReset - A value indicating whether CBT is to be reset. + SkipCbtReset *string `json:"skipCbtReset,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput', 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicResyncProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) MarshalJSON() ([]byte, error) { + vmcri.InstanceType = InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcri.SkipCbtReset != nil { + objectMap["skipCbtReset"] = vmcri.SkipCbtReset + } + if vmcri.InstanceType != "" { + objectMap["instanceType"] = vmcri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtResyncInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) { + return &vmcri, true +} + +// AsResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsBasicResyncProviderSpecificInput() (BasicResyncProviderSpecificInput, bool) { + return &vmcri, true +} + +// VMwareCbtTestMigrateInput vMwareCbt specific test migrate input. +type VMwareCbtTestMigrateInput struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // NetworkID - The test network Id. + NetworkID *string `json:"networkId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput', 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicTestMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) MarshalJSON() ([]byte, error) { + vmctmi.InstanceType = InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmctmi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = vmctmi.RecoveryPointID + } + if vmctmi.NetworkID != nil { + objectMap["networkId"] = vmctmi.NetworkID + } + if vmctmi.InstanceType != "" { + objectMap["instanceType"] = vmctmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtTestMigrateInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) { + return &vmctmi, true +} + +// AsTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsBasicTestMigrateProviderSpecificInput() (BasicTestMigrateProviderSpecificInput, bool) { + return &vmctmi, true +} + +// VMwareCbtUpdateDiskInput vMwareCbt disk input for update. +type VMwareCbtUpdateDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // TargetDiskName - The target disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// VMwareCbtUpdateMigrationItemInput vMwareCbt specific update migration item input. +type VMwareCbtUpdateMigrationItemInput struct { + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // VMNics - The list of NIC details. + VMNics *[]VMwareCbtNicInput `json:"vmNics,omitempty"` + // VMDisks - The list of disk update properties. + VMDisks *[]VMwareCbtUpdateDiskInput `json:"vmDisks,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput', 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicUpdateMigrationItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) MarshalJSON() ([]byte, error) { + vmcumii.InstanceType = InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcumii.TargetVMName != nil { + objectMap["targetVmName"] = vmcumii.TargetVMName + } + if vmcumii.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcumii.TargetVMSize + } + if vmcumii.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcumii.TargetResourceGroupID + } + if vmcumii.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcumii.TargetAvailabilitySetID + } + if vmcumii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcumii.TargetAvailabilityZone + } + if vmcumii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcumii.TargetProximityPlacementGroupID + } + if vmcumii.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcumii.TargetBootDiagnosticsStorageAccountID + } + if vmcumii.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcumii.TargetNetworkID + } + if vmcumii.VMNics != nil { + objectMap["vmNics"] = vmcumii.VMNics + } + if vmcumii.VMDisks != nil { + objectMap["vmDisks"] = vmcumii.VMDisks + } + if vmcumii.LicenseType != "" { + objectMap["licenseType"] = vmcumii.LicenseType + } + if vmcumii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = vmcumii.SQLServerLicenseType + } + if vmcumii.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcumii.PerformAutoResync + } + if vmcumii.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcumii.TargetVMTags + } + if vmcumii.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcumii.TargetDiskTags + } + if vmcumii.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcumii.TargetNicTags + } + if vmcumii.InstanceType != "" { + objectMap["instanceType"] = vmcumii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtUpdateMigrationItemInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) { + return &vmcumii, true +} + +// AsUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsBasicUpdateMigrationItemProviderSpecificInput() (BasicUpdateMigrationItemProviderSpecificInput, bool) { + return &vmcumii, true +} + +// VMwareDetails store the fabric details specific to the VMware fabric. +type VMwareDetails struct { + // ProcessServers - The list of Process Servers associated with the fabric. + ProcessServers *[]ProcessServer `json:"processServers,omitempty"` + // MasterTargetServers - The list of Master Target servers associated with the fabric. + MasterTargetServers *[]MasterTargetServer `json:"masterTargetServers,omitempty"` + // RunAsAccounts - The list of run as accounts created on the server. + RunAsAccounts *[]RunAsAccount `json:"runAsAccounts,omitempty"` + // ReplicationPairCount - The number of replication pairs configured in this CS. + ReplicationPairCount *string `json:"replicationPairCount,omitempty"` + // ProcessServerCount - The number of process servers. + ProcessServerCount *string `json:"processServerCount,omitempty"` + // AgentCount - The number of source and target servers configured to talk to this CS. + AgentCount *string `json:"agentCount,omitempty"` + // ProtectedServers - The number of protected servers. + ProtectedServers *string `json:"protectedServers,omitempty"` + // SystemLoad - The percentage of the system load. + SystemLoad *string `json:"systemLoad,omitempty"` + // SystemLoadStatus - The system load status. + SystemLoadStatus *string `json:"systemLoadStatus,omitempty"` + // CPULoad - The percentage of the CPU load. + CPULoad *string `json:"cpuLoad,omitempty"` + // CPULoadStatus - The CPU load status. + CPULoadStatus *string `json:"cpuLoadStatus,omitempty"` + // TotalMemoryInBytes - The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // MemoryUsageStatus - The memory usage status. + MemoryUsageStatus *string `json:"memoryUsageStatus,omitempty"` + // TotalSpaceInBytes - The total space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - The available space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // SpaceUsageStatus - The space usage status. + SpaceUsageStatus *string `json:"spaceUsageStatus,omitempty"` + // WebLoad - The web load. + WebLoad *string `json:"webLoad,omitempty"` + // WebLoadStatus - The web load status. + WebLoadStatus *string `json:"webLoadStatus,omitempty"` + // DatabaseServerLoad - The database server load. + DatabaseServerLoad *string `json:"databaseServerLoad,omitempty"` + // DatabaseServerLoadStatus - The database server load status. + DatabaseServerLoadStatus *string `json:"databaseServerLoadStatus,omitempty"` + // CsServiceStatus - The CS service status. + CsServiceStatus *string `json:"csServiceStatus,omitempty"` + // IPAddress - The IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // AgentVersion - The agent Version. + AgentVersion *string `json:"agentVersion,omitempty"` + // HostName - The host name. + HostName *string `json:"hostName,omitempty"` + // LastHeartbeat - The last heartbeat received from CS server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // SslCertExpiryDate - CS SSL cert expiry date. + SslCertExpiryDate *date.Time `json:"sslCertExpiryDate,omitempty"` + // SslCertExpiryRemainingDays - CS SSL cert expiry date. + SslCertExpiryRemainingDays *int32 `json:"sslCertExpiryRemainingDays,omitempty"` + // PsTemplateVersion - PS template version. + PsTemplateVersion *string `json:"psTemplateVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // AgentVersionDetails - The agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareDetails. +func (vmd VMwareDetails) MarshalJSON() ([]byte, error) { + vmd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware + objectMap := make(map[string]interface{}) + if vmd.ProcessServers != nil { + objectMap["processServers"] = vmd.ProcessServers + } + if vmd.MasterTargetServers != nil { + objectMap["masterTargetServers"] = vmd.MasterTargetServers + } + if vmd.RunAsAccounts != nil { + objectMap["runAsAccounts"] = vmd.RunAsAccounts + } + if vmd.ReplicationPairCount != nil { + objectMap["replicationPairCount"] = vmd.ReplicationPairCount + } + if vmd.ProcessServerCount != nil { + objectMap["processServerCount"] = vmd.ProcessServerCount + } + if vmd.AgentCount != nil { + objectMap["agentCount"] = vmd.AgentCount + } + if vmd.ProtectedServers != nil { + objectMap["protectedServers"] = vmd.ProtectedServers + } + if vmd.SystemLoad != nil { + objectMap["systemLoad"] = vmd.SystemLoad + } + if vmd.SystemLoadStatus != nil { + objectMap["systemLoadStatus"] = vmd.SystemLoadStatus + } + if vmd.CPULoad != nil { + objectMap["cpuLoad"] = vmd.CPULoad + } + if vmd.CPULoadStatus != nil { + objectMap["cpuLoadStatus"] = vmd.CPULoadStatus + } + if vmd.TotalMemoryInBytes != nil { + objectMap["totalMemoryInBytes"] = vmd.TotalMemoryInBytes + } + if vmd.AvailableMemoryInBytes != nil { + objectMap["availableMemoryInBytes"] = vmd.AvailableMemoryInBytes + } + if vmd.MemoryUsageStatus != nil { + objectMap["memoryUsageStatus"] = vmd.MemoryUsageStatus + } + if vmd.TotalSpaceInBytes != nil { + objectMap["totalSpaceInBytes"] = vmd.TotalSpaceInBytes + } + if vmd.AvailableSpaceInBytes != nil { + objectMap["availableSpaceInBytes"] = vmd.AvailableSpaceInBytes + } + if vmd.SpaceUsageStatus != nil { + objectMap["spaceUsageStatus"] = vmd.SpaceUsageStatus + } + if vmd.WebLoad != nil { + objectMap["webLoad"] = vmd.WebLoad + } + if vmd.WebLoadStatus != nil { + objectMap["webLoadStatus"] = vmd.WebLoadStatus + } + if vmd.DatabaseServerLoad != nil { + objectMap["databaseServerLoad"] = vmd.DatabaseServerLoad + } + if vmd.DatabaseServerLoadStatus != nil { + objectMap["databaseServerLoadStatus"] = vmd.DatabaseServerLoadStatus + } + if vmd.CsServiceStatus != nil { + objectMap["csServiceStatus"] = vmd.CsServiceStatus + } + if vmd.IPAddress != nil { + objectMap["ipAddress"] = vmd.IPAddress + } + if vmd.AgentVersion != nil { + objectMap["agentVersion"] = vmd.AgentVersion + } + if vmd.HostName != nil { + objectMap["hostName"] = vmd.HostName + } + if vmd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = vmd.LastHeartbeat + } + if vmd.VersionStatus != nil { + objectMap["versionStatus"] = vmd.VersionStatus + } + if vmd.SslCertExpiryDate != nil { + objectMap["sslCertExpiryDate"] = vmd.SslCertExpiryDate + } + if vmd.SslCertExpiryRemainingDays != nil { + objectMap["sslCertExpiryRemainingDays"] = vmd.SslCertExpiryRemainingDays + } + if vmd.PsTemplateVersion != nil { + objectMap["psTemplateVersion"] = vmd.PsTemplateVersion + } + if vmd.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = vmd.AgentExpiryDate + } + if vmd.AgentVersionDetails != nil { + objectMap["agentVersionDetails"] = vmd.AgentVersionDetails + } + if vmd.InstanceType != "" { + objectMap["instanceType"] = vmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return &vmd, true +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vmd, true +} + +// VMwareV2FabricCreationInput vMwareV2 fabric provider specific settings. +type VMwareV2FabricCreationInput struct { + // VmwareSiteID - The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // MigrationSolutionID - The ARM Id of the migration solution. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreationInput', 'InstanceTypeAzure', 'InstanceTypeInMageRcm', 'InstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) MarshalJSON() ([]byte, error) { + vmvfci.InstanceType = InstanceTypeVMwareV2 + objectMap := make(map[string]interface{}) + if vmvfci.VmwareSiteID != nil { + objectMap["vmwareSiteId"] = vmvfci.VmwareSiteID + } + if vmvfci.PhysicalSiteID != nil { + objectMap["physicalSiteId"] = vmvfci.PhysicalSiteID + } + if vmvfci.MigrationSolutionID != nil { + objectMap["migrationSolutionId"] = vmvfci.MigrationSolutionID + } + if vmvfci.InstanceType != "" { + objectMap["instanceType"] = vmvfci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return &vmvfci, true +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &vmvfci, true +} + +// VMwareV2FabricSpecificDetails vMwareV2 fabric specific details. +type VMwareV2FabricSpecificDetails struct { + // VmwareSiteID - READ-ONLY; The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - READ-ONLY; The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // MigrationSolutionID - READ-ONLY; The Migration solution ARM Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // ServiceEndpoint - READ-ONLY; The service endpoint. + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` + // ServiceResourceID - READ-ONLY; The service resource Id. + ServiceResourceID *string `json:"serviceResourceId,omitempty"` + // ServiceContainerID - READ-ONLY; The service container Id. + ServiceContainerID *string `json:"serviceContainerId,omitempty"` + // ProcessServers - READ-ONLY; The list of process servers. + ProcessServers *[]ProcessServerDetails `json:"processServers,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) MarshalJSON() ([]byte, error) { + vmvfsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 + objectMap := make(map[string]interface{}) + if vmvfsd.InstanceType != "" { + objectMap["instanceType"] = vmvfsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return &vmvfsd, true +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vmvfsd, true +} + +// VMwareVirtualMachineDetails vMware provider specific settings. +type VMwareVirtualMachineDetails struct { + // AgentGeneratedID - The ID generated by the InMage agent after it gets installed on guest. This is the ID to be used during InMage CreateProtection. + AgentGeneratedID *string `json:"agentGeneratedId,omitempty"` + // AgentInstalled - The value indicating if InMage scout agent is installed on guest. + AgentInstalled *string `json:"agentInstalled,omitempty"` + // OsType - The OsType installed on VM. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // IPAddress - The IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // PoweredOn - The value indicating whether VM is powered on. + PoweredOn *string `json:"poweredOn,omitempty"` + // VCenterInfrastructureID - The VCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. Value can be vCenter or physical. + DiscoveryType *string `json:"discoveryType,omitempty"` + // DiskDetails - The disk details. + DiskDetails *[]InMageDiskDetails `json:"diskDetails,omitempty"` + // ValidationErrors - The validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) MarshalJSON() ([]byte, error) { + vmvmd.InstanceType = InstanceTypeVMwareVirtualMachine + objectMap := make(map[string]interface{}) + if vmvmd.AgentGeneratedID != nil { + objectMap["agentGeneratedId"] = vmvmd.AgentGeneratedID + } + if vmvmd.AgentInstalled != nil { + objectMap["agentInstalled"] = vmvmd.AgentInstalled + } + if vmvmd.OsType != nil { + objectMap["osType"] = vmvmd.OsType + } + if vmvmd.AgentVersion != nil { + objectMap["agentVersion"] = vmvmd.AgentVersion + } + if vmvmd.IPAddress != nil { + objectMap["ipAddress"] = vmvmd.IPAddress + } + if vmvmd.PoweredOn != nil { + objectMap["poweredOn"] = vmvmd.PoweredOn + } + if vmvmd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = vmvmd.VCenterInfrastructureID + } + if vmvmd.DiscoveryType != nil { + objectMap["discoveryType"] = vmvmd.DiscoveryType + } + if vmvmd.DiskDetails != nil { + objectMap["diskDetails"] = vmvmd.DiskDetails + } + if vmvmd.ValidationErrors != nil { + objectMap["validationErrors"] = vmvmd.ValidationErrors + } + if vmvmd.InstanceType != "" { + objectMap["instanceType"] = vmvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return &vmvmd, true +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &vmvmd, true +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/operations.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/operations.go new file mode 100644 index 000000000000..0d86c428338b --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/operations.go @@ -0,0 +1,145 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the client for the Operations methods of the Siterecovery service. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string, resourceGroupName string, resourceName string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// List operation to return the list of available operations. +func (client OperationsClient) List(ctx context.Context) (result OperationsDiscoveryCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.odc.Response.Response != nil { + sc = result.odc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.odc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.odc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", resp, "Failure responding to request") + return + } + if result.odc.hasNextLink() && result.odc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/operations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationsDiscoveryCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationsDiscoveryCollection) (result OperationsDiscoveryCollection, err error) { + req, err := lastResults.operationsDiscoveryCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationsDiscoveryCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/recoverypoints.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/recoverypoints.go new file mode 100644 index 000000000000..321c94e4571a --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/recoverypoints.go @@ -0,0 +1,235 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RecoveryPointsClient is the client for the RecoveryPoints methods of the Siterecovery service. +type RecoveryPointsClient struct { + BaseClient +} + +// NewRecoveryPointsClient creates an instance of the RecoveryPointsClient client. +func NewRecoveryPointsClient(subscriptionID string, resourceGroupName string, resourceName string) RecoveryPointsClient { + return NewRecoveryPointsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewRecoveryPointsClientWithBaseURI creates an instance of the RecoveryPointsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewRecoveryPointsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) RecoveryPointsClient { + return RecoveryPointsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get get the details of specified recovery point. +// Parameters: +// fabricName - the fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replication protected item name. +// recoveryPointName - the recovery point name. +func (client RecoveryPointsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (result RecoveryPoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, recoveryPointName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client RecoveryPointsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "recoveryPointName": autorest.Encode("path", recoveryPointName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints/{recoveryPointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RecoveryPointsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RecoveryPointsClient) GetResponder(resp *http.Response) (result RecoveryPoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationProtectedItems lists the available recovery points for a replication protected item. +// Parameters: +// fabricName - the fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replication protected item name. +func (client RecoveryPointsClient) ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result RecoveryPointCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.RPCVar.Response.Response != nil { + sc = result.RPCVar.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectedItemsNextResults + req, err := client.ListByReplicationProtectedItemsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.RPCVar.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", resp, "Failure sending request") + return + } + + result.RPCVar, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", resp, "Failure responding to request") + return + } + if result.RPCVar.hasNextLink() && result.RPCVar.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectedItemsPreparer prepares the ListByReplicationProtectedItems request. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectedItemsSender sends the ListByReplicationProtectedItems request. The method will close the +// http.Response Body if it receives an error. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectedItemsResponder handles the response to the ListByReplicationProtectedItems request. The method always +// closes the http.Response Body. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsResponder(resp *http.Response) (result RecoveryPointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectedItemsNextResults retrieves the next set of results, if any. +func (client RecoveryPointsClient) listByReplicationProtectedItemsNextResults(ctx context.Context, lastResults RecoveryPointCollection) (result RecoveryPointCollection, err error) { + req, err := lastResults.recoveryPointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectedItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result RecoveryPointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectedItems(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationalertsettings.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationalertsettings.go new file mode 100644 index 000000000000..40792de522af --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationalertsettings.go @@ -0,0 +1,302 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationAlertSettingsClient is the client for the ReplicationAlertSettings methods of the Siterecovery service. +type ReplicationAlertSettingsClient struct { + BaseClient +} + +// NewReplicationAlertSettingsClient creates an instance of the ReplicationAlertSettingsClient client. +func NewReplicationAlertSettingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationAlertSettingsClient { + return NewReplicationAlertSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationAlertSettingsClientWithBaseURI creates an instance of the ReplicationAlertSettingsClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationAlertSettingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationAlertSettingsClient { + return ReplicationAlertSettingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create create or update an email notification(alert) configuration. +// Parameters: +// alertSettingName - the name of the email notification(alert) configuration. +// request - the input to configure the email notification(alert). +func (client ReplicationAlertSettingsClient) Create(ctx context.Context, alertSettingName string, request ConfigureAlertRequest) (result Alert, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, alertSettingName, request) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationAlertSettingsClient) CreatePreparer(ctx context.Context, alertSettingName string, request ConfigureAlertRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertSettingName": autorest.Encode("path", alertSettingName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) CreateResponder(resp *http.Response) (result Alert, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of the specified email notification(alert) configuration. +// Parameters: +// alertSettingName - the name of the email notification configuration. +func (client ReplicationAlertSettingsClient) Get(ctx context.Context, alertSettingName string) (result Alert, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, alertSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationAlertSettingsClient) GetPreparer(ctx context.Context, alertSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertSettingName": autorest.Encode("path", alertSettingName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) GetResponder(resp *http.Response) (result Alert, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of email notification(alert) configurations for the vault. +func (client ReplicationAlertSettingsClient) List(ctx context.Context) (result AlertCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.List") + defer func() { + sc := -1 + if result.ac.Response.Response != nil { + sc = result.ac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", resp, "Failure sending request") + return + } + + result.ac, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", resp, "Failure responding to request") + return + } + if result.ac.hasNextLink() && result.ac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationAlertSettingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) ListResponder(resp *http.Response) (result AlertCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationAlertSettingsClient) listNextResults(ctx context.Context, lastResults AlertCollection) (result AlertCollection, err error) { + req, err := lastResults.alertCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationAlertSettingsClient) ListComplete(ctx context.Context) (result AlertCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationeligibilityresults.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationeligibilityresults.go new file mode 100644 index 000000000000..e37e5a9076ad --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationeligibilityresults.go @@ -0,0 +1,183 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationEligibilityResultsClient is the client for the ReplicationEligibilityResults methods of the Siterecovery +// service. +type ReplicationEligibilityResultsClient struct { + BaseClient +} + +// NewReplicationEligibilityResultsClient creates an instance of the ReplicationEligibilityResultsClient client. +func NewReplicationEligibilityResultsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationEligibilityResultsClient { + return NewReplicationEligibilityResultsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationEligibilityResultsClientWithBaseURI creates an instance of the ReplicationEligibilityResultsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationEligibilityResultsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationEligibilityResultsClient { + return ReplicationEligibilityResultsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get validates whether a given VM can be protected or not in which case returns list of errors. +// Parameters: +// virtualMachineName - virtual Machine name. +func (client ReplicationEligibilityResultsClient) Get(ctx context.Context, virtualMachineName string) (result ReplicationEligibilityResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEligibilityResultsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, virtualMachineName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationEligibilityResultsClient) GetPreparer(ctx context.Context, virtualMachineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineName": autorest.Encode("path", virtualMachineName), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEligibilityResultsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationEligibilityResultsClient) GetResponder(resp *http.Response) (result ReplicationEligibilityResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List validates whether a given VM can be protected or not in which case returns list of errors. +// Parameters: +// virtualMachineName - virtual Machine name. +func (client ReplicationEligibilityResultsClient) List(ctx context.Context, virtualMachineName string) (result ReplicationEligibilityResultsCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEligibilityResultsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, virtualMachineName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationEligibilityResultsClient) ListPreparer(ctx context.Context, virtualMachineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineName": autorest.Encode("path", virtualMachineName), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEligibilityResultsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationEligibilityResultsClient) ListResponder(resp *http.Response) (result ReplicationEligibilityResultsCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationevents.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationevents.go new file mode 100644 index 000000000000..8ddeefa3c34b --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationevents.go @@ -0,0 +1,228 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationEventsClient is the client for the ReplicationEvents methods of the Siterecovery service. +type ReplicationEventsClient struct { + BaseClient +} + +// NewReplicationEventsClient creates an instance of the ReplicationEventsClient client. +func NewReplicationEventsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationEventsClient { + return NewReplicationEventsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationEventsClientWithBaseURI creates an instance of the ReplicationEventsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationEventsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationEventsClient { + return ReplicationEventsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get the operation to get the details of an Azure Site recovery event. +// Parameters: +// eventName - the name of the Azure Site Recovery event. +func (client ReplicationEventsClient) Get(ctx context.Context, eventName string) (result Event, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, eventName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationEventsClient) GetPreparer(ctx context.Context, eventName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "eventName": autorest.Encode("path", eventName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents/{eventName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEventsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationEventsClient) GetResponder(resp *http.Response) (result Event, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of Azure Site Recovery events for the vault. +// Parameters: +// filter - oData filter options. +func (client ReplicationEventsClient) List(ctx context.Context, filter string) (result EventCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.List") + defer func() { + sc := -1 + if result.ec.Response.Response != nil { + sc = result.ec.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ec.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", resp, "Failure sending request") + return + } + + result.ec, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", resp, "Failure responding to request") + return + } + if result.ec.hasNextLink() && result.ec.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationEventsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEventsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationEventsClient) ListResponder(resp *http.Response) (result EventCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationEventsClient) listNextResults(ctx context.Context, lastResults EventCollection) (result EventCollection, err error) { + req, err := lastResults.eventCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationEventsClient) ListComplete(ctx context.Context, filter string) (result EventCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationfabrics.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationfabrics.go new file mode 100644 index 000000000000..f448fecb6325 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationfabrics.go @@ -0,0 +1,786 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationFabricsClient is the client for the ReplicationFabrics methods of the Siterecovery service. +type ReplicationFabricsClient struct { + BaseClient +} + +// NewReplicationFabricsClient creates an instance of the ReplicationFabricsClient client. +func NewReplicationFabricsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationFabricsClient { + return NewReplicationFabricsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationFabricsClientWithBaseURI creates an instance of the ReplicationFabricsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationFabricsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationFabricsClient { + return ReplicationFabricsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// CheckConsistency the operation to perform a consistency check on the fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationFabricsClient) CheckConsistency(ctx context.Context, fabricName string) (result ReplicationFabricsCheckConsistencyFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.CheckConsistency") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CheckConsistencyPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "CheckConsistency", nil, "Failure preparing request") + return + } + + result, err = client.CheckConsistencySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "CheckConsistency", result.Response(), "Failure sending request") + return + } + + return +} + +// CheckConsistencyPreparer prepares the CheckConsistency request. +func (client ReplicationFabricsClient) CheckConsistencyPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/checkConsistency", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckConsistencySender sends the CheckConsistency request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) CheckConsistencySender(req *http.Request) (future ReplicationFabricsCheckConsistencyFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CheckConsistencyResponder handles the response to the CheckConsistency request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) CheckConsistencyResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Create the operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). +// Parameters: +// fabricName - name of the ASR fabric. +// input - fabric creation input. +func (client ReplicationFabricsClient) Create(ctx context.Context, fabricName string, input FabricCreationInput) (result ReplicationFabricsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationFabricsClient) CreatePreparer(ctx context.Context, fabricName string, input FabricCreationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) CreateSender(req *http.Request) (future ReplicationFabricsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) CreateResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete or remove an Azure Site Recovery fabric. +// Parameters: +// fabricName - ASR fabric to delete. +func (client ReplicationFabricsClient) Delete(ctx context.Context, fabricName string) (result ReplicationFabricsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationFabricsClient) DeletePreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) DeleteSender(req *http.Request) (future ReplicationFabricsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of an Azure Site Recovery fabric. +// Parameters: +// fabricName - fabric name. +// filter - oData filter options. +func (client ReplicationFabricsClient) Get(ctx context.Context, fabricName string, filter string) (result Fabric, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationFabricsClient) GetPreparer(ctx context.Context, fabricName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) GetResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of the Azure Site Recovery fabrics in the vault. +func (client ReplicationFabricsClient) List(ctx context.Context) (result FabricCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.List") + defer func() { + sc := -1 + if result.fc.Response.Response != nil { + sc = result.fc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.fc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", resp, "Failure sending request") + return + } + + result.fc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", resp, "Failure responding to request") + return + } + if result.fc.hasNextLink() && result.fc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationFabricsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) ListResponder(resp *http.Response) (result FabricCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationFabricsClient) listNextResults(ctx context.Context, lastResults FabricCollection) (result FabricCollection, err error) { + req, err := lastResults.fabricCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationFabricsClient) ListComplete(ctx context.Context) (result FabricCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// MigrateToAad the operation to migrate an Azure Site Recovery fabric to AAD. +// Parameters: +// fabricName - ASR fabric to migrate. +func (client ReplicationFabricsClient) MigrateToAad(ctx context.Context, fabricName string) (result ReplicationFabricsMigrateToAadFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.MigrateToAad") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.MigrateToAadPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "MigrateToAad", nil, "Failure preparing request") + return + } + + result, err = client.MigrateToAadSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "MigrateToAad", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateToAadPreparer prepares the MigrateToAad request. +func (client ReplicationFabricsClient) MigrateToAadPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/migratetoaad", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateToAadSender sends the MigrateToAad request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) MigrateToAadSender(req *http.Request) (future ReplicationFabricsMigrateToAadFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateToAadResponder handles the response to the MigrateToAad request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) MigrateToAadResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Purge the operation to purge(force delete) an Azure Site Recovery fabric. +// Parameters: +// fabricName - ASR fabric to purge. +func (client ReplicationFabricsClient) Purge(ctx context.Context, fabricName string) (result ReplicationFabricsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationFabricsClient) PurgePreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) PurgeSender(req *http.Request) (future ReplicationFabricsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// ReassociateGateway the operation to move replications from a process server to another process server. +// Parameters: +// fabricName - the name of the fabric containing the process server. +// failoverProcessServerRequest - the input to the failover process server operation. +func (client ReplicationFabricsClient) ReassociateGateway(ctx context.Context, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest) (result ReplicationFabricsReassociateGatewayFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.ReassociateGateway") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReassociateGatewayPreparer(ctx, fabricName, failoverProcessServerRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "ReassociateGateway", nil, "Failure preparing request") + return + } + + result, err = client.ReassociateGatewaySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "ReassociateGateway", result.Response(), "Failure sending request") + return + } + + return +} + +// ReassociateGatewayPreparer prepares the ReassociateGateway request. +func (client ReplicationFabricsClient) ReassociateGatewayPreparer(ctx context.Context, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/reassociateGateway", pathParameters), + autorest.WithJSON(failoverProcessServerRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReassociateGatewaySender sends the ReassociateGateway request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) ReassociateGatewaySender(req *http.Request) (future ReplicationFabricsReassociateGatewayFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReassociateGatewayResponder handles the response to the ReassociateGateway request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) ReassociateGatewayResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RenewCertificate renews the connection certificate for the ASR replication fabric. +// Parameters: +// fabricName - fabric name to renew certs for. +// renewCertificate - renew certificate input. +func (client ReplicationFabricsClient) RenewCertificate(ctx context.Context, fabricName string, renewCertificate RenewCertificateInput) (result ReplicationFabricsRenewCertificateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.RenewCertificate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RenewCertificatePreparer(ctx, fabricName, renewCertificate) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "RenewCertificate", nil, "Failure preparing request") + return + } + + result, err = client.RenewCertificateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "RenewCertificate", result.Response(), "Failure sending request") + return + } + + return +} + +// RenewCertificatePreparer prepares the RenewCertificate request. +func (client ReplicationFabricsClient) RenewCertificatePreparer(ctx context.Context, fabricName string, renewCertificate RenewCertificateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/renewCertificate", pathParameters), + autorest.WithJSON(renewCertificate), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RenewCertificateSender sends the RenewCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) RenewCertificateSender(req *http.Request) (future ReplicationFabricsRenewCertificateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RenewCertificateResponder handles the response to the RenewCertificate request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) RenewCertificateResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationjobs.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationjobs.go new file mode 100644 index 000000000000..d9c392933705 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationjobs.go @@ -0,0 +1,547 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationJobsClient is the client for the ReplicationJobs methods of the Siterecovery service. +type ReplicationJobsClient struct { + BaseClient +} + +// NewReplicationJobsClient creates an instance of the ReplicationJobsClient client. +func NewReplicationJobsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationJobsClient { + return NewReplicationJobsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationJobsClientWithBaseURI creates an instance of the ReplicationJobsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationJobsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationJobsClient { + return ReplicationJobsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Cancel the operation to cancel an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Cancel(ctx context.Context, jobName string) (result ReplicationJobsCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Cancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CancelPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Cancel", nil, "Failure preparing request") + return + } + + result, err = client.CancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Cancel", result.Response(), "Failure sending request") + return + } + + return +} + +// CancelPreparer prepares the Cancel request. +func (client ReplicationJobsClient) CancelPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/cancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CancelSender sends the Cancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) CancelSender(req *http.Request) (future ReplicationJobsCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CancelResponder handles the response to the Cancel request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) CancelResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Export the operation to export the details of the Azure Site Recovery jobs of the vault. +// Parameters: +// jobQueryParameter - job query filter. +func (client ReplicationJobsClient) Export(ctx context.Context, jobQueryParameter JobQueryParameter) (result ReplicationJobsExportFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Export") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ExportPreparer(ctx, jobQueryParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Export", nil, "Failure preparing request") + return + } + + result, err = client.ExportSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Export", result.Response(), "Failure sending request") + return + } + + return +} + +// ExportPreparer prepares the Export request. +func (client ReplicationJobsClient) ExportPreparer(ctx context.Context, jobQueryParameter JobQueryParameter) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/export", pathParameters), + autorest.WithJSON(jobQueryParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExportSender sends the Export request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ExportSender(req *http.Request) (future ReplicationJobsExportFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ExportResponder handles the response to the Export request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ExportResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get the details of an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Get(ctx context.Context, jobName string) (result Job, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationJobsClient) GetPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) GetResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of Azure Site Recovery Jobs for the vault. +// Parameters: +// filter - oData filter options. +func (client ReplicationJobsClient) List(ctx context.Context, filter string) (result JobCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.List") + defer func() { + sc := -1 + if result.jc.Response.Response != nil { + sc = result.jc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.jc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", resp, "Failure sending request") + return + } + + result.jc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", resp, "Failure responding to request") + return + } + if result.jc.hasNextLink() && result.jc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationJobsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ListResponder(resp *http.Response) (result JobCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationJobsClient) listNextResults(ctx context.Context, lastResults JobCollection) (result JobCollection, err error) { + req, err := lastResults.jobCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationJobsClient) ListComplete(ctx context.Context, filter string) (result JobCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} + +// Restart the operation to restart an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Restart(ctx context.Context, jobName string) (result ReplicationJobsRestartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Restart") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RestartPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Restart", nil, "Failure preparing request") + return + } + + result, err = client.RestartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Restart", result.Response(), "Failure sending request") + return + } + + return +} + +// RestartPreparer prepares the Restart request. +func (client ReplicationJobsClient) RestartPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartSender sends the Restart request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) RestartSender(req *http.Request) (future ReplicationJobsRestartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestartResponder handles the response to the Restart request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) RestartResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Resume the operation to resume an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +// resumeJobParams - resume rob comments. +func (client ReplicationJobsClient) Resume(ctx context.Context, jobName string, resumeJobParams ResumeJobParams) (result ReplicationJobsResumeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Resume") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResumePreparer(ctx, jobName, resumeJobParams) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Resume", nil, "Failure preparing request") + return + } + + result, err = client.ResumeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Resume", result.Response(), "Failure sending request") + return + } + + return +} + +// ResumePreparer prepares the Resume request. +func (client ReplicationJobsClient) ResumePreparer(ctx context.Context, jobName string, resumeJobParams ResumeJobParams) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/resume", pathParameters), + autorest.WithJSON(resumeJobParams), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResumeSender sends the Resume request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ResumeSender(req *http.Request) (future ReplicationJobsResumeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResumeResponder handles the response to the Resume request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ResumeResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationlogicalnetworks.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationlogicalnetworks.go new file mode 100644 index 000000000000..1c22b2595c0d --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationlogicalnetworks.go @@ -0,0 +1,229 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationLogicalNetworksClient is the client for the ReplicationLogicalNetworks methods of the Siterecovery +// service. +type ReplicationLogicalNetworksClient struct { + BaseClient +} + +// NewReplicationLogicalNetworksClient creates an instance of the ReplicationLogicalNetworksClient client. +func NewReplicationLogicalNetworksClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationLogicalNetworksClient { + return NewReplicationLogicalNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationLogicalNetworksClientWithBaseURI creates an instance of the ReplicationLogicalNetworksClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationLogicalNetworksClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationLogicalNetworksClient { + return ReplicationLogicalNetworksClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of a logical network. +// Parameters: +// fabricName - server Id. +// logicalNetworkName - logical network name. +func (client ReplicationLogicalNetworksClient) Get(ctx context.Context, fabricName string, logicalNetworkName string) (result LogicalNetwork, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, logicalNetworkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationLogicalNetworksClient) GetPreparer(ctx context.Context, fabricName string, logicalNetworkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "logicalNetworkName": autorest.Encode("path", logicalNetworkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks/{logicalNetworkName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationLogicalNetworksClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationLogicalNetworksClient) GetResponder(resp *http.Response) (result LogicalNetwork, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationFabrics lists all the logical networks of the Azure Site Recovery fabric. +// Parameters: +// fabricName - server Id. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result LogicalNetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.lnc.Response.Response != nil { + sc = result.lnc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.lnc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.lnc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.lnc.hasNextLink() && result.lnc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsResponder(resp *http.Response) (result LogicalNetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationLogicalNetworksClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults LogicalNetworkCollection) (result LogicalNetworkCollection, err error) { + req, err := lastResults.logicalNetworkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result LogicalNetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationmigrationitems.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationmigrationitems.go new file mode 100644 index 000000000000..43f775accda0 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationmigrationitems.go @@ -0,0 +1,1009 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationMigrationItemsClient is the client for the ReplicationMigrationItems methods of the Siterecovery service. +type ReplicationMigrationItemsClient struct { + BaseClient +} + +// NewReplicationMigrationItemsClient creates an instance of the ReplicationMigrationItemsClient client. +func NewReplicationMigrationItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationMigrationItemsClient { + return NewReplicationMigrationItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationMigrationItemsClientWithBaseURI creates an instance of the ReplicationMigrationItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationMigrationItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationMigrationItemsClient { + return ReplicationMigrationItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR migration item (enable migration). +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - enable migration input. +func (client ReplicationMigrationItemsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input EnableMigrationInput) (result ReplicationMigrationItemsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.PolicyID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationMigrationItemsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input EnableMigrationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) CreateSender(req *http.Request) (future ReplicationMigrationItemsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) CreateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// deleteOption - the delete option. +func (client ReplicationMigrationItemsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (result ReplicationMigrationItemsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, migrationItemName, deleteOption) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationMigrationItemsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(deleteOption) > 0 { + queryParameters["deleteOption"] = autorest.Encode("query", deleteOption) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) DeleteSender(req *http.Request) (future ReplicationMigrationItemsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get sends the get request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +func (client ReplicationMigrationItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, migrationItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationMigrationItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) GetResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List sends the list request. +// Parameters: +// skipToken - the pagination token. +// takeToken - the page size. +// filter - oData filter options. +func (client ReplicationMigrationItemsClient) List(ctx context.Context, skipToken string, takeToken string, filter string) (result MigrationItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.List") + defer func() { + sc := -1 + if result.mic.Response.Response != nil { + sc = result.mic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, takeToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.mic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", resp, "Failure sending request") + return + } + + result.mic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", resp, "Failure responding to request") + return + } + if result.mic.hasNextLink() && result.mic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationMigrationItemsClient) ListPreparer(ctx context.Context, skipToken string, takeToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationMigrationItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ListResponder(resp *http.Response) (result MigrationItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationMigrationItemsClient) listNextResults(ctx context.Context, lastResults MigrationItemCollection) (result MigrationItemCollection, err error) { + req, err := lastResults.migrationItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationMigrationItemsClient) ListComplete(ctx context.Context, skipToken string, takeToken string, filter string) (result MigrationItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, takeToken, filter) + return +} + +// ListByReplicationProtectionContainers gets the list of ASR migration items in the protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// skipToken - the pagination token. +// takeToken - the page size. +// filter - oData filter options. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result MigrationItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.mic.Response.Response != nil { + sc = result.mic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName, skipToken, takeToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.mic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.mic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.mic.hasNextLink() && result.mic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result MigrationItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationMigrationItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults MigrationItemCollection) (result MigrationItemCollection, err error) { + req, err := lastResults.migrationItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result MigrationItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName, skipToken, takeToken, filter) + return +} + +// Migrate the operation to initiate migration of the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// migrateInput - migrate input. +func (client ReplicationMigrationItemsClient) Migrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput MigrateInput) (result ReplicationMigrationItemsMigrateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Migrate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: migrateInput, + Constraints: []validation.Constraint{{Target: "migrateInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Migrate", err.Error()) + } + + req, err := client.MigratePreparer(ctx, fabricName, protectionContainerName, migrationItemName, migrateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Migrate", nil, "Failure preparing request") + return + } + + result, err = client.MigrateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Migrate", result.Response(), "Failure sending request") + return + } + + return +} + +// MigratePreparer prepares the Migrate request. +func (client ReplicationMigrationItemsClient) MigratePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput MigrateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrate", pathParameters), + autorest.WithJSON(migrateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateSender sends the Migrate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) MigrateSender(req *http.Request) (future ReplicationMigrationItemsMigrateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateResponder handles the response to the Migrate request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) MigrateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Resync the operation to resynchronize replication of an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - resync input. +func (client ReplicationMigrationItemsClient) Resync(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input ResyncInput) (result ReplicationMigrationItemsResyncFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Resync") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Resync", err.Error()) + } + + req, err := client.ResyncPreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Resync", nil, "Failure preparing request") + return + } + + result, err = client.ResyncSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Resync", result.Response(), "Failure sending request") + return + } + + return +} + +// ResyncPreparer prepares the Resync request. +func (client ReplicationMigrationItemsClient) ResyncPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input ResyncInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/resync", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResyncSender sends the Resync request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ResyncSender(req *http.Request) (future ReplicationMigrationItemsResyncFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResyncResponder handles the response to the Resync request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ResyncResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestMigrate the operation to initiate test migration of the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// testMigrateInput - test migrate input. +func (client ReplicationMigrationItemsClient) TestMigrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput TestMigrateInput) (result ReplicationMigrationItemsTestMigrateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.TestMigrate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testMigrateInput, + Constraints: []validation.Constraint{{Target: "testMigrateInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "TestMigrate", err.Error()) + } + + req, err := client.TestMigratePreparer(ctx, fabricName, protectionContainerName, migrationItemName, testMigrateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrate", nil, "Failure preparing request") + return + } + + result, err = client.TestMigrateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrate", result.Response(), "Failure sending request") + return + } + + return +} + +// TestMigratePreparer prepares the TestMigrate request. +func (client ReplicationMigrationItemsClient) TestMigratePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput TestMigrateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrate", pathParameters), + autorest.WithJSON(testMigrateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestMigrateSender sends the TestMigrate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) TestMigrateSender(req *http.Request) (future ReplicationMigrationItemsTestMigrateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestMigrateResponder handles the response to the TestMigrate request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) TestMigrateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestMigrateCleanup the operation to initiate test migrate cleanup. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// testMigrateCleanupInput - test migrate cleanup input. +func (client ReplicationMigrationItemsClient) TestMigrateCleanup(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput TestMigrateCleanupInput) (result ReplicationMigrationItemsTestMigrateCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.TestMigrateCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testMigrateCleanupInput, + Constraints: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", err.Error()) + } + + req, err := client.TestMigrateCleanupPreparer(ctx, fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestMigrateCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestMigrateCleanupPreparer prepares the TestMigrateCleanup request. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput TestMigrateCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrateCleanup", pathParameters), + autorest.WithJSON(testMigrateCleanupInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestMigrateCleanupSender sends the TestMigrateCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupSender(req *http.Request) (future ReplicationMigrationItemsTestMigrateCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestMigrateCleanupResponder handles the response to the TestMigrateCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update the recovery settings of an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - update migration item input. +func (client ReplicationMigrationItemsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input UpdateMigrationItemInput) (result ReplicationMigrationItemsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationMigrationItemsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input UpdateMigrationItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) UpdateSender(req *http.Request) (future ReplicationMigrationItemsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) UpdateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationnetworkmappings.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationnetworkmappings.go new file mode 100644 index 000000000000..3fcafe955352 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationnetworkmappings.go @@ -0,0 +1,610 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationNetworkMappingsClient is the client for the ReplicationNetworkMappings methods of the Siterecovery +// service. +type ReplicationNetworkMappingsClient struct { + BaseClient +} + +// NewReplicationNetworkMappingsClient creates an instance of the ReplicationNetworkMappingsClient client. +func NewReplicationNetworkMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworkMappingsClient { + return NewReplicationNetworkMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationNetworkMappingsClientWithBaseURI creates an instance of the ReplicationNetworkMappingsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationNetworkMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworkMappingsClient { + return ReplicationNetworkMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +// input - create network mapping input. +func (client ReplicationNetworkMappingsClient) Create(ctx context.Context, fabricName string, networkName string, networkMappingName string, input CreateNetworkMappingInput) (result ReplicationNetworkMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.RecoveryNetworkID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationNetworkMappingsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, networkName, networkMappingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationNetworkMappingsClient) CreatePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string, input CreateNetworkMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) CreateSender(req *http.Request) (future ReplicationNetworkMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) CreateResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - ARM Resource Name for network mapping. +func (client ReplicationNetworkMappingsClient) Delete(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result ReplicationNetworkMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, networkName, networkMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationNetworkMappingsClient) DeletePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) DeleteSender(req *http.Request) (future ReplicationNetworkMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +func (client ReplicationNetworkMappingsClient) Get(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result NetworkMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, networkName, networkMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationNetworkMappingsClient) GetPreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) GetResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all ASR network mappings in the vault. +func (client ReplicationNetworkMappingsClient) List(ctx context.Context) (result NetworkMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.List") + defer func() { + sc := -1 + if result.nmc.Response.Response != nil { + sc = result.nmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.nmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", resp, "Failure sending request") + return + } + + result.nmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.nmc.hasNextLink() && result.nmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationNetworkMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationNetworkMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) ListResponder(resp *http.Response) (result NetworkMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationNetworkMappingsClient) listNextResults(ctx context.Context, lastResults NetworkMappingCollection) (result NetworkMappingCollection, err error) { + req, err := lastResults.networkMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworkMappingsClient) ListComplete(ctx context.Context) (result NetworkMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationNetworks lists all ASR network mappings for the specified network. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworks(ctx context.Context, fabricName string, networkName string) (result NetworkMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.ListByReplicationNetworks") + defer func() { + sc := -1 + if result.nmc.Response.Response != nil { + sc = result.nmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationNetworksNextResults + req, err := client.ListByReplicationNetworksPreparer(ctx, fabricName, networkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationNetworksSender(req) + if err != nil { + result.nmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", resp, "Failure sending request") + return + } + + result.nmc, err = client.ListByReplicationNetworksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", resp, "Failure responding to request") + return + } + if result.nmc.hasNextLink() && result.nmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationNetworksPreparer prepares the ListByReplicationNetworks request. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksPreparer(ctx context.Context, fabricName string, networkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationNetworksSender sends the ListByReplicationNetworks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationNetworksResponder handles the response to the ListByReplicationNetworks request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksResponder(resp *http.Response) (result NetworkMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationNetworksNextResults retrieves the next set of results, if any. +func (client ReplicationNetworkMappingsClient) listByReplicationNetworksNextResults(ctx context.Context, lastResults NetworkMappingCollection) (result NetworkMappingCollection, err error) { + req, err := lastResults.networkMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationNetworksSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationNetworksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationNetworksComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksComplete(ctx context.Context, fabricName string, networkName string) (result NetworkMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.ListByReplicationNetworks") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationNetworks(ctx, fabricName, networkName) + return +} + +// Update the operation to update an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +// input - update network mapping input. +func (client ReplicationNetworkMappingsClient) Update(ctx context.Context, fabricName string, networkName string, networkMappingName string, input UpdateNetworkMappingInput) (result ReplicationNetworkMappingsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, networkName, networkMappingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationNetworkMappingsClient) UpdatePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string, input UpdateNetworkMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) UpdateSender(req *http.Request) (future ReplicationNetworkMappingsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) UpdateResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationnetworks.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationnetworks.go new file mode 100644 index 000000000000..1202586ffe81 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationnetworks.go @@ -0,0 +1,343 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationNetworksClient is the client for the ReplicationNetworks methods of the Siterecovery service. +type ReplicationNetworksClient struct { + BaseClient +} + +// NewReplicationNetworksClient creates an instance of the ReplicationNetworksClient client. +func NewReplicationNetworksClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworksClient { + return NewReplicationNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationNetworksClientWithBaseURI creates an instance of the ReplicationNetworksClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationNetworksClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworksClient { + return ReplicationNetworksClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of a network. +// Parameters: +// fabricName - server Id. +// networkName - primary network name. +func (client ReplicationNetworksClient) Get(ctx context.Context, fabricName string, networkName string) (result Network, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, networkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationNetworksClient) GetPreparer(ctx context.Context, fabricName string, networkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) GetResponder(resp *http.Response) (result Network, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the networks available in a vault. +func (client ReplicationNetworksClient) List(ctx context.Context) (result NetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.List") + defer func() { + sc := -1 + if result.nc.Response.Response != nil { + sc = result.nc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.nc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", resp, "Failure sending request") + return + } + + result.nc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", resp, "Failure responding to request") + return + } + if result.nc.hasNextLink() && result.nc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationNetworksClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) ListResponder(resp *http.Response) (result NetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationNetworksClient) listNextResults(ctx context.Context, lastResults NetworkCollection) (result NetworkCollection, err error) { + req, err := lastResults.networkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworksClient) ListComplete(ctx context.Context) (result NetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the networks available for a fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationNetworksClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result NetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.nc.Response.Response != nil { + sc = result.nc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.nc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.nc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.nc.hasNextLink() && result.nc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationNetworksClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) ListByReplicationFabricsResponder(resp *http.Response) (result NetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationNetworksClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults NetworkCollection) (result NetworkCollection, err error) { + req, err := lastResults.networkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworksClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result NetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationpolicies.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationpolicies.go new file mode 100644 index 000000000000..f8f5b038d624 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationpolicies.go @@ -0,0 +1,465 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationPoliciesClient is the client for the ReplicationPolicies methods of the Siterecovery service. +type ReplicationPoliciesClient struct { + BaseClient +} + +// NewReplicationPoliciesClient creates an instance of the ReplicationPoliciesClient client. +func NewReplicationPoliciesClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationPoliciesClient { + return NewReplicationPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationPoliciesClientWithBaseURI creates an instance of the ReplicationPoliciesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationPoliciesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationPoliciesClient { + return ReplicationPoliciesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a replication policy. +// Parameters: +// policyName - replication policy name. +// input - create policy input. +func (client ReplicationPoliciesClient) Create(ctx context.Context, policyName string, input CreatePolicyInput) (result ReplicationPoliciesCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, policyName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationPoliciesClient) CreatePreparer(ctx context.Context, policyName string, input CreatePolicyInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) CreateSender(req *http.Request) (future ReplicationPoliciesCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) CreateResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a replication policy. +// Parameters: +// policyName - replication policy name. +func (client ReplicationPoliciesClient) Delete(ctx context.Context, policyName string) (result ReplicationPoliciesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationPoliciesClient) DeletePreparer(ctx context.Context, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) DeleteSender(req *http.Request) (future ReplicationPoliciesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a replication policy. +// Parameters: +// policyName - replication policy name. +func (client ReplicationPoliciesClient) Get(ctx context.Context, policyName string) (result Policy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationPoliciesClient) GetPreparer(ctx context.Context, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) GetResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the replication policies for a vault. +func (client ReplicationPoliciesClient) List(ctx context.Context) (result PolicyCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.List") + defer func() { + sc := -1 + if result.pc.Response.Response != nil { + sc = result.pc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", resp, "Failure sending request") + return + } + + result.pc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", resp, "Failure responding to request") + return + } + if result.pc.hasNextLink() && result.pc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationPoliciesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) ListResponder(resp *http.Response) (result PolicyCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationPoliciesClient) listNextResults(ctx context.Context, lastResults PolicyCollection) (result PolicyCollection, err error) { + req, err := lastResults.policyCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationPoliciesClient) ListComplete(ctx context.Context) (result PolicyCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// Update the operation to update a replication policy. +// Parameters: +// policyName - policy Id. +// input - update Policy Input. +func (client ReplicationPoliciesClient) Update(ctx context.Context, policyName string, input UpdatePolicyInput) (result ReplicationPoliciesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, policyName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationPoliciesClient) UpdatePreparer(ctx context.Context, policyName string, input UpdatePolicyInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) UpdateSender(req *http.Request) (future ReplicationPoliciesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) UpdateResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationprotectableitems.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationprotectableitems.go new file mode 100644 index 000000000000..a9c3f1a2d774 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationprotectableitems.go @@ -0,0 +1,245 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectableItemsClient is the client for the ReplicationProtectableItems methods of the Siterecovery +// service. +type ReplicationProtectableItemsClient struct { + BaseClient +} + +// NewReplicationProtectableItemsClient creates an instance of the ReplicationProtectableItemsClient client. +func NewReplicationProtectableItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectableItemsClient { + return NewReplicationProtectableItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectableItemsClientWithBaseURI creates an instance of the ReplicationProtectableItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationProtectableItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectableItemsClient { + return ReplicationProtectableItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get the operation to get the details of a protectable item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// protectableItemName - protectable item name. +func (client ReplicationProtectableItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (result ProtectableItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, protectableItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectableItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectableItemName": autorest.Encode("path", protectableItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems/{protectableItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectableItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectableItemsClient) GetResponder(resp *http.Response) (result ProtectableItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationProtectionContainers lists the protectable items in a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// filter - oData filter options. +// take - take OData query parameter. +// skipToken - skipToken OData query parameter. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result ProtectableItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.pic.Response.Response != nil { + sc = result.pic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName, filter, take, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.pic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.pic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.pic.hasNextLink() && result.pic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(take) > 0 { + queryParameters["$take"] = autorest.Encode("query", take) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ProtectableItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectableItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ProtectableItemCollection) (result ProtectableItemCollection, err error) { + req, err := lastResults.protectableItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result ProtectableItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName, filter, take, skipToken) + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationprotecteditems.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationprotecteditems.go new file mode 100644 index 000000000000..13af04c9e48b --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationprotecteditems.go @@ -0,0 +1,1842 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectedItemsClient is the client for the ReplicationProtectedItems methods of the Siterecovery service. +type ReplicationProtectedItemsClient struct { + BaseClient +} + +// NewReplicationProtectedItemsClient creates an instance of the ReplicationProtectedItemsClient client. +func NewReplicationProtectedItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectedItemsClient { + return NewReplicationProtectedItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectedItemsClientWithBaseURI creates an instance of the ReplicationProtectedItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationProtectedItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectedItemsClient { + return ReplicationProtectedItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// AddDisks operation to add disks(s) to the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// addDisksInput - add disks input. +func (client ReplicationProtectedItemsClient) AddDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput AddDisksInput) (result ReplicationProtectedItemsAddDisksFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.AddDisks") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddDisksPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, addDisksInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "AddDisks", nil, "Failure preparing request") + return + } + + result, err = client.AddDisksSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "AddDisks", result.Response(), "Failure sending request") + return + } + + return +} + +// AddDisksPreparer prepares the AddDisks request. +func (client ReplicationProtectedItemsClient) AddDisksPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput AddDisksInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/addDisks", pathParameters), + autorest.WithJSON(addDisksInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddDisksSender sends the AddDisks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) AddDisksSender(req *http.Request) (future ReplicationProtectedItemsAddDisksFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// AddDisksResponder handles the response to the AddDisks request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) AddDisksResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ApplyRecoveryPoint the operation to change the recovery point of a failed over replication protected item. +// Parameters: +// fabricName - the ARM fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replicated protected item name. +// applyRecoveryPointInput - the ApplyRecoveryPointInput. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPoint(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput ApplyRecoveryPointInput) (result ReplicationProtectedItemsApplyRecoveryPointFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ApplyRecoveryPoint") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: applyRecoveryPointInput, + Constraints: []validation.Constraint{{Target: "applyRecoveryPointInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", err.Error()) + } + + req, err := client.ApplyRecoveryPointPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, applyRecoveryPointInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", nil, "Failure preparing request") + return + } + + result, err = client.ApplyRecoveryPointSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", result.Response(), "Failure sending request") + return + } + + return +} + +// ApplyRecoveryPointPreparer prepares the ApplyRecoveryPoint request. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput ApplyRecoveryPointInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/applyRecoveryPoint", pathParameters), + autorest.WithJSON(applyRecoveryPointInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ApplyRecoveryPointSender sends the ApplyRecoveryPoint request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointSender(req *http.Request) (future ReplicationProtectedItemsApplyRecoveryPointFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ApplyRecoveryPointResponder handles the response to the ApplyRecoveryPoint request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Create the operation to create an ASR replication protected item (Enable replication). +// Parameters: +// fabricName - name of the fabric. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - a name for the replication protected item. +// input - enable Protection Input. +func (client ReplicationProtectedItemsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input EnableProtectionInput) (result ReplicationProtectedItemsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectedItemsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input EnableProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) CreateSender(req *http.Request) (future ReplicationProtectedItemsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) CreateResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to disable replication on a replication protected item. This will also remove the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// disableProtectionInput - disable protection input. +func (client ReplicationProtectedItemsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput DisableProtectionInput) (result ReplicationProtectedItemsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: disableProtectionInput, + Constraints: []validation.Constraint{{Target: "disableProtectionInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, disableProtectionInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectedItemsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput DisableProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/remove", pathParameters), + autorest.WithJSON(disableProtectionInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) DeleteSender(req *http.Request) (future ReplicationProtectedItemsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// FailoverCancel operation to cancel the failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) FailoverCancel(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsFailoverCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.FailoverCancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCancelPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCancel", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCancel", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCancelPreparer prepares the FailoverCancel request. +func (client ReplicationProtectedItemsClient) FailoverCancelPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCancelSender sends the FailoverCancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) FailoverCancelSender(req *http.Request) (future ReplicationProtectedItemsFailoverCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCancelResponder handles the response to the FailoverCancel request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) FailoverCancelResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// FailoverCommit operation to commit the failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) FailoverCommit(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsFailoverCommitFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.FailoverCommit") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCommitPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCommit", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCommitSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCommit", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCommitPreparer prepares the FailoverCommit request. +func (client ReplicationProtectedItemsClient) FailoverCommitPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCommit", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCommitSender sends the FailoverCommit request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) FailoverCommitSender(req *http.Request) (future ReplicationProtectedItemsFailoverCommitFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCommitResponder handles the response to the FailoverCommit request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) FailoverCommitResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of an ASR replication protected item. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectedItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) GetResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of ASR replication protected items in the vault. +// Parameters: +// skipToken - the pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. +// filter - oData filter options. +func (client ReplicationProtectedItemsClient) List(ctx context.Context, skipToken string, filter string) (result ReplicationProtectedItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.List") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectedItemsClient) ListPreparer(ctx context.Context, skipToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectedItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ListResponder(resp *http.Response) (result ReplicationProtectedItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectedItemsClient) listNextResults(ctx context.Context, lastResults ReplicationProtectedItemCollection) (result ReplicationProtectedItemCollection, err error) { + req, err := lastResults.replicationProtectedItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectedItemsClient) ListComplete(ctx context.Context, skipToken string, filter string) (result ReplicationProtectedItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, filter) + return +} + +// ListByReplicationProtectionContainers gets the list of ASR replication protected items in the protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectedItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ReplicationProtectedItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectedItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ReplicationProtectedItemCollection) (result ReplicationProtectedItemCollection, err error) { + req, err := lastResults.replicationProtectedItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectedItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName) + return +} + +// PlannedFailover operation to initiate a planned failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// failoverInput - planned failover input. +func (client ReplicationProtectedItemsClient) PlannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput PlannedFailoverInput) (result ReplicationProtectedItemsPlannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.PlannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PlannedFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "PlannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.PlannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "PlannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// PlannedFailoverPreparer prepares the PlannedFailover request. +func (client ReplicationProtectedItemsClient) PlannedFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput PlannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/plannedFailover", pathParameters), + autorest.WithJSON(failoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PlannedFailoverSender sends the PlannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) PlannedFailoverSender(req *http.Request) (future ReplicationProtectedItemsPlannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PlannedFailoverResponder handles the response to the PlannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) PlannedFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Purge the operation to delete or purge a replication protected item. This operation will force delete the +// replication protected item. Use the remove operation on replication protected item to perform a clean disable +// replication for the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) Purge(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationProtectedItemsClient) PurgePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) PurgeSender(req *http.Request) (future ReplicationProtectedItemsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RemoveDisks operation to remove disk(s) from the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// removeDisksInput - remove disks input. +func (client ReplicationProtectedItemsClient) RemoveDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput RemoveDisksInput) (result ReplicationProtectedItemsRemoveDisksFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.RemoveDisks") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RemoveDisksPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, removeDisksInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RemoveDisks", nil, "Failure preparing request") + return + } + + result, err = client.RemoveDisksSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RemoveDisks", result.Response(), "Failure sending request") + return + } + + return +} + +// RemoveDisksPreparer prepares the RemoveDisks request. +func (client ReplicationProtectedItemsClient) RemoveDisksPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput RemoveDisksInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/removeDisks", pathParameters), + autorest.WithJSON(removeDisksInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RemoveDisksSender sends the RemoveDisks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) RemoveDisksSender(req *http.Request) (future ReplicationProtectedItemsRemoveDisksFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RemoveDisksResponder handles the response to the RemoveDisks request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) RemoveDisksResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RepairReplication the operation to start resynchronize/repair replication for a replication protected item requiring +// resynchronization. +// Parameters: +// fabricName - the name of the fabric. +// protectionContainerName - the name of the container. +// replicatedProtectedItemName - the name of the replication protected item. +func (client ReplicationProtectedItemsClient) RepairReplication(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsRepairReplicationFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.RepairReplication") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RepairReplicationPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RepairReplication", nil, "Failure preparing request") + return + } + + result, err = client.RepairReplicationSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RepairReplication", result.Response(), "Failure sending request") + return + } + + return +} + +// RepairReplicationPreparer prepares the RepairReplication request. +func (client ReplicationProtectedItemsClient) RepairReplicationPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/repairReplication", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RepairReplicationSender sends the RepairReplication request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) RepairReplicationSender(req *http.Request) (future ReplicationProtectedItemsRepairReplicationFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RepairReplicationResponder handles the response to the RepairReplication request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) RepairReplicationResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Reprotect operation to reprotect or reverse replicate a failed over replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// reprotectInput - reverse replication input. +func (client ReplicationProtectedItemsClient) Reprotect(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput ReverseReplicationInput) (result ReplicationProtectedItemsReprotectFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Reprotect") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReprotectPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, reprotectInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Reprotect", nil, "Failure preparing request") + return + } + + result, err = client.ReprotectSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Reprotect", result.Response(), "Failure sending request") + return + } + + return +} + +// ReprotectPreparer prepares the Reprotect request. +func (client ReplicationProtectedItemsClient) ReprotectPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput ReverseReplicationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/reProtect", pathParameters), + autorest.WithJSON(reprotectInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReprotectSender sends the Reprotect request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ReprotectSender(req *http.Request) (future ReplicationProtectedItemsReprotectFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReprotectResponder handles the response to the Reprotect request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ReprotectResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ResolveHealthErrors operation to resolve health issues of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// resolveHealthInput - health issue input object. +func (client ReplicationProtectedItemsClient) ResolveHealthErrors(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput ResolveHealthInput) (result ReplicationProtectedItemsResolveHealthErrorsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ResolveHealthErrors") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResolveHealthErrorsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, resolveHealthInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ResolveHealthErrors", nil, "Failure preparing request") + return + } + + result, err = client.ResolveHealthErrorsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ResolveHealthErrors", result.Response(), "Failure sending request") + return + } + + return +} + +// ResolveHealthErrorsPreparer prepares the ResolveHealthErrors request. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput ResolveHealthInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/resolveHealthErrors", pathParameters), + autorest.WithJSON(resolveHealthInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResolveHealthErrorsSender sends the ResolveHealthErrors request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsSender(req *http.Request) (future ReplicationProtectedItemsResolveHealthErrorsFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResolveHealthErrorsResponder handles the response to the ResolveHealthErrors request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailover operation to perform a test failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// testfailoverInput - test failover input. +func (client ReplicationProtectedItemsClient) TestFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput TestFailoverInput) (result ReplicationProtectedItemsTestFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.TestFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testfailoverInput, + Constraints: []validation.Constraint{{Target: "testfailoverInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "TestFailover", err.Error()) + } + + req, err := client.TestFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, testfailoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailover", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverPreparer prepares the TestFailover request. +func (client ReplicationProtectedItemsClient) TestFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput TestFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailover", pathParameters), + autorest.WithJSON(testfailoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverSender sends the TestFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) TestFailoverSender(req *http.Request) (future ReplicationProtectedItemsTestFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverResponder handles the response to the TestFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) TestFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailoverCleanup operation to clean up the test failover of a replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// cleanupInput - test failover cleanup input. +func (client ReplicationProtectedItemsClient) TestFailoverCleanup(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput TestFailoverCleanupInput) (result ReplicationProtectedItemsTestFailoverCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.TestFailoverCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: cleanupInput, + Constraints: []validation.Constraint{{Target: "cleanupInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "cleanupInput.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "cleanupInput.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", err.Error()) + } + + req, err := client.TestFailoverCleanupPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, cleanupInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverCleanupPreparer prepares the TestFailoverCleanup request. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput TestFailoverCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailoverCleanup", pathParameters), + autorest.WithJSON(cleanupInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverCleanupSender sends the TestFailoverCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupSender(req *http.Request) (future ReplicationProtectedItemsTestFailoverCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverCleanupResponder handles the response to the TestFailoverCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UnplannedFailover operation to initiate a failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// failoverInput - failover input. +func (client ReplicationProtectedItemsClient) UnplannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput UnplannedFailoverInput) (result ReplicationProtectedItemsUnplannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UnplannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: failoverInput, + Constraints: []validation.Constraint{{Target: "failoverInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", err.Error()) + } + + req, err := client.UnplannedFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.UnplannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// UnplannedFailoverPreparer prepares the UnplannedFailover request. +func (client ReplicationProtectedItemsClient) UnplannedFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput UnplannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/unplannedFailover", pathParameters), + autorest.WithJSON(failoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UnplannedFailoverSender sends the UnplannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UnplannedFailoverSender(req *http.Request) (future ReplicationProtectedItemsUnplannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UnplannedFailoverResponder handles the response to the UnplannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UnplannedFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update the recovery settings of an ASR replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// updateProtectionInput - update protection input. +func (client ReplicationProtectedItemsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput UpdateReplicationProtectedItemInput) (result ReplicationProtectedItemsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, updateProtectionInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationProtectedItemsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput UpdateReplicationProtectedItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithJSON(updateProtectionInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateSender(req *http.Request) (future ReplicationProtectedItemsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateMobilityService the operation to update(push update) the installed mobility service software on a replication +// protected item to the latest available version. +// Parameters: +// fabricName - the name of the fabric containing the protected item. +// protectionContainerName - the name of the container containing the protected item. +// replicationProtectedItemName - 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. +func (client ReplicationProtectedItemsClient) UpdateMobilityService(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest UpdateMobilityServiceRequest) (result ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UpdateMobilityService") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateMobilityServicePreparer(ctx, fabricName, protectionContainerName, replicationProtectedItemName, updateMobilityServiceRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateMobilityService", nil, "Failure preparing request") + return + } + + result, err = client.UpdateMobilityServiceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateMobilityService", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateMobilityServicePreparer prepares the UpdateMobilityService request. +func (client ReplicationProtectedItemsClient) UpdateMobilityServicePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest UpdateMobilityServiceRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicationProtectedItemName": autorest.Encode("path", replicationProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicationProtectedItemName}/updateMobilityService", pathParameters), + autorest.WithJSON(updateMobilityServiceRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateMobilityServiceSender sends the UpdateMobilityService request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateMobilityServiceSender(req *http.Request) (future ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateMobilityServiceResponder handles the response to the UpdateMobilityService request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateMobilityServiceResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationprotectioncontainermappings.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationprotectioncontainermappings.go new file mode 100644 index 000000000000..0af4c1898639 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationprotectioncontainermappings.go @@ -0,0 +1,688 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionContainerMappingsClient is the client for the ReplicationProtectionContainerMappings methods of +// the Siterecovery service. +type ReplicationProtectionContainerMappingsClient struct { + BaseClient +} + +// NewReplicationProtectionContainerMappingsClient creates an instance of the +// ReplicationProtectionContainerMappingsClient client. +func NewReplicationProtectionContainerMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainerMappingsClient { + return NewReplicationProtectionContainerMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionContainerMappingsClientWithBaseURI creates an instance of the +// ReplicationProtectionContainerMappingsClient client using a custom endpoint. Use this when interacting with an +// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationProtectionContainerMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainerMappingsClient { + return ReplicationProtectionContainerMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// creationInput - mapping creation input. +func (client ReplicationProtectionContainerMappingsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput CreateProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, mappingName, creationInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionContainerMappingsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput CreateProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithJSON(creationInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) CreateSender(req *http.Request) (future ReplicationProtectionContainerMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) CreateResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete or remove a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// removalInput - removal input. +func (client ReplicationProtectionContainerMappingsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput RemoveProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, mappingName, removalInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectionContainerMappingsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput RemoveProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}/remove", pathParameters), + autorest.WithJSON(removalInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) DeleteSender(req *http.Request) (future ReplicationProtectionContainerMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection Container mapping name. +func (client ReplicationProtectionContainerMappingsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result ProtectionContainerMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, mappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionContainerMappingsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) GetResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the protection container mappings in the vault. +func (client ReplicationProtectionContainerMappingsClient) List(ctx context.Context) (result ProtectionContainerMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.List") + defer func() { + sc := -1 + if result.pcmc.Response.Response != nil { + sc = result.pcmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pcmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", resp, "Failure sending request") + return + } + + result.pcmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.pcmc.hasNextLink() && result.pcmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionContainerMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionContainerMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) ListResponder(resp *http.Response) (result ProtectionContainerMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainerMappingsClient) listNextResults(ctx context.Context, lastResults ProtectionContainerMappingCollection) (result ProtectionContainerMappingCollection, err error) { + req, err := lastResults.protectionContainerMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainerMappingsClient) ListComplete(ctx context.Context) (result ProtectionContainerMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationProtectionContainers lists the protection container mappings for a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainerMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.pcmc.Response.Response != nil { + sc = result.pcmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.pcmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.pcmc, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.pcmc.hasNextLink() && result.pcmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ProtectionContainerMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainerMappingsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ProtectionContainerMappingCollection) (result ProtectionContainerMappingCollection, err error) { + req, err := lastResults.protectionContainerMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainerMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName) + return +} + +// Purge the operation to purge(force delete) a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +func (client ReplicationProtectionContainerMappingsClient) Purge(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result ReplicationProtectionContainerMappingsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, protectionContainerName, mappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationProtectionContainerMappingsClient) PurgePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) PurgeSender(req *http.Request) (future ReplicationProtectionContainerMappingsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update the operation to update protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// updateInput - mapping update input. +func (client ReplicationProtectionContainerMappingsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput UpdateProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, mappingName, updateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationProtectionContainerMappingsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput UpdateProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithJSON(updateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) UpdateSender(req *http.Request) (future ReplicationProtectionContainerMappingsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) UpdateResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationprotectioncontainers.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationprotectioncontainers.go new file mode 100644 index 000000000000..77e30faad912 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationprotectioncontainers.go @@ -0,0 +1,677 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionContainersClient is the client for the ReplicationProtectionContainers methods of the +// Siterecovery service. +type ReplicationProtectionContainersClient struct { + BaseClient +} + +// NewReplicationProtectionContainersClient creates an instance of the ReplicationProtectionContainersClient client. +func NewReplicationProtectionContainersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainersClient { + return NewReplicationProtectionContainersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionContainersClientWithBaseURI creates an instance of the ReplicationProtectionContainersClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationProtectionContainersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainersClient { + return ReplicationProtectionContainersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create operation to create a protection container. +// Parameters: +// fabricName - unique fabric ARM name. +// protectionContainerName - unique protection container ARM name. +// creationInput - creation input. +func (client ReplicationProtectionContainersClient) Create(ctx context.Context, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput) (result ReplicationProtectionContainersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, creationInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionContainersClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}", pathParameters), + autorest.WithJSON(creationInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) CreateSender(req *http.Request) (future ReplicationProtectionContainersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) CreateResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete operation to remove a protection container. +// Parameters: +// fabricName - unique fabric ARM name. +// protectionContainerName - unique protection container ARM name. +func (client ReplicationProtectionContainersClient) Delete(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectionContainersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectionContainersClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) DeleteSender(req *http.Request) (future ReplicationProtectionContainersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DiscoverProtectableItem the operation to a add a protectable item to a protection container(Add physical server). +// Parameters: +// fabricName - the name of the fabric. +// protectionContainerName - the name of the protection container. +// discoverProtectableItemRequest - the request object to add a protectable item. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItem(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest) (result ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.DiscoverProtectableItem") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DiscoverProtectableItemPreparer(ctx, fabricName, protectionContainerName, discoverProtectableItemRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "DiscoverProtectableItem", nil, "Failure preparing request") + return + } + + result, err = client.DiscoverProtectableItemSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "DiscoverProtectableItem", result.Response(), "Failure sending request") + return + } + + return +} + +// DiscoverProtectableItemPreparer prepares the DiscoverProtectableItem request. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemPreparer(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/discoverProtectableItem", pathParameters), + autorest.WithJSON(discoverProtectableItemRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DiscoverProtectableItemSender sends the DiscoverProtectableItem request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemSender(req *http.Request) (future ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DiscoverProtectableItemResponder handles the response to the DiscoverProtectableItem request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectionContainersClient) Get(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainer, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionContainersClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) GetResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the protection containers in a vault. +func (client ReplicationProtectionContainersClient) List(ctx context.Context) (result ProtectionContainerCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.List") + defer func() { + sc := -1 + if result.pcc.Response.Response != nil { + sc = result.pcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", resp, "Failure sending request") + return + } + + result.pcc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", resp, "Failure responding to request") + return + } + if result.pcc.hasNextLink() && result.pcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionContainersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionContainers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) ListResponder(resp *http.Response) (result ProtectionContainerCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainersClient) listNextResults(ctx context.Context, lastResults ProtectionContainerCollection) (result ProtectionContainerCollection, err error) { + req, err := lastResults.protectionContainerCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainersClient) ListComplete(ctx context.Context) (result ProtectionContainerCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the protection containers in the specified fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationProtectionContainersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result ProtectionContainerCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.pcc.Response.Response != nil { + sc = result.pcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.pcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.pcc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.pcc.hasNextLink() && result.pcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsResponder(resp *http.Response) (result ProtectionContainerCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults ProtectionContainerCollection) (result ProtectionContainerCollection, err error) { + req, err := lastResults.protectionContainerCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result ProtectionContainerCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// SwitchProtection operation to switch protection from one container to another or one replication provider to +// another. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// switchInput - switch protection input. +func (client ReplicationProtectionContainersClient) SwitchProtection(ctx context.Context, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput) (result ReplicationProtectionContainersSwitchProtectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.SwitchProtection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.SwitchProtectionPreparer(ctx, fabricName, protectionContainerName, switchInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "SwitchProtection", nil, "Failure preparing request") + return + } + + result, err = client.SwitchProtectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "SwitchProtection", result.Response(), "Failure sending request") + return + } + + return +} + +// SwitchProtectionPreparer prepares the SwitchProtection request. +func (client ReplicationProtectionContainersClient) SwitchProtectionPreparer(ctx context.Context, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/switchprotection", pathParameters), + autorest.WithJSON(switchInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SwitchProtectionSender sends the SwitchProtection request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) SwitchProtectionSender(req *http.Request) (future ReplicationProtectionContainersSwitchProtectionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// SwitchProtectionResponder handles the response to the SwitchProtection request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) SwitchProtectionResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationprotectionintents.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationprotectionintents.go new file mode 100644 index 000000000000..0430a41d1429 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationprotectionintents.go @@ -0,0 +1,312 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionIntentsClient is the client for the ReplicationProtectionIntents methods of the Siterecovery +// service. +type ReplicationProtectionIntentsClient struct { + BaseClient +} + +// NewReplicationProtectionIntentsClient creates an instance of the ReplicationProtectionIntentsClient client. +func NewReplicationProtectionIntentsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionIntentsClient { + return NewReplicationProtectionIntentsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionIntentsClientWithBaseURI creates an instance of the ReplicationProtectionIntentsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationProtectionIntentsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionIntentsClient { + return ReplicationProtectionIntentsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR replication protection intent item. +// Parameters: +// intentObjectName - a name for the replication protection item. +// input - create Protection Intent Input. +func (client ReplicationProtectionIntentsClient) Create(ctx context.Context, intentObjectName string, input CreateProtectionIntentInput) (result ReplicationProtectionIntent, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, intentObjectName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionIntentsClient) CreatePreparer(ctx context.Context, intentObjectName string, input CreateProtectionIntentInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "intentObjectName": autorest.Encode("path", intentObjectName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) CreateResponder(resp *http.Response) (result ReplicationProtectionIntent, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of an ASR replication protection intent. +// Parameters: +// intentObjectName - replication protection intent name. +func (client ReplicationProtectionIntentsClient) Get(ctx context.Context, intentObjectName string) (result ReplicationProtectionIntent, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, intentObjectName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionIntentsClient) GetPreparer(ctx context.Context, intentObjectName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "intentObjectName": autorest.Encode("path", intentObjectName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) GetResponder(resp *http.Response) (result ReplicationProtectionIntent, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of ASR replication protection intent objects in the vault. +// Parameters: +// skipToken - the pagination token. +// takeToken - the page size. +func (client ReplicationProtectionIntentsClient) List(ctx context.Context, skipToken string, takeToken string) (result ReplicationProtectionIntentCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.List") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, takeToken) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionIntentsClient) ListPreparer(ctx context.Context, skipToken string, takeToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) ListResponder(resp *http.Response) (result ReplicationProtectionIntentCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionIntentsClient) listNextResults(ctx context.Context, lastResults ReplicationProtectionIntentCollection) (result ReplicationProtectionIntentCollection, err error) { + req, err := lastResults.replicationProtectionIntentCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionIntentsClient) ListComplete(ctx context.Context, skipToken string, takeToken string) (result ReplicationProtectionIntentCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, takeToken) + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationrecoveryplans.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationrecoveryplans.go new file mode 100644 index 000000000000..789e31140242 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationrecoveryplans.go @@ -0,0 +1,1069 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationRecoveryPlansClient is the client for the ReplicationRecoveryPlans methods of the Siterecovery service. +type ReplicationRecoveryPlansClient struct { + BaseClient +} + +// NewReplicationRecoveryPlansClient creates an instance of the ReplicationRecoveryPlansClient client. +func NewReplicationRecoveryPlansClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryPlansClient { + return NewReplicationRecoveryPlansClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationRecoveryPlansClientWithBaseURI creates an instance of the ReplicationRecoveryPlansClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationRecoveryPlansClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryPlansClient { + return ReplicationRecoveryPlansClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery Plan creation input. +func (client ReplicationRecoveryPlansClient) Create(ctx context.Context, recoveryPlanName string, input CreateRecoveryPlanInput) (result ReplicationRecoveryPlansCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.PrimaryFabricID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "input.Properties.RecoveryFabricID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "input.Properties.Groups", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationRecoveryPlansClient) CreatePreparer(ctx context.Context, recoveryPlanName string, input CreateRecoveryPlanInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) CreateSender(req *http.Request) (future ReplicationRecoveryPlansCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) CreateResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) Delete(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationRecoveryPlansClient) DeletePreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) DeleteSender(req *http.Request) (future ReplicationRecoveryPlansDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// FailoverCancel the operation to cancel the failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) FailoverCancel(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansFailoverCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.FailoverCancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCancelPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCancel", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCancel", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCancelPreparer prepares the FailoverCancel request. +func (client ReplicationRecoveryPlansClient) FailoverCancelPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCancelSender sends the FailoverCancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) FailoverCancelSender(req *http.Request) (future ReplicationRecoveryPlansFailoverCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCancelResponder handles the response to the FailoverCancel request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) FailoverCancelResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// FailoverCommit the operation to commit the failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) FailoverCommit(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansFailoverCommitFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.FailoverCommit") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCommitPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCommit", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCommitSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCommit", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCommitPreparer prepares the FailoverCommit request. +func (client ReplicationRecoveryPlansClient) FailoverCommitPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCommit", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCommitSender sends the FailoverCommit request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) FailoverCommitSender(req *http.Request) (future ReplicationRecoveryPlansFailoverCommitFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCommitResponder handles the response to the FailoverCommit request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) FailoverCommitResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of the recovery plan. +// Parameters: +// recoveryPlanName - name of the recovery plan. +func (client ReplicationRecoveryPlansClient) Get(ctx context.Context, recoveryPlanName string) (result RecoveryPlan, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationRecoveryPlansClient) GetPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) GetResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the recovery plans in the vault. +func (client ReplicationRecoveryPlansClient) List(ctx context.Context) (result RecoveryPlanCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.List") + defer func() { + sc := -1 + if result.RPCVar.Response.Response != nil { + sc = result.RPCVar.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.RPCVar.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", resp, "Failure sending request") + return + } + + result.RPCVar, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", resp, "Failure responding to request") + return + } + if result.RPCVar.hasNextLink() && result.RPCVar.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationRecoveryPlansClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) ListResponder(resp *http.Response) (result RecoveryPlanCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryPlansClient) listNextResults(ctx context.Context, lastResults RecoveryPlanCollection) (result RecoveryPlanCollection, err error) { + req, err := lastResults.recoveryPlanCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryPlansClient) ListComplete(ctx context.Context) (result RecoveryPlanCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// PlannedFailover the operation to start the planned failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - failover input. +func (client ReplicationRecoveryPlansClient) PlannedFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput) (result ReplicationRecoveryPlansPlannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.PlannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", err.Error()) + } + + req, err := client.PlannedFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.PlannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// PlannedFailoverPreparer prepares the PlannedFailover request. +func (client ReplicationRecoveryPlansClient) PlannedFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/plannedFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PlannedFailoverSender sends the PlannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) PlannedFailoverSender(req *http.Request) (future ReplicationRecoveryPlansPlannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PlannedFailoverResponder handles the response to the PlannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) PlannedFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Reprotect the operation to reprotect(reverse replicate) a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) Reprotect(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansReprotectFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Reprotect") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReprotectPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Reprotect", nil, "Failure preparing request") + return + } + + result, err = client.ReprotectSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Reprotect", result.Response(), "Failure sending request") + return + } + + return +} + +// ReprotectPreparer prepares the Reprotect request. +func (client ReplicationRecoveryPlansClient) ReprotectPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/reProtect", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReprotectSender sends the Reprotect request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) ReprotectSender(req *http.Request) (future ReplicationRecoveryPlansReprotectFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReprotectResponder handles the response to the Reprotect request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) ReprotectResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailover the operation to start the test failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan test failover input. +func (client ReplicationRecoveryPlansClient) TestFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverInput) (result ReplicationRecoveryPlansTestFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.TestFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.NetworkType", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "TestFailover", err.Error()) + } + + req, err := client.TestFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailover", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverPreparer prepares the TestFailover request. +func (client ReplicationRecoveryPlansClient) TestFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverSender sends the TestFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) TestFailoverSender(req *http.Request) (future ReplicationRecoveryPlansTestFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverResponder handles the response to the TestFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) TestFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailoverCleanup the operation to cleanup test failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan test failover cleanup input. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanup(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput) (result ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.TestFailoverCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "input.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", err.Error()) + } + + req, err := client.TestFailoverCleanupPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverCleanupPreparer prepares the TestFailoverCleanup request. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailoverCleanup", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverCleanupSender sends the TestFailoverCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupSender(req *http.Request) (future ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverCleanupResponder handles the response to the TestFailoverCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UnplannedFailover the operation to start the unplanned failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan unplanned failover input. +func (client ReplicationRecoveryPlansClient) UnplannedFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput) (result ReplicationRecoveryPlansUnplannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.UnplannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", err.Error()) + } + + req, err := client.UnplannedFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.UnplannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// UnplannedFailoverPreparer prepares the UnplannedFailover request. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/unplannedFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UnplannedFailoverSender sends the UnplannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverSender(req *http.Request) (future ReplicationRecoveryPlansUnplannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UnplannedFailoverResponder handles the response to the UnplannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - update recovery plan input. +func (client ReplicationRecoveryPlansClient) Update(ctx context.Context, recoveryPlanName string, input UpdateRecoveryPlanInput) (result ReplicationRecoveryPlansUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationRecoveryPlansClient) UpdatePreparer(ctx context.Context, recoveryPlanName string, input UpdateRecoveryPlanInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) UpdateSender(req *http.Request) (future ReplicationRecoveryPlansUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) UpdateResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationrecoveryservicesproviders.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationrecoveryservicesproviders.go new file mode 100644 index 000000000000..30b5fef071c6 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationrecoveryservicesproviders.go @@ -0,0 +1,700 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationRecoveryServicesProvidersClient is the client for the ReplicationRecoveryServicesProviders methods of the +// Siterecovery service. +type ReplicationRecoveryServicesProvidersClient struct { + BaseClient +} + +// NewReplicationRecoveryServicesProvidersClient creates an instance of the ReplicationRecoveryServicesProvidersClient +// client. +func NewReplicationRecoveryServicesProvidersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryServicesProvidersClient { + return NewReplicationRecoveryServicesProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationRecoveryServicesProvidersClientWithBaseURI creates an instance of the +// ReplicationRecoveryServicesProvidersClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationRecoveryServicesProvidersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryServicesProvidersClient { + return ReplicationRecoveryServicesProvidersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to add a recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +// addProviderInput - add provider input. +func (client ReplicationRecoveryServicesProvidersClient) Create(ctx context.Context, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput) (result ReplicationRecoveryServicesProvidersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: addProviderInput, + Constraints: []validation.Constraint{{Target: "addProviderInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.MachineName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.AuthenticationIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.ResourceAccessIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, providerName, addProviderInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationRecoveryServicesProvidersClient) CreatePreparer(ctx context.Context, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithJSON(addProviderInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) CreateSender(req *http.Request) (future ReplicationRecoveryServicesProvidersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) CreateResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to removes/delete(unregister) a recovery services provider from the vault. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Delete(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationRecoveryServicesProvidersClient) DeletePreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) DeleteSender(req *http.Request) (future ReplicationRecoveryServicesProvidersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of registered recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Get(ctx context.Context, fabricName string, providerName string) (result RecoveryServicesProvider, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationRecoveryServicesProvidersClient) GetPreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) GetResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the registered recovery services providers in the vault. +func (client ReplicationRecoveryServicesProvidersClient) List(ctx context.Context) (result RecoveryServicesProviderCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.List") + defer func() { + sc := -1 + if result.rspc.Response.Response != nil { + sc = result.rspc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rspc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", resp, "Failure sending request") + return + } + + result.rspc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", resp, "Failure responding to request") + return + } + if result.rspc.hasNextLink() && result.rspc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationRecoveryServicesProvidersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryServicesProviders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) ListResponder(resp *http.Response) (result RecoveryServicesProviderCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryServicesProvidersClient) listNextResults(ctx context.Context, lastResults RecoveryServicesProviderCollection) (result RecoveryServicesProviderCollection, err error) { + req, err := lastResults.recoveryServicesProviderCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryServicesProvidersClient) ListComplete(ctx context.Context) (result RecoveryServicesProviderCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the registered recovery services providers for the specified fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result RecoveryServicesProviderCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.rspc.Response.Response != nil { + sc = result.rspc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.rspc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.rspc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.rspc.hasNextLink() && result.rspc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsResponder(resp *http.Response) (result RecoveryServicesProviderCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryServicesProvidersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults RecoveryServicesProviderCollection) (result RecoveryServicesProviderCollection, err error) { + req, err := lastResults.recoveryServicesProviderCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result RecoveryServicesProviderCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// Purge the operation to purge(force delete) a recovery services provider from the vault. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Purge(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationRecoveryServicesProvidersClient) PurgePreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) PurgeSender(req *http.Request) (future ReplicationRecoveryServicesProvidersPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RefreshProvider the operation to refresh the information from the recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProvider(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.RefreshProvider") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RefreshProviderPreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "RefreshProvider", nil, "Failure preparing request") + return + } + + result, err = client.RefreshProviderSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "RefreshProvider", result.Response(), "Failure sending request") + return + } + + return +} + +// RefreshProviderPreparer prepares the RefreshProvider request. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderPreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/refreshProvider", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RefreshProviderSender sends the RefreshProvider request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderSender(req *http.Request) (future ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RefreshProviderResponder handles the response to the RefreshProvider request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationstorageclassificationmappings.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationstorageclassificationmappings.go new file mode 100644 index 000000000000..f400ae4cd1cd --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationstorageclassificationmappings.go @@ -0,0 +1,517 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationStorageClassificationMappingsClient is the client for the ReplicationStorageClassificationMappings +// methods of the Siterecovery service. +type ReplicationStorageClassificationMappingsClient struct { + BaseClient +} + +// NewReplicationStorageClassificationMappingsClient creates an instance of the +// ReplicationStorageClassificationMappingsClient client. +func NewReplicationStorageClassificationMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationMappingsClient { + return NewReplicationStorageClassificationMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationStorageClassificationMappingsClientWithBaseURI creates an instance of the +// ReplicationStorageClassificationMappingsClient client using a custom endpoint. Use this when interacting with an +// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationStorageClassificationMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationMappingsClient { + return ReplicationStorageClassificationMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +// pairingInput - pairing input. +func (client ReplicationStorageClassificationMappingsClient) Create(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput StorageClassificationMappingInput) (result ReplicationStorageClassificationMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName, pairingInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationStorageClassificationMappingsClient) CreatePreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput StorageClassificationMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithJSON(pairingInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) CreateSender(req *http.Request) (future ReplicationStorageClassificationMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) CreateResponder(resp *http.Response) (result StorageClassificationMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +func (client ReplicationStorageClassificationMappingsClient) Delete(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result ReplicationStorageClassificationMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationStorageClassificationMappingsClient) DeletePreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) DeleteSender(req *http.Request) (future ReplicationStorageClassificationMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the specified storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +func (client ReplicationStorageClassificationMappingsClient) Get(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result StorageClassificationMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationStorageClassificationMappingsClient) GetPreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) GetResponder(resp *http.Response) (result StorageClassificationMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the storage classification mappings in the vault. +func (client ReplicationStorageClassificationMappingsClient) List(ctx context.Context) (result StorageClassificationMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.List") + defer func() { + sc := -1 + if result.scmc.Response.Response != nil { + sc = result.scmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.scmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", resp, "Failure sending request") + return + } + + result.scmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.scmc.hasNextLink() && result.scmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationStorageClassificationMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationStorageClassificationMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) ListResponder(resp *http.Response) (result StorageClassificationMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationMappingsClient) listNextResults(ctx context.Context, lastResults StorageClassificationMappingCollection) (result StorageClassificationMappingCollection, err error) { + req, err := lastResults.storageClassificationMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationMappingsClient) ListComplete(ctx context.Context) (result StorageClassificationMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationStorageClassifications lists the storage classification mappings for the fabric. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassifications(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassificationMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.ListByReplicationStorageClassifications") + defer func() { + sc := -1 + if result.scmc.Response.Response != nil { + sc = result.scmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationStorageClassificationsNextResults + req, err := client.ListByReplicationStorageClassificationsPreparer(ctx, fabricName, storageClassificationName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationStorageClassificationsSender(req) + if err != nil { + result.scmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", resp, "Failure sending request") + return + } + + result.scmc, err = client.ListByReplicationStorageClassificationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", resp, "Failure responding to request") + return + } + if result.scmc.hasNextLink() && result.scmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationStorageClassificationsPreparer prepares the ListByReplicationStorageClassifications request. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsPreparer(ctx context.Context, fabricName string, storageClassificationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationStorageClassificationsSender sends the ListByReplicationStorageClassifications request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationStorageClassificationsResponder handles the response to the ListByReplicationStorageClassifications request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsResponder(resp *http.Response) (result StorageClassificationMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationStorageClassificationsNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationMappingsClient) listByReplicationStorageClassificationsNextResults(ctx context.Context, lastResults StorageClassificationMappingCollection) (result StorageClassificationMappingCollection, err error) { + req, err := lastResults.storageClassificationMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationStorageClassificationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationStorageClassificationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationStorageClassificationsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsComplete(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassificationMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.ListByReplicationStorageClassifications") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationStorageClassifications(ctx, fabricName, storageClassificationName) + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationstorageclassifications.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationstorageclassifications.go new file mode 100644 index 000000000000..93d79e91f85b --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationstorageclassifications.go @@ -0,0 +1,345 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationStorageClassificationsClient is the client for the ReplicationStorageClassifications methods of the +// Siterecovery service. +type ReplicationStorageClassificationsClient struct { + BaseClient +} + +// NewReplicationStorageClassificationsClient creates an instance of the ReplicationStorageClassificationsClient +// client. +func NewReplicationStorageClassificationsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationsClient { + return NewReplicationStorageClassificationsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationStorageClassificationsClientWithBaseURI creates an instance of the +// ReplicationStorageClassificationsClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationStorageClassificationsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationsClient { + return ReplicationStorageClassificationsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of the specified storage classification. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +func (client ReplicationStorageClassificationsClient) Get(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassification, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, storageClassificationName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationStorageClassificationsClient) GetPreparer(ctx context.Context, fabricName string, storageClassificationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) GetResponder(resp *http.Response) (result StorageClassification, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the storage classifications in the vault. +func (client ReplicationStorageClassificationsClient) List(ctx context.Context) (result StorageClassificationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.List") + defer func() { + sc := -1 + if result.scc.Response.Response != nil { + sc = result.scc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.scc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", resp, "Failure sending request") + return + } + + result.scc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", resp, "Failure responding to request") + return + } + if result.scc.hasNextLink() && result.scc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationStorageClassificationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationStorageClassifications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) ListResponder(resp *http.Response) (result StorageClassificationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationsClient) listNextResults(ctx context.Context, lastResults StorageClassificationCollection) (result StorageClassificationCollection, err error) { + req, err := lastResults.storageClassificationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationsClient) ListComplete(ctx context.Context) (result StorageClassificationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the storage classifications available in the specified fabric. +// Parameters: +// fabricName - site name of interest. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result StorageClassificationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.scc.Response.Response != nil { + sc = result.scc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.scc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.scc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.scc.hasNextLink() && result.scc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsResponder(resp *http.Response) (result StorageClassificationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationsClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults StorageClassificationCollection) (result StorageClassificationCollection, err error) { + req, err := lastResults.storageClassificationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result StorageClassificationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationvaulthealth.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationvaulthealth.go new file mode 100644 index 000000000000..1bd9936658c6 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationvaulthealth.go @@ -0,0 +1,181 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationVaultHealthClient is the client for the ReplicationVaultHealth methods of the Siterecovery service. +type ReplicationVaultHealthClient struct { + BaseClient +} + +// NewReplicationVaultHealthClient creates an instance of the ReplicationVaultHealthClient client. +func NewReplicationVaultHealthClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultHealthClient { + return NewReplicationVaultHealthClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationVaultHealthClientWithBaseURI creates an instance of the ReplicationVaultHealthClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewReplicationVaultHealthClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultHealthClient { + return ReplicationVaultHealthClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the health details of the vault. +func (client ReplicationVaultHealthClient) Get(ctx context.Context) (result VaultHealthDetails, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultHealthClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationVaultHealthClient) GetPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultHealthClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationVaultHealthClient) GetResponder(resp *http.Response) (result VaultHealthDetails, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Refresh sends the refresh request. +func (client ReplicationVaultHealthClient) Refresh(ctx context.Context) (result ReplicationVaultHealthRefreshFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultHealthClient.Refresh") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RefreshPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Refresh", nil, "Failure preparing request") + return + } + + result, err = client.RefreshSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Refresh", result.Response(), "Failure sending request") + return + } + + return +} + +// RefreshPreparer prepares the Refresh request. +func (client ReplicationVaultHealthClient) RefreshPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth/default/refresh", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RefreshSender sends the Refresh request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultHealthClient) RefreshSender(req *http.Request) (future ReplicationVaultHealthRefreshFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RefreshResponder handles the response to the Refresh request. The method always +// closes the http.Response Body. +func (client ReplicationVaultHealthClient) RefreshResponder(resp *http.Response) (result VaultHealthDetails, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationvaultsetting.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationvaultsetting.go new file mode 100644 index 000000000000..7db334a2d18b --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationvaultsetting.go @@ -0,0 +1,313 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationVaultSettingClient is the client for the ReplicationVaultSetting methods of the Siterecovery service. +type ReplicationVaultSettingClient struct { + BaseClient +} + +// NewReplicationVaultSettingClient creates an instance of the ReplicationVaultSettingClient client. +func NewReplicationVaultSettingClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultSettingClient { + return NewReplicationVaultSettingClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationVaultSettingClientWithBaseURI creates an instance of the ReplicationVaultSettingClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewReplicationVaultSettingClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultSettingClient { + return ReplicationVaultSettingClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to configure vault setting. +// Parameters: +// vaultSettingName - vault setting name. +// input - vault setting creation input. +func (client ReplicationVaultSettingClient) Create(ctx context.Context, vaultSettingName string, input VaultSettingCreationInput) (result ReplicationVaultSettingCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.MigrationSolutionID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationVaultSettingClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, vaultSettingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationVaultSettingClient) CreatePreparer(ctx context.Context, vaultSettingName string, input VaultSettingCreationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultSettingName": autorest.Encode("path", vaultSettingName), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) CreateSender(req *http.Request) (future ReplicationVaultSettingCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) CreateResponder(resp *http.Response) (result VaultSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the vault setting. This includes the Migration Hub connection settings. +// Parameters: +// vaultSettingName - vault setting name. +func (client ReplicationVaultSettingClient) Get(ctx context.Context, vaultSettingName string) (result VaultSetting, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, vaultSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationVaultSettingClient) GetPreparer(ctx context.Context, vaultSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultSettingName": autorest.Encode("path", vaultSettingName), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) GetResponder(resp *http.Response) (result VaultSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of vault setting. This includes the Migration Hub connection settings. +func (client ReplicationVaultSettingClient) List(ctx context.Context) (result VaultSettingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.List") + defer func() { + sc := -1 + if result.vsc.Response.Response != nil { + sc = result.vsc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vsc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", resp, "Failure sending request") + return + } + + result.vsc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", resp, "Failure responding to request") + return + } + if result.vsc.hasNextLink() && result.vsc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationVaultSettingClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) ListResponder(resp *http.Response) (result VaultSettingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationVaultSettingClient) listNextResults(ctx context.Context, lastResults VaultSettingCollection) (result VaultSettingCollection, err error) { + req, err := lastResults.vaultSettingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationVaultSettingClient) ListComplete(ctx context.Context) (result VaultSettingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationvcenters.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationvcenters.go new file mode 100644 index 000000000000..713992c4fa4a --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/replicationvcenters.go @@ -0,0 +1,591 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationvCentersClient is the client for the ReplicationvCenters methods of the Siterecovery service. +type ReplicationvCentersClient struct { + BaseClient +} + +// NewReplicationvCentersClient creates an instance of the ReplicationvCentersClient client. +func NewReplicationvCentersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationvCentersClient { + return NewReplicationvCentersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationvCentersClientWithBaseURI creates an instance of the ReplicationvCentersClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationvCentersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationvCentersClient { + return ReplicationvCentersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a vCenter object.. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +// addVCenterRequest - the input to the add vCenter operation. +func (client ReplicationvCentersClient) Create(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest) (result ReplicationvCentersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, vcenterName, addVCenterRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationvCentersClient) CreatePreparer(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithJSON(addVCenterRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) CreateSender(req *http.Request) (future ReplicationvCentersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) CreateResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to remove(unregister) a registered vCenter server from the vault. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +func (client ReplicationvCentersClient) Delete(ctx context.Context, fabricName string, vcenterName string) (result ReplicationvCentersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, vcenterName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationvCentersClient) DeletePreparer(ctx context.Context, fabricName string, vcenterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) DeleteSender(req *http.Request) (future ReplicationvCentersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a registered vCenter server(Add vCenter server). +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +func (client ReplicationvCentersClient) Get(ctx context.Context, fabricName string, vcenterName string) (result VCenter, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, vcenterName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationvCentersClient) GetPreparer(ctx context.Context, fabricName string, vcenterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) GetResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the vCenter servers registered in the vault. +func (client ReplicationvCentersClient) List(ctx context.Context) (result VCenterCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.List") + defer func() { + sc := -1 + if result.vcc.Response.Response != nil { + sc = result.vcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", resp, "Failure sending request") + return + } + + result.vcc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", resp, "Failure responding to request") + return + } + if result.vcc.hasNextLink() && result.vcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationvCentersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationvCenters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) ListResponder(resp *http.Response) (result VCenterCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationvCentersClient) listNextResults(ctx context.Context, lastResults VCenterCollection) (result VCenterCollection, err error) { + req, err := lastResults.vCenterCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationvCentersClient) ListComplete(ctx context.Context) (result VCenterCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the vCenter servers registered in a fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationvCentersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result VCenterCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.vcc.Response.Response != nil { + sc = result.vcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.vcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.vcc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.vcc.hasNextLink() && result.vcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationvCentersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) ListByReplicationFabricsResponder(resp *http.Response) (result VCenterCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationvCentersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults VCenterCollection) (result VCenterCollection, err error) { + req, err := lastResults.vCenterCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationvCentersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result VCenterCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// Update the operation to update a registered vCenter. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +// updateVCenterRequest - the input to the update vCenter operation. +func (client ReplicationvCentersClient) Update(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest) (result ReplicationvCentersUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, vcenterName, updateVCenterRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationvCentersClient) UpdatePreparer(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithJSON(updateVCenterRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) UpdateSender(req *http.Request) (future ReplicationvCentersUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) UpdateResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/siterecoveryapi/interfaces.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/siterecoveryapi/interfaces.go new file mode 100644 index 000000000000..8a504e414d2a --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/siterecoveryapi/interfaces.go @@ -0,0 +1,340 @@ +package siterecoveryapi + +// 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. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-02-10/siterecovery" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result siterecovery.OperationsDiscoveryCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.OperationsDiscoveryCollectionIterator, err error) +} + +var _ OperationsClientAPI = (*siterecovery.OperationsClient)(nil) + +// ReplicationAlertSettingsClientAPI contains the set of methods on the ReplicationAlertSettingsClient type. +type ReplicationAlertSettingsClientAPI interface { + Create(ctx context.Context, alertSettingName string, request siterecovery.ConfigureAlertRequest) (result siterecovery.Alert, err error) + Get(ctx context.Context, alertSettingName string) (result siterecovery.Alert, err error) + List(ctx context.Context) (result siterecovery.AlertCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.AlertCollectionIterator, err error) +} + +var _ ReplicationAlertSettingsClientAPI = (*siterecovery.ReplicationAlertSettingsClient)(nil) + +// ReplicationEligibilityResultsClientAPI contains the set of methods on the ReplicationEligibilityResultsClient type. +type ReplicationEligibilityResultsClientAPI interface { + Get(ctx context.Context, virtualMachineName string) (result siterecovery.ReplicationEligibilityResults, err error) + List(ctx context.Context, virtualMachineName string) (result siterecovery.ReplicationEligibilityResultsCollection, err error) +} + +var _ ReplicationEligibilityResultsClientAPI = (*siterecovery.ReplicationEligibilityResultsClient)(nil) + +// ReplicationEventsClientAPI contains the set of methods on the ReplicationEventsClient type. +type ReplicationEventsClientAPI interface { + Get(ctx context.Context, eventName string) (result siterecovery.Event, err error) + List(ctx context.Context, filter string) (result siterecovery.EventCollectionPage, err error) + ListComplete(ctx context.Context, filter string) (result siterecovery.EventCollectionIterator, err error) +} + +var _ ReplicationEventsClientAPI = (*siterecovery.ReplicationEventsClient)(nil) + +// ReplicationFabricsClientAPI contains the set of methods on the ReplicationFabricsClient type. +type ReplicationFabricsClientAPI interface { + CheckConsistency(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsCheckConsistencyFuture, err error) + Create(ctx context.Context, fabricName string, input siterecovery.FabricCreationInput) (result siterecovery.ReplicationFabricsCreateFuture, err error) + Delete(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, filter string) (result siterecovery.Fabric, err error) + List(ctx context.Context) (result siterecovery.FabricCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.FabricCollectionIterator, err error) + MigrateToAad(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsMigrateToAadFuture, err error) + Purge(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsPurgeFuture, err error) + ReassociateGateway(ctx context.Context, fabricName string, failoverProcessServerRequest siterecovery.FailoverProcessServerRequest) (result siterecovery.ReplicationFabricsReassociateGatewayFuture, err error) + RenewCertificate(ctx context.Context, fabricName string, renewCertificate siterecovery.RenewCertificateInput) (result siterecovery.ReplicationFabricsRenewCertificateFuture, err error) +} + +var _ ReplicationFabricsClientAPI = (*siterecovery.ReplicationFabricsClient)(nil) + +// ReplicationLogicalNetworksClientAPI contains the set of methods on the ReplicationLogicalNetworksClient type. +type ReplicationLogicalNetworksClientAPI interface { + Get(ctx context.Context, fabricName string, logicalNetworkName string) (result siterecovery.LogicalNetwork, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.LogicalNetworkCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.LogicalNetworkCollectionIterator, err error) +} + +var _ ReplicationLogicalNetworksClientAPI = (*siterecovery.ReplicationLogicalNetworksClient)(nil) + +// ReplicationNetworksClientAPI contains the set of methods on the ReplicationNetworksClient type. +type ReplicationNetworksClientAPI interface { + Get(ctx context.Context, fabricName string, networkName string) (result siterecovery.Network, err error) + List(ctx context.Context) (result siterecovery.NetworkCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.NetworkCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.NetworkCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.NetworkCollectionIterator, err error) +} + +var _ ReplicationNetworksClientAPI = (*siterecovery.ReplicationNetworksClient)(nil) + +// ReplicationNetworkMappingsClientAPI contains the set of methods on the ReplicationNetworkMappingsClient type. +type ReplicationNetworkMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, networkName string, networkMappingName string, input siterecovery.CreateNetworkMappingInput) (result siterecovery.ReplicationNetworkMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result siterecovery.ReplicationNetworkMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result siterecovery.NetworkMapping, err error) + List(ctx context.Context) (result siterecovery.NetworkMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.NetworkMappingCollectionIterator, err error) + ListByReplicationNetworks(ctx context.Context, fabricName string, networkName string) (result siterecovery.NetworkMappingCollectionPage, err error) + ListByReplicationNetworksComplete(ctx context.Context, fabricName string, networkName string) (result siterecovery.NetworkMappingCollectionIterator, err error) + Update(ctx context.Context, fabricName string, networkName string, networkMappingName string, input siterecovery.UpdateNetworkMappingInput) (result siterecovery.ReplicationNetworkMappingsUpdateFuture, err error) +} + +var _ ReplicationNetworkMappingsClientAPI = (*siterecovery.ReplicationNetworkMappingsClient)(nil) + +// ReplicationProtectionContainersClientAPI contains the set of methods on the ReplicationProtectionContainersClient type. +type ReplicationProtectionContainersClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, creationInput siterecovery.CreateProtectionContainerInput) (result siterecovery.ReplicationProtectionContainersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectionContainersDeleteFuture, err error) + DiscoverProtectableItem(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest siterecovery.DiscoverProtectableItemRequest) (result siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainer, err error) + List(ctx context.Context) (result siterecovery.ProtectionContainerCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.ProtectionContainerCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.ProtectionContainerCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.ProtectionContainerCollectionIterator, err error) + SwitchProtection(ctx context.Context, fabricName string, protectionContainerName string, switchInput siterecovery.SwitchProtectionInput) (result siterecovery.ReplicationProtectionContainersSwitchProtectionFuture, err error) +} + +var _ ReplicationProtectionContainersClientAPI = (*siterecovery.ReplicationProtectionContainersClient)(nil) + +// ReplicationMigrationItemsClientAPI contains the set of methods on the ReplicationMigrationItemsClient type. +type ReplicationMigrationItemsClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.EnableMigrationInput) (result siterecovery.ReplicationMigrationItemsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (result siterecovery.ReplicationMigrationItemsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationItem, err error) + List(ctx context.Context, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionIterator, err error) + Migrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput siterecovery.MigrateInput) (result siterecovery.ReplicationMigrationItemsMigrateFuture, err error) + Resync(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.ResyncInput) (result siterecovery.ReplicationMigrationItemsResyncFuture, err error) + TestMigrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput siterecovery.TestMigrateInput) (result siterecovery.ReplicationMigrationItemsTestMigrateFuture, err error) + TestMigrateCleanup(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput siterecovery.TestMigrateCleanupInput) (result siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.UpdateMigrationItemInput) (result siterecovery.ReplicationMigrationItemsUpdateFuture, err error) +} + +var _ ReplicationMigrationItemsClientAPI = (*siterecovery.ReplicationMigrationItemsClient)(nil) + +// MigrationRecoveryPointsClientAPI contains the set of methods on the MigrationRecoveryPointsClient type. +type MigrationRecoveryPointsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (result siterecovery.MigrationRecoveryPoint, err error) + ListByReplicationMigrationItems(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationRecoveryPointCollectionPage, err error) + ListByReplicationMigrationItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationRecoveryPointCollectionIterator, err error) +} + +var _ MigrationRecoveryPointsClientAPI = (*siterecovery.MigrationRecoveryPointsClient)(nil) + +// ReplicationProtectableItemsClientAPI contains the set of methods on the ReplicationProtectableItemsClient type. +type ReplicationProtectableItemsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (result siterecovery.ProtectableItem, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result siterecovery.ProtectableItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result siterecovery.ProtectableItemCollectionIterator, err error) +} + +var _ ReplicationProtectableItemsClientAPI = (*siterecovery.ReplicationProtectableItemsClient)(nil) + +// ReplicationProtectedItemsClientAPI contains the set of methods on the ReplicationProtectedItemsClient type. +type ReplicationProtectedItemsClientAPI interface { + AddDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput siterecovery.AddDisksInput) (result siterecovery.ReplicationProtectedItemsAddDisksFuture, err error) + ApplyRecoveryPoint(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput siterecovery.ApplyRecoveryPointInput) (result siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture, err error) + Create(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input siterecovery.EnableProtectionInput) (result siterecovery.ReplicationProtectedItemsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput siterecovery.DisableProtectionInput) (result siterecovery.ReplicationProtectedItemsDeleteFuture, err error) + FailoverCancel(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsFailoverCancelFuture, err error) + FailoverCommit(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsFailoverCommitFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItem, err error) + List(ctx context.Context, skipToken string, filter string) (result siterecovery.ReplicationProtectedItemCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, filter string) (result siterecovery.ReplicationProtectedItemCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectedItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectedItemCollectionIterator, err error) + PlannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput siterecovery.PlannedFailoverInput) (result siterecovery.ReplicationProtectedItemsPlannedFailoverFuture, err error) + Purge(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsPurgeFuture, err error) + RemoveDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput siterecovery.RemoveDisksInput) (result siterecovery.ReplicationProtectedItemsRemoveDisksFuture, err error) + RepairReplication(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsRepairReplicationFuture, err error) + Reprotect(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput siterecovery.ReverseReplicationInput) (result siterecovery.ReplicationProtectedItemsReprotectFuture, err error) + ResolveHealthErrors(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput siterecovery.ResolveHealthInput) (result siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture, err error) + TestFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput siterecovery.TestFailoverInput) (result siterecovery.ReplicationProtectedItemsTestFailoverFuture, err error) + TestFailoverCleanup(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput siterecovery.TestFailoverCleanupInput) (result siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture, err error) + UnplannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput siterecovery.UnplannedFailoverInput) (result siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput siterecovery.UpdateReplicationProtectedItemInput) (result siterecovery.ReplicationProtectedItemsUpdateFuture, err error) + UpdateMobilityService(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest siterecovery.UpdateMobilityServiceRequest) (result siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) +} + +var _ ReplicationProtectedItemsClientAPI = (*siterecovery.ReplicationProtectedItemsClient)(nil) + +// RecoveryPointsClientAPI contains the set of methods on the RecoveryPointsClient type. +type RecoveryPointsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (result siterecovery.RecoveryPoint, err error) + ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.RecoveryPointCollectionPage, err error) + ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.RecoveryPointCollectionIterator, err error) +} + +var _ RecoveryPointsClientAPI = (*siterecovery.RecoveryPointsClient)(nil) + +// TargetComputeSizesClientAPI contains the set of methods on the TargetComputeSizesClient type. +type TargetComputeSizesClientAPI interface { + ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.TargetComputeSizeCollectionPage, err error) + ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.TargetComputeSizeCollectionIterator, err error) +} + +var _ TargetComputeSizesClientAPI = (*siterecovery.TargetComputeSizesClient)(nil) + +// ReplicationProtectionContainerMappingsClientAPI contains the set of methods on the ReplicationProtectionContainerMappingsClient type. +type ReplicationProtectionContainerMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput siterecovery.CreateProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput siterecovery.RemoveProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result siterecovery.ProtectionContainerMapping, err error) + List(ctx context.Context) (result siterecovery.ProtectionContainerMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.ProtectionContainerMappingCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainerMappingCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainerMappingCollectionIterator, err error) + Purge(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result siterecovery.ReplicationProtectionContainerMappingsPurgeFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput siterecovery.UpdateProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsUpdateFuture, err error) +} + +var _ ReplicationProtectionContainerMappingsClientAPI = (*siterecovery.ReplicationProtectionContainerMappingsClient)(nil) + +// ReplicationRecoveryServicesProvidersClientAPI contains the set of methods on the ReplicationRecoveryServicesProvidersClient type. +type ReplicationRecoveryServicesProvidersClientAPI interface { + Create(ctx context.Context, fabricName string, providerName string, addProviderInput siterecovery.AddRecoveryServicesProviderInput) (result siterecovery.ReplicationRecoveryServicesProvidersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture, err error) + Get(ctx context.Context, fabricName string, providerName string) (result siterecovery.RecoveryServicesProvider, err error) + List(ctx context.Context) (result siterecovery.RecoveryServicesProviderCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.RecoveryServicesProviderCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.RecoveryServicesProviderCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.RecoveryServicesProviderCollectionIterator, err error) + Purge(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture, err error) + RefreshProvider(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) +} + +var _ ReplicationRecoveryServicesProvidersClientAPI = (*siterecovery.ReplicationRecoveryServicesProvidersClient)(nil) + +// ReplicationStorageClassificationsClientAPI contains the set of methods on the ReplicationStorageClassificationsClient type. +type ReplicationStorageClassificationsClientAPI interface { + Get(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassification, err error) + List(ctx context.Context) (result siterecovery.StorageClassificationCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.StorageClassificationCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.StorageClassificationCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.StorageClassificationCollectionIterator, err error) +} + +var _ ReplicationStorageClassificationsClientAPI = (*siterecovery.ReplicationStorageClassificationsClient)(nil) + +// ReplicationStorageClassificationMappingsClientAPI contains the set of methods on the ReplicationStorageClassificationMappingsClient type. +type ReplicationStorageClassificationMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput siterecovery.StorageClassificationMappingInput) (result siterecovery.ReplicationStorageClassificationMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result siterecovery.ReplicationStorageClassificationMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result siterecovery.StorageClassificationMapping, err error) + List(ctx context.Context) (result siterecovery.StorageClassificationMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.StorageClassificationMappingCollectionIterator, err error) + ListByReplicationStorageClassifications(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassificationMappingCollectionPage, err error) + ListByReplicationStorageClassificationsComplete(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassificationMappingCollectionIterator, err error) +} + +var _ ReplicationStorageClassificationMappingsClientAPI = (*siterecovery.ReplicationStorageClassificationMappingsClient)(nil) + +// ReplicationvCentersClientAPI contains the set of methods on the ReplicationvCentersClient type. +type ReplicationvCentersClientAPI interface { + Create(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest siterecovery.AddVCenterRequest) (result siterecovery.ReplicationvCentersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, vcenterName string) (result siterecovery.ReplicationvCentersDeleteFuture, err error) + Get(ctx context.Context, fabricName string, vcenterName string) (result siterecovery.VCenter, err error) + List(ctx context.Context) (result siterecovery.VCenterCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.VCenterCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.VCenterCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.VCenterCollectionIterator, err error) + Update(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest siterecovery.UpdateVCenterRequest) (result siterecovery.ReplicationvCentersUpdateFuture, err error) +} + +var _ ReplicationvCentersClientAPI = (*siterecovery.ReplicationvCentersClient)(nil) + +// ReplicationJobsClientAPI contains the set of methods on the ReplicationJobsClient type. +type ReplicationJobsClientAPI interface { + Cancel(ctx context.Context, jobName string) (result siterecovery.ReplicationJobsCancelFuture, err error) + Export(ctx context.Context, jobQueryParameter siterecovery.JobQueryParameter) (result siterecovery.ReplicationJobsExportFuture, err error) + Get(ctx context.Context, jobName string) (result siterecovery.Job, err error) + List(ctx context.Context, filter string) (result siterecovery.JobCollectionPage, err error) + ListComplete(ctx context.Context, filter string) (result siterecovery.JobCollectionIterator, err error) + Restart(ctx context.Context, jobName string) (result siterecovery.ReplicationJobsRestartFuture, err error) + Resume(ctx context.Context, jobName string, resumeJobParams siterecovery.ResumeJobParams) (result siterecovery.ReplicationJobsResumeFuture, err error) +} + +var _ ReplicationJobsClientAPI = (*siterecovery.ReplicationJobsClient)(nil) + +// ReplicationPoliciesClientAPI contains the set of methods on the ReplicationPoliciesClient type. +type ReplicationPoliciesClientAPI interface { + Create(ctx context.Context, policyName string, input siterecovery.CreatePolicyInput) (result siterecovery.ReplicationPoliciesCreateFuture, err error) + Delete(ctx context.Context, policyName string) (result siterecovery.ReplicationPoliciesDeleteFuture, err error) + Get(ctx context.Context, policyName string) (result siterecovery.Policy, err error) + List(ctx context.Context) (result siterecovery.PolicyCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.PolicyCollectionIterator, err error) + Update(ctx context.Context, policyName string, input siterecovery.UpdatePolicyInput) (result siterecovery.ReplicationPoliciesUpdateFuture, err error) +} + +var _ ReplicationPoliciesClientAPI = (*siterecovery.ReplicationPoliciesClient)(nil) + +// ReplicationProtectionIntentsClientAPI contains the set of methods on the ReplicationProtectionIntentsClient type. +type ReplicationProtectionIntentsClientAPI interface { + Create(ctx context.Context, intentObjectName string, input siterecovery.CreateProtectionIntentInput) (result siterecovery.ReplicationProtectionIntent, err error) + Get(ctx context.Context, intentObjectName string) (result siterecovery.ReplicationProtectionIntent, err error) + List(ctx context.Context, skipToken string, takeToken string) (result siterecovery.ReplicationProtectionIntentCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, takeToken string) (result siterecovery.ReplicationProtectionIntentCollectionIterator, err error) +} + +var _ ReplicationProtectionIntentsClientAPI = (*siterecovery.ReplicationProtectionIntentsClient)(nil) + +// ReplicationRecoveryPlansClientAPI contains the set of methods on the ReplicationRecoveryPlansClient type. +type ReplicationRecoveryPlansClientAPI interface { + Create(ctx context.Context, recoveryPlanName string, input siterecovery.CreateRecoveryPlanInput) (result siterecovery.ReplicationRecoveryPlansCreateFuture, err error) + Delete(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansDeleteFuture, err error) + FailoverCancel(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansFailoverCancelFuture, err error) + FailoverCommit(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansFailoverCommitFuture, err error) + Get(ctx context.Context, recoveryPlanName string) (result siterecovery.RecoveryPlan, err error) + List(ctx context.Context) (result siterecovery.RecoveryPlanCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.RecoveryPlanCollectionIterator, err error) + PlannedFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanPlannedFailoverInput) (result siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture, err error) + Reprotect(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansReprotectFuture, err error) + TestFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanTestFailoverInput) (result siterecovery.ReplicationRecoveryPlansTestFailoverFuture, err error) + TestFailoverCleanup(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanTestFailoverCleanupInput) (result siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) + UnplannedFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanUnplannedFailoverInput) (result siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture, err error) + Update(ctx context.Context, recoveryPlanName string, input siterecovery.UpdateRecoveryPlanInput) (result siterecovery.ReplicationRecoveryPlansUpdateFuture, err error) +} + +var _ ReplicationRecoveryPlansClientAPI = (*siterecovery.ReplicationRecoveryPlansClient)(nil) + +// SupportedOperatingSystemsClientAPI contains the set of methods on the SupportedOperatingSystemsClient type. +type SupportedOperatingSystemsClientAPI interface { + Get(ctx context.Context, instanceType string) (result siterecovery.SupportedOperatingSystems, err error) +} + +var _ SupportedOperatingSystemsClientAPI = (*siterecovery.SupportedOperatingSystemsClient)(nil) + +// ReplicationVaultHealthClientAPI contains the set of methods on the ReplicationVaultHealthClient type. +type ReplicationVaultHealthClientAPI interface { + Get(ctx context.Context) (result siterecovery.VaultHealthDetails, err error) + Refresh(ctx context.Context) (result siterecovery.ReplicationVaultHealthRefreshFuture, err error) +} + +var _ ReplicationVaultHealthClientAPI = (*siterecovery.ReplicationVaultHealthClient)(nil) + +// ReplicationVaultSettingClientAPI contains the set of methods on the ReplicationVaultSettingClient type. +type ReplicationVaultSettingClientAPI interface { + Create(ctx context.Context, vaultSettingName string, input siterecovery.VaultSettingCreationInput) (result siterecovery.ReplicationVaultSettingCreateFuture, err error) + Get(ctx context.Context, vaultSettingName string) (result siterecovery.VaultSetting, err error) + List(ctx context.Context) (result siterecovery.VaultSettingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.VaultSettingCollectionIterator, err error) +} + +var _ ReplicationVaultSettingClientAPI = (*siterecovery.ReplicationVaultSettingClient)(nil) diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/supportedoperatingsystems.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/supportedoperatingsystems.go new file mode 100644 index 000000000000..6b1161bb2926 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/supportedoperatingsystems.go @@ -0,0 +1,110 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SupportedOperatingSystemsClient is the client for the SupportedOperatingSystems methods of the Siterecovery service. +type SupportedOperatingSystemsClient struct { + BaseClient +} + +// NewSupportedOperatingSystemsClient creates an instance of the SupportedOperatingSystemsClient client. +func NewSupportedOperatingSystemsClient(subscriptionID string, resourceGroupName string, resourceName string) SupportedOperatingSystemsClient { + return NewSupportedOperatingSystemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewSupportedOperatingSystemsClientWithBaseURI creates an instance of the SupportedOperatingSystemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewSupportedOperatingSystemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) SupportedOperatingSystemsClient { + return SupportedOperatingSystemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get sends the get request. +// Parameters: +// instanceType - the instance type. +func (client SupportedOperatingSystemsClient) Get(ctx context.Context, instanceType string) (result SupportedOperatingSystems, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SupportedOperatingSystemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, instanceType) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SupportedOperatingSystemsClient) GetPreparer(ctx context.Context, instanceType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(instanceType) > 0 { + queryParameters["instanceType"] = autorest.Encode("query", instanceType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationSupportedOperatingSystems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SupportedOperatingSystemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SupportedOperatingSystemsClient) GetResponder(resp *http.Response) (result SupportedOperatingSystems, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/targetcomputesizes.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/targetcomputesizes.go new file mode 100644 index 000000000000..f054e7b07508 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/targetcomputesizes.go @@ -0,0 +1,154 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// TargetComputeSizesClient is the client for the TargetComputeSizes methods of the Siterecovery service. +type TargetComputeSizesClient struct { + BaseClient +} + +// NewTargetComputeSizesClient creates an instance of the TargetComputeSizesClient client. +func NewTargetComputeSizesClient(subscriptionID string, resourceGroupName string, resourceName string) TargetComputeSizesClient { + return NewTargetComputeSizesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewTargetComputeSizesClientWithBaseURI creates an instance of the TargetComputeSizesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewTargetComputeSizesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) TargetComputeSizesClient { + return TargetComputeSizesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// ListByReplicationProtectedItems lists the available target compute sizes for a replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client TargetComputeSizesClient) ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result TargetComputeSizeCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizesClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.tcsc.Response.Response != nil { + sc = result.tcsc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectedItemsNextResults + req, err := client.ListByReplicationProtectedItemsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.tcsc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", resp, "Failure sending request") + return + } + + result.tcsc, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", resp, "Failure responding to request") + return + } + if result.tcsc.hasNextLink() && result.tcsc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectedItemsPreparer prepares the ListByReplicationProtectedItems request. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-10" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/targetComputeSizes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectedItemsSender sends the ListByReplicationProtectedItems request. The method will close the +// http.Response Body if it receives an error. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectedItemsResponder handles the response to the ListByReplicationProtectedItems request. The method always +// closes the http.Response Body. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsResponder(resp *http.Response) (result TargetComputeSizeCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectedItemsNextResults retrieves the next set of results, if any. +func (client TargetComputeSizesClient) listByReplicationProtectedItemsNextResults(ctx context.Context, lastResults TargetComputeSizeCollection) (result TargetComputeSizeCollection, err error) { + req, err := lastResults.targetComputeSizeCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectedItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result TargetComputeSizeCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizesClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectedItems(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + return +} diff --git a/services/recoveryservices/mgmt/2021-02-10/siterecovery/version.go b/services/recoveryservices/mgmt/2021-02-10/siterecovery/version.go new file mode 100644 index 000000000000..3180e1fcf2a4 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-02-10/siterecovery/version.go @@ -0,0 +1,19 @@ +package siterecovery + +import "github.com/Azure/azure-sdk-for-go/version" + +// 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. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " siterecovery/2021-02-10" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/CHANGELOG.md b/services/recoveryservices/mgmt/2021-06-01/siterecovery/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/_meta.json b/services/recoveryservices/mgmt/2021-06-01/siterecovery/_meta.json new file mode 100644 index 000000000000..704a2f981a3e --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "16f5f98c30852b877949ea63418f609233470bf7", + "readme": "/_/azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.md", + "tag": "package-2021-06", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-06 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/client.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/client.go new file mode 100644 index 000000000000..39338bd9da60 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/client.go @@ -0,0 +1,45 @@ +// Package siterecovery implements the Azure ARM Siterecovery service API version 2021-06-01. +// +// +package siterecovery + +// 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. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Siterecovery + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Siterecovery. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string + ResourceGroupName string + ResourceName string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string, resourceGroupName string, resourceName string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + ResourceGroupName: resourceGroupName, + ResourceName: resourceName, + } +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/enums.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/enums.go new file mode 100644 index 000000000000..b7d0714c645c --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/enums.go @@ -0,0 +1,1869 @@ +package siterecovery + +// 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. + +// A2ARecoveryAvailabilityType enumerates the values for a2a recovery availability type. +type A2ARecoveryAvailabilityType string + +const ( + // AvailabilitySet ... + AvailabilitySet A2ARecoveryAvailabilityType = "AvailabilitySet" + // AvailabilityZone ... + AvailabilityZone A2ARecoveryAvailabilityType = "AvailabilityZone" + // Single ... + Single A2ARecoveryAvailabilityType = "Single" +) + +// PossibleA2ARecoveryAvailabilityTypeValues returns an array of possible values for the A2ARecoveryAvailabilityType const type. +func PossibleA2ARecoveryAvailabilityTypeValues() []A2ARecoveryAvailabilityType { + return []A2ARecoveryAvailabilityType{AvailabilitySet, AvailabilityZone, Single} +} + +// A2ARpRecoveryPointType enumerates the values for a2a rp recovery point type. +type A2ARpRecoveryPointType string + +const ( + // Latest ... + Latest A2ARpRecoveryPointType = "Latest" + // LatestApplicationConsistent ... + LatestApplicationConsistent A2ARpRecoveryPointType = "LatestApplicationConsistent" + // LatestCrashConsistent ... + LatestCrashConsistent A2ARpRecoveryPointType = "LatestCrashConsistent" + // LatestProcessed ... + LatestProcessed A2ARpRecoveryPointType = "LatestProcessed" +) + +// PossibleA2ARpRecoveryPointTypeValues returns an array of possible values for the A2ARpRecoveryPointType const type. +func PossibleA2ARpRecoveryPointTypeValues() []A2ARpRecoveryPointType { + return []A2ARpRecoveryPointType{Latest, LatestApplicationConsistent, LatestCrashConsistent, LatestProcessed} +} + +// AgentAutoUpdateStatus enumerates the values for agent auto update status. +type AgentAutoUpdateStatus string + +const ( + // Disabled ... + Disabled AgentAutoUpdateStatus = "Disabled" + // Enabled ... + Enabled AgentAutoUpdateStatus = "Enabled" +) + +// PossibleAgentAutoUpdateStatusValues returns an array of possible values for the AgentAutoUpdateStatus const type. +func PossibleAgentAutoUpdateStatusValues() []AgentAutoUpdateStatus { + return []AgentAutoUpdateStatus{Disabled, Enabled} +} + +// AgentUpgradeBlockedReason enumerates the values for agent upgrade blocked reason. +type AgentUpgradeBlockedReason string + +const ( + // AgentNoHeartbeat ... + AgentNoHeartbeat AgentUpgradeBlockedReason = "AgentNoHeartbeat" + // AlreadyOnLatestVersion ... + AlreadyOnLatestVersion AgentUpgradeBlockedReason = "AlreadyOnLatestVersion" + // DistroIsNotReported ... + DistroIsNotReported AgentUpgradeBlockedReason = "DistroIsNotReported" + // DistroNotSupportedForUpgrade ... + DistroNotSupportedForUpgrade AgentUpgradeBlockedReason = "DistroNotSupportedForUpgrade" + // IncompatibleApplianceVersion ... + IncompatibleApplianceVersion AgentUpgradeBlockedReason = "IncompatibleApplianceVersion" + // InvalidAgentVersion ... + InvalidAgentVersion AgentUpgradeBlockedReason = "InvalidAgentVersion" + // InvalidDriverVersion ... + InvalidDriverVersion AgentUpgradeBlockedReason = "InvalidDriverVersion" + // MissingUpgradePath ... + MissingUpgradePath AgentUpgradeBlockedReason = "MissingUpgradePath" + // NotProtected ... + NotProtected AgentUpgradeBlockedReason = "NotProtected" + // ProcessServerNoHeartbeat ... + ProcessServerNoHeartbeat AgentUpgradeBlockedReason = "ProcessServerNoHeartbeat" + // RcmProxyNoHeartbeat ... + RcmProxyNoHeartbeat AgentUpgradeBlockedReason = "RcmProxyNoHeartbeat" + // RebootRequired ... + RebootRequired AgentUpgradeBlockedReason = "RebootRequired" + // Unknown ... + Unknown AgentUpgradeBlockedReason = "Unknown" + // UnsupportedProtectionScenario ... + UnsupportedProtectionScenario AgentUpgradeBlockedReason = "UnsupportedProtectionScenario" +) + +// PossibleAgentUpgradeBlockedReasonValues returns an array of possible values for the AgentUpgradeBlockedReason const type. +func PossibleAgentUpgradeBlockedReasonValues() []AgentUpgradeBlockedReason { + return []AgentUpgradeBlockedReason{AgentNoHeartbeat, AlreadyOnLatestVersion, DistroIsNotReported, DistroNotSupportedForUpgrade, IncompatibleApplianceVersion, InvalidAgentVersion, InvalidDriverVersion, MissingUpgradePath, NotProtected, ProcessServerNoHeartbeat, RcmProxyNoHeartbeat, RebootRequired, Unknown, UnsupportedProtectionScenario} +} + +// AgentVersionStatus enumerates the values for agent version status. +type AgentVersionStatus string + +const ( + // Deprecated ... + Deprecated AgentVersionStatus = "Deprecated" + // NotSupported ... + NotSupported AgentVersionStatus = "NotSupported" + // SecurityUpdateRequired ... + SecurityUpdateRequired AgentVersionStatus = "SecurityUpdateRequired" + // Supported ... + Supported AgentVersionStatus = "Supported" + // UpdateRequired ... + UpdateRequired AgentVersionStatus = "UpdateRequired" +) + +// PossibleAgentVersionStatusValues returns an array of possible values for the AgentVersionStatus const type. +func PossibleAgentVersionStatusValues() []AgentVersionStatus { + return []AgentVersionStatus{Deprecated, NotSupported, SecurityUpdateRequired, Supported, UpdateRequired} +} + +// AlternateLocationRecoveryOption enumerates the values for alternate location recovery option. +type AlternateLocationRecoveryOption string + +const ( + // CreateVMIfNotFound ... + CreateVMIfNotFound AlternateLocationRecoveryOption = "CreateVmIfNotFound" + // NoAction ... + NoAction AlternateLocationRecoveryOption = "NoAction" +) + +// PossibleAlternateLocationRecoveryOptionValues returns an array of possible values for the AlternateLocationRecoveryOption const type. +func PossibleAlternateLocationRecoveryOptionValues() []AlternateLocationRecoveryOption { + return []AlternateLocationRecoveryOption{CreateVMIfNotFound, NoAction} +} + +// AutoProtectionOfDataDisk enumerates the values for auto protection of data disk. +type AutoProtectionOfDataDisk string + +const ( + // AutoProtectionOfDataDiskDisabled ... + AutoProtectionOfDataDiskDisabled AutoProtectionOfDataDisk = "Disabled" + // AutoProtectionOfDataDiskEnabled ... + AutoProtectionOfDataDiskEnabled AutoProtectionOfDataDisk = "Enabled" +) + +// PossibleAutoProtectionOfDataDiskValues returns an array of possible values for the AutoProtectionOfDataDisk const type. +func PossibleAutoProtectionOfDataDiskValues() []AutoProtectionOfDataDisk { + return []AutoProtectionOfDataDisk{AutoProtectionOfDataDiskDisabled, AutoProtectionOfDataDiskEnabled} +} + +// DataSyncStatus enumerates the values for data sync status. +type DataSyncStatus string + +const ( + // ForDownTime ... + ForDownTime DataSyncStatus = "ForDownTime" + // ForSynchronization ... + ForSynchronization DataSyncStatus = "ForSynchronization" +) + +// PossibleDataSyncStatusValues returns an array of possible values for the DataSyncStatus const type. +func PossibleDataSyncStatusValues() []DataSyncStatus { + return []DataSyncStatus{ForDownTime, ForSynchronization} +} + +// DisableProtectionReason enumerates the values for disable protection reason. +type DisableProtectionReason string + +const ( + // MigrationComplete ... + MigrationComplete DisableProtectionReason = "MigrationComplete" + // NotSpecified ... + NotSpecified DisableProtectionReason = "NotSpecified" +) + +// PossibleDisableProtectionReasonValues returns an array of possible values for the DisableProtectionReason const type. +func PossibleDisableProtectionReasonValues() []DisableProtectionReason { + return []DisableProtectionReason{MigrationComplete, NotSpecified} +} + +// DiskAccountType enumerates the values for disk account type. +type DiskAccountType string + +const ( + // PremiumLRS ... + PremiumLRS DiskAccountType = "Premium_LRS" + // StandardLRS ... + StandardLRS DiskAccountType = "Standard_LRS" + // StandardSSDLRS ... + StandardSSDLRS DiskAccountType = "StandardSSD_LRS" +) + +// PossibleDiskAccountTypeValues returns an array of possible values for the DiskAccountType const type. +func PossibleDiskAccountTypeValues() []DiskAccountType { + return []DiskAccountType{PremiumLRS, StandardLRS, StandardSSDLRS} +} + +// DiskReplicationProgressHealth enumerates the values for disk replication progress health. +type DiskReplicationProgressHealth string + +const ( + // InProgress ... + InProgress DiskReplicationProgressHealth = "InProgress" + // None ... + None DiskReplicationProgressHealth = "None" + // NoProgress ... + NoProgress DiskReplicationProgressHealth = "NoProgress" + // Queued ... + Queued DiskReplicationProgressHealth = "Queued" + // SlowProgress ... + SlowProgress DiskReplicationProgressHealth = "SlowProgress" +) + +// PossibleDiskReplicationProgressHealthValues returns an array of possible values for the DiskReplicationProgressHealth const type. +func PossibleDiskReplicationProgressHealthValues() []DiskReplicationProgressHealth { + return []DiskReplicationProgressHealth{InProgress, None, NoProgress, Queued, SlowProgress} +} + +// EthernetAddressType enumerates the values for ethernet address type. +type EthernetAddressType string + +const ( + // Dynamic ... + Dynamic EthernetAddressType = "Dynamic" + // Static ... + Static EthernetAddressType = "Static" +) + +// PossibleEthernetAddressTypeValues returns an array of possible values for the EthernetAddressType const type. +func PossibleEthernetAddressTypeValues() []EthernetAddressType { + return []EthernetAddressType{Dynamic, Static} +} + +// ExportJobOutputSerializationType enumerates the values for export job output serialization type. +type ExportJobOutputSerializationType string + +const ( + // Excel ... + Excel ExportJobOutputSerializationType = "Excel" + // JSON ... + JSON ExportJobOutputSerializationType = "Json" + // XML ... + XML ExportJobOutputSerializationType = "Xml" +) + +// PossibleExportJobOutputSerializationTypeValues returns an array of possible values for the ExportJobOutputSerializationType const type. +func PossibleExportJobOutputSerializationTypeValues() []ExportJobOutputSerializationType { + return []ExportJobOutputSerializationType{Excel, JSON, XML} +} + +// FailoverDeploymentModel enumerates the values for failover deployment model. +type FailoverDeploymentModel string + +const ( + // Classic ... + Classic FailoverDeploymentModel = "Classic" + // NotApplicable ... + NotApplicable FailoverDeploymentModel = "NotApplicable" + // ResourceManager ... + ResourceManager FailoverDeploymentModel = "ResourceManager" +) + +// PossibleFailoverDeploymentModelValues returns an array of possible values for the FailoverDeploymentModel const type. +func PossibleFailoverDeploymentModelValues() []FailoverDeploymentModel { + return []FailoverDeploymentModel{Classic, NotApplicable, ResourceManager} +} + +// HealthErrorCategory enumerates the values for health error category. +type HealthErrorCategory string + +const ( + // HealthErrorCategoryAgentAutoUpdateArtifactDeleted ... + HealthErrorCategoryAgentAutoUpdateArtifactDeleted HealthErrorCategory = "AgentAutoUpdateArtifactDeleted" + // HealthErrorCategoryAgentAutoUpdateInfra ... + HealthErrorCategoryAgentAutoUpdateInfra HealthErrorCategory = "AgentAutoUpdateInfra" + // HealthErrorCategoryAgentAutoUpdateRunAsAccount ... + HealthErrorCategoryAgentAutoUpdateRunAsAccount HealthErrorCategory = "AgentAutoUpdateRunAsAccount" + // HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired ... + HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired HealthErrorCategory = "AgentAutoUpdateRunAsAccountExpired" + // HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry ... + HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry HealthErrorCategory = "AgentAutoUpdateRunAsAccountExpiry" + // HealthErrorCategoryConfiguration ... + HealthErrorCategoryConfiguration HealthErrorCategory = "Configuration" + // HealthErrorCategoryFabricInfrastructure ... + HealthErrorCategoryFabricInfrastructure HealthErrorCategory = "FabricInfrastructure" + // HealthErrorCategoryNone ... + HealthErrorCategoryNone HealthErrorCategory = "None" + // HealthErrorCategoryReplication ... + HealthErrorCategoryReplication HealthErrorCategory = "Replication" + // HealthErrorCategoryTestFailover ... + HealthErrorCategoryTestFailover HealthErrorCategory = "TestFailover" + // HealthErrorCategoryVersionExpiry ... + HealthErrorCategoryVersionExpiry HealthErrorCategory = "VersionExpiry" +) + +// PossibleHealthErrorCategoryValues returns an array of possible values for the HealthErrorCategory const type. +func PossibleHealthErrorCategoryValues() []HealthErrorCategory { + return []HealthErrorCategory{HealthErrorCategoryAgentAutoUpdateArtifactDeleted, HealthErrorCategoryAgentAutoUpdateInfra, HealthErrorCategoryAgentAutoUpdateRunAsAccount, HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired, HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry, HealthErrorCategoryConfiguration, HealthErrorCategoryFabricInfrastructure, HealthErrorCategoryNone, HealthErrorCategoryReplication, HealthErrorCategoryTestFailover, HealthErrorCategoryVersionExpiry} +} + +// HealthErrorCustomerResolvability enumerates the values for health error customer resolvability. +type HealthErrorCustomerResolvability string + +const ( + // Allowed ... + Allowed HealthErrorCustomerResolvability = "Allowed" + // NotAllowed ... + NotAllowed HealthErrorCustomerResolvability = "NotAllowed" +) + +// PossibleHealthErrorCustomerResolvabilityValues returns an array of possible values for the HealthErrorCustomerResolvability const type. +func PossibleHealthErrorCustomerResolvabilityValues() []HealthErrorCustomerResolvability { + return []HealthErrorCustomerResolvability{Allowed, NotAllowed} +} + +// HyperVReplicaAzureRpRecoveryPointType enumerates the values for hyper v replica azure rp recovery point +// type. +type HyperVReplicaAzureRpRecoveryPointType string + +const ( + // HyperVReplicaAzureRpRecoveryPointTypeLatest ... + HyperVReplicaAzureRpRecoveryPointTypeLatest HyperVReplicaAzureRpRecoveryPointType = "Latest" + // HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent ... + HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent HyperVReplicaAzureRpRecoveryPointType = "LatestApplicationConsistent" + // HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed ... + HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed HyperVReplicaAzureRpRecoveryPointType = "LatestProcessed" +) + +// PossibleHyperVReplicaAzureRpRecoveryPointTypeValues returns an array of possible values for the HyperVReplicaAzureRpRecoveryPointType const type. +func PossibleHyperVReplicaAzureRpRecoveryPointTypeValues() []HyperVReplicaAzureRpRecoveryPointType { + return []HyperVReplicaAzureRpRecoveryPointType{HyperVReplicaAzureRpRecoveryPointTypeLatest, HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent, HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed} +} + +// InMageRcmFailbackRecoveryPointType enumerates the values for in mage rcm failback recovery point type. +type InMageRcmFailbackRecoveryPointType string + +const ( + // ApplicationConsistent ... + ApplicationConsistent InMageRcmFailbackRecoveryPointType = "ApplicationConsistent" + // CrashConsistent ... + CrashConsistent InMageRcmFailbackRecoveryPointType = "CrashConsistent" +) + +// PossibleInMageRcmFailbackRecoveryPointTypeValues returns an array of possible values for the InMageRcmFailbackRecoveryPointType const type. +func PossibleInMageRcmFailbackRecoveryPointTypeValues() []InMageRcmFailbackRecoveryPointType { + return []InMageRcmFailbackRecoveryPointType{ApplicationConsistent, CrashConsistent} +} + +// InMageV2RpRecoveryPointType enumerates the values for in mage v2 rp recovery point type. +type InMageV2RpRecoveryPointType string + +const ( + // InMageV2RpRecoveryPointTypeLatest ... + InMageV2RpRecoveryPointTypeLatest InMageV2RpRecoveryPointType = "Latest" + // InMageV2RpRecoveryPointTypeLatestApplicationConsistent ... + InMageV2RpRecoveryPointTypeLatestApplicationConsistent InMageV2RpRecoveryPointType = "LatestApplicationConsistent" + // InMageV2RpRecoveryPointTypeLatestCrashConsistent ... + InMageV2RpRecoveryPointTypeLatestCrashConsistent InMageV2RpRecoveryPointType = "LatestCrashConsistent" + // InMageV2RpRecoveryPointTypeLatestProcessed ... + InMageV2RpRecoveryPointTypeLatestProcessed InMageV2RpRecoveryPointType = "LatestProcessed" +) + +// PossibleInMageV2RpRecoveryPointTypeValues returns an array of possible values for the InMageV2RpRecoveryPointType const type. +func PossibleInMageV2RpRecoveryPointTypeValues() []InMageV2RpRecoveryPointType { + return []InMageV2RpRecoveryPointType{InMageV2RpRecoveryPointTypeLatest, InMageV2RpRecoveryPointTypeLatestApplicationConsistent, InMageV2RpRecoveryPointTypeLatestCrashConsistent, InMageV2RpRecoveryPointTypeLatestProcessed} +} + +// InstanceType enumerates the values for instance type. +type InstanceType string + +const ( + // InstanceTypeA2A ... + InstanceTypeA2A InstanceType = "A2A" + // InstanceTypeAddDisksProviderSpecificInput ... + InstanceTypeAddDisksProviderSpecificInput InstanceType = "AddDisksProviderSpecificInput" +) + +// PossibleInstanceTypeValues returns an array of possible values for the InstanceType const type. +func PossibleInstanceTypeValues() []InstanceType { + return []InstanceType{InstanceTypeA2A, InstanceTypeAddDisksProviderSpecificInput} +} + +// InstanceTypeBasicApplyRecoveryPointProviderSpecificInput enumerates the values for instance type basic apply +// recovery point provider specific input. +type InstanceTypeBasicApplyRecoveryPointProviderSpecificInput string + +const ( + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "A2A" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "ApplyRecoveryPointProviderSpecificInput" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "InMageRcm" +) + +// PossibleInstanceTypeBasicApplyRecoveryPointProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicApplyRecoveryPointProviderSpecificInput const type. +func PossibleInstanceTypeBasicApplyRecoveryPointProviderSpecificInputValues() []InstanceTypeBasicApplyRecoveryPointProviderSpecificInput { + return []InstanceTypeBasicApplyRecoveryPointProviderSpecificInput{InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm} +} + +// InstanceTypeBasicConfigurationSettings enumerates the values for instance type basic configuration settings. +type InstanceTypeBasicConfigurationSettings string + +const ( + // InstanceTypeConfigurationSettings ... + InstanceTypeConfigurationSettings InstanceTypeBasicConfigurationSettings = "ConfigurationSettings" + // InstanceTypeHyperVVirtualMachine ... + InstanceTypeHyperVVirtualMachine InstanceTypeBasicConfigurationSettings = "HyperVVirtualMachine" + // InstanceTypeReplicationGroupDetails ... + InstanceTypeReplicationGroupDetails InstanceTypeBasicConfigurationSettings = "ReplicationGroupDetails" + // InstanceTypeVmmVirtualMachine ... + InstanceTypeVmmVirtualMachine InstanceTypeBasicConfigurationSettings = "VmmVirtualMachine" + // InstanceTypeVMwareVirtualMachine ... + InstanceTypeVMwareVirtualMachine InstanceTypeBasicConfigurationSettings = "VMwareVirtualMachine" +) + +// PossibleInstanceTypeBasicConfigurationSettingsValues returns an array of possible values for the InstanceTypeBasicConfigurationSettings const type. +func PossibleInstanceTypeBasicConfigurationSettingsValues() []InstanceTypeBasicConfigurationSettings { + return []InstanceTypeBasicConfigurationSettings{InstanceTypeConfigurationSettings, InstanceTypeHyperVVirtualMachine, InstanceTypeReplicationGroupDetails, InstanceTypeVmmVirtualMachine, InstanceTypeVMwareVirtualMachine} +} + +// InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails enumerates the values for instance type basic +// create protection intent provider specific details. +type InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails string + +const ( + // InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails = "A2A" + // InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails ... + InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails = "CreateProtectionIntentProviderSpecificDetails" +) + +// PossibleInstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails const type. +func PossibleInstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsValues() []InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails { + return []InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails{InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails} +} + +// InstanceTypeBasicDisableProtectionProviderSpecificInput enumerates the values for instance type basic +// disable protection provider specific input. +type InstanceTypeBasicDisableProtectionProviderSpecificInput string + +const ( + // InstanceTypeDisableProtectionProviderSpecificInput ... + InstanceTypeDisableProtectionProviderSpecificInput InstanceTypeBasicDisableProtectionProviderSpecificInput = "DisableProtectionProviderSpecificInput" + // InstanceTypeInMage ... + InstanceTypeInMage InstanceTypeBasicDisableProtectionProviderSpecificInput = "InMage" +) + +// PossibleInstanceTypeBasicDisableProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicDisableProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicDisableProtectionProviderSpecificInputValues() []InstanceTypeBasicDisableProtectionProviderSpecificInput { + return []InstanceTypeBasicDisableProtectionProviderSpecificInput{InstanceTypeDisableProtectionProviderSpecificInput, InstanceTypeInMage} +} + +// InstanceTypeBasicEnableMigrationProviderSpecificInput enumerates the values for instance type basic enable +// migration provider specific input. +type InstanceTypeBasicEnableMigrationProviderSpecificInput string + +const ( + // InstanceTypeEnableMigrationProviderSpecificInput ... + InstanceTypeEnableMigrationProviderSpecificInput InstanceTypeBasicEnableMigrationProviderSpecificInput = "EnableMigrationProviderSpecificInput" + // InstanceTypeVMwareCbt ... + InstanceTypeVMwareCbt InstanceTypeBasicEnableMigrationProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicEnableMigrationProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicEnableMigrationProviderSpecificInput const type. +func PossibleInstanceTypeBasicEnableMigrationProviderSpecificInputValues() []InstanceTypeBasicEnableMigrationProviderSpecificInput { + return []InstanceTypeBasicEnableMigrationProviderSpecificInput{InstanceTypeEnableMigrationProviderSpecificInput, InstanceTypeVMwareCbt} +} + +// InstanceTypeBasicEnableProtectionProviderSpecificInput enumerates the values for instance type basic enable +// protection provider specific input. +type InstanceTypeBasicEnableProtectionProviderSpecificInput string + +const ( + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A InstanceTypeBasicEnableProtectionProviderSpecificInput = "A2A" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicEnableProtectionProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput InstanceTypeBasicEnableProtectionProviderSpecificInput = "EnableProtectionProviderSpecificInput" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicEnableProtectionProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMage" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMageRcm" +) + +// PossibleInstanceTypeBasicEnableProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicEnableProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicEnableProtectionProviderSpecificInputValues() []InstanceTypeBasicEnableProtectionProviderSpecificInput { + return []InstanceTypeBasicEnableProtectionProviderSpecificInput{InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm} +} + +// InstanceTypeBasicEventProviderSpecificDetails enumerates the values for instance type basic event provider +// specific details. +type InstanceTypeBasicEventProviderSpecificDetails string + +const ( + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicEventProviderSpecificDetails = "A2A" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails InstanceTypeBasicEventProviderSpecificDetails = "EventProviderSpecificDetails" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplica2012" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplica2012R2" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplicaAzure" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplicaBaseEventDetails" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicEventProviderSpecificDetails = "InMageAzureV2" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicEventProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback InstanceTypeBasicEventProviderSpecificDetails = "InMageRcmFailback" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicEventProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicEventProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicEventProviderSpecificDetails const type. +func PossibleInstanceTypeBasicEventProviderSpecificDetailsValues() []InstanceTypeBasicEventProviderSpecificDetails { + return []InstanceTypeBasicEventProviderSpecificDetails{InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicEventSpecificDetails enumerates the values for instance type basic event specific details. +type InstanceTypeBasicEventSpecificDetails string + +const ( + // InstanceTypeEventSpecificDetails ... + InstanceTypeEventSpecificDetails InstanceTypeBasicEventSpecificDetails = "EventSpecificDetails" + // InstanceTypeJobStatus ... + InstanceTypeJobStatus InstanceTypeBasicEventSpecificDetails = "JobStatus" +) + +// PossibleInstanceTypeBasicEventSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicEventSpecificDetails const type. +func PossibleInstanceTypeBasicEventSpecificDetailsValues() []InstanceTypeBasicEventSpecificDetails { + return []InstanceTypeBasicEventSpecificDetails{InstanceTypeEventSpecificDetails, InstanceTypeJobStatus} +} + +// InstanceTypeBasicFabricSpecificCreateNetworkMappingInput enumerates the values for instance type basic +// fabric specific create network mapping input. +type InstanceTypeBasicFabricSpecificCreateNetworkMappingInput string + +const ( + // InstanceTypeAzureToAzure ... + InstanceTypeAzureToAzure InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "AzureToAzure" + // InstanceTypeFabricSpecificCreateNetworkMappingInput ... + InstanceTypeFabricSpecificCreateNetworkMappingInput InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "FabricSpecificCreateNetworkMappingInput" + // InstanceTypeVmmToAzure ... + InstanceTypeVmmToAzure InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "VmmToAzure" + // InstanceTypeVmmToVmm ... + InstanceTypeVmmToVmm InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "VmmToVmm" +) + +// PossibleInstanceTypeBasicFabricSpecificCreateNetworkMappingInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificCreateNetworkMappingInput const type. +func PossibleInstanceTypeBasicFabricSpecificCreateNetworkMappingInputValues() []InstanceTypeBasicFabricSpecificCreateNetworkMappingInput { + return []InstanceTypeBasicFabricSpecificCreateNetworkMappingInput{InstanceTypeAzureToAzure, InstanceTypeFabricSpecificCreateNetworkMappingInput, InstanceTypeVmmToAzure, InstanceTypeVmmToVmm} +} + +// InstanceTypeBasicFabricSpecificCreationInput enumerates the values for instance type basic fabric specific +// creation input. +type InstanceTypeBasicFabricSpecificCreationInput string + +const ( + // InstanceTypeAzure ... + InstanceTypeAzure InstanceTypeBasicFabricSpecificCreationInput = "Azure" + // InstanceTypeFabricSpecificCreationInput ... + InstanceTypeFabricSpecificCreationInput InstanceTypeBasicFabricSpecificCreationInput = "FabricSpecificCreationInput" + // InstanceTypeInMageRcm ... + InstanceTypeInMageRcm InstanceTypeBasicFabricSpecificCreationInput = "InMageRcm" + // InstanceTypeVMwareV2 ... + InstanceTypeVMwareV2 InstanceTypeBasicFabricSpecificCreationInput = "VMwareV2" +) + +// PossibleInstanceTypeBasicFabricSpecificCreationInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificCreationInput const type. +func PossibleInstanceTypeBasicFabricSpecificCreationInputValues() []InstanceTypeBasicFabricSpecificCreationInput { + return []InstanceTypeBasicFabricSpecificCreationInput{InstanceTypeAzure, InstanceTypeFabricSpecificCreationInput, InstanceTypeInMageRcm, InstanceTypeVMwareV2} +} + +// InstanceTypeBasicFabricSpecificDetails enumerates the values for instance type basic fabric specific +// details. +type InstanceTypeBasicFabricSpecificDetails string + +const ( + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure InstanceTypeBasicFabricSpecificDetails = "Azure" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails InstanceTypeBasicFabricSpecificDetails = "FabricSpecificDetails" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite InstanceTypeBasicFabricSpecificDetails = "HyperVSite" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicFabricSpecificDetails = "InMageRcm" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM InstanceTypeBasicFabricSpecificDetails = "VMM" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware InstanceTypeBasicFabricSpecificDetails = "VMware" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 InstanceTypeBasicFabricSpecificDetails = "VMwareV2" +) + +// PossibleInstanceTypeBasicFabricSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicFabricSpecificDetails const type. +func PossibleInstanceTypeBasicFabricSpecificDetailsValues() []InstanceTypeBasicFabricSpecificDetails { + return []InstanceTypeBasicFabricSpecificDetails{InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure, InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails, InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite, InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2} +} + +// InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput enumerates the values for instance type basic +// fabric specific update network mapping input. +type InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput string + +const ( + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "AzureToAzure" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "FabricSpecificUpdateNetworkMappingInput" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "VmmToAzure" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "VmmToVmm" +) + +// PossibleInstanceTypeBasicFabricSpecificUpdateNetworkMappingInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput const type. +func PossibleInstanceTypeBasicFabricSpecificUpdateNetworkMappingInputValues() []InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput { + return []InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput{InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm} +} + +// InstanceTypeBasicGroupTaskDetails enumerates the values for instance type basic group task details. +type InstanceTypeBasicGroupTaskDetails string + +const ( + // InstanceTypeGroupTaskDetails ... + InstanceTypeGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "GroupTaskDetails" + // InstanceTypeInlineWorkflowTaskDetails ... + InstanceTypeInlineWorkflowTaskDetails InstanceTypeBasicGroupTaskDetails = "InlineWorkflowTaskDetails" + // InstanceTypeRecoveryPlanGroupTaskDetails ... + InstanceTypeRecoveryPlanGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "RecoveryPlanGroupTaskDetails" + // InstanceTypeRecoveryPlanShutdownGroupTaskDetails ... + InstanceTypeRecoveryPlanShutdownGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "RecoveryPlanShutdownGroupTaskDetails" +) + +// PossibleInstanceTypeBasicGroupTaskDetailsValues returns an array of possible values for the InstanceTypeBasicGroupTaskDetails const type. +func PossibleInstanceTypeBasicGroupTaskDetailsValues() []InstanceTypeBasicGroupTaskDetails { + return []InstanceTypeBasicGroupTaskDetails{InstanceTypeGroupTaskDetails, InstanceTypeInlineWorkflowTaskDetails, InstanceTypeRecoveryPlanGroupTaskDetails, InstanceTypeRecoveryPlanShutdownGroupTaskDetails} +} + +// InstanceTypeBasicJobDetails enumerates the values for instance type basic job details. +type InstanceTypeBasicJobDetails string + +const ( + // InstanceTypeAsrJobDetails ... + InstanceTypeAsrJobDetails InstanceTypeBasicJobDetails = "AsrJobDetails" + // InstanceTypeExportJobDetails ... + InstanceTypeExportJobDetails InstanceTypeBasicJobDetails = "ExportJobDetails" + // InstanceTypeFailoverJobDetails ... + InstanceTypeFailoverJobDetails InstanceTypeBasicJobDetails = "FailoverJobDetails" + // InstanceTypeJobDetails ... + InstanceTypeJobDetails InstanceTypeBasicJobDetails = "JobDetails" + // InstanceTypeSwitchProtectionJobDetails ... + InstanceTypeSwitchProtectionJobDetails InstanceTypeBasicJobDetails = "SwitchProtectionJobDetails" + // InstanceTypeTestFailoverJobDetails ... + InstanceTypeTestFailoverJobDetails InstanceTypeBasicJobDetails = "TestFailoverJobDetails" +) + +// PossibleInstanceTypeBasicJobDetailsValues returns an array of possible values for the InstanceTypeBasicJobDetails const type. +func PossibleInstanceTypeBasicJobDetailsValues() []InstanceTypeBasicJobDetails { + return []InstanceTypeBasicJobDetails{InstanceTypeAsrJobDetails, InstanceTypeExportJobDetails, InstanceTypeFailoverJobDetails, InstanceTypeJobDetails, InstanceTypeSwitchProtectionJobDetails, InstanceTypeTestFailoverJobDetails} +} + +// InstanceTypeBasicMigrateProviderSpecificInput enumerates the values for instance type basic migrate provider +// specific input. +type InstanceTypeBasicMigrateProviderSpecificInput string + +const ( + // InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput ... + InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput InstanceTypeBasicMigrateProviderSpecificInput = "MigrateProviderSpecificInput" + // InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicMigrateProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicMigrateProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicMigrateProviderSpecificInput const type. +func PossibleInstanceTypeBasicMigrateProviderSpecificInputValues() []InstanceTypeBasicMigrateProviderSpecificInput { + return []InstanceTypeBasicMigrateProviderSpecificInput{InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput, InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicMigrationProviderSpecificSettings enumerates the values for instance type basic migration +// provider specific settings. +type InstanceTypeBasicMigrationProviderSpecificSettings string + +const ( + // InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings ... + InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings InstanceTypeBasicMigrationProviderSpecificSettings = "MigrationProviderSpecificSettings" + // InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt ... + InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt InstanceTypeBasicMigrationProviderSpecificSettings = "VMwareCbt" +) + +// PossibleInstanceTypeBasicMigrationProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicMigrationProviderSpecificSettings const type. +func PossibleInstanceTypeBasicMigrationProviderSpecificSettingsValues() []InstanceTypeBasicMigrationProviderSpecificSettings { + return []InstanceTypeBasicMigrationProviderSpecificSettings{InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings, InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicNetworkMappingFabricSpecificSettings enumerates the values for instance type basic network +// mapping fabric specific settings. +type InstanceTypeBasicNetworkMappingFabricSpecificSettings string + +const ( + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure InstanceTypeBasicNetworkMappingFabricSpecificSettings = "AzureToAzure" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings InstanceTypeBasicNetworkMappingFabricSpecificSettings = "NetworkMappingFabricSpecificSettings" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure InstanceTypeBasicNetworkMappingFabricSpecificSettings = "VmmToAzure" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm InstanceTypeBasicNetworkMappingFabricSpecificSettings = "VmmToVmm" +) + +// PossibleInstanceTypeBasicNetworkMappingFabricSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicNetworkMappingFabricSpecificSettings const type. +func PossibleInstanceTypeBasicNetworkMappingFabricSpecificSettingsValues() []InstanceTypeBasicNetworkMappingFabricSpecificSettings { + return []InstanceTypeBasicNetworkMappingFabricSpecificSettings{InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm} +} + +// InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput enumerates the values for instance type basic +// planned failover provider specific failover input. +type InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput string + +const ( + // InstanceTypeHyperVReplicaAzure ... + InstanceTypeHyperVReplicaAzure InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "HyperVReplicaAzure" + // InstanceTypeHyperVReplicaAzureFailback ... + InstanceTypeHyperVReplicaAzureFailback InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "HyperVReplicaAzureFailback" + // InstanceTypeInMageRcmFailback ... + InstanceTypeInMageRcmFailback InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "InMageRcmFailback" + // InstanceTypePlannedFailoverProviderSpecificFailoverInput ... + InstanceTypePlannedFailoverProviderSpecificFailoverInput InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "PlannedFailoverProviderSpecificFailoverInput" +) + +// PossibleInstanceTypeBasicPlannedFailoverProviderSpecificFailoverInputValues returns an array of possible values for the InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput const type. +func PossibleInstanceTypeBasicPlannedFailoverProviderSpecificFailoverInputValues() []InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput { + return []InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput{InstanceTypeHyperVReplicaAzure, InstanceTypeHyperVReplicaAzureFailback, InstanceTypeInMageRcmFailback, InstanceTypePlannedFailoverProviderSpecificFailoverInput} +} + +// InstanceTypeBasicPolicyProviderSpecificDetails enumerates the values for instance type basic policy provider +// specific details. +type InstanceTypeBasicPolicyProviderSpecificDetails string + +const ( + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicPolicyProviderSpecificDetails = "A2A" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplica2012" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplica2012R2" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplicaAzure" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplicaBasePolicyDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage InstanceTypeBasicPolicyProviderSpecificDetails = "InMage" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicPolicyProviderSpecificDetails = "InMageAzureV2" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails InstanceTypeBasicPolicyProviderSpecificDetails = "InMageBasePolicyDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicPolicyProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback InstanceTypeBasicPolicyProviderSpecificDetails = "InMageRcmFailback" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails InstanceTypeBasicPolicyProviderSpecificDetails = "PolicyProviderSpecificDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicPolicyProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicPolicyProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicPolicyProviderSpecificDetails const type. +func PossibleInstanceTypeBasicPolicyProviderSpecificDetailsValues() []InstanceTypeBasicPolicyProviderSpecificDetails { + return []InstanceTypeBasicPolicyProviderSpecificDetails{InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicPolicyProviderSpecificInput enumerates the values for instance type basic policy provider +// specific input. +type InstanceTypeBasicPolicyProviderSpecificInput string + +const ( + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A InstanceTypeBasicPolicyProviderSpecificInput = "A2A" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicPolicyProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplica2012" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplica2012R2" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage InstanceTypeBasicPolicyProviderSpecificInput = "InMage" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicPolicyProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicPolicyProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback InstanceTypeBasicPolicyProviderSpecificInput = "InMageRcmFailback" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput InstanceTypeBasicPolicyProviderSpecificInput = "PolicyProviderSpecificInput" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicPolicyProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicPolicyProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicPolicyProviderSpecificInput const type. +func PossibleInstanceTypeBasicPolicyProviderSpecificInputValues() []InstanceTypeBasicPolicyProviderSpecificInput { + return []InstanceTypeBasicPolicyProviderSpecificInput{InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails enumerates the values for instance type +// basic protection container mapping provider specific details. +type InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails string + +const ( + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "A2A" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "ProtectionContainerMappingProviderSpecificDetails" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails const type. +func PossibleInstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsValues() []InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails { + return []InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails{InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicProviderSpecificRecoveryPointDetails enumerates the values for instance type basic provider +// specific recovery point details. +type InstanceTypeBasicProviderSpecificRecoveryPointDetails string + +const ( + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A InstanceTypeBasicProviderSpecificRecoveryPointDetails = "A2A" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicProviderSpecificRecoveryPointDetails = "InMageAzureV2" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm InstanceTypeBasicProviderSpecificRecoveryPointDetails = "InMageRcm" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails InstanceTypeBasicProviderSpecificRecoveryPointDetails = "ProviderSpecificRecoveryPointDetails" +) + +// PossibleInstanceTypeBasicProviderSpecificRecoveryPointDetailsValues returns an array of possible values for the InstanceTypeBasicProviderSpecificRecoveryPointDetails const type. +func PossibleInstanceTypeBasicProviderSpecificRecoveryPointDetailsValues() []InstanceTypeBasicProviderSpecificRecoveryPointDetails { + return []InstanceTypeBasicProviderSpecificRecoveryPointDetails{InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails} +} + +// InstanceTypeBasicRecoveryPlanActionDetails enumerates the values for instance type basic recovery plan +// action details. +type InstanceTypeBasicRecoveryPlanActionDetails string + +const ( + // InstanceTypeAutomationRunbookActionDetails ... + InstanceTypeAutomationRunbookActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "AutomationRunbookActionDetails" + // InstanceTypeManualActionDetails ... + InstanceTypeManualActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "ManualActionDetails" + // InstanceTypeRecoveryPlanActionDetails ... + InstanceTypeRecoveryPlanActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "RecoveryPlanActionDetails" + // InstanceTypeScriptActionDetails ... + InstanceTypeScriptActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "ScriptActionDetails" +) + +// PossibleInstanceTypeBasicRecoveryPlanActionDetailsValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanActionDetails const type. +func PossibleInstanceTypeBasicRecoveryPlanActionDetailsValues() []InstanceTypeBasicRecoveryPlanActionDetails { + return []InstanceTypeBasicRecoveryPlanActionDetails{InstanceTypeAutomationRunbookActionDetails, InstanceTypeManualActionDetails, InstanceTypeRecoveryPlanActionDetails, InstanceTypeScriptActionDetails} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificDetails enumerates the values for instance type basic recovery +// plan provider specific details. +type InstanceTypeBasicRecoveryPlanProviderSpecificDetails string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificDetails = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails ... + InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails InstanceTypeBasicRecoveryPlanProviderSpecificDetails = "RecoveryPlanProviderSpecificDetails" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificDetails const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificDetailsValues() []InstanceTypeBasicRecoveryPlanProviderSpecificDetails { + return []InstanceTypeBasicRecoveryPlanProviderSpecificDetails{InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput enumerates the values for instance type basic +// recovery plan provider specific failover input. +type InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "HyperVReplicaAzure" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "HyperVReplicaAzureFailback" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMage" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageAzureV2" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageRcm" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageRcmFailback" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "RecoveryPlanProviderSpecificFailoverInput" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputValues() []InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput { + return []InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput{InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificInput enumerates the values for instance type basic recovery +// plan provider specific input. +type InstanceTypeBasicRecoveryPlanProviderSpecificInput string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificInput = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput ... + InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput InstanceTypeBasicRecoveryPlanProviderSpecificInput = "RecoveryPlanProviderSpecificInput" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificInput const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificInputValues() []InstanceTypeBasicRecoveryPlanProviderSpecificInput { + return []InstanceTypeBasicRecoveryPlanProviderSpecificInput{InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput} +} + +// InstanceTypeBasicRemoveDisksProviderSpecificInput enumerates the values for instance type basic remove disks +// provider specific input. +type InstanceTypeBasicRemoveDisksProviderSpecificInput string + +const ( + // InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A InstanceTypeBasicRemoveDisksProviderSpecificInput = "A2A" + // InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput ... + InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput InstanceTypeBasicRemoveDisksProviderSpecificInput = "RemoveDisksProviderSpecificInput" +) + +// PossibleInstanceTypeBasicRemoveDisksProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicRemoveDisksProviderSpecificInput const type. +func PossibleInstanceTypeBasicRemoveDisksProviderSpecificInputValues() []InstanceTypeBasicRemoveDisksProviderSpecificInput { + return []InstanceTypeBasicRemoveDisksProviderSpecificInput{InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput} +} + +// InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings enumerates the values for instance type +// basic replication protection intent provider specific settings. +type InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings string + +const ( + // InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A ... + InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings = "A2A" + // InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings ... + InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings = "ReplicationProtectionIntentProviderSpecificSettings" +) + +// PossibleInstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings const type. +func PossibleInstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsValues() []InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings { + return []InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings{InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A, InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings} +} + +// InstanceTypeBasicReplicationProviderSpecificContainerCreationInput enumerates the values for instance type +// basic replication provider specific container creation input. +type InstanceTypeBasicReplicationProviderSpecificContainerCreationInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "A2ACrossClusterMigration" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "ReplicationProviderSpecificContainerCreationInput" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificContainerCreationInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificContainerCreationInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificContainerCreationInputValues() []InstanceTypeBasicReplicationProviderSpecificContainerCreationInput { + return []InstanceTypeBasicReplicationProviderSpecificContainerCreationInput{InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReplicationProviderSpecificContainerMappingInput enumerates the values for instance type +// basic replication provider specific container mapping input. +type InstanceTypeBasicReplicationProviderSpecificContainerMappingInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "ReplicationProviderSpecificContainerMappingInput" + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificContainerMappingInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificContainerMappingInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificContainerMappingInputValues() []InstanceTypeBasicReplicationProviderSpecificContainerMappingInput { + return []InstanceTypeBasicReplicationProviderSpecificContainerMappingInput{InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput, InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReplicationProviderSpecificSettings enumerates the values for instance type basic +// replication provider specific settings. +type InstanceTypeBasicReplicationProviderSpecificSettings string + +const ( + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificSettings = "A2A" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration InstanceTypeBasicReplicationProviderSpecificSettings = "A2ACrossClusterMigration" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplica2012" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplica2012R2" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplicaAzure" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplicaBaseReplicationDetails" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage InstanceTypeBasicReplicationProviderSpecificSettings = "InMage" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 InstanceTypeBasicReplicationProviderSpecificSettings = "InMageAzureV2" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm InstanceTypeBasicReplicationProviderSpecificSettings = "InMageRcm" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback InstanceTypeBasicReplicationProviderSpecificSettings = "InMageRcmFailback" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings InstanceTypeBasicReplicationProviderSpecificSettings = "ReplicationProviderSpecificSettings" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificSettings const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificSettingsValues() []InstanceTypeBasicReplicationProviderSpecificSettings { + return []InstanceTypeBasicReplicationProviderSpecificSettings{InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings} +} + +// InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput enumerates the values for instance +// type basic replication provider specific update container mapping input. +type InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "InMageRcm" + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "ReplicationProviderSpecificUpdateContainerMappingInput" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputValues() []InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput { + return []InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput{InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm, InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput} +} + +// InstanceTypeBasicResyncProviderSpecificInput enumerates the values for instance type basic resync provider +// specific input. +type InstanceTypeBasicResyncProviderSpecificInput string + +const ( + // InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput ... + InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput InstanceTypeBasicResyncProviderSpecificInput = "ResyncProviderSpecificInput" + // InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicResyncProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicResyncProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicResyncProviderSpecificInput const type. +func PossibleInstanceTypeBasicResyncProviderSpecificInputValues() []InstanceTypeBasicResyncProviderSpecificInput { + return []InstanceTypeBasicResyncProviderSpecificInput{InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput, InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReverseReplicationProviderSpecificInput enumerates the values for instance type basic +// reverse replication provider specific input. +type InstanceTypeBasicReverseReplicationProviderSpecificInput string + +const ( + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A InstanceTypeBasicReverseReplicationProviderSpecificInput = "A2A" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicReverseReplicationProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMage" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageRcmFailback" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput InstanceTypeBasicReverseReplicationProviderSpecificInput = "ReverseReplicationProviderSpecificInput" +) + +// PossibleInstanceTypeBasicReverseReplicationProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicReverseReplicationProviderSpecificInput const type. +func PossibleInstanceTypeBasicReverseReplicationProviderSpecificInputValues() []InstanceTypeBasicReverseReplicationProviderSpecificInput { + return []InstanceTypeBasicReverseReplicationProviderSpecificInput{InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput} +} + +// InstanceTypeBasicSwitchProtectionProviderSpecificInput enumerates the values for instance type basic switch +// protection provider specific input. +type InstanceTypeBasicSwitchProtectionProviderSpecificInput string + +const ( + // InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A InstanceTypeBasicSwitchProtectionProviderSpecificInput = "A2A" + // InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput ... + InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput InstanceTypeBasicSwitchProtectionProviderSpecificInput = "SwitchProtectionProviderSpecificInput" +) + +// PossibleInstanceTypeBasicSwitchProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicSwitchProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicSwitchProtectionProviderSpecificInputValues() []InstanceTypeBasicSwitchProtectionProviderSpecificInput { + return []InstanceTypeBasicSwitchProtectionProviderSpecificInput{InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput} +} + +// InstanceTypeBasicTaskTypeDetails enumerates the values for instance type basic task type details. +type InstanceTypeBasicTaskTypeDetails string + +const ( + // InstanceTypeAutomationRunbookTaskDetails ... + InstanceTypeAutomationRunbookTaskDetails InstanceTypeBasicTaskTypeDetails = "AutomationRunbookTaskDetails" + // InstanceTypeConsistencyCheckTaskDetails ... + InstanceTypeConsistencyCheckTaskDetails InstanceTypeBasicTaskTypeDetails = "ConsistencyCheckTaskDetails" + // InstanceTypeFabricReplicationGroupTaskDetails ... + InstanceTypeFabricReplicationGroupTaskDetails InstanceTypeBasicTaskTypeDetails = "FabricReplicationGroupTaskDetails" + // InstanceTypeJobTaskDetails ... + InstanceTypeJobTaskDetails InstanceTypeBasicTaskTypeDetails = "JobTaskDetails" + // InstanceTypeManualActionTaskDetails ... + InstanceTypeManualActionTaskDetails InstanceTypeBasicTaskTypeDetails = "ManualActionTaskDetails" + // InstanceTypeScriptActionTaskDetails ... + InstanceTypeScriptActionTaskDetails InstanceTypeBasicTaskTypeDetails = "ScriptActionTaskDetails" + // InstanceTypeTaskTypeDetails ... + InstanceTypeTaskTypeDetails InstanceTypeBasicTaskTypeDetails = "TaskTypeDetails" + // InstanceTypeVirtualMachineTaskDetails ... + InstanceTypeVirtualMachineTaskDetails InstanceTypeBasicTaskTypeDetails = "VirtualMachineTaskDetails" + // InstanceTypeVMNicUpdatesTaskDetails ... + InstanceTypeVMNicUpdatesTaskDetails InstanceTypeBasicTaskTypeDetails = "VmNicUpdatesTaskDetails" +) + +// PossibleInstanceTypeBasicTaskTypeDetailsValues returns an array of possible values for the InstanceTypeBasicTaskTypeDetails const type. +func PossibleInstanceTypeBasicTaskTypeDetailsValues() []InstanceTypeBasicTaskTypeDetails { + return []InstanceTypeBasicTaskTypeDetails{InstanceTypeAutomationRunbookTaskDetails, InstanceTypeConsistencyCheckTaskDetails, InstanceTypeFabricReplicationGroupTaskDetails, InstanceTypeJobTaskDetails, InstanceTypeManualActionTaskDetails, InstanceTypeScriptActionTaskDetails, InstanceTypeTaskTypeDetails, InstanceTypeVirtualMachineTaskDetails, InstanceTypeVMNicUpdatesTaskDetails} +} + +// InstanceTypeBasicTestFailoverProviderSpecificInput enumerates the values for instance type basic test +// failover provider specific input. +type InstanceTypeBasicTestFailoverProviderSpecificInput string + +const ( + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A InstanceTypeBasicTestFailoverProviderSpecificInput = "A2A" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicTestFailoverProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage InstanceTypeBasicTestFailoverProviderSpecificInput = "InMage" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicTestFailoverProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicTestFailoverProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput InstanceTypeBasicTestFailoverProviderSpecificInput = "TestFailoverProviderSpecificInput" +) + +// PossibleInstanceTypeBasicTestFailoverProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicTestFailoverProviderSpecificInput const type. +func PossibleInstanceTypeBasicTestFailoverProviderSpecificInputValues() []InstanceTypeBasicTestFailoverProviderSpecificInput { + return []InstanceTypeBasicTestFailoverProviderSpecificInput{InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput} +} + +// InstanceTypeBasicTestMigrateProviderSpecificInput enumerates the values for instance type basic test migrate +// provider specific input. +type InstanceTypeBasicTestMigrateProviderSpecificInput string + +const ( + // InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput ... + InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput InstanceTypeBasicTestMigrateProviderSpecificInput = "TestMigrateProviderSpecificInput" + // InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicTestMigrateProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicTestMigrateProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicTestMigrateProviderSpecificInput const type. +func PossibleInstanceTypeBasicTestMigrateProviderSpecificInputValues() []InstanceTypeBasicTestMigrateProviderSpecificInput { + return []InstanceTypeBasicTestMigrateProviderSpecificInput{InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput, InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicUnplannedFailoverProviderSpecificInput enumerates the values for instance type basic +// unplanned failover provider specific input. +type InstanceTypeBasicUnplannedFailoverProviderSpecificInput string + +const ( + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "A2A" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMage" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "UnplannedFailoverProviderSpecificInput" +) + +// PossibleInstanceTypeBasicUnplannedFailoverProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUnplannedFailoverProviderSpecificInput const type. +func PossibleInstanceTypeBasicUnplannedFailoverProviderSpecificInputValues() []InstanceTypeBasicUnplannedFailoverProviderSpecificInput { + return []InstanceTypeBasicUnplannedFailoverProviderSpecificInput{InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput} +} + +// InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput enumerates the values for +// instance type basic update appliance for replication protected item provider specific input. +type InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput string + +const ( + // InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput ... + InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput = "UpdateApplianceForReplicationProtectedItemProviderSpecificInput" +) + +// PossibleInstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput const type. +func PossibleInstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputValues() []InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput { + return []InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput{InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput} +} + +// InstanceTypeBasicUpdateMigrationItemProviderSpecificInput enumerates the values for instance type basic +// update migration item provider specific input. +type InstanceTypeBasicUpdateMigrationItemProviderSpecificInput string + +const ( + // InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput ... + InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput InstanceTypeBasicUpdateMigrationItemProviderSpecificInput = "UpdateMigrationItemProviderSpecificInput" + // InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicUpdateMigrationItemProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicUpdateMigrationItemProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUpdateMigrationItemProviderSpecificInput const type. +func PossibleInstanceTypeBasicUpdateMigrationItemProviderSpecificInputValues() []InstanceTypeBasicUpdateMigrationItemProviderSpecificInput { + return []InstanceTypeBasicUpdateMigrationItemProviderSpecificInput{InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput, InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicUpdateReplicationProtectedItemProviderInput enumerates the values for instance type basic +// update replication protected item provider input. +type InstanceTypeBasicUpdateReplicationProtectedItemProviderInput string + +const ( + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "A2A" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "HyperVReplicaAzure" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "InMageAzureV2" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "InMageRcm" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "UpdateReplicationProtectedItemProviderInput" +) + +// PossibleInstanceTypeBasicUpdateReplicationProtectedItemProviderInputValues returns an array of possible values for the InstanceTypeBasicUpdateReplicationProtectedItemProviderInput const type. +func PossibleInstanceTypeBasicUpdateReplicationProtectedItemProviderInputValues() []InstanceTypeBasicUpdateReplicationProtectedItemProviderInput { + return []InstanceTypeBasicUpdateReplicationProtectedItemProviderInput{InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput} +} + +// LicenseType enumerates the values for license type. +type LicenseType string + +const ( + // LicenseTypeNoLicenseType ... + LicenseTypeNoLicenseType LicenseType = "NoLicenseType" + // LicenseTypeNotSpecified ... + LicenseTypeNotSpecified LicenseType = "NotSpecified" + // LicenseTypeWindowsServer ... + LicenseTypeWindowsServer LicenseType = "WindowsServer" +) + +// PossibleLicenseTypeValues returns an array of possible values for the LicenseType const type. +func PossibleLicenseTypeValues() []LicenseType { + return []LicenseType{LicenseTypeNoLicenseType, LicenseTypeNotSpecified, LicenseTypeWindowsServer} +} + +// MigrationItemOperation enumerates the values for migration item operation. +type MigrationItemOperation string + +const ( + // DisableMigration ... + DisableMigration MigrationItemOperation = "DisableMigration" + // Migrate ... + Migrate MigrationItemOperation = "Migrate" + // StartResync ... + StartResync MigrationItemOperation = "StartResync" + // TestMigrate ... + TestMigrate MigrationItemOperation = "TestMigrate" + // TestMigrateCleanup ... + TestMigrateCleanup MigrationItemOperation = "TestMigrateCleanup" +) + +// PossibleMigrationItemOperationValues returns an array of possible values for the MigrationItemOperation const type. +func PossibleMigrationItemOperationValues() []MigrationItemOperation { + return []MigrationItemOperation{DisableMigration, Migrate, StartResync, TestMigrate, TestMigrateCleanup} +} + +// MigrationRecoveryPointType enumerates the values for migration recovery point type. +type MigrationRecoveryPointType string + +const ( + // MigrationRecoveryPointTypeApplicationConsistent ... + MigrationRecoveryPointTypeApplicationConsistent MigrationRecoveryPointType = "ApplicationConsistent" + // MigrationRecoveryPointTypeCrashConsistent ... + MigrationRecoveryPointTypeCrashConsistent MigrationRecoveryPointType = "CrashConsistent" + // MigrationRecoveryPointTypeNotSpecified ... + MigrationRecoveryPointTypeNotSpecified MigrationRecoveryPointType = "NotSpecified" +) + +// PossibleMigrationRecoveryPointTypeValues returns an array of possible values for the MigrationRecoveryPointType const type. +func PossibleMigrationRecoveryPointTypeValues() []MigrationRecoveryPointType { + return []MigrationRecoveryPointType{MigrationRecoveryPointTypeApplicationConsistent, MigrationRecoveryPointTypeCrashConsistent, MigrationRecoveryPointTypeNotSpecified} +} + +// MigrationState enumerates the values for migration state. +type MigrationState string + +const ( + // MigrationStateDisableMigrationFailed ... + MigrationStateDisableMigrationFailed MigrationState = "DisableMigrationFailed" + // MigrationStateDisableMigrationInProgress ... + MigrationStateDisableMigrationInProgress MigrationState = "DisableMigrationInProgress" + // MigrationStateEnableMigrationFailed ... + MigrationStateEnableMigrationFailed MigrationState = "EnableMigrationFailed" + // MigrationStateEnableMigrationInProgress ... + MigrationStateEnableMigrationInProgress MigrationState = "EnableMigrationInProgress" + // MigrationStateInitialSeedingFailed ... + MigrationStateInitialSeedingFailed MigrationState = "InitialSeedingFailed" + // MigrationStateInitialSeedingInProgress ... + MigrationStateInitialSeedingInProgress MigrationState = "InitialSeedingInProgress" + // MigrationStateMigrationFailed ... + MigrationStateMigrationFailed MigrationState = "MigrationFailed" + // MigrationStateMigrationInProgress ... + MigrationStateMigrationInProgress MigrationState = "MigrationInProgress" + // MigrationStateMigrationSucceeded ... + MigrationStateMigrationSucceeded MigrationState = "MigrationSucceeded" + // MigrationStateNone ... + MigrationStateNone MigrationState = "None" + // MigrationStateReplicating ... + MigrationStateReplicating MigrationState = "Replicating" +) + +// PossibleMigrationStateValues returns an array of possible values for the MigrationState const type. +func PossibleMigrationStateValues() []MigrationState { + return []MigrationState{MigrationStateDisableMigrationFailed, MigrationStateDisableMigrationInProgress, MigrationStateEnableMigrationFailed, MigrationStateEnableMigrationInProgress, MigrationStateInitialSeedingFailed, MigrationStateInitialSeedingInProgress, MigrationStateMigrationFailed, MigrationStateMigrationInProgress, MigrationStateMigrationSucceeded, MigrationStateNone, MigrationStateReplicating} +} + +// MobilityAgentUpgradeState enumerates the values for mobility agent upgrade state. +type MobilityAgentUpgradeState string + +const ( + // MobilityAgentUpgradeStateCommit ... + MobilityAgentUpgradeStateCommit MobilityAgentUpgradeState = "Commit" + // MobilityAgentUpgradeStateCompleted ... + MobilityAgentUpgradeStateCompleted MobilityAgentUpgradeState = "Completed" + // MobilityAgentUpgradeStateNone ... + MobilityAgentUpgradeStateNone MobilityAgentUpgradeState = "None" + // MobilityAgentUpgradeStateStarted ... + MobilityAgentUpgradeStateStarted MobilityAgentUpgradeState = "Started" +) + +// PossibleMobilityAgentUpgradeStateValues returns an array of possible values for the MobilityAgentUpgradeState const type. +func PossibleMobilityAgentUpgradeStateValues() []MobilityAgentUpgradeState { + return []MobilityAgentUpgradeState{MobilityAgentUpgradeStateCommit, MobilityAgentUpgradeStateCompleted, MobilityAgentUpgradeStateNone, MobilityAgentUpgradeStateStarted} +} + +// MultiVMGroupCreateOption enumerates the values for multi vm group create option. +type MultiVMGroupCreateOption string + +const ( + // AutoCreated ... + AutoCreated MultiVMGroupCreateOption = "AutoCreated" + // UserSpecified ... + UserSpecified MultiVMGroupCreateOption = "UserSpecified" +) + +// PossibleMultiVMGroupCreateOptionValues returns an array of possible values for the MultiVMGroupCreateOption const type. +func PossibleMultiVMGroupCreateOptionValues() []MultiVMGroupCreateOption { + return []MultiVMGroupCreateOption{AutoCreated, UserSpecified} +} + +// MultiVMSyncPointOption enumerates the values for multi vm sync point option. +type MultiVMSyncPointOption string + +const ( + // UseMultiVMSyncRecoveryPoint ... + UseMultiVMSyncRecoveryPoint MultiVMSyncPointOption = "UseMultiVmSyncRecoveryPoint" + // UsePerVMRecoveryPoint ... + UsePerVMRecoveryPoint MultiVMSyncPointOption = "UsePerVmRecoveryPoint" +) + +// PossibleMultiVMSyncPointOptionValues returns an array of possible values for the MultiVMSyncPointOption const type. +func PossibleMultiVMSyncPointOptionValues() []MultiVMSyncPointOption { + return []MultiVMSyncPointOption{UseMultiVMSyncRecoveryPoint, UsePerVMRecoveryPoint} +} + +// PlannedFailoverStatus enumerates the values for planned failover status. +type PlannedFailoverStatus string + +const ( + // PlannedFailoverStatusCancelled ... + PlannedFailoverStatusCancelled PlannedFailoverStatus = "Cancelled" + // PlannedFailoverStatusFailed ... + PlannedFailoverStatusFailed PlannedFailoverStatus = "Failed" + // PlannedFailoverStatusSucceeded ... + PlannedFailoverStatusSucceeded PlannedFailoverStatus = "Succeeded" + // PlannedFailoverStatusUnknown ... + PlannedFailoverStatusUnknown PlannedFailoverStatus = "Unknown" +) + +// PossiblePlannedFailoverStatusValues returns an array of possible values for the PlannedFailoverStatus const type. +func PossiblePlannedFailoverStatusValues() []PlannedFailoverStatus { + return []PlannedFailoverStatus{PlannedFailoverStatusCancelled, PlannedFailoverStatusFailed, PlannedFailoverStatusSucceeded, PlannedFailoverStatusUnknown} +} + +// PossibleOperationsDirections enumerates the values for possible operations directions. +type PossibleOperationsDirections string + +const ( + // PrimaryToRecovery ... + PrimaryToRecovery PossibleOperationsDirections = "PrimaryToRecovery" + // RecoveryToPrimary ... + RecoveryToPrimary PossibleOperationsDirections = "RecoveryToPrimary" +) + +// PossiblePossibleOperationsDirectionsValues returns an array of possible values for the PossibleOperationsDirections const type. +func PossiblePossibleOperationsDirectionsValues() []PossibleOperationsDirections { + return []PossibleOperationsDirections{PrimaryToRecovery, RecoveryToPrimary} +} + +// PresenceStatus enumerates the values for presence status. +type PresenceStatus string + +const ( + // PresenceStatusNotPresent ... + PresenceStatusNotPresent PresenceStatus = "NotPresent" + // PresenceStatusPresent ... + PresenceStatusPresent PresenceStatus = "Present" + // PresenceStatusUnknown ... + PresenceStatusUnknown PresenceStatus = "Unknown" +) + +// PossiblePresenceStatusValues returns an array of possible values for the PresenceStatus const type. +func PossiblePresenceStatusValues() []PresenceStatus { + return []PresenceStatus{PresenceStatusNotPresent, PresenceStatusPresent, PresenceStatusUnknown} +} + +// ProtectionHealth enumerates the values for protection health. +type ProtectionHealth string + +const ( + // ProtectionHealthCritical ... + ProtectionHealthCritical ProtectionHealth = "Critical" + // ProtectionHealthNone ... + ProtectionHealthNone ProtectionHealth = "None" + // ProtectionHealthNormal ... + ProtectionHealthNormal ProtectionHealth = "Normal" + // ProtectionHealthWarning ... + ProtectionHealthWarning ProtectionHealth = "Warning" +) + +// PossibleProtectionHealthValues returns an array of possible values for the ProtectionHealth const type. +func PossibleProtectionHealthValues() []ProtectionHealth { + return []ProtectionHealth{ProtectionHealthCritical, ProtectionHealthNone, ProtectionHealthNormal, ProtectionHealthWarning} +} + +// RcmComponentStatus enumerates the values for rcm component status. +type RcmComponentStatus string + +const ( + // RcmComponentStatusCritical ... + RcmComponentStatusCritical RcmComponentStatus = "Critical" + // RcmComponentStatusHealthy ... + RcmComponentStatusHealthy RcmComponentStatus = "Healthy" + // RcmComponentStatusUnknown ... + RcmComponentStatusUnknown RcmComponentStatus = "Unknown" + // RcmComponentStatusWarning ... + RcmComponentStatusWarning RcmComponentStatus = "Warning" +) + +// PossibleRcmComponentStatusValues returns an array of possible values for the RcmComponentStatus const type. +func PossibleRcmComponentStatusValues() []RcmComponentStatus { + return []RcmComponentStatus{RcmComponentStatusCritical, RcmComponentStatusHealthy, RcmComponentStatusUnknown, RcmComponentStatusWarning} +} + +// RecoveryPlanActionLocation enumerates the values for recovery plan action location. +type RecoveryPlanActionLocation string + +const ( + // Primary ... + Primary RecoveryPlanActionLocation = "Primary" + // Recovery ... + Recovery RecoveryPlanActionLocation = "Recovery" +) + +// PossibleRecoveryPlanActionLocationValues returns an array of possible values for the RecoveryPlanActionLocation const type. +func PossibleRecoveryPlanActionLocationValues() []RecoveryPlanActionLocation { + return []RecoveryPlanActionLocation{Primary, Recovery} +} + +// RecoveryPlanGroupType enumerates the values for recovery plan group type. +type RecoveryPlanGroupType string + +const ( + // Boot ... + Boot RecoveryPlanGroupType = "Boot" + // Failover ... + Failover RecoveryPlanGroupType = "Failover" + // Shutdown ... + Shutdown RecoveryPlanGroupType = "Shutdown" +) + +// PossibleRecoveryPlanGroupTypeValues returns an array of possible values for the RecoveryPlanGroupType const type. +func PossibleRecoveryPlanGroupTypeValues() []RecoveryPlanGroupType { + return []RecoveryPlanGroupType{Boot, Failover, Shutdown} +} + +// RecoveryPlanPointType enumerates the values for recovery plan point type. +type RecoveryPlanPointType string + +const ( + // RecoveryPlanPointTypeLatest ... + RecoveryPlanPointTypeLatest RecoveryPlanPointType = "Latest" + // RecoveryPlanPointTypeLatestApplicationConsistent ... + RecoveryPlanPointTypeLatestApplicationConsistent RecoveryPlanPointType = "LatestApplicationConsistent" + // RecoveryPlanPointTypeLatestCrashConsistent ... + RecoveryPlanPointTypeLatestCrashConsistent RecoveryPlanPointType = "LatestCrashConsistent" + // RecoveryPlanPointTypeLatestProcessed ... + RecoveryPlanPointTypeLatestProcessed RecoveryPlanPointType = "LatestProcessed" +) + +// PossibleRecoveryPlanPointTypeValues returns an array of possible values for the RecoveryPlanPointType const type. +func PossibleRecoveryPlanPointTypeValues() []RecoveryPlanPointType { + return []RecoveryPlanPointType{RecoveryPlanPointTypeLatest, RecoveryPlanPointTypeLatestApplicationConsistent, RecoveryPlanPointTypeLatestCrashConsistent, RecoveryPlanPointTypeLatestProcessed} +} + +// RecoveryPointSyncType enumerates the values for recovery point sync type. +type RecoveryPointSyncType string + +const ( + // MultiVMSyncRecoveryPoint ... + MultiVMSyncRecoveryPoint RecoveryPointSyncType = "MultiVmSyncRecoveryPoint" + // PerVMRecoveryPoint ... + PerVMRecoveryPoint RecoveryPointSyncType = "PerVmRecoveryPoint" +) + +// PossibleRecoveryPointSyncTypeValues returns an array of possible values for the RecoveryPointSyncType const type. +func PossibleRecoveryPointSyncTypeValues() []RecoveryPointSyncType { + return []RecoveryPointSyncType{MultiVMSyncRecoveryPoint, PerVMRecoveryPoint} +} + +// RecoveryPointType enumerates the values for recovery point type. +type RecoveryPointType string + +const ( + // Custom ... + Custom RecoveryPointType = "Custom" + // LatestTag ... + LatestTag RecoveryPointType = "LatestTag" + // LatestTime ... + LatestTime RecoveryPointType = "LatestTime" +) + +// PossibleRecoveryPointTypeValues returns an array of possible values for the RecoveryPointType const type. +func PossibleRecoveryPointTypeValues() []RecoveryPointType { + return []RecoveryPointType{Custom, LatestTag, LatestTime} +} + +// ReplicationProtectedItemOperation enumerates the values for replication protected item operation. +type ReplicationProtectedItemOperation string + +const ( + // CancelFailover ... + CancelFailover ReplicationProtectedItemOperation = "CancelFailover" + // ChangePit ... + ChangePit ReplicationProtectedItemOperation = "ChangePit" + // Commit ... + Commit ReplicationProtectedItemOperation = "Commit" + // CompleteMigration ... + CompleteMigration ReplicationProtectedItemOperation = "CompleteMigration" + // DisableProtection ... + DisableProtection ReplicationProtectedItemOperation = "DisableProtection" + // Failback ... + Failback ReplicationProtectedItemOperation = "Failback" + // FinalizeFailback ... + FinalizeFailback ReplicationProtectedItemOperation = "FinalizeFailback" + // PlannedFailover ... + PlannedFailover ReplicationProtectedItemOperation = "PlannedFailover" + // RepairReplication ... + RepairReplication ReplicationProtectedItemOperation = "RepairReplication" + // ReverseReplicate ... + ReverseReplicate ReplicationProtectedItemOperation = "ReverseReplicate" + // SwitchProtection ... + SwitchProtection ReplicationProtectedItemOperation = "SwitchProtection" + // TestFailover ... + TestFailover ReplicationProtectedItemOperation = "TestFailover" + // TestFailoverCleanup ... + TestFailoverCleanup ReplicationProtectedItemOperation = "TestFailoverCleanup" + // UnplannedFailover ... + UnplannedFailover ReplicationProtectedItemOperation = "UnplannedFailover" +) + +// PossibleReplicationProtectedItemOperationValues returns an array of possible values for the ReplicationProtectedItemOperation const type. +func PossibleReplicationProtectedItemOperationValues() []ReplicationProtectedItemOperation { + return []ReplicationProtectedItemOperation{CancelFailover, ChangePit, Commit, CompleteMigration, DisableProtection, Failback, FinalizeFailback, PlannedFailover, RepairReplication, ReverseReplicate, SwitchProtection, TestFailover, TestFailoverCleanup, UnplannedFailover} +} + +// ResourceType enumerates the values for resource type. +type ResourceType string + +const ( + // ResourceTypeExisting ... + ResourceTypeExisting ResourceType = "Existing" + // ResourceTypeNew ... + ResourceTypeNew ResourceType = "New" + // ResourceTypeProtectionProfileCustomDetails ... + ResourceTypeProtectionProfileCustomDetails ResourceType = "ProtectionProfileCustomDetails" +) + +// PossibleResourceTypeValues returns an array of possible values for the ResourceType const type. +func PossibleResourceTypeValues() []ResourceType { + return []ResourceType{ResourceTypeExisting, ResourceTypeNew, ResourceTypeProtectionProfileCustomDetails} +} + +// ResourceTypeBasicRecoveryAvailabilitySetCustomDetails enumerates the values for resource type basic recovery +// availability set custom details. +type ResourceTypeBasicRecoveryAvailabilitySetCustomDetails string + +const ( + // ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryAvailabilitySetCustomDetails = "Existing" + // ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails ... + ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails ResourceTypeBasicRecoveryAvailabilitySetCustomDetails = "RecoveryAvailabilitySetCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryAvailabilitySetCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryAvailabilitySetCustomDetails const type. +func PossibleResourceTypeBasicRecoveryAvailabilitySetCustomDetailsValues() []ResourceTypeBasicRecoveryAvailabilitySetCustomDetails { + return []ResourceTypeBasicRecoveryAvailabilitySetCustomDetails{ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails} +} + +// ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails enumerates the values for resource type basic +// recovery proximity placement group custom details. +type ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails string + +const ( + // ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails = "Existing" + // ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails ... + ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails = "RecoveryProximityPlacementGroupCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails const type. +func PossibleResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsValues() []ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails { + return []ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails{ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails} +} + +// ResourceTypeBasicRecoveryResourceGroupCustomDetails enumerates the values for resource type basic recovery +// resource group custom details. +type ResourceTypeBasicRecoveryResourceGroupCustomDetails string + +const ( + // ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryResourceGroupCustomDetails = "Existing" + // ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails ... + ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails ResourceTypeBasicRecoveryResourceGroupCustomDetails = "RecoveryResourceGroupCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryResourceGroupCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryResourceGroupCustomDetails const type. +func PossibleResourceTypeBasicRecoveryResourceGroupCustomDetailsValues() []ResourceTypeBasicRecoveryResourceGroupCustomDetails { + return []ResourceTypeBasicRecoveryResourceGroupCustomDetails{ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails} +} + +// ResourceTypeBasicRecoveryVirtualNetworkCustomDetails enumerates the values for resource type basic recovery +// virtual network custom details. +type ResourceTypeBasicRecoveryVirtualNetworkCustomDetails string + +const ( + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "Existing" + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "New" + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "RecoveryVirtualNetworkCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryVirtualNetworkCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryVirtualNetworkCustomDetails const type. +func PossibleResourceTypeBasicRecoveryVirtualNetworkCustomDetailsValues() []ResourceTypeBasicRecoveryVirtualNetworkCustomDetails { + return []ResourceTypeBasicRecoveryVirtualNetworkCustomDetails{ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew, ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails} +} + +// ResourceTypeBasicStorageAccountCustomDetails enumerates the values for resource type basic storage account +// custom details. +type ResourceTypeBasicStorageAccountCustomDetails string + +const ( + // ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting ... + ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting ResourceTypeBasicStorageAccountCustomDetails = "Existing" + // ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails ... + ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails ResourceTypeBasicStorageAccountCustomDetails = "StorageAccountCustomDetails" +) + +// PossibleResourceTypeBasicStorageAccountCustomDetailsValues returns an array of possible values for the ResourceTypeBasicStorageAccountCustomDetails const type. +func PossibleResourceTypeBasicStorageAccountCustomDetailsValues() []ResourceTypeBasicStorageAccountCustomDetails { + return []ResourceTypeBasicStorageAccountCustomDetails{ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting, ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails} +} + +// ResyncState enumerates the values for resync state. +type ResyncState string + +const ( + // ResyncStateNone ... + ResyncStateNone ResyncState = "None" + // ResyncStatePreparedForResynchronization ... + ResyncStatePreparedForResynchronization ResyncState = "PreparedForResynchronization" + // ResyncStateStartedResynchronization ... + ResyncStateStartedResynchronization ResyncState = "StartedResynchronization" +) + +// PossibleResyncStateValues returns an array of possible values for the ResyncState const type. +func PossibleResyncStateValues() []ResyncState { + return []ResyncState{ResyncStateNone, ResyncStatePreparedForResynchronization, ResyncStateStartedResynchronization} +} + +// RpInMageRecoveryPointType enumerates the values for rp in mage recovery point type. +type RpInMageRecoveryPointType string + +const ( + // RpInMageRecoveryPointTypeCustom ... + RpInMageRecoveryPointTypeCustom RpInMageRecoveryPointType = "Custom" + // RpInMageRecoveryPointTypeLatestTag ... + RpInMageRecoveryPointTypeLatestTag RpInMageRecoveryPointType = "LatestTag" + // RpInMageRecoveryPointTypeLatestTime ... + RpInMageRecoveryPointTypeLatestTime RpInMageRecoveryPointType = "LatestTime" +) + +// PossibleRpInMageRecoveryPointTypeValues returns an array of possible values for the RpInMageRecoveryPointType const type. +func PossibleRpInMageRecoveryPointTypeValues() []RpInMageRecoveryPointType { + return []RpInMageRecoveryPointType{RpInMageRecoveryPointTypeCustom, RpInMageRecoveryPointTypeLatestTag, RpInMageRecoveryPointTypeLatestTime} +} + +// SetMultiVMSyncStatus enumerates the values for set multi vm sync status. +type SetMultiVMSyncStatus string + +const ( + // Disable ... + Disable SetMultiVMSyncStatus = "Disable" + // Enable ... + Enable SetMultiVMSyncStatus = "Enable" +) + +// PossibleSetMultiVMSyncStatusValues returns an array of possible values for the SetMultiVMSyncStatus const type. +func PossibleSetMultiVMSyncStatusValues() []SetMultiVMSyncStatus { + return []SetMultiVMSyncStatus{Disable, Enable} +} + +// Severity enumerates the values for severity. +type Severity string + +const ( + // Error ... + Error Severity = "Error" + // Info ... + Info Severity = "Info" + // NONE ... + NONE Severity = "NONE" + // Warning ... + Warning Severity = "Warning" +) + +// PossibleSeverityValues returns an array of possible values for the Severity const type. +func PossibleSeverityValues() []Severity { + return []Severity{Error, Info, NONE, Warning} +} + +// SourceSiteOperations enumerates the values for source site operations. +type SourceSiteOperations string + +const ( + // NotRequired ... + NotRequired SourceSiteOperations = "NotRequired" + // Required ... + Required SourceSiteOperations = "Required" +) + +// PossibleSourceSiteOperationsValues returns an array of possible values for the SourceSiteOperations const type. +func PossibleSourceSiteOperationsValues() []SourceSiteOperations { + return []SourceSiteOperations{NotRequired, Required} +} + +// SQLServerLicenseType enumerates the values for sql server license type. +type SQLServerLicenseType string + +const ( + // SQLServerLicenseTypeAHUB ... + SQLServerLicenseTypeAHUB SQLServerLicenseType = "AHUB" + // SQLServerLicenseTypeNoLicenseType ... + SQLServerLicenseTypeNoLicenseType SQLServerLicenseType = "NoLicenseType" + // SQLServerLicenseTypeNotSpecified ... + SQLServerLicenseTypeNotSpecified SQLServerLicenseType = "NotSpecified" + // SQLServerLicenseTypePAYG ... + SQLServerLicenseTypePAYG SQLServerLicenseType = "PAYG" +) + +// PossibleSQLServerLicenseTypeValues returns an array of possible values for the SQLServerLicenseType const type. +func PossibleSQLServerLicenseTypeValues() []SQLServerLicenseType { + return []SQLServerLicenseType{SQLServerLicenseTypeAHUB, SQLServerLicenseTypeNoLicenseType, SQLServerLicenseTypeNotSpecified, SQLServerLicenseTypePAYG} +} + +// TestMigrationState enumerates the values for test migration state. +type TestMigrationState string + +const ( + // TestMigrationStateNone ... + TestMigrationStateNone TestMigrationState = "None" + // TestMigrationStateTestMigrationCleanupInProgress ... + TestMigrationStateTestMigrationCleanupInProgress TestMigrationState = "TestMigrationCleanupInProgress" + // TestMigrationStateTestMigrationFailed ... + TestMigrationStateTestMigrationFailed TestMigrationState = "TestMigrationFailed" + // TestMigrationStateTestMigrationInProgress ... + TestMigrationStateTestMigrationInProgress TestMigrationState = "TestMigrationInProgress" + // TestMigrationStateTestMigrationSucceeded ... + TestMigrationStateTestMigrationSucceeded TestMigrationState = "TestMigrationSucceeded" +) + +// PossibleTestMigrationStateValues returns an array of possible values for the TestMigrationState const type. +func PossibleTestMigrationStateValues() []TestMigrationState { + return []TestMigrationState{TestMigrationStateNone, TestMigrationStateTestMigrationCleanupInProgress, TestMigrationStateTestMigrationFailed, TestMigrationStateTestMigrationInProgress, TestMigrationStateTestMigrationSucceeded} +} + +// VMEncryptionType enumerates the values for vm encryption type. +type VMEncryptionType string + +const ( + // NotEncrypted ... + NotEncrypted VMEncryptionType = "NotEncrypted" + // OnePassEncrypted ... + OnePassEncrypted VMEncryptionType = "OnePassEncrypted" + // TwoPassEncrypted ... + TwoPassEncrypted VMEncryptionType = "TwoPassEncrypted" +) + +// PossibleVMEncryptionTypeValues returns an array of possible values for the VMEncryptionType const type. +func PossibleVMEncryptionTypeValues() []VMEncryptionType { + return []VMEncryptionType{NotEncrypted, OnePassEncrypted, TwoPassEncrypted} +} + +// VMReplicationProgressHealth enumerates the values for vm replication progress health. +type VMReplicationProgressHealth string + +const ( + // VMReplicationProgressHealthInProgress ... + VMReplicationProgressHealthInProgress VMReplicationProgressHealth = "InProgress" + // VMReplicationProgressHealthNone ... + VMReplicationProgressHealthNone VMReplicationProgressHealth = "None" + // VMReplicationProgressHealthNoProgress ... + VMReplicationProgressHealthNoProgress VMReplicationProgressHealth = "NoProgress" + // VMReplicationProgressHealthSlowProgress ... + VMReplicationProgressHealthSlowProgress VMReplicationProgressHealth = "SlowProgress" +) + +// PossibleVMReplicationProgressHealthValues returns an array of possible values for the VMReplicationProgressHealth const type. +func PossibleVMReplicationProgressHealthValues() []VMReplicationProgressHealth { + return []VMReplicationProgressHealth{VMReplicationProgressHealthInProgress, VMReplicationProgressHealthNone, VMReplicationProgressHealthNoProgress, VMReplicationProgressHealthSlowProgress} +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/migrationrecoverypoints.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/migrationrecoverypoints.go new file mode 100644 index 000000000000..1bf01329c7a2 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/migrationrecoverypoints.go @@ -0,0 +1,236 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// MigrationRecoveryPointsClient is the client for the MigrationRecoveryPoints methods of the Siterecovery service. +type MigrationRecoveryPointsClient struct { + BaseClient +} + +// NewMigrationRecoveryPointsClient creates an instance of the MigrationRecoveryPointsClient client. +func NewMigrationRecoveryPointsClient(subscriptionID string, resourceGroupName string, resourceName string) MigrationRecoveryPointsClient { + return NewMigrationRecoveryPointsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewMigrationRecoveryPointsClientWithBaseURI creates an instance of the MigrationRecoveryPointsClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewMigrationRecoveryPointsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) MigrationRecoveryPointsClient { + return MigrationRecoveryPointsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get sends the get request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// migrationRecoveryPointName - the migration recovery point name. +func (client MigrationRecoveryPointsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (result MigrationRecoveryPoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, migrationItemName, migrationRecoveryPointName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client MigrationRecoveryPointsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "migrationRecoveryPointName": autorest.Encode("path", migrationRecoveryPointName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints/{migrationRecoveryPointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client MigrationRecoveryPointsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client MigrationRecoveryPointsClient) GetResponder(resp *http.Response) (result MigrationRecoveryPoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationMigrationItems sends the list by replication migration items request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItems(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationRecoveryPointCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.ListByReplicationMigrationItems") + defer func() { + sc := -1 + if result.mrpc.Response.Response != nil { + sc = result.mrpc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationMigrationItemsNextResults + req, err := client.ListByReplicationMigrationItemsPreparer(ctx, fabricName, protectionContainerName, migrationItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationMigrationItemsSender(req) + if err != nil { + result.mrpc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", resp, "Failure sending request") + return + } + + result.mrpc, err = client.ListByReplicationMigrationItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", resp, "Failure responding to request") + return + } + if result.mrpc.hasNextLink() && result.mrpc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationMigrationItemsPreparer prepares the ListByReplicationMigrationItems request. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationMigrationItemsSender sends the ListByReplicationMigrationItems request. The method will close the +// http.Response Body if it receives an error. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationMigrationItemsResponder handles the response to the ListByReplicationMigrationItems request. The method always +// closes the http.Response Body. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsResponder(resp *http.Response) (result MigrationRecoveryPointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationMigrationItemsNextResults retrieves the next set of results, if any. +func (client MigrationRecoveryPointsClient) listByReplicationMigrationItemsNextResults(ctx context.Context, lastResults MigrationRecoveryPointCollection) (result MigrationRecoveryPointCollection, err error) { + req, err := lastResults.migrationRecoveryPointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationMigrationItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationMigrationItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationMigrationItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationRecoveryPointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.ListByReplicationMigrationItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationMigrationItems(ctx, fabricName, protectionContainerName, migrationItemName) + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/models.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/models.go new file mode 100644 index 000000000000..465ed9fe9de8 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/models.go @@ -0,0 +1,32337 @@ +package siterecovery + +// 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. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-06-01/siterecovery" + +// A2AAddDisksInput a2A add disk(s) input. +type A2AAddDisksInput struct { + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeAddDisksProviderSpecificInput', 'InstanceTypeA2A' + InstanceType InstanceType `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AAddDisksInput. +func (aadi A2AAddDisksInput) MarshalJSON() ([]byte, error) { + aadi.InstanceType = InstanceTypeA2A + objectMap := make(map[string]interface{}) + if aadi.VMDisks != nil { + objectMap["vmDisks"] = aadi.VMDisks + } + if aadi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aadi.VMManagedDisks + } + if aadi.InstanceType != "" { + objectMap["instanceType"] = aadi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AAddDisksInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsA2AAddDisksInput() (*A2AAddDisksInput, bool) { + return &aadi, true +} + +// AsAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsBasicAddDisksProviderSpecificInput() (BasicAddDisksProviderSpecificInput, bool) { + return &aadi, true +} + +// A2AApplyRecoveryPointInput applyRecoveryPoint input specific to A2A provider. +type A2AApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + aarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aarpi.InstanceType != "" { + objectMap["instanceType"] = aarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return &aarpi, true +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &aarpi, true +} + +// A2AContainerCreationInput a2A cloud creation input. +type A2AContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) MarshalJSON() ([]byte, error) { + acci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acci.InstanceType != "" { + objectMap["instanceType"] = acci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return &acci, true +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &acci, true +} + +// A2AContainerMappingInput a2A container mapping input. +type A2AContainerMappingInput struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) MarshalJSON() ([]byte, error) { + acmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acmi.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = acmi.AgentAutoUpdateStatus + } + if acmi.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = acmi.AutomationAccountArmID + } + if acmi.InstanceType != "" { + objectMap["instanceType"] = acmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return &acmi, true +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &acmi, true +} + +// A2ACreateProtectionIntentInput a2A create protection intent input. +type A2ACreateProtectionIntentInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryLocation - The primary location for the virtual machine. + PrimaryLocation *string `json:"primaryLocation,omitempty"` + // RecoveryLocation - The recovery location for the virtual machine. + RecoveryLocation *string `json:"recoveryLocation,omitempty"` + // RecoverySubscriptionID - The recovery subscription Id of the virtual machine. + RecoverySubscriptionID *string `json:"recoverySubscriptionId,omitempty"` + // RecoveryAvailabilityType - The recovery availability type of the virtual machine. Possible values include: 'Single', 'AvailabilitySet', 'AvailabilityZone' + RecoveryAvailabilityType A2ARecoveryAvailabilityType `json:"recoveryAvailabilityType,omitempty"` + // ProtectionProfileCustomInput - The protection profile custom inputs. + ProtectionProfileCustomInput BasicProtectionProfileCustomDetails `json:"protectionProfileCustomInput,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` + // RecoveryAvailabilitySetCustomInput - The recovery availability set input. + RecoveryAvailabilitySetCustomInput BasicRecoveryAvailabilitySetCustomDetails `json:"recoveryAvailabilitySetCustomInput,omitempty"` + // RecoveryVirtualNetworkCustomInput - The recovery virtual network input. + RecoveryVirtualNetworkCustomInput BasicRecoveryVirtualNetworkCustomDetails `json:"recoveryVirtualNetworkCustomInput,omitempty"` + // RecoveryProximityPlacementGroupCustomInput - The recovery proximity placement group custom input. + RecoveryProximityPlacementGroupCustomInput BasicRecoveryProximityPlacementGroupCustomDetails `json:"recoveryProximityPlacementGroupCustomInput,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // VMDisks - The list of vm disk inputs. + VMDisks *[]A2AProtectionIntentDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk inputs. + VMManagedDisks *[]A2AProtectionIntentManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccount - The boot diagnostic storage account. + RecoveryBootDiagStorageAccount BasicStorageAccountCustomDetails `json:"recoveryBootDiagStorageAccount,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails', 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) MarshalJSON() ([]byte, error) { + acpii.InstanceType = InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acpii.FabricObjectID != nil { + objectMap["fabricObjectId"] = acpii.FabricObjectID + } + if acpii.PrimaryLocation != nil { + objectMap["primaryLocation"] = acpii.PrimaryLocation + } + if acpii.RecoveryLocation != nil { + objectMap["recoveryLocation"] = acpii.RecoveryLocation + } + if acpii.RecoverySubscriptionID != nil { + objectMap["recoverySubscriptionId"] = acpii.RecoverySubscriptionID + } + if acpii.RecoveryAvailabilityType != "" { + objectMap["recoveryAvailabilityType"] = acpii.RecoveryAvailabilityType + } + objectMap["protectionProfileCustomInput"] = acpii.ProtectionProfileCustomInput + if acpii.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = acpii.RecoveryResourceGroupID + } + objectMap["primaryStagingStorageAccountCustomInput"] = acpii.PrimaryStagingStorageAccountCustomInput + objectMap["recoveryAvailabilitySetCustomInput"] = acpii.RecoveryAvailabilitySetCustomInput + objectMap["recoveryVirtualNetworkCustomInput"] = acpii.RecoveryVirtualNetworkCustomInput + objectMap["recoveryProximityPlacementGroupCustomInput"] = acpii.RecoveryProximityPlacementGroupCustomInput + if acpii.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = acpii.AutoProtectionOfDataDisk + } + if acpii.VMDisks != nil { + objectMap["vmDisks"] = acpii.VMDisks + } + if acpii.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = acpii.VMManagedDisks + } + if acpii.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = acpii.MultiVMGroupName + } + if acpii.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = acpii.MultiVMGroupID + } + objectMap["recoveryBootDiagStorageAccount"] = acpii.RecoveryBootDiagStorageAccount + if acpii.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = acpii.DiskEncryptionInfo + } + if acpii.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = acpii.RecoveryAvailabilityZone + } + if acpii.InstanceType != "" { + objectMap["instanceType"] = acpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACreateProtectionIntentInput is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) { + return &acpii, true +} + +// AsCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsBasicCreateProtectionIntentProviderSpecificDetails() (BasicCreateProtectionIntentProviderSpecificDetails, bool) { + return &acpii, true +} + +// UnmarshalJSON is the custom unmarshaler for A2ACreateProtectionIntentInput struct. +func (acpii *A2ACreateProtectionIntentInput) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "fabricObjectId": + if v != nil { + var fabricObjectID string + err = json.Unmarshal(*v, &fabricObjectID) + if err != nil { + return err + } + acpii.FabricObjectID = &fabricObjectID + } + case "primaryLocation": + if v != nil { + var primaryLocation string + err = json.Unmarshal(*v, &primaryLocation) + if err != nil { + return err + } + acpii.PrimaryLocation = &primaryLocation + } + case "recoveryLocation": + if v != nil { + var recoveryLocation string + err = json.Unmarshal(*v, &recoveryLocation) + if err != nil { + return err + } + acpii.RecoveryLocation = &recoveryLocation + } + case "recoverySubscriptionId": + if v != nil { + var recoverySubscriptionID string + err = json.Unmarshal(*v, &recoverySubscriptionID) + if err != nil { + return err + } + acpii.RecoverySubscriptionID = &recoverySubscriptionID + } + case "recoveryAvailabilityType": + if v != nil { + var recoveryAvailabilityType A2ARecoveryAvailabilityType + err = json.Unmarshal(*v, &recoveryAvailabilityType) + if err != nil { + return err + } + acpii.RecoveryAvailabilityType = recoveryAvailabilityType + } + case "protectionProfileCustomInput": + if v != nil { + protectionProfileCustomInput, err := unmarshalBasicProtectionProfileCustomDetails(*v) + if err != nil { + return err + } + acpii.ProtectionProfileCustomInput = protectionProfileCustomInput + } + case "recoveryResourceGroupId": + if v != nil { + var recoveryResourceGroupID string + err = json.Unmarshal(*v, &recoveryResourceGroupID) + if err != nil { + return err + } + acpii.RecoveryResourceGroupID = &recoveryResourceGroupID + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + acpii.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + case "recoveryAvailabilitySetCustomInput": + if v != nil { + recoveryAvailabilitySetCustomInput, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryAvailabilitySetCustomInput = recoveryAvailabilitySetCustomInput + } + case "recoveryVirtualNetworkCustomInput": + if v != nil { + recoveryVirtualNetworkCustomInput, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryVirtualNetworkCustomInput = recoveryVirtualNetworkCustomInput + } + case "recoveryProximityPlacementGroupCustomInput": + if v != nil { + recoveryProximityPlacementGroupCustomInput, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryProximityPlacementGroupCustomInput = recoveryProximityPlacementGroupCustomInput + } + case "autoProtectionOfDataDisk": + if v != nil { + var autoProtectionOfDataDisk AutoProtectionOfDataDisk + err = json.Unmarshal(*v, &autoProtectionOfDataDisk) + if err != nil { + return err + } + acpii.AutoProtectionOfDataDisk = autoProtectionOfDataDisk + } + case "vmDisks": + if v != nil { + var VMDisks []A2AProtectionIntentDiskInputDetails + err = json.Unmarshal(*v, &VMDisks) + if err != nil { + return err + } + acpii.VMDisks = &VMDisks + } + case "vmManagedDisks": + if v != nil { + var VMManagedDisks []A2AProtectionIntentManagedDiskInputDetails + err = json.Unmarshal(*v, &VMManagedDisks) + if err != nil { + return err + } + acpii.VMManagedDisks = &VMManagedDisks + } + case "multiVmGroupName": + if v != nil { + var multiVMGroupName string + err = json.Unmarshal(*v, &multiVMGroupName) + if err != nil { + return err + } + acpii.MultiVMGroupName = &multiVMGroupName + } + case "multiVmGroupId": + if v != nil { + var multiVMGroupID string + err = json.Unmarshal(*v, &multiVMGroupID) + if err != nil { + return err + } + acpii.MultiVMGroupID = &multiVMGroupID + } + case "recoveryBootDiagStorageAccount": + if v != nil { + recoveryBootDiagStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryBootDiagStorageAccount = recoveryBootDiagStorageAccount + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + acpii.DiskEncryptionInfo = &diskEncryptionInfo + } + case "recoveryAvailabilityZone": + if v != nil { + var recoveryAvailabilityZone string + err = json.Unmarshal(*v, &recoveryAvailabilityZone) + if err != nil { + return err + } + acpii.RecoveryAvailabilityZone = &recoveryAvailabilityZone + } + case "instanceType": + if v != nil { + var instanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails + err = json.Unmarshal(*v, &instanceType) + if err != nil { + return err + } + acpii.InstanceType = instanceType + } + } + } + + return nil +} + +// A2ACrossClusterMigrationApplyRecoveryPointInput applyRecoveryPoint input specific to +// A2ACrossClusterMigration provider. +type A2ACrossClusterMigrationApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + accmarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmarpi.InstanceType != "" { + objectMap["instanceType"] = accmarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return &accmarpi, true +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &accmarpi, true +} + +// A2ACrossClusterMigrationContainerCreationInput a2ACrossClusterMigration cloud creation input. +type A2ACrossClusterMigrationContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) MarshalJSON() ([]byte, error) { + accmcci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmcci.InstanceType != "" { + objectMap["instanceType"] = accmcci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return &accmcci, true +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &accmcci, true +} + +// A2ACrossClusterMigrationEnableProtectionInput a2A Cross-Cluster Migration enable protection input. +type A2ACrossClusterMigrationEnableProtectionInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) MarshalJSON() ([]byte, error) { + accmepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmepi.FabricObjectID != nil { + objectMap["fabricObjectId"] = accmepi.FabricObjectID + } + if accmepi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = accmepi.RecoveryContainerID + } + if accmepi.InstanceType != "" { + objectMap["instanceType"] = accmepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return &accmepi, true +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &accmepi, true +} + +// A2ACrossClusterMigrationPolicyCreationInput a2A Cross-Cluster Migration Policy creation input. +type A2ACrossClusterMigrationPolicyCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) MarshalJSON() ([]byte, error) { + accmpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmpci.InstanceType != "" { + objectMap["instanceType"] = accmpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return &accmpci, true +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &accmpci, true +} + +// A2ACrossClusterMigrationReplicationDetails a2A provider specific settings. +type A2ACrossClusterMigrationReplicationDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryFabricLocation - Primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // OsType - The type of operating system. + OsType *string `json:"osType,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // LifecycleID - An id associated with the PE 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 item even though other internal Ids/ARM Id might be changing. + LifecycleID *string `json:"lifecycleId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) MarshalJSON() ([]byte, error) { + accmrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmrd.FabricObjectID != nil { + objectMap["fabricObjectId"] = accmrd.FabricObjectID + } + if accmrd.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = accmrd.PrimaryFabricLocation + } + if accmrd.OsType != nil { + objectMap["osType"] = accmrd.OsType + } + if accmrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = accmrd.VMProtectionState + } + if accmrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = accmrd.VMProtectionStateDescription + } + if accmrd.LifecycleID != nil { + objectMap["lifecycleId"] = accmrd.LifecycleID + } + if accmrd.InstanceType != "" { + objectMap["instanceType"] = accmrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return &accmrd, true +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &accmrd, true +} + +// A2AEnableProtectionInput a2A enable protection input. +type A2AEnableProtectionInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryAzureNetworkID - The recovery Azure virtual network ARM id. + RecoveryAzureNetworkID *string `json:"recoveryAzureNetworkId,omitempty"` + // RecoverySubnetName - The recovery subnet name. + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + // RecoveryVirtualMachineScaleSetID - The virtual machine scale set Id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) MarshalJSON() ([]byte, error) { + aepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aepi.FabricObjectID != nil { + objectMap["fabricObjectId"] = aepi.FabricObjectID + } + if aepi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = aepi.RecoveryContainerID + } + if aepi.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aepi.RecoveryResourceGroupID + } + if aepi.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aepi.RecoveryCloudServiceID + } + if aepi.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = aepi.RecoveryAvailabilitySetID + } + if aepi.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aepi.RecoveryProximityPlacementGroupID + } + if aepi.VMDisks != nil { + objectMap["vmDisks"] = aepi.VMDisks + } + if aepi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aepi.VMManagedDisks + } + if aepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = aepi.MultiVMGroupName + } + if aepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = aepi.MultiVMGroupID + } + if aepi.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aepi.RecoveryBootDiagStorageAccountID + } + if aepi.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aepi.DiskEncryptionInfo + } + if aepi.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = aepi.RecoveryAvailabilityZone + } + if aepi.RecoveryAzureNetworkID != nil { + objectMap["recoveryAzureNetworkId"] = aepi.RecoveryAzureNetworkID + } + if aepi.RecoverySubnetName != nil { + objectMap["recoverySubnetName"] = aepi.RecoverySubnetName + } + if aepi.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aepi.RecoveryVirtualMachineScaleSetID + } + if aepi.InstanceType != "" { + objectMap["instanceType"] = aepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return &aepi, true +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &aepi, true +} + +// A2AEventDetails model class for event details of a A2A event. +type A2AEventDetails struct { + // ProtectedItemName - The protected item arm name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // FabricObjectID - The azure vm arm id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // FabricName - Fabric arm name. + FabricName *string `json:"fabricName,omitempty"` + // FabricLocation - The fabric location. + FabricLocation *string `json:"fabricLocation,omitempty"` + // RemoteFabricName - Remote fabric arm name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // RemoteFabricLocation - Remote fabric location. + RemoteFabricLocation *string `json:"remoteFabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AEventDetails. +func (aed A2AEventDetails) MarshalJSON() ([]byte, error) { + aed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aed.ProtectedItemName != nil { + objectMap["protectedItemName"] = aed.ProtectedItemName + } + if aed.FabricObjectID != nil { + objectMap["fabricObjectId"] = aed.FabricObjectID + } + if aed.FabricName != nil { + objectMap["fabricName"] = aed.FabricName + } + if aed.FabricLocation != nil { + objectMap["fabricLocation"] = aed.FabricLocation + } + if aed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = aed.RemoteFabricName + } + if aed.RemoteFabricLocation != nil { + objectMap["remoteFabricLocation"] = aed.RemoteFabricLocation + } + if aed.InstanceType != "" { + objectMap["instanceType"] = aed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return &aed, true +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &aed, true +} + +// A2APolicyCreationInput a2A Policy creation input. +type A2APolicyCreationInput struct { + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) MarshalJSON() ([]byte, error) { + apci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apci.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = apci.RecoveryPointHistory + } + if apci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = apci.CrashConsistentFrequencyInMinutes + } + if apci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = apci.AppConsistentFrequencyInMinutes + } + if apci.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = apci.MultiVMSyncStatus + } + if apci.InstanceType != "" { + objectMap["instanceType"] = apci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return &apci, true +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &apci, true +} + +// A2APolicyDetails a2A specific policy details. +type A2APolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2APolicyDetails. +func (apd A2APolicyDetails) MarshalJSON() ([]byte, error) { + apd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = apd.RecoveryPointThresholdInMinutes + } + if apd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = apd.RecoveryPointHistory + } + if apd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = apd.AppConsistentFrequencyInMinutes + } + if apd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = apd.MultiVMSyncStatus + } + if apd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = apd.CrashConsistentFrequencyInMinutes + } + if apd.InstanceType != "" { + objectMap["instanceType"] = apd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return &apd, true +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &apd, true +} + +// A2AProtectedDiskDetails a2A protected disk details. +type A2AProtectedDiskDetails struct { + // DiskURI - The disk uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountID - The recovery disk storage account. + RecoveryAzureStorageAccountID *string `json:"recoveryAzureStorageAccountId,omitempty"` + // PrimaryDiskAzureStorageAccountID - The primary disk storage account. + PrimaryDiskAzureStorageAccountID *string `json:"primaryDiskAzureStorageAccountId,omitempty"` + // RecoveryDiskURI - Recovery disk uri. + RecoveryDiskURI *string `json:"recoveryDiskUri,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // DiskType - The type of disk. + DiskType *string `json:"diskType,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *bool `json:"resyncRequired,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // DataPendingInStagingStorageAccountInMB - The data pending for replication in MB at staging account. + DataPendingInStagingStorageAccountInMB *float64 `json:"dataPendingInStagingStorageAccountInMB,omitempty"` + // DataPendingAtSourceAgentInMB - The data pending at source virtual machine in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // DiskState - The disk state. + DiskState *string `json:"diskState,omitempty"` + // AllowedDiskLevelOperation - The disk level operations list. + AllowedDiskLevelOperation *[]string `json:"allowedDiskLevelOperation,omitempty"` + // IsDiskEncrypted - A value indicating whether vm has encrypted os disk or not. + IsDiskEncrypted *bool `json:"isDiskEncrypted,omitempty"` + // SecretIdentifier - The secret URL / identifier (BEK). + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // DekKeyVaultArmID - The KeyVault resource id for secret (BEK). + DekKeyVaultArmID *string `json:"dekKeyVaultArmId,omitempty"` + // IsDiskKeyEncrypted - A value indicating whether disk key got encrypted or not. + IsDiskKeyEncrypted *bool `json:"isDiskKeyEncrypted,omitempty"` + // KeyIdentifier - The key URL / identifier (KEK). + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KekKeyVaultArmID - The KeyVault resource id for key (KEK). + KekKeyVaultArmID *string `json:"kekKeyVaultArmId,omitempty"` + // FailoverDiskName - The failover name for the managed disk. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The test failover name for the managed disk. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AProtectedManagedDiskDetails a2A protected managed disk details. +type A2AProtectedManagedDiskDetails struct { + // DiskID - The managed disk Arm id. + DiskID *string `json:"diskId,omitempty"` + // RecoveryResourceGroupID - The recovery disk resource group Arm Id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryTargetDiskID - Recovery target disk Arm Id. + RecoveryTargetDiskID *string `json:"recoveryTargetDiskId,omitempty"` + // RecoveryReplicaDiskID - Recovery replica disk Arm Id. + RecoveryReplicaDiskID *string `json:"recoveryReplicaDiskId,omitempty"` + // RecoveryOrignalTargetDiskID - Recovery original target disk Arm Id. + RecoveryOrignalTargetDiskID *string `json:"recoveryOrignalTargetDiskId,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // PrimaryDiskEncryptionSetID - The primary disk encryption set Id. + PrimaryDiskEncryptionSetID *string `json:"primaryDiskEncryptionSetId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // DiskType - The type of disk. + DiskType *string `json:"diskType,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *bool `json:"resyncRequired,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // DataPendingInStagingStorageAccountInMB - The data pending for replication in MB at staging account. + DataPendingInStagingStorageAccountInMB *float64 `json:"dataPendingInStagingStorageAccountInMB,omitempty"` + // DataPendingAtSourceAgentInMB - The data pending at source virtual machine in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // DiskState - The disk state. + DiskState *string `json:"diskState,omitempty"` + // AllowedDiskLevelOperation - The disk level operations list. + AllowedDiskLevelOperation *[]string `json:"allowedDiskLevelOperation,omitempty"` + // IsDiskEncrypted - A value indicating whether vm has encrypted os disk or not. + IsDiskEncrypted *bool `json:"isDiskEncrypted,omitempty"` + // SecretIdentifier - The secret URL / identifier (BEK). + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // DekKeyVaultArmID - The KeyVault resource id for secret (BEK). + DekKeyVaultArmID *string `json:"dekKeyVaultArmId,omitempty"` + // IsDiskKeyEncrypted - A value indicating whether disk key got encrypted or not. + IsDiskKeyEncrypted *bool `json:"isDiskKeyEncrypted,omitempty"` + // KeyIdentifier - The key URL / identifier (KEK). + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KekKeyVaultArmID - The KeyVault resource id for key (KEK). + KekKeyVaultArmID *string `json:"kekKeyVaultArmId,omitempty"` + // FailoverDiskName - The failover name for the managed disk. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The test failover name for the managed disk. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AProtectionContainerMappingDetails a2A provider specific settings. +type A2AProtectionContainerMappingDetails struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // ScheduleName - The schedule arm name. + ScheduleName *string `json:"scheduleName,omitempty"` + // JobScheduleName - The job schedule arm name. + JobScheduleName *string `json:"jobScheduleName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + apcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apcmd.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = apcmd.AgentAutoUpdateStatus + } + if apcmd.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = apcmd.AutomationAccountArmID + } + if apcmd.ScheduleName != nil { + objectMap["scheduleName"] = apcmd.ScheduleName + } + if apcmd.JobScheduleName != nil { + objectMap["jobScheduleName"] = apcmd.JobScheduleName + } + if apcmd.InstanceType != "" { + objectMap["instanceType"] = apcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return &apcmd, true +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &apcmd, true +} + +// A2AProtectionIntentDiskInputDetails azure VM unmanaged disk input details. +type A2AProtectionIntentDiskInputDetails struct { + // DiskURI - The disk Uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountCustomInput - The recovery VHD storage account input. + RecoveryAzureStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"recoveryAzureStorageAccountCustomInput,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for A2AProtectionIntentDiskInputDetails struct. +func (apidid *A2AProtectionIntentDiskInputDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "diskUri": + if v != nil { + var diskURI string + err = json.Unmarshal(*v, &diskURI) + if err != nil { + return err + } + apidid.DiskURI = &diskURI + } + case "recoveryAzureStorageAccountCustomInput": + if v != nil { + recoveryAzureStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apidid.RecoveryAzureStorageAccountCustomInput = recoveryAzureStorageAccountCustomInput + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apidid.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + } + } + + return nil +} + +// A2AProtectionIntentManagedDiskInputDetails azure VM managed disk input details. +type A2AProtectionIntentManagedDiskInputDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` + // RecoveryResourceGroupCustomInput - The recovery resource group input. + RecoveryResourceGroupCustomInput BasicRecoveryResourceGroupCustomDetails `json:"recoveryResourceGroupCustomInput,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for one / single pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for A2AProtectionIntentManagedDiskInputDetails struct. +func (apimdid *A2AProtectionIntentManagedDiskInputDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "diskId": + if v != nil { + var diskID string + err = json.Unmarshal(*v, &diskID) + if err != nil { + return err + } + apimdid.DiskID = &diskID + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apimdid.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + case "recoveryResourceGroupCustomInput": + if v != nil { + recoveryResourceGroupCustomInput, err := unmarshalBasicRecoveryResourceGroupCustomDetails(*v) + if err != nil { + return err + } + apimdid.RecoveryResourceGroupCustomInput = recoveryResourceGroupCustomInput + } + case "recoveryReplicaDiskAccountType": + if v != nil { + var recoveryReplicaDiskAccountType string + err = json.Unmarshal(*v, &recoveryReplicaDiskAccountType) + if err != nil { + return err + } + apimdid.RecoveryReplicaDiskAccountType = &recoveryReplicaDiskAccountType + } + case "recoveryTargetDiskAccountType": + if v != nil { + var recoveryTargetDiskAccountType string + err = json.Unmarshal(*v, &recoveryTargetDiskAccountType) + if err != nil { + return err + } + apimdid.RecoveryTargetDiskAccountType = &recoveryTargetDiskAccountType + } + case "recoveryDiskEncryptionSetId": + if v != nil { + var recoveryDiskEncryptionSetID string + err = json.Unmarshal(*v, &recoveryDiskEncryptionSetID) + if err != nil { + return err + } + apimdid.RecoveryDiskEncryptionSetID = &recoveryDiskEncryptionSetID + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + apimdid.DiskEncryptionInfo = &diskEncryptionInfo + } + } + } + + return nil +} + +// A2ARecoveryPointDetails a2A provider specific recovery point details. +type A2ARecoveryPointDetails struct { + // RecoveryPointSyncType - A value indicating whether the recovery point is multi VM consistent. Possible values include: 'MultiVMSyncRecoveryPoint', 'PerVMRecoveryPoint' + RecoveryPointSyncType RecoveryPointSyncType `json:"recoveryPointSyncType,omitempty"` + // Disks - List of disk ids representing a recovery point. + Disks *[]string `json:"disks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) MarshalJSON() ([]byte, error) { + arpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if arpd.RecoveryPointSyncType != "" { + objectMap["recoveryPointSyncType"] = arpd.RecoveryPointSyncType + } + if arpd.Disks != nil { + objectMap["disks"] = arpd.Disks + } + if arpd.InstanceType != "" { + objectMap["instanceType"] = arpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return &arpd, true +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &arpd, true +} + +// A2ARemoveDisksInput a2A remove disk(s) input. +type A2ARemoveDisksInput struct { + // VMDisksUris - The list of vm disk vhd URIs. + VMDisksUris *[]string `json:"vmDisksUris,omitempty"` + // VMManagedDisksIds - The list of vm managed disk Ids. + VMManagedDisksIds *[]string `json:"vmManagedDisksIds,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput', 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRemoveDisksProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) MarshalJSON() ([]byte, error) { + ardi.InstanceType = InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ardi.VMDisksUris != nil { + objectMap["vmDisksUris"] = ardi.VMDisksUris + } + if ardi.VMManagedDisksIds != nil { + objectMap["vmManagedDisksIds"] = ardi.VMManagedDisksIds + } + if ardi.InstanceType != "" { + objectMap["instanceType"] = ardi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARemoveDisksInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) { + return &ardi, true +} + +// AsRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsBasicRemoveDisksProviderSpecificInput() (BasicRemoveDisksProviderSpecificInput, bool) { + return &ardi, true +} + +// A2AReplicationDetails a2A provider specific settings. +type A2AReplicationDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // InitialPrimaryZone - READ-ONLY; The initial primary availability zone. + InitialPrimaryZone *string `json:"initialPrimaryZone,omitempty"` + // InitialPrimaryFabricLocation - READ-ONLY; The initial primary fabric location. + InitialPrimaryFabricLocation *string `json:"initialPrimaryFabricLocation,omitempty"` + // InitialRecoveryZone - READ-ONLY; The initial recovery availability zone. + InitialRecoveryZone *string `json:"initialRecoveryZone,omitempty"` + // InitialRecoveryFabricLocation - READ-ONLY; The initial recovery fabric location. + InitialRecoveryFabricLocation *string `json:"initialRecoveryFabricLocation,omitempty"` + // MultiVMGroupID - The multi vm group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupCreateOption - Whether Multi VM group is auto created or specified by user. Possible values include: 'AutoCreated', 'UserSpecified' + MultiVMGroupCreateOption MultiVMGroupCreateOption `json:"multiVmGroupCreateOption,omitempty"` + // ManagementID - The management Id. + ManagementID *string `json:"managementId,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]A2AProtectedDiskDetails `json:"protectedDisks,omitempty"` + // UnprotectedDisks - The list of unprotected disks. + UnprotectedDisks *[]A2AUnprotectedDiskDetails `json:"unprotectedDisks,omitempty"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]A2AProtectedManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // RecoveryBootDiagStorageAccountID - The recovery boot diagnostic storage account Arm Id. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // PrimaryFabricLocation - Primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // RecoveryFabricLocation - The recovery fabric location. + RecoveryFabricLocation *string `json:"recoveryFabricLocation,omitempty"` + // OsType - The type of operating system. + OsType *string `json:"osType,omitempty"` + // RecoveryAzureVMSize - The size of recovery virtual machine. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureVMName - The name of recovery virtual machine. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureResourceGroupID - The recovery resource group. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryCloudService - The recovery cloud service. + RecoveryCloudService *string `json:"recoveryCloudService,omitempty"` + // RecoveryAvailabilitySet - The recovery availability set. + RecoveryAvailabilitySet *string `json:"recoveryAvailabilitySet,omitempty"` + // SelectedRecoveryAzureNetworkID - The recovery virtual network. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The test failover virtual network. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // VMNics - The virtual machine nic details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMSyncedConfigDetails - The synced configuration details. + VMSyncedConfigDetails *AzureToAzureVMSyncedConfigDetails `json:"vmSyncedConfigDetails,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // IsReplicationAgentUpdateRequired - A value indicating whether replication agent update is required. + IsReplicationAgentUpdateRequired *bool `json:"isReplicationAgentUpdateRequired,omitempty"` + // AgentCertificateExpiryDate - READ-ONLY; Agent certificate expiry date. + AgentCertificateExpiryDate *date.Time `json:"agentCertificateExpiryDate,omitempty"` + // IsReplicationAgentCertificateUpdateRequired - A value indicating whether agent certificate update is required. + IsReplicationAgentCertificateUpdateRequired *bool `json:"isReplicationAgentCertificateUpdateRequired,omitempty"` + // RecoveryFabricObjectID - The recovery fabric object Id. + RecoveryFabricObjectID *string `json:"recoveryFabricObjectId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // LifecycleID - An id associated with the PE 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 item even though other internal Ids/ARM Id might be changing. + LifecycleID *string `json:"lifecycleId,omitempty"` + // TestFailoverRecoveryFabricObjectID - The test failover fabric object Id. + TestFailoverRecoveryFabricObjectID *string `json:"testFailoverRecoveryFabricObjectId,omitempty"` + // RpoInSeconds - The last RPO value in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // LastRpoCalculatedTime - The time (in UTC) when the last RPO value was calculated by Protection Service. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // PrimaryAvailabilityZone - The primary availability zone. + PrimaryAvailabilityZone *string `json:"primaryAvailabilityZone,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // VMEncryptionType - READ-ONLY; The encryption type of the VM. Possible values include: 'NotEncrypted', 'OnePassEncrypted', 'TwoPassEncrypted' + VMEncryptionType VMEncryptionType `json:"vmEncryptionType,omitempty"` + // TfoAzureVMName - The test failover vm name. + TfoAzureVMName *string `json:"tfoAzureVMName,omitempty"` + // RecoveryAzureGeneration - READ-ONLY; The recovery azure generation. + RecoveryAzureGeneration *string `json:"recoveryAzureGeneration,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // RecoveryVirtualMachineScaleSetID - The recovery virtual machine scale set id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReplicationDetails. +func (ard A2AReplicationDetails) MarshalJSON() ([]byte, error) { + ard.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ard.FabricObjectID != nil { + objectMap["fabricObjectId"] = ard.FabricObjectID + } + if ard.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = ard.MultiVMGroupID + } + if ard.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = ard.MultiVMGroupName + } + if ard.MultiVMGroupCreateOption != "" { + objectMap["multiVmGroupCreateOption"] = ard.MultiVMGroupCreateOption + } + if ard.ManagementID != nil { + objectMap["managementId"] = ard.ManagementID + } + if ard.ProtectedDisks != nil { + objectMap["protectedDisks"] = ard.ProtectedDisks + } + if ard.UnprotectedDisks != nil { + objectMap["unprotectedDisks"] = ard.UnprotectedDisks + } + if ard.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = ard.ProtectedManagedDisks + } + if ard.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = ard.RecoveryBootDiagStorageAccountID + } + if ard.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = ard.PrimaryFabricLocation + } + if ard.RecoveryFabricLocation != nil { + objectMap["recoveryFabricLocation"] = ard.RecoveryFabricLocation + } + if ard.OsType != nil { + objectMap["osType"] = ard.OsType + } + if ard.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = ard.RecoveryAzureVMSize + } + if ard.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVMName"] = ard.RecoveryAzureVMName + } + if ard.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = ard.RecoveryAzureResourceGroupID + } + if ard.RecoveryCloudService != nil { + objectMap["recoveryCloudService"] = ard.RecoveryCloudService + } + if ard.RecoveryAvailabilitySet != nil { + objectMap["recoveryAvailabilitySet"] = ard.RecoveryAvailabilitySet + } + if ard.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = ard.SelectedRecoveryAzureNetworkID + } + if ard.SelectedTfoAzureNetworkID != nil { + objectMap["selectedTfoAzureNetworkId"] = ard.SelectedTfoAzureNetworkID + } + if ard.VMNics != nil { + objectMap["vmNics"] = ard.VMNics + } + if ard.VMSyncedConfigDetails != nil { + objectMap["vmSyncedConfigDetails"] = ard.VMSyncedConfigDetails + } + if ard.MonitoringPercentageCompletion != nil { + objectMap["monitoringPercentageCompletion"] = ard.MonitoringPercentageCompletion + } + if ard.MonitoringJobType != nil { + objectMap["monitoringJobType"] = ard.MonitoringJobType + } + if ard.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = ard.LastHeartbeat + } + if ard.AgentVersion != nil { + objectMap["agentVersion"] = ard.AgentVersion + } + if ard.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = ard.AgentExpiryDate + } + if ard.IsReplicationAgentUpdateRequired != nil { + objectMap["isReplicationAgentUpdateRequired"] = ard.IsReplicationAgentUpdateRequired + } + if ard.IsReplicationAgentCertificateUpdateRequired != nil { + objectMap["isReplicationAgentCertificateUpdateRequired"] = ard.IsReplicationAgentCertificateUpdateRequired + } + if ard.RecoveryFabricObjectID != nil { + objectMap["recoveryFabricObjectId"] = ard.RecoveryFabricObjectID + } + if ard.VMProtectionState != nil { + objectMap["vmProtectionState"] = ard.VMProtectionState + } + if ard.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = ard.VMProtectionStateDescription + } + if ard.LifecycleID != nil { + objectMap["lifecycleId"] = ard.LifecycleID + } + if ard.TestFailoverRecoveryFabricObjectID != nil { + objectMap["testFailoverRecoveryFabricObjectId"] = ard.TestFailoverRecoveryFabricObjectID + } + if ard.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = ard.RpoInSeconds + } + if ard.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = ard.LastRpoCalculatedTime + } + if ard.PrimaryAvailabilityZone != nil { + objectMap["primaryAvailabilityZone"] = ard.PrimaryAvailabilityZone + } + if ard.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = ard.RecoveryAvailabilityZone + } + if ard.TfoAzureVMName != nil { + objectMap["tfoAzureVMName"] = ard.TfoAzureVMName + } + if ard.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = ard.RecoveryProximityPlacementGroupID + } + if ard.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = ard.AutoProtectionOfDataDisk + } + if ard.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = ard.RecoveryVirtualMachineScaleSetID + } + if ard.InstanceType != "" { + objectMap["instanceType"] = ard.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return &ard, true +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &ard, true +} + +// A2AReplicationIntentDetails a2A provider specific settings. +type A2AReplicationIntentDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryLocation - The primary location for the virtual machine. + PrimaryLocation *string `json:"primaryLocation,omitempty"` + // RecoveryLocation - The recovery location for the virtual machine. + RecoveryLocation *string `json:"recoveryLocation,omitempty"` + // RecoverySubscriptionID - The recovery subscription Id of the virtual machine. + RecoverySubscriptionID *string `json:"recoverySubscriptionId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AProtectionIntentDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AProtectionIntentManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ProtectionProfile - The protection profile custom details. + ProtectionProfile BasicProtectionProfileCustomDetails `json:"protectionProfile,omitempty"` + // PrimaryStagingStorageAccount - The primary staging storage account details. + PrimaryStagingStorageAccount BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccount,omitempty"` + // RecoveryAvailabilitySet - The recovery availability set details. + RecoveryAvailabilitySet BasicRecoveryAvailabilitySetCustomDetails `json:"recoveryAvailabilitySet,omitempty"` + // RecoveryVirtualNetwork - The recovery virtual network details. + RecoveryVirtualNetwork BasicRecoveryVirtualNetworkCustomDetails `json:"recoveryVirtualNetwork,omitempty"` + // RecoveryProximityPlacementGroup - The recovery proximity placement group custom details. + RecoveryProximityPlacementGroup BasicRecoveryProximityPlacementGroupCustomDetails `json:"recoveryProximityPlacementGroup,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccount - The boot diagnostic storage account. + RecoveryBootDiagStorageAccount BasicStorageAccountCustomDetails `json:"recoveryBootDiagStorageAccount,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryAvailabilityType - The recovery availability type of the virtual machine. + RecoveryAvailabilityType *string `json:"recoveryAvailabilityType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings', 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A' + InstanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) MarshalJSON() ([]byte, error) { + arid.InstanceType = InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if arid.FabricObjectID != nil { + objectMap["fabricObjectId"] = arid.FabricObjectID + } + if arid.PrimaryLocation != nil { + objectMap["primaryLocation"] = arid.PrimaryLocation + } + if arid.RecoveryLocation != nil { + objectMap["recoveryLocation"] = arid.RecoveryLocation + } + if arid.RecoverySubscriptionID != nil { + objectMap["recoverySubscriptionId"] = arid.RecoverySubscriptionID + } + if arid.VMDisks != nil { + objectMap["vmDisks"] = arid.VMDisks + } + if arid.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = arid.VMManagedDisks + } + if arid.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = arid.RecoveryResourceGroupID + } + objectMap["protectionProfile"] = arid.ProtectionProfile + objectMap["primaryStagingStorageAccount"] = arid.PrimaryStagingStorageAccount + objectMap["recoveryAvailabilitySet"] = arid.RecoveryAvailabilitySet + objectMap["recoveryVirtualNetwork"] = arid.RecoveryVirtualNetwork + objectMap["recoveryProximityPlacementGroup"] = arid.RecoveryProximityPlacementGroup + if arid.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = arid.AutoProtectionOfDataDisk + } + if arid.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = arid.MultiVMGroupName + } + if arid.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = arid.MultiVMGroupID + } + objectMap["recoveryBootDiagStorageAccount"] = arid.RecoveryBootDiagStorageAccount + if arid.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = arid.DiskEncryptionInfo + } + if arid.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = arid.RecoveryAvailabilityZone + } + if arid.RecoveryAvailabilityType != nil { + objectMap["recoveryAvailabilityType"] = arid.RecoveryAvailabilityType + } + if arid.InstanceType != "" { + objectMap["instanceType"] = arid.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReplicationIntentDetails is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) { + return &arid, true +} + +// AsReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsBasicReplicationProtectionIntentProviderSpecificSettings() (BasicReplicationProtectionIntentProviderSpecificSettings, bool) { + return &arid, true +} + +// UnmarshalJSON is the custom unmarshaler for A2AReplicationIntentDetails struct. +func (arid *A2AReplicationIntentDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "fabricObjectId": + if v != nil { + var fabricObjectID string + err = json.Unmarshal(*v, &fabricObjectID) + if err != nil { + return err + } + arid.FabricObjectID = &fabricObjectID + } + case "primaryLocation": + if v != nil { + var primaryLocation string + err = json.Unmarshal(*v, &primaryLocation) + if err != nil { + return err + } + arid.PrimaryLocation = &primaryLocation + } + case "recoveryLocation": + if v != nil { + var recoveryLocation string + err = json.Unmarshal(*v, &recoveryLocation) + if err != nil { + return err + } + arid.RecoveryLocation = &recoveryLocation + } + case "recoverySubscriptionId": + if v != nil { + var recoverySubscriptionID string + err = json.Unmarshal(*v, &recoverySubscriptionID) + if err != nil { + return err + } + arid.RecoverySubscriptionID = &recoverySubscriptionID + } + case "vmDisks": + if v != nil { + var VMDisks []A2AProtectionIntentDiskInputDetails + err = json.Unmarshal(*v, &VMDisks) + if err != nil { + return err + } + arid.VMDisks = &VMDisks + } + case "vmManagedDisks": + if v != nil { + var VMManagedDisks []A2AProtectionIntentManagedDiskInputDetails + err = json.Unmarshal(*v, &VMManagedDisks) + if err != nil { + return err + } + arid.VMManagedDisks = &VMManagedDisks + } + case "recoveryResourceGroupId": + if v != nil { + var recoveryResourceGroupID string + err = json.Unmarshal(*v, &recoveryResourceGroupID) + if err != nil { + return err + } + arid.RecoveryResourceGroupID = &recoveryResourceGroupID + } + case "protectionProfile": + if v != nil { + protectionProfile, err := unmarshalBasicProtectionProfileCustomDetails(*v) + if err != nil { + return err + } + arid.ProtectionProfile = protectionProfile + } + case "primaryStagingStorageAccount": + if v != nil { + primaryStagingStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + arid.PrimaryStagingStorageAccount = primaryStagingStorageAccount + } + case "recoveryAvailabilitySet": + if v != nil { + recoveryAvailabilitySet, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryAvailabilitySet = recoveryAvailabilitySet + } + case "recoveryVirtualNetwork": + if v != nil { + recoveryVirtualNetwork, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryVirtualNetwork = recoveryVirtualNetwork + } + case "recoveryProximityPlacementGroup": + if v != nil { + recoveryProximityPlacementGroup, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryProximityPlacementGroup = recoveryProximityPlacementGroup + } + case "autoProtectionOfDataDisk": + if v != nil { + var autoProtectionOfDataDisk AutoProtectionOfDataDisk + err = json.Unmarshal(*v, &autoProtectionOfDataDisk) + if err != nil { + return err + } + arid.AutoProtectionOfDataDisk = autoProtectionOfDataDisk + } + case "multiVmGroupName": + if v != nil { + var multiVMGroupName string + err = json.Unmarshal(*v, &multiVMGroupName) + if err != nil { + return err + } + arid.MultiVMGroupName = &multiVMGroupName + } + case "multiVmGroupId": + if v != nil { + var multiVMGroupID string + err = json.Unmarshal(*v, &multiVMGroupID) + if err != nil { + return err + } + arid.MultiVMGroupID = &multiVMGroupID + } + case "recoveryBootDiagStorageAccount": + if v != nil { + recoveryBootDiagStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryBootDiagStorageAccount = recoveryBootDiagStorageAccount + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + arid.DiskEncryptionInfo = &diskEncryptionInfo + } + case "recoveryAvailabilityZone": + if v != nil { + var recoveryAvailabilityZone string + err = json.Unmarshal(*v, &recoveryAvailabilityZone) + if err != nil { + return err + } + arid.RecoveryAvailabilityZone = &recoveryAvailabilityZone + } + case "recoveryAvailabilityType": + if v != nil { + var recoveryAvailabilityType string + err = json.Unmarshal(*v, &recoveryAvailabilityType) + if err != nil { + return err + } + arid.RecoveryAvailabilityType = &recoveryAvailabilityType + } + case "instanceType": + if v != nil { + var instanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings + err = json.Unmarshal(*v, &instanceType) + if err != nil { + return err + } + arid.InstanceType = instanceType + } + } + } + + return nil +} + +// A2AReprotectInput azure specific reprotect input. +type A2AReprotectInput struct { + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReprotectInput. +func (ari A2AReprotectInput) MarshalJSON() ([]byte, error) { + ari.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ari.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = ari.RecoveryContainerID + } + if ari.VMDisks != nil { + objectMap["vmDisks"] = ari.VMDisks + } + if ari.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = ari.RecoveryResourceGroupID + } + if ari.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = ari.RecoveryCloudServiceID + } + if ari.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = ari.RecoveryAvailabilitySetID + } + if ari.PolicyID != nil { + objectMap["policyId"] = ari.PolicyID + } + if ari.InstanceType != "" { + objectMap["instanceType"] = ari.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return &ari, true +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &ari, true +} + +// A2ASwitchProtectionInput a2A specific switch protection input. +type A2ASwitchProtectionInput struct { + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // RecoveryVirtualMachineScaleSetID - The virtual machine scale set id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput', 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicSwitchProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) MarshalJSON() ([]byte, error) { + aspi.InstanceType = InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aspi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = aspi.RecoveryContainerID + } + if aspi.VMDisks != nil { + objectMap["vmDisks"] = aspi.VMDisks + } + if aspi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aspi.VMManagedDisks + } + if aspi.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aspi.RecoveryResourceGroupID + } + if aspi.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aspi.RecoveryCloudServiceID + } + if aspi.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = aspi.RecoveryAvailabilitySetID + } + if aspi.PolicyID != nil { + objectMap["policyId"] = aspi.PolicyID + } + if aspi.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aspi.RecoveryBootDiagStorageAccountID + } + if aspi.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = aspi.RecoveryAvailabilityZone + } + if aspi.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aspi.RecoveryProximityPlacementGroupID + } + if aspi.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aspi.RecoveryVirtualMachineScaleSetID + } + if aspi.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aspi.DiskEncryptionInfo + } + if aspi.InstanceType != "" { + objectMap["instanceType"] = aspi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ASwitchProtectionInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) { + return &aspi, true +} + +// AsSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsBasicSwitchProtectionProviderSpecificInput() (BasicSwitchProtectionProviderSpecificInput, bool) { + return &aspi, true +} + +// A2ATestFailoverInput a2A provider specific input for test failover. +type A2ATestFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for TFO or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) MarshalJSON() ([]byte, error) { + atfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if atfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = atfi.RecoveryPointID + } + if atfi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = atfi.CloudServiceCreationOption + } + if atfi.InstanceType != "" { + objectMap["instanceType"] = atfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return &atfi, true +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &atfi, true +} + +// A2AUnplannedFailoverInput a2A provider specific input for unplanned failover. +type A2AUnplannedFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for failover or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + aufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = aufi.RecoveryPointID + } + if aufi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = aufi.CloudServiceCreationOption + } + if aufi.InstanceType != "" { + objectMap["instanceType"] = aufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return &aufi, true +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &aufi, true +} + +// A2AUnprotectedDiskDetails a2A unprotected disk details. +type A2AUnprotectedDiskDetails struct { + // DiskLunID - The source lun Id for the data disk. + DiskLunID *int32 `json:"diskLunId,omitempty"` + // DiskAutoProtectionStatus - A value indicating whether the disk auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + DiskAutoProtectionStatus AutoProtectionOfDataDisk `json:"diskAutoProtectionStatus,omitempty"` +} + +// A2AUpdateContainerMappingInput a2A update protection container mapping. +type A2AUpdateContainerMappingInput struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + aucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aucmi.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = aucmi.AgentAutoUpdateStatus + } + if aucmi.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = aucmi.AutomationAccountArmID + } + if aucmi.InstanceType != "" { + objectMap["instanceType"] = aucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return &aucmi, true +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &aucmi, true +} + +// A2AUpdateReplicationProtectedItemInput inMage Azure V2 input to update replication protected item. +type A2AUpdateReplicationProtectedItemInput struct { + // RecoveryCloudServiceID - The target cloud service ARM Id (for V1). + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryResourceGroupID - The target resource group ARM Id (for V2). + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ManagedDiskUpdateDetails - Managed disk update details. + ManagedDiskUpdateDetails *[]A2AVMManagedDiskUpdateDetails `json:"managedDiskUpdateDetails,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // DiskEncryptionInfo - The recovery os disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // TfoAzureVMName - The user given name for Test Failover VM. + TfoAzureVMName *string `json:"tfoAzureVMName,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // RecoveryVirtualMachineScaleSetID - The recovery virtual machine scale set Id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + aurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aurpii.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aurpii.RecoveryCloudServiceID + } + if aurpii.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aurpii.RecoveryResourceGroupID + } + if aurpii.ManagedDiskUpdateDetails != nil { + objectMap["managedDiskUpdateDetails"] = aurpii.ManagedDiskUpdateDetails + } + if aurpii.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aurpii.RecoveryBootDiagStorageAccountID + } + if aurpii.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aurpii.DiskEncryptionInfo + } + if aurpii.TfoAzureVMName != nil { + objectMap["tfoAzureVMName"] = aurpii.TfoAzureVMName + } + if aurpii.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aurpii.RecoveryProximityPlacementGroupID + } + if aurpii.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aurpii.RecoveryVirtualMachineScaleSetID + } + if aurpii.InstanceType != "" { + objectMap["instanceType"] = aurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return &aurpii, true +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &aurpii, true +} + +// A2AVMDiskInputDetails a2A disk input details. +type A2AVMDiskInputDetails struct { + // DiskURI - The disk Uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountID - The recovery VHD storage account Id. + RecoveryAzureStorageAccountID *string `json:"recoveryAzureStorageAccountId,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account Id. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` +} + +// A2AVMManagedDiskInputDetails a2A managed disk input details. +type A2AVMManagedDiskInputDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account Arm Id. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // RecoveryResourceGroupID - The target resource group Arm Id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for one / single pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` +} + +// A2AVMManagedDiskUpdateDetails a2A Vm managed disk update details. +type A2AVMManagedDiskUpdateDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type before failover. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type before failover. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // DiskEncryptionInfo - The recovery os disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // FailoverDiskName - The target disk name for unplanned failover operation. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The target disk name for test failover operation. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AZoneDetails zone details data. +type A2AZoneDetails struct { + // Source - Source zone info. + Source *string `json:"source,omitempty"` + // Target - The target zone info. + Target *string `json:"target,omitempty"` +} + +// AddDisksInput input for add disk(s) operation. +type AddDisksInput struct { + // Properties - Add disks input properties. + Properties *AddDisksInputProperties `json:"properties,omitempty"` +} + +// AddDisksInputProperties add Disks input properties. +type AddDisksInputProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicAddDisksProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AddDisksInputProperties struct. +func (adip *AddDisksInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicAddDisksProviderSpecificInput(*v) + if err != nil { + return err + } + adip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicAddDisksProviderSpecificInput add Disks provider specific input. +type BasicAddDisksProviderSpecificInput interface { + AsA2AAddDisksInput() (*A2AAddDisksInput, bool) + AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) +} + +// AddDisksProviderSpecificInput add Disks provider specific input. +type AddDisksProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeAddDisksProviderSpecificInput', 'InstanceTypeA2A' + InstanceType InstanceType `json:"instanceType,omitempty"` +} + +func unmarshalBasicAddDisksProviderSpecificInput(body []byte) (BasicAddDisksProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeA2A): + var aadi A2AAddDisksInput + err := json.Unmarshal(body, &aadi) + return aadi, err + default: + var adpsi AddDisksProviderSpecificInput + err := json.Unmarshal(body, &adpsi) + return adpsi, err + } +} +func unmarshalBasicAddDisksProviderSpecificInputArray(body []byte) ([]BasicAddDisksProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + adpsiArray := make([]BasicAddDisksProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + adpsi, err := unmarshalBasicAddDisksProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + adpsiArray[index] = adpsi + } + return adpsiArray, nil +} + +// MarshalJSON is the custom marshaler for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) MarshalJSON() ([]byte, error) { + adpsi.InstanceType = InstanceTypeAddDisksProviderSpecificInput + objectMap := make(map[string]interface{}) + if adpsi.InstanceType != "" { + objectMap["instanceType"] = adpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AAddDisksInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsA2AAddDisksInput() (*A2AAddDisksInput, bool) { + return nil, false +} + +// AsAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) { + return &adpsi, true +} + +// AsBasicAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsBasicAddDisksProviderSpecificInput() (BasicAddDisksProviderSpecificInput, bool) { + return &adpsi, true +} + +// AddRecoveryServicesProviderInput input required to add a provider. +type AddRecoveryServicesProviderInput struct { + // Properties - The properties of an add provider request. + Properties *AddRecoveryServicesProviderInputProperties `json:"properties,omitempty"` +} + +// AddRecoveryServicesProviderInputProperties the properties of an add provider request. +type AddRecoveryServicesProviderInputProperties struct { + // MachineName - The name of the machine where the provider is getting added. + MachineName *string `json:"machineName,omitempty"` + // MachineID - The Id of the machine where the provider is getting added. + MachineID *string `json:"machineId,omitempty"` + // BiosID - The Bios Id of the machine. + BiosID *string `json:"biosId,omitempty"` + // AuthenticationIdentityInput - The identity provider input for DRA authentication. + AuthenticationIdentityInput *IdentityProviderInput `json:"authenticationIdentityInput,omitempty"` + // ResourceAccessIdentityInput - The identity provider input for resource access. + ResourceAccessIdentityInput *IdentityProviderInput `json:"resourceAccessIdentityInput,omitempty"` + // DataPlaneAuthenticationIdentityInput - The identity provider input for data plane authentication. + DataPlaneAuthenticationIdentityInput *IdentityProviderInput `json:"dataPlaneAuthenticationIdentityInput,omitempty"` +} + +// AddVCenterRequest input required to add vCenter. +type AddVCenterRequest struct { + // Properties - The properties of an add vCenter request. + Properties *AddVCenterRequestProperties `json:"properties,omitempty"` +} + +// AddVCenterRequestProperties the properties of an add vCenter request. +type AddVCenterRequestProperties struct { + // FriendlyName - The friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the vCenter to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // ProcessServerID - The process server Id from where the discovery is orchestrated. + ProcessServerID *string `json:"processServerId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The account Id which has privileges to discover the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// AgentDetails agent details. +type AgentDetails struct { + // AgentID - READ-ONLY; The Id of the agent running on the server. + AgentID *string `json:"agentId,omitempty"` + // MachineID - READ-ONLY; The Id of the machine to which the agent is registered. + MachineID *string `json:"machineId,omitempty"` + // BiosID - READ-ONLY; The machine BIOS Id. + BiosID *string `json:"biosId,omitempty"` + // Fqdn - READ-ONLY; The machine FQDN. + Fqdn *string `json:"fqdn,omitempty"` + // Disks - READ-ONLY; The disks. + Disks *[]AgentDiskDetails `json:"disks,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentDetails. +func (ad AgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AgentDiskDetails agent disk details. +type AgentDiskDetails struct { + // DiskID - READ-ONLY; The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LunID - READ-ONLY; The lun of disk. + LunID *int32 `json:"lunId,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentDiskDetails. +func (add AgentDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Alert implements the Alert class. +type Alert struct { + autorest.Response `json:"-"` + // Properties - Alert related data. + Properties *AlertProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Alert. +func (a Alert) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.Properties != nil { + objectMap["properties"] = a.Properties + } + if a.Location != nil { + objectMap["location"] = a.Location + } + return json.Marshal(objectMap) +} + +// AlertCollection collection of alerts. +type AlertCollection struct { + autorest.Response `json:"-"` + // Value - The list of alerts. + Value *[]Alert `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// AlertCollectionIterator provides access to a complete listing of Alert values. +type AlertCollectionIterator struct { + i int + page AlertCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AlertCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AlertCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AlertCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AlertCollectionIterator) Response() AlertCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AlertCollectionIterator) Value() Alert { + if !iter.page.NotDone() { + return Alert{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AlertCollectionIterator type. +func NewAlertCollectionIterator(page AlertCollectionPage) AlertCollectionIterator { + return AlertCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ac AlertCollection) IsEmpty() bool { + return ac.Value == nil || len(*ac.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ac AlertCollection) hasNextLink() bool { + return ac.NextLink != nil && len(*ac.NextLink) != 0 +} + +// alertCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ac AlertCollection) alertCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ac.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ac.NextLink))) +} + +// AlertCollectionPage contains a page of Alert values. +type AlertCollectionPage struct { + fn func(context.Context, AlertCollection) (AlertCollection, error) + ac AlertCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AlertCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ac) + if err != nil { + return err + } + page.ac = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AlertCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AlertCollectionPage) NotDone() bool { + return !page.ac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AlertCollectionPage) Response() AlertCollection { + return page.ac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AlertCollectionPage) Values() []Alert { + if page.ac.IsEmpty() { + return nil + } + return *page.ac.Value +} + +// Creates a new instance of the AlertCollectionPage type. +func NewAlertCollectionPage(cur AlertCollection, getNextPage func(context.Context, AlertCollection) (AlertCollection, error)) AlertCollectionPage { + return AlertCollectionPage{ + fn: getNextPage, + ac: cur, + } +} + +// AlertProperties the properties of an alert. +type AlertProperties struct { + // SendToOwners - A value indicating whether to send email to subscription administrator. + SendToOwners *string `json:"sendToOwners,omitempty"` + // CustomEmailAddresses - The custom email address for sending emails. + CustomEmailAddresses *[]string `json:"customEmailAddresses,omitempty"` + // Locale - The locale for the email notification. + Locale *string `json:"locale,omitempty"` +} + +// ApplyRecoveryPointInput input to apply recovery point. +type ApplyRecoveryPointInput struct { + // Properties - The input properties to apply recovery point. + Properties *ApplyRecoveryPointInputProperties `json:"properties,omitempty"` +} + +// ApplyRecoveryPointInputProperties input properties to apply recovery point. +type ApplyRecoveryPointInputProperties struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // ProviderSpecificDetails - Provider specific input for applying recovery point. + ProviderSpecificDetails BasicApplyRecoveryPointProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ApplyRecoveryPointInputProperties struct. +func (arpip *ApplyRecoveryPointInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryPointId": + if v != nil { + var recoveryPointID string + err = json.Unmarshal(*v, &recoveryPointID) + if err != nil { + return err + } + arpip.RecoveryPointID = &recoveryPointID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicApplyRecoveryPointProviderSpecificInput(*v) + if err != nil { + return err + } + arpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicApplyRecoveryPointProviderSpecificInput provider specific input for apply recovery point. +type BasicApplyRecoveryPointProviderSpecificInput interface { + AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) + AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) + AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) + AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) + AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) + AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) +} + +// ApplyRecoveryPointProviderSpecificInput provider specific input for apply recovery point. +type ApplyRecoveryPointProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicApplyRecoveryPointProviderSpecificInput(body []byte) (BasicApplyRecoveryPointProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A): + var aarpi A2AApplyRecoveryPointInput + err := json.Unmarshal(body, &aarpi) + return aarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput + err := json.Unmarshal(body, &accmarpi) + return accmarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraarpi HyperVReplicaAzureApplyRecoveryPointInput + err := json.Unmarshal(body, &hvraarpi) + return hvraarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2): + var imavarpi InMageAzureV2ApplyRecoveryPointInput + err := json.Unmarshal(body, &imavarpi) + return imavarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm): + var imrarpi InMageRcmApplyRecoveryPointInput + err := json.Unmarshal(body, &imrarpi) + return imrarpi, err + default: + var arppsi ApplyRecoveryPointProviderSpecificInput + err := json.Unmarshal(body, &arppsi) + return arppsi, err + } +} +func unmarshalBasicApplyRecoveryPointProviderSpecificInputArray(body []byte) ([]BasicApplyRecoveryPointProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + arppsiArray := make([]BasicApplyRecoveryPointProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + arppsi, err := unmarshalBasicApplyRecoveryPointProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + arppsiArray[index] = arppsi + } + return arppsiArray, nil +} + +// MarshalJSON is the custom marshaler for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) MarshalJSON() ([]byte, error) { + arppsi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput + objectMap := make(map[string]interface{}) + if arppsi.InstanceType != "" { + objectMap["instanceType"] = arppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return &arppsi, true +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &arppsi, true +} + +// AsrJobDetails this class represents job details based on specific job type. +type AsrJobDetails struct { + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AsrJobDetails. +func (ajd AsrJobDetails) MarshalJSON() ([]byte, error) { + ajd.InstanceType = InstanceTypeAsrJobDetails + objectMap := make(map[string]interface{}) + if ajd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = ajd.AffectedObjectDetails + } + if ajd.InstanceType != "" { + objectMap["instanceType"] = ajd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return &ajd, true +} + +// AsExportJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &ajd, true +} + +// ASRTask task of the Job. +type ASRTask struct { + // TaskID - The Id. + TaskID *string `json:"taskId,omitempty"` + // Name - The unique Task name. + Name *string `json:"name,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // AllowedActions - The state/actions applicable on this task. + AllowedActions *[]string `json:"allowedActions,omitempty"` + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // State - The State. It is one of these values - NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or Other. + State *string `json:"state,omitempty"` + // StateDescription - The description of the task state. For example - For Succeeded state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. + StateDescription *string `json:"stateDescription,omitempty"` + // TaskType - The type of task. Details in CustomDetails property depend on this type. + TaskType *string `json:"taskType,omitempty"` + // CustomDetails - The custom task details based on the task type. + CustomDetails BasicTaskTypeDetails `json:"customDetails,omitempty"` + // GroupTaskCustomDetails - The custom task details based on the task type, if the task type is GroupTaskDetails or one of the types derived from it. + GroupTaskCustomDetails BasicGroupTaskDetails `json:"groupTaskCustomDetails,omitempty"` + // Errors - The task error details. + Errors *[]JobErrorDetails `json:"errors,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ASRTask struct. +func (at *ASRTask) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "taskId": + if v != nil { + var taskID string + err = json.Unmarshal(*v, &taskID) + if err != nil { + return err + } + at.TaskID = &taskID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + at.Name = &name + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + at.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + at.EndTime = &endTime + } + case "allowedActions": + if v != nil { + var allowedActions []string + err = json.Unmarshal(*v, &allowedActions) + if err != nil { + return err + } + at.AllowedActions = &allowedActions + } + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + at.FriendlyName = &friendlyName + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + at.State = &state + } + case "stateDescription": + if v != nil { + var stateDescription string + err = json.Unmarshal(*v, &stateDescription) + if err != nil { + return err + } + at.StateDescription = &stateDescription + } + case "taskType": + if v != nil { + var taskType string + err = json.Unmarshal(*v, &taskType) + if err != nil { + return err + } + at.TaskType = &taskType + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicTaskTypeDetails(*v) + if err != nil { + return err + } + at.CustomDetails = customDetails + } + case "groupTaskCustomDetails": + if v != nil { + groupTaskCustomDetails, err := unmarshalBasicGroupTaskDetails(*v) + if err != nil { + return err + } + at.GroupTaskCustomDetails = groupTaskCustomDetails + } + case "errors": + if v != nil { + var errorsVar []JobErrorDetails + err = json.Unmarshal(*v, &errorsVar) + if err != nil { + return err + } + at.Errors = &errorsVar + } + } + } + + return nil +} + +// AutomationRunbookTaskDetails this class represents the task details for an automation runbook. +type AutomationRunbookTaskDetails struct { + // Name - The recovery plan task name. + Name *string `json:"name,omitempty"` + // CloudServiceName - The cloud service of the automation runbook account. + CloudServiceName *string `json:"cloudServiceName,omitempty"` + // SubscriptionID - The subscription Id of the automation runbook account. + SubscriptionID *string `json:"subscriptionId,omitempty"` + // AccountName - The automation account name of the runbook. + AccountName *string `json:"accountName,omitempty"` + // RunbookID - The runbook Id. + RunbookID *string `json:"runbookId,omitempty"` + // RunbookName - The runbook name. + RunbookName *string `json:"runbookName,omitempty"` + // JobID - The job Id of the runbook execution. + JobID *string `json:"jobId,omitempty"` + // JobOutput - The execution output of the runbook. + JobOutput *string `json:"jobOutput,omitempty"` + // IsPrimarySideScript - A value indicating whether it is a primary side script or not. + IsPrimarySideScript *bool `json:"isPrimarySideScript,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) MarshalJSON() ([]byte, error) { + artd.InstanceType = InstanceTypeAutomationRunbookTaskDetails + objectMap := make(map[string]interface{}) + if artd.Name != nil { + objectMap["name"] = artd.Name + } + if artd.CloudServiceName != nil { + objectMap["cloudServiceName"] = artd.CloudServiceName + } + if artd.SubscriptionID != nil { + objectMap["subscriptionId"] = artd.SubscriptionID + } + if artd.AccountName != nil { + objectMap["accountName"] = artd.AccountName + } + if artd.RunbookID != nil { + objectMap["runbookId"] = artd.RunbookID + } + if artd.RunbookName != nil { + objectMap["runbookName"] = artd.RunbookName + } + if artd.JobID != nil { + objectMap["jobId"] = artd.JobID + } + if artd.JobOutput != nil { + objectMap["jobOutput"] = artd.JobOutput + } + if artd.IsPrimarySideScript != nil { + objectMap["isPrimarySideScript"] = artd.IsPrimarySideScript + } + if artd.InstanceType != "" { + objectMap["instanceType"] = artd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return &artd, true +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &artd, true +} + +// AzureFabricCreationInput fabric provider specific settings. +type AzureFabricCreationInput struct { + // Location - The Location. + Location *string `json:"location,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreationInput', 'InstanceTypeAzure', 'InstanceTypeInMageRcm', 'InstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) MarshalJSON() ([]byte, error) { + afci.InstanceType = InstanceTypeAzure + objectMap := make(map[string]interface{}) + if afci.Location != nil { + objectMap["location"] = afci.Location + } + if afci.InstanceType != "" { + objectMap["instanceType"] = afci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return &afci, true +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &afci, true +} + +// AzureFabricSpecificDetails azure Fabric Specific Details. +type AzureFabricSpecificDetails struct { + // Location - The Location for the Azure fabric. + Location *string `json:"location,omitempty"` + // ContainerIds - The container Ids for the Azure fabric. + ContainerIds *[]string `json:"containerIds,omitempty"` + // Zones - The zones. + Zones *[]A2AZoneDetails `json:"zones,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) MarshalJSON() ([]byte, error) { + afsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure + objectMap := make(map[string]interface{}) + if afsd.Location != nil { + objectMap["location"] = afsd.Location + } + if afsd.ContainerIds != nil { + objectMap["containerIds"] = afsd.ContainerIds + } + if afsd.Zones != nil { + objectMap["zones"] = afsd.Zones + } + if afsd.InstanceType != "" { + objectMap["instanceType"] = afsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return &afsd, true +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &afsd, true +} + +// AzureToAzureCreateNetworkMappingInput create network mappings input properties/behavior specific to +// Azure to Azure Network mapping. +type AzureToAzureCreateNetworkMappingInput struct { + // PrimaryNetworkID - The primary azure vnet Id. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + atacnmi.InstanceType = InstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if atacnmi.PrimaryNetworkID != nil { + objectMap["primaryNetworkId"] = atacnmi.PrimaryNetworkID + } + if atacnmi.InstanceType != "" { + objectMap["instanceType"] = atacnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return &atacnmi, true +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &atacnmi, true +} + +// AzureToAzureNetworkMappingSettings a2A Network Mapping fabric specific settings. +type AzureToAzureNetworkMappingSettings struct { + // PrimaryFabricLocation - The primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // RecoveryFabricLocation - The recovery fabric location. + RecoveryFabricLocation *string `json:"recoveryFabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) MarshalJSON() ([]byte, error) { + atanms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if atanms.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = atanms.PrimaryFabricLocation + } + if atanms.RecoveryFabricLocation != nil { + objectMap["recoveryFabricLocation"] = atanms.RecoveryFabricLocation + } + if atanms.InstanceType != "" { + objectMap["instanceType"] = atanms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return &atanms, true +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &atanms, true +} + +// AzureToAzureUpdateNetworkMappingInput updates network mappings input. +type AzureToAzureUpdateNetworkMappingInput struct { + // PrimaryNetworkID - The primary azure vnet Id. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + ataunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if ataunmi.PrimaryNetworkID != nil { + objectMap["primaryNetworkId"] = ataunmi.PrimaryNetworkID + } + if ataunmi.InstanceType != "" { + objectMap["instanceType"] = ataunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return &ataunmi, true +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &ataunmi, true +} + +// AzureToAzureVMSyncedConfigDetails azure to Azure VM synced configuration details. +type AzureToAzureVMSyncedConfigDetails struct { + // Tags - The Azure VM tags. + Tags map[string]*string `json:"tags"` + // InputEndpoints - The Azure VM input endpoints. + InputEndpoints *[]InputEndpoint `json:"inputEndpoints,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureVMSyncedConfigDetails. +func (atavscd AzureToAzureVMSyncedConfigDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if atavscd.Tags != nil { + objectMap["tags"] = atavscd.Tags + } + if atavscd.InputEndpoints != nil { + objectMap["inputEndpoints"] = atavscd.InputEndpoints + } + return json.Marshal(objectMap) +} + +// AzureVMDiskDetails disk details for E2A provider. +type AzureVMDiskDetails struct { + // VhdType - VHD type. + VhdType *string `json:"vhdType,omitempty"` + // VhdID - The VHD id. + VhdID *string `json:"vhdId,omitempty"` + // DiskID - The disk resource id. + DiskID *string `json:"diskId,omitempty"` + // VhdName - VHD name. + VhdName *string `json:"vhdName,omitempty"` + // MaxSizeMB - Max side in MB. + MaxSizeMB *string `json:"maxSizeMB,omitempty"` + // TargetDiskLocation - Blob uri of the Azure disk. + TargetDiskLocation *string `json:"targetDiskLocation,omitempty"` + // TargetDiskName - The target Azure disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` + // LunID - Ordinal\LunId of the disk for the Azure VM. + LunID *string `json:"lunId,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // CustomTargetDiskName - The custom target Azure disk name. + CustomTargetDiskName *string `json:"customTargetDiskName,omitempty"` +} + +// ComputeSizeErrorDetails represents the error used to indicate why the target compute size is not +// applicable. +type ComputeSizeErrorDetails struct { + // Message - The error message. + Message *string `json:"message,omitempty"` + // Severity - The severity of the error. + Severity *string `json:"severity,omitempty"` +} + +// BasicConfigurationSettings replication provider specific settings. +type BasicConfigurationSettings interface { + AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) + AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) + AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) + AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) + AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) + AsConfigurationSettings() (*ConfigurationSettings, bool) +} + +// ConfigurationSettings replication provider specific settings. +type ConfigurationSettings struct { + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicConfigurationSettings(body []byte) (BasicConfigurationSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeHyperVVirtualMachine): + var hvvmd HyperVVirtualMachineDetails + err := json.Unmarshal(body, &hvvmd) + return hvvmd, err + case string(InstanceTypeReplicationGroupDetails): + var rgd ReplicationGroupDetails + err := json.Unmarshal(body, &rgd) + return rgd, err + case string(InstanceTypeVmmVirtualMachine): + var vvmd VmmVirtualMachineDetails + err := json.Unmarshal(body, &vvmd) + return vvmd, err + case string(InstanceTypeVMwareVirtualMachine): + var vmvmd VMwareVirtualMachineDetails + err := json.Unmarshal(body, &vmvmd) + return vmvmd, err + default: + var cs ConfigurationSettings + err := json.Unmarshal(body, &cs) + return cs, err + } +} +func unmarshalBasicConfigurationSettingsArray(body []byte) ([]BasicConfigurationSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + csArray := make([]BasicConfigurationSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cs, err := unmarshalBasicConfigurationSettings(*rawMessage) + if err != nil { + return nil, err + } + csArray[index] = cs + } + return csArray, nil +} + +// MarshalJSON is the custom marshaler for ConfigurationSettings. +func (cs ConfigurationSettings) MarshalJSON() ([]byte, error) { + cs.InstanceType = InstanceTypeConfigurationSettings + objectMap := make(map[string]interface{}) + if cs.InstanceType != "" { + objectMap["instanceType"] = cs.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return &cs, true +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &cs, true +} + +// ConfigureAlertRequest request to configure alerts for the system. +type ConfigureAlertRequest struct { + // Properties - The properties of a configure alert request. + Properties *ConfigureAlertRequestProperties `json:"properties,omitempty"` +} + +// ConfigureAlertRequestProperties properties of a configure alert request. +type ConfigureAlertRequestProperties struct { + // SendToOwners - A value indicating whether to send email to subscription administrator. + SendToOwners *string `json:"sendToOwners,omitempty"` + // CustomEmailAddresses - The custom email address for sending emails. + CustomEmailAddresses *[]string `json:"customEmailAddresses,omitempty"` + // Locale - The locale for the email notification. + Locale *string `json:"locale,omitempty"` +} + +// ConsistencyCheckTaskDetails this class contains monitoring details of all the inconsistent Protected +// Entities in Vmm. +type ConsistencyCheckTaskDetails struct { + // VMDetails - The list of inconsistent Vm details. + VMDetails *[]InconsistentVMDetails `json:"vmDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) MarshalJSON() ([]byte, error) { + cctd.InstanceType = InstanceTypeConsistencyCheckTaskDetails + objectMap := make(map[string]interface{}) + if cctd.VMDetails != nil { + objectMap["vmDetails"] = cctd.VMDetails + } + if cctd.InstanceType != "" { + objectMap["instanceType"] = cctd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return &cctd, true +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &cctd, true +} + +// CreateNetworkMappingInput create network mappings input. +type CreateNetworkMappingInput struct { + // Properties - Input properties for creating network mapping. + Properties *CreateNetworkMappingInputProperties `json:"properties,omitempty"` +} + +// CreateNetworkMappingInputProperties common input details for network mapping operation. +type CreateNetworkMappingInputProperties struct { + // RecoveryFabricName - Recovery fabric Name. + RecoveryFabricName *string `json:"recoveryFabricName,omitempty"` + // RecoveryNetworkID - Recovery network Id. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // FabricSpecificDetails - Fabric specific input properties. + FabricSpecificDetails BasicFabricSpecificCreateNetworkMappingInput `json:"fabricSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateNetworkMappingInputProperties struct. +func (cnmip *CreateNetworkMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryFabricName": + if v != nil { + var recoveryFabricName string + err = json.Unmarshal(*v, &recoveryFabricName) + if err != nil { + return err + } + cnmip.RecoveryFabricName = &recoveryFabricName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + cnmip.RecoveryNetworkID = &recoveryNetworkID + } + case "fabricSpecificDetails": + if v != nil { + fabricSpecificDetails, err := unmarshalBasicFabricSpecificCreateNetworkMappingInput(*v) + if err != nil { + return err + } + cnmip.FabricSpecificDetails = fabricSpecificDetails + } + } + } + + return nil +} + +// CreatePolicyInput protection Policy input. +type CreatePolicyInput struct { + // Properties - Policy creation properties. + Properties *CreatePolicyInputProperties `json:"properties,omitempty"` +} + +// CreatePolicyInputProperties policy creation properties. +type CreatePolicyInputProperties struct { + // ProviderSpecificInput - The ReplicationProviderSettings. + ProviderSpecificInput BasicPolicyProviderSpecificInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreatePolicyInputProperties struct. +func (cpip *CreatePolicyInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicPolicyProviderSpecificInput(*v) + if err != nil { + return err + } + cpip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionContainerInput create protection container input. +type CreateProtectionContainerInput struct { + // Properties - Create protection container input properties. + Properties *CreateProtectionContainerInputProperties `json:"properties,omitempty"` +} + +// CreateProtectionContainerInputProperties create protection container input properties. +type CreateProtectionContainerInputProperties struct { + // ProviderSpecificInput - Provider specific inputs for container creation. + ProviderSpecificInput *[]BasicReplicationProviderSpecificContainerCreationInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionContainerInputProperties struct. +func (cpcip *CreateProtectionContainerInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificContainerCreationInputArray(*v) + if err != nil { + return err + } + cpcip.ProviderSpecificInput = &providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionContainerMappingInput configure pairing input. +type CreateProtectionContainerMappingInput struct { + // Properties - Configure protection input properties. + Properties *CreateProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// CreateProtectionContainerMappingInputProperties configure pairing input properties. +type CreateProtectionContainerMappingInputProperties struct { + // TargetProtectionContainerID - The target unique protection container name. + TargetProtectionContainerID *string `json:"targetProtectionContainerId,omitempty"` + // PolicyID - Applicable policy. + PolicyID *string `json:"policyId,omitempty"` + // ProviderSpecificInput - Provider specific input for pairing. + ProviderSpecificInput BasicReplicationProviderSpecificContainerMappingInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionContainerMappingInputProperties struct. +func (cpcmip *CreateProtectionContainerMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetProtectionContainerId": + if v != nil { + var targetProtectionContainerID string + err = json.Unmarshal(*v, &targetProtectionContainerID) + if err != nil { + return err + } + cpcmip.TargetProtectionContainerID = &targetProtectionContainerID + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + cpcmip.PolicyID = &policyID + } + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificContainerMappingInput(*v) + if err != nil { + return err + } + cpcmip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionIntentInput create protection intent input. +type CreateProtectionIntentInput struct { + // Properties - Create protection intent input properties. + Properties *CreateProtectionIntentProperties `json:"properties,omitempty"` +} + +// CreateProtectionIntentProperties create protection intent input properties. +type CreateProtectionIntentProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For A2A provider, it will be A2ACreateProtectionIntentInput object. + ProviderSpecificDetails BasicCreateProtectionIntentProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionIntentProperties struct. +func (cpip *CreateProtectionIntentProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicCreateProtectionIntentProviderSpecificDetails(*v) + if err != nil { + return err + } + cpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicCreateProtectionIntentProviderSpecificDetails create protection intent provider specific input. +type BasicCreateProtectionIntentProviderSpecificDetails interface { + AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) + AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) +} + +// CreateProtectionIntentProviderSpecificDetails create protection intent provider specific input. +type CreateProtectionIntentProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails', 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicCreateProtectionIntentProviderSpecificDetails(body []byte) (BasicCreateProtectionIntentProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A): + var acpii A2ACreateProtectionIntentInput + err := json.Unmarshal(body, &acpii) + return acpii, err + default: + var cpipsd CreateProtectionIntentProviderSpecificDetails + err := json.Unmarshal(body, &cpipsd) + return cpipsd, err + } +} +func unmarshalBasicCreateProtectionIntentProviderSpecificDetailsArray(body []byte) ([]BasicCreateProtectionIntentProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + cpipsdArray := make([]BasicCreateProtectionIntentProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cpipsd, err := unmarshalBasicCreateProtectionIntentProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + cpipsdArray[index] = cpipsd + } + return cpipsdArray, nil +} + +// MarshalJSON is the custom marshaler for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) MarshalJSON() ([]byte, error) { + cpipsd.InstanceType = InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails + objectMap := make(map[string]interface{}) + if cpipsd.InstanceType != "" { + objectMap["instanceType"] = cpipsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACreateProtectionIntentInput is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) { + return nil, false +} + +// AsCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) { + return &cpipsd, true +} + +// AsBasicCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsBasicCreateProtectionIntentProviderSpecificDetails() (BasicCreateProtectionIntentProviderSpecificDetails, bool) { + return &cpipsd, true +} + +// CreateRecoveryPlanInput create recovery plan input class. +type CreateRecoveryPlanInput struct { + // Properties - Recovery plan creation properties. + Properties *CreateRecoveryPlanInputProperties `json:"properties,omitempty"` +} + +// CreateRecoveryPlanInputProperties recovery plan creation properties. +type CreateRecoveryPlanInputProperties struct { + // PrimaryFabricID - The primary fabric Id. + PrimaryFabricID *string `json:"primaryFabricId,omitempty"` + // RecoveryFabricID - The recovery fabric Id. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // FailoverDeploymentModel - The failover deployment model. Possible values include: 'NotApplicable', 'Classic', 'ResourceManager' + FailoverDeploymentModel FailoverDeploymentModel `json:"failoverDeploymentModel,omitempty"` + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` + // ProviderSpecificInput - The provider specific input. + ProviderSpecificInput *[]BasicRecoveryPlanProviderSpecificInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateRecoveryPlanInputProperties struct. +func (crpip *CreateRecoveryPlanInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "primaryFabricId": + if v != nil { + var primaryFabricID string + err = json.Unmarshal(*v, &primaryFabricID) + if err != nil { + return err + } + crpip.PrimaryFabricID = &primaryFabricID + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + crpip.RecoveryFabricID = &recoveryFabricID + } + case "failoverDeploymentModel": + if v != nil { + var failoverDeploymentModel FailoverDeploymentModel + err = json.Unmarshal(*v, &failoverDeploymentModel) + if err != nil { + return err + } + crpip.FailoverDeploymentModel = failoverDeploymentModel + } + case "groups": + if v != nil { + var groups []RecoveryPlanGroup + err = json.Unmarshal(*v, &groups) + if err != nil { + return err + } + crpip.Groups = &groups + } + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicRecoveryPlanProviderSpecificInputArray(*v) + if err != nil { + return err + } + crpip.ProviderSpecificInput = &providerSpecificInput + } + } + } + + return nil +} + +// CurrentJobDetails current job details of the migration item. +type CurrentJobDetails struct { + // JobName - READ-ONLY; The job name. + JobName *string `json:"jobName,omitempty"` + // JobID - READ-ONLY; The ARM Id of the job being executed. + JobID *string `json:"jobId,omitempty"` + // StartTime - READ-ONLY; The start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for CurrentJobDetails. +func (cjd CurrentJobDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CurrentScenarioDetails current scenario details of the protected entity. +type CurrentScenarioDetails struct { + // ScenarioName - Scenario name. + ScenarioName *string `json:"scenarioName,omitempty"` + // JobID - ARM Id of the job being executed. + JobID *string `json:"jobId,omitempty"` + // StartTime - Start time of the workflow. + StartTime *date.Time `json:"startTime,omitempty"` +} + +// DataStore the datastore details of the MT. +type DataStore struct { + // SymbolicName - The symbolic name of data store. + SymbolicName *string `json:"symbolicName,omitempty"` + // UUID - The uuid of data store. + UUID *string `json:"uuid,omitempty"` + // Capacity - The capacity of data store in GBs. + Capacity *string `json:"capacity,omitempty"` + // FreeSpace - The free space of data store in GBs. + FreeSpace *string `json:"freeSpace,omitempty"` + // Type - The type of data store. + Type *string `json:"type,omitempty"` +} + +// DisableProtectionInput disable protection input. +type DisableProtectionInput struct { + // Properties - Disable protection input properties. + Properties *DisableProtectionInputProperties `json:"properties,omitempty"` +} + +// DisableProtectionInputProperties disable protection input properties. +type DisableProtectionInputProperties struct { + // DisableProtectionReason - Disable protection reason. It can have values NotSpecified/MigrationComplete. Possible values include: 'NotSpecified', 'MigrationComplete' + DisableProtectionReason DisableProtectionReason `json:"disableProtectionReason,omitempty"` + // ReplicationProviderInput - Replication provider specific input. + ReplicationProviderInput BasicDisableProtectionProviderSpecificInput `json:"replicationProviderInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DisableProtectionInputProperties struct. +func (dpip *DisableProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "disableProtectionReason": + if v != nil { + var disableProtectionReason DisableProtectionReason + err = json.Unmarshal(*v, &disableProtectionReason) + if err != nil { + return err + } + dpip.DisableProtectionReason = disableProtectionReason + } + case "replicationProviderInput": + if v != nil { + replicationProviderInput, err := unmarshalBasicDisableProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + dpip.ReplicationProviderInput = replicationProviderInput + } + } + } + + return nil +} + +// BasicDisableProtectionProviderSpecificInput disable protection provider specific input. +type BasicDisableProtectionProviderSpecificInput interface { + AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) + AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) +} + +// DisableProtectionProviderSpecificInput disable protection provider specific input. +type DisableProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeDisableProtectionProviderSpecificInput', 'InstanceTypeInMage' + InstanceType InstanceTypeBasicDisableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicDisableProtectionProviderSpecificInput(body []byte) (BasicDisableProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInMage): + var imdppsi InMageDisableProtectionProviderSpecificInput + err := json.Unmarshal(body, &imdppsi) + return imdppsi, err + default: + var dppsi DisableProtectionProviderSpecificInput + err := json.Unmarshal(body, &dppsi) + return dppsi, err + } +} +func unmarshalBasicDisableProtectionProviderSpecificInputArray(body []byte) ([]BasicDisableProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dppsiArray := make([]BasicDisableProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + dppsi, err := unmarshalBasicDisableProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + dppsiArray[index] = dppsi + } + return dppsiArray, nil +} + +// MarshalJSON is the custom marshaler for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + dppsi.InstanceType = InstanceTypeDisableProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if dppsi.InstanceType != "" { + objectMap["instanceType"] = dppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) { + return &dppsi, true +} + +// AsBasicDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsBasicDisableProtectionProviderSpecificInput() (BasicDisableProtectionProviderSpecificInput, bool) { + return &dppsi, true +} + +// DiscoverProtectableItemRequest request to add a physical machine as a protectable item in a container. +type DiscoverProtectableItemRequest struct { + // Properties - The properties of a discover protectable item request. + Properties *DiscoverProtectableItemRequestProperties `json:"properties,omitempty"` +} + +// DiscoverProtectableItemRequestProperties discover protectable item properties. +type DiscoverProtectableItemRequestProperties struct { + // FriendlyName - The friendly name of the physical machine. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the physical machine to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // OsType - The OS type on the physical machine. + OsType *string `json:"osType,omitempty"` +} + +// DiskDetails onprem disk details data. +type DiskDetails struct { + // MaxSizeMB - The hard disk max size in MB. + MaxSizeMB *int64 `json:"maxSizeMB,omitempty"` + // VhdType - The type of the volume. + VhdType *string `json:"vhdType,omitempty"` + // VhdID - The VHD Id. + VhdID *string `json:"vhdId,omitempty"` + // VhdName - The VHD name. + VhdName *string `json:"vhdName,omitempty"` +} + +// DiskEncryptionInfo recovery disk encryption info (BEK and KEK). +type DiskEncryptionInfo struct { + // DiskEncryptionKeyInfo - The recovery KeyVault reference for secret. + DiskEncryptionKeyInfo *DiskEncryptionKeyInfo `json:"diskEncryptionKeyInfo,omitempty"` + // KeyEncryptionKeyInfo - The recovery KeyVault reference for key. + KeyEncryptionKeyInfo *KeyEncryptionKeyInfo `json:"keyEncryptionKeyInfo,omitempty"` +} + +// DiskEncryptionKeyInfo disk Encryption Key Information (BitLocker Encryption Key (BEK) on Windows). +type DiskEncryptionKeyInfo struct { + // SecretIdentifier - The secret url / identifier. + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // KeyVaultResourceArmID - The KeyVault resource ARM id for secret. + KeyVaultResourceArmID *string `json:"keyVaultResourceArmId,omitempty"` +} + +// DiskVolumeDetails volume details. +type DiskVolumeDetails struct { + // Label - The volume label. + Label *string `json:"label,omitempty"` + // Name - The volume name. + Name *string `json:"name,omitempty"` +} + +// Display contains the localized display information for this particular operation / action. These value +// will be used by several clients for (1) custom role definitions for RBAC; (2) complex query filters for +// the event service; and (3) audit history / records for management operations. +type Display struct { + // Provider - The provider. The localized friendly form of the resource provider name - it is expected to also include the publisher/company responsible. It should use Title Casing and begin with "Microsoft" for 1st party services. e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". + Provider *string `json:"provider,omitempty"` + // Resource - The resource. The localized friendly form of the resource related to this action/operation - it should match the public documentation for the resource provider. It should use Title Casing. This value should be unique for a particular URL type (e.g. nested types should *not* reuse their parent's display.resource field). e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual Machine VM Sizes" or "Scheduler Jobs". + Resource *string `json:"resource,omitempty"` + // Operation - The operation. The localized friendly name for the operation, as it should be shown to the user. It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use Title Casing. Prescriptive guidance: Read Create or Update Delete 'ActionName'. + Operation *string `json:"operation,omitempty"` + // Description - The description. The localized friendly description for the operation, as it should be shown to the user. It should be thorough, yet concise - it will be used in tool tips and detailed views. Prescriptive guidance for namespaces: Read any 'display.provider' resource Create or Update any 'display.provider' resource Delete any 'display.provider' resource Perform any other action on any 'display.provider' resource Prescriptive guidance for namespaces: Read any 'display.resource' Create or Update any 'display.resource' Delete any 'display.resource' 'ActionName' any 'display.resources'. + Description *string `json:"description,omitempty"` +} + +// DraDetails DRA details. +type DraDetails struct { + // ID - READ-ONLY; The DRA Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The DRA name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The DRA Bios Id. + BiosID *string `json:"biosId,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the DRA. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // ForwardProtectedItemCount - READ-ONLY; The count of protected items which are protected in forward direction. + ForwardProtectedItemCount *int32 `json:"forwardProtectedItemCount,omitempty"` + // ReverseProtectedItemCount - READ-ONLY; The count of protected items which are protected in reverse direction. + ReverseProtectedItemCount *int32 `json:"reverseProtectedItemCount,omitempty"` +} + +// MarshalJSON is the custom marshaler for DraDetails. +func (dd DraDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// EnableMigrationInput enable migration input. +type EnableMigrationInput struct { + // Properties - Enable migration input properties. + Properties *EnableMigrationInputProperties `json:"properties,omitempty"` +} + +// EnableMigrationInputProperties enable migration input properties. +type EnableMigrationInputProperties struct { + // PolicyID - The policy Id. + PolicyID *string `json:"policyId,omitempty"` + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicEnableMigrationProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EnableMigrationInputProperties struct. +func (emip *EnableMigrationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + emip.PolicyID = &policyID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEnableMigrationProviderSpecificInput(*v) + if err != nil { + return err + } + emip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicEnableMigrationProviderSpecificInput enable migration provider specific input. +type BasicEnableMigrationProviderSpecificInput interface { + AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) + AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) +} + +// EnableMigrationProviderSpecificInput enable migration provider specific input. +type EnableMigrationProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeEnableMigrationProviderSpecificInput', 'InstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEnableMigrationProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicEnableMigrationProviderSpecificInput(body []byte) (BasicEnableMigrationProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeVMwareCbt): + var vmcemi VMwareCbtEnableMigrationInput + err := json.Unmarshal(body, &vmcemi) + return vmcemi, err + default: + var empsi EnableMigrationProviderSpecificInput + err := json.Unmarshal(body, &empsi) + return empsi, err + } +} +func unmarshalBasicEnableMigrationProviderSpecificInputArray(body []byte) ([]BasicEnableMigrationProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + empsiArray := make([]BasicEnableMigrationProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + empsi, err := unmarshalBasicEnableMigrationProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + empsiArray[index] = empsi + } + return empsiArray, nil +} + +// MarshalJSON is the custom marshaler for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) MarshalJSON() ([]byte, error) { + empsi.InstanceType = InstanceTypeEnableMigrationProviderSpecificInput + objectMap := make(map[string]interface{}) + if empsi.InstanceType != "" { + objectMap["instanceType"] = empsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtEnableMigrationInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) { + return nil, false +} + +// AsEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) { + return &empsi, true +} + +// AsBasicEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsBasicEnableMigrationProviderSpecificInput() (BasicEnableMigrationProviderSpecificInput, bool) { + return &empsi, true +} + +// EnableProtectionInput enable protection input. +type EnableProtectionInput struct { + // Properties - Enable protection input properties. + Properties *EnableProtectionInputProperties `json:"properties,omitempty"` +} + +// EnableProtectionInputProperties enable protection input properties. +type EnableProtectionInputProperties struct { + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // ProtectableItemID - The protectable item Id. + ProtectableItemID *string `json:"protectableItemId,omitempty"` + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicEnableProtectionProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EnableProtectionInputProperties struct. +func (epip *EnableProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + epip.PolicyID = &policyID + } + case "protectableItemId": + if v != nil { + var protectableItemID string + err = json.Unmarshal(*v, &protectableItemID) + if err != nil { + return err + } + epip.ProtectableItemID = &protectableItemID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEnableProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + epip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicEnableProtectionProviderSpecificInput enable protection provider specific input. +type BasicEnableProtectionProviderSpecificInput interface { + AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) + AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) + AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) + AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) + AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) + AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) + AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) +} + +// EnableProtectionProviderSpecificInput enable protection provider specific input. +type EnableProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicEnableProtectionProviderSpecificInput(body []byte) (BasicEnableProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmepi A2ACrossClusterMigrationEnableProtectionInput + err := json.Unmarshal(body, &accmepi) + return accmepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A): + var aepi A2AEnableProtectionInput + err := json.Unmarshal(body, &aepi) + return aepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraepi HyperVReplicaAzureEnableProtectionInput + err := json.Unmarshal(body, &hvraepi) + return hvraepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2): + var imavepi InMageAzureV2EnableProtectionInput + err := json.Unmarshal(body, &imavepi) + return imavepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage): + var imepi InMageEnableProtectionInput + err := json.Unmarshal(body, &imepi) + return imepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm): + var imrepi InMageRcmEnableProtectionInput + err := json.Unmarshal(body, &imrepi) + return imrepi, err + default: + var eppsi EnableProtectionProviderSpecificInput + err := json.Unmarshal(body, &eppsi) + return eppsi, err + } +} +func unmarshalBasicEnableProtectionProviderSpecificInputArray(body []byte) ([]BasicEnableProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + eppsiArray := make([]BasicEnableProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + eppsi, err := unmarshalBasicEnableProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + eppsiArray[index] = eppsi + } + return eppsiArray, nil +} + +// MarshalJSON is the custom marshaler for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + eppsi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if eppsi.InstanceType != "" { + objectMap["instanceType"] = eppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return &eppsi, true +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &eppsi, true +} + +// EncryptionDetails encryption details for the fabric. +type EncryptionDetails struct { + // KekState - The key encryption key state for the Vmm. + KekState *string `json:"kekState,omitempty"` + // KekCertThumbprint - The key encryption key certificate thumbprint. + KekCertThumbprint *string `json:"kekCertThumbprint,omitempty"` + // KekCertExpiryDate - The key encryption key certificate expiry date. + KekCertExpiryDate *date.Time `json:"kekCertExpiryDate,omitempty"` +} + +// Event implements the Event class. +type Event struct { + autorest.Response `json:"-"` + // Properties - Event related data. + Properties *EventProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Event. +func (e Event) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if e.Properties != nil { + objectMap["properties"] = e.Properties + } + if e.Location != nil { + objectMap["location"] = e.Location + } + return json.Marshal(objectMap) +} + +// EventCollection collection of fabric details. +type EventCollection struct { + autorest.Response `json:"-"` + // Value - The list of events. + Value *[]Event `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// EventCollectionIterator provides access to a complete listing of Event values. +type EventCollectionIterator struct { + i int + page EventCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *EventCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EventCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *EventCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EventCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter EventCollectionIterator) Response() EventCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter EventCollectionIterator) Value() Event { + if !iter.page.NotDone() { + return Event{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the EventCollectionIterator type. +func NewEventCollectionIterator(page EventCollectionPage) EventCollectionIterator { + return EventCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ec EventCollection) IsEmpty() bool { + return ec.Value == nil || len(*ec.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ec EventCollection) hasNextLink() bool { + return ec.NextLink != nil && len(*ec.NextLink) != 0 +} + +// eventCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ec EventCollection) eventCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ec.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ec.NextLink))) +} + +// EventCollectionPage contains a page of Event values. +type EventCollectionPage struct { + fn func(context.Context, EventCollection) (EventCollection, error) + ec EventCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *EventCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EventCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ec) + if err != nil { + return err + } + page.ec = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *EventCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EventCollectionPage) NotDone() bool { + return !page.ec.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EventCollectionPage) Response() EventCollection { + return page.ec +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EventCollectionPage) Values() []Event { + if page.ec.IsEmpty() { + return nil + } + return *page.ec.Value +} + +// Creates a new instance of the EventCollectionPage type. +func NewEventCollectionPage(cur EventCollection, getNextPage func(context.Context, EventCollection) (EventCollection, error)) EventCollectionPage { + return EventCollectionPage{ + fn: getNextPage, + ec: cur, + } +} + +// EventProperties the properties of a monitoring event. +type EventProperties struct { + // EventCode - The Id of the monitoring event. + EventCode *string `json:"eventCode,omitempty"` + // Description - The event name. + Description *string `json:"description,omitempty"` + // EventType - The type of the event. for example: VM Health, Server Health, Job Failure etc. + EventType *string `json:"eventType,omitempty"` + // AffectedObjectFriendlyName - The friendly name of the source of the event on which it is raised (for example, VM, VMM etc). + AffectedObjectFriendlyName *string `json:"affectedObjectFriendlyName,omitempty"` + // AffectedObjectCorrelationID - The affected object correlationId for the event. + AffectedObjectCorrelationID *string `json:"affectedObjectCorrelationId,omitempty"` + // Severity - The severity of the event. + Severity *string `json:"severity,omitempty"` + // TimeOfOccurrence - The time of occurrence of the event. + TimeOfOccurrence *date.Time `json:"timeOfOccurrence,omitempty"` + // FabricID - The ARM ID of the fabric. + FabricID *string `json:"fabricId,omitempty"` + // ProviderSpecificDetails - The provider specific settings. + ProviderSpecificDetails BasicEventProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` + // EventSpecificDetails - The event specific settings. + EventSpecificDetails BasicEventSpecificDetails `json:"eventSpecificDetails,omitempty"` + // HealthErrors - The list of errors / warnings capturing details associated with the issue(s). + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EventProperties struct. +func (ep *EventProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "eventCode": + if v != nil { + var eventCode string + err = json.Unmarshal(*v, &eventCode) + if err != nil { + return err + } + ep.EventCode = &eventCode + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ep.Description = &description + } + case "eventType": + if v != nil { + var eventType string + err = json.Unmarshal(*v, &eventType) + if err != nil { + return err + } + ep.EventType = &eventType + } + case "affectedObjectFriendlyName": + if v != nil { + var affectedObjectFriendlyName string + err = json.Unmarshal(*v, &affectedObjectFriendlyName) + if err != nil { + return err + } + ep.AffectedObjectFriendlyName = &affectedObjectFriendlyName + } + case "affectedObjectCorrelationId": + if v != nil { + var affectedObjectCorrelationID string + err = json.Unmarshal(*v, &affectedObjectCorrelationID) + if err != nil { + return err + } + ep.AffectedObjectCorrelationID = &affectedObjectCorrelationID + } + case "severity": + if v != nil { + var severity string + err = json.Unmarshal(*v, &severity) + if err != nil { + return err + } + ep.Severity = &severity + } + case "timeOfOccurrence": + if v != nil { + var timeOfOccurrence date.Time + err = json.Unmarshal(*v, &timeOfOccurrence) + if err != nil { + return err + } + ep.TimeOfOccurrence = &timeOfOccurrence + } + case "fabricId": + if v != nil { + var fabricID string + err = json.Unmarshal(*v, &fabricID) + if err != nil { + return err + } + ep.FabricID = &fabricID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEventProviderSpecificDetails(*v) + if err != nil { + return err + } + ep.ProviderSpecificDetails = providerSpecificDetails + } + case "eventSpecificDetails": + if v != nil { + eventSpecificDetails, err := unmarshalBasicEventSpecificDetails(*v) + if err != nil { + return err + } + ep.EventSpecificDetails = eventSpecificDetails + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + ep.HealthErrors = &healthErrors + } + } + } + + return nil +} + +// BasicEventProviderSpecificDetails model class for provider specific details for an event. +type BasicEventProviderSpecificDetails interface { + AsA2AEventDetails() (*A2AEventDetails, bool) + AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) + AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) + AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) + AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) + AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) + AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) + AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) + AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) + AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) +} + +// EventProviderSpecificDetails model class for provider specific details for an event. +type EventProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicEventProviderSpecificDetails(body []byte) (BasicEventProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A): + var aed A2AEventDetails + err := json.Unmarshal(body, &aed) + return aed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012): + var hvr2ed HyperVReplica2012EventDetails + err := json.Unmarshal(body, &hvr2ed) + return hvr2ed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2): + var hvr2ed HyperVReplica2012R2EventDetails + err := json.Unmarshal(body, &hvr2ed) + return hvr2ed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure): + var hvraed HyperVReplicaAzureEventDetails + err := json.Unmarshal(body, &hvraed) + return hvraed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails): + var hvrbed HyperVReplicaBaseEventDetails + err := json.Unmarshal(body, &hvrbed) + return hvrbed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2): + var imaved InMageAzureV2EventDetails + err := json.Unmarshal(body, &imaved) + return imaved, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm): + var imred InMageRcmEventDetails + err := json.Unmarshal(body, &imred) + return imred, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback): + var imrfed InMageRcmFailbackEventDetails + err := json.Unmarshal(body, &imrfed) + return imrfed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt): + var vmced VMwareCbtEventDetails + err := json.Unmarshal(body, &vmced) + return vmced, err + default: + var epsd EventProviderSpecificDetails + err := json.Unmarshal(body, &epsd) + return epsd, err + } +} +func unmarshalBasicEventProviderSpecificDetailsArray(body []byte) ([]BasicEventProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + epsdArray := make([]BasicEventProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + epsd, err := unmarshalBasicEventProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + epsdArray[index] = epsd + } + return epsdArray, nil +} + +// MarshalJSON is the custom marshaler for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) MarshalJSON() ([]byte, error) { + epsd.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails + objectMap := make(map[string]interface{}) + if epsd.InstanceType != "" { + objectMap["instanceType"] = epsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return &epsd, true +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &epsd, true +} + +// EventQueryParameter implements the event query parameter. +type EventQueryParameter struct { + // EventCode - The source id of the events to be queried. + EventCode *string `json:"eventCode,omitempty"` + // Severity - The severity of the events to be queried. + Severity *string `json:"severity,omitempty"` + // EventType - The type of the events to be queried. + EventType *string `json:"eventType,omitempty"` + // FabricName - The affected object server id of the events to be queried. + FabricName *string `json:"fabricName,omitempty"` + // AffectedObjectFriendlyName - The affected object name of the events to be queried. + AffectedObjectFriendlyName *string `json:"affectedObjectFriendlyName,omitempty"` + // AffectedObjectCorrelationID - The affected object correlationId for the events to be queried. + AffectedObjectCorrelationID *string `json:"affectedObjectCorrelationId,omitempty"` + // StartTime - The start time of the time range within which the events are to be queried. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time of the time range within which the events are to be queried. + EndTime *date.Time `json:"endTime,omitempty"` +} + +// BasicEventSpecificDetails model class for event specific details for an event. +type BasicEventSpecificDetails interface { + AsJobStatusEventDetails() (*JobStatusEventDetails, bool) + AsEventSpecificDetails() (*EventSpecificDetails, bool) +} + +// EventSpecificDetails model class for event specific details for an event. +type EventSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeEventSpecificDetails', 'InstanceTypeJobStatus' + InstanceType InstanceTypeBasicEventSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicEventSpecificDetails(body []byte) (BasicEventSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeJobStatus): + var jsed JobStatusEventDetails + err := json.Unmarshal(body, &jsed) + return jsed, err + default: + var esd EventSpecificDetails + err := json.Unmarshal(body, &esd) + return esd, err + } +} +func unmarshalBasicEventSpecificDetailsArray(body []byte) ([]BasicEventSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + esdArray := make([]BasicEventSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + esd, err := unmarshalBasicEventSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + esdArray[index] = esd + } + return esdArray, nil +} + +// MarshalJSON is the custom marshaler for EventSpecificDetails. +func (esd EventSpecificDetails) MarshalJSON() ([]byte, error) { + esd.InstanceType = InstanceTypeEventSpecificDetails + objectMap := make(map[string]interface{}) + if esd.InstanceType != "" { + objectMap["instanceType"] = esd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsJobStatusEventDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsJobStatusEventDetails() (*JobStatusEventDetails, bool) { + return nil, false +} + +// AsEventSpecificDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsEventSpecificDetails() (*EventSpecificDetails, bool) { + return &esd, true +} + +// AsBasicEventSpecificDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsBasicEventSpecificDetails() (BasicEventSpecificDetails, bool) { + return &esd, true +} + +// ExistingProtectionProfile existing storage account input. +type ExistingProtectionProfile struct { + // ProtectionProfileID - The protection profile Arm Id. Throw error, if resource does not exists. + ProtectionProfileID *string `json:"protectionProfileId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) MarshalJSON() ([]byte, error) { + epp.ResourceType = ResourceTypeExisting + objectMap := make(map[string]interface{}) + if epp.ProtectionProfileID != nil { + objectMap["protectionProfileId"] = epp.ProtectionProfileID + } + if epp.ResourceType != "" { + objectMap["resourceType"] = epp.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return &epp, true +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return nil, false +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return nil, false +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &epp, true +} + +// ExistingRecoveryAvailabilitySet existing recovery availability set input. +type ExistingRecoveryAvailabilitySet struct { + // RecoveryAvailabilitySetID - The recovery availability set Id. Will throw error, if resource does not exist. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails', 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryAvailabilitySetCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) MarshalJSON() ([]byte, error) { + eras.ResourceType = ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if eras.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = eras.RecoveryAvailabilitySetID + } + if eras.ResourceType != "" { + objectMap["resourceType"] = eras.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryAvailabilitySet is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) { + return &eras, true +} + +// AsRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsBasicRecoveryAvailabilitySetCustomDetails() (BasicRecoveryAvailabilitySetCustomDetails, bool) { + return &eras, true +} + +// ExistingRecoveryProximityPlacementGroup existing recovery proximity placement group input. +type ExistingRecoveryProximityPlacementGroup struct { + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. Will throw error, if resource does not exist. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails', 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) MarshalJSON() ([]byte, error) { + erppg.ResourceType = ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if erppg.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = erppg.RecoveryProximityPlacementGroupID + } + if erppg.ResourceType != "" { + objectMap["resourceType"] = erppg.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryProximityPlacementGroup is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) { + return &erppg, true +} + +// AsRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsBasicRecoveryProximityPlacementGroupCustomDetails() (BasicRecoveryProximityPlacementGroupCustomDetails, bool) { + return &erppg, true +} + +// ExistingRecoveryRecoveryResourceGroup existing recovery resource group input. +type ExistingRecoveryRecoveryResourceGroup struct { + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails', 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryResourceGroupCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) MarshalJSON() ([]byte, error) { + errrg.ResourceType = ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if errrg.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = errrg.RecoveryResourceGroupID + } + if errrg.ResourceType != "" { + objectMap["resourceType"] = errrg.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryRecoveryResourceGroup is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) { + return &errrg, true +} + +// AsRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsBasicRecoveryResourceGroupCustomDetails() (BasicRecoveryResourceGroupCustomDetails, bool) { + return &errrg, true +} + +// ExistingRecoveryVirtualNetwork existing recovery virtual network input. +type ExistingRecoveryVirtualNetwork struct { + // RecoveryVirtualNetworkID - The recovery virtual network Id. Will throw error, if resource does not exist. + RecoveryVirtualNetworkID *string `json:"recoveryVirtualNetworkId,omitempty"` + // RecoverySubnetName - The recovery subnet name. + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) MarshalJSON() ([]byte, error) { + ervn.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if ervn.RecoveryVirtualNetworkID != nil { + objectMap["recoveryVirtualNetworkId"] = ervn.RecoveryVirtualNetworkID + } + if ervn.RecoverySubnetName != nil { + objectMap["recoverySubnetName"] = ervn.RecoverySubnetName + } + if ervn.ResourceType != "" { + objectMap["resourceType"] = ervn.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return &ervn, true +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &ervn, true +} + +// ExistingStorageAccount existing storage account input. +type ExistingStorageAccount struct { + // AzureStorageAccountID - The storage account Arm Id. Throw error, if resource does not exists. + AzureStorageAccountID *string `json:"azureStorageAccountId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails', 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicStorageAccountCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingStorageAccount. +func (esa ExistingStorageAccount) MarshalJSON() ([]byte, error) { + esa.ResourceType = ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if esa.AzureStorageAccountID != nil { + objectMap["azureStorageAccountId"] = esa.AzureStorageAccountID + } + if esa.ResourceType != "" { + objectMap["resourceType"] = esa.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingStorageAccount is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsExistingStorageAccount() (*ExistingStorageAccount, bool) { + return &esa, true +} + +// AsStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) { + return nil, false +} + +// AsBasicStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsBasicStorageAccountCustomDetails() (BasicStorageAccountCustomDetails, bool) { + return &esa, true +} + +// ExportJobDetails this class represents details for export jobs workflow. +type ExportJobDetails struct { + // BlobURI - BlobUri of the exported jobs. + BlobURI *string `json:"blobUri,omitempty"` + // SasToken - The sas token to access blob. + SasToken *string `json:"sasToken,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExportJobDetails. +func (ejd ExportJobDetails) MarshalJSON() ([]byte, error) { + ejd.InstanceType = InstanceTypeExportJobDetails + objectMap := make(map[string]interface{}) + if ejd.BlobURI != nil { + objectMap["blobUri"] = ejd.BlobURI + } + if ejd.SasToken != nil { + objectMap["sasToken"] = ejd.SasToken + } + if ejd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = ejd.AffectedObjectDetails + } + if ejd.InstanceType != "" { + objectMap["instanceType"] = ejd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return &ejd, true +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &ejd, true +} + +// Fabric fabric definition. +type Fabric struct { + autorest.Response `json:"-"` + // Properties - Fabric related data. + Properties *FabricProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Fabric. +func (f Fabric) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if f.Properties != nil { + objectMap["properties"] = f.Properties + } + if f.Location != nil { + objectMap["location"] = f.Location + } + return json.Marshal(objectMap) +} + +// FabricCollection collection of fabric details. +type FabricCollection struct { + autorest.Response `json:"-"` + // Value - The fabric details. + Value *[]Fabric `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// FabricCollectionIterator provides access to a complete listing of Fabric values. +type FabricCollectionIterator struct { + i int + page FabricCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *FabricCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FabricCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *FabricCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter FabricCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter FabricCollectionIterator) Response() FabricCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter FabricCollectionIterator) Value() Fabric { + if !iter.page.NotDone() { + return Fabric{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the FabricCollectionIterator type. +func NewFabricCollectionIterator(page FabricCollectionPage) FabricCollectionIterator { + return FabricCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (fc FabricCollection) IsEmpty() bool { + return fc.Value == nil || len(*fc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (fc FabricCollection) hasNextLink() bool { + return fc.NextLink != nil && len(*fc.NextLink) != 0 +} + +// fabricCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (fc FabricCollection) fabricCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !fc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(fc.NextLink))) +} + +// FabricCollectionPage contains a page of Fabric values. +type FabricCollectionPage struct { + fn func(context.Context, FabricCollection) (FabricCollection, error) + fc FabricCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *FabricCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FabricCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.fc) + if err != nil { + return err + } + page.fc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *FabricCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page FabricCollectionPage) NotDone() bool { + return !page.fc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page FabricCollectionPage) Response() FabricCollection { + return page.fc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page FabricCollectionPage) Values() []Fabric { + if page.fc.IsEmpty() { + return nil + } + return *page.fc.Value +} + +// Creates a new instance of the FabricCollectionPage type. +func NewFabricCollectionPage(cur FabricCollection, getNextPage func(context.Context, FabricCollection) (FabricCollection, error)) FabricCollectionPage { + return FabricCollectionPage{ + fn: getNextPage, + fc: cur, + } +} + +// FabricCreationInput site details provided during the time of site creation. +type FabricCreationInput struct { + // Properties - Fabric creation input. + Properties *FabricCreationInputProperties `json:"properties,omitempty"` +} + +// FabricCreationInputProperties properties of site details provided during the time of site creation. +type FabricCreationInputProperties struct { + // CustomDetails - Fabric provider specific creation input. + CustomDetails BasicFabricSpecificCreationInput `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for FabricCreationInputProperties struct. +func (fcip *FabricCreationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicFabricSpecificCreationInput(*v) + if err != nil { + return err + } + fcip.CustomDetails = customDetails + } + } + } + + return nil +} + +// FabricProperties fabric properties. +type FabricProperties struct { + // FriendlyName - Friendly name of the fabric. + FriendlyName *string `json:"friendlyName,omitempty"` + // EncryptionDetails - Encryption details for the fabric. + EncryptionDetails *EncryptionDetails `json:"encryptionDetails,omitempty"` + // RolloverEncryptionDetails - Rollover encryption details for the fabric. + RolloverEncryptionDetails *EncryptionDetails `json:"rolloverEncryptionDetails,omitempty"` + // InternalIdentifier - Dra Registration Id. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // BcdrState - BCDR state of the fabric. + BcdrState *string `json:"bcdrState,omitempty"` + // CustomDetails - Fabric specific settings. + CustomDetails BasicFabricSpecificDetails `json:"customDetails,omitempty"` + // HealthErrorDetails - Fabric health error details. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // Health - Health of fabric. + Health *string `json:"health,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for FabricProperties struct. +func (fp *FabricProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + fp.FriendlyName = &friendlyName + } + case "encryptionDetails": + if v != nil { + var encryptionDetails EncryptionDetails + err = json.Unmarshal(*v, &encryptionDetails) + if err != nil { + return err + } + fp.EncryptionDetails = &encryptionDetails + } + case "rolloverEncryptionDetails": + if v != nil { + var rolloverEncryptionDetails EncryptionDetails + err = json.Unmarshal(*v, &rolloverEncryptionDetails) + if err != nil { + return err + } + fp.RolloverEncryptionDetails = &rolloverEncryptionDetails + } + case "internalIdentifier": + if v != nil { + var internalIdentifier string + err = json.Unmarshal(*v, &internalIdentifier) + if err != nil { + return err + } + fp.InternalIdentifier = &internalIdentifier + } + case "bcdrState": + if v != nil { + var bcdrState string + err = json.Unmarshal(*v, &bcdrState) + if err != nil { + return err + } + fp.BcdrState = &bcdrState + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicFabricSpecificDetails(*v) + if err != nil { + return err + } + fp.CustomDetails = customDetails + } + case "healthErrorDetails": + if v != nil { + var healthErrorDetails []HealthError + err = json.Unmarshal(*v, &healthErrorDetails) + if err != nil { + return err + } + fp.HealthErrorDetails = &healthErrorDetails + } + case "health": + if v != nil { + var health string + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + fp.Health = &health + } + } + } + + return nil +} + +// FabricQueryParameter query parameter to get fabric. +type FabricQueryParameter struct { + // ZoneToZoneMappings - A value indicating whether the zone to zone mappings are to be returned. + ZoneToZoneMappings *string `json:"zoneToZoneMappings,omitempty"` + // FetchAgentDetails - A value indicating whether the agent details are to be fetched. + FetchAgentDetails *string `json:"fetchAgentDetails,omitempty"` + // BiosID - The BIOS Id to be used for fetching agent details. + BiosID *string `json:"biosId,omitempty"` + // Fqdn - The FQDN to be used for fetching agent details. + Fqdn *string `json:"fqdn,omitempty"` + // DiscoveryType - The type of the discovered machine to be used for fetching agent details. + DiscoveryType *string `json:"discoveryType,omitempty"` + // OsType - The OS type to be used for fetching agent details. + OsType *string `json:"osType,omitempty"` +} + +// FabricReplicationGroupTaskDetails this class represents the fabric replication group task details. +type FabricReplicationGroupTaskDetails struct { + // SkippedReason - The skipped reason. + SkippedReason *string `json:"skippedReason,omitempty"` + // SkippedReasonString - The skipped reason string. + SkippedReasonString *string `json:"skippedReasonString,omitempty"` + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) MarshalJSON() ([]byte, error) { + frgtd.InstanceType = InstanceTypeFabricReplicationGroupTaskDetails + objectMap := make(map[string]interface{}) + if frgtd.SkippedReason != nil { + objectMap["skippedReason"] = frgtd.SkippedReason + } + if frgtd.SkippedReasonString != nil { + objectMap["skippedReasonString"] = frgtd.SkippedReasonString + } + if frgtd.JobTask != nil { + objectMap["jobTask"] = frgtd.JobTask + } + if frgtd.InstanceType != "" { + objectMap["instanceType"] = frgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return &frgtd, true +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &frgtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &frgtd, true +} + +// BasicFabricSpecificCreateNetworkMappingInput input details specific to fabrics during Network Mapping. +type BasicFabricSpecificCreateNetworkMappingInput interface { + AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) + AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) + AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) + AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) +} + +// FabricSpecificCreateNetworkMappingInput input details specific to fabrics during Network Mapping. +type FabricSpecificCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificCreateNetworkMappingInput(body []byte) (BasicFabricSpecificCreateNetworkMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAzureToAzure): + var atacnmi AzureToAzureCreateNetworkMappingInput + err := json.Unmarshal(body, &atacnmi) + return atacnmi, err + case string(InstanceTypeVmmToAzure): + var vtacnmi VmmToAzureCreateNetworkMappingInput + err := json.Unmarshal(body, &vtacnmi) + return vtacnmi, err + case string(InstanceTypeVmmToVmm): + var vtvcnmi VmmToVmmCreateNetworkMappingInput + err := json.Unmarshal(body, &vtvcnmi) + return vtvcnmi, err + default: + var fscnmi FabricSpecificCreateNetworkMappingInput + err := json.Unmarshal(body, &fscnmi) + return fscnmi, err + } +} +func unmarshalBasicFabricSpecificCreateNetworkMappingInputArray(body []byte) ([]BasicFabricSpecificCreateNetworkMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fscnmiArray := make([]BasicFabricSpecificCreateNetworkMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fscnmi, err := unmarshalBasicFabricSpecificCreateNetworkMappingInput(*rawMessage) + if err != nil { + return nil, err + } + fscnmiArray[index] = fscnmi + } + return fscnmiArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + fscnmi.InstanceType = InstanceTypeFabricSpecificCreateNetworkMappingInput + objectMap := make(map[string]interface{}) + if fscnmi.InstanceType != "" { + objectMap["instanceType"] = fscnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return &fscnmi, true +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &fscnmi, true +} + +// BasicFabricSpecificCreationInput fabric provider specific settings. +type BasicFabricSpecificCreationInput interface { + AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) + AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) + AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) + AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) +} + +// FabricSpecificCreationInput fabric provider specific settings. +type FabricSpecificCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreationInput', 'InstanceTypeAzure', 'InstanceTypeInMageRcm', 'InstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificCreationInput(body []byte) (BasicFabricSpecificCreationInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAzure): + var afci AzureFabricCreationInput + err := json.Unmarshal(body, &afci) + return afci, err + case string(InstanceTypeInMageRcm): + var imrfci InMageRcmFabricCreationInput + err := json.Unmarshal(body, &imrfci) + return imrfci, err + case string(InstanceTypeVMwareV2): + var vmvfci VMwareV2FabricCreationInput + err := json.Unmarshal(body, &vmvfci) + return vmvfci, err + default: + var fsci FabricSpecificCreationInput + err := json.Unmarshal(body, &fsci) + return fsci, err + } +} +func unmarshalBasicFabricSpecificCreationInputArray(body []byte) ([]BasicFabricSpecificCreationInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsciArray := make([]BasicFabricSpecificCreationInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsci, err := unmarshalBasicFabricSpecificCreationInput(*rawMessage) + if err != nil { + return nil, err + } + fsciArray[index] = fsci + } + return fsciArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) MarshalJSON() ([]byte, error) { + fsci.InstanceType = InstanceTypeFabricSpecificCreationInput + objectMap := make(map[string]interface{}) + if fsci.InstanceType != "" { + objectMap["instanceType"] = fsci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return &fsci, true +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &fsci, true +} + +// BasicFabricSpecificDetails fabric specific details. +type BasicFabricSpecificDetails interface { + AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) + AsHyperVSiteDetails() (*HyperVSiteDetails, bool) + AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) + AsVmmDetails() (*VmmDetails, bool) + AsVMwareDetails() (*VMwareDetails, bool) + AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) + AsFabricSpecificDetails() (*FabricSpecificDetails, bool) +} + +// FabricSpecificDetails fabric specific details. +type FabricSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificDetails(body []byte) (BasicFabricSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure): + var afsd AzureFabricSpecificDetails + err := json.Unmarshal(body, &afsd) + return afsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite): + var hvsd HyperVSiteDetails + err := json.Unmarshal(body, &hvsd) + return hvsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm): + var imrfsd InMageRcmFabricSpecificDetails + err := json.Unmarshal(body, &imrfsd) + return imrfsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM): + var vd VmmDetails + err := json.Unmarshal(body, &vd) + return vd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware): + var vmd VMwareDetails + err := json.Unmarshal(body, &vmd) + return vmd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2): + var vmvfsd VMwareV2FabricSpecificDetails + err := json.Unmarshal(body, &vmvfsd) + return vmvfsd, err + default: + var fsd FabricSpecificDetails + err := json.Unmarshal(body, &fsd) + return fsd, err + } +} +func unmarshalBasicFabricSpecificDetailsArray(body []byte) ([]BasicFabricSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsdArray := make([]BasicFabricSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsd, err := unmarshalBasicFabricSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + fsdArray[index] = fsd + } + return fsdArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificDetails. +func (fsd FabricSpecificDetails) MarshalJSON() ([]byte, error) { + fsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails + objectMap := make(map[string]interface{}) + if fsd.InstanceType != "" { + objectMap["instanceType"] = fsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return &fsd, true +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &fsd, true +} + +// BasicFabricSpecificUpdateNetworkMappingInput input details specific to fabrics during Network Mapping. +type BasicFabricSpecificUpdateNetworkMappingInput interface { + AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) + AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) + AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) + AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) +} + +// FabricSpecificUpdateNetworkMappingInput input details specific to fabrics during Network Mapping. +type FabricSpecificUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificUpdateNetworkMappingInput(body []byte) (BasicFabricSpecificUpdateNetworkMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure): + var ataunmi AzureToAzureUpdateNetworkMappingInput + err := json.Unmarshal(body, &ataunmi) + return ataunmi, err + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure): + var vtaunmi VmmToAzureUpdateNetworkMappingInput + err := json.Unmarshal(body, &vtaunmi) + return vtaunmi, err + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm): + var vtvunmi VmmToVmmUpdateNetworkMappingInput + err := json.Unmarshal(body, &vtvunmi) + return vtvunmi, err + default: + var fsunmi FabricSpecificUpdateNetworkMappingInput + err := json.Unmarshal(body, &fsunmi) + return fsunmi, err + } +} +func unmarshalBasicFabricSpecificUpdateNetworkMappingInputArray(body []byte) ([]BasicFabricSpecificUpdateNetworkMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsunmiArray := make([]BasicFabricSpecificUpdateNetworkMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsunmi, err := unmarshalBasicFabricSpecificUpdateNetworkMappingInput(*rawMessage) + if err != nil { + return nil, err + } + fsunmiArray[index] = fsunmi + } + return fsunmiArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + fsunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput + objectMap := make(map[string]interface{}) + if fsunmi.InstanceType != "" { + objectMap["instanceType"] = fsunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return &fsunmi, true +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &fsunmi, true +} + +// FailoverJobDetails this class represents the details for a failover job. +type FailoverJobDetails struct { + // ProtectedItemDetails - The test VM details. + ProtectedItemDetails *[]FailoverReplicationProtectedItemDetails `json:"protectedItemDetails,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for FailoverJobDetails. +func (fjd FailoverJobDetails) MarshalJSON() ([]byte, error) { + fjd.InstanceType = InstanceTypeFailoverJobDetails + objectMap := make(map[string]interface{}) + if fjd.ProtectedItemDetails != nil { + objectMap["protectedItemDetails"] = fjd.ProtectedItemDetails + } + if fjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = fjd.AffectedObjectDetails + } + if fjd.InstanceType != "" { + objectMap["instanceType"] = fjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return &fjd, true +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &fjd, true +} + +// FailoverProcessServerRequest request to failover a process server. +type FailoverProcessServerRequest struct { + // Properties - The properties of the PS Failover request. + Properties *FailoverProcessServerRequestProperties `json:"properties,omitempty"` +} + +// FailoverProcessServerRequestProperties the properties of the Failover Process Server request. +type FailoverProcessServerRequestProperties struct { + // ContainerName - The container identifier. + ContainerName *string `json:"containerName,omitempty"` + // SourceProcessServerID - The source process server. + SourceProcessServerID *string `json:"sourceProcessServerId,omitempty"` + // TargetProcessServerID - The new process server. + TargetProcessServerID *string `json:"targetProcessServerId,omitempty"` + // VmsToMigrate - The VMS to migrate. + VmsToMigrate *[]string `json:"vmsToMigrate,omitempty"` + // UpdateType - A value for failover type. It can be systemlevel/serverlevel. + UpdateType *string `json:"updateType,omitempty"` +} + +// FailoverReplicationProtectedItemDetails failover details for a replication protected item. +type FailoverReplicationProtectedItemDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // FriendlyName - The friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // TestVMName - The test Vm name. + TestVMName *string `json:"testVmName,omitempty"` + // TestVMFriendlyName - The test Vm friendly name. + TestVMFriendlyName *string `json:"testVmFriendlyName,omitempty"` + // NetworkConnectionStatus - The network connection status. + NetworkConnectionStatus *string `json:"networkConnectionStatus,omitempty"` + // NetworkFriendlyName - The network friendly name. + NetworkFriendlyName *string `json:"networkFriendlyName,omitempty"` + // Subnet - The network subnet. + Subnet *string `json:"subnet,omitempty"` + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // RecoveryPointTime - The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` +} + +// BasicGroupTaskDetails this class represents the group task details when parent child relationship exists in the +// drill down. +type BasicGroupTaskDetails interface { + AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) + AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) + AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) + AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) + AsGroupTaskDetails() (*GroupTaskDetails, bool) +} + +// GroupTaskDetails this class represents the group task details when parent child relationship exists in the +// drill down. +type GroupTaskDetails struct { + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicGroupTaskDetails(body []byte) (BasicGroupTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInlineWorkflowTaskDetails): + var iwtd InlineWorkflowTaskDetails + err := json.Unmarshal(body, &iwtd) + return iwtd, err + case string(InstanceTypeRecoveryPlanGroupTaskDetails): + var rpgtd RecoveryPlanGroupTaskDetails + err := json.Unmarshal(body, &rpgtd) + return rpgtd, err + case string(InstanceTypeRecoveryPlanShutdownGroupTaskDetails): + var rpsgtd RecoveryPlanShutdownGroupTaskDetails + err := json.Unmarshal(body, &rpsgtd) + return rpsgtd, err + default: + var gtd GroupTaskDetails + err := json.Unmarshal(body, >d) + return gtd, err + } +} +func unmarshalBasicGroupTaskDetailsArray(body []byte) ([]BasicGroupTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + gtdArray := make([]BasicGroupTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + gtd, err := unmarshalBasicGroupTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + gtdArray[index] = gtd + } + return gtdArray, nil +} + +// MarshalJSON is the custom marshaler for GroupTaskDetails. +func (gtd GroupTaskDetails) MarshalJSON() ([]byte, error) { + gtd.InstanceType = InstanceTypeGroupTaskDetails + objectMap := make(map[string]interface{}) + if gtd.ChildTasks != nil { + objectMap["childTasks"] = gtd.ChildTasks + } + if gtd.InstanceType != "" { + objectMap["instanceType"] = gtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return >d, true +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return >d, true +} + +// HealthError health Error. +type HealthError struct { + // InnerHealthErrors - The inner health errors. HealthError having a list of HealthError as child errors is problematic. InnerHealthError is used because this will prevent an infinite loop of structures when Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health errors and all API consumers can utilize this in the same fashion as Exception -> InnerException. + InnerHealthErrors *[]InnerHealthError `json:"innerHealthErrors,omitempty"` + // ErrorSource - Source of error. + ErrorSource *string `json:"errorSource,omitempty"` + // ErrorType - Type of error. + ErrorType *string `json:"errorType,omitempty"` + // ErrorLevel - Level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // ErrorCategory - Category of error. + ErrorCategory *string `json:"errorCategory,omitempty"` + // ErrorCode - Error code. + ErrorCode *string `json:"errorCode,omitempty"` + // SummaryMessage - Summary message of the entity. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // ErrorMessage - Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // CreationTimeUtc - Error creation time (UTC). + CreationTimeUtc *date.Time `json:"creationTimeUtc,omitempty"` + // RecoveryProviderErrorMessage - DRA error message. + RecoveryProviderErrorMessage *string `json:"recoveryProviderErrorMessage,omitempty"` + // EntityID - ID of the entity. + EntityID *string `json:"entityId,omitempty"` + // ErrorID - The health error unique id. + ErrorID *string `json:"errorId,omitempty"` + // CustomerResolvability - Value indicating whether the health error is customer resolvable. Possible values include: 'Allowed', 'NotAllowed' + CustomerResolvability HealthErrorCustomerResolvability `json:"customerResolvability,omitempty"` +} + +// HealthErrorSummary class to define the summary of the health error details. +type HealthErrorSummary struct { + // SummaryCode - The code of the health error. + SummaryCode *string `json:"summaryCode,omitempty"` + // Category - The category of the health error. Possible values include: 'HealthErrorCategoryNone', 'HealthErrorCategoryReplication', 'HealthErrorCategoryTestFailover', 'HealthErrorCategoryConfiguration', 'HealthErrorCategoryFabricInfrastructure', 'HealthErrorCategoryVersionExpiry', 'HealthErrorCategoryAgentAutoUpdateInfra', 'HealthErrorCategoryAgentAutoUpdateArtifactDeleted', 'HealthErrorCategoryAgentAutoUpdateRunAsAccount', 'HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry', 'HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired' + Category HealthErrorCategory `json:"category,omitempty"` + // Severity - Severity of error. Possible values include: 'NONE', 'Warning', 'Error', 'Info' + Severity Severity `json:"severity,omitempty"` + // SummaryMessage - The summary message of the health error. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // AffectedResourceType - The type of affected ARM resource. + AffectedResourceType *string `json:"affectedResourceType,omitempty"` + // AffectedResourceSubtype - The sub type of any subcomponent within the ARM resource that this might be applicable. Value remains null if not applicable. + AffectedResourceSubtype *string `json:"affectedResourceSubtype,omitempty"` + // AffectedResourceCorrelationIds - The list of affected resource correlation Ids. This can be used to uniquely identify the count of items affected by a specific category and severity as well as count of item affected by an specific issue. + AffectedResourceCorrelationIds *[]string `json:"affectedResourceCorrelationIds,omitempty"` +} + +// HyperVHostDetails hyper-V host details. +type HyperVHostDetails struct { + // ID - READ-ONLY; The Hyper-V host Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The Hyper-V host name. + Name *string `json:"name,omitempty"` + // MarsAgentVersion - READ-ONLY; The Mars agent version. + MarsAgentVersion *string `json:"marsAgentVersion,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVHostDetails. +func (hvhd HyperVHostDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// HyperVReplica2012EventDetails model class for event details of a HyperVReplica E2E event. +type HyperVReplica2012EventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) MarshalJSON() ([]byte, error) { + hvr2ed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvr2ed.ContainerName != nil { + objectMap["containerName"] = hvr2ed.ContainerName + } + if hvr2ed.FabricName != nil { + objectMap["fabricName"] = hvr2ed.FabricName + } + if hvr2ed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvr2ed.RemoteContainerName + } + if hvr2ed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvr2ed.RemoteFabricName + } + if hvr2ed.InstanceType != "" { + objectMap["instanceType"] = hvr2ed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return &hvr2ed, true +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvr2ed, true +} + +// HyperVReplica2012R2EventDetails model class for event details of a HyperVReplica blue E2E event. +type HyperVReplica2012R2EventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) MarshalJSON() ([]byte, error) { + hvr2ed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvr2ed.ContainerName != nil { + objectMap["containerName"] = hvr2ed.ContainerName + } + if hvr2ed.FabricName != nil { + objectMap["fabricName"] = hvr2ed.FabricName + } + if hvr2ed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvr2ed.RemoteContainerName + } + if hvr2ed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvr2ed.RemoteFabricName + } + if hvr2ed.InstanceType != "" { + objectMap["instanceType"] = hvr2ed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return &hvr2ed, true +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvr2ed, true +} + +// HyperVReplicaAzureApplyRecoveryPointInput applyRecoveryPoint input specific to HyperVReplicaAzure +// provider. +type HyperVReplicaAzureApplyRecoveryPointInput struct { + // PrimaryKekCertificatePfx - The primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - The secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + hvraarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraarpi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvraarpi.PrimaryKekCertificatePfx + } + if hvraarpi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvraarpi.SecondaryKekCertificatePfx + } + if hvraarpi.InstanceType != "" { + objectMap["instanceType"] = hvraarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return &hvraarpi, true +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &hvraarpi, true +} + +// HyperVReplicaAzureDiskInputDetails disk input details. +type HyperVReplicaAzureDiskInputDetails struct { + // DiskID - The DiskId. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The LogStorageAccountId. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// HyperVReplicaAzureEnableProtectionInput hyperVReplicaAzure specific enable protection input. +type HyperVReplicaAzureEnableProtectionInput struct { + // HvHostVMID - The Hyper-V host VM Id. + HvHostVMID *string `json:"hvHostVmId,omitempty"` + // VMName - The VM Name. + VMName *string `json:"vmName,omitempty"` + // OsType - The OS type associated with VM. + OsType *string `json:"osType,omitempty"` + // VhdID - The OS disk VHD id associated with VM. + VhdID *string `json:"vhdId,omitempty"` + // TargetStorageAccountID - The storage account Id. + TargetStorageAccountID *string `json:"targetStorageAccountId,omitempty"` + // TargetAzureNetworkID - The selected target Azure network Id. + TargetAzureNetworkID *string `json:"targetAzureNetworkId,omitempty"` + // TargetAzureSubnetID - The selected target Azure subnet Id. + TargetAzureSubnetID *string `json:"targetAzureSubnetId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // TargetAzureVMName - The target azure VM Name. + TargetAzureVMName *string `json:"targetAzureVmName,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DisksToInclude - The list of VHD Ids of disks to be protected. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // TargetAzureV1ResourceGroupID - The Id of the target resource group (for classic deployment) in which the failover VM is to be created. + TargetAzureV1ResourceGroupID *string `json:"targetAzureV1ResourceGroupId,omitempty"` + // TargetAzureV2ResourceGroupID - The Id of the target resource group (for resource manager deployment) in which the failover VM is to be created. + TargetAzureV2ResourceGroupID *string `json:"targetAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id for resource manager deployment. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetProximityPlacementGroupID - The proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisksForReplication - A value indicating whether managed disks should be used during replication. + UseManagedDisksForReplication *string `json:"useManagedDisksForReplication,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DisksToIncludeForManagedDisks - The disks to include list for managed disks. + DisksToIncludeForManagedDisks *[]HyperVReplicaAzureDiskInputDetails `json:"disksToIncludeForManagedDisks,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) MarshalJSON() ([]byte, error) { + hvraepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraepi.HvHostVMID != nil { + objectMap["hvHostVmId"] = hvraepi.HvHostVMID + } + if hvraepi.VMName != nil { + objectMap["vmName"] = hvraepi.VMName + } + if hvraepi.OsType != nil { + objectMap["osType"] = hvraepi.OsType + } + if hvraepi.VhdID != nil { + objectMap["vhdId"] = hvraepi.VhdID + } + if hvraepi.TargetStorageAccountID != nil { + objectMap["targetStorageAccountId"] = hvraepi.TargetStorageAccountID + } + if hvraepi.TargetAzureNetworkID != nil { + objectMap["targetAzureNetworkId"] = hvraepi.TargetAzureNetworkID + } + if hvraepi.TargetAzureSubnetID != nil { + objectMap["targetAzureSubnetId"] = hvraepi.TargetAzureSubnetID + } + if hvraepi.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = hvraepi.EnableRdpOnTargetOption + } + if hvraepi.TargetAzureVMName != nil { + objectMap["targetAzureVmName"] = hvraepi.TargetAzureVMName + } + if hvraepi.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = hvraepi.LogStorageAccountID + } + if hvraepi.DisksToInclude != nil { + objectMap["disksToInclude"] = hvraepi.DisksToInclude + } + if hvraepi.TargetAzureV1ResourceGroupID != nil { + objectMap["targetAzureV1ResourceGroupId"] = hvraepi.TargetAzureV1ResourceGroupID + } + if hvraepi.TargetAzureV2ResourceGroupID != nil { + objectMap["targetAzureV2ResourceGroupId"] = hvraepi.TargetAzureV2ResourceGroupID + } + if hvraepi.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvraepi.UseManagedDisks + } + if hvraepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = hvraepi.TargetAvailabilitySetID + } + if hvraepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvraepi.TargetAvailabilityZone + } + if hvraepi.LicenseType != "" { + objectMap["licenseType"] = hvraepi.LicenseType + } + if hvraepi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = hvraepi.SQLServerLicenseType + } + if hvraepi.TargetVMSize != nil { + objectMap["targetVmSize"] = hvraepi.TargetVMSize + } + if hvraepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvraepi.TargetProximityPlacementGroupID + } + if hvraepi.UseManagedDisksForReplication != nil { + objectMap["useManagedDisksForReplication"] = hvraepi.UseManagedDisksForReplication + } + if hvraepi.DiskType != "" { + objectMap["diskType"] = hvraepi.DiskType + } + if hvraepi.DisksToIncludeForManagedDisks != nil { + objectMap["disksToIncludeForManagedDisks"] = hvraepi.DisksToIncludeForManagedDisks + } + if hvraepi.DiskEncryptionSetID != nil { + objectMap["diskEncryptionSetId"] = hvraepi.DiskEncryptionSetID + } + if hvraepi.TargetVMTags != nil { + objectMap["targetVmTags"] = hvraepi.TargetVMTags + } + if hvraepi.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = hvraepi.SeedManagedDiskTags + } + if hvraepi.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvraepi.TargetManagedDiskTags + } + if hvraepi.TargetNicTags != nil { + objectMap["targetNicTags"] = hvraepi.TargetNicTags + } + if hvraepi.InstanceType != "" { + objectMap["instanceType"] = hvraepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return &hvraepi, true +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &hvraepi, true +} + +// HyperVReplicaAzureEventDetails model class for event details of a HyperVReplica E2A event. +type HyperVReplicaAzureEventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) MarshalJSON() ([]byte, error) { + hvraed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraed.ContainerName != nil { + objectMap["containerName"] = hvraed.ContainerName + } + if hvraed.FabricName != nil { + objectMap["fabricName"] = hvraed.FabricName + } + if hvraed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvraed.RemoteContainerName + } + if hvraed.InstanceType != "" { + objectMap["instanceType"] = hvraed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return &hvraed, true +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvraed, true +} + +// HyperVReplicaAzureFailbackProviderInput hyperVReplicaAzureFailback specific planned failover input. +type HyperVReplicaAzureFailbackProviderInput struct { + // DataSyncOption - Data sync option. + DataSyncOption *string `json:"dataSyncOption,omitempty"` + // RecoveryVMCreationOption - ALR options to create alternate recovery. + RecoveryVMCreationOption *string `json:"recoveryVmCreationOption,omitempty"` + // ProviderIDForAlternateRecovery - Provider Id for alternate location. + ProviderIDForAlternateRecovery *string `json:"providerIdForAlternateRecovery,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) MarshalJSON() ([]byte, error) { + hvrafpi.InstanceType = InstanceTypeHyperVReplicaAzureFailback + objectMap := make(map[string]interface{}) + if hvrafpi.DataSyncOption != nil { + objectMap["dataSyncOption"] = hvrafpi.DataSyncOption + } + if hvrafpi.RecoveryVMCreationOption != nil { + objectMap["recoveryVmCreationOption"] = hvrafpi.RecoveryVMCreationOption + } + if hvrafpi.ProviderIDForAlternateRecovery != nil { + objectMap["providerIdForAlternateRecovery"] = hvrafpi.ProviderIDForAlternateRecovery + } + if hvrafpi.InstanceType != "" { + objectMap["instanceType"] = hvrafpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return &hvrafpi, true +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &hvrafpi, true +} + +// HyperVReplicaAzureManagedDiskDetails hyper-V Managed disk details. +type HyperVReplicaAzureManagedDiskDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // SeedManagedDiskID - Seed managed disk Id. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // ReplicaDiskType - The replica disk type. + ReplicaDiskType *string `json:"replicaDiskType,omitempty"` + // DiskEncryptionSetID - The disk encryption set ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// HyperVReplicaAzurePlannedFailoverProviderInput hyperVReplicaAzure specific planned failover input. +type HyperVReplicaAzurePlannedFailoverProviderInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) MarshalJSON() ([]byte, error) { + hvrapfpi.InstanceType = InstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapfpi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvrapfpi.PrimaryKekCertificatePfx + } + if hvrapfpi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvrapfpi.SecondaryKekCertificatePfx + } + if hvrapfpi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvrapfpi.RecoveryPointID + } + if hvrapfpi.InstanceType != "" { + objectMap["instanceType"] = hvrapfpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return &hvrapfpi, true +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &hvrapfpi, true +} + +// HyperVReplicaAzurePolicyDetails hyper-V Replica Azure specific protection profile details. +type HyperVReplicaAzurePolicyDetails struct { + // RecoveryPointHistoryDurationInHours - The duration (in hours) to which point the recovery history needs to be maintained. + RecoveryPointHistoryDurationInHours *int32 `json:"recoveryPointHistoryDurationInHours,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - The interval (in hours) at which Hyper-V Replica should create an application consistent snapshot within the VM. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // ReplicationInterval - The replication interval. + ReplicationInterval *int32 `json:"replicationInterval,omitempty"` + // OnlineReplicationStartTime - The scheduled start time for the initial replication. If this parameter is Null, the initial replication starts immediately. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // Encryption - A value indicating whether encryption is enabled for virtual machines in this cloud. + Encryption *string `json:"encryption,omitempty"` + // ActiveStorageAccountID - The active storage account Id. + ActiveStorageAccountID *string `json:"activeStorageAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) MarshalJSON() ([]byte, error) { + hvrapd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapd.RecoveryPointHistoryDurationInHours != nil { + objectMap["recoveryPointHistoryDurationInHours"] = hvrapd.RecoveryPointHistoryDurationInHours + } + if hvrapd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrapd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrapd.ReplicationInterval != nil { + objectMap["replicationInterval"] = hvrapd.ReplicationInterval + } + if hvrapd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrapd.OnlineReplicationStartTime + } + if hvrapd.Encryption != nil { + objectMap["encryption"] = hvrapd.Encryption + } + if hvrapd.ActiveStorageAccountID != nil { + objectMap["activeStorageAccountId"] = hvrapd.ActiveStorageAccountID + } + if hvrapd.InstanceType != "" { + objectMap["instanceType"] = hvrapd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return &hvrapd, true +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrapd, true +} + +// HyperVReplicaAzurePolicyInput hyper-V Replica Azure specific input for creating a protection profile. +type HyperVReplicaAzurePolicyInput struct { + // RecoveryPointHistoryDuration - The duration (in hours) to which point the recovery history needs to be maintained. + RecoveryPointHistoryDuration *int32 `json:"recoveryPointHistoryDuration,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - The interval (in hours) at which Hyper-V Replica should create an application consistent snapshot within the VM. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // ReplicationInterval - The replication interval. + ReplicationInterval *int32 `json:"replicationInterval,omitempty"` + // OnlineReplicationStartTime - The scheduled start time for the initial replication. If this parameter is Null, the initial replication starts immediately. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // StorageAccounts - The list of storage accounts to which the VMs in the primary cloud can replicate to. + StorageAccounts *[]string `json:"storageAccounts,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) MarshalJSON() ([]byte, error) { + hvrapi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapi.RecoveryPointHistoryDuration != nil { + objectMap["recoveryPointHistoryDuration"] = hvrapi.RecoveryPointHistoryDuration + } + if hvrapi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrapi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrapi.ReplicationInterval != nil { + objectMap["replicationInterval"] = hvrapi.ReplicationInterval + } + if hvrapi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrapi.OnlineReplicationStartTime + } + if hvrapi.StorageAccounts != nil { + objectMap["storageAccounts"] = hvrapi.StorageAccounts + } + if hvrapi.InstanceType != "" { + objectMap["instanceType"] = hvrapi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return &hvrapi, true +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrapi, true +} + +// HyperVReplicaAzureReplicationDetails hyper V Replica Azure provider specific settings. +type HyperVReplicaAzureReplicationDetails struct { + // AzureVMDiskDetails - Azure VM Disk details. + AzureVMDiskDetails *[]AzureVMDiskDetails `json:"azureVmDiskDetails,omitempty"` + // RecoveryAzureVMName - Recovery Azure given name. + RecoveryAzureVMName *string `json:"recoveryAzureVmName,omitempty"` + // RecoveryAzureVMSize - The Recovery Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureStorageAccount - The recovery Azure storage account. + RecoveryAzureStorageAccount *string `json:"recoveryAzureStorageAccount,omitempty"` + // RecoveryAzureLogStorageAccountID - The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. + RecoveryAzureLogStorageAccountID *string `json:"recoveryAzureLogStorageAccountId,omitempty"` + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // RpoInSeconds - Last RPO value. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // SelectedRecoveryAzureNetworkID - The selected recovery azure network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // Encryption - The encryption info. + Encryption *string `json:"encryption,omitempty"` + // OSDetails - The operating system info. + OSDetails *OSDetails `json:"oSDetails,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // RecoveryAzureResourceGroupID - The target resource group Id. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]HyperVReplicaAzureManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) MarshalJSON() ([]byte, error) { + hvrard.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrard.AzureVMDiskDetails != nil { + objectMap["azureVmDiskDetails"] = hvrard.AzureVMDiskDetails + } + if hvrard.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVmName"] = hvrard.RecoveryAzureVMName + } + if hvrard.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = hvrard.RecoveryAzureVMSize + } + if hvrard.RecoveryAzureStorageAccount != nil { + objectMap["recoveryAzureStorageAccount"] = hvrard.RecoveryAzureStorageAccount + } + if hvrard.RecoveryAzureLogStorageAccountID != nil { + objectMap["recoveryAzureLogStorageAccountId"] = hvrard.RecoveryAzureLogStorageAccountID + } + if hvrard.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrard.LastReplicatedTime + } + if hvrard.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = hvrard.RpoInSeconds + } + if hvrard.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = hvrard.LastRpoCalculatedTime + } + if hvrard.VMID != nil { + objectMap["vmId"] = hvrard.VMID + } + if hvrard.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrard.VMProtectionState + } + if hvrard.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrard.VMProtectionStateDescription + } + if hvrard.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrard.InitialReplicationDetails + } + if hvrard.VMNics != nil { + objectMap["vmNics"] = hvrard.VMNics + } + if hvrard.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = hvrard.SelectedRecoveryAzureNetworkID + } + if hvrard.SelectedSourceNicID != nil { + objectMap["selectedSourceNicId"] = hvrard.SelectedSourceNicID + } + if hvrard.Encryption != nil { + objectMap["encryption"] = hvrard.Encryption + } + if hvrard.OSDetails != nil { + objectMap["oSDetails"] = hvrard.OSDetails + } + if hvrard.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = hvrard.SourceVMRAMSizeInMB + } + if hvrard.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = hvrard.SourceVMCPUCount + } + if hvrard.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = hvrard.EnableRdpOnTargetOption + } + if hvrard.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = hvrard.RecoveryAzureResourceGroupID + } + if hvrard.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = hvrard.RecoveryAvailabilitySetID + } + if hvrard.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvrard.TargetAvailabilityZone + } + if hvrard.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvrard.TargetProximityPlacementGroupID + } + if hvrard.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvrard.UseManagedDisks + } + if hvrard.LicenseType != nil { + objectMap["licenseType"] = hvrard.LicenseType + } + if hvrard.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = hvrard.SQLServerLicenseType + } + if hvrard.TargetVMTags != nil { + objectMap["targetVmTags"] = hvrard.TargetVMTags + } + if hvrard.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = hvrard.SeedManagedDiskTags + } + if hvrard.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvrard.TargetManagedDiskTags + } + if hvrard.TargetNicTags != nil { + objectMap["targetNicTags"] = hvrard.TargetNicTags + } + if hvrard.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = hvrard.ProtectedManagedDisks + } + if hvrard.InstanceType != "" { + objectMap["instanceType"] = hvrard.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return &hvrard, true +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrard, true +} + +// HyperVReplicaAzureReprotectInput azure specific reprotect input. +type HyperVReplicaAzureReprotectInput struct { + // HvHostVMID - The Hyper-V host Vm Id. + HvHostVMID *string `json:"hvHostVmId,omitempty"` + // VMName - The Vm Name. + VMName *string `json:"vmName,omitempty"` + // OsType - The OS type associated with vm. + OsType *string `json:"osType,omitempty"` + // VHDID - The OS disk VHD id associated with vm. + VHDID *string `json:"vHDId,omitempty"` + // StorageAccountID - The storage account name. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) MarshalJSON() ([]byte, error) { + hvrari.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrari.HvHostVMID != nil { + objectMap["hvHostVmId"] = hvrari.HvHostVMID + } + if hvrari.VMName != nil { + objectMap["vmName"] = hvrari.VMName + } + if hvrari.OsType != nil { + objectMap["osType"] = hvrari.OsType + } + if hvrari.VHDID != nil { + objectMap["vHDId"] = hvrari.VHDID + } + if hvrari.StorageAccountID != nil { + objectMap["storageAccountId"] = hvrari.StorageAccountID + } + if hvrari.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = hvrari.LogStorageAccountID + } + if hvrari.InstanceType != "" { + objectMap["instanceType"] = hvrari.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return &hvrari, true +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &hvrari, true +} + +// HyperVReplicaAzureTestFailoverInput hvrA provider specific input for test failover. +type HyperVReplicaAzureTestFailoverInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) MarshalJSON() ([]byte, error) { + hvratfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvratfi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvratfi.PrimaryKekCertificatePfx + } + if hvratfi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvratfi.SecondaryKekCertificatePfx + } + if hvratfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvratfi.RecoveryPointID + } + if hvratfi.InstanceType != "" { + objectMap["instanceType"] = hvratfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return &hvratfi, true +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &hvratfi, true +} + +// HyperVReplicaAzureUnplannedFailoverInput hvrA provider specific input for unplanned failover. +type HyperVReplicaAzureUnplannedFailoverInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + hvraufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraufi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvraufi.PrimaryKekCertificatePfx + } + if hvraufi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvraufi.SecondaryKekCertificatePfx + } + if hvraufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvraufi.RecoveryPointID + } + if hvraufi.InstanceType != "" { + objectMap["instanceType"] = hvraufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return &hvraufi, true +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &hvraufi, true +} + +// HyperVReplicaAzureUpdateReplicationProtectedItemInput hyperV replica Azure input to update replication +// protected item. +type HyperVReplicaAzureUpdateReplicationProtectedItemInput struct { + // RecoveryAzureV1ResourceGroupID - The recovery Azure resource group Id for classic deployment. + RecoveryAzureV1ResourceGroupID *string `json:"recoveryAzureV1ResourceGroupId,omitempty"` + // RecoveryAzureV2ResourceGroupID - The recovery Azure resource group Id for resource manager deployment. + RecoveryAzureV2ResourceGroupID *string `json:"recoveryAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // DiskIDToDiskEncryptionMap - The dictionary of disk resource Id to disk encryption set ARM Id. + DiskIDToDiskEncryptionMap map[string]*string `json:"diskIdToDiskEncryptionMap"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // VMDisks - The list of disk update properties. + VMDisks *[]UpdateDiskInput `json:"vmDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + hvraurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraurpii.RecoveryAzureV1ResourceGroupID != nil { + objectMap["recoveryAzureV1ResourceGroupId"] = hvraurpii.RecoveryAzureV1ResourceGroupID + } + if hvraurpii.RecoveryAzureV2ResourceGroupID != nil { + objectMap["recoveryAzureV2ResourceGroupId"] = hvraurpii.RecoveryAzureV2ResourceGroupID + } + if hvraurpii.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvraurpii.UseManagedDisks + } + if hvraurpii.DiskIDToDiskEncryptionMap != nil { + objectMap["diskIdToDiskEncryptionMap"] = hvraurpii.DiskIDToDiskEncryptionMap + } + if hvraurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvraurpii.TargetProximityPlacementGroupID + } + if hvraurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvraurpii.TargetAvailabilityZone + } + if hvraurpii.TargetVMTags != nil { + objectMap["targetVmTags"] = hvraurpii.TargetVMTags + } + if hvraurpii.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvraurpii.TargetManagedDiskTags + } + if hvraurpii.TargetNicTags != nil { + objectMap["targetNicTags"] = hvraurpii.TargetNicTags + } + if hvraurpii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = hvraurpii.SQLServerLicenseType + } + if hvraurpii.VMDisks != nil { + objectMap["vmDisks"] = hvraurpii.VMDisks + } + if hvraurpii.InstanceType != "" { + objectMap["instanceType"] = hvraurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return &hvraurpii, true +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &hvraurpii, true +} + +// HyperVReplicaBaseEventDetails abstract model class for event details of a HyperVReplica E2E event. +type HyperVReplicaBaseEventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) MarshalJSON() ([]byte, error) { + hvrbed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails + objectMap := make(map[string]interface{}) + if hvrbed.ContainerName != nil { + objectMap["containerName"] = hvrbed.ContainerName + } + if hvrbed.FabricName != nil { + objectMap["fabricName"] = hvrbed.FabricName + } + if hvrbed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvrbed.RemoteContainerName + } + if hvrbed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvrbed.RemoteFabricName + } + if hvrbed.InstanceType != "" { + objectMap["instanceType"] = hvrbed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return &hvrbed, true +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvrbed, true +} + +// HyperVReplicaBasePolicyDetails base class for HyperVReplica policy details. +type HyperVReplicaBasePolicyDetails struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud. + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) MarshalJSON() ([]byte, error) { + hvrbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails + objectMap := make(map[string]interface{}) + if hvrbpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpd.RecoveryPoints + } + if hvrbpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpd.Compression != nil { + objectMap["compression"] = hvrbpd.Compression + } + if hvrbpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpd.InitialReplicationMethod + } + if hvrbpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpd.OnlineReplicationStartTime + } + if hvrbpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpd.OfflineReplicationImportPath + } + if hvrbpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpd.OfflineReplicationExportPath + } + if hvrbpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpd.ReplicationPort + } + if hvrbpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpd.AllowedAuthenticationType + } + if hvrbpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrbpd.ReplicaDeletionOption + } + if hvrbpd.InstanceType != "" { + objectMap["instanceType"] = hvrbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return &hvrbpd, true +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrbpd, true +} + +// HyperVReplicaBaseReplicationDetails hyper V replica provider specific settings base class. +type HyperVReplicaBaseReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) MarshalJSON() ([]byte, error) { + hvrbrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails + objectMap := make(map[string]interface{}) + if hvrbrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrbrd.LastReplicatedTime + } + if hvrbrd.VMNics != nil { + objectMap["vmNics"] = hvrbrd.VMNics + } + if hvrbrd.VMID != nil { + objectMap["vmId"] = hvrbrd.VMID + } + if hvrbrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrbrd.VMProtectionState + } + if hvrbrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrbrd.VMProtectionStateDescription + } + if hvrbrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrbrd.InitialReplicationDetails + } + if hvrbrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrbrd.VMDiskDetails + } + if hvrbrd.InstanceType != "" { + objectMap["instanceType"] = hvrbrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return &hvrbrd, true +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrbrd, true +} + +// HyperVReplicaBluePolicyDetails hyper-V Replica Blue specific protection profile details. +type HyperVReplicaBluePolicyDetails struct { + // ReplicationFrequencyInSeconds - A value indicating the replication interval. + ReplicationFrequencyInSeconds *int32 `json:"replicationFrequencyInSeconds,omitempty"` + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) MarshalJSON() ([]byte, error) { + hvrbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbpd.ReplicationFrequencyInSeconds != nil { + objectMap["replicationFrequencyInSeconds"] = hvrbpd.ReplicationFrequencyInSeconds + } + if hvrbpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpd.RecoveryPoints + } + if hvrbpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpd.Compression != nil { + objectMap["compression"] = hvrbpd.Compression + } + if hvrbpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpd.InitialReplicationMethod + } + if hvrbpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpd.OnlineReplicationStartTime + } + if hvrbpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpd.OfflineReplicationImportPath + } + if hvrbpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpd.OfflineReplicationExportPath + } + if hvrbpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpd.ReplicationPort + } + if hvrbpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpd.AllowedAuthenticationType + } + if hvrbpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrbpd.ReplicaDeletionOption + } + if hvrbpd.InstanceType != "" { + objectMap["instanceType"] = hvrbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return &hvrbpd, true +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrbpd, true +} + +// HyperVReplicaBluePolicyInput hyperV Replica Blue policy input. +type HyperVReplicaBluePolicyInput struct { + // ReplicationFrequencyInSeconds - A value indicating the replication interval. + ReplicationFrequencyInSeconds *int32 `json:"replicationFrequencyInSeconds,omitempty"` + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletion - A value indicating whether the VM has to be auto deleted. + ReplicaDeletion *string `json:"replicaDeletion,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) MarshalJSON() ([]byte, error) { + hvrbpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbpi.ReplicationFrequencyInSeconds != nil { + objectMap["replicationFrequencyInSeconds"] = hvrbpi.ReplicationFrequencyInSeconds + } + if hvrbpi.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpi.RecoveryPoints + } + if hvrbpi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpi.Compression != nil { + objectMap["compression"] = hvrbpi.Compression + } + if hvrbpi.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpi.InitialReplicationMethod + } + if hvrbpi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpi.OnlineReplicationStartTime + } + if hvrbpi.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpi.OfflineReplicationImportPath + } + if hvrbpi.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpi.OfflineReplicationExportPath + } + if hvrbpi.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpi.ReplicationPort + } + if hvrbpi.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpi.AllowedAuthenticationType + } + if hvrbpi.ReplicaDeletion != nil { + objectMap["replicaDeletion"] = hvrbpi.ReplicaDeletion + } + if hvrbpi.InstanceType != "" { + objectMap["instanceType"] = hvrbpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return &hvrbpi, true +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return &hvrbpi, true +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrbpi, true +} + +// HyperVReplicaBlueReplicationDetails hyperV replica 2012 R2 (Blue) replication details. +type HyperVReplicaBlueReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) MarshalJSON() ([]byte, error) { + hvrbrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrbrd.LastReplicatedTime + } + if hvrbrd.VMNics != nil { + objectMap["vmNics"] = hvrbrd.VMNics + } + if hvrbrd.VMID != nil { + objectMap["vmId"] = hvrbrd.VMID + } + if hvrbrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrbrd.VMProtectionState + } + if hvrbrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrbrd.VMProtectionStateDescription + } + if hvrbrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrbrd.InitialReplicationDetails + } + if hvrbrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrbrd.VMDiskDetails + } + if hvrbrd.InstanceType != "" { + objectMap["instanceType"] = hvrbrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return &hvrbrd, true +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrbrd, true +} + +// HyperVReplicaPolicyDetails hyper-V Replica Blue specific protection profile details. +type HyperVReplicaPolicyDetails struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) MarshalJSON() ([]byte, error) { + hvrpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrpd.RecoveryPoints + } + if hvrpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrpd.Compression != nil { + objectMap["compression"] = hvrpd.Compression + } + if hvrpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrpd.InitialReplicationMethod + } + if hvrpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrpd.OnlineReplicationStartTime + } + if hvrpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrpd.OfflineReplicationImportPath + } + if hvrpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrpd.OfflineReplicationExportPath + } + if hvrpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrpd.ReplicationPort + } + if hvrpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrpd.AllowedAuthenticationType + } + if hvrpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrpd.ReplicaDeletionOption + } + if hvrpd.InstanceType != "" { + objectMap["instanceType"] = hvrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return &hvrpd, true +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrpd, true +} + +// BasicHyperVReplicaPolicyInput hyper-V Replica specific policy Input. +type BasicHyperVReplicaPolicyInput interface { + AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) + AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) +} + +// HyperVReplicaPolicyInput hyper-V Replica specific policy Input. +type HyperVReplicaPolicyInput struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletion - A value indicating whether the VM has to be auto deleted. + ReplicaDeletion *string `json:"replicaDeletion,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicHyperVReplicaPolicyInput(body []byte) (BasicHyperVReplicaPolicyInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2): + var hvrbpi HyperVReplicaBluePolicyInput + err := json.Unmarshal(body, &hvrbpi) + return hvrbpi, err + default: + var hvrpi HyperVReplicaPolicyInput + err := json.Unmarshal(body, &hvrpi) + return hvrpi, err + } +} +func unmarshalBasicHyperVReplicaPolicyInputArray(body []byte) ([]BasicHyperVReplicaPolicyInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + hvrpiArray := make([]BasicHyperVReplicaPolicyInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + hvrpi, err := unmarshalBasicHyperVReplicaPolicyInput(*rawMessage) + if err != nil { + return nil, err + } + hvrpiArray[index] = hvrpi + } + return hvrpiArray, nil +} + +// MarshalJSON is the custom marshaler for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) MarshalJSON() ([]byte, error) { + hvrpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrpi.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrpi.RecoveryPoints + } + if hvrpi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrpi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrpi.Compression != nil { + objectMap["compression"] = hvrpi.Compression + } + if hvrpi.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrpi.InitialReplicationMethod + } + if hvrpi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrpi.OnlineReplicationStartTime + } + if hvrpi.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrpi.OfflineReplicationImportPath + } + if hvrpi.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrpi.OfflineReplicationExportPath + } + if hvrpi.ReplicationPort != nil { + objectMap["replicationPort"] = hvrpi.ReplicationPort + } + if hvrpi.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrpi.AllowedAuthenticationType + } + if hvrpi.ReplicaDeletion != nil { + objectMap["replicaDeletion"] = hvrpi.ReplicaDeletion + } + if hvrpi.InstanceType != "" { + objectMap["instanceType"] = hvrpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return &hvrpi, true +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return &hvrpi, true +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrpi, true +} + +// HyperVReplicaReplicationDetails hyperV replica 2012 replication details. +type HyperVReplicaReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) MarshalJSON() ([]byte, error) { + hvrrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrrd.LastReplicatedTime + } + if hvrrd.VMNics != nil { + objectMap["vmNics"] = hvrrd.VMNics + } + if hvrrd.VMID != nil { + objectMap["vmId"] = hvrrd.VMID + } + if hvrrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrrd.VMProtectionState + } + if hvrrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrrd.VMProtectionStateDescription + } + if hvrrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrrd.InitialReplicationDetails + } + if hvrrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrrd.VMDiskDetails + } + if hvrrd.InstanceType != "" { + objectMap["instanceType"] = hvrrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return &hvrrd, true +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrrd, true +} + +// HyperVSiteDetails hyperVSite fabric specific details. +type HyperVSiteDetails struct { + // HyperVHosts - The list of Hyper-V hosts associated with the fabric. + HyperVHosts *[]HyperVHostDetails `json:"hyperVHosts,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) MarshalJSON() ([]byte, error) { + hvsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite + objectMap := make(map[string]interface{}) + if hvsd.HyperVHosts != nil { + objectMap["hyperVHosts"] = hvsd.HyperVHosts + } + if hvsd.InstanceType != "" { + objectMap["instanceType"] = hvsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return &hvsd, true +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &hvsd, true +} + +// BasicHyperVVirtualMachineDetails single Host fabric provider specific VM settings. +type BasicHyperVVirtualMachineDetails interface { + AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) + AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) +} + +// HyperVVirtualMachineDetails single Host fabric provider specific VM settings. +type HyperVVirtualMachineDetails struct { + // SourceItemID - The source id of the object. + SourceItemID *string `json:"sourceItemId,omitempty"` + // Generation - The id of the object in fabric. + Generation *string `json:"generation,omitempty"` + // OsDetails - The Last replication time. + OsDetails *OSDetails `json:"osDetails,omitempty"` + // DiskDetails - The Last successful failover time. + DiskDetails *[]DiskDetails `json:"diskDetails,omitempty"` + // HasPhysicalDisk - A value indicating whether the VM has a physical disk attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasPhysicalDisk PresenceStatus `json:"hasPhysicalDisk,omitempty"` + // HasFibreChannelAdapter - A value indicating whether the VM has a fibre channel adapter attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasFibreChannelAdapter PresenceStatus `json:"hasFibreChannelAdapter,omitempty"` + // HasSharedVhd - A value indicating whether the VM has a shared VHD attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasSharedVhd PresenceStatus `json:"hasSharedVhd,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicHyperVVirtualMachineDetails(body []byte) (BasicHyperVVirtualMachineDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeVmmVirtualMachine): + var vvmd VmmVirtualMachineDetails + err := json.Unmarshal(body, &vvmd) + return vvmd, err + default: + var hvvmd HyperVVirtualMachineDetails + err := json.Unmarshal(body, &hvvmd) + return hvvmd, err + } +} +func unmarshalBasicHyperVVirtualMachineDetailsArray(body []byte) ([]BasicHyperVVirtualMachineDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + hvvmdArray := make([]BasicHyperVVirtualMachineDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + hvvmd, err := unmarshalBasicHyperVVirtualMachineDetails(*rawMessage) + if err != nil { + return nil, err + } + hvvmdArray[index] = hvvmd + } + return hvvmdArray, nil +} + +// MarshalJSON is the custom marshaler for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) MarshalJSON() ([]byte, error) { + hvvmd.InstanceType = InstanceTypeHyperVVirtualMachine + objectMap := make(map[string]interface{}) + if hvvmd.SourceItemID != nil { + objectMap["sourceItemId"] = hvvmd.SourceItemID + } + if hvvmd.Generation != nil { + objectMap["generation"] = hvvmd.Generation + } + if hvvmd.OsDetails != nil { + objectMap["osDetails"] = hvvmd.OsDetails + } + if hvvmd.DiskDetails != nil { + objectMap["diskDetails"] = hvvmd.DiskDetails + } + if hvvmd.HasPhysicalDisk != "" { + objectMap["hasPhysicalDisk"] = hvvmd.HasPhysicalDisk + } + if hvvmd.HasFibreChannelAdapter != "" { + objectMap["hasFibreChannelAdapter"] = hvvmd.HasFibreChannelAdapter + } + if hvvmd.HasSharedVhd != "" { + objectMap["hasSharedVhd"] = hvvmd.HasSharedVhd + } + if hvvmd.InstanceType != "" { + objectMap["instanceType"] = hvvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return &hvvmd, true +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return &hvvmd, true +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &hvvmd, true +} + +// IdentityProviderDetails identity provider details. +type IdentityProviderDetails struct { + // TenantID - The tenant Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + TenantID *string `json:"tenantId,omitempty"` + // ApplicationID - The application/client Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ApplicationID *string `json:"applicationId,omitempty"` + // ObjectID - The object Id of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ObjectID *string `json:"objectId,omitempty"` + // Audience - The intended Audience of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + Audience *string `json:"audience,omitempty"` + // AadAuthority - The base authority for Azure Active Directory authentication. + AadAuthority *string `json:"aadAuthority,omitempty"` +} + +// IdentityProviderInput identity provider input. +type IdentityProviderInput struct { + // TenantID - The tenant Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + TenantID *string `json:"tenantId,omitempty"` + // ApplicationID - The application/client Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ApplicationID *string `json:"applicationId,omitempty"` + // ObjectID - The object Id of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ObjectID *string `json:"objectId,omitempty"` + // Audience - The intended Audience of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + Audience *string `json:"audience,omitempty"` + // AadAuthority - The base authority for Azure Active Directory authentication. + AadAuthority *string `json:"aadAuthority,omitempty"` +} + +// InconsistentVMDetails this class stores the monitoring details for consistency check of inconsistent +// Protected Entity. +type InconsistentVMDetails struct { + // VMName - The Vm name. + VMName *string `json:"vmName,omitempty"` + // CloudName - The Cloud name. + CloudName *string `json:"cloudName,omitempty"` + // Details - The list of details regarding state of the Protected Entity in SRS and On prem. + Details *[]string `json:"details,omitempty"` + // ErrorIds - The list of error ids. + ErrorIds *[]string `json:"errorIds,omitempty"` +} + +// InitialReplicationDetails initial replication details. +type InitialReplicationDetails struct { + // InitialReplicationType - Initial replication type. + InitialReplicationType *string `json:"initialReplicationType,omitempty"` + // InitialReplicationProgressPercentage - The initial replication progress percentage. + InitialReplicationProgressPercentage *string `json:"initialReplicationProgressPercentage,omitempty"` +} + +// InlineWorkflowTaskDetails this class represents the inline workflow task details. +type InlineWorkflowTaskDetails struct { + // WorkflowIds - The list of child workflow ids. + WorkflowIds *[]string `json:"workflowIds,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) MarshalJSON() ([]byte, error) { + iwtd.InstanceType = InstanceTypeInlineWorkflowTaskDetails + objectMap := make(map[string]interface{}) + if iwtd.WorkflowIds != nil { + objectMap["workflowIds"] = iwtd.WorkflowIds + } + if iwtd.ChildTasks != nil { + objectMap["childTasks"] = iwtd.ChildTasks + } + if iwtd.InstanceType != "" { + objectMap["instanceType"] = iwtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return &iwtd, true +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &iwtd, true +} + +// InMageAgentDetails the details of the InMage agent. +type InMageAgentDetails struct { + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentUpdateStatus - A value indicating whether installed agent needs to be updated. + AgentUpdateStatus *string `json:"agentUpdateStatus,omitempty"` + // PostUpdateRebootStatus - A value indicating whether reboot is required after update is applied. + PostUpdateRebootStatus *string `json:"postUpdateRebootStatus,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` +} + +// InMageAzureV2ApplyRecoveryPointInput applyRecoveryPoint input specific to InMageAzureV2 provider. +type InMageAzureV2ApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + imavarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavarpi.InstanceType != "" { + objectMap["instanceType"] = imavarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return &imavarpi, true +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &imavarpi, true +} + +// InMageAzureV2DiskInputDetails disk input details. +type InMageAzureV2DiskInputDetails struct { + // DiskID - The DiskId. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The LogStorageAccountId. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageAzureV2EnableProtectionInput vMware Azure specific enable protection input. +type InMageAzureV2EnableProtectionInput struct { + // MasterTargetID - The Master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // StorageAccountID - The storage account Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // MultiVMGroupID - The multi VM group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]InMageAzureV2DiskInputDetails `json:"disksToInclude,omitempty"` + // TargetAzureNetworkID - The selected target Azure network Id. + TargetAzureNetworkID *string `json:"targetAzureNetworkId,omitempty"` + // TargetAzureSubnetID - The selected target Azure subnet Id. + TargetAzureSubnetID *string `json:"targetAzureSubnetId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target VM after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // TargetAzureVMName - The target azure VM Name. + TargetAzureVMName *string `json:"targetAzureVmName,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // TargetAzureV1ResourceGroupID - The Id of the target resource group (for classic deployment) in which the failover VM is to be created. + TargetAzureV1ResourceGroupID *string `json:"targetAzureV1ResourceGroupId,omitempty"` + // TargetAzureV2ResourceGroupID - The Id of the target resource group (for resource manager deployment) in which the failover VM is to be created. + TargetAzureV2ResourceGroupID *string `json:"targetAzureV2ResourceGroupId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id for resource manager deployment. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) MarshalJSON() ([]byte, error) { + imavepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavepi.MasterTargetID != nil { + objectMap["masterTargetId"] = imavepi.MasterTargetID + } + if imavepi.ProcessServerID != nil { + objectMap["processServerId"] = imavepi.ProcessServerID + } + if imavepi.StorageAccountID != nil { + objectMap["storageAccountId"] = imavepi.StorageAccountID + } + if imavepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imavepi.RunAsAccountID + } + if imavepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imavepi.MultiVMGroupID + } + if imavepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imavepi.MultiVMGroupName + } + if imavepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imavepi.DisksToInclude + } + if imavepi.TargetAzureNetworkID != nil { + objectMap["targetAzureNetworkId"] = imavepi.TargetAzureNetworkID + } + if imavepi.TargetAzureSubnetID != nil { + objectMap["targetAzureSubnetId"] = imavepi.TargetAzureSubnetID + } + if imavepi.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = imavepi.EnableRdpOnTargetOption + } + if imavepi.TargetAzureVMName != nil { + objectMap["targetAzureVmName"] = imavepi.TargetAzureVMName + } + if imavepi.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imavepi.LogStorageAccountID + } + if imavepi.TargetAzureV1ResourceGroupID != nil { + objectMap["targetAzureV1ResourceGroupId"] = imavepi.TargetAzureV1ResourceGroupID + } + if imavepi.TargetAzureV2ResourceGroupID != nil { + objectMap["targetAzureV2ResourceGroupId"] = imavepi.TargetAzureV2ResourceGroupID + } + if imavepi.DiskType != "" { + objectMap["diskType"] = imavepi.DiskType + } + if imavepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imavepi.TargetAvailabilitySetID + } + if imavepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavepi.TargetAvailabilityZone + } + if imavepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavepi.TargetProximityPlacementGroupID + } + if imavepi.LicenseType != "" { + objectMap["licenseType"] = imavepi.LicenseType + } + if imavepi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = imavepi.SQLServerLicenseType + } + if imavepi.TargetVMSize != nil { + objectMap["targetVmSize"] = imavepi.TargetVMSize + } + if imavepi.DiskEncryptionSetID != nil { + objectMap["diskEncryptionSetId"] = imavepi.DiskEncryptionSetID + } + if imavepi.TargetVMTags != nil { + objectMap["targetVmTags"] = imavepi.TargetVMTags + } + if imavepi.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = imavepi.SeedManagedDiskTags + } + if imavepi.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavepi.TargetManagedDiskTags + } + if imavepi.TargetNicTags != nil { + objectMap["targetNicTags"] = imavepi.TargetNicTags + } + if imavepi.InstanceType != "" { + objectMap["instanceType"] = imavepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return &imavepi, true +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imavepi, true +} + +// InMageAzureV2EventDetails model class for event details of a VMwareAzureV2 event. +type InMageAzureV2EventDetails struct { + // EventType - InMage Event type. Takes one of the values of InMageDataContract.InMageMonitoringEventType. + EventType *string `json:"eventType,omitempty"` + // Category - InMage Event Category. + Category *string `json:"category,omitempty"` + // Component - InMage Event Component. + Component *string `json:"component,omitempty"` + // CorrectiveAction - Corrective Action string for the event. + CorrectiveAction *string `json:"correctiveAction,omitempty"` + // Details - InMage Event Details. + Details *string `json:"details,omitempty"` + // Summary - InMage Event Summary. + Summary *string `json:"summary,omitempty"` + // SiteName - VMware Site name. + SiteName *string `json:"siteName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) MarshalJSON() ([]byte, error) { + imaved.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imaved.EventType != nil { + objectMap["eventType"] = imaved.EventType + } + if imaved.Category != nil { + objectMap["category"] = imaved.Category + } + if imaved.Component != nil { + objectMap["component"] = imaved.Component + } + if imaved.CorrectiveAction != nil { + objectMap["correctiveAction"] = imaved.CorrectiveAction + } + if imaved.Details != nil { + objectMap["details"] = imaved.Details + } + if imaved.Summary != nil { + objectMap["summary"] = imaved.Summary + } + if imaved.SiteName != nil { + objectMap["siteName"] = imaved.SiteName + } + if imaved.InstanceType != "" { + objectMap["instanceType"] = imaved.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return &imaved, true +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imaved, true +} + +// InMageAzureV2ManagedDiskDetails inMageAzureV2 Managed disk details. +type InMageAzureV2ManagedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // SeedManagedDiskID - Seed managed disk Id. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // ReplicaDiskType - The replica disk type. + ReplicaDiskType *string `json:"replicaDiskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetDiskName - The target disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// InMageAzureV2PolicyDetails inMage Azure v2 specific protection profile details. +type InMageAzureV2PolicyDetails struct { + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) MarshalJSON() ([]byte, error) { + imavpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imavpd.CrashConsistentFrequencyInMinutes + } + if imavpd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imavpd.RecoveryPointThresholdInMinutes + } + if imavpd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imavpd.RecoveryPointHistory + } + if imavpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imavpd.AppConsistentFrequencyInMinutes + } + if imavpd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imavpd.MultiVMSyncStatus + } + if imavpd.InstanceType != "" { + objectMap["instanceType"] = imavpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return &imavpd, true +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imavpd, true +} + +// InMageAzureV2PolicyInput vMWare Azure specific policy Input. +type InMageAzureV2PolicyInput struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) MarshalJSON() ([]byte, error) { + imavpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavpi.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imavpi.RecoveryPointThresholdInMinutes + } + if imavpi.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imavpi.RecoveryPointHistory + } + if imavpi.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imavpi.CrashConsistentFrequencyInMinutes + } + if imavpi.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imavpi.AppConsistentFrequencyInMinutes + } + if imavpi.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = imavpi.MultiVMSyncStatus + } + if imavpi.InstanceType != "" { + objectMap["instanceType"] = imavpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return &imavpi, true +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imavpi, true +} + +// InMageAzureV2ProtectedDiskDetails inMageAzureV2 protected disk details. +type InMageAzureV2ProtectedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // HealthErrorCode - The health error code for the disk. + HealthErrorCode *string `json:"healthErrorCode,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncDurationInSeconds - The resync duration in seconds. + ResyncDurationInSeconds *int64 `json:"resyncDurationInSeconds,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // FileSystemCapacityInBytes - The disk file system capacity in bytes. + FileSystemCapacityInBytes *int64 `json:"fileSystemCapacityInBytes,omitempty"` + // SourceDataInMegaBytes - The source data transit in MB. + SourceDataInMegaBytes *float64 `json:"sourceDataInMegaBytes,omitempty"` + // PsDataInMegaBytes - The PS data transit in MB. + PsDataInMegaBytes *float64 `json:"psDataInMegaBytes,omitempty"` + // TargetDataInMegaBytes - The target data transit in MB. + TargetDataInMegaBytes *float64 `json:"targetDataInMegaBytes,omitempty"` + // DiskResized - A value indicating whether disk is resized. + DiskResized *string `json:"diskResized,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // ResyncProcessedBytes - The resync processed bytes. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTotalTransferredBytes - The resync total transferred bytes. + ResyncTotalTransferredBytes *int64 `json:"resyncTotalTransferredBytes,omitempty"` + // ResyncLast15MinutesTransferredBytes - The resync last 15 minutes transferred bytes. + ResyncLast15MinutesTransferredBytes *int64 `json:"resyncLast15MinutesTransferredBytes,omitempty"` + // ResyncLastDataTransferTimeUTC - The last data transfer time in UTC. + ResyncLastDataTransferTimeUTC *date.Time `json:"resyncLastDataTransferTimeUTC,omitempty"` + // ResyncStartTime - The resync start time. + ResyncStartTime *date.Time `json:"resyncStartTime,omitempty"` + // ProgressHealth - The Progress Health. + ProgressHealth *string `json:"progressHealth,omitempty"` + // ProgressStatus - The Progress Status. + ProgressStatus *string `json:"progressStatus,omitempty"` +} + +// InMageAzureV2RecoveryPointDetails inMage Azure V2 provider specific recovery point details. +type InMageAzureV2RecoveryPointDetails struct { + // IsMultiVMSyncPoint - A value indicating whether the recovery point is multi VM consistent. + IsMultiVMSyncPoint *string `json:"isMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) MarshalJSON() ([]byte, error) { + imavrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavrpd.IsMultiVMSyncPoint != nil { + objectMap["isMultiVmSyncPoint"] = imavrpd.IsMultiVMSyncPoint + } + if imavrpd.InstanceType != "" { + objectMap["instanceType"] = imavrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return &imavrpd, true +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &imavrpd, true +} + +// InMageAzureV2ReplicationDetails inMageAzureV2 provider specific settings. +type InMageAzureV2ReplicationDetails struct { + // InfrastructureVMID - The infrastructure VM Id. + InfrastructureVMID *string `json:"infrastructureVmId,omitempty"` + // VCenterInfrastructureID - The vCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // CompressedDataRateInMB - The compressed data change rate in MB. + CompressedDataRateInMB *float64 `json:"compressedDataRateInMB,omitempty"` + // UncompressedDataRateInMB - The uncompressed data change rate in MB. + UncompressedDataRateInMB *float64 `json:"uncompressedDataRateInMB,omitempty"` + // IPAddress - The source IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // IsAgentUpdateRequired - A value indicating whether installed agent needs to be updated. + IsAgentUpdateRequired *string `json:"isAgentUpdateRequired,omitempty"` + // IsRebootAfterUpdateRequired - A value indicating whether the source server requires a restart after update. + IsRebootAfterUpdateRequired *string `json:"isRebootAfterUpdateRequired,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // ProcessServerName - The process server name. + ProcessServerName *string `json:"processServerName,omitempty"` + // MultiVMGroupID - The multi vm group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi vm sync is enabled or disabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageAzureV2ProtectedDiskDetails `json:"protectedDisks,omitempty"` + // DiskResized - A value indicating whether any disk is resized for this VM. + DiskResized *string `json:"diskResized,omitempty"` + // MasterTargetID - The master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // OsType - The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // VhdName - The OS disk VHD name. + VhdName *string `json:"vhdName,omitempty"` + // OsDiskID - The id of the disk containing the OS. + OsDiskID *string `json:"osDiskId,omitempty"` + // AzureVMDiskDetails - Azure VM Disk details. + AzureVMDiskDetails *[]AzureVMDiskDetails `json:"azureVMDiskDetails,omitempty"` + // RecoveryAzureVMName - Recovery Azure given name. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureVMSize - The Recovery Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureStorageAccount - The recovery Azure storage account. + RecoveryAzureStorageAccount *string `json:"recoveryAzureStorageAccount,omitempty"` + // RecoveryAzureLogStorageAccountID - The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. + RecoveryAzureLogStorageAccountID *string `json:"recoveryAzureLogStorageAccountId,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // SelectedRecoveryAzureNetworkID - The selected recovery azure network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The test failover virtual network. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. Value can be vCenter or physical. + DiscoveryType *string `json:"discoveryType,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // Datastores - The datastores of the on-premise machine. Value can be list of strings that contain datastore names. + Datastores *[]string `json:"datastores,omitempty"` + // TargetVMID - The ARM Id of the target Azure VM. This value will be null until the VM is failed over. Only after failure it will be populated with the ARM Id of the Azure VM. + TargetVMID *string `json:"targetVmId,omitempty"` + // RecoveryAzureResourceGroupID - The target resource group Id. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // ValidationErrors - The validation errors of the on-premise machine Value can be list of validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastUpdateReceivedTime - The last update time received from on-prem components. + LastUpdateReceivedTime *date.Time `json:"lastUpdateReceivedTime,omitempty"` + // ReplicaID - The replica id of the protected item. + ReplicaID *string `json:"replicaId,omitempty"` + // OsVersion - The OS Version of the protected item. + OsVersion *string `json:"osVersion,omitempty"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]InMageAzureV2ManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // FirmwareType - The firmware type of this protected item. + FirmwareType *string `json:"firmwareType,omitempty"` + // AzureVMGeneration - The target generation for this protected item. + AzureVMGeneration *string `json:"azureVmGeneration,omitempty"` + // IsAdditionalStatsAvailable - A value indicating whether additional IR stats are available or not. + IsAdditionalStatsAvailable *bool `json:"isAdditionalStatsAvailable,omitempty"` + // TotalDataTransferred - The total transferred data in bytes. + TotalDataTransferred *int64 `json:"totalDataTransferred,omitempty"` + // TotalProgressHealth - The progress health. + TotalProgressHealth *string `json:"totalProgressHealth,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) MarshalJSON() ([]byte, error) { + imavrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavrd.InfrastructureVMID != nil { + objectMap["infrastructureVmId"] = imavrd.InfrastructureVMID + } + if imavrd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = imavrd.VCenterInfrastructureID + } + if imavrd.ProtectionStage != nil { + objectMap["protectionStage"] = imavrd.ProtectionStage + } + if imavrd.VMID != nil { + objectMap["vmId"] = imavrd.VMID + } + if imavrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = imavrd.VMProtectionState + } + if imavrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = imavrd.VMProtectionStateDescription + } + if imavrd.ResyncProgressPercentage != nil { + objectMap["resyncProgressPercentage"] = imavrd.ResyncProgressPercentage + } + if imavrd.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = imavrd.RpoInSeconds + } + if imavrd.CompressedDataRateInMB != nil { + objectMap["compressedDataRateInMB"] = imavrd.CompressedDataRateInMB + } + if imavrd.UncompressedDataRateInMB != nil { + objectMap["uncompressedDataRateInMB"] = imavrd.UncompressedDataRateInMB + } + if imavrd.IPAddress != nil { + objectMap["ipAddress"] = imavrd.IPAddress + } + if imavrd.AgentVersion != nil { + objectMap["agentVersion"] = imavrd.AgentVersion + } + if imavrd.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = imavrd.AgentExpiryDate + } + if imavrd.IsAgentUpdateRequired != nil { + objectMap["isAgentUpdateRequired"] = imavrd.IsAgentUpdateRequired + } + if imavrd.IsRebootAfterUpdateRequired != nil { + objectMap["isRebootAfterUpdateRequired"] = imavrd.IsRebootAfterUpdateRequired + } + if imavrd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = imavrd.LastHeartbeat + } + if imavrd.ProcessServerID != nil { + objectMap["processServerId"] = imavrd.ProcessServerID + } + if imavrd.ProcessServerName != nil { + objectMap["processServerName"] = imavrd.ProcessServerName + } + if imavrd.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imavrd.MultiVMGroupID + } + if imavrd.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imavrd.MultiVMGroupName + } + if imavrd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imavrd.MultiVMSyncStatus + } + if imavrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imavrd.ProtectedDisks + } + if imavrd.DiskResized != nil { + objectMap["diskResized"] = imavrd.DiskResized + } + if imavrd.MasterTargetID != nil { + objectMap["masterTargetId"] = imavrd.MasterTargetID + } + if imavrd.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = imavrd.SourceVMCPUCount + } + if imavrd.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = imavrd.SourceVMRAMSizeInMB + } + if imavrd.OsType != nil { + objectMap["osType"] = imavrd.OsType + } + if imavrd.VhdName != nil { + objectMap["vhdName"] = imavrd.VhdName + } + if imavrd.OsDiskID != nil { + objectMap["osDiskId"] = imavrd.OsDiskID + } + if imavrd.AzureVMDiskDetails != nil { + objectMap["azureVMDiskDetails"] = imavrd.AzureVMDiskDetails + } + if imavrd.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVMName"] = imavrd.RecoveryAzureVMName + } + if imavrd.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = imavrd.RecoveryAzureVMSize + } + if imavrd.RecoveryAzureStorageAccount != nil { + objectMap["recoveryAzureStorageAccount"] = imavrd.RecoveryAzureStorageAccount + } + if imavrd.RecoveryAzureLogStorageAccountID != nil { + objectMap["recoveryAzureLogStorageAccountId"] = imavrd.RecoveryAzureLogStorageAccountID + } + if imavrd.VMNics != nil { + objectMap["vmNics"] = imavrd.VMNics + } + if imavrd.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = imavrd.SelectedRecoveryAzureNetworkID + } + if imavrd.SelectedTfoAzureNetworkID != nil { + objectMap["selectedTfoAzureNetworkId"] = imavrd.SelectedTfoAzureNetworkID + } + if imavrd.SelectedSourceNicID != nil { + objectMap["selectedSourceNicId"] = imavrd.SelectedSourceNicID + } + if imavrd.DiscoveryType != nil { + objectMap["discoveryType"] = imavrd.DiscoveryType + } + if imavrd.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = imavrd.EnableRdpOnTargetOption + } + if imavrd.Datastores != nil { + objectMap["datastores"] = imavrd.Datastores + } + if imavrd.TargetVMID != nil { + objectMap["targetVmId"] = imavrd.TargetVMID + } + if imavrd.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = imavrd.RecoveryAzureResourceGroupID + } + if imavrd.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = imavrd.RecoveryAvailabilitySetID + } + if imavrd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavrd.TargetAvailabilityZone + } + if imavrd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavrd.TargetProximityPlacementGroupID + } + if imavrd.UseManagedDisks != nil { + objectMap["useManagedDisks"] = imavrd.UseManagedDisks + } + if imavrd.LicenseType != nil { + objectMap["licenseType"] = imavrd.LicenseType + } + if imavrd.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = imavrd.SQLServerLicenseType + } + if imavrd.ValidationErrors != nil { + objectMap["validationErrors"] = imavrd.ValidationErrors + } + if imavrd.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = imavrd.LastRpoCalculatedTime + } + if imavrd.LastUpdateReceivedTime != nil { + objectMap["lastUpdateReceivedTime"] = imavrd.LastUpdateReceivedTime + } + if imavrd.ReplicaID != nil { + objectMap["replicaId"] = imavrd.ReplicaID + } + if imavrd.OsVersion != nil { + objectMap["osVersion"] = imavrd.OsVersion + } + if imavrd.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = imavrd.ProtectedManagedDisks + } + if imavrd.FirmwareType != nil { + objectMap["firmwareType"] = imavrd.FirmwareType + } + if imavrd.AzureVMGeneration != nil { + objectMap["azureVmGeneration"] = imavrd.AzureVMGeneration + } + if imavrd.IsAdditionalStatsAvailable != nil { + objectMap["isAdditionalStatsAvailable"] = imavrd.IsAdditionalStatsAvailable + } + if imavrd.TotalDataTransferred != nil { + objectMap["totalDataTransferred"] = imavrd.TotalDataTransferred + } + if imavrd.TotalProgressHealth != nil { + objectMap["totalProgressHealth"] = imavrd.TotalProgressHealth + } + if imavrd.TargetVMTags != nil { + objectMap["targetVmTags"] = imavrd.TargetVMTags + } + if imavrd.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = imavrd.SeedManagedDiskTags + } + if imavrd.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavrd.TargetManagedDiskTags + } + if imavrd.TargetNicTags != nil { + objectMap["targetNicTags"] = imavrd.TargetNicTags + } + if imavrd.InstanceType != "" { + objectMap["instanceType"] = imavrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return &imavrd, true +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imavrd, true +} + +// InMageAzureV2ReprotectInput inMageAzureV2 specific provider input. +type InMageAzureV2ReprotectInput struct { + // MasterTargetID - The Master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // StorageAccountID - The storage account id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) MarshalJSON() ([]byte, error) { + imavri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavri.MasterTargetID != nil { + objectMap["masterTargetId"] = imavri.MasterTargetID + } + if imavri.ProcessServerID != nil { + objectMap["processServerId"] = imavri.ProcessServerID + } + if imavri.StorageAccountID != nil { + objectMap["storageAccountId"] = imavri.StorageAccountID + } + if imavri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imavri.RunAsAccountID + } + if imavri.PolicyID != nil { + objectMap["policyId"] = imavri.PolicyID + } + if imavri.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imavri.LogStorageAccountID + } + if imavri.DisksToInclude != nil { + objectMap["disksToInclude"] = imavri.DisksToInclude + } + if imavri.InstanceType != "" { + objectMap["instanceType"] = imavri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return &imavri, true +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imavri, true +} + +// InMageAzureV2TestFailoverInput inMageAzureV2 provider specific input for test failover. +type InMageAzureV2TestFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) MarshalJSON() ([]byte, error) { + imavtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imavtfi.RecoveryPointID + } + if imavtfi.InstanceType != "" { + objectMap["instanceType"] = imavtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return &imavtfi, true +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imavtfi, true +} + +// InMageAzureV2UnplannedFailoverInput inMageAzureV2 provider specific input for unplanned failover. +type InMageAzureV2UnplannedFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imavufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imavufi.RecoveryPointID + } + if imavufi.InstanceType != "" { + objectMap["instanceType"] = imavufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return &imavufi, true +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imavufi, true +} + +// InMageAzureV2UpdateReplicationProtectedItemInput inMage Azure V2 input to update replication protected +// item. +type InMageAzureV2UpdateReplicationProtectedItemInput struct { + // RecoveryAzureV1ResourceGroupID - The recovery Azure resource group Id for classic deployment. + RecoveryAzureV1ResourceGroupID *string `json:"recoveryAzureV1ResourceGroupId,omitempty"` + // RecoveryAzureV2ResourceGroupID - The recovery Azure resource group Id for resource manager deployment. + RecoveryAzureV2ResourceGroupID *string `json:"recoveryAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // VMDisks - The list of disk update properties. + VMDisks *[]UpdateDiskInput `json:"vmDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imavurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavurpii.RecoveryAzureV1ResourceGroupID != nil { + objectMap["recoveryAzureV1ResourceGroupId"] = imavurpii.RecoveryAzureV1ResourceGroupID + } + if imavurpii.RecoveryAzureV2ResourceGroupID != nil { + objectMap["recoveryAzureV2ResourceGroupId"] = imavurpii.RecoveryAzureV2ResourceGroupID + } + if imavurpii.UseManagedDisks != nil { + objectMap["useManagedDisks"] = imavurpii.UseManagedDisks + } + if imavurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavurpii.TargetProximityPlacementGroupID + } + if imavurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavurpii.TargetAvailabilityZone + } + if imavurpii.TargetVMTags != nil { + objectMap["targetVmTags"] = imavurpii.TargetVMTags + } + if imavurpii.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavurpii.TargetManagedDiskTags + } + if imavurpii.TargetNicTags != nil { + objectMap["targetNicTags"] = imavurpii.TargetNicTags + } + if imavurpii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = imavurpii.SQLServerLicenseType + } + if imavurpii.VMDisks != nil { + objectMap["vmDisks"] = imavurpii.VMDisks + } + if imavurpii.InstanceType != "" { + objectMap["instanceType"] = imavurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return &imavurpii, true +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &imavurpii, true +} + +// InMageBasePolicyDetails base class for the policies of providers using InMage replication. +type InMageBasePolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) MarshalJSON() ([]byte, error) { + imbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails + objectMap := make(map[string]interface{}) + if imbpd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imbpd.RecoveryPointThresholdInMinutes + } + if imbpd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imbpd.RecoveryPointHistory + } + if imbpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imbpd.AppConsistentFrequencyInMinutes + } + if imbpd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imbpd.MultiVMSyncStatus + } + if imbpd.InstanceType != "" { + objectMap["instanceType"] = imbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return &imbpd, true +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imbpd, true +} + +// InMageDisableProtectionProviderSpecificInput inMage disable protection provider specific input. +type InMageDisableProtectionProviderSpecificInput struct { + // ReplicaVMDeletionStatus - A value indicating whether the replica VM should be destroyed or retained. Values from Delete and Retain. + ReplicaVMDeletionStatus *string `json:"replicaVmDeletionStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeDisableProtectionProviderSpecificInput', 'InstanceTypeInMage' + InstanceType InstanceTypeBasicDisableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + imdppsi.InstanceType = InstanceTypeInMage + objectMap := make(map[string]interface{}) + if imdppsi.ReplicaVMDeletionStatus != nil { + objectMap["replicaVmDeletionStatus"] = imdppsi.ReplicaVMDeletionStatus + } + if imdppsi.InstanceType != "" { + objectMap["instanceType"] = imdppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) { + return &imdppsi, true +} + +// AsDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsBasicDisableProtectionProviderSpecificInput() (BasicDisableProtectionProviderSpecificInput, bool) { + return &imdppsi, true +} + +// InMageDiskDetails vMware/Physical specific Disk Details. +type InMageDiskDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskSizeInMB - The disk size in MB. + DiskSizeInMB *string `json:"diskSizeInMB,omitempty"` + // DiskType - Whether disk is system disk or data disk. + DiskType *string `json:"diskType,omitempty"` + // DiskConfiguration - Whether disk is dynamic disk or basic disk. + DiskConfiguration *string `json:"diskConfiguration,omitempty"` + // VolumeList - Volumes of the disk. + VolumeList *[]DiskVolumeDetails `json:"volumeList,omitempty"` +} + +// InMageDiskExclusionInput diskExclusionInput when doing enable protection of virtual machine in InMage +// provider. +type InMageDiskExclusionInput struct { + // VolumeOptions - The volume label based option for disk exclusion. + VolumeOptions *[]InMageVolumeExclusionOptions `json:"volumeOptions,omitempty"` + // DiskSignatureOptions - The guest disk signature based option for disk exclusion. + DiskSignatureOptions *[]InMageDiskSignatureExclusionOptions `json:"diskSignatureOptions,omitempty"` +} + +// InMageDiskSignatureExclusionOptions guest disk signature based disk exclusion option when doing enable +// protection of virtual machine in InMage provider. +type InMageDiskSignatureExclusionOptions struct { + // DiskSignature - The guest signature of disk to be excluded from replication. + DiskSignature *string `json:"diskSignature,omitempty"` +} + +// InMageEnableProtectionInput vMware Azure specific enable protection input. +type InMageEnableProtectionInput struct { + // VMFriendlyName - The VM Name. + VMFriendlyName *string `json:"vmFriendlyName,omitempty"` + // MasterTargetID - The Master Target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RetentionDrive - The retention drive to use on the MT. + RetentionDrive *string `json:"retentionDrive,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // MultiVMGroupID - The multi VM group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // DiskExclusionInput - The enable disk exclusion input. + DiskExclusionInput *InMageDiskExclusionInput `json:"diskExclusionInput,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) MarshalJSON() ([]byte, error) { + imepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imepi.VMFriendlyName != nil { + objectMap["vmFriendlyName"] = imepi.VMFriendlyName + } + if imepi.MasterTargetID != nil { + objectMap["masterTargetId"] = imepi.MasterTargetID + } + if imepi.ProcessServerID != nil { + objectMap["processServerId"] = imepi.ProcessServerID + } + if imepi.RetentionDrive != nil { + objectMap["retentionDrive"] = imepi.RetentionDrive + } + if imepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imepi.RunAsAccountID + } + if imepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imepi.MultiVMGroupID + } + if imepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imepi.MultiVMGroupName + } + if imepi.DatastoreName != nil { + objectMap["datastoreName"] = imepi.DatastoreName + } + if imepi.DiskExclusionInput != nil { + objectMap["diskExclusionInput"] = imepi.DiskExclusionInput + } + if imepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imepi.DisksToInclude + } + if imepi.InstanceType != "" { + objectMap["instanceType"] = imepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return &imepi, true +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imepi, true +} + +// InMagePolicyDetails inMage specific protection profile details. +type InMagePolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMagePolicyDetails. +func (impd InMagePolicyDetails) MarshalJSON() ([]byte, error) { + impd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage + objectMap := make(map[string]interface{}) + if impd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = impd.RecoveryPointThresholdInMinutes + } + if impd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = impd.RecoveryPointHistory + } + if impd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = impd.AppConsistentFrequencyInMinutes + } + if impd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = impd.MultiVMSyncStatus + } + if impd.InstanceType != "" { + objectMap["instanceType"] = impd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return &impd, true +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &impd, true +} + +// InMagePolicyInput vMWare Azure specific protection profile Input. +type InMagePolicyInput struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMagePolicyInput. +func (impi InMagePolicyInput) MarshalJSON() ([]byte, error) { + impi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if impi.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = impi.RecoveryPointThresholdInMinutes + } + if impi.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = impi.RecoveryPointHistory + } + if impi.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = impi.AppConsistentFrequencyInMinutes + } + if impi.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = impi.MultiVMSyncStatus + } + if impi.InstanceType != "" { + objectMap["instanceType"] = impi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return &impi, true +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &impi, true +} + +// InMageProtectedDiskDetails inMage protected disk details. +type InMageProtectedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // HealthErrorCode - The health error code for the disk. + HealthErrorCode *string `json:"healthErrorCode,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncDurationInSeconds - The resync duration in seconds. + ResyncDurationInSeconds *int64 `json:"resyncDurationInSeconds,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // FileSystemCapacityInBytes - The file system capacity in bytes. + FileSystemCapacityInBytes *int64 `json:"fileSystemCapacityInBytes,omitempty"` + // SourceDataInMB - The source data transit in MB. + SourceDataInMB *float64 `json:"sourceDataInMB,omitempty"` + // PsDataInMB - The PS data transit in MB. + PsDataInMB *float64 `json:"psDataInMB,omitempty"` + // TargetDataInMB - The target data transit in MB. + TargetDataInMB *float64 `json:"targetDataInMB,omitempty"` + // DiskResized - A value indicating whether disk is resized. + DiskResized *string `json:"diskResized,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // ResyncProcessedBytes - The resync processed bytes. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTotalTransferredBytes - The resync total transferred bytes. + ResyncTotalTransferredBytes *int64 `json:"resyncTotalTransferredBytes,omitempty"` + // ResyncLast15MinutesTransferredBytes - The resync last 15 minutes transferred bytes. + ResyncLast15MinutesTransferredBytes *int64 `json:"resyncLast15MinutesTransferredBytes,omitempty"` + // ResyncLastDataTransferTimeUTC - The last data transfer time in UTC. + ResyncLastDataTransferTimeUTC *date.Time `json:"resyncLastDataTransferTimeUTC,omitempty"` + // ResyncStartTime - The resync start time. + ResyncStartTime *date.Time `json:"resyncStartTime,omitempty"` + // ProgressHealth - The Progress Health. + ProgressHealth *string `json:"progressHealth,omitempty"` + // ProgressStatus - The Progress Status. + ProgressStatus *string `json:"progressStatus,omitempty"` +} + +// InMageRcmAgentUpgradeBlockingErrorDetails inMageRcm source agent upgrade blocking error details. +type InMageRcmAgentUpgradeBlockingErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageRcmAgentUpgradeBlockingErrorDetails. +func (imraubed InMageRcmAgentUpgradeBlockingErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmApplyRecoveryPointInput applyRecoveryPoint input specific to InMageRcm provider. +type InMageRcmApplyRecoveryPointInput struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + imrarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrarpi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrarpi.RecoveryPointID + } + if imrarpi.InstanceType != "" { + objectMap["instanceType"] = imrarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return &imrarpi, true +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &imrarpi, true +} + +// InMageRcmDiscoveredProtectedVMDetails inMageRcm discovered protected VM details. +type InMageRcmDiscoveredProtectedVMDetails struct { + // VCenterID - READ-ONLY; The VCenter Id. + VCenterID *string `json:"vCenterId,omitempty"` + // VCenterFqdn - READ-ONLY; The VCenter fqdn. + VCenterFqdn *string `json:"vCenterFqdn,omitempty"` + // Datastores - READ-ONLY; The list of datastores. + Datastores *[]string `json:"datastores,omitempty"` + // IPAddresses - READ-ONLY; The list of IP addresses. + IPAddresses *[]string `json:"ipAddresses,omitempty"` + // VmwareToolsStatus - READ-ONLY; The VMware tools status. + VmwareToolsStatus *string `json:"vmwareToolsStatus,omitempty"` + // PowerStatus - READ-ONLY; The VM power status. + PowerStatus *string `json:"powerStatus,omitempty"` + // VMFqdn - READ-ONLY; The VM fqdn. + VMFqdn *string `json:"vmFqdn,omitempty"` + // OsName - READ-ONLY; The VM's OS name. + OsName *string `json:"osName,omitempty"` + // CreatedTimestamp - READ-ONLY; The SDS created timestamp. + CreatedTimestamp *date.Time `json:"createdTimestamp,omitempty"` + // UpdatedTimestamp - READ-ONLY; The SDS updated timestamp. + UpdatedTimestamp *date.Time `json:"updatedTimestamp,omitempty"` + // IsDeleted - READ-ONLY; A value indicating whether the VM is deleted. + IsDeleted *bool `json:"isDeleted,omitempty"` + // LastDiscoveryTimeInUtc - READ-ONLY; The last time when SDS information discovered in SRS. + LastDiscoveryTimeInUtc *date.Time `json:"lastDiscoveryTimeInUtc,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmDiscoveredProtectedVMDetails. +func (imrdpvd InMageRcmDiscoveredProtectedVMDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmDiskInput inMageRcm disk input. +type InMageRcmDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageRcmDisksDefaultInput inMageRcm disk input. +type InMageRcmDisksDefaultInput struct { + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageRcmEnableProtectionInput inMageRcm specific enable protection input. +type InMageRcmEnableProtectionInput struct { + // FabricDiscoveryMachineID - The ARM Id of discovered machine. + FabricDiscoveryMachineID *string `json:"fabricDiscoveryMachineId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]InMageRcmDiskInput `json:"disksToInclude,omitempty"` + // DisksDefault - The default disk input. + DisksDefault *InMageRcmDisksDefaultInput `json:"disksDefault,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetNetworkID - The selected target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The selected test network ARM Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // TargetSubnetName - The selected target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TestSubnetName - The selected test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // RunAsAccountID - The run-as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) MarshalJSON() ([]byte, error) { + imrepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrepi.FabricDiscoveryMachineID != nil { + objectMap["fabricDiscoveryMachineId"] = imrepi.FabricDiscoveryMachineID + } + if imrepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imrepi.DisksToInclude + } + if imrepi.DisksDefault != nil { + objectMap["disksDefault"] = imrepi.DisksDefault + } + if imrepi.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrepi.TargetResourceGroupID + } + if imrepi.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrepi.TargetNetworkID + } + if imrepi.TestNetworkID != nil { + objectMap["testNetworkId"] = imrepi.TestNetworkID + } + if imrepi.TargetSubnetName != nil { + objectMap["targetSubnetName"] = imrepi.TargetSubnetName + } + if imrepi.TestSubnetName != nil { + objectMap["testSubnetName"] = imrepi.TestSubnetName + } + if imrepi.TargetVMName != nil { + objectMap["targetVmName"] = imrepi.TargetVMName + } + if imrepi.TargetVMSize != nil { + objectMap["targetVmSize"] = imrepi.TargetVMSize + } + if imrepi.LicenseType != "" { + objectMap["licenseType"] = imrepi.LicenseType + } + if imrepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrepi.TargetAvailabilitySetID + } + if imrepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrepi.TargetAvailabilityZone + } + if imrepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrepi.TargetProximityPlacementGroupID + } + if imrepi.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrepi.TargetBootDiagnosticsStorageAccountID + } + if imrepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imrepi.RunAsAccountID + } + if imrepi.ProcessServerID != nil { + objectMap["processServerId"] = imrepi.ProcessServerID + } + if imrepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imrepi.MultiVMGroupName + } + if imrepi.InstanceType != "" { + objectMap["instanceType"] = imrepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return &imrepi, true +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imrepi, true +} + +// InMageRcmEventDetails event details for InMageRcm provider. +type InMageRcmEventDetails struct { + // ProtectedItemName - READ-ONLY; The protected item name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // VMName - READ-ONLY; The protected item name. + VMName *string `json:"vmName,omitempty"` + // LatestAgentVersion - READ-ONLY; The latest agent version. + LatestAgentVersion *string `json:"latestAgentVersion,omitempty"` + // JobID - READ-ONLY; The job Id. + JobID *string `json:"jobId,omitempty"` + // FabricName - READ-ONLY; The fabric name. + FabricName *string `json:"fabricName,omitempty"` + // ApplianceName - READ-ONLY; The appliance name. + ApplianceName *string `json:"applianceName,omitempty"` + // ServerType - READ-ONLY; The server type. + ServerType *string `json:"serverType,omitempty"` + // ComponentDisplayName - READ-ONLY; The component display name. + ComponentDisplayName *string `json:"componentDisplayName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) MarshalJSON() ([]byte, error) { + imred.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imred.InstanceType != "" { + objectMap["instanceType"] = imred.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return &imred, true +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imred, true +} + +// InMageRcmFabricCreationInput inMageRcm fabric provider specific settings. +type InMageRcmFabricCreationInput struct { + // VmwareSiteID - The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // SourceAgentIdentity - The identity provider input for source agent authentication. + SourceAgentIdentity *IdentityProviderInput `json:"sourceAgentIdentity,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreationInput', 'InstanceTypeAzure', 'InstanceTypeInMageRcm', 'InstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) MarshalJSON() ([]byte, error) { + imrfci.InstanceType = InstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrfci.VmwareSiteID != nil { + objectMap["vmwareSiteId"] = imrfci.VmwareSiteID + } + if imrfci.PhysicalSiteID != nil { + objectMap["physicalSiteId"] = imrfci.PhysicalSiteID + } + if imrfci.SourceAgentIdentity != nil { + objectMap["sourceAgentIdentity"] = imrfci.SourceAgentIdentity + } + if imrfci.InstanceType != "" { + objectMap["instanceType"] = imrfci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return &imrfci, true +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &imrfci, true +} + +// InMageRcmFabricSpecificDetails inMageRcm fabric specific details. +type InMageRcmFabricSpecificDetails struct { + // VmwareSiteID - READ-ONLY; The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - READ-ONLY; The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // ServiceEndpoint - READ-ONLY; The service endpoint. + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` + // ServiceResourceID - READ-ONLY; The service resource Id. + ServiceResourceID *string `json:"serviceResourceId,omitempty"` + // ServiceContainerID - READ-ONLY; The service container Id. + ServiceContainerID *string `json:"serviceContainerId,omitempty"` + // DataPlaneURI - READ-ONLY; The data plane Uri. + DataPlaneURI *string `json:"dataPlaneUri,omitempty"` + // ControlPlaneURI - READ-ONLY; The control plane Uri. + ControlPlaneURI *string `json:"controlPlaneUri,omitempty"` + // SourceAgentIdentityDetails - The source agent identity details. + SourceAgentIdentityDetails *IdentityProviderDetails `json:"sourceAgentIdentityDetails,omitempty"` + // ProcessServers - READ-ONLY; The list of process servers. + ProcessServers *[]ProcessServerDetails `json:"processServers,omitempty"` + // RcmProxies - READ-ONLY; The list of RCM proxies. + RcmProxies *[]RcmProxyDetails `json:"rcmProxies,omitempty"` + // PushInstallers - READ-ONLY; The list of push installers. + PushInstallers *[]PushInstallerDetails `json:"pushInstallers,omitempty"` + // ReplicationAgents - READ-ONLY; The list of replication agents. + ReplicationAgents *[]ReplicationAgentDetails `json:"replicationAgents,omitempty"` + // ReprotectAgents - READ-ONLY; The list of reprotect agents. + ReprotectAgents *[]ReprotectAgentDetails `json:"reprotectAgents,omitempty"` + // MarsAgents - READ-ONLY; The list of Mars agents. + MarsAgents *[]MarsAgentDetails `json:"marsAgents,omitempty"` + // Dras - READ-ONLY; The list of DRAs. + Dras *[]DraDetails `json:"dras,omitempty"` + // AgentDetails - READ-ONLY; The list of agent details. + AgentDetails *[]AgentDetails `json:"agentDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) MarshalJSON() ([]byte, error) { + imrfsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrfsd.SourceAgentIdentityDetails != nil { + objectMap["sourceAgentIdentityDetails"] = imrfsd.SourceAgentIdentityDetails + } + if imrfsd.InstanceType != "" { + objectMap["instanceType"] = imrfsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return &imrfsd, true +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &imrfsd, true +} + +// InMageRcmFailbackDiscoveredProtectedVMDetails inMageRcmFailback discovered VM details. +type InMageRcmFailbackDiscoveredProtectedVMDetails struct { + // VCenterID - READ-ONLY; The VCenter Id. + VCenterID *string `json:"vCenterId,omitempty"` + // VCenterFqdn - READ-ONLY; The VCenter fqdn. + VCenterFqdn *string `json:"vCenterFqdn,omitempty"` + // Datastores - READ-ONLY; The list of datastores. + Datastores *[]string `json:"datastores,omitempty"` + // IPAddresses - READ-ONLY; The list of IP addresses. + IPAddresses *[]string `json:"ipAddresses,omitempty"` + // VmwareToolsStatus - READ-ONLY; The VMware tools status. + VmwareToolsStatus *string `json:"vmwareToolsStatus,omitempty"` + // PowerStatus - READ-ONLY; The VM power status. + PowerStatus *string `json:"powerStatus,omitempty"` + // VMFqdn - READ-ONLY; The VM fqdn. + VMFqdn *string `json:"vmFqdn,omitempty"` + // OsName - READ-ONLY; The VM's OS name. + OsName *string `json:"osName,omitempty"` + // CreatedTimestamp - READ-ONLY; The SDS created timestamp. + CreatedTimestamp *date.Time `json:"createdTimestamp,omitempty"` + // UpdatedTimestamp - READ-ONLY; The SDS updated timestamp. + UpdatedTimestamp *date.Time `json:"updatedTimestamp,omitempty"` + // IsDeleted - READ-ONLY; A value indicating whether the VM is deleted. + IsDeleted *bool `json:"isDeleted,omitempty"` + // LastDiscoveryTimeInUtc - READ-ONLY; The last time when SDS information discovered in SRS. + LastDiscoveryTimeInUtc *date.Time `json:"lastDiscoveryTimeInUtc,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackDiscoveredProtectedVMDetails. +func (imrfdpvd InMageRcmFailbackDiscoveredProtectedVMDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackEventDetails event details for InMageRcmFailback provider. +type InMageRcmFailbackEventDetails struct { + // ProtectedItemName - READ-ONLY; The protected item name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // VMName - READ-ONLY; The protected item name. + VMName *string `json:"vmName,omitempty"` + // ApplianceName - READ-ONLY; The appliance name. + ApplianceName *string `json:"applianceName,omitempty"` + // ServerType - READ-ONLY; The server type. + ServerType *string `json:"serverType,omitempty"` + // ComponentDisplayName - READ-ONLY; The component display name. + ComponentDisplayName *string `json:"componentDisplayName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) MarshalJSON() ([]byte, error) { + imrfed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfed.InstanceType != "" { + objectMap["instanceType"] = imrfed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return &imrfed, true +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imrfed, true +} + +// InMageRcmFailbackMobilityAgentDetails inMageRcmFailback mobility agent details. +type InMageRcmFailbackMobilityAgentDetails struct { + // Version - READ-ONLY; The agent version. + Version *string `json:"version,omitempty"` + // LatestVersion - READ-ONLY; The latest agent version available. + LatestVersion *string `json:"latestVersion,omitempty"` + // DriverVersion - READ-ONLY; The driver version. + DriverVersion *string `json:"driverVersion,omitempty"` + // LatestUpgradableVersionWithoutReboot - READ-ONLY; The latest upgradeable version available without reboot. + LatestUpgradableVersionWithoutReboot *string `json:"latestUpgradableVersionWithoutReboot,omitempty"` + // AgentVersionExpiryDate - READ-ONLY; The agent version expiry date. + AgentVersionExpiryDate *date.Time `json:"agentVersionExpiryDate,omitempty"` + // DriverVersionExpiryDate - READ-ONLY; The driver version expiry date. + DriverVersionExpiryDate *date.Time `json:"driverVersionExpiryDate,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The time of the last heartbeat received from the agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // ReasonsBlockingUpgrade - READ-ONLY; The whether update is possible or not. + ReasonsBlockingUpgrade *[]AgentUpgradeBlockedReason `json:"reasonsBlockingUpgrade,omitempty"` + // IsUpgradeable - READ-ONLY; A value indicating whether agent is upgradeable or not. + IsUpgradeable *string `json:"isUpgradeable,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackMobilityAgentDetails. +func (imrfmad InMageRcmFailbackMobilityAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackNicDetails inMageRcmFailback NIC details. +type InMageRcmFailbackNicDetails struct { + // MacAddress - READ-ONLY; The mac address. + MacAddress *string `json:"macAddress,omitempty"` + // NetworkName - READ-ONLY; The network name. + NetworkName *string `json:"networkName,omitempty"` + // AdapterType - READ-ONLY; The adapter type. + AdapterType *string `json:"adapterType,omitempty"` + // SourceIPAddress - READ-ONLY; The IP address. + SourceIPAddress *string `json:"sourceIpAddress,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackNicDetails. +func (imrfnd InMageRcmFailbackNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackPlannedFailoverProviderInput provider specific input for InMageRcmFailback failover. +type InMageRcmFailbackPlannedFailoverProviderInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'ApplicationConsistent', 'CrashConsistent' + RecoveryPointType InMageRcmFailbackRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) MarshalJSON() ([]byte, error) { + imrfpfpi.InstanceType = InstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpfpi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imrfpfpi.RecoveryPointType + } + if imrfpfpi.InstanceType != "" { + objectMap["instanceType"] = imrfpfpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return &imrfpfpi, true +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &imrfpfpi, true +} + +// InMageRcmFailbackPolicyCreationInput inMageRcmFailback policy creation input. +type InMageRcmFailbackPolicyCreationInput struct { + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) MarshalJSON() ([]byte, error) { + imrfpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrfpci.CrashConsistentFrequencyInMinutes + } + if imrfpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrfpci.AppConsistentFrequencyInMinutes + } + if imrfpci.InstanceType != "" { + objectMap["instanceType"] = imrfpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return &imrfpci, true +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imrfpci, true +} + +// InMageRcmFailbackPolicyDetails inMageRcm failback specific policy details. +type InMageRcmFailbackPolicyDetails struct { + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) MarshalJSON() ([]byte, error) { + imrfpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrfpd.AppConsistentFrequencyInMinutes + } + if imrfpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrfpd.CrashConsistentFrequencyInMinutes + } + if imrfpd.InstanceType != "" { + objectMap["instanceType"] = imrfpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return &imrfpd, true +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imrfpd, true +} + +// InMageRcmFailbackProtectedDiskDetails inMageRcmFailback protected disk details. +type InMageRcmFailbackProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk Id (reported by source agent). + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // DiskUUID - READ-ONLY; The disk Uuid (reported by vCenter). + DiskUUID *string `json:"diskUuid,omitempty"` + // DataPendingInLogDataStoreInMB - READ-ONLY; The data pending in log data store in MB. + DataPendingInLogDataStoreInMB *float64 `json:"dataPendingInLogDataStoreInMB,omitempty"` + // DataPendingAtSourceAgentInMB - READ-ONLY; The data pending at source agent in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // IsInitialReplicationComplete - READ-ONLY; A value indicating whether initial replication is complete or not. + IsInitialReplicationComplete *string `json:"isInitialReplicationComplete,omitempty"` + // IrDetails - The initial replication details. + IrDetails *InMageRcmFailbackSyncDetails `json:"irDetails,omitempty"` + // ResyncDetails - The resync details. + ResyncDetails *InMageRcmFailbackSyncDetails `json:"resyncDetails,omitempty"` + // LastSyncTime - READ-ONLY; The last sync time. + LastSyncTime *date.Time `json:"lastSyncTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackProtectedDiskDetails. +func (imrfpdd InMageRcmFailbackProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrfpdd.IrDetails != nil { + objectMap["irDetails"] = imrfpdd.IrDetails + } + if imrfpdd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrfpdd.ResyncDetails + } + return json.Marshal(objectMap) +} + +// InMageRcmFailbackReplicationDetails inMageRcmFailback provider specific details. +type InMageRcmFailbackReplicationDetails struct { + // InternalIdentifier - READ-ONLY; The virtual machine internal identifier. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // AzureVirtualMachineID - READ-ONLY; The ARM Id of the azure VM. + AzureVirtualMachineID *string `json:"azureVirtualMachineId,omitempty"` + // MultiVMGroupName - READ-ONLY; The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // ReprotectAgentID - READ-ONLY; The reprotect agent Id. + ReprotectAgentID *string `json:"reprotectAgentId,omitempty"` + // ReprotectAgentName - READ-ONLY; The reprotect agent name. + ReprotectAgentName *string `json:"reprotectAgentName,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // TargetvCenterID - READ-ONLY; The target vCenter Id. + TargetvCenterID *string `json:"targetvCenterId,omitempty"` + // TargetDataStoreName - READ-ONLY; The target datastore name. + TargetDataStoreName *string `json:"targetDataStoreName,omitempty"` + // TargetVMName - READ-ONLY; The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // InitialReplicationProgressPercentage - READ-ONLY; The initial replication progress percentage. + InitialReplicationProgressPercentage *int32 `json:"initialReplicationProgressPercentage,omitempty"` + // InitialReplicationProcessedBytes - READ-ONLY; The initial replication processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + InitialReplicationProcessedBytes *int64 `json:"initialReplicationProcessedBytes,omitempty"` + // InitialReplicationTransferredBytes - READ-ONLY; The initial replication transferred bytes from source VM to target for all selected disks on source VM. + InitialReplicationTransferredBytes *int64 `json:"initialReplicationTransferredBytes,omitempty"` + // InitialReplicationProgressHealth - READ-ONLY; The initial replication progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + InitialReplicationProgressHealth VMReplicationProgressHealth `json:"initialReplicationProgressHealth,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncProcessedBytes - READ-ONLY; The resync processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTransferredBytes - READ-ONLY; The resync transferred bytes from source VM to target for all selected disks on source VM. + ResyncTransferredBytes *int64 `json:"resyncTransferredBytes,omitempty"` + // ResyncProgressHealth - READ-ONLY; The resync progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + ResyncProgressHealth VMReplicationProgressHealth `json:"resyncProgressHealth,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageRcmFailbackProtectedDiskDetails `json:"protectedDisks,omitempty"` + // MobilityAgentDetails - The mobility agent information. + MobilityAgentDetails *InMageRcmFailbackMobilityAgentDetails `json:"mobilityAgentDetails,omitempty"` + // VMNics - The network details. + VMNics *[]InMageRcmFailbackNicDetails `json:"vmNics,omitempty"` + // LastPlannedFailoverStartTime - READ-ONLY; The last planned failover start time. + LastPlannedFailoverStartTime *date.Time `json:"lastPlannedFailoverStartTime,omitempty"` + // LastPlannedFailoverStatus - READ-ONLY; The last planned failover status. Possible values include: 'PlannedFailoverStatusSucceeded', 'PlannedFailoverStatusFailed', 'PlannedFailoverStatusCancelled', 'PlannedFailoverStatusUnknown' + LastPlannedFailoverStatus PlannedFailoverStatus `json:"lastPlannedFailoverStatus,omitempty"` + // DiscoveredVMDetails - The discovered VM information. + DiscoveredVMDetails *InMageRcmFailbackDiscoveredProtectedVMDetails `json:"discoveredVmDetails,omitempty"` + // LastUsedPolicyID - READ-ONLY; The policy Id used by the forward replication. + LastUsedPolicyID *string `json:"lastUsedPolicyId,omitempty"` + // LastUsedPolicyFriendlyName - READ-ONLY; The policy friendly name used by the forward replication. + LastUsedPolicyFriendlyName *string `json:"lastUsedPolicyFriendlyName,omitempty"` + // IsAgentRegistrationSuccessfulAfterFailover - READ-ONLY; A value indicating whether agent registration was successful after failover. + IsAgentRegistrationSuccessfulAfterFailover *bool `json:"isAgentRegistrationSuccessfulAfterFailover,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) MarshalJSON() ([]byte, error) { + imrfrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrfrd.ProtectedDisks + } + if imrfrd.MobilityAgentDetails != nil { + objectMap["mobilityAgentDetails"] = imrfrd.MobilityAgentDetails + } + if imrfrd.VMNics != nil { + objectMap["vmNics"] = imrfrd.VMNics + } + if imrfrd.DiscoveredVMDetails != nil { + objectMap["discoveredVmDetails"] = imrfrd.DiscoveredVMDetails + } + if imrfrd.InstanceType != "" { + objectMap["instanceType"] = imrfrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return &imrfrd, true +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrfrd, true +} + +// InMageRcmFailbackReprotectInput inMageRcmFailback specific provider input. +type InMageRcmFailbackReprotectInput struct { + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RunAsAccountID - The run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) MarshalJSON() ([]byte, error) { + imrfri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfri.ProcessServerID != nil { + objectMap["processServerId"] = imrfri.ProcessServerID + } + if imrfri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imrfri.RunAsAccountID + } + if imrfri.PolicyID != nil { + objectMap["policyId"] = imrfri.PolicyID + } + if imrfri.InstanceType != "" { + objectMap["instanceType"] = imrfri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return &imrfri, true +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imrfri, true +} + +// InMageRcmFailbackSyncDetails inMageRcmFailback disk level sync details. +type InMageRcmFailbackSyncDetails struct { + // ProgressHealth - READ-ONLY; The progress health. Possible values include: 'None', 'InProgress', 'SlowProgress', 'NoProgress', 'Queued' + ProgressHealth DiskReplicationProgressHealth `json:"progressHealth,omitempty"` + // TransferredBytes - READ-ONLY; The transferred bytes from source VM to azure for the disk. + TransferredBytes *int64 `json:"transferredBytes,omitempty"` + // Last15MinutesTransferredBytes - READ-ONLY; The bytes transferred in last 15 minutes from source VM to target. + Last15MinutesTransferredBytes *int64 `json:"last15MinutesTransferredBytes,omitempty"` + // LastDataTransferTimeUtc - READ-ONLY; The time of the last data transfer from source VM to target. + LastDataTransferTimeUtc *string `json:"lastDataTransferTimeUtc,omitempty"` + // ProcessedBytes - READ-ONLY; The total processed bytes. This includes bytes that are transferred from source VM to target and matched bytes. + ProcessedBytes *int64 `json:"processedBytes,omitempty"` + // StartTime - READ-ONLY; The start time. + StartTime *string `json:"startTime,omitempty"` + // LastRefreshTime - READ-ONLY; The last refresh time. + LastRefreshTime *string `json:"lastRefreshTime,omitempty"` + // ProgressPercentage - READ-ONLY; Progress in percentage. Progress percentage is calculated based on processed bytes. + ProgressPercentage *int32 `json:"progressPercentage,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackSyncDetails. +func (imrfsd InMageRcmFailbackSyncDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmLastAgentUpgradeErrorDetails inMageRcm last source agent upgrade error details. +type InMageRcmLastAgentUpgradeErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageRcmLastAgentUpgradeErrorDetails. +func (imrlaued InMageRcmLastAgentUpgradeErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmMobilityAgentDetails inMageRcm mobility agent details. +type InMageRcmMobilityAgentDetails struct { + // Version - READ-ONLY; The agent version. + Version *string `json:"version,omitempty"` + // LatestVersion - READ-ONLY; The latest agent version available. + LatestVersion *string `json:"latestVersion,omitempty"` + // LatestAgentReleaseDate - READ-ONLY; The latest agent version release date. + LatestAgentReleaseDate *string `json:"latestAgentReleaseDate,omitempty"` + // DriverVersion - READ-ONLY; The driver version. + DriverVersion *string `json:"driverVersion,omitempty"` + // LatestUpgradableVersionWithoutReboot - READ-ONLY; The latest upgradeable version available without reboot. + LatestUpgradableVersionWithoutReboot *string `json:"latestUpgradableVersionWithoutReboot,omitempty"` + // AgentVersionExpiryDate - READ-ONLY; The agent version expiry date. + AgentVersionExpiryDate *date.Time `json:"agentVersionExpiryDate,omitempty"` + // DriverVersionExpiryDate - READ-ONLY; The driver version expiry date. + DriverVersionExpiryDate *date.Time `json:"driverVersionExpiryDate,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The time of the last heartbeat received from the agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // ReasonsBlockingUpgrade - READ-ONLY; The whether update is possible or not. + ReasonsBlockingUpgrade *[]AgentUpgradeBlockedReason `json:"reasonsBlockingUpgrade,omitempty"` + // IsUpgradeable - READ-ONLY; A value indicating whether agent is upgradeable or not. + IsUpgradeable *string `json:"isUpgradeable,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmMobilityAgentDetails. +func (imrmad InMageRcmMobilityAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmNicDetails inMageRcm NIC details. +type InMageRcmNicDetails struct { + // NicID - READ-ONLY; The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // IsSelectedForFailover - A value indicating whether this NIC is selected for failover. + IsSelectedForFailover *string `json:"isSelectedForFailover,omitempty"` + // SourceIPAddress - READ-ONLY; The source IP address. + SourceIPAddress *string `json:"sourceIPAddress,omitempty"` + // SourceIPAddressType - READ-ONLY; The source IP address type. Possible values include: 'Dynamic', 'Static' + SourceIPAddressType EthernetAddressType `json:"sourceIPAddressType,omitempty"` + // SourceNetworkID - READ-ONLY; Source network Id. + SourceNetworkID *string `json:"sourceNetworkId,omitempty"` + // SourceSubnetName - READ-ONLY; Source subnet name. + SourceSubnetName *string `json:"sourceSubnetName,omitempty"` + // TargetIPAddress - The target IP address. + TargetIPAddress *string `json:"targetIPAddress,omitempty"` + // TargetIPAddressType - The target IP address type. Possible values include: 'Dynamic', 'Static' + TargetIPAddressType EthernetAddressType `json:"targetIPAddressType,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TestSubnetName - Test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TestIPAddress - The test IP address. + TestIPAddress *string `json:"testIPAddress,omitempty"` + // TestIPAddressType - The test IP address type. Possible values include: 'Dynamic', 'Static' + TestIPAddressType EthernetAddressType `json:"testIPAddressType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmNicDetails. +func (imrnd InMageRcmNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrnd.IsPrimaryNic != nil { + objectMap["isPrimaryNic"] = imrnd.IsPrimaryNic + } + if imrnd.IsSelectedForFailover != nil { + objectMap["isSelectedForFailover"] = imrnd.IsSelectedForFailover + } + if imrnd.TargetIPAddress != nil { + objectMap["targetIPAddress"] = imrnd.TargetIPAddress + } + if imrnd.TargetIPAddressType != "" { + objectMap["targetIPAddressType"] = imrnd.TargetIPAddressType + } + if imrnd.TargetSubnetName != nil { + objectMap["targetSubnetName"] = imrnd.TargetSubnetName + } + if imrnd.TestSubnetName != nil { + objectMap["testSubnetName"] = imrnd.TestSubnetName + } + if imrnd.TestIPAddress != nil { + objectMap["testIPAddress"] = imrnd.TestIPAddress + } + if imrnd.TestIPAddressType != "" { + objectMap["testIPAddressType"] = imrnd.TestIPAddressType + } + return json.Marshal(objectMap) +} + +// InMageRcmNicInput inMageRcm NIC input. +type InMageRcmNicInput struct { + // NicID - The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // IsSelectedForFailover - A value indicating whether this NIC is selected for failover. + IsSelectedForFailover *string `json:"isSelectedForFailover,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetStaticIPAddress - The target static IP address. + TargetStaticIPAddress *string `json:"targetStaticIPAddress,omitempty"` + // TestSubnetName - The test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TestStaticIPAddress - The test static IP address. + TestStaticIPAddress *string `json:"testStaticIPAddress,omitempty"` +} + +// InMageRcmPolicyCreationInput inMageRcm policy creation input. +type InMageRcmPolicyCreationInput struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // EnableMultiVMSync - A value indicating whether multi-VM sync has to be enabled. + EnableMultiVMSync *string `json:"enableMultiVmSync,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) MarshalJSON() ([]byte, error) { + imrpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpci.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = imrpci.RecoveryPointHistoryInMinutes + } + if imrpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrpci.CrashConsistentFrequencyInMinutes + } + if imrpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrpci.AppConsistentFrequencyInMinutes + } + if imrpci.EnableMultiVMSync != nil { + objectMap["enableMultiVmSync"] = imrpci.EnableMultiVMSync + } + if imrpci.InstanceType != "" { + objectMap["instanceType"] = imrpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return &imrpci, true +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imrpci, true +} + +// InMageRcmPolicyDetails inMageRcm specific policy details. +type InMageRcmPolicyDetails struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // EnableMultiVMSync - A value indicating whether multi-VM sync has to be enabled. + EnableMultiVMSync *string `json:"enableMultiVmSync,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) MarshalJSON() ([]byte, error) { + imrpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpd.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = imrpd.RecoveryPointHistoryInMinutes + } + if imrpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrpd.AppConsistentFrequencyInMinutes + } + if imrpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrpd.CrashConsistentFrequencyInMinutes + } + if imrpd.EnableMultiVMSync != nil { + objectMap["enableMultiVmSync"] = imrpd.EnableMultiVMSync + } + if imrpd.InstanceType != "" { + objectMap["instanceType"] = imrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return &imrpd, true +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imrpd, true +} + +// InMageRcmProtectedDiskDetails inMageRcm protected disk details. +type InMageRcmProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskEncryptionSetID - READ-ONLY; The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // SeedManagedDiskID - READ-ONLY; The ARM Id of the seed managed disk. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // TargetManagedDiskID - READ-ONLY; The ARM Id of the target managed disk. + TargetManagedDiskID *string `json:"targetManagedDiskId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DataPendingInLogDataStoreInMB - READ-ONLY; The data pending in log data store in MB. + DataPendingInLogDataStoreInMB *float64 `json:"dataPendingInLogDataStoreInMB,omitempty"` + // DataPendingAtSourceAgentInMB - READ-ONLY; The data pending at source agent in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // IsInitialReplicationComplete - READ-ONLY; A value indicating whether initial replication is complete or not. + IsInitialReplicationComplete *string `json:"isInitialReplicationComplete,omitempty"` + // IrDetails - The initial replication details. + IrDetails *InMageRcmSyncDetails `json:"irDetails,omitempty"` + // ResyncDetails - The resync details. + ResyncDetails *InMageRcmSyncDetails `json:"resyncDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmProtectedDiskDetails. +func (imrpdd InMageRcmProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrpdd.DiskType != "" { + objectMap["diskType"] = imrpdd.DiskType + } + if imrpdd.IrDetails != nil { + objectMap["irDetails"] = imrpdd.IrDetails + } + if imrpdd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrpdd.ResyncDetails + } + return json.Marshal(objectMap) +} + +// InMageRcmProtectionContainerMappingDetails inMageRcm provider specific container mapping details. +type InMageRcmProtectionContainerMappingDetails struct { + // EnableAgentAutoUpgrade - READ-ONLY; A value indicating whether the flag for enable agent auto upgrade. + EnableAgentAutoUpgrade *string `json:"enableAgentAutoUpgrade,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + imrpcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpcmd.InstanceType != "" { + objectMap["instanceType"] = imrpcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return &imrpcmd, true +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &imrpcmd, true +} + +// InMageRcmRecoveryPointDetails inMageRcm provider specific recovery point details. +type InMageRcmRecoveryPointDetails struct { + // IsMultiVMSyncPoint - READ-ONLY; A value indicating whether the recovery point is multi VM consistent. + IsMultiVMSyncPoint *string `json:"isMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) MarshalJSON() ([]byte, error) { + imrrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrrpd.InstanceType != "" { + objectMap["instanceType"] = imrrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return &imrrpd, true +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &imrrpd, true +} + +// InMageRcmReplicationDetails inMageRcm provider specific details. +type InMageRcmReplicationDetails struct { + // InternalIdentifier - READ-ONLY; The virtual machine internal identifier. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // FabricDiscoveryMachineID - READ-ONLY; The ARM Id of the discovered VM. + FabricDiscoveryMachineID *string `json:"fabricDiscoveryMachineId,omitempty"` + // MultiVMGroupName - READ-ONLY; The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DiscoveryType - READ-ONLY; The type of the discovered VM. + DiscoveryType *string `json:"discoveryType,omitempty"` + // ProcessServerID - READ-ONLY; The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // ProcessorCoreCount - READ-ONLY; The processor core count. + ProcessorCoreCount *int32 `json:"processorCoreCount,omitempty"` + // AllocatedMemoryInMB - READ-ONLY; The allocated memory in MB. + AllocatedMemoryInMB *float64 `json:"allocatedMemoryInMB,omitempty"` + // ProcessServerName - READ-ONLY; The process server name. + ProcessServerName *string `json:"processServerName,omitempty"` + // RunAsAccountID - READ-ONLY; The run-as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // FirmwareType - READ-ONLY; The firmware type. + FirmwareType *string `json:"firmwareType,omitempty"` + // PrimaryNicIPAddress - READ-ONLY; The IP address of the primary network interface. + PrimaryNicIPAddress *string `json:"primaryNicIpAddress,omitempty"` + // TargetGeneration - READ-ONLY; The target generation. + TargetGeneration *string `json:"targetGeneration,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // TargetVMName - Target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetLocation - The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // TargetAvailabilitySetID - The target availability set Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The test network Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // FailoverRecoveryPointID - READ-ONLY; The recovery point Id to which the VM was failed over. + FailoverRecoveryPointID *string `json:"failoverRecoveryPointId,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // LastRpoInSeconds - READ-ONLY; The last recovery point objective value. + LastRpoInSeconds *int64 `json:"lastRpoInSeconds,omitempty"` + // LastRpoCalculatedTime - READ-ONLY; The last recovery point objective calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastRecoveryPointID - READ-ONLY; The last recovery point Id. + LastRecoveryPointID *string `json:"lastRecoveryPointId,omitempty"` + // InitialReplicationProgressPercentage - READ-ONLY; The initial replication progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + InitialReplicationProgressPercentage *int32 `json:"initialReplicationProgressPercentage,omitempty"` + // InitialReplicationProcessedBytes - READ-ONLY; The initial replication processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + InitialReplicationProcessedBytes *int64 `json:"initialReplicationProcessedBytes,omitempty"` + // InitialReplicationTransferredBytes - READ-ONLY; The initial replication transferred bytes from source VM to azure for all selected disks on source VM. + InitialReplicationTransferredBytes *int64 `json:"initialReplicationTransferredBytes,omitempty"` + // InitialReplicationProgressHealth - READ-ONLY; The initial replication progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + InitialReplicationProgressHealth VMReplicationProgressHealth `json:"initialReplicationProgressHealth,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncProcessedBytes - READ-ONLY; The resync processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTransferredBytes - READ-ONLY; The resync transferred bytes from source VM to azure for all selected disks on source VM. + ResyncTransferredBytes *int64 `json:"resyncTransferredBytes,omitempty"` + // ResyncProgressHealth - READ-ONLY; The resync progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + ResyncProgressHealth VMReplicationProgressHealth `json:"resyncProgressHealth,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // AgentUpgradeState - READ-ONLY; The agent auto upgrade state. Possible values include: 'MobilityAgentUpgradeStateNone', 'MobilityAgentUpgradeStateStarted', 'MobilityAgentUpgradeStateCompleted', 'MobilityAgentUpgradeStateCommit' + AgentUpgradeState MobilityAgentUpgradeState `json:"agentUpgradeState,omitempty"` + // LastAgentUpgradeType - READ-ONLY; The last agent upgrade type. + LastAgentUpgradeType *string `json:"lastAgentUpgradeType,omitempty"` + // AgentUpgradeJobID - READ-ONLY; The agent upgrade job Id. + AgentUpgradeJobID *string `json:"agentUpgradeJobId,omitempty"` + // AgentUpgradeAttemptToVersion - READ-ONLY; The agent version to which last agent upgrade was attempted. + AgentUpgradeAttemptToVersion *string `json:"agentUpgradeAttemptToVersion,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageRcmProtectedDiskDetails `json:"protectedDisks,omitempty"` + // IsLastUpgradeSuccessful - READ-ONLY; A value indicating whether last agent upgrade was successful or not. + IsLastUpgradeSuccessful *string `json:"isLastUpgradeSuccessful,omitempty"` + // IsAgentRegistrationSuccessfulAfterFailover - READ-ONLY; A value indicating whether agent registration was successful after failover. + IsAgentRegistrationSuccessfulAfterFailover *bool `json:"isAgentRegistrationSuccessfulAfterFailover,omitempty"` + // MobilityAgentDetails - The mobility agent information. + MobilityAgentDetails *InMageRcmMobilityAgentDetails `json:"mobilityAgentDetails,omitempty"` + // LastAgentUpgradeErrorDetails - The last agent upgrade error information. + LastAgentUpgradeErrorDetails *[]InMageRcmLastAgentUpgradeErrorDetails `json:"lastAgentUpgradeErrorDetails,omitempty"` + // AgentUpgradeBlockingErrorDetails - The agent upgrade blocking error information. + AgentUpgradeBlockingErrorDetails *[]InMageRcmAgentUpgradeBlockingErrorDetails `json:"agentUpgradeBlockingErrorDetails,omitempty"` + // VMNics - The network details. + VMNics *[]InMageRcmNicDetails `json:"vmNics,omitempty"` + // DiscoveredVMDetails - The discovered VM details. + DiscoveredVMDetails *InMageRcmDiscoveredProtectedVMDetails `json:"discoveredVmDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) MarshalJSON() ([]byte, error) { + imrrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrrd.LicenseType != nil { + objectMap["licenseType"] = imrrd.LicenseType + } + if imrrd.TargetVMName != nil { + objectMap["targetVmName"] = imrrd.TargetVMName + } + if imrrd.TargetVMSize != nil { + objectMap["targetVmSize"] = imrrd.TargetVMSize + } + if imrrd.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrrd.TargetResourceGroupID + } + if imrrd.TargetLocation != nil { + objectMap["targetLocation"] = imrrd.TargetLocation + } + if imrrd.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrrd.TargetAvailabilitySetID + } + if imrrd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrrd.TargetAvailabilityZone + } + if imrrd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrrd.TargetProximityPlacementGroupID + } + if imrrd.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrrd.TargetBootDiagnosticsStorageAccountID + } + if imrrd.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrrd.TargetNetworkID + } + if imrrd.TestNetworkID != nil { + objectMap["testNetworkId"] = imrrd.TestNetworkID + } + if imrrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrrd.ProtectedDisks + } + if imrrd.MobilityAgentDetails != nil { + objectMap["mobilityAgentDetails"] = imrrd.MobilityAgentDetails + } + if imrrd.LastAgentUpgradeErrorDetails != nil { + objectMap["lastAgentUpgradeErrorDetails"] = imrrd.LastAgentUpgradeErrorDetails + } + if imrrd.AgentUpgradeBlockingErrorDetails != nil { + objectMap["agentUpgradeBlockingErrorDetails"] = imrrd.AgentUpgradeBlockingErrorDetails + } + if imrrd.VMNics != nil { + objectMap["vmNics"] = imrrd.VMNics + } + if imrrd.DiscoveredVMDetails != nil { + objectMap["discoveredVmDetails"] = imrrd.DiscoveredVMDetails + } + if imrrd.InstanceType != "" { + objectMap["instanceType"] = imrrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return &imrrd, true +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrrd, true +} + +// InMageRcmReprotectInput inMageRcm specific provider input. +type InMageRcmReprotectInput struct { + // ReprotectAgentID - The reprotect agent Id. + ReprotectAgentID *string `json:"reprotectAgentId,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) MarshalJSON() ([]byte, error) { + imrri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrri.ReprotectAgentID != nil { + objectMap["reprotectAgentId"] = imrri.ReprotectAgentID + } + if imrri.DatastoreName != nil { + objectMap["datastoreName"] = imrri.DatastoreName + } + if imrri.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imrri.LogStorageAccountID + } + if imrri.PolicyID != nil { + objectMap["policyId"] = imrri.PolicyID + } + if imrri.InstanceType != "" { + objectMap["instanceType"] = imrri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return &imrri, true +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imrri, true +} + +// InMageRcmSyncDetails inMageRcm disk level sync details. +type InMageRcmSyncDetails struct { + // ProgressHealth - READ-ONLY; The progress health. Possible values include: 'None', 'InProgress', 'SlowProgress', 'NoProgress', 'Queued' + ProgressHealth DiskReplicationProgressHealth `json:"progressHealth,omitempty"` + // TransferredBytes - READ-ONLY; The transferred bytes from source VM to azure for the disk. + TransferredBytes *int64 `json:"transferredBytes,omitempty"` + // Last15MinutesTransferredBytes - READ-ONLY; The bytes transferred in last 15 minutes from source VM to azure. + Last15MinutesTransferredBytes *int64 `json:"last15MinutesTransferredBytes,omitempty"` + // LastDataTransferTimeUtc - READ-ONLY; The time of the last data transfer from source VM to azure. + LastDataTransferTimeUtc *string `json:"lastDataTransferTimeUtc,omitempty"` + // ProcessedBytes - READ-ONLY; The total processed bytes. This includes bytes that are transferred from source VM to azure and matched bytes. + ProcessedBytes *int64 `json:"processedBytes,omitempty"` + // StartTime - READ-ONLY; The start time. + StartTime *string `json:"startTime,omitempty"` + // LastRefreshTime - READ-ONLY; The last refresh time. + LastRefreshTime *string `json:"lastRefreshTime,omitempty"` + // ProgressPercentage - READ-ONLY; Progress in percentage. Progress percentage is calculated based on processed bytes. + ProgressPercentage *int32 `json:"progressPercentage,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmSyncDetails. +func (imrsd InMageRcmSyncDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmTestFailoverInput inMageRcm provider specific input for test failover. +type InMageRcmTestFailoverInput struct { + // NetworkID - The test network Id. + NetworkID *string `json:"networkId,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) MarshalJSON() ([]byte, error) { + imrtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrtfi.NetworkID != nil { + objectMap["networkId"] = imrtfi.NetworkID + } + if imrtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrtfi.RecoveryPointID + } + if imrtfi.InstanceType != "" { + objectMap["instanceType"] = imrtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return &imrtfi, true +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imrtfi, true +} + +// InMageRcmUnplannedFailoverInput inMageRcm provider specific input for unplanned failover. +type InMageRcmUnplannedFailoverInput struct { + // PerformShutdown - A value indicating whether VM is to be shutdown. + PerformShutdown *string `json:"performShutdown,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imrufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrufi.PerformShutdown != nil { + objectMap["performShutdown"] = imrufi.PerformShutdown + } + if imrufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrufi.RecoveryPointID + } + if imrufi.InstanceType != "" { + objectMap["instanceType"] = imrufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return &imrufi, true +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imrufi, true +} + +// InMageRcmUpdateApplianceForReplicationProtectedItemInput inMageRcm provider specific input to update +// appliance for replication protected item. +type InMageRcmUpdateApplianceForReplicationProtectedItemInput struct { + // RunAsAccountID - The run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput', 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imruafrpii.InstanceType = InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imruafrpii.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imruafrpii.RunAsAccountID + } + if imruafrpii.InstanceType != "" { + objectMap["instanceType"] = imruafrpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageRcmUpdateApplianceForReplicationProtectedItemInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) AsInMageRcmUpdateApplianceForReplicationProtectedItemInput() (*InMageRcmUpdateApplianceForReplicationProtectedItemInput, bool) { + return &imruafrpii, true +} + +// AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (*UpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return &imruafrpii, true +} + +// InMageRcmUpdateContainerMappingInput inMageRcm update protection container mapping. +type InMageRcmUpdateContainerMappingInput struct { + // EnableAgentAutoUpgrade - A value indicating whether agent auto upgrade has to be enabled. + EnableAgentAutoUpgrade *string `json:"enableAgentAutoUpgrade,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + imrucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrucmi.EnableAgentAutoUpgrade != nil { + objectMap["enableAgentAutoUpgrade"] = imrucmi.EnableAgentAutoUpgrade + } + if imrucmi.InstanceType != "" { + objectMap["instanceType"] = imrucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return &imrucmi, true +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &imrucmi, true +} + +// InMageRcmUpdateReplicationProtectedItemInput inMageRcm provider specific input to update replication +// protected item. +type InMageRcmUpdateReplicationProtectedItemInput struct { + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The test network ARM Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // VMNics - The list of NIC details. + VMNics *[]InMageRcmNicInput `json:"vmNics,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imrurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrurpii.TargetVMName != nil { + objectMap["targetVmName"] = imrurpii.TargetVMName + } + if imrurpii.TargetVMSize != nil { + objectMap["targetVmSize"] = imrurpii.TargetVMSize + } + if imrurpii.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrurpii.TargetResourceGroupID + } + if imrurpii.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrurpii.TargetAvailabilitySetID + } + if imrurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrurpii.TargetAvailabilityZone + } + if imrurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrurpii.TargetProximityPlacementGroupID + } + if imrurpii.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrurpii.TargetBootDiagnosticsStorageAccountID + } + if imrurpii.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrurpii.TargetNetworkID + } + if imrurpii.TestNetworkID != nil { + objectMap["testNetworkId"] = imrurpii.TestNetworkID + } + if imrurpii.VMNics != nil { + objectMap["vmNics"] = imrurpii.VMNics + } + if imrurpii.LicenseType != "" { + objectMap["licenseType"] = imrurpii.LicenseType + } + if imrurpii.InstanceType != "" { + objectMap["instanceType"] = imrurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return &imrurpii, true +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &imrurpii, true +} + +// InMageReplicationDetails inMage provider specific settings. +type InMageReplicationDetails struct { + // ActiveSiteType - The active location of the VM. If the VM is being protected from Azure, this field will take values from { Azure, OnPrem }. If the VM is being protected between two data-centers, this field will be OnPrem always. + ActiveSiteType *string `json:"activeSiteType,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // OsDetails - The OS details. + OsDetails *OSDiskDetails `json:"osDetails,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // ResyncDetails - The resync details of the machine. + ResyncDetails *InitialReplicationDetails `json:"resyncDetails,omitempty"` + // RetentionWindowStart - The retention window start time. + RetentionWindowStart *date.Time `json:"retentionWindowStart,omitempty"` + // RetentionWindowEnd - The retention window end time. + RetentionWindowEnd *date.Time `json:"retentionWindowEnd,omitempty"` + // CompressedDataRateInMB - The compressed data change rate in MB. + CompressedDataRateInMB *float64 `json:"compressedDataRateInMB,omitempty"` + // UncompressedDataRateInMB - The uncompressed data change rate in MB. + UncompressedDataRateInMB *float64 `json:"uncompressedDataRateInMB,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageProtectedDiskDetails `json:"protectedDisks,omitempty"` + // IPAddress - The source IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // MasterTargetID - The master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ConsistencyPoints - The collection of Consistency points. + ConsistencyPoints map[string]*date.Time `json:"consistencyPoints"` + // DiskResized - A value indicating whether any disk is resized for this VM. + DiskResized *string `json:"diskResized,omitempty"` + // RebootAfterUpdateStatus - A value indicating whether the source server requires a restart after update. + RebootAfterUpdateStatus *string `json:"rebootAfterUpdateStatus,omitempty"` + // MultiVMGroupID - The multi vm group Id, if any. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name, if any. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMSyncStatus - A value indicating whether the multi vm sync is enabled or disabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // AgentDetails - The agent details. + AgentDetails *InMageAgentDetails `json:"agentDetails,omitempty"` + // VCenterInfrastructureID - The vCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // InfrastructureVMID - The infrastructure VM Id. + InfrastructureVMID *string `json:"infrastructureVmId,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. + DiscoveryType *string `json:"discoveryType,omitempty"` + // AzureStorageAccountID - A value indicating the underlying Azure storage account. If the VM is not running in Azure, this value shall be set to null. + AzureStorageAccountID *string `json:"azureStorageAccountId,omitempty"` + // Datastores - The datastores of the on-premise machine Value can be list of strings that contain datastore names. + Datastores *[]string `json:"datastores,omitempty"` + // ValidationErrors - The validation errors of the on-premise machine Value can be list of validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastUpdateReceivedTime - The last update time received from on-prem components. + LastUpdateReceivedTime *date.Time `json:"lastUpdateReceivedTime,omitempty"` + // ReplicaID - The replica id of the protected item. + ReplicaID *string `json:"replicaId,omitempty"` + // OsVersion - The OS Version of the protected item. + OsVersion *string `json:"osVersion,omitempty"` + // IsAdditionalStatsAvailable - A value indicating whether additional IR stats are available or not. + IsAdditionalStatsAvailable *bool `json:"isAdditionalStatsAvailable,omitempty"` + // TotalDataTransferred - The total transferred data in bytes. + TotalDataTransferred *int64 `json:"totalDataTransferred,omitempty"` + // TotalProgressHealth - The progress health. + TotalProgressHealth *string `json:"totalProgressHealth,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageReplicationDetails. +func (imrd InMageReplicationDetails) MarshalJSON() ([]byte, error) { + imrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imrd.ActiveSiteType != nil { + objectMap["activeSiteType"] = imrd.ActiveSiteType + } + if imrd.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = imrd.SourceVMCPUCount + } + if imrd.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = imrd.SourceVMRAMSizeInMB + } + if imrd.OsDetails != nil { + objectMap["osDetails"] = imrd.OsDetails + } + if imrd.ProtectionStage != nil { + objectMap["protectionStage"] = imrd.ProtectionStage + } + if imrd.VMID != nil { + objectMap["vmId"] = imrd.VMID + } + if imrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = imrd.VMProtectionState + } + if imrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = imrd.VMProtectionStateDescription + } + if imrd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrd.ResyncDetails + } + if imrd.RetentionWindowStart != nil { + objectMap["retentionWindowStart"] = imrd.RetentionWindowStart + } + if imrd.RetentionWindowEnd != nil { + objectMap["retentionWindowEnd"] = imrd.RetentionWindowEnd + } + if imrd.CompressedDataRateInMB != nil { + objectMap["compressedDataRateInMB"] = imrd.CompressedDataRateInMB + } + if imrd.UncompressedDataRateInMB != nil { + objectMap["uncompressedDataRateInMB"] = imrd.UncompressedDataRateInMB + } + if imrd.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = imrd.RpoInSeconds + } + if imrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrd.ProtectedDisks + } + if imrd.IPAddress != nil { + objectMap["ipAddress"] = imrd.IPAddress + } + if imrd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = imrd.LastHeartbeat + } + if imrd.ProcessServerID != nil { + objectMap["processServerId"] = imrd.ProcessServerID + } + if imrd.MasterTargetID != nil { + objectMap["masterTargetId"] = imrd.MasterTargetID + } + if imrd.ConsistencyPoints != nil { + objectMap["consistencyPoints"] = imrd.ConsistencyPoints + } + if imrd.DiskResized != nil { + objectMap["diskResized"] = imrd.DiskResized + } + if imrd.RebootAfterUpdateStatus != nil { + objectMap["rebootAfterUpdateStatus"] = imrd.RebootAfterUpdateStatus + } + if imrd.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imrd.MultiVMGroupID + } + if imrd.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imrd.MultiVMGroupName + } + if imrd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imrd.MultiVMSyncStatus + } + if imrd.AgentDetails != nil { + objectMap["agentDetails"] = imrd.AgentDetails + } + if imrd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = imrd.VCenterInfrastructureID + } + if imrd.InfrastructureVMID != nil { + objectMap["infrastructureVmId"] = imrd.InfrastructureVMID + } + if imrd.VMNics != nil { + objectMap["vmNics"] = imrd.VMNics + } + if imrd.DiscoveryType != nil { + objectMap["discoveryType"] = imrd.DiscoveryType + } + if imrd.AzureStorageAccountID != nil { + objectMap["azureStorageAccountId"] = imrd.AzureStorageAccountID + } + if imrd.Datastores != nil { + objectMap["datastores"] = imrd.Datastores + } + if imrd.ValidationErrors != nil { + objectMap["validationErrors"] = imrd.ValidationErrors + } + if imrd.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = imrd.LastRpoCalculatedTime + } + if imrd.LastUpdateReceivedTime != nil { + objectMap["lastUpdateReceivedTime"] = imrd.LastUpdateReceivedTime + } + if imrd.ReplicaID != nil { + objectMap["replicaId"] = imrd.ReplicaID + } + if imrd.OsVersion != nil { + objectMap["osVersion"] = imrd.OsVersion + } + if imrd.IsAdditionalStatsAvailable != nil { + objectMap["isAdditionalStatsAvailable"] = imrd.IsAdditionalStatsAvailable + } + if imrd.TotalDataTransferred != nil { + objectMap["totalDataTransferred"] = imrd.TotalDataTransferred + } + if imrd.TotalProgressHealth != nil { + objectMap["totalProgressHealth"] = imrd.TotalProgressHealth + } + if imrd.InstanceType != "" { + objectMap["instanceType"] = imrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return &imrd, true +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrd, true +} + +// InMageReprotectInput inMageAzureV2 specific provider input. +type InMageReprotectInput struct { + // MasterTargetID - The Master Target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RetentionDrive - The retention drive to use on the MT. + RetentionDrive *string `json:"retentionDrive,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // DiskExclusionInput - The enable disk exclusion input. + DiskExclusionInput *InMageDiskExclusionInput `json:"diskExclusionInput,omitempty"` + // ProfileID - The Policy Id. + ProfileID *string `json:"profileId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageReprotectInput. +func (imri InMageReprotectInput) MarshalJSON() ([]byte, error) { + imri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imri.MasterTargetID != nil { + objectMap["masterTargetId"] = imri.MasterTargetID + } + if imri.ProcessServerID != nil { + objectMap["processServerId"] = imri.ProcessServerID + } + if imri.RetentionDrive != nil { + objectMap["retentionDrive"] = imri.RetentionDrive + } + if imri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imri.RunAsAccountID + } + if imri.DatastoreName != nil { + objectMap["datastoreName"] = imri.DatastoreName + } + if imri.DiskExclusionInput != nil { + objectMap["diskExclusionInput"] = imri.DiskExclusionInput + } + if imri.ProfileID != nil { + objectMap["profileId"] = imri.ProfileID + } + if imri.DisksToInclude != nil { + objectMap["disksToInclude"] = imri.DisksToInclude + } + if imri.InstanceType != "" { + objectMap["instanceType"] = imri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return &imri, true +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imri, true +} + +// InMageTestFailoverInput provider specific input for InMage test failover. +type InMageTestFailoverInput struct { + // RecoveryPointType - The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. Possible values include: 'LatestTime', 'LatestTag', 'Custom' + RecoveryPointType RecoveryPointType `json:"recoveryPointType,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) MarshalJSON() ([]byte, error) { + imtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imtfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imtfi.RecoveryPointType + } + if imtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imtfi.RecoveryPointID + } + if imtfi.InstanceType != "" { + objectMap["instanceType"] = imtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return &imtfi, true +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imtfi, true +} + +// InMageUnplannedFailoverInput provider specific input for InMage unplanned failover. +type InMageUnplannedFailoverInput struct { + // RecoveryPointType - The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. Possible values include: 'LatestTime', 'LatestTag', 'Custom' + RecoveryPointType RecoveryPointType `json:"recoveryPointType,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imufi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imufi.RecoveryPointType + } + if imufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imufi.RecoveryPointID + } + if imufi.InstanceType != "" { + objectMap["instanceType"] = imufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return &imufi, true +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imufi, true +} + +// InMageVolumeExclusionOptions guest disk signature based disk exclusion option when doing enable +// protection of virtual machine in InMage provider. +type InMageVolumeExclusionOptions struct { + // VolumeLabel - The volume label. The disk having any volume with this label will be excluded from replication. + VolumeLabel *string `json:"volumeLabel,omitempty"` + // OnlyExcludeIfSingleVolume - The value indicating whether to exclude multi volume disk or not. If a disk has multiple volumes and one of the volume has label matching with VolumeLabel this disk will be excluded from replication if OnlyExcludeIfSingleVolume is false. + OnlyExcludeIfSingleVolume *string `json:"onlyExcludeIfSingleVolume,omitempty"` +} + +// InnerHealthError implements InnerHealthError class. HealthError object has a list of InnerHealthErrors +// as child errors. InnerHealthError is used because this will prevent an infinite loop of structures when +// Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health +// errors and all API consumers can utilize this in the same fashion as Exception -> InnerException. +type InnerHealthError struct { + // ErrorSource - Source of error. + ErrorSource *string `json:"errorSource,omitempty"` + // ErrorType - Type of error. + ErrorType *string `json:"errorType,omitempty"` + // ErrorLevel - Level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // ErrorCategory - Category of error. + ErrorCategory *string `json:"errorCategory,omitempty"` + // ErrorCode - Error code. + ErrorCode *string `json:"errorCode,omitempty"` + // SummaryMessage - Summary message of the entity. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // ErrorMessage - Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // CreationTimeUtc - Error creation time (UTC). + CreationTimeUtc *date.Time `json:"creationTimeUtc,omitempty"` + // RecoveryProviderErrorMessage - DRA error message. + RecoveryProviderErrorMessage *string `json:"recoveryProviderErrorMessage,omitempty"` + // EntityID - ID of the entity. + EntityID *string `json:"entityId,omitempty"` + // ErrorID - The health error unique id. + ErrorID *string `json:"errorId,omitempty"` + // CustomerResolvability - Value indicating whether the health error is customer resolvable. Possible values include: 'Allowed', 'NotAllowed' + CustomerResolvability HealthErrorCustomerResolvability `json:"customerResolvability,omitempty"` +} + +// InputEndpoint ... +type InputEndpoint struct { + EndpointName *string `json:"endpointName,omitempty"` + PrivatePort *int32 `json:"privatePort,omitempty"` + PublicPort *int32 `json:"publicPort,omitempty"` + Protocol *string `json:"protocol,omitempty"` +} + +// IPConfigDetails ... +type IPConfigDetails struct { + Name *string `json:"name,omitempty"` + IsPrimary *bool `json:"isPrimary,omitempty"` + SubnetName *string `json:"subnetName,omitempty"` + StaticIPAddress *string `json:"staticIPAddress,omitempty"` + IPAddressType *string `json:"ipAddressType,omitempty"` + IsSeletedForFailover *bool `json:"isSeletedForFailover,omitempty"` + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + RecoveryStaticIPAddress *string `json:"recoveryStaticIPAddress,omitempty"` + RecoveryIPAddressType *string `json:"recoveryIPAddressType,omitempty"` + RecoveryPublicIPAddressID *string `json:"recoveryPublicIPAddressId,omitempty"` + RecoveryLBBackendAddressPoolIds *[]string `json:"recoveryLBBackendAddressPoolIds,omitempty"` + TfoSubnetName *string `json:"tfoSubnetName,omitempty"` + TfoStaticIPAddress *string `json:"tfoStaticIPAddress,omitempty"` + TfoPublicIPAddressID *string `json:"tfoPublicIPAddressId,omitempty"` + TfoLBBackendAddressPoolIds *[]string `json:"tfoLBBackendAddressPoolIds,omitempty"` +} + +// IPConfigInputDetails ... +type IPConfigInputDetails struct { + IPConfigName *string `json:"ipConfigName,omitempty"` + IsPrimary *bool `json:"isPrimary,omitempty"` + IsSeletedForFailover *bool `json:"isSeletedForFailover,omitempty"` + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + RecoveryStaticIPAddress *string `json:"recoveryStaticIPAddress,omitempty"` + RecoveryPublicIPAddressID *string `json:"recoveryPublicIPAddressId,omitempty"` + RecoveryLBBackendAddressPoolIds *[]string `json:"recoveryLBBackendAddressPoolIds,omitempty"` + TfoSubnetName *string `json:"tfoSubnetName,omitempty"` + TfoStaticIPAddress *string `json:"tfoStaticIPAddress,omitempty"` + TfoPublicIPAddressID *string `json:"tfoPublicIPAddressId,omitempty"` + TfoLBBackendAddressPoolIds *[]string `json:"tfoLBBackendAddressPoolIds,omitempty"` +} + +// Job job details. +type Job struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *JobProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if j.Properties != nil { + objectMap["properties"] = j.Properties + } + if j.Location != nil { + objectMap["location"] = j.Location + } + return json.Marshal(objectMap) +} + +// JobCollection collection of jobs. +type JobCollection struct { + autorest.Response `json:"-"` + // Value - The list of jobs. + Value *[]Job `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// JobCollectionIterator provides access to a complete listing of Job values. +type JobCollectionIterator struct { + i int + page JobCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *JobCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *JobCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter JobCollectionIterator) Response() JobCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter JobCollectionIterator) Value() Job { + if !iter.page.NotDone() { + return Job{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the JobCollectionIterator type. +func NewJobCollectionIterator(page JobCollectionPage) JobCollectionIterator { + return JobCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (jc JobCollection) IsEmpty() bool { + return jc.Value == nil || len(*jc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (jc JobCollection) hasNextLink() bool { + return jc.NextLink != nil && len(*jc.NextLink) != 0 +} + +// jobCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jc JobCollection) jobCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !jc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jc.NextLink))) +} + +// JobCollectionPage contains a page of Job values. +type JobCollectionPage struct { + fn func(context.Context, JobCollection) (JobCollection, error) + jc JobCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *JobCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.jc) + if err != nil { + return err + } + page.jc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *JobCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobCollectionPage) NotDone() bool { + return !page.jc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobCollectionPage) Response() JobCollection { + return page.jc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobCollectionPage) Values() []Job { + if page.jc.IsEmpty() { + return nil + } + return *page.jc.Value +} + +// Creates a new instance of the JobCollectionPage type. +func NewJobCollectionPage(cur JobCollection, getNextPage func(context.Context, JobCollection) (JobCollection, error)) JobCollectionPage { + return JobCollectionPage{ + fn: getNextPage, + jc: cur, + } +} + +// BasicJobDetails job details based on specific job type. +type BasicJobDetails interface { + AsAsrJobDetails() (*AsrJobDetails, bool) + AsExportJobDetails() (*ExportJobDetails, bool) + AsFailoverJobDetails() (*FailoverJobDetails, bool) + AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) + AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) + AsJobDetails() (*JobDetails, bool) +} + +// JobDetails job details based on specific job type. +type JobDetails struct { + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicJobDetails(body []byte) (BasicJobDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAsrJobDetails): + var ajd AsrJobDetails + err := json.Unmarshal(body, &ajd) + return ajd, err + case string(InstanceTypeExportJobDetails): + var ejd ExportJobDetails + err := json.Unmarshal(body, &ejd) + return ejd, err + case string(InstanceTypeFailoverJobDetails): + var fjd FailoverJobDetails + err := json.Unmarshal(body, &fjd) + return fjd, err + case string(InstanceTypeSwitchProtectionJobDetails): + var spjd SwitchProtectionJobDetails + err := json.Unmarshal(body, &spjd) + return spjd, err + case string(InstanceTypeTestFailoverJobDetails): + var tfjd TestFailoverJobDetails + err := json.Unmarshal(body, &tfjd) + return tfjd, err + default: + var jd JobDetails + err := json.Unmarshal(body, &jd) + return jd, err + } +} +func unmarshalBasicJobDetailsArray(body []byte) ([]BasicJobDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jdArray := make([]BasicJobDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + jd, err := unmarshalBasicJobDetails(*rawMessage) + if err != nil { + return nil, err + } + jdArray[index] = jd + } + return jdArray, nil +} + +// MarshalJSON is the custom marshaler for JobDetails. +func (jd JobDetails) MarshalJSON() ([]byte, error) { + jd.InstanceType = InstanceTypeJobDetails + objectMap := make(map[string]interface{}) + if jd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = jd.AffectedObjectDetails + } + if jd.InstanceType != "" { + objectMap["instanceType"] = jd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsJobDetails() (*JobDetails, bool) { + return &jd, true +} + +// AsBasicJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &jd, true +} + +// JobEntity this class contains the minimal job details required to navigate to the desired drill down. +type JobEntity struct { + // JobID - The job id. + JobID *string `json:"jobId,omitempty"` + // JobFriendlyName - The job display name. + JobFriendlyName *string `json:"jobFriendlyName,omitempty"` + // TargetObjectID - The object id. + TargetObjectID *string `json:"targetObjectId,omitempty"` + // TargetObjectName - The object name. + TargetObjectName *string `json:"targetObjectName,omitempty"` + // TargetInstanceType - The workflow affected object type. + TargetInstanceType *string `json:"targetInstanceType,omitempty"` + // JobScenarioName - The job name. Enum type ScenarioName. + JobScenarioName *string `json:"jobScenarioName,omitempty"` +} + +// JobErrorDetails this class contains the error details per object. +type JobErrorDetails struct { + // ServiceErrorDetails - The Service error details. + ServiceErrorDetails *ServiceError `json:"serviceErrorDetails,omitempty"` + // ProviderErrorDetails - The Provider error details. + ProviderErrorDetails *ProviderError `json:"providerErrorDetails,omitempty"` + // ErrorLevel - Error level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // CreationTime - The creation time of job error. + CreationTime *date.Time `json:"creationTime,omitempty"` + // TaskID - The Id of the task. + TaskID *string `json:"taskId,omitempty"` +} + +// JobProperties job custom data details. +type JobProperties struct { + // ActivityID - The activity id. + ActivityID *string `json:"activityId,omitempty"` + // ScenarioName - The ScenarioName. + ScenarioName *string `json:"scenarioName,omitempty"` + // FriendlyName - The DisplayName. + FriendlyName *string `json:"friendlyName,omitempty"` + // State - The status of the Job. It is one of these values - NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or Other. + State *string `json:"state,omitempty"` + // StateDescription - The description of the state of the Job. For e.g. - For Succeeded state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. + StateDescription *string `json:"stateDescription,omitempty"` + // Tasks - The tasks. + Tasks *[]ASRTask `json:"tasks,omitempty"` + // Errors - The errors. + Errors *[]JobErrorDetails `json:"errors,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // AllowedActions - The Allowed action the job. + AllowedActions *[]string `json:"allowedActions,omitempty"` + // TargetObjectID - The affected Object Id. + TargetObjectID *string `json:"targetObjectId,omitempty"` + // TargetObjectName - The name of the affected object. + TargetObjectName *string `json:"targetObjectName,omitempty"` + // TargetInstanceType - The type of the affected object which is of Microsoft.Azure.SiteRecovery.V2015_11_10.AffectedObjectType class. + TargetInstanceType *string `json:"targetInstanceType,omitempty"` + // CustomDetails - The custom job details like test failover job details. + CustomDetails BasicJobDetails `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for JobProperties struct. +func (jp *JobProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "activityId": + if v != nil { + var activityID string + err = json.Unmarshal(*v, &activityID) + if err != nil { + return err + } + jp.ActivityID = &activityID + } + case "scenarioName": + if v != nil { + var scenarioName string + err = json.Unmarshal(*v, &scenarioName) + if err != nil { + return err + } + jp.ScenarioName = &scenarioName + } + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + jp.FriendlyName = &friendlyName + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + jp.State = &state + } + case "stateDescription": + if v != nil { + var stateDescription string + err = json.Unmarshal(*v, &stateDescription) + if err != nil { + return err + } + jp.StateDescription = &stateDescription + } + case "tasks": + if v != nil { + var tasks []ASRTask + err = json.Unmarshal(*v, &tasks) + if err != nil { + return err + } + jp.Tasks = &tasks + } + case "errors": + if v != nil { + var errorsVar []JobErrorDetails + err = json.Unmarshal(*v, &errorsVar) + if err != nil { + return err + } + jp.Errors = &errorsVar + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + jp.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + jp.EndTime = &endTime + } + case "allowedActions": + if v != nil { + var allowedActions []string + err = json.Unmarshal(*v, &allowedActions) + if err != nil { + return err + } + jp.AllowedActions = &allowedActions + } + case "targetObjectId": + if v != nil { + var targetObjectID string + err = json.Unmarshal(*v, &targetObjectID) + if err != nil { + return err + } + jp.TargetObjectID = &targetObjectID + } + case "targetObjectName": + if v != nil { + var targetObjectName string + err = json.Unmarshal(*v, &targetObjectName) + if err != nil { + return err + } + jp.TargetObjectName = &targetObjectName + } + case "targetInstanceType": + if v != nil { + var targetInstanceType string + err = json.Unmarshal(*v, &targetInstanceType) + if err != nil { + return err + } + jp.TargetInstanceType = &targetInstanceType + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicJobDetails(*v) + if err != nil { + return err + } + jp.CustomDetails = customDetails + } + } + } + + return nil +} + +// JobQueryParameter query parameter to enumerate jobs. +type JobQueryParameter struct { + // StartTime - Date time to get jobs from. + StartTime *string `json:"startTime,omitempty"` + // EndTime - Date time to get jobs upto. + EndTime *string `json:"endTime,omitempty"` + // FabricID - The Id of the fabric to search jobs under. + FabricID *string `json:"fabricId,omitempty"` + // AffectedObjectTypes - The type of objects. + AffectedObjectTypes *string `json:"affectedObjectTypes,omitempty"` + // JobStatus - The states of the job to be filtered can be in. + JobStatus *string `json:"jobStatus,omitempty"` + // JobOutputType - The output type of the jobs. Possible values include: 'JSON', 'XML', 'Excel' + JobOutputType ExportJobOutputSerializationType `json:"jobOutputType,omitempty"` + // JobName - The job Name. + JobName *string `json:"jobName,omitempty"` + // TimezoneOffset - The timezone offset for the location of the request (in minutes). + TimezoneOffset *float64 `json:"timezoneOffset,omitempty"` +} + +// JobStatusEventDetails model class for event details of a job status event. +type JobStatusEventDetails struct { + // JobID - Job arm id for the event. + JobID *string `json:"jobId,omitempty"` + // JobFriendlyName - JobName for the Event. + JobFriendlyName *string `json:"jobFriendlyName,omitempty"` + // JobStatus - JobStatus for the Event. + JobStatus *string `json:"jobStatus,omitempty"` + // AffectedObjectType - AffectedObjectType for the event. + AffectedObjectType *string `json:"affectedObjectType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeEventSpecificDetails', 'InstanceTypeJobStatus' + InstanceType InstanceTypeBasicEventSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobStatusEventDetails. +func (jsed JobStatusEventDetails) MarshalJSON() ([]byte, error) { + jsed.InstanceType = InstanceTypeJobStatus + objectMap := make(map[string]interface{}) + if jsed.JobID != nil { + objectMap["jobId"] = jsed.JobID + } + if jsed.JobFriendlyName != nil { + objectMap["jobFriendlyName"] = jsed.JobFriendlyName + } + if jsed.JobStatus != nil { + objectMap["jobStatus"] = jsed.JobStatus + } + if jsed.AffectedObjectType != nil { + objectMap["affectedObjectType"] = jsed.AffectedObjectType + } + if jsed.InstanceType != "" { + objectMap["instanceType"] = jsed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsJobStatusEventDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsJobStatusEventDetails() (*JobStatusEventDetails, bool) { + return &jsed, true +} + +// AsEventSpecificDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsEventSpecificDetails() (*EventSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventSpecificDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsBasicEventSpecificDetails() (BasicEventSpecificDetails, bool) { + return &jsed, true +} + +// BasicJobTaskDetails this class represents a task which is actually a workflow so that one can navigate to its +// individual drill down. +type BasicJobTaskDetails interface { + AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) + AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) + AsJobTaskDetails() (*JobTaskDetails, bool) +} + +// JobTaskDetails this class represents a task which is actually a workflow so that one can navigate to its +// individual drill down. +type JobTaskDetails struct { + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicJobTaskDetails(body []byte) (BasicJobTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeFabricReplicationGroupTaskDetails): + var frgtd FabricReplicationGroupTaskDetails + err := json.Unmarshal(body, &frgtd) + return frgtd, err + case string(InstanceTypeVirtualMachineTaskDetails): + var vmtd VirtualMachineTaskDetails + err := json.Unmarshal(body, &vmtd) + return vmtd, err + default: + var jtd JobTaskDetails + err := json.Unmarshal(body, &jtd) + return jtd, err + } +} +func unmarshalBasicJobTaskDetailsArray(body []byte) ([]BasicJobTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jtdArray := make([]BasicJobTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + jtd, err := unmarshalBasicJobTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + jtdArray[index] = jtd + } + return jtdArray, nil +} + +// MarshalJSON is the custom marshaler for JobTaskDetails. +func (jtd JobTaskDetails) MarshalJSON() ([]byte, error) { + jtd.InstanceType = InstanceTypeJobTaskDetails + objectMap := make(map[string]interface{}) + if jtd.JobTask != nil { + objectMap["jobTask"] = jtd.JobTask + } + if jtd.InstanceType != "" { + objectMap["instanceType"] = jtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return &jtd, true +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &jtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &jtd, true +} + +// KeyEncryptionKeyInfo key Encryption Key (KEK) information. +type KeyEncryptionKeyInfo struct { + // KeyIdentifier - The key URL / identifier. + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KeyVaultResourceArmID - The KeyVault resource ARM Id for key. + KeyVaultResourceArmID *string `json:"keyVaultResourceArmId,omitempty"` +} + +// LogicalNetwork logical network data model. +type LogicalNetwork struct { + autorest.Response `json:"-"` + // Properties - The Logical Network Properties. + Properties *LogicalNetworkProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for LogicalNetwork. +func (ln LogicalNetwork) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ln.Properties != nil { + objectMap["properties"] = ln.Properties + } + if ln.Location != nil { + objectMap["location"] = ln.Location + } + return json.Marshal(objectMap) +} + +// LogicalNetworkCollection list of logical networks. +type LogicalNetworkCollection struct { + autorest.Response `json:"-"` + // Value - The Logical Networks list details. + Value *[]LogicalNetwork `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// LogicalNetworkCollectionIterator provides access to a complete listing of LogicalNetwork values. +type LogicalNetworkCollectionIterator struct { + i int + page LogicalNetworkCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *LogicalNetworkCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LogicalNetworkCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *LogicalNetworkCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter LogicalNetworkCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter LogicalNetworkCollectionIterator) Response() LogicalNetworkCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter LogicalNetworkCollectionIterator) Value() LogicalNetwork { + if !iter.page.NotDone() { + return LogicalNetwork{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the LogicalNetworkCollectionIterator type. +func NewLogicalNetworkCollectionIterator(page LogicalNetworkCollectionPage) LogicalNetworkCollectionIterator { + return LogicalNetworkCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lnc LogicalNetworkCollection) IsEmpty() bool { + return lnc.Value == nil || len(*lnc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (lnc LogicalNetworkCollection) hasNextLink() bool { + return lnc.NextLink != nil && len(*lnc.NextLink) != 0 +} + +// logicalNetworkCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lnc LogicalNetworkCollection) logicalNetworkCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !lnc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lnc.NextLink))) +} + +// LogicalNetworkCollectionPage contains a page of LogicalNetwork values. +type LogicalNetworkCollectionPage struct { + fn func(context.Context, LogicalNetworkCollection) (LogicalNetworkCollection, error) + lnc LogicalNetworkCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *LogicalNetworkCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LogicalNetworkCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.lnc) + if err != nil { + return err + } + page.lnc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *LogicalNetworkCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page LogicalNetworkCollectionPage) NotDone() bool { + return !page.lnc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page LogicalNetworkCollectionPage) Response() LogicalNetworkCollection { + return page.lnc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page LogicalNetworkCollectionPage) Values() []LogicalNetwork { + if page.lnc.IsEmpty() { + return nil + } + return *page.lnc.Value +} + +// Creates a new instance of the LogicalNetworkCollectionPage type. +func NewLogicalNetworkCollectionPage(cur LogicalNetworkCollection, getNextPage func(context.Context, LogicalNetworkCollection) (LogicalNetworkCollection, error)) LogicalNetworkCollectionPage { + return LogicalNetworkCollectionPage{ + fn: getNextPage, + lnc: cur, + } +} + +// LogicalNetworkProperties logical Network Properties. +type LogicalNetworkProperties struct { + // FriendlyName - The Friendly Name. + FriendlyName *string `json:"friendlyName,omitempty"` + // NetworkVirtualizationStatus - A value indicating whether Network Virtualization is enabled for the logical network. + NetworkVirtualizationStatus *string `json:"networkVirtualizationStatus,omitempty"` + // LogicalNetworkUsage - A value indicating whether logical network is used as private test network by test failover. + LogicalNetworkUsage *string `json:"logicalNetworkUsage,omitempty"` + // LogicalNetworkDefinitionsStatus - A value indicating whether logical network definitions are isolated. + LogicalNetworkDefinitionsStatus *string `json:"logicalNetworkDefinitionsStatus,omitempty"` +} + +// ManualActionTaskDetails this class represents the manual action task details. +type ManualActionTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // Instructions - The instructions. + Instructions *string `json:"instructions,omitempty"` + // Observation - The observation. + Observation *string `json:"observation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) MarshalJSON() ([]byte, error) { + matd.InstanceType = InstanceTypeManualActionTaskDetails + objectMap := make(map[string]interface{}) + if matd.Name != nil { + objectMap["name"] = matd.Name + } + if matd.Instructions != nil { + objectMap["instructions"] = matd.Instructions + } + if matd.Observation != nil { + objectMap["observation"] = matd.Observation + } + if matd.InstanceType != "" { + objectMap["instanceType"] = matd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return &matd, true +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &matd, true +} + +// MarsAgentDetails mars agent details. +type MarsAgentDetails struct { + // ID - READ-ONLY; The Mars agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The Mars agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The Mars agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The Mars agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the Mars agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the Mars agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for MarsAgentDetails. +func (mad MarsAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MasterTargetServer details of a Master Target Server. +type MasterTargetServer struct { + // ID - The server Id. + ID *string `json:"id,omitempty"` + // IPAddress - The IP address of the server. + IPAddress *string `json:"ipAddress,omitempty"` + // Name - The server name. + Name *string `json:"name,omitempty"` + // OsType - The OS type of the server. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The version of the scout component on the server. + AgentVersion *string `json:"agentVersion,omitempty"` + // LastHeartbeat - The last heartbeat received from the server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // RetentionVolumes - The retention volumes of Master target Server. + RetentionVolumes *[]RetentionVolume `json:"retentionVolumes,omitempty"` + // DataStores - The list of data stores in the fabric. + DataStores *[]DataStore `json:"dataStores,omitempty"` + // ValidationErrors - Validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // HealthErrors - Health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // DiskCount - Disk count of the master target. + DiskCount *int32 `json:"diskCount,omitempty"` + // OsVersion - OS Version of the master target. + OsVersion *string `json:"osVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // MarsAgentVersion - MARS agent version. + MarsAgentVersion *string `json:"marsAgentVersion,omitempty"` + // MarsAgentExpiryDate - MARS agent expiry date. + MarsAgentExpiryDate *date.Time `json:"marsAgentExpiryDate,omitempty"` + // AgentVersionDetails - Agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // MarsAgentVersionDetails - Mars agent version details. + MarsAgentVersionDetails *VersionDetails `json:"marsAgentVersionDetails,omitempty"` +} + +// MigrateInput input for migrate. +type MigrateInput struct { + // Properties - Migrate input properties. + Properties *MigrateInputProperties `json:"properties,omitempty"` +} + +// MigrateInputProperties migrate input properties. +type MigrateInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicMigrateProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for MigrateInputProperties struct. +func (mip *MigrateInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicMigrateProviderSpecificInput(*v) + if err != nil { + return err + } + mip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicMigrateProviderSpecificInput migrate provider specific input. +type BasicMigrateProviderSpecificInput interface { + AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) + AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) +} + +// MigrateProviderSpecificInput migrate provider specific input. +type MigrateProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput', 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicMigrateProviderSpecificInput(body []byte) (BasicMigrateProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt): + var vmcmi VMwareCbtMigrateInput + err := json.Unmarshal(body, &vmcmi) + return vmcmi, err + default: + var mpsi MigrateProviderSpecificInput + err := json.Unmarshal(body, &mpsi) + return mpsi, err + } +} +func unmarshalBasicMigrateProviderSpecificInputArray(body []byte) ([]BasicMigrateProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + mpsiArray := make([]BasicMigrateProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + mpsi, err := unmarshalBasicMigrateProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + mpsiArray[index] = mpsi + } + return mpsiArray, nil +} + +// MarshalJSON is the custom marshaler for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) MarshalJSON() ([]byte, error) { + mpsi.InstanceType = InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput + objectMap := make(map[string]interface{}) + if mpsi.InstanceType != "" { + objectMap["instanceType"] = mpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrateInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) { + return nil, false +} + +// AsMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) { + return &mpsi, true +} + +// AsBasicMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsBasicMigrateProviderSpecificInput() (BasicMigrateProviderSpecificInput, bool) { + return &mpsi, true +} + +// MigrationItem migration item. +type MigrationItem struct { + autorest.Response `json:"-"` + // Properties - The migration item properties. + Properties *MigrationItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationItem. +func (mi MigrationItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mi.Properties != nil { + objectMap["properties"] = mi.Properties + } + if mi.Location != nil { + objectMap["location"] = mi.Location + } + return json.Marshal(objectMap) +} + +// MigrationItemCollection migration item collection. +type MigrationItemCollection struct { + autorest.Response `json:"-"` + // Value - The list of migration items. + Value *[]MigrationItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MigrationItemCollectionIterator provides access to a complete listing of MigrationItem values. +type MigrationItemCollectionIterator struct { + i int + page MigrationItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *MigrationItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *MigrationItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MigrationItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter MigrationItemCollectionIterator) Response() MigrationItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter MigrationItemCollectionIterator) Value() MigrationItem { + if !iter.page.NotDone() { + return MigrationItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the MigrationItemCollectionIterator type. +func NewMigrationItemCollectionIterator(page MigrationItemCollectionPage) MigrationItemCollectionIterator { + return MigrationItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mic MigrationItemCollection) IsEmpty() bool { + return mic.Value == nil || len(*mic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mic MigrationItemCollection) hasNextLink() bool { + return mic.NextLink != nil && len(*mic.NextLink) != 0 +} + +// migrationItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mic MigrationItemCollection) migrationItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !mic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mic.NextLink))) +} + +// MigrationItemCollectionPage contains a page of MigrationItem values. +type MigrationItemCollectionPage struct { + fn func(context.Context, MigrationItemCollection) (MigrationItemCollection, error) + mic MigrationItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *MigrationItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.mic) + if err != nil { + return err + } + page.mic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *MigrationItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MigrationItemCollectionPage) NotDone() bool { + return !page.mic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MigrationItemCollectionPage) Response() MigrationItemCollection { + return page.mic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MigrationItemCollectionPage) Values() []MigrationItem { + if page.mic.IsEmpty() { + return nil + } + return *page.mic.Value +} + +// Creates a new instance of the MigrationItemCollectionPage type. +func NewMigrationItemCollectionPage(cur MigrationItemCollection, getNextPage func(context.Context, MigrationItemCollection) (MigrationItemCollection, error)) MigrationItemCollectionPage { + return MigrationItemCollectionPage{ + fn: getNextPage, + mic: cur, + } +} + +// MigrationItemProperties migration item properties. +type MigrationItemProperties struct { + // MachineName - READ-ONLY; The on-premise virtual machine name. + MachineName *string `json:"machineName,omitempty"` + // PolicyID - READ-ONLY; The ARM Id of policy governing this item. + PolicyID *string `json:"policyId,omitempty"` + // PolicyFriendlyName - READ-ONLY; The name of policy governing this item. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` + // MigrationState - READ-ONLY; The migration status. Possible values include: 'MigrationStateNone', 'MigrationStateEnableMigrationInProgress', 'MigrationStateEnableMigrationFailed', 'MigrationStateDisableMigrationInProgress', 'MigrationStateDisableMigrationFailed', 'MigrationStateInitialSeedingInProgress', 'MigrationStateInitialSeedingFailed', 'MigrationStateReplicating', 'MigrationStateMigrationInProgress', 'MigrationStateMigrationSucceeded', 'MigrationStateMigrationFailed' + MigrationState MigrationState `json:"migrationState,omitempty"` + // MigrationStateDescription - READ-ONLY; The migration state description. + MigrationStateDescription *string `json:"migrationStateDescription,omitempty"` + // LastTestMigrationTime - READ-ONLY; The last test migration time. + LastTestMigrationTime *date.Time `json:"lastTestMigrationTime,omitempty"` + // LastTestMigrationStatus - READ-ONLY; The status of the last test migration. + LastTestMigrationStatus *string `json:"lastTestMigrationStatus,omitempty"` + // TestMigrateState - READ-ONLY; The test migrate state. Possible values include: 'TestMigrationStateNone', 'TestMigrationStateTestMigrationInProgress', 'TestMigrationStateTestMigrationSucceeded', 'TestMigrationStateTestMigrationFailed', 'TestMigrationStateTestMigrationCleanupInProgress' + TestMigrateState TestMigrationState `json:"testMigrateState,omitempty"` + // TestMigrateStateDescription - READ-ONLY; The test migrate state description. + TestMigrateStateDescription *string `json:"testMigrateStateDescription,omitempty"` + // Health - READ-ONLY; The consolidated health. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The list of health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // AllowedOperations - READ-ONLY; The allowed operations on the migration item based on the current migration state of the item. + AllowedOperations *[]MigrationItemOperation `json:"allowedOperations,omitempty"` + // CurrentJob - READ-ONLY; The current job details. + CurrentJob *CurrentJobDetails `json:"currentJob,omitempty"` + // EventCorrelationID - READ-ONLY; The correlation Id for events associated with this migration item. + EventCorrelationID *string `json:"eventCorrelationId,omitempty"` + // ProviderSpecificDetails - The migration provider custom settings. + ProviderSpecificDetails BasicMigrationProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationItemProperties. +func (mip MigrationItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["providerSpecificDetails"] = mip.ProviderSpecificDetails + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MigrationItemProperties struct. +func (mip *MigrationItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "machineName": + if v != nil { + var machineName string + err = json.Unmarshal(*v, &machineName) + if err != nil { + return err + } + mip.MachineName = &machineName + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + mip.PolicyID = &policyID + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + mip.PolicyFriendlyName = &policyFriendlyName + } + case "migrationState": + if v != nil { + var migrationState MigrationState + err = json.Unmarshal(*v, &migrationState) + if err != nil { + return err + } + mip.MigrationState = migrationState + } + case "migrationStateDescription": + if v != nil { + var migrationStateDescription string + err = json.Unmarshal(*v, &migrationStateDescription) + if err != nil { + return err + } + mip.MigrationStateDescription = &migrationStateDescription + } + case "lastTestMigrationTime": + if v != nil { + var lastTestMigrationTime date.Time + err = json.Unmarshal(*v, &lastTestMigrationTime) + if err != nil { + return err + } + mip.LastTestMigrationTime = &lastTestMigrationTime + } + case "lastTestMigrationStatus": + if v != nil { + var lastTestMigrationStatus string + err = json.Unmarshal(*v, &lastTestMigrationStatus) + if err != nil { + return err + } + mip.LastTestMigrationStatus = &lastTestMigrationStatus + } + case "testMigrateState": + if v != nil { + var testMigrateState TestMigrationState + err = json.Unmarshal(*v, &testMigrateState) + if err != nil { + return err + } + mip.TestMigrateState = testMigrateState + } + case "testMigrateStateDescription": + if v != nil { + var testMigrateStateDescription string + err = json.Unmarshal(*v, &testMigrateStateDescription) + if err != nil { + return err + } + mip.TestMigrateStateDescription = &testMigrateStateDescription + } + case "health": + if v != nil { + var health ProtectionHealth + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + mip.Health = health + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + mip.HealthErrors = &healthErrors + } + case "allowedOperations": + if v != nil { + var allowedOperations []MigrationItemOperation + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + mip.AllowedOperations = &allowedOperations + } + case "currentJob": + if v != nil { + var currentJob CurrentJobDetails + err = json.Unmarshal(*v, ¤tJob) + if err != nil { + return err + } + mip.CurrentJob = ¤tJob + } + case "eventCorrelationId": + if v != nil { + var eventCorrelationID string + err = json.Unmarshal(*v, &eventCorrelationID) + if err != nil { + return err + } + mip.EventCorrelationID = &eventCorrelationID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicMigrationProviderSpecificSettings(*v) + if err != nil { + return err + } + mip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// MigrationItemsQueryParameter query parameter to enumerate migration items. +type MigrationItemsQueryParameter struct { + // SourceFabricName - The source fabric name filter. + SourceFabricName *string `json:"sourceFabricName,omitempty"` + // SourceContainerName - The source container name filter. + SourceContainerName *string `json:"sourceContainerName,omitempty"` + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` +} + +// BasicMigrationProviderSpecificSettings migration provider specific settings. +type BasicMigrationProviderSpecificSettings interface { + AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) + AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) +} + +// MigrationProviderSpecificSettings migration provider specific settings. +type MigrationProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings', 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicMigrationProviderSpecificSettings(body []byte) (BasicMigrationProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt): + var vmcmd VMwareCbtMigrationDetails + err := json.Unmarshal(body, &vmcmd) + return vmcmd, err + default: + var mpss MigrationProviderSpecificSettings + err := json.Unmarshal(body, &mpss) + return mpss, err + } +} +func unmarshalBasicMigrationProviderSpecificSettingsArray(body []byte) ([]BasicMigrationProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + mpssArray := make([]BasicMigrationProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + mpss, err := unmarshalBasicMigrationProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + mpssArray[index] = mpss + } + return mpssArray, nil +} + +// MarshalJSON is the custom marshaler for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) MarshalJSON() ([]byte, error) { + mpss.InstanceType = InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings + objectMap := make(map[string]interface{}) + if mpss.InstanceType != "" { + objectMap["instanceType"] = mpss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrationDetails is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) { + return nil, false +} + +// AsMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) { + return &mpss, true +} + +// AsBasicMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsBasicMigrationProviderSpecificSettings() (BasicMigrationProviderSpecificSettings, bool) { + return &mpss, true +} + +// MigrationRecoveryPoint recovery point for a migration item. +type MigrationRecoveryPoint struct { + autorest.Response `json:"-"` + // Properties - Recovery point properties. + Properties *MigrationRecoveryPointProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationRecoveryPoint. +func (mrp MigrationRecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mrp.Properties != nil { + objectMap["properties"] = mrp.Properties + } + if mrp.Location != nil { + objectMap["location"] = mrp.Location + } + return json.Marshal(objectMap) +} + +// MigrationRecoveryPointCollection collection of migration recovery points. +type MigrationRecoveryPointCollection struct { + autorest.Response `json:"-"` + // Value - The migration recovery point details. + Value *[]MigrationRecoveryPoint `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MigrationRecoveryPointCollectionIterator provides access to a complete listing of MigrationRecoveryPoint +// values. +type MigrationRecoveryPointCollectionIterator struct { + i int + page MigrationRecoveryPointCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *MigrationRecoveryPointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *MigrationRecoveryPointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MigrationRecoveryPointCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter MigrationRecoveryPointCollectionIterator) Response() MigrationRecoveryPointCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter MigrationRecoveryPointCollectionIterator) Value() MigrationRecoveryPoint { + if !iter.page.NotDone() { + return MigrationRecoveryPoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the MigrationRecoveryPointCollectionIterator type. +func NewMigrationRecoveryPointCollectionIterator(page MigrationRecoveryPointCollectionPage) MigrationRecoveryPointCollectionIterator { + return MigrationRecoveryPointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mrpc MigrationRecoveryPointCollection) IsEmpty() bool { + return mrpc.Value == nil || len(*mrpc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mrpc MigrationRecoveryPointCollection) hasNextLink() bool { + return mrpc.NextLink != nil && len(*mrpc.NextLink) != 0 +} + +// migrationRecoveryPointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mrpc MigrationRecoveryPointCollection) migrationRecoveryPointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !mrpc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mrpc.NextLink))) +} + +// MigrationRecoveryPointCollectionPage contains a page of MigrationRecoveryPoint values. +type MigrationRecoveryPointCollectionPage struct { + fn func(context.Context, MigrationRecoveryPointCollection) (MigrationRecoveryPointCollection, error) + mrpc MigrationRecoveryPointCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *MigrationRecoveryPointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.mrpc) + if err != nil { + return err + } + page.mrpc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *MigrationRecoveryPointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MigrationRecoveryPointCollectionPage) NotDone() bool { + return !page.mrpc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MigrationRecoveryPointCollectionPage) Response() MigrationRecoveryPointCollection { + return page.mrpc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MigrationRecoveryPointCollectionPage) Values() []MigrationRecoveryPoint { + if page.mrpc.IsEmpty() { + return nil + } + return *page.mrpc.Value +} + +// Creates a new instance of the MigrationRecoveryPointCollectionPage type. +func NewMigrationRecoveryPointCollectionPage(cur MigrationRecoveryPointCollection, getNextPage func(context.Context, MigrationRecoveryPointCollection) (MigrationRecoveryPointCollection, error)) MigrationRecoveryPointCollectionPage { + return MigrationRecoveryPointCollectionPage{ + fn: getNextPage, + mrpc: cur, + } +} + +// MigrationRecoveryPointProperties migration item recovery point properties. +type MigrationRecoveryPointProperties struct { + // RecoveryPointTime - READ-ONLY; The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointType - READ-ONLY; The recovery point type. Possible values include: 'MigrationRecoveryPointTypeNotSpecified', 'MigrationRecoveryPointTypeApplicationConsistent', 'MigrationRecoveryPointTypeCrashConsistent' + RecoveryPointType MigrationRecoveryPointType `json:"recoveryPointType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationRecoveryPointProperties. +func (mrpp MigrationRecoveryPointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MobilityServiceUpdate the Mobility Service update details. +type MobilityServiceUpdate struct { + // Version - The version of the latest update. + Version *string `json:"version,omitempty"` + // RebootStatus - The reboot status of the update - whether it is required or not. + RebootStatus *string `json:"rebootStatus,omitempty"` + // OsType - The OS type. + OsType *string `json:"osType,omitempty"` +} + +// Network network model. +type Network struct { + autorest.Response `json:"-"` + // Properties - The Network Properties. + Properties *NetworkProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Network. +func (n Network) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if n.Properties != nil { + objectMap["properties"] = n.Properties + } + if n.Location != nil { + objectMap["location"] = n.Location + } + return json.Marshal(objectMap) +} + +// NetworkCollection list of networks. +type NetworkCollection struct { + autorest.Response `json:"-"` + // Value - The Networks list details. + Value *[]Network `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// NetworkCollectionIterator provides access to a complete listing of Network values. +type NetworkCollectionIterator struct { + i int + page NetworkCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *NetworkCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *NetworkCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter NetworkCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter NetworkCollectionIterator) Response() NetworkCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter NetworkCollectionIterator) Value() Network { + if !iter.page.NotDone() { + return Network{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the NetworkCollectionIterator type. +func NewNetworkCollectionIterator(page NetworkCollectionPage) NetworkCollectionIterator { + return NetworkCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (nc NetworkCollection) IsEmpty() bool { + return nc.Value == nil || len(*nc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (nc NetworkCollection) hasNextLink() bool { + return nc.NextLink != nil && len(*nc.NextLink) != 0 +} + +// networkCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (nc NetworkCollection) networkCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !nc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(nc.NextLink))) +} + +// NetworkCollectionPage contains a page of Network values. +type NetworkCollectionPage struct { + fn func(context.Context, NetworkCollection) (NetworkCollection, error) + nc NetworkCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *NetworkCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.nc) + if err != nil { + return err + } + page.nc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *NetworkCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page NetworkCollectionPage) NotDone() bool { + return !page.nc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page NetworkCollectionPage) Response() NetworkCollection { + return page.nc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page NetworkCollectionPage) Values() []Network { + if page.nc.IsEmpty() { + return nil + } + return *page.nc.Value +} + +// Creates a new instance of the NetworkCollectionPage type. +func NewNetworkCollectionPage(cur NetworkCollection, getNextPage func(context.Context, NetworkCollection) (NetworkCollection, error)) NetworkCollectionPage { + return NetworkCollectionPage{ + fn: getNextPage, + nc: cur, + } +} + +// NetworkMapping network Mapping model. Ideally it should have been possible to inherit this class from +// prev version in InheritedModels as long as there is no difference in structure or method signature. +// Since there were no base Models for certain fields and methods viz NetworkMappingProperties and Load +// with required return type, the class has been introduced in its entirety with references to base models +// to facilitate extensions in subsequent versions. +type NetworkMapping struct { + autorest.Response `json:"-"` + // Properties - The Network Mapping Properties. + Properties *NetworkMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for NetworkMapping. +func (nm NetworkMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if nm.Properties != nil { + objectMap["properties"] = nm.Properties + } + if nm.Location != nil { + objectMap["location"] = nm.Location + } + return json.Marshal(objectMap) +} + +// NetworkMappingCollection list of network mappings. As with NetworkMapping, it should be possible to +// reuse a prev version of this class. It doesn't seem likely this class could be anything more than a +// slightly bespoke collection of NetworkMapping. Hence it makes sense to override Load with +// Base.NetworkMapping instead of existing CurrentVersion.NetworkMapping. +type NetworkMappingCollection struct { + autorest.Response `json:"-"` + // Value - The Network Mappings list. + Value *[]NetworkMapping `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// NetworkMappingCollectionIterator provides access to a complete listing of NetworkMapping values. +type NetworkMappingCollectionIterator struct { + i int + page NetworkMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *NetworkMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *NetworkMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter NetworkMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter NetworkMappingCollectionIterator) Response() NetworkMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter NetworkMappingCollectionIterator) Value() NetworkMapping { + if !iter.page.NotDone() { + return NetworkMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the NetworkMappingCollectionIterator type. +func NewNetworkMappingCollectionIterator(page NetworkMappingCollectionPage) NetworkMappingCollectionIterator { + return NetworkMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (nmc NetworkMappingCollection) IsEmpty() bool { + return nmc.Value == nil || len(*nmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (nmc NetworkMappingCollection) hasNextLink() bool { + return nmc.NextLink != nil && len(*nmc.NextLink) != 0 +} + +// networkMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (nmc NetworkMappingCollection) networkMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !nmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(nmc.NextLink))) +} + +// NetworkMappingCollectionPage contains a page of NetworkMapping values. +type NetworkMappingCollectionPage struct { + fn func(context.Context, NetworkMappingCollection) (NetworkMappingCollection, error) + nmc NetworkMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *NetworkMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.nmc) + if err != nil { + return err + } + page.nmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *NetworkMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page NetworkMappingCollectionPage) NotDone() bool { + return !page.nmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page NetworkMappingCollectionPage) Response() NetworkMappingCollection { + return page.nmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page NetworkMappingCollectionPage) Values() []NetworkMapping { + if page.nmc.IsEmpty() { + return nil + } + return *page.nmc.Value +} + +// Creates a new instance of the NetworkMappingCollectionPage type. +func NewNetworkMappingCollectionPage(cur NetworkMappingCollection, getNextPage func(context.Context, NetworkMappingCollection) (NetworkMappingCollection, error)) NetworkMappingCollectionPage { + return NetworkMappingCollectionPage{ + fn: getNextPage, + nmc: cur, + } +} + +// BasicNetworkMappingFabricSpecificSettings network Mapping fabric specific settings. +type BasicNetworkMappingFabricSpecificSettings interface { + AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) + AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) + AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) + AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) +} + +// NetworkMappingFabricSpecificSettings network Mapping fabric specific settings. +type NetworkMappingFabricSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicNetworkMappingFabricSpecificSettings(body []byte) (BasicNetworkMappingFabricSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure): + var atanms AzureToAzureNetworkMappingSettings + err := json.Unmarshal(body, &atanms) + return atanms, err + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure): + var vtanms VmmToAzureNetworkMappingSettings + err := json.Unmarshal(body, &vtanms) + return vtanms, err + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm): + var vtvnms VmmToVmmNetworkMappingSettings + err := json.Unmarshal(body, &vtvnms) + return vtvnms, err + default: + var nmfss NetworkMappingFabricSpecificSettings + err := json.Unmarshal(body, &nmfss) + return nmfss, err + } +} +func unmarshalBasicNetworkMappingFabricSpecificSettingsArray(body []byte) ([]BasicNetworkMappingFabricSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + nmfssArray := make([]BasicNetworkMappingFabricSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + nmfss, err := unmarshalBasicNetworkMappingFabricSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + nmfssArray[index] = nmfss + } + return nmfssArray, nil +} + +// MarshalJSON is the custom marshaler for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) MarshalJSON() ([]byte, error) { + nmfss.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings + objectMap := make(map[string]interface{}) + if nmfss.InstanceType != "" { + objectMap["instanceType"] = nmfss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return &nmfss, true +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &nmfss, true +} + +// NetworkMappingProperties network Mapping Properties. +type NetworkMappingProperties struct { + // State - The pairing state for network mapping. + State *string `json:"state,omitempty"` + // PrimaryNetworkFriendlyName - The primary network friendly name. + PrimaryNetworkFriendlyName *string `json:"primaryNetworkFriendlyName,omitempty"` + // PrimaryNetworkID - The primary network id for network mapping. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // PrimaryFabricFriendlyName - The primary fabric friendly name. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // RecoveryNetworkFriendlyName - The recovery network friendly name. + RecoveryNetworkFriendlyName *string `json:"recoveryNetworkFriendlyName,omitempty"` + // RecoveryNetworkID - The recovery network id for network mapping. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // RecoveryFabricArmID - The recovery fabric ARM id. + RecoveryFabricArmID *string `json:"recoveryFabricArmId,omitempty"` + // RecoveryFabricFriendlyName - The recovery fabric friendly name. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // FabricSpecificSettings - The fabric specific settings. + FabricSpecificSettings BasicNetworkMappingFabricSpecificSettings `json:"fabricSpecificSettings,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for NetworkMappingProperties struct. +func (nmp *NetworkMappingProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + nmp.State = &state + } + case "primaryNetworkFriendlyName": + if v != nil { + var primaryNetworkFriendlyName string + err = json.Unmarshal(*v, &primaryNetworkFriendlyName) + if err != nil { + return err + } + nmp.PrimaryNetworkFriendlyName = &primaryNetworkFriendlyName + } + case "primaryNetworkId": + if v != nil { + var primaryNetworkID string + err = json.Unmarshal(*v, &primaryNetworkID) + if err != nil { + return err + } + nmp.PrimaryNetworkID = &primaryNetworkID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + nmp.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "recoveryNetworkFriendlyName": + if v != nil { + var recoveryNetworkFriendlyName string + err = json.Unmarshal(*v, &recoveryNetworkFriendlyName) + if err != nil { + return err + } + nmp.RecoveryNetworkFriendlyName = &recoveryNetworkFriendlyName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + nmp.RecoveryNetworkID = &recoveryNetworkID + } + case "recoveryFabricArmId": + if v != nil { + var recoveryFabricArmID string + err = json.Unmarshal(*v, &recoveryFabricArmID) + if err != nil { + return err + } + nmp.RecoveryFabricArmID = &recoveryFabricArmID + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + nmp.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "fabricSpecificSettings": + if v != nil { + fabricSpecificSettings, err := unmarshalBasicNetworkMappingFabricSpecificSettings(*v) + if err != nil { + return err + } + nmp.FabricSpecificSettings = fabricSpecificSettings + } + } + } + + return nil +} + +// NetworkProperties network Properties. +type NetworkProperties struct { + // FabricType - The Fabric Type. + FabricType *string `json:"fabricType,omitempty"` + // Subnets - The List of subnets. + Subnets *[]Subnet `json:"subnets,omitempty"` + // FriendlyName - The Friendly Name. + FriendlyName *string `json:"friendlyName,omitempty"` + // NetworkType - The Network Type. + NetworkType *string `json:"networkType,omitempty"` +} + +// NewProtectionProfile new Protection profile input. +type NewProtectionProfile struct { + // PolicyName - The protection profile input. + PolicyName *string `json:"policyName,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for NewProtectionProfile. +func (npp NewProtectionProfile) MarshalJSON() ([]byte, error) { + npp.ResourceType = ResourceTypeNew + objectMap := make(map[string]interface{}) + if npp.PolicyName != nil { + objectMap["policyName"] = npp.PolicyName + } + if npp.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = npp.RecoveryPointHistory + } + if npp.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = npp.CrashConsistentFrequencyInMinutes + } + if npp.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = npp.AppConsistentFrequencyInMinutes + } + if npp.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = npp.MultiVMSyncStatus + } + if npp.ResourceType != "" { + objectMap["resourceType"] = npp.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return nil, false +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return &npp, true +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return nil, false +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &npp, true +} + +// NewRecoveryVirtualNetwork recovery virtual network input to create new virtual network from given source +// network. +type NewRecoveryVirtualNetwork struct { + // RecoveryVirtualNetworkResourceGroupName - The name of the resource group to be used to create the recovery virtual network. If absent, target network would be created in the same resource group as target VM. + RecoveryVirtualNetworkResourceGroupName *string `json:"recoveryVirtualNetworkResourceGroupName,omitempty"` + // RecoveryVirtualNetworkName - The recovery virtual network name. + RecoveryVirtualNetworkName *string `json:"recoveryVirtualNetworkName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) MarshalJSON() ([]byte, error) { + nrvn.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew + objectMap := make(map[string]interface{}) + if nrvn.RecoveryVirtualNetworkResourceGroupName != nil { + objectMap["recoveryVirtualNetworkResourceGroupName"] = nrvn.RecoveryVirtualNetworkResourceGroupName + } + if nrvn.RecoveryVirtualNetworkName != nil { + objectMap["recoveryVirtualNetworkName"] = nrvn.RecoveryVirtualNetworkName + } + if nrvn.ResourceType != "" { + objectMap["resourceType"] = nrvn.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return &nrvn, true +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &nrvn, true +} + +// OperationsDiscovery operations discovery class. +type OperationsDiscovery struct { + // Name - Name of the API. The name of the operation being performed on this particular object. It should match the action name that appears in RBAC / the event service. Examples of operations include: * Microsoft.Compute/virtualMachine/capture/action * Microsoft.Compute/virtualMachine/restart/action * Microsoft.Compute/virtualMachine/write * Microsoft.Compute/virtualMachine/read * Microsoft.Compute/virtualMachine/delete Each action should include, in order: (1) Resource Provider Namespace (2) Type hierarchy for which the action applies (e.g. server/databases for a SQL Azure database) (3) Read, Write, Action or Delete indicating which type applies. If it is a PUT/PATCH on a collection or named value, Write should be used. If it is a GET, Read should be used. If it is a DELETE, Delete should be used. If it is a POST, Action should be used. As a note: all resource providers would need to include the "{Resource Provider Namespace}/register/action" operation in their response. This API is used to register for their service, and should include details about the operation (e.g. a localized name for the resource provider + any special considerations like PII release). + Name *string `json:"name,omitempty"` + // Display - Object type. + Display *Display `json:"display,omitempty"` + // Origin - Origin. The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. Default value is "user,system". + Origin *string `json:"origin,omitempty"` + // Properties - Properties. Reserved for future use. + Properties interface{} `json:"properties,omitempty"` +} + +// OperationsDiscoveryCollection collection of ClientDiscovery details. +type OperationsDiscoveryCollection struct { + autorest.Response `json:"-"` + // Value - The ClientDiscovery details. + Value *[]OperationsDiscovery `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationsDiscoveryCollectionIterator provides access to a complete listing of OperationsDiscovery +// values. +type OperationsDiscoveryCollectionIterator struct { + i int + page OperationsDiscoveryCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationsDiscoveryCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsDiscoveryCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationsDiscoveryCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationsDiscoveryCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationsDiscoveryCollectionIterator) Response() OperationsDiscoveryCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationsDiscoveryCollectionIterator) Value() OperationsDiscovery { + if !iter.page.NotDone() { + return OperationsDiscovery{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationsDiscoveryCollectionIterator type. +func NewOperationsDiscoveryCollectionIterator(page OperationsDiscoveryCollectionPage) OperationsDiscoveryCollectionIterator { + return OperationsDiscoveryCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (odc OperationsDiscoveryCollection) IsEmpty() bool { + return odc.Value == nil || len(*odc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (odc OperationsDiscoveryCollection) hasNextLink() bool { + return odc.NextLink != nil && len(*odc.NextLink) != 0 +} + +// operationsDiscoveryCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (odc OperationsDiscoveryCollection) operationsDiscoveryCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !odc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(odc.NextLink))) +} + +// OperationsDiscoveryCollectionPage contains a page of OperationsDiscovery values. +type OperationsDiscoveryCollectionPage struct { + fn func(context.Context, OperationsDiscoveryCollection) (OperationsDiscoveryCollection, error) + odc OperationsDiscoveryCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationsDiscoveryCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsDiscoveryCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.odc) + if err != nil { + return err + } + page.odc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationsDiscoveryCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationsDiscoveryCollectionPage) NotDone() bool { + return !page.odc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationsDiscoveryCollectionPage) Response() OperationsDiscoveryCollection { + return page.odc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationsDiscoveryCollectionPage) Values() []OperationsDiscovery { + if page.odc.IsEmpty() { + return nil + } + return *page.odc.Value +} + +// Creates a new instance of the OperationsDiscoveryCollectionPage type. +func NewOperationsDiscoveryCollectionPage(cur OperationsDiscoveryCollection, getNextPage func(context.Context, OperationsDiscoveryCollection) (OperationsDiscoveryCollection, error)) OperationsDiscoveryCollectionPage { + return OperationsDiscoveryCollectionPage{ + fn: getNextPage, + odc: cur, + } +} + +// OSDetails disk Details. +type OSDetails struct { + // OsType - VM Disk details. + OsType *string `json:"osType,omitempty"` + // ProductType - Product type. + ProductType *string `json:"productType,omitempty"` + // OsEdition - The OSEdition. + OsEdition *string `json:"osEdition,omitempty"` + // OSVersion - The OS Version. + OSVersion *string `json:"oSVersion,omitempty"` + // OSMajorVersion - The OS Major Version. + OSMajorVersion *string `json:"oSMajorVersion,omitempty"` + // OSMinorVersion - The OS Minor Version. + OSMinorVersion *string `json:"oSMinorVersion,omitempty"` +} + +// OSDiskDetails details of the OS Disk. +type OSDiskDetails struct { + // OsVhdID - The id of the disk containing the OS. + OsVhdID *string `json:"osVhdId,omitempty"` + // OsType - The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // VhdName - The OS disk VHD name. + VhdName *string `json:"vhdName,omitempty"` +} + +// OSVersionWrapper wrapper model for OSVersion to include version and service pack info. +type OSVersionWrapper struct { + // Version - The version. + Version *string `json:"version,omitempty"` + // ServicePack - The service pack. + ServicePack *string `json:"servicePack,omitempty"` +} + +// PlannedFailoverInput input definition for planned failover. +type PlannedFailoverInput struct { + // Properties - Planned failover input properties. + Properties *PlannedFailoverInputProperties `json:"properties,omitempty"` +} + +// PlannedFailoverInputProperties input definition for planned failover input properties. +type PlannedFailoverInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicPlannedFailoverProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for PlannedFailoverInputProperties struct. +func (pfip *PlannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + pfip.FailoverDirection = &failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(*v) + if err != nil { + return err + } + pfip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicPlannedFailoverProviderSpecificFailoverInput provider specific failover input. +type BasicPlannedFailoverProviderSpecificFailoverInput interface { + AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) + AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) + AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) + AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) +} + +// PlannedFailoverProviderSpecificFailoverInput provider specific failover input. +type PlannedFailoverProviderSpecificFailoverInput struct { + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(body []byte) (BasicPlannedFailoverProviderSpecificFailoverInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeHyperVReplicaAzureFailback): + var hvrafpi HyperVReplicaAzureFailbackProviderInput + err := json.Unmarshal(body, &hvrafpi) + return hvrafpi, err + case string(InstanceTypeHyperVReplicaAzure): + var hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput + err := json.Unmarshal(body, &hvrapfpi) + return hvrapfpi, err + case string(InstanceTypeInMageRcmFailback): + var imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput + err := json.Unmarshal(body, &imrfpfpi) + return imrfpfpi, err + default: + var pfpsfi PlannedFailoverProviderSpecificFailoverInput + err := json.Unmarshal(body, &pfpsfi) + return pfpsfi, err + } +} +func unmarshalBasicPlannedFailoverProviderSpecificFailoverInputArray(body []byte) ([]BasicPlannedFailoverProviderSpecificFailoverInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pfpsfiArray := make([]BasicPlannedFailoverProviderSpecificFailoverInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pfpsfi, err := unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(*rawMessage) + if err != nil { + return nil, err + } + pfpsfiArray[index] = pfpsfi + } + return pfpsfiArray, nil +} + +// MarshalJSON is the custom marshaler for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) MarshalJSON() ([]byte, error) { + pfpsfi.InstanceType = InstanceTypePlannedFailoverProviderSpecificFailoverInput + objectMap := make(map[string]interface{}) + if pfpsfi.InstanceType != "" { + objectMap["instanceType"] = pfpsfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return &pfpsfi, true +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &pfpsfi, true +} + +// Policy protection profile details. +type Policy struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *PolicyProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Policy. +func (p Policy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.Properties != nil { + objectMap["properties"] = p.Properties + } + if p.Location != nil { + objectMap["location"] = p.Location + } + return json.Marshal(objectMap) +} + +// PolicyCollection protection Profile Collection details. +type PolicyCollection struct { + autorest.Response `json:"-"` + // Value - The policy details. + Value *[]Policy `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// PolicyCollectionIterator provides access to a complete listing of Policy values. +type PolicyCollectionIterator struct { + i int + page PolicyCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PolicyCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PolicyCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PolicyCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PolicyCollectionIterator) Response() PolicyCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PolicyCollectionIterator) Value() Policy { + if !iter.page.NotDone() { + return Policy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PolicyCollectionIterator type. +func NewPolicyCollectionIterator(page PolicyCollectionPage) PolicyCollectionIterator { + return PolicyCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pc PolicyCollection) IsEmpty() bool { + return pc.Value == nil || len(*pc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pc PolicyCollection) hasNextLink() bool { + return pc.NextLink != nil && len(*pc.NextLink) != 0 +} + +// policyCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pc PolicyCollection) policyCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pc.NextLink))) +} + +// PolicyCollectionPage contains a page of Policy values. +type PolicyCollectionPage struct { + fn func(context.Context, PolicyCollection) (PolicyCollection, error) + pc PolicyCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PolicyCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pc) + if err != nil { + return err + } + page.pc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PolicyCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PolicyCollectionPage) NotDone() bool { + return !page.pc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PolicyCollectionPage) Response() PolicyCollection { + return page.pc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PolicyCollectionPage) Values() []Policy { + if page.pc.IsEmpty() { + return nil + } + return *page.pc.Value +} + +// Creates a new instance of the PolicyCollectionPage type. +func NewPolicyCollectionPage(cur PolicyCollection, getNextPage func(context.Context, PolicyCollection) (PolicyCollection, error)) PolicyCollectionPage { + return PolicyCollectionPage{ + fn: getNextPage, + pc: cur, + } +} + +// PolicyProperties protection profile custom data details. +type PolicyProperties struct { + // FriendlyName - The FriendlyName. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProviderSpecificDetails - The ReplicationChannelSetting. + ProviderSpecificDetails BasicPolicyProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for PolicyProperties struct. +func (pp *PolicyProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + pp.FriendlyName = &friendlyName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicPolicyProviderSpecificDetails(*v) + if err != nil { + return err + } + pp.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicPolicyProviderSpecificDetails base class for Provider specific details for policies. +type BasicPolicyProviderSpecificDetails interface { + AsA2APolicyDetails() (*A2APolicyDetails, bool) + AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) + AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) + AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) + AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) + AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) + AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) + AsInMagePolicyDetails() (*InMagePolicyDetails, bool) + AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) + AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) + AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) + AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) +} + +// PolicyProviderSpecificDetails base class for Provider specific details for policies. +type PolicyProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicPolicyProviderSpecificDetails(body []byte) (BasicPolicyProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A): + var apd A2APolicyDetails + err := json.Unmarshal(body, &apd) + return apd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure): + var hvrapd HyperVReplicaAzurePolicyDetails + err := json.Unmarshal(body, &hvrapd) + return hvrapd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails): + var hvrbpd HyperVReplicaBasePolicyDetails + err := json.Unmarshal(body, &hvrbpd) + return hvrbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2): + var hvrbpd HyperVReplicaBluePolicyDetails + err := json.Unmarshal(body, &hvrbpd) + return hvrbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012): + var hvrpd HyperVReplicaPolicyDetails + err := json.Unmarshal(body, &hvrpd) + return hvrpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2): + var imavpd InMageAzureV2PolicyDetails + err := json.Unmarshal(body, &imavpd) + return imavpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails): + var imbpd InMageBasePolicyDetails + err := json.Unmarshal(body, &imbpd) + return imbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage): + var impd InMagePolicyDetails + err := json.Unmarshal(body, &impd) + return impd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback): + var imrfpd InMageRcmFailbackPolicyDetails + err := json.Unmarshal(body, &imrfpd) + return imrfpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm): + var imrpd InMageRcmPolicyDetails + err := json.Unmarshal(body, &imrpd) + return imrpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt): + var vcpd VmwareCbtPolicyDetails + err := json.Unmarshal(body, &vcpd) + return vcpd, err + default: + var ppsd PolicyProviderSpecificDetails + err := json.Unmarshal(body, &ppsd) + return ppsd, err + } +} +func unmarshalBasicPolicyProviderSpecificDetailsArray(body []byte) ([]BasicPolicyProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppsdArray := make([]BasicPolicyProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppsd, err := unmarshalBasicPolicyProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + ppsdArray[index] = ppsd + } + return ppsdArray, nil +} + +// MarshalJSON is the custom marshaler for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) MarshalJSON() ([]byte, error) { + ppsd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails + objectMap := make(map[string]interface{}) + if ppsd.InstanceType != "" { + objectMap["instanceType"] = ppsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return &ppsd, true +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &ppsd, true +} + +// BasicPolicyProviderSpecificInput base class for provider specific input. +type BasicPolicyProviderSpecificInput interface { + AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) + AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) + AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) + AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) + AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) + AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) + AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) + AsInMagePolicyInput() (*InMagePolicyInput, bool) + AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) + AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) + AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) + AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) +} + +// PolicyProviderSpecificInput base class for provider specific input. +type PolicyProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicPolicyProviderSpecificInput(body []byte) (BasicPolicyProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmpci A2ACrossClusterMigrationPolicyCreationInput + err := json.Unmarshal(body, &accmpci) + return accmpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A): + var apci A2APolicyCreationInput + err := json.Unmarshal(body, &apci) + return apci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvrapi HyperVReplicaAzurePolicyInput + err := json.Unmarshal(body, &hvrapi) + return hvrapi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2): + var hvrbpi HyperVReplicaBluePolicyInput + err := json.Unmarshal(body, &hvrbpi) + return hvrbpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012): + var hvrpi HyperVReplicaPolicyInput + err := json.Unmarshal(body, &hvrpi) + return hvrpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2): + var imavpi InMageAzureV2PolicyInput + err := json.Unmarshal(body, &imavpi) + return imavpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage): + var impi InMagePolicyInput + err := json.Unmarshal(body, &impi) + return impi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback): + var imrfpci InMageRcmFailbackPolicyCreationInput + err := json.Unmarshal(body, &imrfpci) + return imrfpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm): + var imrpci InMageRcmPolicyCreationInput + err := json.Unmarshal(body, &imrpci) + return imrpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt): + var vmcpci VMwareCbtPolicyCreationInput + err := json.Unmarshal(body, &vmcpci) + return vmcpci, err + default: + var ppsi PolicyProviderSpecificInput + err := json.Unmarshal(body, &ppsi) + return ppsi, err + } +} +func unmarshalBasicPolicyProviderSpecificInputArray(body []byte) ([]BasicPolicyProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppsiArray := make([]BasicPolicyProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppsi, err := unmarshalBasicPolicyProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + ppsiArray[index] = ppsi + } + return ppsiArray, nil +} + +// MarshalJSON is the custom marshaler for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) MarshalJSON() ([]byte, error) { + ppsi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput + objectMap := make(map[string]interface{}) + if ppsi.InstanceType != "" { + objectMap["instanceType"] = ppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return &ppsi, true +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &ppsi, true +} + +// ProcessServer details of the Process Server. +type ProcessServer struct { + // FriendlyName - The Process Server's friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ID - The Process Server Id. + ID *string `json:"id,omitempty"` + // IPAddress - The IP address of the server. + IPAddress *string `json:"ipAddress,omitempty"` + // OsType - The OS type of the server. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The version of the scout component on the server. + AgentVersion *string `json:"agentVersion,omitempty"` + // LastHeartbeat - The last heartbeat received from the server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // MobilityServiceUpdates - The list of the mobility service updates available on the Process Server. + MobilityServiceUpdates *[]MobilityServiceUpdate `json:"mobilityServiceUpdates,omitempty"` + // HostID - The agent generated Id. + HostID *string `json:"hostId,omitempty"` + // MachineCount - The servers configured with this PS. + MachineCount *string `json:"machineCount,omitempty"` + // ReplicationPairCount - The number of replication pairs configured in this PS. + ReplicationPairCount *string `json:"replicationPairCount,omitempty"` + // SystemLoad - The percentage of the system load. + SystemLoad *string `json:"systemLoad,omitempty"` + // SystemLoadStatus - The system load status. + SystemLoadStatus *string `json:"systemLoadStatus,omitempty"` + // CPULoad - The percentage of the CPU load. + CPULoad *string `json:"cpuLoad,omitempty"` + // CPULoadStatus - The CPU load status. + CPULoadStatus *string `json:"cpuLoadStatus,omitempty"` + // TotalMemoryInBytes - The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // MemoryUsageStatus - The memory usage status. + MemoryUsageStatus *string `json:"memoryUsageStatus,omitempty"` + // TotalSpaceInBytes - The total space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - The available space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // SpaceUsageStatus - The space usage status. + SpaceUsageStatus *string `json:"spaceUsageStatus,omitempty"` + // PsServiceStatus - The PS service status. + PsServiceStatus *string `json:"psServiceStatus,omitempty"` + // SslCertExpiryDate - The PS SSL cert expiry date. + SslCertExpiryDate *date.Time `json:"sslCertExpiryDate,omitempty"` + // SslCertExpiryRemainingDays - CS SSL cert expiry date. + SslCertExpiryRemainingDays *int32 `json:"sslCertExpiryRemainingDays,omitempty"` + // OsVersion - OS Version of the process server. Note: This will get populated if user has CS version greater than 9.12.0.0. + OsVersion *string `json:"osVersion,omitempty"` + // HealthErrors - Health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // AgentVersionDetails - The agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // Health - READ-ONLY; The health of Process Server. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // PsStatsRefreshTime - READ-ONLY; The process server stats refresh time. + PsStatsRefreshTime *date.Time `json:"psStatsRefreshTime,omitempty"` + // ThroughputUploadPendingDataInBytes - READ-ONLY; The uploading pending data in bytes. + ThroughputUploadPendingDataInBytes *int64 `json:"throughputUploadPendingDataInBytes,omitempty"` + // ThroughputInMBps - READ-ONLY; The throughput in MBps. + ThroughputInMBps *int64 `json:"throughputInMBps,omitempty"` + // ThroughputInBytes - READ-ONLY; The throughput in bytes. + ThroughputInBytes *int64 `json:"throughputInBytes,omitempty"` + // ThroughputStatus - READ-ONLY; The throughput status. + ThroughputStatus *string `json:"throughputStatus,omitempty"` + // MarsCommunicationStatus - READ-ONLY; The MARS communication status. + MarsCommunicationStatus *string `json:"marsCommunicationStatus,omitempty"` + // MarsRegistrationStatus - READ-ONLY; The MARS registration status. + MarsRegistrationStatus *string `json:"marsRegistrationStatus,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessServer. +func (ps ProcessServer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ps.FriendlyName != nil { + objectMap["friendlyName"] = ps.FriendlyName + } + if ps.ID != nil { + objectMap["id"] = ps.ID + } + if ps.IPAddress != nil { + objectMap["ipAddress"] = ps.IPAddress + } + if ps.OsType != nil { + objectMap["osType"] = ps.OsType + } + if ps.AgentVersion != nil { + objectMap["agentVersion"] = ps.AgentVersion + } + if ps.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = ps.LastHeartbeat + } + if ps.VersionStatus != nil { + objectMap["versionStatus"] = ps.VersionStatus + } + if ps.MobilityServiceUpdates != nil { + objectMap["mobilityServiceUpdates"] = ps.MobilityServiceUpdates + } + if ps.HostID != nil { + objectMap["hostId"] = ps.HostID + } + if ps.MachineCount != nil { + objectMap["machineCount"] = ps.MachineCount + } + if ps.ReplicationPairCount != nil { + objectMap["replicationPairCount"] = ps.ReplicationPairCount + } + if ps.SystemLoad != nil { + objectMap["systemLoad"] = ps.SystemLoad + } + if ps.SystemLoadStatus != nil { + objectMap["systemLoadStatus"] = ps.SystemLoadStatus + } + if ps.CPULoad != nil { + objectMap["cpuLoad"] = ps.CPULoad + } + if ps.CPULoadStatus != nil { + objectMap["cpuLoadStatus"] = ps.CPULoadStatus + } + if ps.TotalMemoryInBytes != nil { + objectMap["totalMemoryInBytes"] = ps.TotalMemoryInBytes + } + if ps.AvailableMemoryInBytes != nil { + objectMap["availableMemoryInBytes"] = ps.AvailableMemoryInBytes + } + if ps.MemoryUsageStatus != nil { + objectMap["memoryUsageStatus"] = ps.MemoryUsageStatus + } + if ps.TotalSpaceInBytes != nil { + objectMap["totalSpaceInBytes"] = ps.TotalSpaceInBytes + } + if ps.AvailableSpaceInBytes != nil { + objectMap["availableSpaceInBytes"] = ps.AvailableSpaceInBytes + } + if ps.SpaceUsageStatus != nil { + objectMap["spaceUsageStatus"] = ps.SpaceUsageStatus + } + if ps.PsServiceStatus != nil { + objectMap["psServiceStatus"] = ps.PsServiceStatus + } + if ps.SslCertExpiryDate != nil { + objectMap["sslCertExpiryDate"] = ps.SslCertExpiryDate + } + if ps.SslCertExpiryRemainingDays != nil { + objectMap["sslCertExpiryRemainingDays"] = ps.SslCertExpiryRemainingDays + } + if ps.OsVersion != nil { + objectMap["osVersion"] = ps.OsVersion + } + if ps.HealthErrors != nil { + objectMap["healthErrors"] = ps.HealthErrors + } + if ps.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = ps.AgentExpiryDate + } + if ps.AgentVersionDetails != nil { + objectMap["agentVersionDetails"] = ps.AgentVersionDetails + } + return json.Marshal(objectMap) +} + +// ProcessServerDetails process server details. +type ProcessServerDetails struct { + // ID - READ-ONLY; The process server Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The process server name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The process server Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The process server Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // IPAddresses - READ-ONLY; The list of IP addresses for communicating with the RCM component. + IPAddresses *[]string `json:"ipAddresses,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the process server. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // TotalMemoryInBytes - READ-ONLY; The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - READ-ONLY; The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // UsedMemoryInBytes - READ-ONLY; The used memory. + UsedMemoryInBytes *int64 `json:"usedMemoryInBytes,omitempty"` + // MemoryUsagePercentage - READ-ONLY; The memory usage percentage. + MemoryUsagePercentage *float64 `json:"memoryUsagePercentage,omitempty"` + // TotalSpaceInBytes - READ-ONLY; The total disk space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - READ-ONLY; The available disk space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // UsedSpaceInBytes - READ-ONLY; The used disk space. + UsedSpaceInBytes *int64 `json:"usedSpaceInBytes,omitempty"` + // FreeSpacePercentage - READ-ONLY; The free disk space percentage. + FreeSpacePercentage *float64 `json:"freeSpacePercentage,omitempty"` + // ThroughputUploadPendingDataInBytes - READ-ONLY; The uploading pending data in bytes. + ThroughputUploadPendingDataInBytes *int64 `json:"throughputUploadPendingDataInBytes,omitempty"` + // ThroughputInBytes - READ-ONLY; The throughput in bytes. + ThroughputInBytes *int64 `json:"throughputInBytes,omitempty"` + // ProcessorUsagePercentage - READ-ONLY; The processor usage percentage. + ProcessorUsagePercentage *float64 `json:"processorUsagePercentage,omitempty"` + // ThroughputStatus - READ-ONLY; The throughput status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + ThroughputStatus RcmComponentStatus `json:"throughputStatus,omitempty"` + // SystemLoad - READ-ONLY; The system load. + SystemLoad *int64 `json:"systemLoad,omitempty"` + // SystemLoadStatus - READ-ONLY; The system load status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + SystemLoadStatus RcmComponentStatus `json:"systemLoadStatus,omitempty"` + // DiskUsageStatus - READ-ONLY; The disk usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + DiskUsageStatus RcmComponentStatus `json:"diskUsageStatus,omitempty"` + // MemoryUsageStatus - READ-ONLY; The memory usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + MemoryUsageStatus RcmComponentStatus `json:"memoryUsageStatus,omitempty"` + // ProcessorUsageStatus - READ-ONLY; The processor usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + ProcessorUsageStatus RcmComponentStatus `json:"processorUsageStatus,omitempty"` + // Health - READ-ONLY; The health of the process server. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // ProtectedItemCount - READ-ONLY; The protected item count. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // HistoricHealth - READ-ONLY; The historic health of the process server based on the health in last 24 hours. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + HistoricHealth ProtectionHealth `json:"historicHealth,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessServerDetails. +func (psd ProcessServerDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ProtectableItem replication protected item. +type ProtectableItem struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectableItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectableItem. +func (pi ProtectableItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pi.Properties != nil { + objectMap["properties"] = pi.Properties + } + if pi.Location != nil { + objectMap["location"] = pi.Location + } + return json.Marshal(objectMap) +} + +// ProtectableItemCollection protectable item collection. +type ProtectableItemCollection struct { + autorest.Response `json:"-"` + // Value - The Protectable item details. + Value *[]ProtectableItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectableItemCollectionIterator provides access to a complete listing of ProtectableItem values. +type ProtectableItemCollectionIterator struct { + i int + page ProtectableItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectableItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectableItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectableItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectableItemCollectionIterator) Response() ProtectableItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectableItemCollectionIterator) Value() ProtectableItem { + if !iter.page.NotDone() { + return ProtectableItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectableItemCollectionIterator type. +func NewProtectableItemCollectionIterator(page ProtectableItemCollectionPage) ProtectableItemCollectionIterator { + return ProtectableItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pic ProtectableItemCollection) IsEmpty() bool { + return pic.Value == nil || len(*pic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pic ProtectableItemCollection) hasNextLink() bool { + return pic.NextLink != nil && len(*pic.NextLink) != 0 +} + +// protectableItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pic ProtectableItemCollection) protectableItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pic.NextLink))) +} + +// ProtectableItemCollectionPage contains a page of ProtectableItem values. +type ProtectableItemCollectionPage struct { + fn func(context.Context, ProtectableItemCollection) (ProtectableItemCollection, error) + pic ProtectableItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectableItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pic) + if err != nil { + return err + } + page.pic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectableItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectableItemCollectionPage) NotDone() bool { + return !page.pic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectableItemCollectionPage) Response() ProtectableItemCollection { + return page.pic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectableItemCollectionPage) Values() []ProtectableItem { + if page.pic.IsEmpty() { + return nil + } + return *page.pic.Value +} + +// Creates a new instance of the ProtectableItemCollectionPage type. +func NewProtectableItemCollectionPage(cur ProtectableItemCollection, getNextPage func(context.Context, ProtectableItemCollection) (ProtectableItemCollection, error)) ProtectableItemCollectionPage { + return ProtectableItemCollectionPage{ + fn: getNextPage, + pic: cur, + } +} + +// ProtectableItemProperties replication protected item custom data details. +type ProtectableItemProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionStatus - The protection status. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ReplicationProtectedItemID - The ARM resource of protected items. + ReplicationProtectedItemID *string `json:"replicationProtectedItemId,omitempty"` + // RecoveryServicesProviderID - The recovery provider ARM Id. + RecoveryServicesProviderID *string `json:"recoveryServicesProviderId,omitempty"` + // ProtectionReadinessErrors - The Current protection readiness errors. + ProtectionReadinessErrors *[]string `json:"protectionReadinessErrors,omitempty"` + // SupportedReplicationProviders - The list of replication providers supported for the protectable item. + SupportedReplicationProviders *[]string `json:"supportedReplicationProviders,omitempty"` + // CustomDetails - The Replication provider custom settings. + CustomDetails BasicConfigurationSettings `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ProtectableItemProperties struct. +func (pip *ProtectableItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + pip.FriendlyName = &friendlyName + } + case "protectionStatus": + if v != nil { + var protectionStatus string + err = json.Unmarshal(*v, &protectionStatus) + if err != nil { + return err + } + pip.ProtectionStatus = &protectionStatus + } + case "replicationProtectedItemId": + if v != nil { + var replicationProtectedItemID string + err = json.Unmarshal(*v, &replicationProtectedItemID) + if err != nil { + return err + } + pip.ReplicationProtectedItemID = &replicationProtectedItemID + } + case "recoveryServicesProviderId": + if v != nil { + var recoveryServicesProviderID string + err = json.Unmarshal(*v, &recoveryServicesProviderID) + if err != nil { + return err + } + pip.RecoveryServicesProviderID = &recoveryServicesProviderID + } + case "protectionReadinessErrors": + if v != nil { + var protectionReadinessErrors []string + err = json.Unmarshal(*v, &protectionReadinessErrors) + if err != nil { + return err + } + pip.ProtectionReadinessErrors = &protectionReadinessErrors + } + case "supportedReplicationProviders": + if v != nil { + var supportedReplicationProviders []string + err = json.Unmarshal(*v, &supportedReplicationProviders) + if err != nil { + return err + } + pip.SupportedReplicationProviders = &supportedReplicationProviders + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicConfigurationSettings(*v) + if err != nil { + return err + } + pip.CustomDetails = customDetails + } + } + } + + return nil +} + +// ProtectableItemQueryParameter query parameter to enumerate Protectable items. +type ProtectableItemQueryParameter struct { + // State - State of the Protectable item query filter. + State *string `json:"state,omitempty"` +} + +// ProtectedItemsQueryParameter query parameter to enumerate protected items. +type ProtectedItemsQueryParameter struct { + // SourceFabricName - The source fabric name filter. + SourceFabricName *string `json:"sourceFabricName,omitempty"` + // RecoveryPlanName - The recovery plan filter. + RecoveryPlanName *string `json:"recoveryPlanName,omitempty"` + // SourceFabricLocation - The source fabric location filter. + SourceFabricLocation *string `json:"sourceFabricLocation,omitempty"` + // FabricObjectID - The fabric object Id filter. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // VCenterName - The vCenter name filter. + VCenterName *string `json:"vCenterName,omitempty"` + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` + // MultiVMGroupCreateOption - Whether Multi VM group is auto created or specified by user. Possible values include: 'AutoCreated', 'UserSpecified' + MultiVMGroupCreateOption MultiVMGroupCreateOption `json:"multiVmGroupCreateOption,omitempty"` + // ProcessServerID - The process server Id filter. + ProcessServerID *string `json:"processServerId,omitempty"` +} + +// ProtectionContainer protection container details. +type ProtectionContainer struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectionContainerProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainer. +func (pc ProtectionContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pc.Properties != nil { + objectMap["properties"] = pc.Properties + } + if pc.Location != nil { + objectMap["location"] = pc.Location + } + return json.Marshal(objectMap) +} + +// ProtectionContainerCollection protection Container collection. +type ProtectionContainerCollection struct { + autorest.Response `json:"-"` + // Value - The Protection Container details. + Value *[]ProtectionContainer `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectionContainerCollectionIterator provides access to a complete listing of ProtectionContainer +// values. +type ProtectionContainerCollectionIterator struct { + i int + page ProtectionContainerCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectionContainerCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionContainerCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionContainerCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectionContainerCollectionIterator) Response() ProtectionContainerCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectionContainerCollectionIterator) Value() ProtectionContainer { + if !iter.page.NotDone() { + return ProtectionContainer{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectionContainerCollectionIterator type. +func NewProtectionContainerCollectionIterator(page ProtectionContainerCollectionPage) ProtectionContainerCollectionIterator { + return ProtectionContainerCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcc ProtectionContainerCollection) IsEmpty() bool { + return pcc.Value == nil || len(*pcc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pcc ProtectionContainerCollection) hasNextLink() bool { + return pcc.NextLink != nil && len(*pcc.NextLink) != 0 +} + +// protectionContainerCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcc ProtectionContainerCollection) protectionContainerCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pcc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcc.NextLink))) +} + +// ProtectionContainerCollectionPage contains a page of ProtectionContainer values. +type ProtectionContainerCollectionPage struct { + fn func(context.Context, ProtectionContainerCollection) (ProtectionContainerCollection, error) + pcc ProtectionContainerCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectionContainerCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pcc) + if err != nil { + return err + } + page.pcc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionContainerCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionContainerCollectionPage) NotDone() bool { + return !page.pcc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionContainerCollectionPage) Response() ProtectionContainerCollection { + return page.pcc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionContainerCollectionPage) Values() []ProtectionContainer { + if page.pcc.IsEmpty() { + return nil + } + return *page.pcc.Value +} + +// Creates a new instance of the ProtectionContainerCollectionPage type. +func NewProtectionContainerCollectionPage(cur ProtectionContainerCollection, getNextPage func(context.Context, ProtectionContainerCollection) (ProtectionContainerCollection, error)) ProtectionContainerCollectionPage { + return ProtectionContainerCollectionPage{ + fn: getNextPage, + pcc: cur, + } +} + +// ProtectionContainerFabricSpecificDetails base class for fabric specific details of container. +type ProtectionContainerFabricSpecificDetails struct { + // InstanceType - READ-ONLY; Gets the class type. Overridden in derived classes. + InstanceType *string `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainerFabricSpecificDetails. +func (pcfsd ProtectionContainerFabricSpecificDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ProtectionContainerMapping protection container mapping object. +type ProtectionContainerMapping struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectionContainerMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainerMapping. +func (pcm ProtectionContainerMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pcm.Properties != nil { + objectMap["properties"] = pcm.Properties + } + if pcm.Location != nil { + objectMap["location"] = pcm.Location + } + return json.Marshal(objectMap) +} + +// ProtectionContainerMappingCollection protection container mapping collection class. +type ProtectionContainerMappingCollection struct { + autorest.Response `json:"-"` + // Value - List of container mappings. + Value *[]ProtectionContainerMapping `json:"value,omitempty"` + // NextLink - Link to fetch rest of the data. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectionContainerMappingCollectionIterator provides access to a complete listing of +// ProtectionContainerMapping values. +type ProtectionContainerMappingCollectionIterator struct { + i int + page ProtectionContainerMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectionContainerMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionContainerMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionContainerMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectionContainerMappingCollectionIterator) Response() ProtectionContainerMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectionContainerMappingCollectionIterator) Value() ProtectionContainerMapping { + if !iter.page.NotDone() { + return ProtectionContainerMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectionContainerMappingCollectionIterator type. +func NewProtectionContainerMappingCollectionIterator(page ProtectionContainerMappingCollectionPage) ProtectionContainerMappingCollectionIterator { + return ProtectionContainerMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcmc ProtectionContainerMappingCollection) IsEmpty() bool { + return pcmc.Value == nil || len(*pcmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pcmc ProtectionContainerMappingCollection) hasNextLink() bool { + return pcmc.NextLink != nil && len(*pcmc.NextLink) != 0 +} + +// protectionContainerMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcmc ProtectionContainerMappingCollection) protectionContainerMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pcmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcmc.NextLink))) +} + +// ProtectionContainerMappingCollectionPage contains a page of ProtectionContainerMapping values. +type ProtectionContainerMappingCollectionPage struct { + fn func(context.Context, ProtectionContainerMappingCollection) (ProtectionContainerMappingCollection, error) + pcmc ProtectionContainerMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectionContainerMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pcmc) + if err != nil { + return err + } + page.pcmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionContainerMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionContainerMappingCollectionPage) NotDone() bool { + return !page.pcmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionContainerMappingCollectionPage) Response() ProtectionContainerMappingCollection { + return page.pcmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionContainerMappingCollectionPage) Values() []ProtectionContainerMapping { + if page.pcmc.IsEmpty() { + return nil + } + return *page.pcmc.Value +} + +// Creates a new instance of the ProtectionContainerMappingCollectionPage type. +func NewProtectionContainerMappingCollectionPage(cur ProtectionContainerMappingCollection, getNextPage func(context.Context, ProtectionContainerMappingCollection) (ProtectionContainerMappingCollection, error)) ProtectionContainerMappingCollectionPage { + return ProtectionContainerMappingCollectionPage{ + fn: getNextPage, + pcmc: cur, + } +} + +// ProtectionContainerMappingProperties protection container mapping properties. +type ProtectionContainerMappingProperties struct { + // TargetProtectionContainerID - Paired protection container ARM ID. + TargetProtectionContainerID *string `json:"targetProtectionContainerId,omitempty"` + // TargetProtectionContainerFriendlyName - Friendly name of paired container. + TargetProtectionContainerFriendlyName *string `json:"targetProtectionContainerFriendlyName,omitempty"` + // ProviderSpecificDetails - Provider specific provider details. + ProviderSpecificDetails BasicProtectionContainerMappingProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` + // Health - Health of pairing. + Health *string `json:"health,omitempty"` + // HealthErrorDetails - Health error. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // PolicyID - Policy ARM Id. + PolicyID *string `json:"policyId,omitempty"` + // State - Association Status. + State *string `json:"state,omitempty"` + // SourceProtectionContainerFriendlyName - Friendly name of source protection container. + SourceProtectionContainerFriendlyName *string `json:"sourceProtectionContainerFriendlyName,omitempty"` + // SourceFabricFriendlyName - Friendly name of source fabric. + SourceFabricFriendlyName *string `json:"sourceFabricFriendlyName,omitempty"` + // TargetFabricFriendlyName - Friendly name of target fabric. + TargetFabricFriendlyName *string `json:"targetFabricFriendlyName,omitempty"` + // PolicyFriendlyName - Friendly name of replication policy. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ProtectionContainerMappingProperties struct. +func (pcmp *ProtectionContainerMappingProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetProtectionContainerId": + if v != nil { + var targetProtectionContainerID string + err = json.Unmarshal(*v, &targetProtectionContainerID) + if err != nil { + return err + } + pcmp.TargetProtectionContainerID = &targetProtectionContainerID + } + case "targetProtectionContainerFriendlyName": + if v != nil { + var targetProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &targetProtectionContainerFriendlyName) + if err != nil { + return err + } + pcmp.TargetProtectionContainerFriendlyName = &targetProtectionContainerFriendlyName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicProtectionContainerMappingProviderSpecificDetails(*v) + if err != nil { + return err + } + pcmp.ProviderSpecificDetails = providerSpecificDetails + } + case "health": + if v != nil { + var health string + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + pcmp.Health = &health + } + case "healthErrorDetails": + if v != nil { + var healthErrorDetails []HealthError + err = json.Unmarshal(*v, &healthErrorDetails) + if err != nil { + return err + } + pcmp.HealthErrorDetails = &healthErrorDetails + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + pcmp.PolicyID = &policyID + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + pcmp.State = &state + } + case "sourceProtectionContainerFriendlyName": + if v != nil { + var sourceProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &sourceProtectionContainerFriendlyName) + if err != nil { + return err + } + pcmp.SourceProtectionContainerFriendlyName = &sourceProtectionContainerFriendlyName + } + case "sourceFabricFriendlyName": + if v != nil { + var sourceFabricFriendlyName string + err = json.Unmarshal(*v, &sourceFabricFriendlyName) + if err != nil { + return err + } + pcmp.SourceFabricFriendlyName = &sourceFabricFriendlyName + } + case "targetFabricFriendlyName": + if v != nil { + var targetFabricFriendlyName string + err = json.Unmarshal(*v, &targetFabricFriendlyName) + if err != nil { + return err + } + pcmp.TargetFabricFriendlyName = &targetFabricFriendlyName + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + pcmp.PolicyFriendlyName = &policyFriendlyName + } + } + } + + return nil +} + +// BasicProtectionContainerMappingProviderSpecificDetails container mapping provider specific details. +type BasicProtectionContainerMappingProviderSpecificDetails interface { + AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) + AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) + AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) + AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) +} + +// ProtectionContainerMappingProviderSpecificDetails container mapping provider specific details. +type ProtectionContainerMappingProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicProtectionContainerMappingProviderSpecificDetails(body []byte) (BasicProtectionContainerMappingProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A): + var apcmd A2AProtectionContainerMappingDetails + err := json.Unmarshal(body, &apcmd) + return apcmd, err + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm): + var imrpcmd InMageRcmProtectionContainerMappingDetails + err := json.Unmarshal(body, &imrpcmd) + return imrpcmd, err + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt): + var vmcpcmd VMwareCbtProtectionContainerMappingDetails + err := json.Unmarshal(body, &vmcpcmd) + return vmcpcmd, err + default: + var pcmpsd ProtectionContainerMappingProviderSpecificDetails + err := json.Unmarshal(body, &pcmpsd) + return pcmpsd, err + } +} +func unmarshalBasicProtectionContainerMappingProviderSpecificDetailsArray(body []byte) ([]BasicProtectionContainerMappingProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pcmpsdArray := make([]BasicProtectionContainerMappingProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pcmpsd, err := unmarshalBasicProtectionContainerMappingProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + pcmpsdArray[index] = pcmpsd + } + return pcmpsdArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) MarshalJSON() ([]byte, error) { + pcmpsd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails + objectMap := make(map[string]interface{}) + if pcmpsd.InstanceType != "" { + objectMap["instanceType"] = pcmpsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return &pcmpsd, true +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &pcmpsd, true +} + +// ProtectionContainerProperties protection profile custom data details. +type ProtectionContainerProperties struct { + // FabricFriendlyName - Fabric friendly name. + FabricFriendlyName *string `json:"fabricFriendlyName,omitempty"` + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // FabricType - The fabric type. + FabricType *string `json:"fabricType,omitempty"` + // ProtectedItemCount - Number of protected PEs. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // PairingStatus - The pairing status of this cloud. + PairingStatus *string `json:"pairingStatus,omitempty"` + // Role - The role of this cloud. + Role *string `json:"role,omitempty"` + // FabricSpecificDetails - Fabric specific details. + FabricSpecificDetails *ProtectionContainerFabricSpecificDetails `json:"fabricSpecificDetails,omitempty"` +} + +// BasicProtectionProfileCustomDetails protection Profile custom input. +type BasicProtectionProfileCustomDetails interface { + AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) + AsNewProtectionProfile() (*NewProtectionProfile, bool) + AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) +} + +// ProtectionProfileCustomDetails protection Profile custom input. +type ProtectionProfileCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +func unmarshalBasicProtectionProfileCustomDetails(body []byte) (BasicProtectionProfileCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeExisting): + var epp ExistingProtectionProfile + err := json.Unmarshal(body, &epp) + return epp, err + case string(ResourceTypeNew): + var npp NewProtectionProfile + err := json.Unmarshal(body, &npp) + return npp, err + default: + var ppcd ProtectionProfileCustomDetails + err := json.Unmarshal(body, &ppcd) + return ppcd, err + } +} +func unmarshalBasicProtectionProfileCustomDetailsArray(body []byte) ([]BasicProtectionProfileCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppcdArray := make([]BasicProtectionProfileCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppcd, err := unmarshalBasicProtectionProfileCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + ppcdArray[index] = ppcd + } + return ppcdArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) MarshalJSON() ([]byte, error) { + ppcd.ResourceType = ResourceTypeProtectionProfileCustomDetails + objectMap := make(map[string]interface{}) + if ppcd.ResourceType != "" { + objectMap["resourceType"] = ppcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return nil, false +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return nil, false +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return &ppcd, true +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &ppcd, true +} + +// ProviderError this class contains the error details per object. +type ProviderError struct { + // ErrorCode - The Error code. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorMessage - The Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // ErrorID - The Provider error Id. + ErrorID *string `json:"errorId,omitempty"` + // PossibleCauses - The possible causes for the error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - The recommended action to resolve the error. + RecommendedAction *string `json:"recommendedAction,omitempty"` +} + +// BasicProviderSpecificRecoveryPointDetails replication provider specific recovery point details. +type BasicProviderSpecificRecoveryPointDetails interface { + AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) + AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) + AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) + AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) +} + +// ProviderSpecificRecoveryPointDetails replication provider specific recovery point details. +type ProviderSpecificRecoveryPointDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicProviderSpecificRecoveryPointDetails(body []byte) (BasicProviderSpecificRecoveryPointDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A): + var arpd A2ARecoveryPointDetails + err := json.Unmarshal(body, &arpd) + return arpd, err + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2): + var imavrpd InMageAzureV2RecoveryPointDetails + err := json.Unmarshal(body, &imavrpd) + return imavrpd, err + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm): + var imrrpd InMageRcmRecoveryPointDetails + err := json.Unmarshal(body, &imrrpd) + return imrrpd, err + default: + var psrpd ProviderSpecificRecoveryPointDetails + err := json.Unmarshal(body, &psrpd) + return psrpd, err + } +} +func unmarshalBasicProviderSpecificRecoveryPointDetailsArray(body []byte) ([]BasicProviderSpecificRecoveryPointDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + psrpdArray := make([]BasicProviderSpecificRecoveryPointDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + psrpd, err := unmarshalBasicProviderSpecificRecoveryPointDetails(*rawMessage) + if err != nil { + return nil, err + } + psrpdArray[index] = psrpd + } + return psrpdArray, nil +} + +// MarshalJSON is the custom marshaler for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) MarshalJSON() ([]byte, error) { + psrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails + objectMap := make(map[string]interface{}) + if psrpd.InstanceType != "" { + objectMap["instanceType"] = psrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return &psrpd, true +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &psrpd, true +} + +// PushInstallerDetails push installer details. +type PushInstallerDetails struct { + // ID - READ-ONLY; The push installer Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The push installer name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The push installer Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The push installer Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the push installer. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the push installer. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for PushInstallerDetails. +func (pid PushInstallerDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RcmProxyDetails RCM proxy details. +type RcmProxyDetails struct { + // ID - READ-ONLY; The RCM proxy Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The RCM proxy name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The RCM proxy Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The RCM proxy Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // ClientAuthenticationType - READ-ONLY; The client authentication type. + ClientAuthenticationType *string `json:"clientAuthenticationType,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the RCM proxy. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the RCM proxy. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for RcmProxyDetails. +func (rpd RcmProxyDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// BasicRecoveryAvailabilitySetCustomDetails recovery Availability Set custom input. +type BasicRecoveryAvailabilitySetCustomDetails interface { + AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) + AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) +} + +// RecoveryAvailabilitySetCustomDetails recovery Availability Set custom input. +type RecoveryAvailabilitySetCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails', 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryAvailabilitySetCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryAvailabilitySetCustomDetails(body []byte) (BasicRecoveryAvailabilitySetCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting): + var eras ExistingRecoveryAvailabilitySet + err := json.Unmarshal(body, &eras) + return eras, err + default: + var rascd RecoveryAvailabilitySetCustomDetails + err := json.Unmarshal(body, &rascd) + return rascd, err + } +} +func unmarshalBasicRecoveryAvailabilitySetCustomDetailsArray(body []byte) ([]BasicRecoveryAvailabilitySetCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rascdArray := make([]BasicRecoveryAvailabilitySetCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rascd, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rascdArray[index] = rascd + } + return rascdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) MarshalJSON() ([]byte, error) { + rascd.ResourceType = ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails + objectMap := make(map[string]interface{}) + if rascd.ResourceType != "" { + objectMap["resourceType"] = rascd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryAvailabilitySet is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) { + return nil, false +} + +// AsRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) { + return &rascd, true +} + +// AsBasicRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsBasicRecoveryAvailabilitySetCustomDetails() (BasicRecoveryAvailabilitySetCustomDetails, bool) { + return &rascd, true +} + +// RecoveryPlan recovery plan details. +type RecoveryPlan struct { + autorest.Response `json:"-"` + // Properties - The custom details. + Properties *RecoveryPlanProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlan. +func (rp RecoveryPlan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.Properties != nil { + objectMap["properties"] = rp.Properties + } + if rp.Location != nil { + objectMap["location"] = rp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryPlanA2ADetails recovery plan A2A specific details. +type RecoveryPlanA2ADetails struct { + // PrimaryZone - The primary zone. + PrimaryZone *string `json:"primaryZone,omitempty"` + // RecoveryZone - The recovery zone. + RecoveryZone *string `json:"recoveryZone,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails', 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) MarshalJSON() ([]byte, error) { + rpad.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpad.PrimaryZone != nil { + objectMap["primaryZone"] = rpad.PrimaryZone + } + if rpad.RecoveryZone != nil { + objectMap["recoveryZone"] = rpad.RecoveryZone + } + if rpad.InstanceType != "" { + objectMap["instanceType"] = rpad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2ADetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) { + return &rpad, true +} + +// AsRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsBasicRecoveryPlanProviderSpecificDetails() (BasicRecoveryPlanProviderSpecificDetails, bool) { + return &rpad, true +} + +// RecoveryPlanA2AFailoverInput recovery plan A2A failover input. +type RecoveryPlanA2AFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'Latest', 'LatestApplicationConsistent', 'LatestCrashConsistent', 'LatestProcessed' + RecoveryPointType A2ARpRecoveryPointType `json:"recoveryPointType,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for TFO or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // MultiVMSyncPointOption - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. Possible values include: 'UseMultiVMSyncRecoveryPoint', 'UsePerVMRecoveryPoint' + MultiVMSyncPointOption MultiVMSyncPointOption `json:"multiVmSyncPointOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) MarshalJSON() ([]byte, error) { + rpafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpafi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpafi.RecoveryPointType + } + if rpafi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = rpafi.CloudServiceCreationOption + } + if rpafi.MultiVMSyncPointOption != "" { + objectMap["multiVmSyncPointOption"] = rpafi.MultiVMSyncPointOption + } + if rpafi.InstanceType != "" { + objectMap["instanceType"] = rpafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return &rpafi, true +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpafi, true +} + +// RecoveryPlanA2AInput recovery plan A2A input. +type RecoveryPlanA2AInput struct { + // PrimaryZone - The primary zone. + PrimaryZone *string `json:"primaryZone,omitempty"` + // RecoveryZone - The recovery zone. + RecoveryZone *string `json:"recoveryZone,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) MarshalJSON() ([]byte, error) { + rpai.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpai.PrimaryZone != nil { + objectMap["primaryZone"] = rpai.PrimaryZone + } + if rpai.RecoveryZone != nil { + objectMap["recoveryZone"] = rpai.RecoveryZone + } + if rpai.InstanceType != "" { + objectMap["instanceType"] = rpai.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) { + return &rpai, true +} + +// AsRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsBasicRecoveryPlanProviderSpecificInput() (BasicRecoveryPlanProviderSpecificInput, bool) { + return &rpai, true +} + +// RecoveryPlanAction recovery plan action details. +type RecoveryPlanAction struct { + // ActionName - The action name. + ActionName *string `json:"actionName,omitempty"` + // FailoverTypes - The list of failover types. + FailoverTypes *[]ReplicationProtectedItemOperation `json:"failoverTypes,omitempty"` + // FailoverDirections - The list of failover directions. + FailoverDirections *[]PossibleOperationsDirections `json:"failoverDirections,omitempty"` + // CustomDetails - The custom details. + CustomDetails BasicRecoveryPlanActionDetails `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanAction struct. +func (rpa *RecoveryPlanAction) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "actionName": + if v != nil { + var actionName string + err = json.Unmarshal(*v, &actionName) + if err != nil { + return err + } + rpa.ActionName = &actionName + } + case "failoverTypes": + if v != nil { + var failoverTypes []ReplicationProtectedItemOperation + err = json.Unmarshal(*v, &failoverTypes) + if err != nil { + return err + } + rpa.FailoverTypes = &failoverTypes + } + case "failoverDirections": + if v != nil { + var failoverDirections []PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirections) + if err != nil { + return err + } + rpa.FailoverDirections = &failoverDirections + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicRecoveryPlanActionDetails(*v) + if err != nil { + return err + } + rpa.CustomDetails = customDetails + } + } + } + + return nil +} + +// BasicRecoveryPlanActionDetails recovery plan action custom details. +type BasicRecoveryPlanActionDetails interface { + AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) + AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) + AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) + AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) +} + +// RecoveryPlanActionDetails recovery plan action custom details. +type RecoveryPlanActionDetails struct { + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanActionDetails(body []byte) (BasicRecoveryPlanActionDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAutomationRunbookActionDetails): + var rparad RecoveryPlanAutomationRunbookActionDetails + err := json.Unmarshal(body, &rparad) + return rparad, err + case string(InstanceTypeManualActionDetails): + var rpmad RecoveryPlanManualActionDetails + err := json.Unmarshal(body, &rpmad) + return rpmad, err + case string(InstanceTypeScriptActionDetails): + var rpsad RecoveryPlanScriptActionDetails + err := json.Unmarshal(body, &rpsad) + return rpsad, err + default: + var rpad RecoveryPlanActionDetails + err := json.Unmarshal(body, &rpad) + return rpad, err + } +} +func unmarshalBasicRecoveryPlanActionDetailsArray(body []byte) ([]BasicRecoveryPlanActionDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpadArray := make([]BasicRecoveryPlanActionDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpad, err := unmarshalBasicRecoveryPlanActionDetails(*rawMessage) + if err != nil { + return nil, err + } + rpadArray[index] = rpad + } + return rpadArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) MarshalJSON() ([]byte, error) { + rpad.InstanceType = InstanceTypeRecoveryPlanActionDetails + objectMap := make(map[string]interface{}) + if rpad.InstanceType != "" { + objectMap["instanceType"] = rpad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return &rpad, true +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpad, true +} + +// RecoveryPlanAutomationRunbookActionDetails recovery plan Automation runbook action details. +type RecoveryPlanAutomationRunbookActionDetails struct { + // RunbookID - The runbook ARM Id. + RunbookID *string `json:"runbookId,omitempty"` + // Timeout - The runbook timeout. + Timeout *string `json:"timeout,omitempty"` + // FabricLocation - The fabric location. Possible values include: 'Primary', 'Recovery' + FabricLocation RecoveryPlanActionLocation `json:"fabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) MarshalJSON() ([]byte, error) { + rparad.InstanceType = InstanceTypeAutomationRunbookActionDetails + objectMap := make(map[string]interface{}) + if rparad.RunbookID != nil { + objectMap["runbookId"] = rparad.RunbookID + } + if rparad.Timeout != nil { + objectMap["timeout"] = rparad.Timeout + } + if rparad.FabricLocation != "" { + objectMap["fabricLocation"] = rparad.FabricLocation + } + if rparad.InstanceType != "" { + objectMap["instanceType"] = rparad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return &rparad, true +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rparad, true +} + +// RecoveryPlanCollection recovery plan collection details. +type RecoveryPlanCollection struct { + autorest.Response `json:"-"` + // Value - The list of recovery plans. + Value *[]RecoveryPlan `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryPlanCollectionIterator provides access to a complete listing of RecoveryPlan values. +type RecoveryPlanCollectionIterator struct { + i int + page RecoveryPlanCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryPlanCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPlanCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryPlanCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryPlanCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryPlanCollectionIterator) Response() RecoveryPlanCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryPlanCollectionIterator) Value() RecoveryPlan { + if !iter.page.NotDone() { + return RecoveryPlan{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryPlanCollectionIterator type. +func NewRecoveryPlanCollectionIterator(page RecoveryPlanCollectionPage) RecoveryPlanCollectionIterator { + return RecoveryPlanCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (RPCVar RecoveryPlanCollection) IsEmpty() bool { + return RPCVar.Value == nil || len(*RPCVar.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (RPCVar RecoveryPlanCollection) hasNextLink() bool { + return RPCVar.NextLink != nil && len(*RPCVar.NextLink) != 0 +} + +// recoveryPlanCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (RPCVar RecoveryPlanCollection) recoveryPlanCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !RPCVar.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(RPCVar.NextLink))) +} + +// RecoveryPlanCollectionPage contains a page of RecoveryPlan values. +type RecoveryPlanCollectionPage struct { + fn func(context.Context, RecoveryPlanCollection) (RecoveryPlanCollection, error) + RPCVar RecoveryPlanCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryPlanCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPlanCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.RPCVar) + if err != nil { + return err + } + page.RPCVar = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryPlanCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryPlanCollectionPage) NotDone() bool { + return !page.RPCVar.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryPlanCollectionPage) Response() RecoveryPlanCollection { + return page.RPCVar +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryPlanCollectionPage) Values() []RecoveryPlan { + if page.RPCVar.IsEmpty() { + return nil + } + return *page.RPCVar.Value +} + +// Creates a new instance of the RecoveryPlanCollectionPage type. +func NewRecoveryPlanCollectionPage(cur RecoveryPlanCollection, getNextPage func(context.Context, RecoveryPlanCollection) (RecoveryPlanCollection, error)) RecoveryPlanCollectionPage { + return RecoveryPlanCollectionPage{ + fn: getNextPage, + RPCVar: cur, + } +} + +// RecoveryPlanGroup recovery plan group details. +type RecoveryPlanGroup struct { + // GroupType - The group type. Possible values include: 'Shutdown', 'Boot', 'Failover' + GroupType RecoveryPlanGroupType `json:"groupType,omitempty"` + // ReplicationProtectedItems - The list of protected items. + ReplicationProtectedItems *[]RecoveryPlanProtectedItem `json:"replicationProtectedItems,omitempty"` + // StartGroupActions - The start group actions. + StartGroupActions *[]RecoveryPlanAction `json:"startGroupActions,omitempty"` + // EndGroupActions - The end group actions. + EndGroupActions *[]RecoveryPlanAction `json:"endGroupActions,omitempty"` +} + +// BasicRecoveryPlanGroupTaskDetails this class represents the recovery plan group task. +type BasicRecoveryPlanGroupTaskDetails interface { + AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) + AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) +} + +// RecoveryPlanGroupTaskDetails this class represents the recovery plan group task. +type RecoveryPlanGroupTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // GroupID - The group identifier. + GroupID *string `json:"groupId,omitempty"` + // RpGroupType - The group type. + RpGroupType *string `json:"rpGroupType,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanGroupTaskDetails(body []byte) (BasicRecoveryPlanGroupTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeRecoveryPlanShutdownGroupTaskDetails): + var rpsgtd RecoveryPlanShutdownGroupTaskDetails + err := json.Unmarshal(body, &rpsgtd) + return rpsgtd, err + default: + var rpgtd RecoveryPlanGroupTaskDetails + err := json.Unmarshal(body, &rpgtd) + return rpgtd, err + } +} +func unmarshalBasicRecoveryPlanGroupTaskDetailsArray(body []byte) ([]BasicRecoveryPlanGroupTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpgtdArray := make([]BasicRecoveryPlanGroupTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpgtd, err := unmarshalBasicRecoveryPlanGroupTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + rpgtdArray[index] = rpgtd + } + return rpgtdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) MarshalJSON() ([]byte, error) { + rpgtd.InstanceType = InstanceTypeRecoveryPlanGroupTaskDetails + objectMap := make(map[string]interface{}) + if rpgtd.Name != nil { + objectMap["name"] = rpgtd.Name + } + if rpgtd.GroupID != nil { + objectMap["groupId"] = rpgtd.GroupID + } + if rpgtd.RpGroupType != nil { + objectMap["rpGroupType"] = rpgtd.RpGroupType + } + if rpgtd.ChildTasks != nil { + objectMap["childTasks"] = rpgtd.ChildTasks + } + if rpgtd.InstanceType != "" { + objectMap["instanceType"] = rpgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return &rpgtd, true +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return &rpgtd, true +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &rpgtd, true +} + +// RecoveryPlanHyperVReplicaAzureFailbackInput recovery plan HVR Azure failback input. +type RecoveryPlanHyperVReplicaAzureFailbackInput struct { + // DataSyncOption - The data sync option. Possible values include: 'ForDownTime', 'ForSynchronization' + DataSyncOption DataSyncStatus `json:"dataSyncOption,omitempty"` + // RecoveryVMCreationOption - The ALR option. Possible values include: 'CreateVMIfNotFound', 'NoAction' + RecoveryVMCreationOption AlternateLocationRecoveryOption `json:"recoveryVmCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) MarshalJSON() ([]byte, error) { + rphvrafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback + objectMap := make(map[string]interface{}) + if rphvrafi.DataSyncOption != "" { + objectMap["dataSyncOption"] = rphvrafi.DataSyncOption + } + if rphvrafi.RecoveryVMCreationOption != "" { + objectMap["recoveryVmCreationOption"] = rphvrafi.RecoveryVMCreationOption + } + if rphvrafi.InstanceType != "" { + objectMap["instanceType"] = rphvrafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return &rphvrafi, true +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rphvrafi, true +} + +// RecoveryPlanHyperVReplicaAzureFailoverInput recovery plan HVR Azure failover input. +type RecoveryPlanHyperVReplicaAzureFailoverInput struct { + // PrimaryKekCertificatePfx - The primary KEK certificate PFX. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - The secondary KEK certificate PFX. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointType - The recovery point type. Possible values include: 'HyperVReplicaAzureRpRecoveryPointTypeLatest', 'HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent', 'HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed' + RecoveryPointType HyperVReplicaAzureRpRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) MarshalJSON() ([]byte, error) { + rphvrafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if rphvrafi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = rphvrafi.PrimaryKekCertificatePfx + } + if rphvrafi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = rphvrafi.SecondaryKekCertificatePfx + } + if rphvrafi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rphvrafi.RecoveryPointType + } + if rphvrafi.InstanceType != "" { + objectMap["instanceType"] = rphvrafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return &rphvrafi, true +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rphvrafi, true +} + +// RecoveryPlanInMageAzureV2FailoverInput recovery plan InMageAzureV2 failover input. +type RecoveryPlanInMageAzureV2FailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'InMageV2RpRecoveryPointTypeLatest', 'InMageV2RpRecoveryPointTypeLatestApplicationConsistent', 'InMageV2RpRecoveryPointTypeLatestCrashConsistent', 'InMageV2RpRecoveryPointTypeLatestProcessed' + RecoveryPointType InMageV2RpRecoveryPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) MarshalJSON() ([]byte, error) { + rpimavfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if rpimavfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimavfi.RecoveryPointType + } + if rpimavfi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimavfi.UseMultiVMSyncPoint + } + if rpimavfi.InstanceType != "" { + objectMap["instanceType"] = rpimavfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return &rpimavfi, true +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimavfi, true +} + +// RecoveryPlanInMageFailoverInput recovery plan InMage failover input. +type RecoveryPlanInMageFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'RpInMageRecoveryPointTypeLatestTime', 'RpInMageRecoveryPointTypeLatestTag', 'RpInMageRecoveryPointTypeCustom' + RecoveryPointType RpInMageRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) MarshalJSON() ([]byte, error) { + rpimfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if rpimfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimfi.RecoveryPointType + } + if rpimfi.InstanceType != "" { + objectMap["instanceType"] = rpimfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return &rpimfi, true +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimfi, true +} + +// RecoveryPlanInMageRcmFailbackFailoverInput recovery plan InMageRcmFailback failover input. +type RecoveryPlanInMageRcmFailbackFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'ApplicationConsistent', 'CrashConsistent' + RecoveryPointType InMageRcmFailbackRecoveryPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) MarshalJSON() ([]byte, error) { + rpimrffi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if rpimrffi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimrffi.RecoveryPointType + } + if rpimrffi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimrffi.UseMultiVMSyncPoint + } + if rpimrffi.InstanceType != "" { + objectMap["instanceType"] = rpimrffi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return &rpimrffi, true +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimrffi, true +} + +// RecoveryPlanInMageRcmFailoverInput recovery plan InMageRcm failover input. +type RecoveryPlanInMageRcmFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'RecoveryPlanPointTypeLatest', 'RecoveryPlanPointTypeLatestApplicationConsistent', 'RecoveryPlanPointTypeLatestCrashConsistent', 'RecoveryPlanPointTypeLatestProcessed' + RecoveryPointType RecoveryPlanPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) MarshalJSON() ([]byte, error) { + rpimrfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if rpimrfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimrfi.RecoveryPointType + } + if rpimrfi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimrfi.UseMultiVMSyncPoint + } + if rpimrfi.InstanceType != "" { + objectMap["instanceType"] = rpimrfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return &rpimrfi, true +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimrfi, true +} + +// RecoveryPlanManualActionDetails recovery plan manual action details. +type RecoveryPlanManualActionDetails struct { + // Description - The manual action description. + Description *string `json:"description,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) MarshalJSON() ([]byte, error) { + rpmad.InstanceType = InstanceTypeManualActionDetails + objectMap := make(map[string]interface{}) + if rpmad.Description != nil { + objectMap["description"] = rpmad.Description + } + if rpmad.InstanceType != "" { + objectMap["instanceType"] = rpmad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return &rpmad, true +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpmad, true +} + +// RecoveryPlanPlannedFailoverInput recovery plan planned failover input. +type RecoveryPlanPlannedFailoverInput struct { + // Properties - The recovery plan planned failover input properties. + Properties *RecoveryPlanPlannedFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanPlannedFailoverInputProperties recovery plan planned failover input properties. +type RecoveryPlanPlannedFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanPlannedFailoverInputProperties struct. +func (rppfip *RecoveryPlanPlannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rppfip.FailoverDirection = failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rppfip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanProperties recovery plan properties. +type RecoveryPlanProperties struct { + // FriendlyName - The friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // PrimaryFabricID - The primary fabric Id. + PrimaryFabricID *string `json:"primaryFabricId,omitempty"` + // PrimaryFabricFriendlyName - The primary fabric friendly name. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // RecoveryFabricID - The recovery fabric Id. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // RecoveryFabricFriendlyName - The recovery fabric friendly name. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // FailoverDeploymentModel - The failover deployment model. + FailoverDeploymentModel *string `json:"failoverDeploymentModel,omitempty"` + // ReplicationProviders - The list of replication providers. + ReplicationProviders *[]string `json:"replicationProviders,omitempty"` + // AllowedOperations - The list of allowed operations. + AllowedOperations *[]string `json:"allowedOperations,omitempty"` + // LastPlannedFailoverTime - The start time of the last planned failover. + LastPlannedFailoverTime *date.Time `json:"lastPlannedFailoverTime,omitempty"` + // LastUnplannedFailoverTime - The start time of the last unplanned failover. + LastUnplannedFailoverTime *date.Time `json:"lastUnplannedFailoverTime,omitempty"` + // LastTestFailoverTime - The start time of the last test failover. + LastTestFailoverTime *date.Time `json:"lastTestFailoverTime,omitempty"` + // CurrentScenario - The current scenario details. + CurrentScenario *CurrentScenarioDetails `json:"currentScenario,omitempty"` + // CurrentScenarioStatus - The recovery plan status. + CurrentScenarioStatus *string `json:"currentScenarioStatus,omitempty"` + // CurrentScenarioStatusDescription - The recovery plan status description. + CurrentScenarioStatusDescription *string `json:"currentScenarioStatusDescription,omitempty"` + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` + // ProviderSpecificDetails - The provider id and provider specific details. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanProperties struct. +func (rpp *RecoveryPlanProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpp.FriendlyName = &friendlyName + } + case "primaryFabricId": + if v != nil { + var primaryFabricID string + err = json.Unmarshal(*v, &primaryFabricID) + if err != nil { + return err + } + rpp.PrimaryFabricID = &primaryFabricID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + rpp.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + rpp.RecoveryFabricID = &recoveryFabricID + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + rpp.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "failoverDeploymentModel": + if v != nil { + var failoverDeploymentModel string + err = json.Unmarshal(*v, &failoverDeploymentModel) + if err != nil { + return err + } + rpp.FailoverDeploymentModel = &failoverDeploymentModel + } + case "replicationProviders": + if v != nil { + var replicationProviders []string + err = json.Unmarshal(*v, &replicationProviders) + if err != nil { + return err + } + rpp.ReplicationProviders = &replicationProviders + } + case "allowedOperations": + if v != nil { + var allowedOperations []string + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + rpp.AllowedOperations = &allowedOperations + } + case "lastPlannedFailoverTime": + if v != nil { + var lastPlannedFailoverTime date.Time + err = json.Unmarshal(*v, &lastPlannedFailoverTime) + if err != nil { + return err + } + rpp.LastPlannedFailoverTime = &lastPlannedFailoverTime + } + case "lastUnplannedFailoverTime": + if v != nil { + var lastUnplannedFailoverTime date.Time + err = json.Unmarshal(*v, &lastUnplannedFailoverTime) + if err != nil { + return err + } + rpp.LastUnplannedFailoverTime = &lastUnplannedFailoverTime + } + case "lastTestFailoverTime": + if v != nil { + var lastTestFailoverTime date.Time + err = json.Unmarshal(*v, &lastTestFailoverTime) + if err != nil { + return err + } + rpp.LastTestFailoverTime = &lastTestFailoverTime + } + case "currentScenario": + if v != nil { + var currentScenario CurrentScenarioDetails + err = json.Unmarshal(*v, ¤tScenario) + if err != nil { + return err + } + rpp.CurrentScenario = ¤tScenario + } + case "currentScenarioStatus": + if v != nil { + var currentScenarioStatus string + err = json.Unmarshal(*v, ¤tScenarioStatus) + if err != nil { + return err + } + rpp.CurrentScenarioStatus = ¤tScenarioStatus + } + case "currentScenarioStatusDescription": + if v != nil { + var currentScenarioStatusDescription string + err = json.Unmarshal(*v, ¤tScenarioStatusDescription) + if err != nil { + return err + } + rpp.CurrentScenarioStatusDescription = ¤tScenarioStatusDescription + } + case "groups": + if v != nil { + var groups []RecoveryPlanGroup + err = json.Unmarshal(*v, &groups) + if err != nil { + return err + } + rpp.Groups = &groups + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificDetailsArray(*v) + if err != nil { + return err + } + rpp.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanProtectedItem recovery plan protected item. +type RecoveryPlanProtectedItem struct { + // ID - The ARM Id of the recovery plan protected item. + ID *string `json:"id,omitempty"` + // VirtualMachineID - The virtual machine Id. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` +} + +// BasicRecoveryPlanProviderSpecificDetails recovery plan provider specific details. +type BasicRecoveryPlanProviderSpecificDetails interface { + AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) + AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) +} + +// RecoveryPlanProviderSpecificDetails recovery plan provider specific details. +type RecoveryPlanProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails', 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificDetails(body []byte) (BasicRecoveryPlanProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A): + var rpad RecoveryPlanA2ADetails + err := json.Unmarshal(body, &rpad) + return rpad, err + default: + var rppsd RecoveryPlanProviderSpecificDetails + err := json.Unmarshal(body, &rppsd) + return rppsd, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificDetailsArray(body []byte) ([]BasicRecoveryPlanProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsdArray := make([]BasicRecoveryPlanProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsd, err := unmarshalBasicRecoveryPlanProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + rppsdArray[index] = rppsd + } + return rppsdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) MarshalJSON() ([]byte, error) { + rppsd.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails + objectMap := make(map[string]interface{}) + if rppsd.InstanceType != "" { + objectMap["instanceType"] = rppsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2ADetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) { + return &rppsd, true +} + +// AsBasicRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsBasicRecoveryPlanProviderSpecificDetails() (BasicRecoveryPlanProviderSpecificDetails, bool) { + return &rppsd, true +} + +// BasicRecoveryPlanProviderSpecificFailoverInput recovery plan provider specific failover input. +type BasicRecoveryPlanProviderSpecificFailoverInput interface { + AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) + AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) + AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) + AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) + AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) + AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) + AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) + AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) +} + +// RecoveryPlanProviderSpecificFailoverInput recovery plan provider specific failover input. +type RecoveryPlanProviderSpecificFailoverInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificFailoverInput(body []byte) (BasicRecoveryPlanProviderSpecificFailoverInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A): + var rpafi RecoveryPlanA2AFailoverInput + err := json.Unmarshal(body, &rpafi) + return rpafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback): + var rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput + err := json.Unmarshal(body, &rphvrafi) + return rphvrafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure): + var rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput + err := json.Unmarshal(body, &rphvrafi) + return rphvrafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2): + var rpimavfi RecoveryPlanInMageAzureV2FailoverInput + err := json.Unmarshal(body, &rpimavfi) + return rpimavfi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage): + var rpimfi RecoveryPlanInMageFailoverInput + err := json.Unmarshal(body, &rpimfi) + return rpimfi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback): + var rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput + err := json.Unmarshal(body, &rpimrffi) + return rpimrffi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm): + var rpimrfi RecoveryPlanInMageRcmFailoverInput + err := json.Unmarshal(body, &rpimrfi) + return rpimrfi, err + default: + var rppsfi RecoveryPlanProviderSpecificFailoverInput + err := json.Unmarshal(body, &rppsfi) + return rppsfi, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(body []byte) ([]BasicRecoveryPlanProviderSpecificFailoverInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsfiArray := make([]BasicRecoveryPlanProviderSpecificFailoverInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsfi, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInput(*rawMessage) + if err != nil { + return nil, err + } + rppsfiArray[index] = rppsfi + } + return rppsfiArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) MarshalJSON() ([]byte, error) { + rppsfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput + objectMap := make(map[string]interface{}) + if rppsfi.InstanceType != "" { + objectMap["instanceType"] = rppsfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return &rppsfi, true +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rppsfi, true +} + +// BasicRecoveryPlanProviderSpecificInput recovery plan provider specific input base class. +type BasicRecoveryPlanProviderSpecificInput interface { + AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) + AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) +} + +// RecoveryPlanProviderSpecificInput recovery plan provider specific input base class. +type RecoveryPlanProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificInput(body []byte) (BasicRecoveryPlanProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A): + var rpai RecoveryPlanA2AInput + err := json.Unmarshal(body, &rpai) + return rpai, err + default: + var rppsi RecoveryPlanProviderSpecificInput + err := json.Unmarshal(body, &rppsi) + return rppsi, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificInputArray(body []byte) ([]BasicRecoveryPlanProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsiArray := make([]BasicRecoveryPlanProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsi, err := unmarshalBasicRecoveryPlanProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rppsiArray[index] = rppsi + } + return rppsiArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) MarshalJSON() ([]byte, error) { + rppsi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput + objectMap := make(map[string]interface{}) + if rppsi.InstanceType != "" { + objectMap["instanceType"] = rppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) { + return &rppsi, true +} + +// AsBasicRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsBasicRecoveryPlanProviderSpecificInput() (BasicRecoveryPlanProviderSpecificInput, bool) { + return &rppsi, true +} + +// RecoveryPlanScriptActionDetails recovery plan script action details. +type RecoveryPlanScriptActionDetails struct { + // Path - The script path. + Path *string `json:"path,omitempty"` + // Timeout - The script timeout. + Timeout *string `json:"timeout,omitempty"` + // FabricLocation - The fabric location. Possible values include: 'Primary', 'Recovery' + FabricLocation RecoveryPlanActionLocation `json:"fabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) MarshalJSON() ([]byte, error) { + rpsad.InstanceType = InstanceTypeScriptActionDetails + objectMap := make(map[string]interface{}) + if rpsad.Path != nil { + objectMap["path"] = rpsad.Path + } + if rpsad.Timeout != nil { + objectMap["timeout"] = rpsad.Timeout + } + if rpsad.FabricLocation != "" { + objectMap["fabricLocation"] = rpsad.FabricLocation + } + if rpsad.InstanceType != "" { + objectMap["instanceType"] = rpsad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return &rpsad, true +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpsad, true +} + +// RecoveryPlanShutdownGroupTaskDetails this class represents the recovery plan shutdown group task +// details. +type RecoveryPlanShutdownGroupTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // GroupID - The group identifier. + GroupID *string `json:"groupId,omitempty"` + // RpGroupType - The group type. + RpGroupType *string `json:"rpGroupType,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) MarshalJSON() ([]byte, error) { + rpsgtd.InstanceType = InstanceTypeRecoveryPlanShutdownGroupTaskDetails + objectMap := make(map[string]interface{}) + if rpsgtd.Name != nil { + objectMap["name"] = rpsgtd.Name + } + if rpsgtd.GroupID != nil { + objectMap["groupId"] = rpsgtd.GroupID + } + if rpsgtd.RpGroupType != nil { + objectMap["rpGroupType"] = rpsgtd.RpGroupType + } + if rpsgtd.ChildTasks != nil { + objectMap["childTasks"] = rpsgtd.ChildTasks + } + if rpsgtd.InstanceType != "" { + objectMap["instanceType"] = rpsgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// RecoveryPlanTestFailoverCleanupInput recovery plan test failover cleanup input. +type RecoveryPlanTestFailoverCleanupInput struct { + // Properties - The recovery plan test failover cleanup input properties. + Properties *RecoveryPlanTestFailoverCleanupInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanTestFailoverCleanupInputProperties recovery plan test failover cleanup input properties. +type RecoveryPlanTestFailoverCleanupInputProperties struct { + // Comments - The test failover cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// RecoveryPlanTestFailoverInput recovery plan test failover input. +type RecoveryPlanTestFailoverInput struct { + // Properties - The recovery plan test failover input properties. + Properties *RecoveryPlanTestFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanTestFailoverInputProperties recovery plan test failover input properties. +type RecoveryPlanTestFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // NetworkType - The network type to be used for test failover. + NetworkType *string `json:"networkType,omitempty"` + // NetworkID - The Id of the network to be used for test failover. + NetworkID *string `json:"networkId,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanTestFailoverInputProperties struct. +func (rptfip *RecoveryPlanTestFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rptfip.FailoverDirection = failoverDirection + } + case "networkType": + if v != nil { + var networkType string + err = json.Unmarshal(*v, &networkType) + if err != nil { + return err + } + rptfip.NetworkType = &networkType + } + case "networkId": + if v != nil { + var networkID string + err = json.Unmarshal(*v, &networkID) + if err != nil { + return err + } + rptfip.NetworkID = &networkID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rptfip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanUnplannedFailoverInput recovery plan unplanned failover input. +type RecoveryPlanUnplannedFailoverInput struct { + // Properties - The recovery plan unplanned failover input properties. + Properties *RecoveryPlanUnplannedFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanUnplannedFailoverInputProperties recovery plan unplanned failover input properties. +type RecoveryPlanUnplannedFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // SourceSiteOperations - A value indicating whether source site operations are required. Possible values include: 'Required', 'NotRequired' + SourceSiteOperations SourceSiteOperations `json:"sourceSiteOperations,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanUnplannedFailoverInputProperties struct. +func (rpufip *RecoveryPlanUnplannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rpufip.FailoverDirection = failoverDirection + } + case "sourceSiteOperations": + if v != nil { + var sourceSiteOperations SourceSiteOperations + err = json.Unmarshal(*v, &sourceSiteOperations) + if err != nil { + return err + } + rpufip.SourceSiteOperations = sourceSiteOperations + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rpufip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPoint recovery point. +type RecoveryPoint struct { + autorest.Response `json:"-"` + // Properties - The recovery point properties. + Properties *RecoveryPointProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPoint. +func (rp RecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.Properties != nil { + objectMap["properties"] = rp.Properties + } + if rp.Location != nil { + objectMap["location"] = rp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryPointCollection collection of recovery point details. +type RecoveryPointCollection struct { + autorest.Response `json:"-"` + // Value - The recovery point details. + Value *[]RecoveryPoint `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryPointCollectionIterator provides access to a complete listing of RecoveryPoint values. +type RecoveryPointCollectionIterator struct { + i int + page RecoveryPointCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryPointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryPointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryPointCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryPointCollectionIterator) Response() RecoveryPointCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryPointCollectionIterator) Value() RecoveryPoint { + if !iter.page.NotDone() { + return RecoveryPoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryPointCollectionIterator type. +func NewRecoveryPointCollectionIterator(page RecoveryPointCollectionPage) RecoveryPointCollectionIterator { + return RecoveryPointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (RPCVar RecoveryPointCollection) IsEmpty() bool { + return RPCVar.Value == nil || len(*RPCVar.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (RPCVar RecoveryPointCollection) hasNextLink() bool { + return RPCVar.NextLink != nil && len(*RPCVar.NextLink) != 0 +} + +// recoveryPointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (RPCVar RecoveryPointCollection) recoveryPointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !RPCVar.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(RPCVar.NextLink))) +} + +// RecoveryPointCollectionPage contains a page of RecoveryPoint values. +type RecoveryPointCollectionPage struct { + fn func(context.Context, RecoveryPointCollection) (RecoveryPointCollection, error) + RPCVar RecoveryPointCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryPointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.RPCVar) + if err != nil { + return err + } + page.RPCVar = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryPointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryPointCollectionPage) NotDone() bool { + return !page.RPCVar.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryPointCollectionPage) Response() RecoveryPointCollection { + return page.RPCVar +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryPointCollectionPage) Values() []RecoveryPoint { + if page.RPCVar.IsEmpty() { + return nil + } + return *page.RPCVar.Value +} + +// Creates a new instance of the RecoveryPointCollectionPage type. +func NewRecoveryPointCollectionPage(cur RecoveryPointCollection, getNextPage func(context.Context, RecoveryPointCollection) (RecoveryPointCollection, error)) RecoveryPointCollectionPage { + return RecoveryPointCollectionPage{ + fn: getNextPage, + RPCVar: cur, + } +} + +// RecoveryPointProperties recovery point properties. +type RecoveryPointProperties struct { + // RecoveryPointTime - The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointType - The recovery point type: ApplicationConsistent, CrashConsistent. + RecoveryPointType *string `json:"recoveryPointType,omitempty"` + // ProviderSpecificDetails - The provider specific details for the recovery point. + ProviderSpecificDetails BasicProviderSpecificRecoveryPointDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPointProperties struct. +func (rpp *RecoveryPointProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryPointTime": + if v != nil { + var recoveryPointTime date.Time + err = json.Unmarshal(*v, &recoveryPointTime) + if err != nil { + return err + } + rpp.RecoveryPointTime = &recoveryPointTime + } + case "recoveryPointType": + if v != nil { + var recoveryPointType string + err = json.Unmarshal(*v, &recoveryPointType) + if err != nil { + return err + } + rpp.RecoveryPointType = &recoveryPointType + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicProviderSpecificRecoveryPointDetails(*v) + if err != nil { + return err + } + rpp.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicRecoveryProximityPlacementGroupCustomDetails recovery Proximity placement group custom input. +type BasicRecoveryProximityPlacementGroupCustomDetails interface { + AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) + AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) +} + +// RecoveryProximityPlacementGroupCustomDetails recovery Proximity placement group custom input. +type RecoveryProximityPlacementGroupCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails', 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(body []byte) (BasicRecoveryProximityPlacementGroupCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting): + var erppg ExistingRecoveryProximityPlacementGroup + err := json.Unmarshal(body, &erppg) + return erppg, err + default: + var rppgcd RecoveryProximityPlacementGroupCustomDetails + err := json.Unmarshal(body, &rppgcd) + return rppgcd, err + } +} +func unmarshalBasicRecoveryProximityPlacementGroupCustomDetailsArray(body []byte) ([]BasicRecoveryProximityPlacementGroupCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppgcdArray := make([]BasicRecoveryProximityPlacementGroupCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppgcd, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rppgcdArray[index] = rppgcd + } + return rppgcdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) MarshalJSON() ([]byte, error) { + rppgcd.ResourceType = ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails + objectMap := make(map[string]interface{}) + if rppgcd.ResourceType != "" { + objectMap["resourceType"] = rppgcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryProximityPlacementGroup is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) { + return nil, false +} + +// AsRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) { + return &rppgcd, true +} + +// AsBasicRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsBasicRecoveryProximityPlacementGroupCustomDetails() (BasicRecoveryProximityPlacementGroupCustomDetails, bool) { + return &rppgcd, true +} + +// BasicRecoveryResourceGroupCustomDetails recovery Resource Group custom input. +type BasicRecoveryResourceGroupCustomDetails interface { + AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) + AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) +} + +// RecoveryResourceGroupCustomDetails recovery Resource Group custom input. +type RecoveryResourceGroupCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails', 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryResourceGroupCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryResourceGroupCustomDetails(body []byte) (BasicRecoveryResourceGroupCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting): + var errrg ExistingRecoveryRecoveryResourceGroup + err := json.Unmarshal(body, &errrg) + return errrg, err + default: + var rrgcd RecoveryResourceGroupCustomDetails + err := json.Unmarshal(body, &rrgcd) + return rrgcd, err + } +} +func unmarshalBasicRecoveryResourceGroupCustomDetailsArray(body []byte) ([]BasicRecoveryResourceGroupCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rrgcdArray := make([]BasicRecoveryResourceGroupCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rrgcd, err := unmarshalBasicRecoveryResourceGroupCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rrgcdArray[index] = rrgcd + } + return rrgcdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) MarshalJSON() ([]byte, error) { + rrgcd.ResourceType = ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails + objectMap := make(map[string]interface{}) + if rrgcd.ResourceType != "" { + objectMap["resourceType"] = rrgcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryRecoveryResourceGroup is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) { + return nil, false +} + +// AsRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) { + return &rrgcd, true +} + +// AsBasicRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsBasicRecoveryResourceGroupCustomDetails() (BasicRecoveryResourceGroupCustomDetails, bool) { + return &rrgcd, true +} + +// RecoveryServicesProvider provider details. +type RecoveryServicesProvider struct { + autorest.Response `json:"-"` + // Properties - Provider properties. + Properties *RecoveryServicesProviderProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryServicesProvider. +func (rsp RecoveryServicesProvider) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rsp.Properties != nil { + objectMap["properties"] = rsp.Properties + } + if rsp.Location != nil { + objectMap["location"] = rsp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryServicesProviderCollection collection of providers. +type RecoveryServicesProviderCollection struct { + autorest.Response `json:"-"` + // Value - The Servers details. + Value *[]RecoveryServicesProvider `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryServicesProviderCollectionIterator provides access to a complete listing of +// RecoveryServicesProvider values. +type RecoveryServicesProviderCollectionIterator struct { + i int + page RecoveryServicesProviderCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryServicesProviderCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryServicesProviderCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryServicesProviderCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryServicesProviderCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryServicesProviderCollectionIterator) Response() RecoveryServicesProviderCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryServicesProviderCollectionIterator) Value() RecoveryServicesProvider { + if !iter.page.NotDone() { + return RecoveryServicesProvider{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryServicesProviderCollectionIterator type. +func NewRecoveryServicesProviderCollectionIterator(page RecoveryServicesProviderCollectionPage) RecoveryServicesProviderCollectionIterator { + return RecoveryServicesProviderCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rspc RecoveryServicesProviderCollection) IsEmpty() bool { + return rspc.Value == nil || len(*rspc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rspc RecoveryServicesProviderCollection) hasNextLink() bool { + return rspc.NextLink != nil && len(*rspc.NextLink) != 0 +} + +// recoveryServicesProviderCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rspc RecoveryServicesProviderCollection) recoveryServicesProviderCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rspc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rspc.NextLink))) +} + +// RecoveryServicesProviderCollectionPage contains a page of RecoveryServicesProvider values. +type RecoveryServicesProviderCollectionPage struct { + fn func(context.Context, RecoveryServicesProviderCollection) (RecoveryServicesProviderCollection, error) + rspc RecoveryServicesProviderCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryServicesProviderCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryServicesProviderCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rspc) + if err != nil { + return err + } + page.rspc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryServicesProviderCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryServicesProviderCollectionPage) NotDone() bool { + return !page.rspc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryServicesProviderCollectionPage) Response() RecoveryServicesProviderCollection { + return page.rspc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryServicesProviderCollectionPage) Values() []RecoveryServicesProvider { + if page.rspc.IsEmpty() { + return nil + } + return *page.rspc.Value +} + +// Creates a new instance of the RecoveryServicesProviderCollectionPage type. +func NewRecoveryServicesProviderCollectionPage(cur RecoveryServicesProviderCollection, getNextPage func(context.Context, RecoveryServicesProviderCollection) (RecoveryServicesProviderCollection, error)) RecoveryServicesProviderCollectionPage { + return RecoveryServicesProviderCollectionPage{ + fn: getNextPage, + rspc: cur, + } +} + +// RecoveryServicesProviderProperties recovery services provider properties. +type RecoveryServicesProviderProperties struct { + // FabricType - Type of the site. + FabricType *string `json:"fabricType,omitempty"` + // FriendlyName - Friendly name of the DRA. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProviderVersion - The provider version. + ProviderVersion *string `json:"providerVersion,omitempty"` + // ServerVersion - The fabric provider. + ServerVersion *string `json:"serverVersion,omitempty"` + // ProviderVersionState - DRA version status. + ProviderVersionState *string `json:"providerVersionState,omitempty"` + // ProviderVersionExpiryDate - Expiry date of the version. + ProviderVersionExpiryDate *date.Time `json:"providerVersionExpiryDate,omitempty"` + // FabricFriendlyName - The fabric friendly name. + FabricFriendlyName *string `json:"fabricFriendlyName,omitempty"` + // LastHeartBeat - Time when last heartbeat was sent by the DRA. + LastHeartBeat *date.Time `json:"lastHeartBeat,omitempty"` + // ConnectionStatus - A value indicating whether DRA is responsive. + ConnectionStatus *string `json:"connectionStatus,omitempty"` + // ProtectedItemCount - Number of protected VMs currently managed by the DRA. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // AllowedScenarios - The scenarios allowed on this provider. + AllowedScenarios *[]string `json:"allowedScenarios,omitempty"` + // HealthErrorDetails - The recovery services provider health error details. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // DraIdentifier - The DRA Id. + DraIdentifier *string `json:"draIdentifier,omitempty"` + // MachineID - The machine Id. + MachineID *string `json:"machineId,omitempty"` + // MachineName - The machine name. + MachineName *string `json:"machineName,omitempty"` + // BiosID - The Bios Id. + BiosID *string `json:"biosId,omitempty"` + // AuthenticationIdentityDetails - The authentication identity details. + AuthenticationIdentityDetails *IdentityProviderDetails `json:"authenticationIdentityDetails,omitempty"` + // ResourceAccessIdentityDetails - The resource access identity details. + ResourceAccessIdentityDetails *IdentityProviderDetails `json:"resourceAccessIdentityDetails,omitempty"` + // DataPlaneAuthenticationIdentityDetails - The data plane authentication identity details. + DataPlaneAuthenticationIdentityDetails *IdentityProviderDetails `json:"dataPlaneAuthenticationIdentityDetails,omitempty"` + // ProviderVersionDetails - The provider version details. + ProviderVersionDetails *VersionDetails `json:"providerVersionDetails,omitempty"` +} + +// BasicRecoveryVirtualNetworkCustomDetails recovery Virtual network custom input. +type BasicRecoveryVirtualNetworkCustomDetails interface { + AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) + AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) + AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) +} + +// RecoveryVirtualNetworkCustomDetails recovery Virtual network custom input. +type RecoveryVirtualNetworkCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryVirtualNetworkCustomDetails(body []byte) (BasicRecoveryVirtualNetworkCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting): + var ervn ExistingRecoveryVirtualNetwork + err := json.Unmarshal(body, &ervn) + return ervn, err + case string(ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew): + var nrvn NewRecoveryVirtualNetwork + err := json.Unmarshal(body, &nrvn) + return nrvn, err + default: + var rvncd RecoveryVirtualNetworkCustomDetails + err := json.Unmarshal(body, &rvncd) + return rvncd, err + } +} +func unmarshalBasicRecoveryVirtualNetworkCustomDetailsArray(body []byte) ([]BasicRecoveryVirtualNetworkCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rvncdArray := make([]BasicRecoveryVirtualNetworkCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rvncd, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rvncdArray[index] = rvncd + } + return rvncdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) MarshalJSON() ([]byte, error) { + rvncd.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails + objectMap := make(map[string]interface{}) + if rvncd.ResourceType != "" { + objectMap["resourceType"] = rvncd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return &rvncd, true +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &rvncd, true +} + +// RemoveDisksInput input for remove disk(s) operation. +type RemoveDisksInput struct { + // Properties - Remove disk input properties. + Properties *RemoveDisksInputProperties `json:"properties,omitempty"` +} + +// RemoveDisksInputProperties remove Disk input properties. +type RemoveDisksInputProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicRemoveDisksProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RemoveDisksInputProperties struct. +func (rdip *RemoveDisksInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRemoveDisksProviderSpecificInput(*v) + if err != nil { + return err + } + rdip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicRemoveDisksProviderSpecificInput remove Disk provider specific input. +type BasicRemoveDisksProviderSpecificInput interface { + AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) + AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) +} + +// RemoveDisksProviderSpecificInput remove Disk provider specific input. +type RemoveDisksProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput', 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRemoveDisksProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRemoveDisksProviderSpecificInput(body []byte) (BasicRemoveDisksProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A): + var ardi A2ARemoveDisksInput + err := json.Unmarshal(body, &ardi) + return ardi, err + default: + var rdpsi RemoveDisksProviderSpecificInput + err := json.Unmarshal(body, &rdpsi) + return rdpsi, err + } +} +func unmarshalBasicRemoveDisksProviderSpecificInputArray(body []byte) ([]BasicRemoveDisksProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rdpsiArray := make([]BasicRemoveDisksProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rdpsi, err := unmarshalBasicRemoveDisksProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rdpsiArray[index] = rdpsi + } + return rdpsiArray, nil +} + +// MarshalJSON is the custom marshaler for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) MarshalJSON() ([]byte, error) { + rdpsi.InstanceType = InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput + objectMap := make(map[string]interface{}) + if rdpsi.InstanceType != "" { + objectMap["instanceType"] = rdpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARemoveDisksInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) { + return nil, false +} + +// AsRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) { + return &rdpsi, true +} + +// AsBasicRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsBasicRemoveDisksProviderSpecificInput() (BasicRemoveDisksProviderSpecificInput, bool) { + return &rdpsi, true +} + +// RemoveProtectionContainerMappingInput container unpairing input. +type RemoveProtectionContainerMappingInput struct { + // Properties - Configure protection input properties. + Properties *RemoveProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// RemoveProtectionContainerMappingInputProperties unpairing input properties. +type RemoveProtectionContainerMappingInputProperties struct { + // ProviderSpecificInput - Provider specific input for unpairing. + ProviderSpecificInput *ReplicationProviderContainerUnmappingInput `json:"providerSpecificInput,omitempty"` +} + +// RenewCertificateInput certificate renewal input. +type RenewCertificateInput struct { + // Properties - Renew certificate input properties. + Properties *RenewCertificateInputProperties `json:"properties,omitempty"` +} + +// RenewCertificateInputProperties renew Certificate input properties. +type RenewCertificateInputProperties struct { + // RenewCertificateType - Renew certificate type. + RenewCertificateType *string `json:"renewCertificateType,omitempty"` +} + +// ReplicationAgentDetails replication agent details. +type ReplicationAgentDetails struct { + // ID - READ-ONLY; The replication agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The replication agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The replication agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The replication agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the replication agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the replication agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationAgentDetails. +func (rad ReplicationAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ReplicationEligibilityResults replication eligibility results response model. +type ReplicationEligibilityResults struct { + autorest.Response `json:"-"` + // Name - READ-ONLY; Gets the name of this object. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets the object type. + Type *string `json:"type,omitempty"` + // ID - READ-ONLY; Gets Unique ARM identifier for this object. + ID *string `json:"id,omitempty"` + // Properties - READ-ONLY; Gets properties model for replication eligibility results API. + Properties *ReplicationEligibilityResultsProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResults. +func (rer ReplicationEligibilityResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ReplicationEligibilityResultsCollection replication eligibility results collection response model. +type ReplicationEligibilityResultsCollection struct { + autorest.Response `json:"-"` + // Value - The replication eligibility results details. + Value *[]ReplicationEligibilityResults `json:"value,omitempty"` +} + +// ReplicationEligibilityResultsErrorInfo error model that can be exposed to the user. +type ReplicationEligibilityResultsErrorInfo struct { + // Code - The error code. + Code *string `json:"code,omitempty"` + // Message - The error message. + Message *string `json:"message,omitempty"` + // PossibleCauses - The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // Status - READ-ONLY; The error status. + Status *string `json:"status,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResultsErrorInfo. +func (rerei ReplicationEligibilityResultsErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rerei.Code != nil { + objectMap["code"] = rerei.Code + } + if rerei.Message != nil { + objectMap["message"] = rerei.Message + } + if rerei.PossibleCauses != nil { + objectMap["possibleCauses"] = rerei.PossibleCauses + } + if rerei.RecommendedAction != nil { + objectMap["recommendedAction"] = rerei.RecommendedAction + } + return json.Marshal(objectMap) +} + +// ReplicationEligibilityResultsProperties properties model for replication eligibility results API. +type ReplicationEligibilityResultsProperties struct { + // ClientRequestID - READ-ONLY; The client request Id. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // Errors - The error details. + Errors *[]ReplicationEligibilityResultsErrorInfo `json:"errors,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResultsProperties. +func (rerp ReplicationEligibilityResultsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rerp.Errors != nil { + objectMap["errors"] = rerp.Errors + } + return json.Marshal(objectMap) +} + +// ReplicationFabricsCheckConsistencyFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsCheckConsistencyFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsCheckConsistencyFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsCheckConsistencyFuture.Result. +func (future *ReplicationFabricsCheckConsistencyFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCheckConsistencyFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsCheckConsistencyFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.CheckConsistencyResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCheckConsistencyFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsCreateFuture.Result. +func (future *ReplicationFabricsCreateFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.CreateResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCreateFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsDeleteFuture.Result. +func (future *ReplicationFabricsDeleteFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsMigrateToAadFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsMigrateToAadFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsMigrateToAadFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsMigrateToAadFuture.Result. +func (future *ReplicationFabricsMigrateToAadFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsMigrateToAadFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsMigrateToAadFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsPurgeFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationFabricsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsPurgeFuture.Result. +func (future *ReplicationFabricsPurgeFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsReassociateGatewayFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsReassociateGatewayFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsReassociateGatewayFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsReassociateGatewayFuture.Result. +func (future *ReplicationFabricsReassociateGatewayFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsReassociateGatewayFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsReassociateGatewayFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.ReassociateGatewayResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsReassociateGatewayFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsRenewCertificateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsRenewCertificateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsRenewCertificateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsRenewCertificateFuture.Result. +func (future *ReplicationFabricsRenewCertificateFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsRenewCertificateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsRenewCertificateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.RenewCertificateResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsRenewCertificateFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationGroupDetails replication group details. This will be used in case of San. +type ReplicationGroupDetails struct { + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) MarshalJSON() ([]byte, error) { + rgd.InstanceType = InstanceTypeReplicationGroupDetails + objectMap := make(map[string]interface{}) + if rgd.InstanceType != "" { + objectMap["instanceType"] = rgd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return &rgd, true +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &rgd, true +} + +// ReplicationJobsCancelFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsCancelFuture.Result. +func (future *ReplicationJobsCancelFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.CancelResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsCancelFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsExportFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsExportFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsExportFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsExportFuture.Result. +func (future *ReplicationJobsExportFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsExportFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsExportFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.ExportResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsExportFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsRestartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsRestartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsRestartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsRestartFuture.Result. +func (future *ReplicationJobsRestartFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsRestartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsRestartFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.RestartResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsRestartFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsResumeFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsResumeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsResumeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsResumeFuture.Result. +func (future *ReplicationJobsResumeFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsResumeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsResumeFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.ResumeResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsResumeFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsCreateFuture.Result. +func (future *ReplicationMigrationItemsCreateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.CreateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsCreateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsDeleteFuture.Result. +func (future *ReplicationMigrationItemsDeleteFuture) result(client ReplicationMigrationItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationMigrationItemsMigrateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsMigrateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsMigrateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsMigrateFuture.Result. +func (future *ReplicationMigrationItemsMigrateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsMigrateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsMigrateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.MigrateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsMigrateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsResyncFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsResyncFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsResyncFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsResyncFuture.Result. +func (future *ReplicationMigrationItemsResyncFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsResyncFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsResyncFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.ResyncResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsResyncFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsTestMigrateCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationMigrationItemsTestMigrateCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsTestMigrateCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsTestMigrateCleanupFuture.Result. +func (future *ReplicationMigrationItemsTestMigrateCleanupFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.TestMigrateCleanupResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsTestMigrateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsTestMigrateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsTestMigrateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsTestMigrateFuture.Result. +func (future *ReplicationMigrationItemsTestMigrateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsTestMigrateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.TestMigrateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsUpdateFuture.Result. +func (future *ReplicationMigrationItemsUpdateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.UpdateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsUpdateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationNetworkMappingsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (NetworkMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsCreateFuture.Result. +func (future *ReplicationNetworkMappingsCreateFuture) result(client ReplicationNetworkMappingsClient) (nm NetworkMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + nm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nm.Response.Response, err = future.GetResult(sender); err == nil && nm.Response.Response.StatusCode != http.StatusNoContent { + nm, err = client.CreateResponder(nm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsCreateFuture", "Result", nm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationNetworkMappingsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsDeleteFuture.Result. +func (future *ReplicationNetworkMappingsDeleteFuture) result(client ReplicationNetworkMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationNetworkMappingsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (NetworkMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsUpdateFuture.Result. +func (future *ReplicationNetworkMappingsUpdateFuture) result(client ReplicationNetworkMappingsClient) (nm NetworkMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + nm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nm.Response.Response, err = future.GetResult(sender); err == nil && nm.Response.Response.StatusCode != http.StatusNoContent { + nm, err = client.UpdateResponder(nm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsUpdateFuture", "Result", nm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationPoliciesCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (Policy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesCreateFuture.Result. +func (future *ReplicationPoliciesCreateFuture) result(client ReplicationPoliciesClient) (p Policy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + p.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.CreateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesCreateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesDeleteFuture.Result. +func (future *ReplicationPoliciesDeleteFuture) result(client ReplicationPoliciesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationPoliciesUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (Policy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesUpdateFuture.Result. +func (future *ReplicationPoliciesUpdateFuture) result(client ReplicationPoliciesClient) (p Policy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + p.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.UpdateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesUpdateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItem replication protected item. +type ReplicationProtectedItem struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ReplicationProtectedItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectedItem. +func (rpi ReplicationProtectedItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpi.Properties != nil { + objectMap["properties"] = rpi.Properties + } + if rpi.Location != nil { + objectMap["location"] = rpi.Location + } + return json.Marshal(objectMap) +} + +// ReplicationProtectedItemCollection replication protected item collection. +type ReplicationProtectedItemCollection struct { + autorest.Response `json:"-"` + // Value - The Replication protected item details. + Value *[]ReplicationProtectedItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ReplicationProtectedItemCollectionIterator provides access to a complete listing of +// ReplicationProtectedItem values. +type ReplicationProtectedItemCollectionIterator struct { + i int + page ReplicationProtectedItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ReplicationProtectedItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ReplicationProtectedItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ReplicationProtectedItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ReplicationProtectedItemCollectionIterator) Response() ReplicationProtectedItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ReplicationProtectedItemCollectionIterator) Value() ReplicationProtectedItem { + if !iter.page.NotDone() { + return ReplicationProtectedItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ReplicationProtectedItemCollectionIterator type. +func NewReplicationProtectedItemCollectionIterator(page ReplicationProtectedItemCollectionPage) ReplicationProtectedItemCollectionIterator { + return ReplicationProtectedItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rpic ReplicationProtectedItemCollection) IsEmpty() bool { + return rpic.Value == nil || len(*rpic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rpic ReplicationProtectedItemCollection) hasNextLink() bool { + return rpic.NextLink != nil && len(*rpic.NextLink) != 0 +} + +// replicationProtectedItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rpic ReplicationProtectedItemCollection) replicationProtectedItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rpic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rpic.NextLink))) +} + +// ReplicationProtectedItemCollectionPage contains a page of ReplicationProtectedItem values. +type ReplicationProtectedItemCollectionPage struct { + fn func(context.Context, ReplicationProtectedItemCollection) (ReplicationProtectedItemCollection, error) + rpic ReplicationProtectedItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ReplicationProtectedItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rpic) + if err != nil { + return err + } + page.rpic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ReplicationProtectedItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ReplicationProtectedItemCollectionPage) NotDone() bool { + return !page.rpic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ReplicationProtectedItemCollectionPage) Response() ReplicationProtectedItemCollection { + return page.rpic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ReplicationProtectedItemCollectionPage) Values() []ReplicationProtectedItem { + if page.rpic.IsEmpty() { + return nil + } + return *page.rpic.Value +} + +// Creates a new instance of the ReplicationProtectedItemCollectionPage type. +func NewReplicationProtectedItemCollectionPage(cur ReplicationProtectedItemCollection, getNextPage func(context.Context, ReplicationProtectedItemCollection) (ReplicationProtectedItemCollection, error)) ReplicationProtectedItemCollectionPage { + return ReplicationProtectedItemCollectionPage{ + fn: getNextPage, + rpic: cur, + } +} + +// ReplicationProtectedItemProperties replication protected item custom data details. +type ReplicationProtectedItemProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectedItemType - The type of protected item type. + ProtectedItemType *string `json:"protectedItemType,omitempty"` + // ProtectableItemID - The protected item ARM Id. + ProtectableItemID *string `json:"protectableItemId,omitempty"` + // RecoveryServicesProviderID - The recovery provider ARM Id. + RecoveryServicesProviderID *string `json:"recoveryServicesProviderId,omitempty"` + // PrimaryFabricFriendlyName - The friendly name of the primary fabric. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // PrimaryFabricProvider - The fabric provider of the primary fabric. + PrimaryFabricProvider *string `json:"primaryFabricProvider,omitempty"` + // RecoveryFabricFriendlyName - The friendly name of recovery fabric. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // RecoveryFabricID - The Arm Id of recovery fabric. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // PrimaryProtectionContainerFriendlyName - The name of primary protection container friendly name. + PrimaryProtectionContainerFriendlyName *string `json:"primaryProtectionContainerFriendlyName,omitempty"` + // RecoveryProtectionContainerFriendlyName - The name of recovery container friendly name. + RecoveryProtectionContainerFriendlyName *string `json:"recoveryProtectionContainerFriendlyName,omitempty"` + // ProtectionState - The protection status. + ProtectionState *string `json:"protectionState,omitempty"` + // ProtectionStateDescription - The protection state description. + ProtectionStateDescription *string `json:"protectionStateDescription,omitempty"` + // ActiveLocation - The Current active location of the PE. + ActiveLocation *string `json:"activeLocation,omitempty"` + // TestFailoverState - The Test failover state. + TestFailoverState *string `json:"testFailoverState,omitempty"` + // TestFailoverStateDescription - The Test failover state description. + TestFailoverStateDescription *string `json:"testFailoverStateDescription,omitempty"` + // AllowedOperations - The allowed operations on the Replication protected item. + AllowedOperations *[]string `json:"allowedOperations,omitempty"` + // ReplicationHealth - 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 `json:"replicationHealth,omitempty"` + // FailoverHealth - The consolidated failover health for the VM. + FailoverHealth *string `json:"failoverHealth,omitempty"` + // HealthErrors - List of health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // PolicyID - The ID of Policy governing this PE. + PolicyID *string `json:"policyId,omitempty"` + // PolicyFriendlyName - The name of Policy governing this PE. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` + // LastSuccessfulFailoverTime - The Last successful failover time. + LastSuccessfulFailoverTime *date.Time `json:"lastSuccessfulFailoverTime,omitempty"` + // LastSuccessfulTestFailoverTime - The Last successful test failover time. + LastSuccessfulTestFailoverTime *date.Time `json:"lastSuccessfulTestFailoverTime,omitempty"` + // CurrentScenario - The current scenario. + CurrentScenario *CurrentScenarioDetails `json:"currentScenario,omitempty"` + // FailoverRecoveryPointID - The recovery point ARM Id to which the Vm was failed over. + FailoverRecoveryPointID *string `json:"failoverRecoveryPointId,omitempty"` + // ProviderSpecificDetails - The Replication provider custom settings. + ProviderSpecificDetails BasicReplicationProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // EventCorrelationID - The correlation Id for events associated with this protected item. + EventCorrelationID *string `json:"eventCorrelationId,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ReplicationProtectedItemProperties struct. +func (rpip *ReplicationProtectedItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpip.FriendlyName = &friendlyName + } + case "protectedItemType": + if v != nil { + var protectedItemType string + err = json.Unmarshal(*v, &protectedItemType) + if err != nil { + return err + } + rpip.ProtectedItemType = &protectedItemType + } + case "protectableItemId": + if v != nil { + var protectableItemID string + err = json.Unmarshal(*v, &protectableItemID) + if err != nil { + return err + } + rpip.ProtectableItemID = &protectableItemID + } + case "recoveryServicesProviderId": + if v != nil { + var recoveryServicesProviderID string + err = json.Unmarshal(*v, &recoveryServicesProviderID) + if err != nil { + return err + } + rpip.RecoveryServicesProviderID = &recoveryServicesProviderID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + rpip.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "primaryFabricProvider": + if v != nil { + var primaryFabricProvider string + err = json.Unmarshal(*v, &primaryFabricProvider) + if err != nil { + return err + } + rpip.PrimaryFabricProvider = &primaryFabricProvider + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + rpip.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + rpip.RecoveryFabricID = &recoveryFabricID + } + case "primaryProtectionContainerFriendlyName": + if v != nil { + var primaryProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &primaryProtectionContainerFriendlyName) + if err != nil { + return err + } + rpip.PrimaryProtectionContainerFriendlyName = &primaryProtectionContainerFriendlyName + } + case "recoveryProtectionContainerFriendlyName": + if v != nil { + var recoveryProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &recoveryProtectionContainerFriendlyName) + if err != nil { + return err + } + rpip.RecoveryProtectionContainerFriendlyName = &recoveryProtectionContainerFriendlyName + } + case "protectionState": + if v != nil { + var protectionState string + err = json.Unmarshal(*v, &protectionState) + if err != nil { + return err + } + rpip.ProtectionState = &protectionState + } + case "protectionStateDescription": + if v != nil { + var protectionStateDescription string + err = json.Unmarshal(*v, &protectionStateDescription) + if err != nil { + return err + } + rpip.ProtectionStateDescription = &protectionStateDescription + } + case "activeLocation": + if v != nil { + var activeLocation string + err = json.Unmarshal(*v, &activeLocation) + if err != nil { + return err + } + rpip.ActiveLocation = &activeLocation + } + case "testFailoverState": + if v != nil { + var testFailoverState string + err = json.Unmarshal(*v, &testFailoverState) + if err != nil { + return err + } + rpip.TestFailoverState = &testFailoverState + } + case "testFailoverStateDescription": + if v != nil { + var testFailoverStateDescription string + err = json.Unmarshal(*v, &testFailoverStateDescription) + if err != nil { + return err + } + rpip.TestFailoverStateDescription = &testFailoverStateDescription + } + case "allowedOperations": + if v != nil { + var allowedOperations []string + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + rpip.AllowedOperations = &allowedOperations + } + case "replicationHealth": + if v != nil { + var replicationHealth string + err = json.Unmarshal(*v, &replicationHealth) + if err != nil { + return err + } + rpip.ReplicationHealth = &replicationHealth + } + case "failoverHealth": + if v != nil { + var failoverHealth string + err = json.Unmarshal(*v, &failoverHealth) + if err != nil { + return err + } + rpip.FailoverHealth = &failoverHealth + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + rpip.HealthErrors = &healthErrors + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + rpip.PolicyID = &policyID + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + rpip.PolicyFriendlyName = &policyFriendlyName + } + case "lastSuccessfulFailoverTime": + if v != nil { + var lastSuccessfulFailoverTime date.Time + err = json.Unmarshal(*v, &lastSuccessfulFailoverTime) + if err != nil { + return err + } + rpip.LastSuccessfulFailoverTime = &lastSuccessfulFailoverTime + } + case "lastSuccessfulTestFailoverTime": + if v != nil { + var lastSuccessfulTestFailoverTime date.Time + err = json.Unmarshal(*v, &lastSuccessfulTestFailoverTime) + if err != nil { + return err + } + rpip.LastSuccessfulTestFailoverTime = &lastSuccessfulTestFailoverTime + } + case "currentScenario": + if v != nil { + var currentScenario CurrentScenarioDetails + err = json.Unmarshal(*v, ¤tScenario) + if err != nil { + return err + } + rpip.CurrentScenario = ¤tScenario + } + case "failoverRecoveryPointId": + if v != nil { + var failoverRecoveryPointID string + err = json.Unmarshal(*v, &failoverRecoveryPointID) + if err != nil { + return err + } + rpip.FailoverRecoveryPointID = &failoverRecoveryPointID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReplicationProviderSpecificSettings(*v) + if err != nil { + return err + } + rpip.ProviderSpecificDetails = providerSpecificDetails + } + case "recoveryContainerId": + if v != nil { + var recoveryContainerID string + err = json.Unmarshal(*v, &recoveryContainerID) + if err != nil { + return err + } + rpip.RecoveryContainerID = &recoveryContainerID + } + case "eventCorrelationId": + if v != nil { + var eventCorrelationID string + err = json.Unmarshal(*v, &eventCorrelationID) + if err != nil { + return err + } + rpip.EventCorrelationID = &eventCorrelationID + } + } + } + + return nil +} + +// ReplicationProtectedItemsAddDisksFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsAddDisksFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsAddDisksFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsAddDisksFuture.Result. +func (future *ReplicationProtectedItemsAddDisksFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsAddDisksFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsAddDisksFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.AddDisksResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsAddDisksFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsApplyRecoveryPointFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsApplyRecoveryPointFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsApplyRecoveryPointFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsApplyRecoveryPointFuture.Result. +func (future *ReplicationProtectedItemsApplyRecoveryPointFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ApplyRecoveryPointResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsCreateFuture.Result. +func (future *ReplicationProtectedItemsCreateFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.CreateResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsCreateFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsDeleteFuture.Result. +func (future *ReplicationProtectedItemsDeleteFuture) result(client ReplicationProtectedItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectedItemsFailoverCancelFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsFailoverCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsFailoverCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsFailoverCancelFuture.Result. +func (future *ReplicationProtectedItemsFailoverCancelFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsFailoverCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.FailoverCancelResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCancelFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsFailoverCommitFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsFailoverCommitFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsFailoverCommitFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsFailoverCommitFuture.Result. +func (future *ReplicationProtectedItemsFailoverCommitFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCommitFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsFailoverCommitFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.FailoverCommitResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCommitFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsPlannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsPlannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsPlannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsPlannedFailoverFuture.Result. +func (future *ReplicationProtectedItemsPlannedFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPlannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsPlannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.PlannedFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPlannedFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsPurgeFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsPurgeFuture.Result. +func (future *ReplicationProtectedItemsPurgeFuture) result(client ReplicationProtectedItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectedItemsRemoveDisksFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsRemoveDisksFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsRemoveDisksFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsRemoveDisksFuture.Result. +func (future *ReplicationProtectedItemsRemoveDisksFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRemoveDisksFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsRemoveDisksFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.RemoveDisksResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRemoveDisksFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsRepairReplicationFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsRepairReplicationFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsRepairReplicationFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsRepairReplicationFuture.Result. +func (future *ReplicationProtectedItemsRepairReplicationFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRepairReplicationFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsRepairReplicationFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.RepairReplicationResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRepairReplicationFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsReprotectFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsReprotectFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsReprotectFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsReprotectFuture.Result. +func (future *ReplicationProtectedItemsReprotectFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsReprotectFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsReprotectFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ReprotectResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsReprotectFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsResolveHealthErrorsFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsResolveHealthErrorsFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsResolveHealthErrorsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsResolveHealthErrorsFuture.Result. +func (future *ReplicationProtectedItemsResolveHealthErrorsFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ResolveHealthErrorsResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsTestFailoverCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsTestFailoverCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsTestFailoverCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsTestFailoverCleanupFuture.Result. +func (future *ReplicationProtectedItemsTestFailoverCleanupFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.TestFailoverCleanupResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsTestFailoverFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectedItemsTestFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsTestFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsTestFailoverFuture.Result. +func (future *ReplicationProtectedItemsTestFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsTestFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.TestFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUnplannedFailoverFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsUnplannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUnplannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUnplannedFailoverFuture.Result. +func (future *ReplicationProtectedItemsUnplannedFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UnplannedFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateApplianceFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsUpdateApplianceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateApplianceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateApplianceFuture.Result. +func (future *ReplicationProtectedItemsUpdateApplianceFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateApplianceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateApplianceFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateApplianceResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateApplianceFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateFuture.Result. +func (future *ReplicationProtectedItemsUpdateFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateMobilityServiceFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsUpdateMobilityServiceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateMobilityServiceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateMobilityServiceFuture.Result. +func (future *ReplicationProtectedItemsUpdateMobilityServiceFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateMobilityServiceResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainerMappingsCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (ProtectionContainerMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsCreateFuture.Result. +func (future *ReplicationProtectionContainerMappingsCreateFuture) result(client ReplicationProtectionContainerMappingsClient) (pcm ProtectionContainerMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pcm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pcm.Response.Response, err = future.GetResult(sender); err == nil && pcm.Response.Response.StatusCode != http.StatusNoContent { + pcm, err = client.CreateResponder(pcm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsCreateFuture", "Result", pcm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainerMappingsDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsDeleteFuture.Result. +func (future *ReplicationProtectionContainerMappingsDeleteFuture) result(client ReplicationProtectionContainerMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainerMappingsPurgeFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsPurgeFuture.Result. +func (future *ReplicationProtectionContainerMappingsPurgeFuture) result(client ReplicationProtectionContainerMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainerMappingsUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (ProtectionContainerMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsUpdateFuture.Result. +func (future *ReplicationProtectionContainerMappingsUpdateFuture) result(client ReplicationProtectionContainerMappingsClient) (pcm ProtectionContainerMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pcm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pcm.Response.Response, err = future.GetResult(sender); err == nil && pcm.Response.Response.StatusCode != http.StatusNoContent { + pcm, err = client.UpdateResponder(pcm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsUpdateFuture", "Result", pcm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersCreateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectionContainersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersCreateFuture.Result. +func (future *ReplicationProtectionContainersCreateFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.CreateResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersCreateFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersDeleteFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectionContainersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersDeleteFuture.Result. +func (future *ReplicationProtectionContainersDeleteFuture) result(client ReplicationProtectionContainersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainersDiscoverProtectableItemFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type ReplicationProtectionContainersDiscoverProtectableItemFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersDiscoverProtectableItemFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersDiscoverProtectableItemFuture.Result. +func (future *ReplicationProtectionContainersDiscoverProtectableItemFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.DiscoverProtectableItemResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersSwitchProtectionFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainersSwitchProtectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersSwitchProtectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersSwitchProtectionFuture.Result. +func (future *ReplicationProtectionContainersSwitchProtectionFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersSwitchProtectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersSwitchProtectionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.SwitchProtectionResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersSwitchProtectionFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionIntent replication protection intent. +type ReplicationProtectionIntent struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ReplicationProtectionIntentProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntent. +func (rpi ReplicationProtectionIntent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpi.Properties != nil { + objectMap["properties"] = rpi.Properties + } + if rpi.Location != nil { + objectMap["location"] = rpi.Location + } + return json.Marshal(objectMap) +} + +// ReplicationProtectionIntentCollection replication protection intent objects collection. +type ReplicationProtectionIntentCollection struct { + autorest.Response `json:"-"` + // Value - The Replication protection intent details. + Value *[]ReplicationProtectionIntent `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ReplicationProtectionIntentCollectionIterator provides access to a complete listing of +// ReplicationProtectionIntent values. +type ReplicationProtectionIntentCollectionIterator struct { + i int + page ReplicationProtectionIntentCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ReplicationProtectionIntentCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ReplicationProtectionIntentCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ReplicationProtectionIntentCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ReplicationProtectionIntentCollectionIterator) Response() ReplicationProtectionIntentCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ReplicationProtectionIntentCollectionIterator) Value() ReplicationProtectionIntent { + if !iter.page.NotDone() { + return ReplicationProtectionIntent{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ReplicationProtectionIntentCollectionIterator type. +func NewReplicationProtectionIntentCollectionIterator(page ReplicationProtectionIntentCollectionPage) ReplicationProtectionIntentCollectionIterator { + return ReplicationProtectionIntentCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rpic ReplicationProtectionIntentCollection) IsEmpty() bool { + return rpic.Value == nil || len(*rpic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rpic ReplicationProtectionIntentCollection) hasNextLink() bool { + return rpic.NextLink != nil && len(*rpic.NextLink) != 0 +} + +// replicationProtectionIntentCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rpic ReplicationProtectionIntentCollection) replicationProtectionIntentCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rpic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rpic.NextLink))) +} + +// ReplicationProtectionIntentCollectionPage contains a page of ReplicationProtectionIntent values. +type ReplicationProtectionIntentCollectionPage struct { + fn func(context.Context, ReplicationProtectionIntentCollection) (ReplicationProtectionIntentCollection, error) + rpic ReplicationProtectionIntentCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ReplicationProtectionIntentCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rpic) + if err != nil { + return err + } + page.rpic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ReplicationProtectionIntentCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ReplicationProtectionIntentCollectionPage) NotDone() bool { + return !page.rpic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ReplicationProtectionIntentCollectionPage) Response() ReplicationProtectionIntentCollection { + return page.rpic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ReplicationProtectionIntentCollectionPage) Values() []ReplicationProtectionIntent { + if page.rpic.IsEmpty() { + return nil + } + return *page.rpic.Value +} + +// Creates a new instance of the ReplicationProtectionIntentCollectionPage type. +func NewReplicationProtectionIntentCollectionPage(cur ReplicationProtectionIntentCollection, getNextPage func(context.Context, ReplicationProtectionIntentCollection) (ReplicationProtectionIntentCollection, error)) ReplicationProtectionIntentCollectionPage { + return ReplicationProtectionIntentCollectionPage{ + fn: getNextPage, + rpic: cur, + } +} + +// ReplicationProtectionIntentProperties replication protection intent custom data details. +type ReplicationProtectionIntentProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // JobID - READ-ONLY; The job Id. + JobID *string `json:"jobId,omitempty"` + // JobState - READ-ONLY; The job state. + JobState *string `json:"jobState,omitempty"` + // IsActive - READ-ONLY; A value indicating whether the intent object is active. + IsActive *bool `json:"isActive,omitempty"` + // CreationTimeUTC - READ-ONLY; The creation time in UTC. + CreationTimeUTC *string `json:"creationTimeUTC,omitempty"` + // ProviderSpecificDetails - The Replication provider custom settings. + ProviderSpecificDetails BasicReplicationProtectionIntentProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntentProperties. +func (rpip ReplicationProtectionIntentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpip.FriendlyName != nil { + objectMap["friendlyName"] = rpip.FriendlyName + } + objectMap["providerSpecificDetails"] = rpip.ProviderSpecificDetails + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ReplicationProtectionIntentProperties struct. +func (rpip *ReplicationProtectionIntentProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpip.FriendlyName = &friendlyName + } + case "jobId": + if v != nil { + var jobID string + err = json.Unmarshal(*v, &jobID) + if err != nil { + return err + } + rpip.JobID = &jobID + } + case "jobState": + if v != nil { + var jobState string + err = json.Unmarshal(*v, &jobState) + if err != nil { + return err + } + rpip.JobState = &jobState + } + case "isActive": + if v != nil { + var isActive bool + err = json.Unmarshal(*v, &isActive) + if err != nil { + return err + } + rpip.IsActive = &isActive + } + case "creationTimeUTC": + if v != nil { + var creationTimeUTC string + err = json.Unmarshal(*v, &creationTimeUTC) + if err != nil { + return err + } + rpip.CreationTimeUTC = &creationTimeUTC + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(*v) + if err != nil { + return err + } + rpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicReplicationProtectionIntentProviderSpecificSettings replication provider specific settings. +type BasicReplicationProtectionIntentProviderSpecificSettings interface { + AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) + AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) +} + +// ReplicationProtectionIntentProviderSpecificSettings replication provider specific settings. +type ReplicationProtectionIntentProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings', 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A' + InstanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(body []byte) (BasicReplicationProtectionIntentProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A): + var arid A2AReplicationIntentDetails + err := json.Unmarshal(body, &arid) + return arid, err + default: + var rpipss ReplicationProtectionIntentProviderSpecificSettings + err := json.Unmarshal(body, &rpipss) + return rpipss, err + } +} +func unmarshalBasicReplicationProtectionIntentProviderSpecificSettingsArray(body []byte) ([]BasicReplicationProtectionIntentProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpipssArray := make([]BasicReplicationProtectionIntentProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpipss, err := unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + rpipssArray[index] = rpipss + } + return rpipssArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) MarshalJSON() ([]byte, error) { + rpipss.InstanceType = InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings + objectMap := make(map[string]interface{}) + if rpipss.InstanceType != "" { + objectMap["instanceType"] = rpipss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReplicationIntentDetails is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) { + return nil, false +} + +// AsReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) { + return &rpipss, true +} + +// AsBasicReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsBasicReplicationProtectionIntentProviderSpecificSettings() (BasicReplicationProtectionIntentProviderSpecificSettings, bool) { + return &rpipss, true +} + +// ReplicationProviderContainerUnmappingInput provider specific input for unpairing operations. +type ReplicationProviderContainerUnmappingInput struct { + // InstanceType - The class type. + InstanceType *string `json:"instanceType,omitempty"` +} + +// BasicReplicationProviderSpecificContainerCreationInput provider specific input for container creation operation. +type BasicReplicationProviderSpecificContainerCreationInput interface { + AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) + AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) + AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) + AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) +} + +// ReplicationProviderSpecificContainerCreationInput provider specific input for container creation operation. +type ReplicationProviderSpecificContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificContainerCreationInput(body []byte) (BasicReplicationProviderSpecificContainerCreationInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A): + var acci A2AContainerCreationInput + err := json.Unmarshal(body, &acci) + return acci, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration): + var accmcci A2ACrossClusterMigrationContainerCreationInput + err := json.Unmarshal(body, &accmcci) + return accmcci, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt): + var vmccci VMwareCbtContainerCreationInput + err := json.Unmarshal(body, &vmccci) + return vmccci, err + default: + var rpscci ReplicationProviderSpecificContainerCreationInput + err := json.Unmarshal(body, &rpscci) + return rpscci, err + } +} +func unmarshalBasicReplicationProviderSpecificContainerCreationInputArray(body []byte) ([]BasicReplicationProviderSpecificContainerCreationInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpscciArray := make([]BasicReplicationProviderSpecificContainerCreationInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpscci, err := unmarshalBasicReplicationProviderSpecificContainerCreationInput(*rawMessage) + if err != nil { + return nil, err + } + rpscciArray[index] = rpscci + } + return rpscciArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) MarshalJSON() ([]byte, error) { + rpscci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput + objectMap := make(map[string]interface{}) + if rpscci.InstanceType != "" { + objectMap["instanceType"] = rpscci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return &rpscci, true +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &rpscci, true +} + +// BasicReplicationProviderSpecificContainerMappingInput provider specific input for pairing operations. +type BasicReplicationProviderSpecificContainerMappingInput interface { + AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) + AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) + AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) +} + +// ReplicationProviderSpecificContainerMappingInput provider specific input for pairing operations. +type ReplicationProviderSpecificContainerMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificContainerMappingInput(body []byte) (BasicReplicationProviderSpecificContainerMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A): + var acmi A2AContainerMappingInput + err := json.Unmarshal(body, &acmi) + return acmi, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt): + var vmccmi VMwareCbtContainerMappingInput + err := json.Unmarshal(body, &vmccmi) + return vmccmi, err + default: + var rpscmi ReplicationProviderSpecificContainerMappingInput + err := json.Unmarshal(body, &rpscmi) + return rpscmi, err + } +} +func unmarshalBasicReplicationProviderSpecificContainerMappingInputArray(body []byte) ([]BasicReplicationProviderSpecificContainerMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpscmiArray := make([]BasicReplicationProviderSpecificContainerMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpscmi, err := unmarshalBasicReplicationProviderSpecificContainerMappingInput(*rawMessage) + if err != nil { + return nil, err + } + rpscmiArray[index] = rpscmi + } + return rpscmiArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) MarshalJSON() ([]byte, error) { + rpscmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput + objectMap := make(map[string]interface{}) + if rpscmi.InstanceType != "" { + objectMap["instanceType"] = rpscmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return &rpscmi, true +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &rpscmi, true +} + +// BasicReplicationProviderSpecificSettings replication provider specific settings. +type BasicReplicationProviderSpecificSettings interface { + AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) + AsA2AReplicationDetails() (*A2AReplicationDetails, bool) + AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) + AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) + AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) + AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) + AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) + AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) + AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) + AsInMageReplicationDetails() (*InMageReplicationDetails, bool) + AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) +} + +// ReplicationProviderSpecificSettings replication provider specific settings. +type ReplicationProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificSettings(body []byte) (BasicReplicationProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration): + var accmrd A2ACrossClusterMigrationReplicationDetails + err := json.Unmarshal(body, &accmrd) + return accmrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A): + var ard A2AReplicationDetails + err := json.Unmarshal(body, &ard) + return ard, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure): + var hvrard HyperVReplicaAzureReplicationDetails + err := json.Unmarshal(body, &hvrard) + return hvrard, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails): + var hvrbrd HyperVReplicaBaseReplicationDetails + err := json.Unmarshal(body, &hvrbrd) + return hvrbrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2): + var hvrbrd HyperVReplicaBlueReplicationDetails + err := json.Unmarshal(body, &hvrbrd) + return hvrbrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012): + var hvrrd HyperVReplicaReplicationDetails + err := json.Unmarshal(body, &hvrrd) + return hvrrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2): + var imavrd InMageAzureV2ReplicationDetails + err := json.Unmarshal(body, &imavrd) + return imavrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback): + var imrfrd InMageRcmFailbackReplicationDetails + err := json.Unmarshal(body, &imrfrd) + return imrfrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm): + var imrrd InMageRcmReplicationDetails + err := json.Unmarshal(body, &imrrd) + return imrrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage): + var imrd InMageReplicationDetails + err := json.Unmarshal(body, &imrd) + return imrd, err + default: + var rpss ReplicationProviderSpecificSettings + err := json.Unmarshal(body, &rpss) + return rpss, err + } +} +func unmarshalBasicReplicationProviderSpecificSettingsArray(body []byte) ([]BasicReplicationProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpssArray := make([]BasicReplicationProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpss, err := unmarshalBasicReplicationProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + rpssArray[index] = rpss + } + return rpssArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) MarshalJSON() ([]byte, error) { + rpss.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings + objectMap := make(map[string]interface{}) + if rpss.InstanceType != "" { + objectMap["instanceType"] = rpss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return &rpss, true +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &rpss, true +} + +// BasicReplicationProviderSpecificUpdateContainerMappingInput provider specific input for update pairing operations. +type BasicReplicationProviderSpecificUpdateContainerMappingInput interface { + AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) + AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) + AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) +} + +// ReplicationProviderSpecificUpdateContainerMappingInput provider specific input for update pairing +// operations. +type ReplicationProviderSpecificUpdateContainerMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(body []byte) (BasicReplicationProviderSpecificUpdateContainerMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A): + var aucmi A2AUpdateContainerMappingInput + err := json.Unmarshal(body, &aucmi) + return aucmi, err + case string(InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm): + var imrucmi InMageRcmUpdateContainerMappingInput + err := json.Unmarshal(body, &imrucmi) + return imrucmi, err + default: + var rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput + err := json.Unmarshal(body, &rpsucmi) + return rpsucmi, err + } +} +func unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInputArray(body []byte) ([]BasicReplicationProviderSpecificUpdateContainerMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpsucmiArray := make([]BasicReplicationProviderSpecificUpdateContainerMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpsucmi, err := unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(*rawMessage) + if err != nil { + return nil, err + } + rpsucmiArray[index] = rpsucmi + } + return rpsucmiArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + rpsucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput + objectMap := make(map[string]interface{}) + if rpsucmi.InstanceType != "" { + objectMap["instanceType"] = rpsucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &rpsucmi, true +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &rpsucmi, true +} + +// ReplicationRecoveryPlansCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansCreateFuture.Result. +func (future *ReplicationRecoveryPlansCreateFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.CreateResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansCreateFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansDeleteFuture.Result. +func (future *ReplicationRecoveryPlansDeleteFuture) result(client ReplicationRecoveryPlansClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryPlansFailoverCancelFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationRecoveryPlansFailoverCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansFailoverCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansFailoverCancelFuture.Result. +func (future *ReplicationRecoveryPlansFailoverCancelFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansFailoverCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.FailoverCancelResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCancelFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansFailoverCommitFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationRecoveryPlansFailoverCommitFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansFailoverCommitFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansFailoverCommitFuture.Result. +func (future *ReplicationRecoveryPlansFailoverCommitFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCommitFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansFailoverCommitFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.FailoverCommitResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCommitFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansPlannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryPlansPlannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansPlannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansPlannedFailoverFuture.Result. +func (future *ReplicationRecoveryPlansPlannedFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.PlannedFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansReprotectFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansReprotectFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansReprotectFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansReprotectFuture.Result. +func (future *ReplicationRecoveryPlansReprotectFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansReprotectFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansReprotectFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.ReprotectResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansReprotectFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansTestFailoverCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryPlansTestFailoverCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansTestFailoverCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansTestFailoverCleanupFuture.Result. +func (future *ReplicationRecoveryPlansTestFailoverCleanupFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.TestFailoverCleanupResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansTestFailoverFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansTestFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansTestFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansTestFailoverFuture.Result. +func (future *ReplicationRecoveryPlansTestFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansTestFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.TestFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansUnplannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryPlansUnplannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansUnplannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansUnplannedFailoverFuture.Result. +func (future *ReplicationRecoveryPlansUnplannedFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.UnplannedFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansUpdateFuture.Result. +func (future *ReplicationRecoveryPlansUpdateFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.UpdateResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUpdateFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryServicesProvidersCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryServicesProvidersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (RecoveryServicesProvider, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersCreateFuture.Result. +func (future *ReplicationRecoveryServicesProvidersCreateFuture) result(client ReplicationRecoveryServicesProvidersClient) (rsp RecoveryServicesProvider, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rsp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rsp.Response.Response, err = future.GetResult(sender); err == nil && rsp.Response.Response.StatusCode != http.StatusNoContent { + rsp, err = client.CreateResponder(rsp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersCreateFuture", "Result", rsp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryServicesProvidersDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryServicesProvidersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersDeleteFuture.Result. +func (future *ReplicationRecoveryServicesProvidersDeleteFuture) result(client ReplicationRecoveryServicesProvidersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryServicesProvidersPurgeFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryServicesProvidersPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersPurgeFuture.Result. +func (future *ReplicationRecoveryServicesProvidersPurgeFuture) result(client ReplicationRecoveryServicesProvidersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryServicesProvidersRefreshProviderFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type ReplicationRecoveryServicesProvidersRefreshProviderFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (RecoveryServicesProvider, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersRefreshProviderFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersRefreshProviderFuture.Result. +func (future *ReplicationRecoveryServicesProvidersRefreshProviderFuture) result(client ReplicationRecoveryServicesProvidersClient) (rsp RecoveryServicesProvider, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rsp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rsp.Response.Response, err = future.GetResult(sender); err == nil && rsp.Response.Response.StatusCode != http.StatusNoContent { + rsp, err = client.RefreshProviderResponder(rsp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture", "Result", rsp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationStorageClassificationMappingsCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationStorageClassificationMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationStorageClassificationMappingsClient) (StorageClassificationMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationStorageClassificationMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationStorageClassificationMappingsCreateFuture.Result. +func (future *ReplicationStorageClassificationMappingsCreateFuture) result(client ReplicationStorageClassificationMappingsClient) (scm StorageClassificationMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + scm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationStorageClassificationMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if scm.Response.Response, err = future.GetResult(sender); err == nil && scm.Response.Response.StatusCode != http.StatusNoContent { + scm, err = client.CreateResponder(scm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsCreateFuture", "Result", scm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationStorageClassificationMappingsDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationStorageClassificationMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationStorageClassificationMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationStorageClassificationMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationStorageClassificationMappingsDeleteFuture.Result. +func (future *ReplicationStorageClassificationMappingsDeleteFuture) result(client ReplicationStorageClassificationMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationStorageClassificationMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationVaultHealthRefreshFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationVaultHealthRefreshFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationVaultHealthClient) (VaultHealthDetails, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationVaultHealthRefreshFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationVaultHealthRefreshFuture.Result. +func (future *ReplicationVaultHealthRefreshFuture) result(client ReplicationVaultHealthClient) (vhd VaultHealthDetails, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthRefreshFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vhd.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationVaultHealthRefreshFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vhd.Response.Response, err = future.GetResult(sender); err == nil && vhd.Response.Response.StatusCode != http.StatusNoContent { + vhd, err = client.RefreshResponder(vhd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthRefreshFuture", "Result", vhd.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationVaultSettingCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationVaultSettingCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationVaultSettingClient) (VaultSetting, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationVaultSettingCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationVaultSettingCreateFuture.Result. +func (future *ReplicationVaultSettingCreateFuture) result(client ReplicationVaultSettingClient) (vs VaultSetting, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vs.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationVaultSettingCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vs.Response.Response, err = future.GetResult(sender); err == nil && vs.Response.Response.StatusCode != http.StatusNoContent { + vs, err = client.CreateResponder(vs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingCreateFuture", "Result", vs.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationvCentersCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (VCenter, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersCreateFuture.Result. +func (future *ReplicationvCentersCreateFuture) result(client ReplicationvCentersClient) (vc VCenter, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent { + vc, err = client.CreateResponder(vc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersCreateFuture", "Result", vc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationvCentersDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersDeleteFuture.Result. +func (future *ReplicationvCentersDeleteFuture) result(client ReplicationvCentersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationvCentersUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (VCenter, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersUpdateFuture.Result. +func (future *ReplicationvCentersUpdateFuture) result(client ReplicationvCentersClient) (vc VCenter, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent { + vc, err = client.UpdateResponder(vc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersUpdateFuture", "Result", vc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReprotectAgentDetails reprotect agent details. +type ReprotectAgentDetails struct { + // ID - READ-ONLY; The reprotect agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The reprotect agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The reprotect agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The reprotect agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the reprotect agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the reprotect agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // ProtectedItemCount - READ-ONLY; The protected item count. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // AccessibleDatastores - READ-ONLY; The list of accessible datastores fetched from discovery. + AccessibleDatastores *[]string `json:"accessibleDatastores,omitempty"` + // VcenterID - READ-ONLY; The Vcenter Id. + VcenterID *string `json:"vcenterId,omitempty"` + // LastDiscoveryInUtc - READ-ONLY; The last time when SDS information discovered in SRS. + LastDiscoveryInUtc *date.Time `json:"lastDiscoveryInUtc,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReprotectAgentDetails. +func (rad ReprotectAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResolveHealthError resolve health errors input properties. +type ResolveHealthError struct { + // HealthErrorID - Health error id. + HealthErrorID *string `json:"healthErrorId,omitempty"` +} + +// ResolveHealthInput resolve health input. +type ResolveHealthInput struct { + // Properties - Disable resolve health input properties. + Properties *ResolveHealthInputProperties `json:"properties,omitempty"` +} + +// ResolveHealthInputProperties resolve health input properties. +type ResolveHealthInputProperties struct { + // HealthErrors - Health errors. + HealthErrors *[]ResolveHealthError `json:"healthErrors,omitempty"` +} + +// Resource azure resource. +type Resource struct { + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location + } + return json.Marshal(objectMap) +} + +// ResourceHealthSummary base class to define the health summary of the resources contained under an Arm +// resource. +type ResourceHealthSummary struct { + // ResourceCount - The count of total resources under the container. + ResourceCount *int32 `json:"resourceCount,omitempty"` + // Issues - The list of summary of health errors across the resources under the container. + Issues *[]HealthErrorSummary `json:"issues,omitempty"` + // CategorizedResourceCounts - The categorized resource counts. + CategorizedResourceCounts map[string]*int32 `json:"categorizedResourceCounts"` +} + +// MarshalJSON is the custom marshaler for ResourceHealthSummary. +func (RHS ResourceHealthSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if RHS.ResourceCount != nil { + objectMap["resourceCount"] = RHS.ResourceCount + } + if RHS.Issues != nil { + objectMap["issues"] = RHS.Issues + } + if RHS.CategorizedResourceCounts != nil { + objectMap["categorizedResourceCounts"] = RHS.CategorizedResourceCounts + } + return json.Marshal(objectMap) +} + +// ResumeJobParams resume job params. +type ResumeJobParams struct { + // Properties - Resume job properties. + Properties *ResumeJobParamsProperties `json:"properties,omitempty"` +} + +// ResumeJobParamsProperties resume job properties. +type ResumeJobParamsProperties struct { + // Comments - Resume job comments. + Comments *string `json:"comments,omitempty"` +} + +// ResyncInput resync input. +type ResyncInput struct { + // Properties - Resync input properties. + Properties *ResyncInputProperties `json:"properties,omitempty"` +} + +// ResyncInputProperties resync input properties. +type ResyncInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicResyncProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ResyncInputProperties struct. +func (rip *ResyncInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicResyncProviderSpecificInput(*v) + if err != nil { + return err + } + rip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicResyncProviderSpecificInput resync provider specific input. +type BasicResyncProviderSpecificInput interface { + AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) + AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) +} + +// ResyncProviderSpecificInput resync provider specific input. +type ResyncProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput', 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicResyncProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicResyncProviderSpecificInput(body []byte) (BasicResyncProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt): + var vmcri VMwareCbtResyncInput + err := json.Unmarshal(body, &vmcri) + return vmcri, err + default: + var rpsi ResyncProviderSpecificInput + err := json.Unmarshal(body, &rpsi) + return rpsi, err + } +} +func unmarshalBasicResyncProviderSpecificInputArray(body []byte) ([]BasicResyncProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpsiArray := make([]BasicResyncProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpsi, err := unmarshalBasicResyncProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rpsiArray[index] = rpsi + } + return rpsiArray, nil +} + +// MarshalJSON is the custom marshaler for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) MarshalJSON() ([]byte, error) { + rpsi.InstanceType = InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput + objectMap := make(map[string]interface{}) + if rpsi.InstanceType != "" { + objectMap["instanceType"] = rpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtResyncInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) { + return nil, false +} + +// AsResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) { + return &rpsi, true +} + +// AsBasicResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsBasicResyncProviderSpecificInput() (BasicResyncProviderSpecificInput, bool) { + return &rpsi, true +} + +// RetentionVolume the retention details of the MT. +type RetentionVolume struct { + // VolumeName - The volume name. + VolumeName *string `json:"volumeName,omitempty"` + // CapacityInBytes - The volume capacity. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // FreeSpaceInBytes - The free space available in this volume. + FreeSpaceInBytes *int64 `json:"freeSpaceInBytes,omitempty"` + // ThresholdPercentage - The threshold percentage. + ThresholdPercentage *int32 `json:"thresholdPercentage,omitempty"` +} + +// ReverseReplicationInput reverse replication input. +type ReverseReplicationInput struct { + // Properties - Reverse replication properties. + Properties *ReverseReplicationInputProperties `json:"properties,omitempty"` +} + +// ReverseReplicationInputProperties reverse replication input properties. +type ReverseReplicationInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - Provider specific reverse replication input. + ProviderSpecificDetails BasicReverseReplicationProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ReverseReplicationInputProperties struct. +func (rrip *ReverseReplicationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rrip.FailoverDirection = &failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReverseReplicationProviderSpecificInput(*v) + if err != nil { + return err + } + rrip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicReverseReplicationProviderSpecificInput provider specific reverse replication input. +type BasicReverseReplicationProviderSpecificInput interface { + AsA2AReprotectInput() (*A2AReprotectInput, bool) + AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) + AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) + AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) + AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) + AsInMageReprotectInput() (*InMageReprotectInput, bool) + AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) +} + +// ReverseReplicationProviderSpecificInput provider specific reverse replication input. +type ReverseReplicationProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReverseReplicationProviderSpecificInput(body []byte) (BasicReverseReplicationProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A): + var ari A2AReprotectInput + err := json.Unmarshal(body, &ari) + return ari, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvrari HyperVReplicaAzureReprotectInput + err := json.Unmarshal(body, &hvrari) + return hvrari, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2): + var imavri InMageAzureV2ReprotectInput + err := json.Unmarshal(body, &imavri) + return imavri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback): + var imrfri InMageRcmFailbackReprotectInput + err := json.Unmarshal(body, &imrfri) + return imrfri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm): + var imrri InMageRcmReprotectInput + err := json.Unmarshal(body, &imrri) + return imrri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage): + var imri InMageReprotectInput + err := json.Unmarshal(body, &imri) + return imri, err + default: + var rrpsi ReverseReplicationProviderSpecificInput + err := json.Unmarshal(body, &rrpsi) + return rrpsi, err + } +} +func unmarshalBasicReverseReplicationProviderSpecificInputArray(body []byte) ([]BasicReverseReplicationProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rrpsiArray := make([]BasicReverseReplicationProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rrpsi, err := unmarshalBasicReverseReplicationProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rrpsiArray[index] = rrpsi + } + return rrpsiArray, nil +} + +// MarshalJSON is the custom marshaler for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) MarshalJSON() ([]byte, error) { + rrpsi.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput + objectMap := make(map[string]interface{}) + if rrpsi.InstanceType != "" { + objectMap["instanceType"] = rrpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return &rrpsi, true +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &rrpsi, true +} + +// RoleAssignment azure role assignment details. +type RoleAssignment struct { + // ID - The ARM Id of the role assignment. + ID *string `json:"id,omitempty"` + // Name - The name of the role assignment. + Name *string `json:"name,omitempty"` + // Scope - Role assignment scope. + Scope *string `json:"scope,omitempty"` + // PrincipalID - Principal Id. + PrincipalID *string `json:"principalId,omitempty"` + // RoleDefinitionID - Role definition id. + RoleDefinitionID *string `json:"roleDefinitionId,omitempty"` +} + +// RunAsAccount CS Accounts Details. +type RunAsAccount struct { + // AccountID - The CS RunAs account Id. + AccountID *string `json:"accountId,omitempty"` + // AccountName - The CS RunAs account name. + AccountName *string `json:"accountName,omitempty"` +} + +// ScriptActionTaskDetails this class represents the script action task details. +type ScriptActionTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // Path - The path. + Path *string `json:"path,omitempty"` + // Output - The output. + Output *string `json:"output,omitempty"` + // IsPrimarySideScript - A value indicating whether it is a primary side script or not. + IsPrimarySideScript *bool `json:"isPrimarySideScript,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) MarshalJSON() ([]byte, error) { + satd.InstanceType = InstanceTypeScriptActionTaskDetails + objectMap := make(map[string]interface{}) + if satd.Name != nil { + objectMap["name"] = satd.Name + } + if satd.Path != nil { + objectMap["path"] = satd.Path + } + if satd.Output != nil { + objectMap["output"] = satd.Output + } + if satd.IsPrimarySideScript != nil { + objectMap["isPrimarySideScript"] = satd.IsPrimarySideScript + } + if satd.InstanceType != "" { + objectMap["instanceType"] = satd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return &satd, true +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &satd, true +} + +// ServiceError ASR error model. +type ServiceError struct { + // Code - Error code. + Code *string `json:"code,omitempty"` + // Message - Error message. + Message *string `json:"message,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ActivityID - Activity Id. + ActivityID *string `json:"activityId,omitempty"` +} + +// BasicStorageAccountCustomDetails storage account custom input. +type BasicStorageAccountCustomDetails interface { + AsExistingStorageAccount() (*ExistingStorageAccount, bool) + AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) +} + +// StorageAccountCustomDetails storage account custom input. +type StorageAccountCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails', 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicStorageAccountCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicStorageAccountCustomDetails(body []byte) (BasicStorageAccountCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting): + var esa ExistingStorageAccount + err := json.Unmarshal(body, &esa) + return esa, err + default: + var sacd StorageAccountCustomDetails + err := json.Unmarshal(body, &sacd) + return sacd, err + } +} +func unmarshalBasicStorageAccountCustomDetailsArray(body []byte) ([]BasicStorageAccountCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sacdArray := make([]BasicStorageAccountCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sacd, err := unmarshalBasicStorageAccountCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + sacdArray[index] = sacd + } + return sacdArray, nil +} + +// MarshalJSON is the custom marshaler for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) MarshalJSON() ([]byte, error) { + sacd.ResourceType = ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails + objectMap := make(map[string]interface{}) + if sacd.ResourceType != "" { + objectMap["resourceType"] = sacd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingStorageAccount is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsExistingStorageAccount() (*ExistingStorageAccount, bool) { + return nil, false +} + +// AsStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) { + return &sacd, true +} + +// AsBasicStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsBasicStorageAccountCustomDetails() (BasicStorageAccountCustomDetails, bool) { + return &sacd, true +} + +// StorageClassification storage object definition. +type StorageClassification struct { + autorest.Response `json:"-"` + // Properties - Properties of the storage object. + Properties *StorageClassificationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageClassification. +func (sc StorageClassification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sc.Properties != nil { + objectMap["properties"] = sc.Properties + } + if sc.Location != nil { + objectMap["location"] = sc.Location + } + return json.Marshal(objectMap) +} + +// StorageClassificationCollection collection of storage details. +type StorageClassificationCollection struct { + autorest.Response `json:"-"` + // Value - The storage details. + Value *[]StorageClassification `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// StorageClassificationCollectionIterator provides access to a complete listing of StorageClassification +// values. +type StorageClassificationCollectionIterator struct { + i int + page StorageClassificationCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StorageClassificationCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StorageClassificationCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StorageClassificationCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StorageClassificationCollectionIterator) Response() StorageClassificationCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StorageClassificationCollectionIterator) Value() StorageClassification { + if !iter.page.NotDone() { + return StorageClassification{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StorageClassificationCollectionIterator type. +func NewStorageClassificationCollectionIterator(page StorageClassificationCollectionPage) StorageClassificationCollectionIterator { + return StorageClassificationCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scc StorageClassificationCollection) IsEmpty() bool { + return scc.Value == nil || len(*scc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scc StorageClassificationCollection) hasNextLink() bool { + return scc.NextLink != nil && len(*scc.NextLink) != 0 +} + +// storageClassificationCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scc StorageClassificationCollection) storageClassificationCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !scc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scc.NextLink))) +} + +// StorageClassificationCollectionPage contains a page of StorageClassification values. +type StorageClassificationCollectionPage struct { + fn func(context.Context, StorageClassificationCollection) (StorageClassificationCollection, error) + scc StorageClassificationCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StorageClassificationCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.scc) + if err != nil { + return err + } + page.scc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StorageClassificationCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StorageClassificationCollectionPage) NotDone() bool { + return !page.scc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StorageClassificationCollectionPage) Response() StorageClassificationCollection { + return page.scc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StorageClassificationCollectionPage) Values() []StorageClassification { + if page.scc.IsEmpty() { + return nil + } + return *page.scc.Value +} + +// Creates a new instance of the StorageClassificationCollectionPage type. +func NewStorageClassificationCollectionPage(cur StorageClassificationCollection, getNextPage func(context.Context, StorageClassificationCollection) (StorageClassificationCollection, error)) StorageClassificationCollectionPage { + return StorageClassificationCollectionPage{ + fn: getNextPage, + scc: cur, + } +} + +// StorageClassificationMapping storage mapping object. +type StorageClassificationMapping struct { + autorest.Response `json:"-"` + // Properties - Properties of the storage mapping object. + Properties *StorageClassificationMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageClassificationMapping. +func (scm StorageClassificationMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scm.Properties != nil { + objectMap["properties"] = scm.Properties + } + if scm.Location != nil { + objectMap["location"] = scm.Location + } + return json.Marshal(objectMap) +} + +// StorageClassificationMappingCollection collection of storage mapping details. +type StorageClassificationMappingCollection struct { + autorest.Response `json:"-"` + // Value - The storage details. + Value *[]StorageClassificationMapping `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// StorageClassificationMappingCollectionIterator provides access to a complete listing of +// StorageClassificationMapping values. +type StorageClassificationMappingCollectionIterator struct { + i int + page StorageClassificationMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StorageClassificationMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StorageClassificationMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StorageClassificationMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StorageClassificationMappingCollectionIterator) Response() StorageClassificationMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StorageClassificationMappingCollectionIterator) Value() StorageClassificationMapping { + if !iter.page.NotDone() { + return StorageClassificationMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StorageClassificationMappingCollectionIterator type. +func NewStorageClassificationMappingCollectionIterator(page StorageClassificationMappingCollectionPage) StorageClassificationMappingCollectionIterator { + return StorageClassificationMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scmc StorageClassificationMappingCollection) IsEmpty() bool { + return scmc.Value == nil || len(*scmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scmc StorageClassificationMappingCollection) hasNextLink() bool { + return scmc.NextLink != nil && len(*scmc.NextLink) != 0 +} + +// storageClassificationMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scmc StorageClassificationMappingCollection) storageClassificationMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !scmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scmc.NextLink))) +} + +// StorageClassificationMappingCollectionPage contains a page of StorageClassificationMapping values. +type StorageClassificationMappingCollectionPage struct { + fn func(context.Context, StorageClassificationMappingCollection) (StorageClassificationMappingCollection, error) + scmc StorageClassificationMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StorageClassificationMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.scmc) + if err != nil { + return err + } + page.scmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StorageClassificationMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StorageClassificationMappingCollectionPage) NotDone() bool { + return !page.scmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StorageClassificationMappingCollectionPage) Response() StorageClassificationMappingCollection { + return page.scmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StorageClassificationMappingCollectionPage) Values() []StorageClassificationMapping { + if page.scmc.IsEmpty() { + return nil + } + return *page.scmc.Value +} + +// Creates a new instance of the StorageClassificationMappingCollectionPage type. +func NewStorageClassificationMappingCollectionPage(cur StorageClassificationMappingCollection, getNextPage func(context.Context, StorageClassificationMappingCollection) (StorageClassificationMappingCollection, error)) StorageClassificationMappingCollectionPage { + return StorageClassificationMappingCollectionPage{ + fn: getNextPage, + scmc: cur, + } +} + +// StorageClassificationMappingInput storage mapping input. +type StorageClassificationMappingInput struct { + // Properties - Storage mapping input properties. + Properties *StorageMappingInputProperties `json:"properties,omitempty"` +} + +// StorageClassificationMappingProperties storage mapping properties. +type StorageClassificationMappingProperties struct { + // TargetStorageClassificationID - Target storage object Id. + TargetStorageClassificationID *string `json:"targetStorageClassificationId,omitempty"` +} + +// StorageClassificationProperties storage object properties. +type StorageClassificationProperties struct { + // FriendlyName - Friendly name of the Storage classification. + FriendlyName *string `json:"friendlyName,omitempty"` +} + +// StorageMappingInputProperties storage mapping input properties. +type StorageMappingInputProperties struct { + // TargetStorageClassificationID - The ID of the storage object. + TargetStorageClassificationID *string `json:"targetStorageClassificationId,omitempty"` +} + +// Subnet subnets of the network. +type Subnet struct { + // Name - The subnet name. + Name *string `json:"name,omitempty"` + // FriendlyName - The subnet friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // AddressList - The list of addresses for the subnet. + AddressList *[]string `json:"addressList,omitempty"` +} + +// SupportedOperatingSystems supported operating systems. +type SupportedOperatingSystems struct { + autorest.Response `json:"-"` + // Properties - The supported operating systems properties. + Properties *SupportedOSProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for SupportedOperatingSystems. +func (sos SupportedOperatingSystems) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sos.Properties != nil { + objectMap["properties"] = sos.Properties + } + if sos.Location != nil { + objectMap["location"] = sos.Location + } + return json.Marshal(objectMap) +} + +// SupportedOSDetails supported operating system details. +type SupportedOSDetails struct { + // OsName - The name. + OsName *string `json:"osName,omitempty"` + // OsType - The type. + OsType *string `json:"osType,omitempty"` + // OsVersions - The list of version for operating system. + OsVersions *[]OSVersionWrapper `json:"osVersions,omitempty"` +} + +// SupportedOSProperties supported operating systems properties. +type SupportedOSProperties struct { + // SupportedOsList - The supported operating systems property list. + SupportedOsList *[]SupportedOSProperty `json:"supportedOsList,omitempty"` +} + +// SupportedOSProperty supported operating systems property. +type SupportedOSProperty struct { + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` + // SupportedOs - The list of supported operating systems. + SupportedOs *[]SupportedOSDetails `json:"supportedOs,omitempty"` +} + +// SwitchProtectionInput switch protection input. +type SwitchProtectionInput struct { + // Properties - Switch protection properties. + Properties *SwitchProtectionInputProperties `json:"properties,omitempty"` +} + +// SwitchProtectionInputProperties switch protection input properties. +type SwitchProtectionInputProperties struct { + // ReplicationProtectedItemName - The unique replication protected item name. + ReplicationProtectedItemName *string `json:"replicationProtectedItemName,omitempty"` + // ProviderSpecificDetails - Provider specific switch protection input. + ProviderSpecificDetails BasicSwitchProtectionProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SwitchProtectionInputProperties struct. +func (spip *SwitchProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "replicationProtectedItemName": + if v != nil { + var replicationProtectedItemName string + err = json.Unmarshal(*v, &replicationProtectedItemName) + if err != nil { + return err + } + spip.ReplicationProtectedItemName = &replicationProtectedItemName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicSwitchProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + spip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// SwitchProtectionJobDetails this class represents details for switch protection job. +type SwitchProtectionJobDetails struct { + // NewReplicationProtectedItemID - ARM Id of the new replication protected item. + NewReplicationProtectedItemID *string `json:"newReplicationProtectedItemId,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) MarshalJSON() ([]byte, error) { + spjd.InstanceType = InstanceTypeSwitchProtectionJobDetails + objectMap := make(map[string]interface{}) + if spjd.NewReplicationProtectedItemID != nil { + objectMap["newReplicationProtectedItemId"] = spjd.NewReplicationProtectedItemID + } + if spjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = spjd.AffectedObjectDetails + } + if spjd.InstanceType != "" { + objectMap["instanceType"] = spjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return &spjd, true +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &spjd, true +} + +// BasicSwitchProtectionProviderSpecificInput provider specific switch protection input. +type BasicSwitchProtectionProviderSpecificInput interface { + AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) + AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) +} + +// SwitchProtectionProviderSpecificInput provider specific switch protection input. +type SwitchProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput', 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicSwitchProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicSwitchProtectionProviderSpecificInput(body []byte) (BasicSwitchProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A): + var aspi A2ASwitchProtectionInput + err := json.Unmarshal(body, &aspi) + return aspi, err + default: + var sppsi SwitchProtectionProviderSpecificInput + err := json.Unmarshal(body, &sppsi) + return sppsi, err + } +} +func unmarshalBasicSwitchProtectionProviderSpecificInputArray(body []byte) ([]BasicSwitchProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sppsiArray := make([]BasicSwitchProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sppsi, err := unmarshalBasicSwitchProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + sppsiArray[index] = sppsi + } + return sppsiArray, nil +} + +// MarshalJSON is the custom marshaler for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + sppsi.InstanceType = InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if sppsi.InstanceType != "" { + objectMap["instanceType"] = sppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ASwitchProtectionInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) { + return nil, false +} + +// AsSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) { + return &sppsi, true +} + +// AsBasicSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsBasicSwitchProtectionProviderSpecificInput() (BasicSwitchProtectionProviderSpecificInput, bool) { + return &sppsi, true +} + +// TargetComputeSize represents applicable recovery vm sizes. +type TargetComputeSize struct { + // ID - The Id. + ID *string `json:"id,omitempty"` + // Name - The name. + Name *string `json:"name,omitempty"` + // Type - The Type of the object. + Type *string `json:"type,omitempty"` + // Properties - The custom data. + Properties *TargetComputeSizeProperties `json:"properties,omitempty"` +} + +// TargetComputeSizeCollection target compute size collection. +type TargetComputeSizeCollection struct { + autorest.Response `json:"-"` + // Value - The list of target compute sizes. + Value *[]TargetComputeSize `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// TargetComputeSizeCollectionIterator provides access to a complete listing of TargetComputeSize values. +type TargetComputeSizeCollectionIterator struct { + i int + page TargetComputeSizeCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *TargetComputeSizeCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizeCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *TargetComputeSizeCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TargetComputeSizeCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter TargetComputeSizeCollectionIterator) Response() TargetComputeSizeCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter TargetComputeSizeCollectionIterator) Value() TargetComputeSize { + if !iter.page.NotDone() { + return TargetComputeSize{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the TargetComputeSizeCollectionIterator type. +func NewTargetComputeSizeCollectionIterator(page TargetComputeSizeCollectionPage) TargetComputeSizeCollectionIterator { + return TargetComputeSizeCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (tcsc TargetComputeSizeCollection) IsEmpty() bool { + return tcsc.Value == nil || len(*tcsc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (tcsc TargetComputeSizeCollection) hasNextLink() bool { + return tcsc.NextLink != nil && len(*tcsc.NextLink) != 0 +} + +// targetComputeSizeCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tcsc TargetComputeSizeCollection) targetComputeSizeCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !tcsc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(tcsc.NextLink))) +} + +// TargetComputeSizeCollectionPage contains a page of TargetComputeSize values. +type TargetComputeSizeCollectionPage struct { + fn func(context.Context, TargetComputeSizeCollection) (TargetComputeSizeCollection, error) + tcsc TargetComputeSizeCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *TargetComputeSizeCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizeCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.tcsc) + if err != nil { + return err + } + page.tcsc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *TargetComputeSizeCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TargetComputeSizeCollectionPage) NotDone() bool { + return !page.tcsc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TargetComputeSizeCollectionPage) Response() TargetComputeSizeCollection { + return page.tcsc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TargetComputeSizeCollectionPage) Values() []TargetComputeSize { + if page.tcsc.IsEmpty() { + return nil + } + return *page.tcsc.Value +} + +// Creates a new instance of the TargetComputeSizeCollectionPage type. +func NewTargetComputeSizeCollectionPage(cur TargetComputeSizeCollection, getNextPage func(context.Context, TargetComputeSizeCollection) (TargetComputeSizeCollection, error)) TargetComputeSizeCollectionPage { + return TargetComputeSizeCollectionPage{ + fn: getNextPage, + tcsc: cur, + } +} + +// TargetComputeSizeProperties represents applicable recovery vm sizes properties. +type TargetComputeSizeProperties struct { + // Name - Target compute size name. + Name *string `json:"name,omitempty"` + // FriendlyName - Target compute size display name. + FriendlyName *string `json:"friendlyName,omitempty"` + // CPUCoresCount - The maximum cpu cores count supported by target compute size. + CPUCoresCount *int32 `json:"cpuCoresCount,omitempty"` + // VCPUsAvailable - READ-ONLY; The Available vCPUs supported by target compute size. + VCPUsAvailable *int32 `json:"vCPUsAvailable,omitempty"` + // MemoryInGB - The maximum memory in GB supported by target compute size. + MemoryInGB *float64 `json:"memoryInGB,omitempty"` + // MaxDataDiskCount - The maximum data disks count supported by target compute size. + MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` + // MaxNicsCount - The maximum Nics count supported by target compute size. + MaxNicsCount *int32 `json:"maxNicsCount,omitempty"` + // Errors - The reasons why the target compute size is not applicable for the protected item. + Errors *[]ComputeSizeErrorDetails `json:"errors,omitempty"` + // HighIopsSupported - The value indicating whether the target compute size supports high Iops. + HighIopsSupported *string `json:"highIopsSupported,omitempty"` + // HyperVGenerations - The supported HyperV Generations. + HyperVGenerations *[]string `json:"hyperVGenerations,omitempty"` +} + +// MarshalJSON is the custom marshaler for TargetComputeSizeProperties. +func (tcsp TargetComputeSizeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tcsp.Name != nil { + objectMap["name"] = tcsp.Name + } + if tcsp.FriendlyName != nil { + objectMap["friendlyName"] = tcsp.FriendlyName + } + if tcsp.CPUCoresCount != nil { + objectMap["cpuCoresCount"] = tcsp.CPUCoresCount + } + if tcsp.MemoryInGB != nil { + objectMap["memoryInGB"] = tcsp.MemoryInGB + } + if tcsp.MaxDataDiskCount != nil { + objectMap["maxDataDiskCount"] = tcsp.MaxDataDiskCount + } + if tcsp.MaxNicsCount != nil { + objectMap["maxNicsCount"] = tcsp.MaxNicsCount + } + if tcsp.Errors != nil { + objectMap["errors"] = tcsp.Errors + } + if tcsp.HighIopsSupported != nil { + objectMap["highIopsSupported"] = tcsp.HighIopsSupported + } + if tcsp.HyperVGenerations != nil { + objectMap["hyperVGenerations"] = tcsp.HyperVGenerations + } + return json.Marshal(objectMap) +} + +// BasicTaskTypeDetails task details based on specific task type. +type BasicTaskTypeDetails interface { + AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) + AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) + AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) + AsJobTaskDetails() (*JobTaskDetails, bool) + AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) + AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) + AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) + AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) + AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) + AsTaskTypeDetails() (*TaskTypeDetails, bool) +} + +// TaskTypeDetails task details based on specific task type. +type TaskTypeDetails struct { + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicTaskTypeDetails(body []byte) (BasicTaskTypeDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAutomationRunbookTaskDetails): + var artd AutomationRunbookTaskDetails + err := json.Unmarshal(body, &artd) + return artd, err + case string(InstanceTypeConsistencyCheckTaskDetails): + var cctd ConsistencyCheckTaskDetails + err := json.Unmarshal(body, &cctd) + return cctd, err + case string(InstanceTypeFabricReplicationGroupTaskDetails): + var frgtd FabricReplicationGroupTaskDetails + err := json.Unmarshal(body, &frgtd) + return frgtd, err + case string(InstanceTypeJobTaskDetails): + var jtd JobTaskDetails + err := json.Unmarshal(body, &jtd) + return jtd, err + case string(InstanceTypeManualActionTaskDetails): + var matd ManualActionTaskDetails + err := json.Unmarshal(body, &matd) + return matd, err + case string(InstanceTypeScriptActionTaskDetails): + var satd ScriptActionTaskDetails + err := json.Unmarshal(body, &satd) + return satd, err + case string(InstanceTypeVirtualMachineTaskDetails): + var vmtd VirtualMachineTaskDetails + err := json.Unmarshal(body, &vmtd) + return vmtd, err + case string(InstanceTypeVMNicUpdatesTaskDetails): + var vnutd VMNicUpdatesTaskDetails + err := json.Unmarshal(body, &vnutd) + return vnutd, err + default: + var ttd TaskTypeDetails + err := json.Unmarshal(body, &ttd) + return ttd, err + } +} +func unmarshalBasicTaskTypeDetailsArray(body []byte) ([]BasicTaskTypeDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ttdArray := make([]BasicTaskTypeDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ttd, err := unmarshalBasicTaskTypeDetails(*rawMessage) + if err != nil { + return nil, err + } + ttdArray[index] = ttd + } + return ttdArray, nil +} + +// MarshalJSON is the custom marshaler for TaskTypeDetails. +func (ttd TaskTypeDetails) MarshalJSON() ([]byte, error) { + ttd.InstanceType = InstanceTypeTaskTypeDetails + objectMap := make(map[string]interface{}) + if ttd.InstanceType != "" { + objectMap["instanceType"] = ttd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return &ttd, true +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &ttd, true +} + +// TestFailoverCleanupInput input definition for test failover cleanup. +type TestFailoverCleanupInput struct { + // Properties - Test failover cleanup input properties. + Properties *TestFailoverCleanupInputProperties `json:"properties,omitempty"` +} + +// TestFailoverCleanupInputProperties input definition for test failover cleanup input properties. +type TestFailoverCleanupInputProperties struct { + // Comments - Test failover cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// TestFailoverInput input definition for test failover. +type TestFailoverInput struct { + // Properties - Test failover input properties. + Properties *TestFailoverInputProperties `json:"properties,omitempty"` +} + +// TestFailoverInputProperties input definition for test failover input properties. +type TestFailoverInputProperties struct { + // FailoverDirection - Test failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // NetworkType - Network type to be used for test failover. + NetworkType *string `json:"networkType,omitempty"` + // NetworkID - The id of the network to be used for test failover. + NetworkID *string `json:"networkId,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicTestFailoverProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TestFailoverInputProperties struct. +func (tfip *TestFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + tfip.FailoverDirection = &failoverDirection + } + case "networkType": + if v != nil { + var networkType string + err = json.Unmarshal(*v, &networkType) + if err != nil { + return err + } + tfip.NetworkType = &networkType + } + case "networkId": + if v != nil { + var networkID string + err = json.Unmarshal(*v, &networkID) + if err != nil { + return err + } + tfip.NetworkID = &networkID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicTestFailoverProviderSpecificInput(*v) + if err != nil { + return err + } + tfip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// TestFailoverJobDetails this class represents the details for a test failover job. +type TestFailoverJobDetails struct { + // TestFailoverStatus - The test failover status. + TestFailoverStatus *string `json:"testFailoverStatus,omitempty"` + // Comments - The test failover comments. + Comments *string `json:"comments,omitempty"` + // NetworkName - The test network name. + NetworkName *string `json:"networkName,omitempty"` + // NetworkFriendlyName - The test network friendly name. + NetworkFriendlyName *string `json:"networkFriendlyName,omitempty"` + // NetworkType - The test network type (see TestFailoverInput enum for possible values). + NetworkType *string `json:"networkType,omitempty"` + // ProtectedItemDetails - The test VM details. + ProtectedItemDetails *[]FailoverReplicationProtectedItemDetails `json:"protectedItemDetails,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) MarshalJSON() ([]byte, error) { + tfjd.InstanceType = InstanceTypeTestFailoverJobDetails + objectMap := make(map[string]interface{}) + if tfjd.TestFailoverStatus != nil { + objectMap["testFailoverStatus"] = tfjd.TestFailoverStatus + } + if tfjd.Comments != nil { + objectMap["comments"] = tfjd.Comments + } + if tfjd.NetworkName != nil { + objectMap["networkName"] = tfjd.NetworkName + } + if tfjd.NetworkFriendlyName != nil { + objectMap["networkFriendlyName"] = tfjd.NetworkFriendlyName + } + if tfjd.NetworkType != nil { + objectMap["networkType"] = tfjd.NetworkType + } + if tfjd.ProtectedItemDetails != nil { + objectMap["protectedItemDetails"] = tfjd.ProtectedItemDetails + } + if tfjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = tfjd.AffectedObjectDetails + } + if tfjd.InstanceType != "" { + objectMap["instanceType"] = tfjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return &tfjd, true +} + +// AsJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &tfjd, true +} + +// BasicTestFailoverProviderSpecificInput provider specific test failover input. +type BasicTestFailoverProviderSpecificInput interface { + AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) + AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) + AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) + AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) + AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) + AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) +} + +// TestFailoverProviderSpecificInput provider specific test failover input. +type TestFailoverProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicTestFailoverProviderSpecificInput(body []byte) (BasicTestFailoverProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A): + var atfi A2ATestFailoverInput + err := json.Unmarshal(body, &atfi) + return atfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvratfi HyperVReplicaAzureTestFailoverInput + err := json.Unmarshal(body, &hvratfi) + return hvratfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2): + var imavtfi InMageAzureV2TestFailoverInput + err := json.Unmarshal(body, &imavtfi) + return imavtfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm): + var imrtfi InMageRcmTestFailoverInput + err := json.Unmarshal(body, &imrtfi) + return imrtfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage): + var imtfi InMageTestFailoverInput + err := json.Unmarshal(body, &imtfi) + return imtfi, err + default: + var tfpsi TestFailoverProviderSpecificInput + err := json.Unmarshal(body, &tfpsi) + return tfpsi, err + } +} +func unmarshalBasicTestFailoverProviderSpecificInputArray(body []byte) ([]BasicTestFailoverProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tfpsiArray := make([]BasicTestFailoverProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + tfpsi, err := unmarshalBasicTestFailoverProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + tfpsiArray[index] = tfpsi + } + return tfpsiArray, nil +} + +// MarshalJSON is the custom marshaler for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) MarshalJSON() ([]byte, error) { + tfpsi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput + objectMap := make(map[string]interface{}) + if tfpsi.InstanceType != "" { + objectMap["instanceType"] = tfpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return &tfpsi, true +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &tfpsi, true +} + +// TestMigrateCleanupInput input for test migrate cleanup. +type TestMigrateCleanupInput struct { + // Properties - Test migrate cleanup input properties. + Properties *TestMigrateCleanupInputProperties `json:"properties,omitempty"` +} + +// TestMigrateCleanupInputProperties test migrate cleanup input properties. +type TestMigrateCleanupInputProperties struct { + // Comments - Test migrate cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// TestMigrateInput input for test migrate. +type TestMigrateInput struct { + // Properties - Test migrate input properties. + Properties *TestMigrateInputProperties `json:"properties,omitempty"` +} + +// TestMigrateInputProperties test migrate input properties. +type TestMigrateInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicTestMigrateProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TestMigrateInputProperties struct. +func (tmip *TestMigrateInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicTestMigrateProviderSpecificInput(*v) + if err != nil { + return err + } + tmip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicTestMigrateProviderSpecificInput test migrate provider specific input. +type BasicTestMigrateProviderSpecificInput interface { + AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) + AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) +} + +// TestMigrateProviderSpecificInput test migrate provider specific input. +type TestMigrateProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput', 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicTestMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicTestMigrateProviderSpecificInput(body []byte) (BasicTestMigrateProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt): + var vmctmi VMwareCbtTestMigrateInput + err := json.Unmarshal(body, &vmctmi) + return vmctmi, err + default: + var tmpsi TestMigrateProviderSpecificInput + err := json.Unmarshal(body, &tmpsi) + return tmpsi, err + } +} +func unmarshalBasicTestMigrateProviderSpecificInputArray(body []byte) ([]BasicTestMigrateProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tmpsiArray := make([]BasicTestMigrateProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + tmpsi, err := unmarshalBasicTestMigrateProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + tmpsiArray[index] = tmpsi + } + return tmpsiArray, nil +} + +// MarshalJSON is the custom marshaler for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) MarshalJSON() ([]byte, error) { + tmpsi.InstanceType = InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput + objectMap := make(map[string]interface{}) + if tmpsi.InstanceType != "" { + objectMap["instanceType"] = tmpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtTestMigrateInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) { + return nil, false +} + +// AsTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) { + return &tmpsi, true +} + +// AsBasicTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsBasicTestMigrateProviderSpecificInput() (BasicTestMigrateProviderSpecificInput, bool) { + return &tmpsi, true +} + +// UnplannedFailoverInput input definition for unplanned failover. +type UnplannedFailoverInput struct { + // Properties - Unplanned failover input properties. + Properties *UnplannedFailoverInputProperties `json:"properties,omitempty"` +} + +// UnplannedFailoverInputProperties input definition for unplanned failover input properties. +type UnplannedFailoverInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // SourceSiteOperations - Source site operations status. + SourceSiteOperations *string `json:"sourceSiteOperations,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicUnplannedFailoverProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UnplannedFailoverInputProperties struct. +func (ufip *UnplannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + ufip.FailoverDirection = &failoverDirection + } + case "sourceSiteOperations": + if v != nil { + var sourceSiteOperations string + err = json.Unmarshal(*v, &sourceSiteOperations) + if err != nil { + return err + } + ufip.SourceSiteOperations = &sourceSiteOperations + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUnplannedFailoverProviderSpecificInput(*v) + if err != nil { + return err + } + ufip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUnplannedFailoverProviderSpecificInput provider specific unplanned failover input. +type BasicUnplannedFailoverProviderSpecificInput interface { + AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) + AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) + AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) + AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) + AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) + AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) +} + +// UnplannedFailoverProviderSpecificInput provider specific unplanned failover input. +type UnplannedFailoverProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUnplannedFailoverProviderSpecificInput(body []byte) (BasicUnplannedFailoverProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A): + var aufi A2AUnplannedFailoverInput + err := json.Unmarshal(body, &aufi) + return aufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraufi HyperVReplicaAzureUnplannedFailoverInput + err := json.Unmarshal(body, &hvraufi) + return hvraufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2): + var imavufi InMageAzureV2UnplannedFailoverInput + err := json.Unmarshal(body, &imavufi) + return imavufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm): + var imrufi InMageRcmUnplannedFailoverInput + err := json.Unmarshal(body, &imrufi) + return imrufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage): + var imufi InMageUnplannedFailoverInput + err := json.Unmarshal(body, &imufi) + return imufi, err + default: + var ufpsi UnplannedFailoverProviderSpecificInput + err := json.Unmarshal(body, &ufpsi) + return ufpsi, err + } +} +func unmarshalBasicUnplannedFailoverProviderSpecificInputArray(body []byte) ([]BasicUnplannedFailoverProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ufpsiArray := make([]BasicUnplannedFailoverProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ufpsi, err := unmarshalBasicUnplannedFailoverProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + ufpsiArray[index] = ufpsi + } + return ufpsiArray, nil +} + +// MarshalJSON is the custom marshaler for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) MarshalJSON() ([]byte, error) { + ufpsi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput + objectMap := make(map[string]interface{}) + if ufpsi.InstanceType != "" { + objectMap["instanceType"] = ufpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return &ufpsi, true +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &ufpsi, true +} + +// UpdateApplianceForReplicationProtectedItemInput update appliance for replication protected item input. +type UpdateApplianceForReplicationProtectedItemInput struct { + // Properties - Update appliance replication protected item properties. + Properties *UpdateApplianceForReplicationProtectedItemInputProperties `json:"properties,omitempty"` +} + +// UpdateApplianceForReplicationProtectedItemInputProperties update appliance for protected item input +// properties. +type UpdateApplianceForReplicationProtectedItemInputProperties struct { + // TargetApplianceID - The target appliance Id. + TargetApplianceID *string `json:"targetApplianceId,omitempty"` + // ProviderSpecificDetails - The provider specific input to update replication protected item. + ProviderSpecificDetails BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateApplianceForReplicationProtectedItemInputProperties struct. +func (uafrpiip *UpdateApplianceForReplicationProtectedItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetApplianceId": + if v != nil { + var targetApplianceID string + err = json.Unmarshal(*v, &targetApplianceID) + if err != nil { + return err + } + uafrpiip.TargetApplianceID = &targetApplianceID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput(*v) + if err != nil { + return err + } + uafrpiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput update replication protected item provider +// specific input. +type BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput interface { + AsInMageRcmUpdateApplianceForReplicationProtectedItemInput() (*InMageRcmUpdateApplianceForReplicationProtectedItemInput, bool) + AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (*UpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) +} + +// UpdateApplianceForReplicationProtectedItemProviderSpecificInput update replication protected item provider +// specific input. +type UpdateApplianceForReplicationProtectedItemProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput', 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput(body []byte) (BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm): + var imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput + err := json.Unmarshal(body, &imruafrpii) + return imruafrpii, err + default: + var uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput + err := json.Unmarshal(body, &uafrpipsi) + return uafrpipsi, err + } +} +func unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputArray(body []byte) ([]BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + uafrpipsiArray := make([]BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + uafrpipsi, err := unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + uafrpipsiArray[index] = uafrpipsi + } + return uafrpipsiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) MarshalJSON() ([]byte, error) { + uafrpipsi.InstanceType = InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput + objectMap := make(map[string]interface{}) + if uafrpipsi.InstanceType != "" { + objectMap["instanceType"] = uafrpipsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageRcmUpdateApplianceForReplicationProtectedItemInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) AsInMageRcmUpdateApplianceForReplicationProtectedItemInput() (*InMageRcmUpdateApplianceForReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (*UpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return &uafrpipsi, true +} + +// AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return &uafrpipsi, true +} + +// UpdateDiskInput disk input for update. +type UpdateDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // TargetDiskName - The target disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// UpdateMigrationItemInput update migration item input. +type UpdateMigrationItemInput struct { + // Properties - Update migration item input properties. + Properties *UpdateMigrationItemInputProperties `json:"properties,omitempty"` +} + +// UpdateMigrationItemInputProperties update migration item input properties. +type UpdateMigrationItemInputProperties struct { + // ProviderSpecificDetails - The provider specific input to update migration item. + ProviderSpecificDetails BasicUpdateMigrationItemProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateMigrationItemInputProperties struct. +func (umiip *UpdateMigrationItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateMigrationItemProviderSpecificInput(*v) + if err != nil { + return err + } + umiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateMigrationItemProviderSpecificInput update migration item provider specific input. +type BasicUpdateMigrationItemProviderSpecificInput interface { + AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) + AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) +} + +// UpdateMigrationItemProviderSpecificInput update migration item provider specific input. +type UpdateMigrationItemProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput', 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicUpdateMigrationItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateMigrationItemProviderSpecificInput(body []byte) (BasicUpdateMigrationItemProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt): + var vmcumii VMwareCbtUpdateMigrationItemInput + err := json.Unmarshal(body, &vmcumii) + return vmcumii, err + default: + var umipsi UpdateMigrationItemProviderSpecificInput + err := json.Unmarshal(body, &umipsi) + return umipsi, err + } +} +func unmarshalBasicUpdateMigrationItemProviderSpecificInputArray(body []byte) ([]BasicUpdateMigrationItemProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + umipsiArray := make([]BasicUpdateMigrationItemProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + umipsi, err := unmarshalBasicUpdateMigrationItemProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + umipsiArray[index] = umipsi + } + return umipsiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) MarshalJSON() ([]byte, error) { + umipsi.InstanceType = InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput + objectMap := make(map[string]interface{}) + if umipsi.InstanceType != "" { + objectMap["instanceType"] = umipsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtUpdateMigrationItemInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) { + return nil, false +} + +// AsUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) { + return &umipsi, true +} + +// AsBasicUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsBasicUpdateMigrationItemProviderSpecificInput() (BasicUpdateMigrationItemProviderSpecificInput, bool) { + return &umipsi, true +} + +// UpdateMobilityServiceRequest request to update the mobility service on a protected item. +type UpdateMobilityServiceRequest struct { + // Properties - The properties of the update mobility service request. + Properties *UpdateMobilityServiceRequestProperties `json:"properties,omitempty"` +} + +// UpdateMobilityServiceRequestProperties the properties of an update mobility service request. +type UpdateMobilityServiceRequestProperties struct { + // RunAsAccountID - The CS run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// UpdateNetworkMappingInput update network mapping input. +type UpdateNetworkMappingInput struct { + // Properties - The input properties needed to update network mapping. + Properties *UpdateNetworkMappingInputProperties `json:"properties,omitempty"` +} + +// UpdateNetworkMappingInputProperties common input details for network mapping operation. +type UpdateNetworkMappingInputProperties struct { + // RecoveryFabricName - Recovery fabric name. + RecoveryFabricName *string `json:"recoveryFabricName,omitempty"` + // RecoveryNetworkID - Recovery network Id. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // FabricSpecificDetails - Fabrics specific input network Id. + FabricSpecificDetails BasicFabricSpecificUpdateNetworkMappingInput `json:"fabricSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateNetworkMappingInputProperties struct. +func (unmip *UpdateNetworkMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryFabricName": + if v != nil { + var recoveryFabricName string + err = json.Unmarshal(*v, &recoveryFabricName) + if err != nil { + return err + } + unmip.RecoveryFabricName = &recoveryFabricName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + unmip.RecoveryNetworkID = &recoveryNetworkID + } + case "fabricSpecificDetails": + if v != nil { + fabricSpecificDetails, err := unmarshalBasicFabricSpecificUpdateNetworkMappingInput(*v) + if err != nil { + return err + } + unmip.FabricSpecificDetails = fabricSpecificDetails + } + } + } + + return nil +} + +// UpdatePolicyInput update policy input. +type UpdatePolicyInput struct { + // Properties - The ReplicationProviderSettings. + Properties *UpdatePolicyInputProperties `json:"properties,omitempty"` +} + +// UpdatePolicyInputProperties policy update properties. +type UpdatePolicyInputProperties struct { + // ReplicationProviderSettings - The ReplicationProviderSettings. + ReplicationProviderSettings BasicPolicyProviderSpecificInput `json:"replicationProviderSettings,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdatePolicyInputProperties struct. +func (upip *UpdatePolicyInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "replicationProviderSettings": + if v != nil { + replicationProviderSettings, err := unmarshalBasicPolicyProviderSpecificInput(*v) + if err != nil { + return err + } + upip.ReplicationProviderSettings = replicationProviderSettings + } + } + } + + return nil +} + +// UpdateProtectionContainerMappingInput container pairing update input. +type UpdateProtectionContainerMappingInput struct { + // Properties - Update protection container mapping input properties. + Properties *UpdateProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// UpdateProtectionContainerMappingInputProperties container pairing update input. +type UpdateProtectionContainerMappingInputProperties struct { + // ProviderSpecificInput - Provider specific input for updating protection container mapping. + ProviderSpecificInput BasicReplicationProviderSpecificUpdateContainerMappingInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateProtectionContainerMappingInputProperties struct. +func (upcmip *UpdateProtectionContainerMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(*v) + if err != nil { + return err + } + upcmip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// UpdateRecoveryPlanInput update recovery plan input class. +type UpdateRecoveryPlanInput struct { + // Properties - Recovery plan update properties. + Properties *UpdateRecoveryPlanInputProperties `json:"properties,omitempty"` +} + +// UpdateRecoveryPlanInputProperties recovery plan update properties. +type UpdateRecoveryPlanInputProperties struct { + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` +} + +// UpdateReplicationProtectedItemInput update replication protected item input. +type UpdateReplicationProtectedItemInput struct { + // Properties - Update replication protected item properties. + Properties *UpdateReplicationProtectedItemInputProperties `json:"properties,omitempty"` +} + +// UpdateReplicationProtectedItemInputProperties update protected item input properties. +type UpdateReplicationProtectedItemInputProperties struct { + // RecoveryAzureVMName - Target Azure VM name given by the user. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureVMSize - Target Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // SelectedRecoveryAzureNetworkID - Target Azure Network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The Azure Network Id for test failover. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // VMNics - The list of VM nic details. + VMNics *[]VMNicInputDetails `json:"vmNics,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // RecoveryAvailabilitySetID - The target availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // ProviderSpecificDetails - The provider specific input to update replication protected item. + ProviderSpecificDetails BasicUpdateReplicationProtectedItemProviderInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateReplicationProtectedItemInputProperties struct. +func (urpiip *UpdateReplicationProtectedItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryAzureVMName": + if v != nil { + var recoveryAzureVMName string + err = json.Unmarshal(*v, &recoveryAzureVMName) + if err != nil { + return err + } + urpiip.RecoveryAzureVMName = &recoveryAzureVMName + } + case "recoveryAzureVMSize": + if v != nil { + var recoveryAzureVMSize string + err = json.Unmarshal(*v, &recoveryAzureVMSize) + if err != nil { + return err + } + urpiip.RecoveryAzureVMSize = &recoveryAzureVMSize + } + case "selectedRecoveryAzureNetworkId": + if v != nil { + var selectedRecoveryAzureNetworkID string + err = json.Unmarshal(*v, &selectedRecoveryAzureNetworkID) + if err != nil { + return err + } + urpiip.SelectedRecoveryAzureNetworkID = &selectedRecoveryAzureNetworkID + } + case "selectedTfoAzureNetworkId": + if v != nil { + var selectedTfoAzureNetworkID string + err = json.Unmarshal(*v, &selectedTfoAzureNetworkID) + if err != nil { + return err + } + urpiip.SelectedTfoAzureNetworkID = &selectedTfoAzureNetworkID + } + case "selectedSourceNicId": + if v != nil { + var selectedSourceNicID string + err = json.Unmarshal(*v, &selectedSourceNicID) + if err != nil { + return err + } + urpiip.SelectedSourceNicID = &selectedSourceNicID + } + case "enableRdpOnTargetOption": + if v != nil { + var enableRdpOnTargetOption string + err = json.Unmarshal(*v, &enableRdpOnTargetOption) + if err != nil { + return err + } + urpiip.EnableRdpOnTargetOption = &enableRdpOnTargetOption + } + case "vmNics": + if v != nil { + var VMNics []VMNicInputDetails + err = json.Unmarshal(*v, &VMNics) + if err != nil { + return err + } + urpiip.VMNics = &VMNics + } + case "licenseType": + if v != nil { + var licenseType LicenseType + err = json.Unmarshal(*v, &licenseType) + if err != nil { + return err + } + urpiip.LicenseType = licenseType + } + case "recoveryAvailabilitySetId": + if v != nil { + var recoveryAvailabilitySetID string + err = json.Unmarshal(*v, &recoveryAvailabilitySetID) + if err != nil { + return err + } + urpiip.RecoveryAvailabilitySetID = &recoveryAvailabilitySetID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateReplicationProtectedItemProviderInput(*v) + if err != nil { + return err + } + urpiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateReplicationProtectedItemProviderInput update replication protected item provider specific input. +type BasicUpdateReplicationProtectedItemProviderInput interface { + AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) + AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) + AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) + AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) + AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) +} + +// UpdateReplicationProtectedItemProviderInput update replication protected item provider specific input. +type UpdateReplicationProtectedItemProviderInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateReplicationProtectedItemProviderInput(body []byte) (BasicUpdateReplicationProtectedItemProviderInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A): + var aurpii A2AUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &aurpii) + return aurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure): + var hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &hvraurpii) + return hvraurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2): + var imavurpii InMageAzureV2UpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &imavurpii) + return imavurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm): + var imrurpii InMageRcmUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &imrurpii) + return imrurpii, err + default: + var urpipi UpdateReplicationProtectedItemProviderInput + err := json.Unmarshal(body, &urpipi) + return urpipi, err + } +} +func unmarshalBasicUpdateReplicationProtectedItemProviderInputArray(body []byte) ([]BasicUpdateReplicationProtectedItemProviderInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + urpipiArray := make([]BasicUpdateReplicationProtectedItemProviderInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + urpipi, err := unmarshalBasicUpdateReplicationProtectedItemProviderInput(*rawMessage) + if err != nil { + return nil, err + } + urpipiArray[index] = urpipi + } + return urpipiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) MarshalJSON() ([]byte, error) { + urpipi.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput + objectMap := make(map[string]interface{}) + if urpipi.InstanceType != "" { + objectMap["instanceType"] = urpipi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return &urpipi, true +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &urpipi, true +} + +// UpdateVCenterRequest input required to update vCenter. +type UpdateVCenterRequest struct { + // Properties - The update VCenter Request Properties. + Properties *UpdateVCenterRequestProperties `json:"properties,omitempty"` +} + +// UpdateVCenterRequestProperties the properties of an update vCenter request. +type UpdateVCenterRequestProperties struct { + // FriendlyName - The friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the vCenter to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // ProcessServerID - The process server Id from where the update can be orchestrated. + ProcessServerID *string `json:"processServerId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The CS account Id which has privileges to update the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// VaultHealthDetails vault health details definition. +type VaultHealthDetails struct { + autorest.Response `json:"-"` + // Properties - The vault health related data. + Properties *VaultHealthProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VaultHealthDetails. +func (vhd VaultHealthDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vhd.Properties != nil { + objectMap["properties"] = vhd.Properties + } + if vhd.Location != nil { + objectMap["location"] = vhd.Location + } + return json.Marshal(objectMap) +} + +// VaultHealthProperties class to define the health summary of the Vault. +type VaultHealthProperties struct { + // VaultErrors - The list of errors on the vault. + VaultErrors *[]HealthError `json:"vaultErrors,omitempty"` + // ProtectedItemsHealth - The list of the health detail of the protected items in the vault. + ProtectedItemsHealth *ResourceHealthSummary `json:"protectedItemsHealth,omitempty"` + // FabricsHealth - The list of the health detail of the fabrics in the vault. + FabricsHealth *ResourceHealthSummary `json:"fabricsHealth,omitempty"` + // ContainersHealth - The list of the health detail of the containers in the vault. + ContainersHealth *ResourceHealthSummary `json:"containersHealth,omitempty"` +} + +// VaultSetting vault setting. +type VaultSetting struct { + autorest.Response `json:"-"` + // Properties - The vault setting properties. + Properties *VaultSettingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VaultSetting. +func (vs VaultSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vs.Properties != nil { + objectMap["properties"] = vs.Properties + } + if vs.Location != nil { + objectMap["location"] = vs.Location + } + return json.Marshal(objectMap) +} + +// VaultSettingCollection vault setting collection. +type VaultSettingCollection struct { + autorest.Response `json:"-"` + // Value - The list of vault setting. + Value *[]VaultSetting `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// VaultSettingCollectionIterator provides access to a complete listing of VaultSetting values. +type VaultSettingCollectionIterator struct { + i int + page VaultSettingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VaultSettingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VaultSettingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VaultSettingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VaultSettingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VaultSettingCollectionIterator) Response() VaultSettingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VaultSettingCollectionIterator) Value() VaultSetting { + if !iter.page.NotDone() { + return VaultSetting{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VaultSettingCollectionIterator type. +func NewVaultSettingCollectionIterator(page VaultSettingCollectionPage) VaultSettingCollectionIterator { + return VaultSettingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vsc VaultSettingCollection) IsEmpty() bool { + return vsc.Value == nil || len(*vsc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vsc VaultSettingCollection) hasNextLink() bool { + return vsc.NextLink != nil && len(*vsc.NextLink) != 0 +} + +// vaultSettingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vsc VaultSettingCollection) vaultSettingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !vsc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vsc.NextLink))) +} + +// VaultSettingCollectionPage contains a page of VaultSetting values. +type VaultSettingCollectionPage struct { + fn func(context.Context, VaultSettingCollection) (VaultSettingCollection, error) + vsc VaultSettingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VaultSettingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VaultSettingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vsc) + if err != nil { + return err + } + page.vsc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VaultSettingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VaultSettingCollectionPage) NotDone() bool { + return !page.vsc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VaultSettingCollectionPage) Response() VaultSettingCollection { + return page.vsc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VaultSettingCollectionPage) Values() []VaultSetting { + if page.vsc.IsEmpty() { + return nil + } + return *page.vsc.Value +} + +// Creates a new instance of the VaultSettingCollectionPage type. +func NewVaultSettingCollectionPage(cur VaultSettingCollection, getNextPage func(context.Context, VaultSettingCollection) (VaultSettingCollection, error)) VaultSettingCollectionPage { + return VaultSettingCollectionPage{ + fn: getNextPage, + vsc: cur, + } +} + +// VaultSettingCreationInput input to create vault setting. +type VaultSettingCreationInput struct { + // Properties - Vault setting creation input properties. + Properties *VaultSettingCreationInputProperties `json:"properties,omitempty"` +} + +// VaultSettingCreationInputProperties input to create vault setting. +type VaultSettingCreationInputProperties struct { + // MigrationSolutionID - The migration solution Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // VmwareToAzureProviderType - VMware to Azure provider type. + VmwareToAzureProviderType *string `json:"vmwareToAzureProviderType,omitempty"` +} + +// VaultSettingProperties vault setting properties. +type VaultSettingProperties struct { + // MigrationSolutionID - The migration solution ARM Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // VmwareToAzureProviderType - VMware to Azure provider type. + VmwareToAzureProviderType *string `json:"vmwareToAzureProviderType,omitempty"` +} + +// VCenter vCenter definition. +type VCenter struct { + autorest.Response `json:"-"` + // Properties - VCenter related data. + Properties *VCenterProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VCenter. +func (vc VCenter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vc.Properties != nil { + objectMap["properties"] = vc.Properties + } + if vc.Location != nil { + objectMap["location"] = vc.Location + } + return json.Marshal(objectMap) +} + +// VCenterCollection collection of vCenter details. +type VCenterCollection struct { + autorest.Response `json:"-"` + // Value - The vCenter details. + Value *[]VCenter `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// VCenterCollectionIterator provides access to a complete listing of VCenter values. +type VCenterCollectionIterator struct { + i int + page VCenterCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VCenterCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VCenterCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VCenterCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VCenterCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VCenterCollectionIterator) Response() VCenterCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VCenterCollectionIterator) Value() VCenter { + if !iter.page.NotDone() { + return VCenter{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VCenterCollectionIterator type. +func NewVCenterCollectionIterator(page VCenterCollectionPage) VCenterCollectionIterator { + return VCenterCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vcc VCenterCollection) IsEmpty() bool { + return vcc.Value == nil || len(*vcc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vcc VCenterCollection) hasNextLink() bool { + return vcc.NextLink != nil && len(*vcc.NextLink) != 0 +} + +// vCenterCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vcc VCenterCollection) vCenterCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !vcc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vcc.NextLink))) +} + +// VCenterCollectionPage contains a page of VCenter values. +type VCenterCollectionPage struct { + fn func(context.Context, VCenterCollection) (VCenterCollection, error) + vcc VCenterCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VCenterCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VCenterCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vcc) + if err != nil { + return err + } + page.vcc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VCenterCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VCenterCollectionPage) NotDone() bool { + return !page.vcc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VCenterCollectionPage) Response() VCenterCollection { + return page.vcc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VCenterCollectionPage) Values() []VCenter { + if page.vcc.IsEmpty() { + return nil + } + return *page.vcc.Value +} + +// Creates a new instance of the VCenterCollectionPage type. +func NewVCenterCollectionPage(cur VCenterCollection, getNextPage func(context.Context, VCenterCollection) (VCenterCollection, error)) VCenterCollectionPage { + return VCenterCollectionPage{ + fn: getNextPage, + vcc: cur, + } +} + +// VCenterProperties vCenter properties. +type VCenterProperties struct { + // FriendlyName - Friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // InternalID - VCenter internal ID. + InternalID *string `json:"internalId,omitempty"` + // LastHeartbeat - The time when the last heartbeat was received by vCenter. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // DiscoveryStatus - The VCenter discovery status. + DiscoveryStatus *string `json:"discoveryStatus,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // IPAddress - The IP address of the vCenter. + IPAddress *string `json:"ipAddress,omitempty"` + // InfrastructureID - The infrastructure Id of vCenter. + InfrastructureID *string `json:"infrastructureId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The account Id which has privileges to discover the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // FabricArmResourceName - The ARM resource name of the fabric containing this VCenter. + FabricArmResourceName *string `json:"fabricArmResourceName,omitempty"` + // HealthErrors - The health errors for this VCenter. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// VersionDetails version related details. +type VersionDetails struct { + // Version - The agent version. + Version *string `json:"version,omitempty"` + // ExpiryDate - Version expiry date. + ExpiryDate *date.Time `json:"expiryDate,omitempty"` + // Status - A value indicating whether security update required. Possible values include: 'Supported', 'NotSupported', 'Deprecated', 'UpdateRequired', 'SecurityUpdateRequired' + Status AgentVersionStatus `json:"status,omitempty"` +} + +// VirtualMachineTaskDetails this class represents the virtual machine task details. +type VirtualMachineTaskDetails struct { + // SkippedReason - The skipped reason. + SkippedReason *string `json:"skippedReason,omitempty"` + // SkippedReasonString - The skipped reason string. + SkippedReasonString *string `json:"skippedReasonString,omitempty"` + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) MarshalJSON() ([]byte, error) { + vmtd.InstanceType = InstanceTypeVirtualMachineTaskDetails + objectMap := make(map[string]interface{}) + if vmtd.SkippedReason != nil { + objectMap["skippedReason"] = vmtd.SkippedReason + } + if vmtd.SkippedReasonString != nil { + objectMap["skippedReasonString"] = vmtd.SkippedReasonString + } + if vmtd.JobTask != nil { + objectMap["jobTask"] = vmtd.JobTask + } + if vmtd.InstanceType != "" { + objectMap["instanceType"] = vmtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &vmtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return &vmtd, true +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &vmtd, true +} + +// VmmDetails VMM fabric specific details. +type VmmDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmDetails. +func (vd VmmDetails) MarshalJSON() ([]byte, error) { + vd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM + objectMap := make(map[string]interface{}) + if vd.InstanceType != "" { + objectMap["instanceType"] = vd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVmmDetails() (*VmmDetails, bool) { + return &vd, true +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vd, true +} + +// VmmToAzureCreateNetworkMappingInput create network mappings input properties/behavior specific to Vmm to +// Azure Network mapping. +type VmmToAzureCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtacnmi.InstanceType = InstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtacnmi.InstanceType != "" { + objectMap["instanceType"] = vtacnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return &vtacnmi, true +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &vtacnmi, true +} + +// VmmToAzureNetworkMappingSettings e2A Network Mapping fabric specific settings. +type VmmToAzureNetworkMappingSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) MarshalJSON() ([]byte, error) { + vtanms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtanms.InstanceType != "" { + objectMap["instanceType"] = vtanms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return &vtanms, true +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &vtanms, true +} + +// VmmToAzureUpdateNetworkMappingInput update network mappings input properties/behavior specific to vmm to +// azure. +type VmmToAzureUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtaunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtaunmi.InstanceType != "" { + objectMap["instanceType"] = vtaunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return &vtaunmi, true +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &vtaunmi, true +} + +// VmmToVmmCreateNetworkMappingInput create network mappings input properties/behavior specific to vmm to +// vmm Network mapping. +type VmmToVmmCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtvcnmi.InstanceType = InstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvcnmi.InstanceType != "" { + objectMap["instanceType"] = vtvcnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return &vtvcnmi, true +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &vtvcnmi, true +} + +// VmmToVmmNetworkMappingSettings e2E Network Mapping fabric specific settings. +type VmmToVmmNetworkMappingSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) MarshalJSON() ([]byte, error) { + vtvnms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvnms.InstanceType != "" { + objectMap["instanceType"] = vtvnms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return &vtvnms, true +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &vtvnms, true +} + +// VmmToVmmUpdateNetworkMappingInput update network mappings input properties/behavior specific to vmm to +// vmm. +type VmmToVmmUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtvunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvunmi.InstanceType != "" { + objectMap["instanceType"] = vtvunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return &vtvunmi, true +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &vtvunmi, true +} + +// VmmVirtualMachineDetails VMM fabric provider specific VM settings. +type VmmVirtualMachineDetails struct { + // SourceItemID - The source id of the object. + SourceItemID *string `json:"sourceItemId,omitempty"` + // Generation - The id of the object in fabric. + Generation *string `json:"generation,omitempty"` + // OsDetails - The Last replication time. + OsDetails *OSDetails `json:"osDetails,omitempty"` + // DiskDetails - The Last successful failover time. + DiskDetails *[]DiskDetails `json:"diskDetails,omitempty"` + // HasPhysicalDisk - A value indicating whether the VM has a physical disk attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasPhysicalDisk PresenceStatus `json:"hasPhysicalDisk,omitempty"` + // HasFibreChannelAdapter - A value indicating whether the VM has a fibre channel adapter attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasFibreChannelAdapter PresenceStatus `json:"hasFibreChannelAdapter,omitempty"` + // HasSharedVhd - A value indicating whether the VM has a shared VHD attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasSharedVhd PresenceStatus `json:"hasSharedVhd,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) MarshalJSON() ([]byte, error) { + vvmd.InstanceType = InstanceTypeVmmVirtualMachine + objectMap := make(map[string]interface{}) + if vvmd.SourceItemID != nil { + objectMap["sourceItemId"] = vvmd.SourceItemID + } + if vvmd.Generation != nil { + objectMap["generation"] = vvmd.Generation + } + if vvmd.OsDetails != nil { + objectMap["osDetails"] = vvmd.OsDetails + } + if vvmd.DiskDetails != nil { + objectMap["diskDetails"] = vvmd.DiskDetails + } + if vvmd.HasPhysicalDisk != "" { + objectMap["hasPhysicalDisk"] = vvmd.HasPhysicalDisk + } + if vvmd.HasFibreChannelAdapter != "" { + objectMap["hasFibreChannelAdapter"] = vvmd.HasFibreChannelAdapter + } + if vvmd.HasSharedVhd != "" { + objectMap["hasSharedVhd"] = vvmd.HasSharedVhd + } + if vvmd.InstanceType != "" { + objectMap["instanceType"] = vvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return &vvmd, true +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return &vvmd, true +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &vvmd, true +} + +// VMNicDetails hyper V VM network details. +type VMNicDetails struct { + // NicID - The nic Id. + NicID *string `json:"nicId,omitempty"` + // ReplicaNicID - The replica nic Id. + ReplicaNicID *string `json:"replicaNicId,omitempty"` + // SourceNicArmID - The source nic ARM Id. + SourceNicArmID *string `json:"sourceNicArmId,omitempty"` + // VMNetworkName - VM network name. + VMNetworkName *string `json:"vMNetworkName,omitempty"` + // RecoveryVMNetworkID - Recovery VM network Id. + RecoveryVMNetworkID *string `json:"recoveryVMNetworkId,omitempty"` + // IPConfigs - The IP configurations of the NIC. + IPConfigs *[]IPConfigDetails `json:"ipConfigs,omitempty"` + // SelectionType - Selection type for failover. + SelectionType *string `json:"selectionType,omitempty"` + // RecoveryNetworkSecurityGroupID - The id of the NSG associated with the NIC. + RecoveryNetworkSecurityGroupID *string `json:"recoveryNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnRecovery - A value indicating whether the NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnRecovery *bool `json:"enableAcceleratedNetworkingOnRecovery,omitempty"` + // TfoVMNetworkID - The network to be used by NIC during test failover. + TfoVMNetworkID *string `json:"tfoVMNetworkId,omitempty"` + // TfoNetworkSecurityGroupID - The NSG to be used by NIC during test failover. + TfoNetworkSecurityGroupID *string `json:"tfoNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnTfo - Whether the TFO NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnTfo *bool `json:"enableAcceleratedNetworkingOnTfo,omitempty"` + // RecoveryNicName - The name of the NIC to be used when creating target NICs. + RecoveryNicName *string `json:"recoveryNicName,omitempty"` + // RecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs. + RecoveryNicResourceGroupName *string `json:"recoveryNicResourceGroupName,omitempty"` + // ReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during failover subject to availability. + ReuseExistingNic *bool `json:"reuseExistingNic,omitempty"` + // TfoRecoveryNicName - The name of the NIC to be used when creating target NICs in TFO. + TfoRecoveryNicName *string `json:"tfoRecoveryNicName,omitempty"` + // TfoRecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs in TFO. + TfoRecoveryNicResourceGroupName *string `json:"tfoRecoveryNicResourceGroupName,omitempty"` + // TfoReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during test failover subject to availability. + TfoReuseExistingNic *bool `json:"tfoReuseExistingNic,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` +} + +// VMNicInputDetails hyper V VM network input details. +type VMNicInputDetails struct { + // NicID - The nic Id. + NicID *string `json:"nicId,omitempty"` + // IPConfigs - The IP configurations to be used by NIC during test failover and failover. + IPConfigs *[]IPConfigInputDetails `json:"ipConfigs,omitempty"` + // SelectionType - Selection type for failover. + SelectionType *string `json:"selectionType,omitempty"` + // RecoveryNetworkSecurityGroupID - The id of the NSG associated with the NIC. + RecoveryNetworkSecurityGroupID *string `json:"recoveryNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnRecovery - Whether the NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnRecovery *bool `json:"enableAcceleratedNetworkingOnRecovery,omitempty"` + // TfoNetworkSecurityGroupID - The NSG to be used by NIC during test failover. + TfoNetworkSecurityGroupID *string `json:"tfoNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnTfo - Whether the test NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnTfo *bool `json:"enableAcceleratedNetworkingOnTfo,omitempty"` + // RecoveryNicName - The name of the NIC to be used when creating target NICs. + RecoveryNicName *string `json:"recoveryNicName,omitempty"` + // RecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs. + RecoveryNicResourceGroupName *string `json:"recoveryNicResourceGroupName,omitempty"` + // ReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during failover subject to availability. + ReuseExistingNic *bool `json:"reuseExistingNic,omitempty"` + // TfoNicName - The name of the NIC to be used when creating target NICs in TFO. + TfoNicName *string `json:"tfoNicName,omitempty"` + // TfoNicResourceGroupName - The resource group of the NIC to be used when creating target NICs in TFO. + TfoNicResourceGroupName *string `json:"tfoNicResourceGroupName,omitempty"` + // TfoReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during test failover subject to availability. + TfoReuseExistingNic *bool `json:"tfoReuseExistingNic,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` +} + +// VMNicUpdatesTaskDetails this class represents the vm NicUpdates task details. +type VMNicUpdatesTaskDetails struct { + // VMID - Virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // NicID - Nic Id. + NicID *string `json:"nicId,omitempty"` + // Name - Name of the Nic. + Name *string `json:"name,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) MarshalJSON() ([]byte, error) { + vnutd.InstanceType = InstanceTypeVMNicUpdatesTaskDetails + objectMap := make(map[string]interface{}) + if vnutd.VMID != nil { + objectMap["vmId"] = vnutd.VMID + } + if vnutd.NicID != nil { + objectMap["nicId"] = vnutd.NicID + } + if vnutd.Name != nil { + objectMap["name"] = vnutd.Name + } + if vnutd.InstanceType != "" { + objectMap["instanceType"] = vnutd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return &vnutd, true +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &vnutd, true +} + +// VMwareCbtContainerCreationInput vMwareCbt container creation input. +type VMwareCbtContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) MarshalJSON() ([]byte, error) { + vmccci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmccci.InstanceType != "" { + objectMap["instanceType"] = vmccci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return &vmccci, true +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &vmccci, true +} + +// VMwareCbtContainerMappingInput vMwareCbt container mapping input. +type VMwareCbtContainerMappingInput struct { + // KeyVaultID - The target key vault ARM Id. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyVaultURI - The target key vault URL. + KeyVaultURI *string `json:"keyVaultUri,omitempty"` + // StorageAccountID - The storage account ARM Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // StorageAccountSasSecretName - The secret name of the storage account. + StorageAccountSasSecretName *string `json:"storageAccountSasSecretName,omitempty"` + // ServiceBusConnectionStringSecretName - The secret name of the service bus connection string. + ServiceBusConnectionStringSecretName *string `json:"serviceBusConnectionStringSecretName,omitempty"` + // TargetLocation - The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) MarshalJSON() ([]byte, error) { + vmccmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmccmi.KeyVaultID != nil { + objectMap["keyVaultId"] = vmccmi.KeyVaultID + } + if vmccmi.KeyVaultURI != nil { + objectMap["keyVaultUri"] = vmccmi.KeyVaultURI + } + if vmccmi.StorageAccountID != nil { + objectMap["storageAccountId"] = vmccmi.StorageAccountID + } + if vmccmi.StorageAccountSasSecretName != nil { + objectMap["storageAccountSasSecretName"] = vmccmi.StorageAccountSasSecretName + } + if vmccmi.ServiceBusConnectionStringSecretName != nil { + objectMap["serviceBusConnectionStringSecretName"] = vmccmi.ServiceBusConnectionStringSecretName + } + if vmccmi.TargetLocation != nil { + objectMap["targetLocation"] = vmccmi.TargetLocation + } + if vmccmi.InstanceType != "" { + objectMap["instanceType"] = vmccmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return &vmccmi, true +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &vmccmi, true +} + +// VMwareCbtDiskInput vMwareCbt disk input. +type VMwareCbtDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // IsOSDisk - A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // LogStorageAccountSasSecretName - The key vault secret name of the log storage account. + LogStorageAccountSasSecretName *string `json:"logStorageAccountSasSecretName,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// VMwareCbtEnableMigrationInput vMwareCbt specific enable migration input. +type VMwareCbtEnableMigrationInput struct { + // VmwareMachineID - The ARM Id of the VM discovered in VMware. + VmwareMachineID *string `json:"vmwareMachineId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]VMwareCbtDiskInput `json:"disksToInclude,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // DataMoverRunAsAccountID - The data mover run as account Id. + DataMoverRunAsAccountID *string `json:"dataMoverRunAsAccountId,omitempty"` + // SnapshotRunAsAccountID - The snapshot run as account Id. + SnapshotRunAsAccountID *string `json:"snapshotRunAsAccountId,omitempty"` + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TargetSubnetName - The target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedDiskTags - The tags for the seed disks. + SeedDiskTags map[string]*string `json:"seedDiskTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeEnableMigrationProviderSpecificInput', 'InstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEnableMigrationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) MarshalJSON() ([]byte, error) { + vmcemi.InstanceType = InstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcemi.VmwareMachineID != nil { + objectMap["vmwareMachineId"] = vmcemi.VmwareMachineID + } + if vmcemi.DisksToInclude != nil { + objectMap["disksToInclude"] = vmcemi.DisksToInclude + } + if vmcemi.LicenseType != "" { + objectMap["licenseType"] = vmcemi.LicenseType + } + if vmcemi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = vmcemi.SQLServerLicenseType + } + if vmcemi.DataMoverRunAsAccountID != nil { + objectMap["dataMoverRunAsAccountId"] = vmcemi.DataMoverRunAsAccountID + } + if vmcemi.SnapshotRunAsAccountID != nil { + objectMap["snapshotRunAsAccountId"] = vmcemi.SnapshotRunAsAccountID + } + if vmcemi.TargetVMName != nil { + objectMap["targetVmName"] = vmcemi.TargetVMName + } + if vmcemi.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcemi.TargetVMSize + } + if vmcemi.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcemi.TargetResourceGroupID + } + if vmcemi.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcemi.TargetNetworkID + } + if vmcemi.TargetSubnetName != nil { + objectMap["targetSubnetName"] = vmcemi.TargetSubnetName + } + if vmcemi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcemi.TargetAvailabilitySetID + } + if vmcemi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcemi.TargetAvailabilityZone + } + if vmcemi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcemi.TargetProximityPlacementGroupID + } + if vmcemi.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcemi.TargetBootDiagnosticsStorageAccountID + } + if vmcemi.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcemi.PerformAutoResync + } + if vmcemi.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcemi.TargetVMTags + } + if vmcemi.SeedDiskTags != nil { + objectMap["seedDiskTags"] = vmcemi.SeedDiskTags + } + if vmcemi.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcemi.TargetDiskTags + } + if vmcemi.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcemi.TargetNicTags + } + if vmcemi.InstanceType != "" { + objectMap["instanceType"] = vmcemi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtEnableMigrationInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) { + return &vmcemi, true +} + +// AsEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsBasicEnableMigrationProviderSpecificInput() (BasicEnableMigrationProviderSpecificInput, bool) { + return &vmcemi, true +} + +// VMwareCbtEventDetails event details for VMwareCbt provider. +type VMwareCbtEventDetails struct { + // MigrationItemName - READ-ONLY; The migration item name. + MigrationItemName *string `json:"migrationItemName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) MarshalJSON() ([]byte, error) { + vmced.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmced.InstanceType != "" { + objectMap["instanceType"] = vmced.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return &vmced, true +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &vmced, true +} + +// VMwareCbtMigrateInput vMwareCbt specific migrate input. +type VMwareCbtMigrateInput struct { + // PerformShutdown - A value indicating whether VM is to be shutdown. + PerformShutdown *string `json:"performShutdown,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput', 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) MarshalJSON() ([]byte, error) { + vmcmi.InstanceType = InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcmi.PerformShutdown != nil { + objectMap["performShutdown"] = vmcmi.PerformShutdown + } + if vmcmi.InstanceType != "" { + objectMap["instanceType"] = vmcmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrateInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) { + return &vmcmi, true +} + +// AsMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsBasicMigrateProviderSpecificInput() (BasicMigrateProviderSpecificInput, bool) { + return &vmcmi, true +} + +// VMwareCbtMigrationDetails vMwareCbt provider specific settings. +type VMwareCbtMigrationDetails struct { + // VmwareMachineID - READ-ONLY; The ARM Id of the VM discovered in VMware. + VmwareMachineID *string `json:"vmwareMachineId,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // FirmwareType - READ-ONLY; The firmware type. + FirmwareType *string `json:"firmwareType,omitempty"` + // TargetGeneration - READ-ONLY; The target generation. + TargetGeneration *string `json:"targetGeneration,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // DataMoverRunAsAccountID - READ-ONLY; The data mover run as account Id. + DataMoverRunAsAccountID *string `json:"dataMoverRunAsAccountId,omitempty"` + // SnapshotRunAsAccountID - READ-ONLY; The snapshot run as account Id. + SnapshotRunAsAccountID *string `json:"snapshotRunAsAccountId,omitempty"` + // TargetVMName - Target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetLocation - READ-ONLY; The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // TargetResourceGroupID - The target resource group Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]VMwareCbtProtectedDiskDetails `json:"protectedDisks,omitempty"` + // TargetNetworkID - The target network Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // VMNics - The network details. + VMNics *[]VMwareCbtNicDetails `json:"vmNics,omitempty"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // MigrationRecoveryPointID - READ-ONLY; The recovery point Id to which the VM was migrated. + MigrationRecoveryPointID *string `json:"migrationRecoveryPointId,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // LastRecoveryPointID - READ-ONLY; The last recovery point Id. + LastRecoveryPointID *string `json:"lastRecoveryPointId,omitempty"` + // InitialSeedingProgressPercentage - READ-ONLY; The initial seeding progress percentage. + InitialSeedingProgressPercentage *int32 `json:"initialSeedingProgressPercentage,omitempty"` + // MigrationProgressPercentage - READ-ONLY; The migration progress percentage. + MigrationProgressPercentage *int32 `json:"migrationProgressPercentage,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // InitialSeedingRetryCount - READ-ONLY; The initial seeding retry count. + InitialSeedingRetryCount *int64 `json:"initialSeedingRetryCount,omitempty"` + // ResyncRetryCount - READ-ONLY; The resync retry count. + ResyncRetryCount *int64 `json:"resyncRetryCount,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // SeedDiskTags - The tags for the seed disks. + SeedDiskTags map[string]*string `json:"seedDiskTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings', 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) MarshalJSON() ([]byte, error) { + vmcmd.InstanceType = InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcmd.LicenseType != nil { + objectMap["licenseType"] = vmcmd.LicenseType + } + if vmcmd.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = vmcmd.SQLServerLicenseType + } + if vmcmd.TargetVMName != nil { + objectMap["targetVmName"] = vmcmd.TargetVMName + } + if vmcmd.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcmd.TargetVMSize + } + if vmcmd.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcmd.TargetResourceGroupID + } + if vmcmd.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcmd.TargetAvailabilitySetID + } + if vmcmd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcmd.TargetAvailabilityZone + } + if vmcmd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcmd.TargetProximityPlacementGroupID + } + if vmcmd.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcmd.TargetBootDiagnosticsStorageAccountID + } + if vmcmd.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcmd.TargetVMTags + } + if vmcmd.ProtectedDisks != nil { + objectMap["protectedDisks"] = vmcmd.ProtectedDisks + } + if vmcmd.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcmd.TargetNetworkID + } + if vmcmd.VMNics != nil { + objectMap["vmNics"] = vmcmd.VMNics + } + if vmcmd.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcmd.TargetNicTags + } + if vmcmd.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcmd.PerformAutoResync + } + if vmcmd.SeedDiskTags != nil { + objectMap["seedDiskTags"] = vmcmd.SeedDiskTags + } + if vmcmd.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcmd.TargetDiskTags + } + if vmcmd.InstanceType != "" { + objectMap["instanceType"] = vmcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrationDetails is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) { + return &vmcmd, true +} + +// AsMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsBasicMigrationProviderSpecificSettings() (BasicMigrationProviderSpecificSettings, bool) { + return &vmcmd, true +} + +// VMwareCbtNicDetails vMwareCbt NIC details. +type VMwareCbtNicDetails struct { + // NicID - READ-ONLY; The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // SourceIPAddress - READ-ONLY; The source IP address. + SourceIPAddress *string `json:"sourceIPAddress,omitempty"` + // SourceIPAddressType - READ-ONLY; The source IP address type. Possible values include: 'Dynamic', 'Static' + SourceIPAddressType EthernetAddressType `json:"sourceIPAddressType,omitempty"` + // SourceNetworkID - READ-ONLY; Source network Id. + SourceNetworkID *string `json:"sourceNetworkId,omitempty"` + // TargetIPAddress - The target IP address. + TargetIPAddress *string `json:"targetIPAddress,omitempty"` + // TargetIPAddressType - The target IP address type. Possible values include: 'Dynamic', 'Static' + TargetIPAddressType EthernetAddressType `json:"targetIPAddressType,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` + // IsSelectedForMigration - A value indicating whether this NIC is selected for migration. + IsSelectedForMigration *string `json:"isSelectedForMigration,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtNicDetails. +func (vmcnd VMwareCbtNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmcnd.IsPrimaryNic != nil { + objectMap["isPrimaryNic"] = vmcnd.IsPrimaryNic + } + if vmcnd.TargetIPAddress != nil { + objectMap["targetIPAddress"] = vmcnd.TargetIPAddress + } + if vmcnd.TargetIPAddressType != "" { + objectMap["targetIPAddressType"] = vmcnd.TargetIPAddressType + } + if vmcnd.TargetSubnetName != nil { + objectMap["targetSubnetName"] = vmcnd.TargetSubnetName + } + if vmcnd.TargetNicName != nil { + objectMap["targetNicName"] = vmcnd.TargetNicName + } + if vmcnd.IsSelectedForMigration != nil { + objectMap["isSelectedForMigration"] = vmcnd.IsSelectedForMigration + } + return json.Marshal(objectMap) +} + +// VMwareCbtNicInput vMwareCbt NIC input. +type VMwareCbtNicInput struct { + // NicID - The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetStaticIPAddress - The static IP address. + TargetStaticIPAddress *string `json:"targetStaticIPAddress,omitempty"` + // IsSelectedForMigration - A value indicating whether this NIC is selected for migration. + IsSelectedForMigration *string `json:"isSelectedForMigration,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` +} + +// VMwareCbtPolicyCreationInput vMware Cbt policy creation input. +type VMwareCbtPolicyCreationInput struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) MarshalJSON() ([]byte, error) { + vmcpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcpci.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = vmcpci.RecoveryPointHistoryInMinutes + } + if vmcpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = vmcpci.CrashConsistentFrequencyInMinutes + } + if vmcpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = vmcpci.AppConsistentFrequencyInMinutes + } + if vmcpci.InstanceType != "" { + objectMap["instanceType"] = vmcpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return &vmcpci, true +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &vmcpci, true +} + +// VmwareCbtPolicyDetails vMware Cbt specific policy details. +type VmwareCbtPolicyDetails struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) MarshalJSON() ([]byte, error) { + vcpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vcpd.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = vcpd.RecoveryPointHistoryInMinutes + } + if vcpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = vcpd.AppConsistentFrequencyInMinutes + } + if vcpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = vcpd.CrashConsistentFrequencyInMinutes + } + if vcpd.InstanceType != "" { + objectMap["instanceType"] = vcpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return &vcpd, true +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &vcpd, true +} + +// VMwareCbtProtectedDiskDetails vMwareCbt protected disk details. +type VMwareCbtProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskPath - READ-ONLY; The disk path. + DiskPath *string `json:"diskPath,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // LogStorageAccountSasSecretName - READ-ONLY; The key vault secret name of the log storage account. + LogStorageAccountSasSecretName *string `json:"logStorageAccountSasSecretName,omitempty"` + // DiskEncryptionSetID - READ-ONLY; The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // SeedManagedDiskID - READ-ONLY; The ARM Id of the seed managed disk. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // TargetManagedDiskID - READ-ONLY; The ARM Id of the target managed disk. + TargetManagedDiskID *string `json:"targetManagedDiskId,omitempty"` + // TargetDiskName - The name for the target managed disk. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtProtectedDiskDetails. +func (vmcpdd VMwareCbtProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmcpdd.DiskType != "" { + objectMap["diskType"] = vmcpdd.DiskType + } + if vmcpdd.TargetDiskName != nil { + objectMap["targetDiskName"] = vmcpdd.TargetDiskName + } + return json.Marshal(objectMap) +} + +// VMwareCbtProtectionContainerMappingDetails vMwareCbt provider specific container mapping details. +type VMwareCbtProtectionContainerMappingDetails struct { + // KeyVaultID - READ-ONLY; The target key vault ARM Id. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyVaultURI - READ-ONLY; The target key vault URI. + KeyVaultURI *string `json:"keyVaultUri,omitempty"` + // StorageAccountID - READ-ONLY; The storage account ARM Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // StorageAccountSasSecretName - READ-ONLY; The secret name of the storage account. + StorageAccountSasSecretName *string `json:"storageAccountSasSecretName,omitempty"` + // ServiceBusConnectionStringSecretName - READ-ONLY; The secret name of the service bus connection string. + ServiceBusConnectionStringSecretName *string `json:"serviceBusConnectionStringSecretName,omitempty"` + // TargetLocation - READ-ONLY; The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + vmcpcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcpcmd.InstanceType != "" { + objectMap["instanceType"] = vmcpcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return &vmcpcmd, true +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &vmcpcmd, true +} + +// VMwareCbtResyncInput vMwareCbt specific resync input. +type VMwareCbtResyncInput struct { + // SkipCbtReset - A value indicating whether CBT is to be reset. + SkipCbtReset *string `json:"skipCbtReset,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput', 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicResyncProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) MarshalJSON() ([]byte, error) { + vmcri.InstanceType = InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcri.SkipCbtReset != nil { + objectMap["skipCbtReset"] = vmcri.SkipCbtReset + } + if vmcri.InstanceType != "" { + objectMap["instanceType"] = vmcri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtResyncInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) { + return &vmcri, true +} + +// AsResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsBasicResyncProviderSpecificInput() (BasicResyncProviderSpecificInput, bool) { + return &vmcri, true +} + +// VMwareCbtTestMigrateInput vMwareCbt specific test migrate input. +type VMwareCbtTestMigrateInput struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // NetworkID - The test network Id. + NetworkID *string `json:"networkId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput', 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicTestMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) MarshalJSON() ([]byte, error) { + vmctmi.InstanceType = InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmctmi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = vmctmi.RecoveryPointID + } + if vmctmi.NetworkID != nil { + objectMap["networkId"] = vmctmi.NetworkID + } + if vmctmi.InstanceType != "" { + objectMap["instanceType"] = vmctmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtTestMigrateInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) { + return &vmctmi, true +} + +// AsTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsBasicTestMigrateProviderSpecificInput() (BasicTestMigrateProviderSpecificInput, bool) { + return &vmctmi, true +} + +// VMwareCbtUpdateDiskInput vMwareCbt disk input for update. +type VMwareCbtUpdateDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // TargetDiskName - The target disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// VMwareCbtUpdateMigrationItemInput vMwareCbt specific update migration item input. +type VMwareCbtUpdateMigrationItemInput struct { + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // VMNics - The list of NIC details. + VMNics *[]VMwareCbtNicInput `json:"vmNics,omitempty"` + // VMDisks - The list of disk update properties. + VMDisks *[]VMwareCbtUpdateDiskInput `json:"vmDisks,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput', 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicUpdateMigrationItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) MarshalJSON() ([]byte, error) { + vmcumii.InstanceType = InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcumii.TargetVMName != nil { + objectMap["targetVmName"] = vmcumii.TargetVMName + } + if vmcumii.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcumii.TargetVMSize + } + if vmcumii.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcumii.TargetResourceGroupID + } + if vmcumii.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcumii.TargetAvailabilitySetID + } + if vmcumii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcumii.TargetAvailabilityZone + } + if vmcumii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcumii.TargetProximityPlacementGroupID + } + if vmcumii.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcumii.TargetBootDiagnosticsStorageAccountID + } + if vmcumii.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcumii.TargetNetworkID + } + if vmcumii.VMNics != nil { + objectMap["vmNics"] = vmcumii.VMNics + } + if vmcumii.VMDisks != nil { + objectMap["vmDisks"] = vmcumii.VMDisks + } + if vmcumii.LicenseType != "" { + objectMap["licenseType"] = vmcumii.LicenseType + } + if vmcumii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = vmcumii.SQLServerLicenseType + } + if vmcumii.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcumii.PerformAutoResync + } + if vmcumii.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcumii.TargetVMTags + } + if vmcumii.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcumii.TargetDiskTags + } + if vmcumii.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcumii.TargetNicTags + } + if vmcumii.InstanceType != "" { + objectMap["instanceType"] = vmcumii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtUpdateMigrationItemInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) { + return &vmcumii, true +} + +// AsUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsBasicUpdateMigrationItemProviderSpecificInput() (BasicUpdateMigrationItemProviderSpecificInput, bool) { + return &vmcumii, true +} + +// VMwareDetails store the fabric details specific to the VMware fabric. +type VMwareDetails struct { + // ProcessServers - The list of Process Servers associated with the fabric. + ProcessServers *[]ProcessServer `json:"processServers,omitempty"` + // MasterTargetServers - The list of Master Target servers associated with the fabric. + MasterTargetServers *[]MasterTargetServer `json:"masterTargetServers,omitempty"` + // RunAsAccounts - The list of run as accounts created on the server. + RunAsAccounts *[]RunAsAccount `json:"runAsAccounts,omitempty"` + // ReplicationPairCount - The number of replication pairs configured in this CS. + ReplicationPairCount *string `json:"replicationPairCount,omitempty"` + // ProcessServerCount - The number of process servers. + ProcessServerCount *string `json:"processServerCount,omitempty"` + // AgentCount - The number of source and target servers configured to talk to this CS. + AgentCount *string `json:"agentCount,omitempty"` + // ProtectedServers - The number of protected servers. + ProtectedServers *string `json:"protectedServers,omitempty"` + // SystemLoad - The percentage of the system load. + SystemLoad *string `json:"systemLoad,omitempty"` + // SystemLoadStatus - The system load status. + SystemLoadStatus *string `json:"systemLoadStatus,omitempty"` + // CPULoad - The percentage of the CPU load. + CPULoad *string `json:"cpuLoad,omitempty"` + // CPULoadStatus - The CPU load status. + CPULoadStatus *string `json:"cpuLoadStatus,omitempty"` + // TotalMemoryInBytes - The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // MemoryUsageStatus - The memory usage status. + MemoryUsageStatus *string `json:"memoryUsageStatus,omitempty"` + // TotalSpaceInBytes - The total space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - The available space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // SpaceUsageStatus - The space usage status. + SpaceUsageStatus *string `json:"spaceUsageStatus,omitempty"` + // WebLoad - The web load. + WebLoad *string `json:"webLoad,omitempty"` + // WebLoadStatus - The web load status. + WebLoadStatus *string `json:"webLoadStatus,omitempty"` + // DatabaseServerLoad - The database server load. + DatabaseServerLoad *string `json:"databaseServerLoad,omitempty"` + // DatabaseServerLoadStatus - The database server load status. + DatabaseServerLoadStatus *string `json:"databaseServerLoadStatus,omitempty"` + // CsServiceStatus - The CS service status. + CsServiceStatus *string `json:"csServiceStatus,omitempty"` + // IPAddress - The IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // AgentVersion - The agent Version. + AgentVersion *string `json:"agentVersion,omitempty"` + // HostName - The host name. + HostName *string `json:"hostName,omitempty"` + // LastHeartbeat - The last heartbeat received from CS server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // SslCertExpiryDate - CS SSL cert expiry date. + SslCertExpiryDate *date.Time `json:"sslCertExpiryDate,omitempty"` + // SslCertExpiryRemainingDays - CS SSL cert expiry date. + SslCertExpiryRemainingDays *int32 `json:"sslCertExpiryRemainingDays,omitempty"` + // PsTemplateVersion - PS template version. + PsTemplateVersion *string `json:"psTemplateVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // AgentVersionDetails - The agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareDetails. +func (vmd VMwareDetails) MarshalJSON() ([]byte, error) { + vmd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware + objectMap := make(map[string]interface{}) + if vmd.ProcessServers != nil { + objectMap["processServers"] = vmd.ProcessServers + } + if vmd.MasterTargetServers != nil { + objectMap["masterTargetServers"] = vmd.MasterTargetServers + } + if vmd.RunAsAccounts != nil { + objectMap["runAsAccounts"] = vmd.RunAsAccounts + } + if vmd.ReplicationPairCount != nil { + objectMap["replicationPairCount"] = vmd.ReplicationPairCount + } + if vmd.ProcessServerCount != nil { + objectMap["processServerCount"] = vmd.ProcessServerCount + } + if vmd.AgentCount != nil { + objectMap["agentCount"] = vmd.AgentCount + } + if vmd.ProtectedServers != nil { + objectMap["protectedServers"] = vmd.ProtectedServers + } + if vmd.SystemLoad != nil { + objectMap["systemLoad"] = vmd.SystemLoad + } + if vmd.SystemLoadStatus != nil { + objectMap["systemLoadStatus"] = vmd.SystemLoadStatus + } + if vmd.CPULoad != nil { + objectMap["cpuLoad"] = vmd.CPULoad + } + if vmd.CPULoadStatus != nil { + objectMap["cpuLoadStatus"] = vmd.CPULoadStatus + } + if vmd.TotalMemoryInBytes != nil { + objectMap["totalMemoryInBytes"] = vmd.TotalMemoryInBytes + } + if vmd.AvailableMemoryInBytes != nil { + objectMap["availableMemoryInBytes"] = vmd.AvailableMemoryInBytes + } + if vmd.MemoryUsageStatus != nil { + objectMap["memoryUsageStatus"] = vmd.MemoryUsageStatus + } + if vmd.TotalSpaceInBytes != nil { + objectMap["totalSpaceInBytes"] = vmd.TotalSpaceInBytes + } + if vmd.AvailableSpaceInBytes != nil { + objectMap["availableSpaceInBytes"] = vmd.AvailableSpaceInBytes + } + if vmd.SpaceUsageStatus != nil { + objectMap["spaceUsageStatus"] = vmd.SpaceUsageStatus + } + if vmd.WebLoad != nil { + objectMap["webLoad"] = vmd.WebLoad + } + if vmd.WebLoadStatus != nil { + objectMap["webLoadStatus"] = vmd.WebLoadStatus + } + if vmd.DatabaseServerLoad != nil { + objectMap["databaseServerLoad"] = vmd.DatabaseServerLoad + } + if vmd.DatabaseServerLoadStatus != nil { + objectMap["databaseServerLoadStatus"] = vmd.DatabaseServerLoadStatus + } + if vmd.CsServiceStatus != nil { + objectMap["csServiceStatus"] = vmd.CsServiceStatus + } + if vmd.IPAddress != nil { + objectMap["ipAddress"] = vmd.IPAddress + } + if vmd.AgentVersion != nil { + objectMap["agentVersion"] = vmd.AgentVersion + } + if vmd.HostName != nil { + objectMap["hostName"] = vmd.HostName + } + if vmd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = vmd.LastHeartbeat + } + if vmd.VersionStatus != nil { + objectMap["versionStatus"] = vmd.VersionStatus + } + if vmd.SslCertExpiryDate != nil { + objectMap["sslCertExpiryDate"] = vmd.SslCertExpiryDate + } + if vmd.SslCertExpiryRemainingDays != nil { + objectMap["sslCertExpiryRemainingDays"] = vmd.SslCertExpiryRemainingDays + } + if vmd.PsTemplateVersion != nil { + objectMap["psTemplateVersion"] = vmd.PsTemplateVersion + } + if vmd.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = vmd.AgentExpiryDate + } + if vmd.AgentVersionDetails != nil { + objectMap["agentVersionDetails"] = vmd.AgentVersionDetails + } + if vmd.InstanceType != "" { + objectMap["instanceType"] = vmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return &vmd, true +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vmd, true +} + +// VMwareV2FabricCreationInput vMwareV2 fabric provider specific settings. +type VMwareV2FabricCreationInput struct { + // VmwareSiteID - The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // MigrationSolutionID - The ARM Id of the migration solution. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreationInput', 'InstanceTypeAzure', 'InstanceTypeInMageRcm', 'InstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) MarshalJSON() ([]byte, error) { + vmvfci.InstanceType = InstanceTypeVMwareV2 + objectMap := make(map[string]interface{}) + if vmvfci.VmwareSiteID != nil { + objectMap["vmwareSiteId"] = vmvfci.VmwareSiteID + } + if vmvfci.PhysicalSiteID != nil { + objectMap["physicalSiteId"] = vmvfci.PhysicalSiteID + } + if vmvfci.MigrationSolutionID != nil { + objectMap["migrationSolutionId"] = vmvfci.MigrationSolutionID + } + if vmvfci.InstanceType != "" { + objectMap["instanceType"] = vmvfci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return &vmvfci, true +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &vmvfci, true +} + +// VMwareV2FabricSpecificDetails vMwareV2 fabric specific details. +type VMwareV2FabricSpecificDetails struct { + // VmwareSiteID - READ-ONLY; The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - READ-ONLY; The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // MigrationSolutionID - READ-ONLY; The Migration solution ARM Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // ServiceEndpoint - READ-ONLY; The service endpoint. + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` + // ServiceResourceID - READ-ONLY; The service resource Id. + ServiceResourceID *string `json:"serviceResourceId,omitempty"` + // ServiceContainerID - READ-ONLY; The service container Id. + ServiceContainerID *string `json:"serviceContainerId,omitempty"` + // ProcessServers - READ-ONLY; The list of process servers. + ProcessServers *[]ProcessServerDetails `json:"processServers,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) MarshalJSON() ([]byte, error) { + vmvfsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 + objectMap := make(map[string]interface{}) + if vmvfsd.InstanceType != "" { + objectMap["instanceType"] = vmvfsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return &vmvfsd, true +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vmvfsd, true +} + +// VMwareVirtualMachineDetails vMware provider specific settings. +type VMwareVirtualMachineDetails struct { + // AgentGeneratedID - The ID generated by the InMage agent after it gets installed on guest. This is the ID to be used during InMage CreateProtection. + AgentGeneratedID *string `json:"agentGeneratedId,omitempty"` + // AgentInstalled - The value indicating if InMage scout agent is installed on guest. + AgentInstalled *string `json:"agentInstalled,omitempty"` + // OsType - The OsType installed on VM. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // IPAddress - The IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // PoweredOn - The value indicating whether VM is powered on. + PoweredOn *string `json:"poweredOn,omitempty"` + // VCenterInfrastructureID - The VCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. Value can be vCenter or physical. + DiscoveryType *string `json:"discoveryType,omitempty"` + // DiskDetails - The disk details. + DiskDetails *[]InMageDiskDetails `json:"diskDetails,omitempty"` + // ValidationErrors - The validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) MarshalJSON() ([]byte, error) { + vmvmd.InstanceType = InstanceTypeVMwareVirtualMachine + objectMap := make(map[string]interface{}) + if vmvmd.AgentGeneratedID != nil { + objectMap["agentGeneratedId"] = vmvmd.AgentGeneratedID + } + if vmvmd.AgentInstalled != nil { + objectMap["agentInstalled"] = vmvmd.AgentInstalled + } + if vmvmd.OsType != nil { + objectMap["osType"] = vmvmd.OsType + } + if vmvmd.AgentVersion != nil { + objectMap["agentVersion"] = vmvmd.AgentVersion + } + if vmvmd.IPAddress != nil { + objectMap["ipAddress"] = vmvmd.IPAddress + } + if vmvmd.PoweredOn != nil { + objectMap["poweredOn"] = vmvmd.PoweredOn + } + if vmvmd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = vmvmd.VCenterInfrastructureID + } + if vmvmd.DiscoveryType != nil { + objectMap["discoveryType"] = vmvmd.DiscoveryType + } + if vmvmd.DiskDetails != nil { + objectMap["diskDetails"] = vmvmd.DiskDetails + } + if vmvmd.ValidationErrors != nil { + objectMap["validationErrors"] = vmvmd.ValidationErrors + } + if vmvmd.InstanceType != "" { + objectMap["instanceType"] = vmvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return &vmvmd, true +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &vmvmd, true +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/operations.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/operations.go new file mode 100644 index 000000000000..36b53e18e1c8 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/operations.go @@ -0,0 +1,145 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the client for the Operations methods of the Siterecovery service. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string, resourceGroupName string, resourceName string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// List operation to return the list of available operations. +func (client OperationsClient) List(ctx context.Context) (result OperationsDiscoveryCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.odc.Response.Response != nil { + sc = result.odc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.odc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.odc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", resp, "Failure responding to request") + return + } + if result.odc.hasNextLink() && result.odc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/operations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationsDiscoveryCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationsDiscoveryCollection) (result OperationsDiscoveryCollection, err error) { + req, err := lastResults.operationsDiscoveryCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationsDiscoveryCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/recoverypoints.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/recoverypoints.go new file mode 100644 index 000000000000..21e4f3ba2f5f --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/recoverypoints.go @@ -0,0 +1,235 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RecoveryPointsClient is the client for the RecoveryPoints methods of the Siterecovery service. +type RecoveryPointsClient struct { + BaseClient +} + +// NewRecoveryPointsClient creates an instance of the RecoveryPointsClient client. +func NewRecoveryPointsClient(subscriptionID string, resourceGroupName string, resourceName string) RecoveryPointsClient { + return NewRecoveryPointsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewRecoveryPointsClientWithBaseURI creates an instance of the RecoveryPointsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewRecoveryPointsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) RecoveryPointsClient { + return RecoveryPointsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get get the details of specified recovery point. +// Parameters: +// fabricName - the fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replication protected item name. +// recoveryPointName - the recovery point name. +func (client RecoveryPointsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (result RecoveryPoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, recoveryPointName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client RecoveryPointsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "recoveryPointName": autorest.Encode("path", recoveryPointName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints/{recoveryPointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RecoveryPointsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RecoveryPointsClient) GetResponder(resp *http.Response) (result RecoveryPoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationProtectedItems lists the available recovery points for a replication protected item. +// Parameters: +// fabricName - the fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replication protected item name. +func (client RecoveryPointsClient) ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result RecoveryPointCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.RPCVar.Response.Response != nil { + sc = result.RPCVar.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectedItemsNextResults + req, err := client.ListByReplicationProtectedItemsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.RPCVar.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", resp, "Failure sending request") + return + } + + result.RPCVar, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", resp, "Failure responding to request") + return + } + if result.RPCVar.hasNextLink() && result.RPCVar.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectedItemsPreparer prepares the ListByReplicationProtectedItems request. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectedItemsSender sends the ListByReplicationProtectedItems request. The method will close the +// http.Response Body if it receives an error. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectedItemsResponder handles the response to the ListByReplicationProtectedItems request. The method always +// closes the http.Response Body. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsResponder(resp *http.Response) (result RecoveryPointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectedItemsNextResults retrieves the next set of results, if any. +func (client RecoveryPointsClient) listByReplicationProtectedItemsNextResults(ctx context.Context, lastResults RecoveryPointCollection) (result RecoveryPointCollection, err error) { + req, err := lastResults.recoveryPointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectedItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result RecoveryPointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectedItems(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationalertsettings.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationalertsettings.go new file mode 100644 index 000000000000..e786407e8e08 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationalertsettings.go @@ -0,0 +1,302 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationAlertSettingsClient is the client for the ReplicationAlertSettings methods of the Siterecovery service. +type ReplicationAlertSettingsClient struct { + BaseClient +} + +// NewReplicationAlertSettingsClient creates an instance of the ReplicationAlertSettingsClient client. +func NewReplicationAlertSettingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationAlertSettingsClient { + return NewReplicationAlertSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationAlertSettingsClientWithBaseURI creates an instance of the ReplicationAlertSettingsClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationAlertSettingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationAlertSettingsClient { + return ReplicationAlertSettingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create create or update an email notification(alert) configuration. +// Parameters: +// alertSettingName - the name of the email notification(alert) configuration. +// request - the input to configure the email notification(alert). +func (client ReplicationAlertSettingsClient) Create(ctx context.Context, alertSettingName string, request ConfigureAlertRequest) (result Alert, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, alertSettingName, request) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationAlertSettingsClient) CreatePreparer(ctx context.Context, alertSettingName string, request ConfigureAlertRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertSettingName": autorest.Encode("path", alertSettingName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) CreateResponder(resp *http.Response) (result Alert, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of the specified email notification(alert) configuration. +// Parameters: +// alertSettingName - the name of the email notification configuration. +func (client ReplicationAlertSettingsClient) Get(ctx context.Context, alertSettingName string) (result Alert, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, alertSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationAlertSettingsClient) GetPreparer(ctx context.Context, alertSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertSettingName": autorest.Encode("path", alertSettingName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) GetResponder(resp *http.Response) (result Alert, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of email notification(alert) configurations for the vault. +func (client ReplicationAlertSettingsClient) List(ctx context.Context) (result AlertCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.List") + defer func() { + sc := -1 + if result.ac.Response.Response != nil { + sc = result.ac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", resp, "Failure sending request") + return + } + + result.ac, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", resp, "Failure responding to request") + return + } + if result.ac.hasNextLink() && result.ac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationAlertSettingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) ListResponder(resp *http.Response) (result AlertCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationAlertSettingsClient) listNextResults(ctx context.Context, lastResults AlertCollection) (result AlertCollection, err error) { + req, err := lastResults.alertCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationAlertSettingsClient) ListComplete(ctx context.Context) (result AlertCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationeligibilityresults.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationeligibilityresults.go new file mode 100644 index 000000000000..b0cc69be0bbc --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationeligibilityresults.go @@ -0,0 +1,183 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationEligibilityResultsClient is the client for the ReplicationEligibilityResults methods of the Siterecovery +// service. +type ReplicationEligibilityResultsClient struct { + BaseClient +} + +// NewReplicationEligibilityResultsClient creates an instance of the ReplicationEligibilityResultsClient client. +func NewReplicationEligibilityResultsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationEligibilityResultsClient { + return NewReplicationEligibilityResultsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationEligibilityResultsClientWithBaseURI creates an instance of the ReplicationEligibilityResultsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationEligibilityResultsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationEligibilityResultsClient { + return ReplicationEligibilityResultsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get validates whether a given VM can be protected or not in which case returns list of errors. +// Parameters: +// virtualMachineName - virtual Machine name. +func (client ReplicationEligibilityResultsClient) Get(ctx context.Context, virtualMachineName string) (result ReplicationEligibilityResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEligibilityResultsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, virtualMachineName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationEligibilityResultsClient) GetPreparer(ctx context.Context, virtualMachineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineName": autorest.Encode("path", virtualMachineName), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEligibilityResultsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationEligibilityResultsClient) GetResponder(resp *http.Response) (result ReplicationEligibilityResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List validates whether a given VM can be protected or not in which case returns list of errors. +// Parameters: +// virtualMachineName - virtual Machine name. +func (client ReplicationEligibilityResultsClient) List(ctx context.Context, virtualMachineName string) (result ReplicationEligibilityResultsCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEligibilityResultsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, virtualMachineName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationEligibilityResultsClient) ListPreparer(ctx context.Context, virtualMachineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineName": autorest.Encode("path", virtualMachineName), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEligibilityResultsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationEligibilityResultsClient) ListResponder(resp *http.Response) (result ReplicationEligibilityResultsCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationevents.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationevents.go new file mode 100644 index 000000000000..9b210e2e2b32 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationevents.go @@ -0,0 +1,228 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationEventsClient is the client for the ReplicationEvents methods of the Siterecovery service. +type ReplicationEventsClient struct { + BaseClient +} + +// NewReplicationEventsClient creates an instance of the ReplicationEventsClient client. +func NewReplicationEventsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationEventsClient { + return NewReplicationEventsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationEventsClientWithBaseURI creates an instance of the ReplicationEventsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationEventsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationEventsClient { + return ReplicationEventsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get the operation to get the details of an Azure Site recovery event. +// Parameters: +// eventName - the name of the Azure Site Recovery event. +func (client ReplicationEventsClient) Get(ctx context.Context, eventName string) (result Event, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, eventName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationEventsClient) GetPreparer(ctx context.Context, eventName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "eventName": autorest.Encode("path", eventName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents/{eventName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEventsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationEventsClient) GetResponder(resp *http.Response) (result Event, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of Azure Site Recovery events for the vault. +// Parameters: +// filter - oData filter options. +func (client ReplicationEventsClient) List(ctx context.Context, filter string) (result EventCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.List") + defer func() { + sc := -1 + if result.ec.Response.Response != nil { + sc = result.ec.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ec.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", resp, "Failure sending request") + return + } + + result.ec, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", resp, "Failure responding to request") + return + } + if result.ec.hasNextLink() && result.ec.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationEventsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEventsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationEventsClient) ListResponder(resp *http.Response) (result EventCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationEventsClient) listNextResults(ctx context.Context, lastResults EventCollection) (result EventCollection, err error) { + req, err := lastResults.eventCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationEventsClient) ListComplete(ctx context.Context, filter string) (result EventCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationfabrics.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationfabrics.go new file mode 100644 index 000000000000..648d402c3729 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationfabrics.go @@ -0,0 +1,786 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationFabricsClient is the client for the ReplicationFabrics methods of the Siterecovery service. +type ReplicationFabricsClient struct { + BaseClient +} + +// NewReplicationFabricsClient creates an instance of the ReplicationFabricsClient client. +func NewReplicationFabricsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationFabricsClient { + return NewReplicationFabricsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationFabricsClientWithBaseURI creates an instance of the ReplicationFabricsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationFabricsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationFabricsClient { + return ReplicationFabricsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// CheckConsistency the operation to perform a consistency check on the fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationFabricsClient) CheckConsistency(ctx context.Context, fabricName string) (result ReplicationFabricsCheckConsistencyFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.CheckConsistency") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CheckConsistencyPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "CheckConsistency", nil, "Failure preparing request") + return + } + + result, err = client.CheckConsistencySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "CheckConsistency", result.Response(), "Failure sending request") + return + } + + return +} + +// CheckConsistencyPreparer prepares the CheckConsistency request. +func (client ReplicationFabricsClient) CheckConsistencyPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/checkConsistency", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckConsistencySender sends the CheckConsistency request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) CheckConsistencySender(req *http.Request) (future ReplicationFabricsCheckConsistencyFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CheckConsistencyResponder handles the response to the CheckConsistency request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) CheckConsistencyResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Create the operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). +// Parameters: +// fabricName - name of the ASR fabric. +// input - fabric creation input. +func (client ReplicationFabricsClient) Create(ctx context.Context, fabricName string, input FabricCreationInput) (result ReplicationFabricsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationFabricsClient) CreatePreparer(ctx context.Context, fabricName string, input FabricCreationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) CreateSender(req *http.Request) (future ReplicationFabricsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) CreateResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete or remove an Azure Site Recovery fabric. +// Parameters: +// fabricName - ASR fabric to delete. +func (client ReplicationFabricsClient) Delete(ctx context.Context, fabricName string) (result ReplicationFabricsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationFabricsClient) DeletePreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) DeleteSender(req *http.Request) (future ReplicationFabricsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of an Azure Site Recovery fabric. +// Parameters: +// fabricName - fabric name. +// filter - oData filter options. +func (client ReplicationFabricsClient) Get(ctx context.Context, fabricName string, filter string) (result Fabric, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationFabricsClient) GetPreparer(ctx context.Context, fabricName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) GetResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of the Azure Site Recovery fabrics in the vault. +func (client ReplicationFabricsClient) List(ctx context.Context) (result FabricCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.List") + defer func() { + sc := -1 + if result.fc.Response.Response != nil { + sc = result.fc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.fc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", resp, "Failure sending request") + return + } + + result.fc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", resp, "Failure responding to request") + return + } + if result.fc.hasNextLink() && result.fc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationFabricsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) ListResponder(resp *http.Response) (result FabricCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationFabricsClient) listNextResults(ctx context.Context, lastResults FabricCollection) (result FabricCollection, err error) { + req, err := lastResults.fabricCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationFabricsClient) ListComplete(ctx context.Context) (result FabricCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// MigrateToAad the operation to migrate an Azure Site Recovery fabric to AAD. +// Parameters: +// fabricName - ASR fabric to migrate. +func (client ReplicationFabricsClient) MigrateToAad(ctx context.Context, fabricName string) (result ReplicationFabricsMigrateToAadFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.MigrateToAad") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.MigrateToAadPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "MigrateToAad", nil, "Failure preparing request") + return + } + + result, err = client.MigrateToAadSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "MigrateToAad", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateToAadPreparer prepares the MigrateToAad request. +func (client ReplicationFabricsClient) MigrateToAadPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/migratetoaad", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateToAadSender sends the MigrateToAad request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) MigrateToAadSender(req *http.Request) (future ReplicationFabricsMigrateToAadFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateToAadResponder handles the response to the MigrateToAad request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) MigrateToAadResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Purge the operation to purge(force delete) an Azure Site Recovery fabric. +// Parameters: +// fabricName - ASR fabric to purge. +func (client ReplicationFabricsClient) Purge(ctx context.Context, fabricName string) (result ReplicationFabricsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationFabricsClient) PurgePreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) PurgeSender(req *http.Request) (future ReplicationFabricsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// ReassociateGateway the operation to move replications from a process server to another process server. +// Parameters: +// fabricName - the name of the fabric containing the process server. +// failoverProcessServerRequest - the input to the failover process server operation. +func (client ReplicationFabricsClient) ReassociateGateway(ctx context.Context, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest) (result ReplicationFabricsReassociateGatewayFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.ReassociateGateway") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReassociateGatewayPreparer(ctx, fabricName, failoverProcessServerRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "ReassociateGateway", nil, "Failure preparing request") + return + } + + result, err = client.ReassociateGatewaySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "ReassociateGateway", result.Response(), "Failure sending request") + return + } + + return +} + +// ReassociateGatewayPreparer prepares the ReassociateGateway request. +func (client ReplicationFabricsClient) ReassociateGatewayPreparer(ctx context.Context, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/reassociateGateway", pathParameters), + autorest.WithJSON(failoverProcessServerRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReassociateGatewaySender sends the ReassociateGateway request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) ReassociateGatewaySender(req *http.Request) (future ReplicationFabricsReassociateGatewayFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReassociateGatewayResponder handles the response to the ReassociateGateway request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) ReassociateGatewayResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RenewCertificate renews the connection certificate for the ASR replication fabric. +// Parameters: +// fabricName - fabric name to renew certs for. +// renewCertificate - renew certificate input. +func (client ReplicationFabricsClient) RenewCertificate(ctx context.Context, fabricName string, renewCertificate RenewCertificateInput) (result ReplicationFabricsRenewCertificateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.RenewCertificate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RenewCertificatePreparer(ctx, fabricName, renewCertificate) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "RenewCertificate", nil, "Failure preparing request") + return + } + + result, err = client.RenewCertificateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "RenewCertificate", result.Response(), "Failure sending request") + return + } + + return +} + +// RenewCertificatePreparer prepares the RenewCertificate request. +func (client ReplicationFabricsClient) RenewCertificatePreparer(ctx context.Context, fabricName string, renewCertificate RenewCertificateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/renewCertificate", pathParameters), + autorest.WithJSON(renewCertificate), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RenewCertificateSender sends the RenewCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) RenewCertificateSender(req *http.Request) (future ReplicationFabricsRenewCertificateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RenewCertificateResponder handles the response to the RenewCertificate request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) RenewCertificateResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationjobs.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationjobs.go new file mode 100644 index 000000000000..33fe5cb70765 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationjobs.go @@ -0,0 +1,547 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationJobsClient is the client for the ReplicationJobs methods of the Siterecovery service. +type ReplicationJobsClient struct { + BaseClient +} + +// NewReplicationJobsClient creates an instance of the ReplicationJobsClient client. +func NewReplicationJobsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationJobsClient { + return NewReplicationJobsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationJobsClientWithBaseURI creates an instance of the ReplicationJobsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationJobsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationJobsClient { + return ReplicationJobsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Cancel the operation to cancel an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Cancel(ctx context.Context, jobName string) (result ReplicationJobsCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Cancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CancelPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Cancel", nil, "Failure preparing request") + return + } + + result, err = client.CancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Cancel", result.Response(), "Failure sending request") + return + } + + return +} + +// CancelPreparer prepares the Cancel request. +func (client ReplicationJobsClient) CancelPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/cancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CancelSender sends the Cancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) CancelSender(req *http.Request) (future ReplicationJobsCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CancelResponder handles the response to the Cancel request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) CancelResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Export the operation to export the details of the Azure Site Recovery jobs of the vault. +// Parameters: +// jobQueryParameter - job query filter. +func (client ReplicationJobsClient) Export(ctx context.Context, jobQueryParameter JobQueryParameter) (result ReplicationJobsExportFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Export") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ExportPreparer(ctx, jobQueryParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Export", nil, "Failure preparing request") + return + } + + result, err = client.ExportSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Export", result.Response(), "Failure sending request") + return + } + + return +} + +// ExportPreparer prepares the Export request. +func (client ReplicationJobsClient) ExportPreparer(ctx context.Context, jobQueryParameter JobQueryParameter) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/export", pathParameters), + autorest.WithJSON(jobQueryParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExportSender sends the Export request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ExportSender(req *http.Request) (future ReplicationJobsExportFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ExportResponder handles the response to the Export request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ExportResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get the details of an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Get(ctx context.Context, jobName string) (result Job, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationJobsClient) GetPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) GetResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of Azure Site Recovery Jobs for the vault. +// Parameters: +// filter - oData filter options. +func (client ReplicationJobsClient) List(ctx context.Context, filter string) (result JobCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.List") + defer func() { + sc := -1 + if result.jc.Response.Response != nil { + sc = result.jc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.jc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", resp, "Failure sending request") + return + } + + result.jc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", resp, "Failure responding to request") + return + } + if result.jc.hasNextLink() && result.jc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationJobsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ListResponder(resp *http.Response) (result JobCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationJobsClient) listNextResults(ctx context.Context, lastResults JobCollection) (result JobCollection, err error) { + req, err := lastResults.jobCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationJobsClient) ListComplete(ctx context.Context, filter string) (result JobCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} + +// Restart the operation to restart an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Restart(ctx context.Context, jobName string) (result ReplicationJobsRestartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Restart") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RestartPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Restart", nil, "Failure preparing request") + return + } + + result, err = client.RestartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Restart", result.Response(), "Failure sending request") + return + } + + return +} + +// RestartPreparer prepares the Restart request. +func (client ReplicationJobsClient) RestartPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartSender sends the Restart request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) RestartSender(req *http.Request) (future ReplicationJobsRestartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestartResponder handles the response to the Restart request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) RestartResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Resume the operation to resume an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +// resumeJobParams - resume rob comments. +func (client ReplicationJobsClient) Resume(ctx context.Context, jobName string, resumeJobParams ResumeJobParams) (result ReplicationJobsResumeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Resume") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResumePreparer(ctx, jobName, resumeJobParams) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Resume", nil, "Failure preparing request") + return + } + + result, err = client.ResumeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Resume", result.Response(), "Failure sending request") + return + } + + return +} + +// ResumePreparer prepares the Resume request. +func (client ReplicationJobsClient) ResumePreparer(ctx context.Context, jobName string, resumeJobParams ResumeJobParams) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/resume", pathParameters), + autorest.WithJSON(resumeJobParams), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResumeSender sends the Resume request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ResumeSender(req *http.Request) (future ReplicationJobsResumeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResumeResponder handles the response to the Resume request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ResumeResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationlogicalnetworks.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationlogicalnetworks.go new file mode 100644 index 000000000000..5839b73fb40d --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationlogicalnetworks.go @@ -0,0 +1,229 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationLogicalNetworksClient is the client for the ReplicationLogicalNetworks methods of the Siterecovery +// service. +type ReplicationLogicalNetworksClient struct { + BaseClient +} + +// NewReplicationLogicalNetworksClient creates an instance of the ReplicationLogicalNetworksClient client. +func NewReplicationLogicalNetworksClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationLogicalNetworksClient { + return NewReplicationLogicalNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationLogicalNetworksClientWithBaseURI creates an instance of the ReplicationLogicalNetworksClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationLogicalNetworksClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationLogicalNetworksClient { + return ReplicationLogicalNetworksClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of a logical network. +// Parameters: +// fabricName - server Id. +// logicalNetworkName - logical network name. +func (client ReplicationLogicalNetworksClient) Get(ctx context.Context, fabricName string, logicalNetworkName string) (result LogicalNetwork, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, logicalNetworkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationLogicalNetworksClient) GetPreparer(ctx context.Context, fabricName string, logicalNetworkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "logicalNetworkName": autorest.Encode("path", logicalNetworkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks/{logicalNetworkName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationLogicalNetworksClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationLogicalNetworksClient) GetResponder(resp *http.Response) (result LogicalNetwork, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationFabrics lists all the logical networks of the Azure Site Recovery fabric. +// Parameters: +// fabricName - server Id. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result LogicalNetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.lnc.Response.Response != nil { + sc = result.lnc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.lnc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.lnc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.lnc.hasNextLink() && result.lnc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsResponder(resp *http.Response) (result LogicalNetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationLogicalNetworksClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults LogicalNetworkCollection) (result LogicalNetworkCollection, err error) { + req, err := lastResults.logicalNetworkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result LogicalNetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationmigrationitems.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationmigrationitems.go new file mode 100644 index 000000000000..3ab5210874ef --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationmigrationitems.go @@ -0,0 +1,1009 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationMigrationItemsClient is the client for the ReplicationMigrationItems methods of the Siterecovery service. +type ReplicationMigrationItemsClient struct { + BaseClient +} + +// NewReplicationMigrationItemsClient creates an instance of the ReplicationMigrationItemsClient client. +func NewReplicationMigrationItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationMigrationItemsClient { + return NewReplicationMigrationItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationMigrationItemsClientWithBaseURI creates an instance of the ReplicationMigrationItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationMigrationItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationMigrationItemsClient { + return ReplicationMigrationItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR migration item (enable migration). +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - enable migration input. +func (client ReplicationMigrationItemsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input EnableMigrationInput) (result ReplicationMigrationItemsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.PolicyID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationMigrationItemsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input EnableMigrationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) CreateSender(req *http.Request) (future ReplicationMigrationItemsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) CreateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// deleteOption - the delete option. +func (client ReplicationMigrationItemsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (result ReplicationMigrationItemsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, migrationItemName, deleteOption) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationMigrationItemsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(deleteOption) > 0 { + queryParameters["deleteOption"] = autorest.Encode("query", deleteOption) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) DeleteSender(req *http.Request) (future ReplicationMigrationItemsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get sends the get request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +func (client ReplicationMigrationItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, migrationItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationMigrationItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) GetResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List sends the list request. +// Parameters: +// skipToken - the pagination token. +// takeToken - the page size. +// filter - oData filter options. +func (client ReplicationMigrationItemsClient) List(ctx context.Context, skipToken string, takeToken string, filter string) (result MigrationItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.List") + defer func() { + sc := -1 + if result.mic.Response.Response != nil { + sc = result.mic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, takeToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.mic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", resp, "Failure sending request") + return + } + + result.mic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", resp, "Failure responding to request") + return + } + if result.mic.hasNextLink() && result.mic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationMigrationItemsClient) ListPreparer(ctx context.Context, skipToken string, takeToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationMigrationItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ListResponder(resp *http.Response) (result MigrationItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationMigrationItemsClient) listNextResults(ctx context.Context, lastResults MigrationItemCollection) (result MigrationItemCollection, err error) { + req, err := lastResults.migrationItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationMigrationItemsClient) ListComplete(ctx context.Context, skipToken string, takeToken string, filter string) (result MigrationItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, takeToken, filter) + return +} + +// ListByReplicationProtectionContainers gets the list of ASR migration items in the protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// skipToken - the pagination token. +// takeToken - the page size. +// filter - oData filter options. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result MigrationItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.mic.Response.Response != nil { + sc = result.mic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName, skipToken, takeToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.mic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.mic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.mic.hasNextLink() && result.mic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result MigrationItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationMigrationItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults MigrationItemCollection) (result MigrationItemCollection, err error) { + req, err := lastResults.migrationItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result MigrationItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName, skipToken, takeToken, filter) + return +} + +// Migrate the operation to initiate migration of the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// migrateInput - migrate input. +func (client ReplicationMigrationItemsClient) Migrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput MigrateInput) (result ReplicationMigrationItemsMigrateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Migrate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: migrateInput, + Constraints: []validation.Constraint{{Target: "migrateInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Migrate", err.Error()) + } + + req, err := client.MigratePreparer(ctx, fabricName, protectionContainerName, migrationItemName, migrateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Migrate", nil, "Failure preparing request") + return + } + + result, err = client.MigrateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Migrate", result.Response(), "Failure sending request") + return + } + + return +} + +// MigratePreparer prepares the Migrate request. +func (client ReplicationMigrationItemsClient) MigratePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput MigrateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrate", pathParameters), + autorest.WithJSON(migrateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateSender sends the Migrate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) MigrateSender(req *http.Request) (future ReplicationMigrationItemsMigrateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateResponder handles the response to the Migrate request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) MigrateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Resync the operation to resynchronize replication of an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - resync input. +func (client ReplicationMigrationItemsClient) Resync(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input ResyncInput) (result ReplicationMigrationItemsResyncFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Resync") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Resync", err.Error()) + } + + req, err := client.ResyncPreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Resync", nil, "Failure preparing request") + return + } + + result, err = client.ResyncSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Resync", result.Response(), "Failure sending request") + return + } + + return +} + +// ResyncPreparer prepares the Resync request. +func (client ReplicationMigrationItemsClient) ResyncPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input ResyncInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/resync", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResyncSender sends the Resync request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ResyncSender(req *http.Request) (future ReplicationMigrationItemsResyncFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResyncResponder handles the response to the Resync request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ResyncResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestMigrate the operation to initiate test migration of the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// testMigrateInput - test migrate input. +func (client ReplicationMigrationItemsClient) TestMigrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput TestMigrateInput) (result ReplicationMigrationItemsTestMigrateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.TestMigrate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testMigrateInput, + Constraints: []validation.Constraint{{Target: "testMigrateInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "TestMigrate", err.Error()) + } + + req, err := client.TestMigratePreparer(ctx, fabricName, protectionContainerName, migrationItemName, testMigrateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrate", nil, "Failure preparing request") + return + } + + result, err = client.TestMigrateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrate", result.Response(), "Failure sending request") + return + } + + return +} + +// TestMigratePreparer prepares the TestMigrate request. +func (client ReplicationMigrationItemsClient) TestMigratePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput TestMigrateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrate", pathParameters), + autorest.WithJSON(testMigrateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestMigrateSender sends the TestMigrate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) TestMigrateSender(req *http.Request) (future ReplicationMigrationItemsTestMigrateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestMigrateResponder handles the response to the TestMigrate request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) TestMigrateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestMigrateCleanup the operation to initiate test migrate cleanup. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// testMigrateCleanupInput - test migrate cleanup input. +func (client ReplicationMigrationItemsClient) TestMigrateCleanup(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput TestMigrateCleanupInput) (result ReplicationMigrationItemsTestMigrateCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.TestMigrateCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testMigrateCleanupInput, + Constraints: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", err.Error()) + } + + req, err := client.TestMigrateCleanupPreparer(ctx, fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestMigrateCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestMigrateCleanupPreparer prepares the TestMigrateCleanup request. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput TestMigrateCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrateCleanup", pathParameters), + autorest.WithJSON(testMigrateCleanupInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestMigrateCleanupSender sends the TestMigrateCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupSender(req *http.Request) (future ReplicationMigrationItemsTestMigrateCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestMigrateCleanupResponder handles the response to the TestMigrateCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update the recovery settings of an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - update migration item input. +func (client ReplicationMigrationItemsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input UpdateMigrationItemInput) (result ReplicationMigrationItemsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationMigrationItemsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input UpdateMigrationItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) UpdateSender(req *http.Request) (future ReplicationMigrationItemsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) UpdateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationnetworkmappings.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationnetworkmappings.go new file mode 100644 index 000000000000..e27c97f4117f --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationnetworkmappings.go @@ -0,0 +1,610 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationNetworkMappingsClient is the client for the ReplicationNetworkMappings methods of the Siterecovery +// service. +type ReplicationNetworkMappingsClient struct { + BaseClient +} + +// NewReplicationNetworkMappingsClient creates an instance of the ReplicationNetworkMappingsClient client. +func NewReplicationNetworkMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworkMappingsClient { + return NewReplicationNetworkMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationNetworkMappingsClientWithBaseURI creates an instance of the ReplicationNetworkMappingsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationNetworkMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworkMappingsClient { + return ReplicationNetworkMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +// input - create network mapping input. +func (client ReplicationNetworkMappingsClient) Create(ctx context.Context, fabricName string, networkName string, networkMappingName string, input CreateNetworkMappingInput) (result ReplicationNetworkMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.RecoveryNetworkID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationNetworkMappingsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, networkName, networkMappingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationNetworkMappingsClient) CreatePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string, input CreateNetworkMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) CreateSender(req *http.Request) (future ReplicationNetworkMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) CreateResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - ARM Resource Name for network mapping. +func (client ReplicationNetworkMappingsClient) Delete(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result ReplicationNetworkMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, networkName, networkMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationNetworkMappingsClient) DeletePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) DeleteSender(req *http.Request) (future ReplicationNetworkMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +func (client ReplicationNetworkMappingsClient) Get(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result NetworkMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, networkName, networkMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationNetworkMappingsClient) GetPreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) GetResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all ASR network mappings in the vault. +func (client ReplicationNetworkMappingsClient) List(ctx context.Context) (result NetworkMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.List") + defer func() { + sc := -1 + if result.nmc.Response.Response != nil { + sc = result.nmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.nmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", resp, "Failure sending request") + return + } + + result.nmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.nmc.hasNextLink() && result.nmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationNetworkMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationNetworkMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) ListResponder(resp *http.Response) (result NetworkMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationNetworkMappingsClient) listNextResults(ctx context.Context, lastResults NetworkMappingCollection) (result NetworkMappingCollection, err error) { + req, err := lastResults.networkMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworkMappingsClient) ListComplete(ctx context.Context) (result NetworkMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationNetworks lists all ASR network mappings for the specified network. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworks(ctx context.Context, fabricName string, networkName string) (result NetworkMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.ListByReplicationNetworks") + defer func() { + sc := -1 + if result.nmc.Response.Response != nil { + sc = result.nmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationNetworksNextResults + req, err := client.ListByReplicationNetworksPreparer(ctx, fabricName, networkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationNetworksSender(req) + if err != nil { + result.nmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", resp, "Failure sending request") + return + } + + result.nmc, err = client.ListByReplicationNetworksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", resp, "Failure responding to request") + return + } + if result.nmc.hasNextLink() && result.nmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationNetworksPreparer prepares the ListByReplicationNetworks request. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksPreparer(ctx context.Context, fabricName string, networkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationNetworksSender sends the ListByReplicationNetworks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationNetworksResponder handles the response to the ListByReplicationNetworks request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksResponder(resp *http.Response) (result NetworkMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationNetworksNextResults retrieves the next set of results, if any. +func (client ReplicationNetworkMappingsClient) listByReplicationNetworksNextResults(ctx context.Context, lastResults NetworkMappingCollection) (result NetworkMappingCollection, err error) { + req, err := lastResults.networkMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationNetworksSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationNetworksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationNetworksComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksComplete(ctx context.Context, fabricName string, networkName string) (result NetworkMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.ListByReplicationNetworks") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationNetworks(ctx, fabricName, networkName) + return +} + +// Update the operation to update an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +// input - update network mapping input. +func (client ReplicationNetworkMappingsClient) Update(ctx context.Context, fabricName string, networkName string, networkMappingName string, input UpdateNetworkMappingInput) (result ReplicationNetworkMappingsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, networkName, networkMappingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationNetworkMappingsClient) UpdatePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string, input UpdateNetworkMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) UpdateSender(req *http.Request) (future ReplicationNetworkMappingsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) UpdateResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationnetworks.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationnetworks.go new file mode 100644 index 000000000000..7000703c4256 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationnetworks.go @@ -0,0 +1,343 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationNetworksClient is the client for the ReplicationNetworks methods of the Siterecovery service. +type ReplicationNetworksClient struct { + BaseClient +} + +// NewReplicationNetworksClient creates an instance of the ReplicationNetworksClient client. +func NewReplicationNetworksClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworksClient { + return NewReplicationNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationNetworksClientWithBaseURI creates an instance of the ReplicationNetworksClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationNetworksClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworksClient { + return ReplicationNetworksClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of a network. +// Parameters: +// fabricName - server Id. +// networkName - primary network name. +func (client ReplicationNetworksClient) Get(ctx context.Context, fabricName string, networkName string) (result Network, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, networkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationNetworksClient) GetPreparer(ctx context.Context, fabricName string, networkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) GetResponder(resp *http.Response) (result Network, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the networks available in a vault. +func (client ReplicationNetworksClient) List(ctx context.Context) (result NetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.List") + defer func() { + sc := -1 + if result.nc.Response.Response != nil { + sc = result.nc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.nc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", resp, "Failure sending request") + return + } + + result.nc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", resp, "Failure responding to request") + return + } + if result.nc.hasNextLink() && result.nc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationNetworksClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) ListResponder(resp *http.Response) (result NetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationNetworksClient) listNextResults(ctx context.Context, lastResults NetworkCollection) (result NetworkCollection, err error) { + req, err := lastResults.networkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworksClient) ListComplete(ctx context.Context) (result NetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the networks available for a fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationNetworksClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result NetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.nc.Response.Response != nil { + sc = result.nc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.nc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.nc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.nc.hasNextLink() && result.nc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationNetworksClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) ListByReplicationFabricsResponder(resp *http.Response) (result NetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationNetworksClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults NetworkCollection) (result NetworkCollection, err error) { + req, err := lastResults.networkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworksClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result NetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationpolicies.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationpolicies.go new file mode 100644 index 000000000000..e7a604b070cc --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationpolicies.go @@ -0,0 +1,465 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationPoliciesClient is the client for the ReplicationPolicies methods of the Siterecovery service. +type ReplicationPoliciesClient struct { + BaseClient +} + +// NewReplicationPoliciesClient creates an instance of the ReplicationPoliciesClient client. +func NewReplicationPoliciesClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationPoliciesClient { + return NewReplicationPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationPoliciesClientWithBaseURI creates an instance of the ReplicationPoliciesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationPoliciesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationPoliciesClient { + return ReplicationPoliciesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a replication policy. +// Parameters: +// policyName - replication policy name. +// input - create policy input. +func (client ReplicationPoliciesClient) Create(ctx context.Context, policyName string, input CreatePolicyInput) (result ReplicationPoliciesCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, policyName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationPoliciesClient) CreatePreparer(ctx context.Context, policyName string, input CreatePolicyInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) CreateSender(req *http.Request) (future ReplicationPoliciesCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) CreateResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a replication policy. +// Parameters: +// policyName - replication policy name. +func (client ReplicationPoliciesClient) Delete(ctx context.Context, policyName string) (result ReplicationPoliciesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationPoliciesClient) DeletePreparer(ctx context.Context, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) DeleteSender(req *http.Request) (future ReplicationPoliciesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a replication policy. +// Parameters: +// policyName - replication policy name. +func (client ReplicationPoliciesClient) Get(ctx context.Context, policyName string) (result Policy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationPoliciesClient) GetPreparer(ctx context.Context, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) GetResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the replication policies for a vault. +func (client ReplicationPoliciesClient) List(ctx context.Context) (result PolicyCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.List") + defer func() { + sc := -1 + if result.pc.Response.Response != nil { + sc = result.pc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", resp, "Failure sending request") + return + } + + result.pc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", resp, "Failure responding to request") + return + } + if result.pc.hasNextLink() && result.pc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationPoliciesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) ListResponder(resp *http.Response) (result PolicyCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationPoliciesClient) listNextResults(ctx context.Context, lastResults PolicyCollection) (result PolicyCollection, err error) { + req, err := lastResults.policyCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationPoliciesClient) ListComplete(ctx context.Context) (result PolicyCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// Update the operation to update a replication policy. +// Parameters: +// policyName - policy Id. +// input - update Policy Input. +func (client ReplicationPoliciesClient) Update(ctx context.Context, policyName string, input UpdatePolicyInput) (result ReplicationPoliciesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, policyName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationPoliciesClient) UpdatePreparer(ctx context.Context, policyName string, input UpdatePolicyInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) UpdateSender(req *http.Request) (future ReplicationPoliciesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) UpdateResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationprotectableitems.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationprotectableitems.go new file mode 100644 index 000000000000..5742a85247e2 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationprotectableitems.go @@ -0,0 +1,245 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectableItemsClient is the client for the ReplicationProtectableItems methods of the Siterecovery +// service. +type ReplicationProtectableItemsClient struct { + BaseClient +} + +// NewReplicationProtectableItemsClient creates an instance of the ReplicationProtectableItemsClient client. +func NewReplicationProtectableItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectableItemsClient { + return NewReplicationProtectableItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectableItemsClientWithBaseURI creates an instance of the ReplicationProtectableItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationProtectableItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectableItemsClient { + return ReplicationProtectableItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get the operation to get the details of a protectable item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// protectableItemName - protectable item name. +func (client ReplicationProtectableItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (result ProtectableItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, protectableItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectableItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectableItemName": autorest.Encode("path", protectableItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems/{protectableItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectableItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectableItemsClient) GetResponder(resp *http.Response) (result ProtectableItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationProtectionContainers lists the protectable items in a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// filter - oData filter options. +// take - take OData query parameter. +// skipToken - skipToken OData query parameter. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result ProtectableItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.pic.Response.Response != nil { + sc = result.pic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName, filter, take, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.pic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.pic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.pic.hasNextLink() && result.pic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(take) > 0 { + queryParameters["$take"] = autorest.Encode("query", take) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ProtectableItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectableItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ProtectableItemCollection) (result ProtectableItemCollection, err error) { + req, err := lastResults.protectableItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result ProtectableItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName, filter, take, skipToken) + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationprotecteditems.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationprotecteditems.go new file mode 100644 index 000000000000..b29e7dbc53a8 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationprotecteditems.go @@ -0,0 +1,1935 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectedItemsClient is the client for the ReplicationProtectedItems methods of the Siterecovery service. +type ReplicationProtectedItemsClient struct { + BaseClient +} + +// NewReplicationProtectedItemsClient creates an instance of the ReplicationProtectedItemsClient client. +func NewReplicationProtectedItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectedItemsClient { + return NewReplicationProtectedItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectedItemsClientWithBaseURI creates an instance of the ReplicationProtectedItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationProtectedItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectedItemsClient { + return ReplicationProtectedItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// AddDisks operation to add disks(s) to the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// addDisksInput - add disks input. +func (client ReplicationProtectedItemsClient) AddDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput AddDisksInput) (result ReplicationProtectedItemsAddDisksFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.AddDisks") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddDisksPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, addDisksInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "AddDisks", nil, "Failure preparing request") + return + } + + result, err = client.AddDisksSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "AddDisks", result.Response(), "Failure sending request") + return + } + + return +} + +// AddDisksPreparer prepares the AddDisks request. +func (client ReplicationProtectedItemsClient) AddDisksPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput AddDisksInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/addDisks", pathParameters), + autorest.WithJSON(addDisksInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddDisksSender sends the AddDisks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) AddDisksSender(req *http.Request) (future ReplicationProtectedItemsAddDisksFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// AddDisksResponder handles the response to the AddDisks request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) AddDisksResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ApplyRecoveryPoint the operation to change the recovery point of a failed over replication protected item. +// Parameters: +// fabricName - the ARM fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replicated protected item name. +// applyRecoveryPointInput - the ApplyRecoveryPointInput. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPoint(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput ApplyRecoveryPointInput) (result ReplicationProtectedItemsApplyRecoveryPointFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ApplyRecoveryPoint") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: applyRecoveryPointInput, + Constraints: []validation.Constraint{{Target: "applyRecoveryPointInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", err.Error()) + } + + req, err := client.ApplyRecoveryPointPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, applyRecoveryPointInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", nil, "Failure preparing request") + return + } + + result, err = client.ApplyRecoveryPointSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", result.Response(), "Failure sending request") + return + } + + return +} + +// ApplyRecoveryPointPreparer prepares the ApplyRecoveryPoint request. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput ApplyRecoveryPointInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/applyRecoveryPoint", pathParameters), + autorest.WithJSON(applyRecoveryPointInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ApplyRecoveryPointSender sends the ApplyRecoveryPoint request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointSender(req *http.Request) (future ReplicationProtectedItemsApplyRecoveryPointFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ApplyRecoveryPointResponder handles the response to the ApplyRecoveryPoint request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Create the operation to create an ASR replication protected item (Enable replication). +// Parameters: +// fabricName - name of the fabric. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - a name for the replication protected item. +// input - enable Protection Input. +func (client ReplicationProtectedItemsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input EnableProtectionInput) (result ReplicationProtectedItemsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectedItemsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input EnableProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) CreateSender(req *http.Request) (future ReplicationProtectedItemsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) CreateResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to disable replication on a replication protected item. This will also remove the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// disableProtectionInput - disable protection input. +func (client ReplicationProtectedItemsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput DisableProtectionInput) (result ReplicationProtectedItemsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: disableProtectionInput, + Constraints: []validation.Constraint{{Target: "disableProtectionInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, disableProtectionInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectedItemsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput DisableProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/remove", pathParameters), + autorest.WithJSON(disableProtectionInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) DeleteSender(req *http.Request) (future ReplicationProtectedItemsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// FailoverCancel operation to cancel the failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) FailoverCancel(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsFailoverCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.FailoverCancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCancelPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCancel", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCancel", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCancelPreparer prepares the FailoverCancel request. +func (client ReplicationProtectedItemsClient) FailoverCancelPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCancelSender sends the FailoverCancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) FailoverCancelSender(req *http.Request) (future ReplicationProtectedItemsFailoverCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCancelResponder handles the response to the FailoverCancel request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) FailoverCancelResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// FailoverCommit operation to commit the failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) FailoverCommit(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsFailoverCommitFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.FailoverCommit") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCommitPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCommit", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCommitSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCommit", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCommitPreparer prepares the FailoverCommit request. +func (client ReplicationProtectedItemsClient) FailoverCommitPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCommit", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCommitSender sends the FailoverCommit request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) FailoverCommitSender(req *http.Request) (future ReplicationProtectedItemsFailoverCommitFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCommitResponder handles the response to the FailoverCommit request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) FailoverCommitResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of an ASR replication protected item. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectedItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) GetResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of ASR replication protected items in the vault. +// Parameters: +// skipToken - the pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. +// filter - oData filter options. +func (client ReplicationProtectedItemsClient) List(ctx context.Context, skipToken string, filter string) (result ReplicationProtectedItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.List") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectedItemsClient) ListPreparer(ctx context.Context, skipToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectedItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ListResponder(resp *http.Response) (result ReplicationProtectedItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectedItemsClient) listNextResults(ctx context.Context, lastResults ReplicationProtectedItemCollection) (result ReplicationProtectedItemCollection, err error) { + req, err := lastResults.replicationProtectedItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectedItemsClient) ListComplete(ctx context.Context, skipToken string, filter string) (result ReplicationProtectedItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, filter) + return +} + +// ListByReplicationProtectionContainers gets the list of ASR replication protected items in the protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectedItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ReplicationProtectedItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectedItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ReplicationProtectedItemCollection) (result ReplicationProtectedItemCollection, err error) { + req, err := lastResults.replicationProtectedItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectedItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName) + return +} + +// PlannedFailover operation to initiate a planned failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// failoverInput - planned failover input. +func (client ReplicationProtectedItemsClient) PlannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput PlannedFailoverInput) (result ReplicationProtectedItemsPlannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.PlannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PlannedFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "PlannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.PlannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "PlannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// PlannedFailoverPreparer prepares the PlannedFailover request. +func (client ReplicationProtectedItemsClient) PlannedFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput PlannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/plannedFailover", pathParameters), + autorest.WithJSON(failoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PlannedFailoverSender sends the PlannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) PlannedFailoverSender(req *http.Request) (future ReplicationProtectedItemsPlannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PlannedFailoverResponder handles the response to the PlannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) PlannedFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Purge the operation to delete or purge a replication protected item. This operation will force delete the +// replication protected item. Use the remove operation on replication protected item to perform a clean disable +// replication for the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) Purge(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationProtectedItemsClient) PurgePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) PurgeSender(req *http.Request) (future ReplicationProtectedItemsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RemoveDisks operation to remove disk(s) from the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// removeDisksInput - remove disks input. +func (client ReplicationProtectedItemsClient) RemoveDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput RemoveDisksInput) (result ReplicationProtectedItemsRemoveDisksFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.RemoveDisks") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RemoveDisksPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, removeDisksInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RemoveDisks", nil, "Failure preparing request") + return + } + + result, err = client.RemoveDisksSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RemoveDisks", result.Response(), "Failure sending request") + return + } + + return +} + +// RemoveDisksPreparer prepares the RemoveDisks request. +func (client ReplicationProtectedItemsClient) RemoveDisksPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput RemoveDisksInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/removeDisks", pathParameters), + autorest.WithJSON(removeDisksInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RemoveDisksSender sends the RemoveDisks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) RemoveDisksSender(req *http.Request) (future ReplicationProtectedItemsRemoveDisksFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RemoveDisksResponder handles the response to the RemoveDisks request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) RemoveDisksResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RepairReplication the operation to start resynchronize/repair replication for a replication protected item requiring +// resynchronization. +// Parameters: +// fabricName - the name of the fabric. +// protectionContainerName - the name of the container. +// replicatedProtectedItemName - the name of the replication protected item. +func (client ReplicationProtectedItemsClient) RepairReplication(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsRepairReplicationFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.RepairReplication") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RepairReplicationPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RepairReplication", nil, "Failure preparing request") + return + } + + result, err = client.RepairReplicationSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RepairReplication", result.Response(), "Failure sending request") + return + } + + return +} + +// RepairReplicationPreparer prepares the RepairReplication request. +func (client ReplicationProtectedItemsClient) RepairReplicationPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/repairReplication", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RepairReplicationSender sends the RepairReplication request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) RepairReplicationSender(req *http.Request) (future ReplicationProtectedItemsRepairReplicationFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RepairReplicationResponder handles the response to the RepairReplication request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) RepairReplicationResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Reprotect operation to reprotect or reverse replicate a failed over replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// reprotectInput - reverse replication input. +func (client ReplicationProtectedItemsClient) Reprotect(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput ReverseReplicationInput) (result ReplicationProtectedItemsReprotectFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Reprotect") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReprotectPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, reprotectInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Reprotect", nil, "Failure preparing request") + return + } + + result, err = client.ReprotectSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Reprotect", result.Response(), "Failure sending request") + return + } + + return +} + +// ReprotectPreparer prepares the Reprotect request. +func (client ReplicationProtectedItemsClient) ReprotectPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput ReverseReplicationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/reProtect", pathParameters), + autorest.WithJSON(reprotectInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReprotectSender sends the Reprotect request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ReprotectSender(req *http.Request) (future ReplicationProtectedItemsReprotectFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReprotectResponder handles the response to the Reprotect request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ReprotectResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ResolveHealthErrors operation to resolve health issues of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// resolveHealthInput - health issue input object. +func (client ReplicationProtectedItemsClient) ResolveHealthErrors(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput ResolveHealthInput) (result ReplicationProtectedItemsResolveHealthErrorsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ResolveHealthErrors") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResolveHealthErrorsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, resolveHealthInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ResolveHealthErrors", nil, "Failure preparing request") + return + } + + result, err = client.ResolveHealthErrorsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ResolveHealthErrors", result.Response(), "Failure sending request") + return + } + + return +} + +// ResolveHealthErrorsPreparer prepares the ResolveHealthErrors request. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput ResolveHealthInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/resolveHealthErrors", pathParameters), + autorest.WithJSON(resolveHealthInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResolveHealthErrorsSender sends the ResolveHealthErrors request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsSender(req *http.Request) (future ReplicationProtectedItemsResolveHealthErrorsFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResolveHealthErrorsResponder handles the response to the ResolveHealthErrors request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailover operation to perform a test failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// testfailoverInput - test failover input. +func (client ReplicationProtectedItemsClient) TestFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput TestFailoverInput) (result ReplicationProtectedItemsTestFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.TestFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testfailoverInput, + Constraints: []validation.Constraint{{Target: "testfailoverInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "TestFailover", err.Error()) + } + + req, err := client.TestFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, testfailoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailover", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverPreparer prepares the TestFailover request. +func (client ReplicationProtectedItemsClient) TestFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput TestFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailover", pathParameters), + autorest.WithJSON(testfailoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverSender sends the TestFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) TestFailoverSender(req *http.Request) (future ReplicationProtectedItemsTestFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverResponder handles the response to the TestFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) TestFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailoverCleanup operation to clean up the test failover of a replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// cleanupInput - test failover cleanup input. +func (client ReplicationProtectedItemsClient) TestFailoverCleanup(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput TestFailoverCleanupInput) (result ReplicationProtectedItemsTestFailoverCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.TestFailoverCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: cleanupInput, + Constraints: []validation.Constraint{{Target: "cleanupInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "cleanupInput.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "cleanupInput.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", err.Error()) + } + + req, err := client.TestFailoverCleanupPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, cleanupInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverCleanupPreparer prepares the TestFailoverCleanup request. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput TestFailoverCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailoverCleanup", pathParameters), + autorest.WithJSON(cleanupInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverCleanupSender sends the TestFailoverCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupSender(req *http.Request) (future ReplicationProtectedItemsTestFailoverCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverCleanupResponder handles the response to the TestFailoverCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UnplannedFailover operation to initiate a failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// failoverInput - failover input. +func (client ReplicationProtectedItemsClient) UnplannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput UnplannedFailoverInput) (result ReplicationProtectedItemsUnplannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UnplannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: failoverInput, + Constraints: []validation.Constraint{{Target: "failoverInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", err.Error()) + } + + req, err := client.UnplannedFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.UnplannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// UnplannedFailoverPreparer prepares the UnplannedFailover request. +func (client ReplicationProtectedItemsClient) UnplannedFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput UnplannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/unplannedFailover", pathParameters), + autorest.WithJSON(failoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UnplannedFailoverSender sends the UnplannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UnplannedFailoverSender(req *http.Request) (future ReplicationProtectedItemsUnplannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UnplannedFailoverResponder handles the response to the UnplannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UnplannedFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update the recovery settings of an ASR replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// updateProtectionInput - update protection input. +func (client ReplicationProtectedItemsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput UpdateReplicationProtectedItemInput) (result ReplicationProtectedItemsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, updateProtectionInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationProtectedItemsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput UpdateReplicationProtectedItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithJSON(updateProtectionInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateSender(req *http.Request) (future ReplicationProtectedItemsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateAppliance the operation to update appliance of an ASR replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// applianceUpdateInput - appliance update protection input. +func (client ReplicationProtectedItemsClient) UpdateAppliance(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput UpdateApplianceForReplicationProtectedItemInput) (result ReplicationProtectedItemsUpdateApplianceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UpdateAppliance") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: applianceUpdateInput, + Constraints: []validation.Constraint{{Target: "applianceUpdateInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "applianceUpdateInput.Properties.TargetApplianceID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "UpdateAppliance", err.Error()) + } + + req, err := client.UpdateAppliancePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, applianceUpdateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateAppliance", nil, "Failure preparing request") + return + } + + result, err = client.UpdateApplianceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateAppliance", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateAppliancePreparer prepares the UpdateAppliance request. +func (client ReplicationProtectedItemsClient) UpdateAppliancePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput UpdateApplianceForReplicationProtectedItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/updateAppliance", pathParameters), + autorest.WithJSON(applianceUpdateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateApplianceSender sends the UpdateAppliance request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateApplianceSender(req *http.Request) (future ReplicationProtectedItemsUpdateApplianceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateApplianceResponder handles the response to the UpdateAppliance request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateApplianceResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateMobilityService the operation to update(push update) the installed mobility service software on a replication +// protected item to the latest available version. +// Parameters: +// fabricName - the name of the fabric containing the protected item. +// protectionContainerName - the name of the container containing the protected item. +// replicationProtectedItemName - 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. +func (client ReplicationProtectedItemsClient) UpdateMobilityService(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest UpdateMobilityServiceRequest) (result ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UpdateMobilityService") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateMobilityServicePreparer(ctx, fabricName, protectionContainerName, replicationProtectedItemName, updateMobilityServiceRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateMobilityService", nil, "Failure preparing request") + return + } + + result, err = client.UpdateMobilityServiceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateMobilityService", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateMobilityServicePreparer prepares the UpdateMobilityService request. +func (client ReplicationProtectedItemsClient) UpdateMobilityServicePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest UpdateMobilityServiceRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicationProtectedItemName": autorest.Encode("path", replicationProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicationProtectedItemName}/updateMobilityService", pathParameters), + autorest.WithJSON(updateMobilityServiceRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateMobilityServiceSender sends the UpdateMobilityService request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateMobilityServiceSender(req *http.Request) (future ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateMobilityServiceResponder handles the response to the UpdateMobilityService request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateMobilityServiceResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationprotectioncontainermappings.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationprotectioncontainermappings.go new file mode 100644 index 000000000000..1e2f8e49f431 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationprotectioncontainermappings.go @@ -0,0 +1,688 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionContainerMappingsClient is the client for the ReplicationProtectionContainerMappings methods of +// the Siterecovery service. +type ReplicationProtectionContainerMappingsClient struct { + BaseClient +} + +// NewReplicationProtectionContainerMappingsClient creates an instance of the +// ReplicationProtectionContainerMappingsClient client. +func NewReplicationProtectionContainerMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainerMappingsClient { + return NewReplicationProtectionContainerMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionContainerMappingsClientWithBaseURI creates an instance of the +// ReplicationProtectionContainerMappingsClient client using a custom endpoint. Use this when interacting with an +// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationProtectionContainerMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainerMappingsClient { + return ReplicationProtectionContainerMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// creationInput - mapping creation input. +func (client ReplicationProtectionContainerMappingsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput CreateProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, mappingName, creationInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionContainerMappingsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput CreateProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithJSON(creationInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) CreateSender(req *http.Request) (future ReplicationProtectionContainerMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) CreateResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete or remove a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// removalInput - removal input. +func (client ReplicationProtectionContainerMappingsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput RemoveProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, mappingName, removalInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectionContainerMappingsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput RemoveProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}/remove", pathParameters), + autorest.WithJSON(removalInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) DeleteSender(req *http.Request) (future ReplicationProtectionContainerMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection Container mapping name. +func (client ReplicationProtectionContainerMappingsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result ProtectionContainerMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, mappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionContainerMappingsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) GetResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the protection container mappings in the vault. +func (client ReplicationProtectionContainerMappingsClient) List(ctx context.Context) (result ProtectionContainerMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.List") + defer func() { + sc := -1 + if result.pcmc.Response.Response != nil { + sc = result.pcmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pcmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", resp, "Failure sending request") + return + } + + result.pcmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.pcmc.hasNextLink() && result.pcmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionContainerMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionContainerMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) ListResponder(resp *http.Response) (result ProtectionContainerMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainerMappingsClient) listNextResults(ctx context.Context, lastResults ProtectionContainerMappingCollection) (result ProtectionContainerMappingCollection, err error) { + req, err := lastResults.protectionContainerMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainerMappingsClient) ListComplete(ctx context.Context) (result ProtectionContainerMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationProtectionContainers lists the protection container mappings for a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainerMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.pcmc.Response.Response != nil { + sc = result.pcmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.pcmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.pcmc, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.pcmc.hasNextLink() && result.pcmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ProtectionContainerMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainerMappingsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ProtectionContainerMappingCollection) (result ProtectionContainerMappingCollection, err error) { + req, err := lastResults.protectionContainerMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainerMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName) + return +} + +// Purge the operation to purge(force delete) a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +func (client ReplicationProtectionContainerMappingsClient) Purge(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result ReplicationProtectionContainerMappingsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, protectionContainerName, mappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationProtectionContainerMappingsClient) PurgePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) PurgeSender(req *http.Request) (future ReplicationProtectionContainerMappingsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update the operation to update protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// updateInput - mapping update input. +func (client ReplicationProtectionContainerMappingsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput UpdateProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, mappingName, updateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationProtectionContainerMappingsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput UpdateProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithJSON(updateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) UpdateSender(req *http.Request) (future ReplicationProtectionContainerMappingsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) UpdateResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationprotectioncontainers.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationprotectioncontainers.go new file mode 100644 index 000000000000..8429b74f27ac --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationprotectioncontainers.go @@ -0,0 +1,677 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionContainersClient is the client for the ReplicationProtectionContainers methods of the +// Siterecovery service. +type ReplicationProtectionContainersClient struct { + BaseClient +} + +// NewReplicationProtectionContainersClient creates an instance of the ReplicationProtectionContainersClient client. +func NewReplicationProtectionContainersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainersClient { + return NewReplicationProtectionContainersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionContainersClientWithBaseURI creates an instance of the ReplicationProtectionContainersClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationProtectionContainersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainersClient { + return ReplicationProtectionContainersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create operation to create a protection container. +// Parameters: +// fabricName - unique fabric ARM name. +// protectionContainerName - unique protection container ARM name. +// creationInput - creation input. +func (client ReplicationProtectionContainersClient) Create(ctx context.Context, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput) (result ReplicationProtectionContainersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, creationInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionContainersClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}", pathParameters), + autorest.WithJSON(creationInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) CreateSender(req *http.Request) (future ReplicationProtectionContainersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) CreateResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete operation to remove a protection container. +// Parameters: +// fabricName - unique fabric ARM name. +// protectionContainerName - unique protection container ARM name. +func (client ReplicationProtectionContainersClient) Delete(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectionContainersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectionContainersClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) DeleteSender(req *http.Request) (future ReplicationProtectionContainersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DiscoverProtectableItem the operation to a add a protectable item to a protection container(Add physical server). +// Parameters: +// fabricName - the name of the fabric. +// protectionContainerName - the name of the protection container. +// discoverProtectableItemRequest - the request object to add a protectable item. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItem(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest) (result ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.DiscoverProtectableItem") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DiscoverProtectableItemPreparer(ctx, fabricName, protectionContainerName, discoverProtectableItemRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "DiscoverProtectableItem", nil, "Failure preparing request") + return + } + + result, err = client.DiscoverProtectableItemSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "DiscoverProtectableItem", result.Response(), "Failure sending request") + return + } + + return +} + +// DiscoverProtectableItemPreparer prepares the DiscoverProtectableItem request. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemPreparer(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/discoverProtectableItem", pathParameters), + autorest.WithJSON(discoverProtectableItemRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DiscoverProtectableItemSender sends the DiscoverProtectableItem request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemSender(req *http.Request) (future ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DiscoverProtectableItemResponder handles the response to the DiscoverProtectableItem request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectionContainersClient) Get(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainer, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionContainersClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) GetResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the protection containers in a vault. +func (client ReplicationProtectionContainersClient) List(ctx context.Context) (result ProtectionContainerCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.List") + defer func() { + sc := -1 + if result.pcc.Response.Response != nil { + sc = result.pcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", resp, "Failure sending request") + return + } + + result.pcc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", resp, "Failure responding to request") + return + } + if result.pcc.hasNextLink() && result.pcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionContainersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionContainers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) ListResponder(resp *http.Response) (result ProtectionContainerCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainersClient) listNextResults(ctx context.Context, lastResults ProtectionContainerCollection) (result ProtectionContainerCollection, err error) { + req, err := lastResults.protectionContainerCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainersClient) ListComplete(ctx context.Context) (result ProtectionContainerCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the protection containers in the specified fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationProtectionContainersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result ProtectionContainerCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.pcc.Response.Response != nil { + sc = result.pcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.pcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.pcc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.pcc.hasNextLink() && result.pcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsResponder(resp *http.Response) (result ProtectionContainerCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults ProtectionContainerCollection) (result ProtectionContainerCollection, err error) { + req, err := lastResults.protectionContainerCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result ProtectionContainerCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// SwitchProtection operation to switch protection from one container to another or one replication provider to +// another. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// switchInput - switch protection input. +func (client ReplicationProtectionContainersClient) SwitchProtection(ctx context.Context, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput) (result ReplicationProtectionContainersSwitchProtectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.SwitchProtection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.SwitchProtectionPreparer(ctx, fabricName, protectionContainerName, switchInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "SwitchProtection", nil, "Failure preparing request") + return + } + + result, err = client.SwitchProtectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "SwitchProtection", result.Response(), "Failure sending request") + return + } + + return +} + +// SwitchProtectionPreparer prepares the SwitchProtection request. +func (client ReplicationProtectionContainersClient) SwitchProtectionPreparer(ctx context.Context, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/switchprotection", pathParameters), + autorest.WithJSON(switchInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SwitchProtectionSender sends the SwitchProtection request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) SwitchProtectionSender(req *http.Request) (future ReplicationProtectionContainersSwitchProtectionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// SwitchProtectionResponder handles the response to the SwitchProtection request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) SwitchProtectionResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationprotectionintents.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationprotectionintents.go new file mode 100644 index 000000000000..ec8fd2c8d57c --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationprotectionintents.go @@ -0,0 +1,312 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionIntentsClient is the client for the ReplicationProtectionIntents methods of the Siterecovery +// service. +type ReplicationProtectionIntentsClient struct { + BaseClient +} + +// NewReplicationProtectionIntentsClient creates an instance of the ReplicationProtectionIntentsClient client. +func NewReplicationProtectionIntentsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionIntentsClient { + return NewReplicationProtectionIntentsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionIntentsClientWithBaseURI creates an instance of the ReplicationProtectionIntentsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationProtectionIntentsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionIntentsClient { + return ReplicationProtectionIntentsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR replication protection intent item. +// Parameters: +// intentObjectName - a name for the replication protection item. +// input - create Protection Intent Input. +func (client ReplicationProtectionIntentsClient) Create(ctx context.Context, intentObjectName string, input CreateProtectionIntentInput) (result ReplicationProtectionIntent, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, intentObjectName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionIntentsClient) CreatePreparer(ctx context.Context, intentObjectName string, input CreateProtectionIntentInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "intentObjectName": autorest.Encode("path", intentObjectName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) CreateResponder(resp *http.Response) (result ReplicationProtectionIntent, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of an ASR replication protection intent. +// Parameters: +// intentObjectName - replication protection intent name. +func (client ReplicationProtectionIntentsClient) Get(ctx context.Context, intentObjectName string) (result ReplicationProtectionIntent, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, intentObjectName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionIntentsClient) GetPreparer(ctx context.Context, intentObjectName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "intentObjectName": autorest.Encode("path", intentObjectName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) GetResponder(resp *http.Response) (result ReplicationProtectionIntent, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of ASR replication protection intent objects in the vault. +// Parameters: +// skipToken - the pagination token. +// takeToken - the page size. +func (client ReplicationProtectionIntentsClient) List(ctx context.Context, skipToken string, takeToken string) (result ReplicationProtectionIntentCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.List") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, takeToken) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionIntentsClient) ListPreparer(ctx context.Context, skipToken string, takeToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) ListResponder(resp *http.Response) (result ReplicationProtectionIntentCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionIntentsClient) listNextResults(ctx context.Context, lastResults ReplicationProtectionIntentCollection) (result ReplicationProtectionIntentCollection, err error) { + req, err := lastResults.replicationProtectionIntentCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionIntentsClient) ListComplete(ctx context.Context, skipToken string, takeToken string) (result ReplicationProtectionIntentCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, takeToken) + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationrecoveryplans.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationrecoveryplans.go new file mode 100644 index 000000000000..583e4693dda8 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationrecoveryplans.go @@ -0,0 +1,1069 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationRecoveryPlansClient is the client for the ReplicationRecoveryPlans methods of the Siterecovery service. +type ReplicationRecoveryPlansClient struct { + BaseClient +} + +// NewReplicationRecoveryPlansClient creates an instance of the ReplicationRecoveryPlansClient client. +func NewReplicationRecoveryPlansClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryPlansClient { + return NewReplicationRecoveryPlansClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationRecoveryPlansClientWithBaseURI creates an instance of the ReplicationRecoveryPlansClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationRecoveryPlansClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryPlansClient { + return ReplicationRecoveryPlansClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery Plan creation input. +func (client ReplicationRecoveryPlansClient) Create(ctx context.Context, recoveryPlanName string, input CreateRecoveryPlanInput) (result ReplicationRecoveryPlansCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.PrimaryFabricID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "input.Properties.RecoveryFabricID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "input.Properties.Groups", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationRecoveryPlansClient) CreatePreparer(ctx context.Context, recoveryPlanName string, input CreateRecoveryPlanInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) CreateSender(req *http.Request) (future ReplicationRecoveryPlansCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) CreateResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) Delete(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationRecoveryPlansClient) DeletePreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) DeleteSender(req *http.Request) (future ReplicationRecoveryPlansDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// FailoverCancel the operation to cancel the failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) FailoverCancel(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansFailoverCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.FailoverCancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCancelPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCancel", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCancel", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCancelPreparer prepares the FailoverCancel request. +func (client ReplicationRecoveryPlansClient) FailoverCancelPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCancelSender sends the FailoverCancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) FailoverCancelSender(req *http.Request) (future ReplicationRecoveryPlansFailoverCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCancelResponder handles the response to the FailoverCancel request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) FailoverCancelResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// FailoverCommit the operation to commit the failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) FailoverCommit(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansFailoverCommitFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.FailoverCommit") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCommitPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCommit", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCommitSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCommit", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCommitPreparer prepares the FailoverCommit request. +func (client ReplicationRecoveryPlansClient) FailoverCommitPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCommit", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCommitSender sends the FailoverCommit request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) FailoverCommitSender(req *http.Request) (future ReplicationRecoveryPlansFailoverCommitFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCommitResponder handles the response to the FailoverCommit request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) FailoverCommitResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of the recovery plan. +// Parameters: +// recoveryPlanName - name of the recovery plan. +func (client ReplicationRecoveryPlansClient) Get(ctx context.Context, recoveryPlanName string) (result RecoveryPlan, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationRecoveryPlansClient) GetPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) GetResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the recovery plans in the vault. +func (client ReplicationRecoveryPlansClient) List(ctx context.Context) (result RecoveryPlanCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.List") + defer func() { + sc := -1 + if result.RPCVar.Response.Response != nil { + sc = result.RPCVar.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.RPCVar.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", resp, "Failure sending request") + return + } + + result.RPCVar, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", resp, "Failure responding to request") + return + } + if result.RPCVar.hasNextLink() && result.RPCVar.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationRecoveryPlansClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) ListResponder(resp *http.Response) (result RecoveryPlanCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryPlansClient) listNextResults(ctx context.Context, lastResults RecoveryPlanCollection) (result RecoveryPlanCollection, err error) { + req, err := lastResults.recoveryPlanCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryPlansClient) ListComplete(ctx context.Context) (result RecoveryPlanCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// PlannedFailover the operation to start the planned failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - failover input. +func (client ReplicationRecoveryPlansClient) PlannedFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput) (result ReplicationRecoveryPlansPlannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.PlannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", err.Error()) + } + + req, err := client.PlannedFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.PlannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// PlannedFailoverPreparer prepares the PlannedFailover request. +func (client ReplicationRecoveryPlansClient) PlannedFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/plannedFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PlannedFailoverSender sends the PlannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) PlannedFailoverSender(req *http.Request) (future ReplicationRecoveryPlansPlannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PlannedFailoverResponder handles the response to the PlannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) PlannedFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Reprotect the operation to reprotect(reverse replicate) a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) Reprotect(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansReprotectFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Reprotect") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReprotectPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Reprotect", nil, "Failure preparing request") + return + } + + result, err = client.ReprotectSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Reprotect", result.Response(), "Failure sending request") + return + } + + return +} + +// ReprotectPreparer prepares the Reprotect request. +func (client ReplicationRecoveryPlansClient) ReprotectPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/reProtect", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReprotectSender sends the Reprotect request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) ReprotectSender(req *http.Request) (future ReplicationRecoveryPlansReprotectFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReprotectResponder handles the response to the Reprotect request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) ReprotectResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailover the operation to start the test failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan test failover input. +func (client ReplicationRecoveryPlansClient) TestFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverInput) (result ReplicationRecoveryPlansTestFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.TestFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.NetworkType", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "TestFailover", err.Error()) + } + + req, err := client.TestFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailover", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverPreparer prepares the TestFailover request. +func (client ReplicationRecoveryPlansClient) TestFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverSender sends the TestFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) TestFailoverSender(req *http.Request) (future ReplicationRecoveryPlansTestFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverResponder handles the response to the TestFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) TestFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailoverCleanup the operation to cleanup test failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan test failover cleanup input. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanup(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput) (result ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.TestFailoverCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "input.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", err.Error()) + } + + req, err := client.TestFailoverCleanupPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverCleanupPreparer prepares the TestFailoverCleanup request. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailoverCleanup", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverCleanupSender sends the TestFailoverCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupSender(req *http.Request) (future ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverCleanupResponder handles the response to the TestFailoverCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UnplannedFailover the operation to start the unplanned failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan unplanned failover input. +func (client ReplicationRecoveryPlansClient) UnplannedFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput) (result ReplicationRecoveryPlansUnplannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.UnplannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", err.Error()) + } + + req, err := client.UnplannedFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.UnplannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// UnplannedFailoverPreparer prepares the UnplannedFailover request. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/unplannedFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UnplannedFailoverSender sends the UnplannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverSender(req *http.Request) (future ReplicationRecoveryPlansUnplannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UnplannedFailoverResponder handles the response to the UnplannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - update recovery plan input. +func (client ReplicationRecoveryPlansClient) Update(ctx context.Context, recoveryPlanName string, input UpdateRecoveryPlanInput) (result ReplicationRecoveryPlansUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationRecoveryPlansClient) UpdatePreparer(ctx context.Context, recoveryPlanName string, input UpdateRecoveryPlanInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) UpdateSender(req *http.Request) (future ReplicationRecoveryPlansUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) UpdateResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationrecoveryservicesproviders.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationrecoveryservicesproviders.go new file mode 100644 index 000000000000..39cbbfc52f5f --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationrecoveryservicesproviders.go @@ -0,0 +1,700 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationRecoveryServicesProvidersClient is the client for the ReplicationRecoveryServicesProviders methods of the +// Siterecovery service. +type ReplicationRecoveryServicesProvidersClient struct { + BaseClient +} + +// NewReplicationRecoveryServicesProvidersClient creates an instance of the ReplicationRecoveryServicesProvidersClient +// client. +func NewReplicationRecoveryServicesProvidersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryServicesProvidersClient { + return NewReplicationRecoveryServicesProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationRecoveryServicesProvidersClientWithBaseURI creates an instance of the +// ReplicationRecoveryServicesProvidersClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationRecoveryServicesProvidersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryServicesProvidersClient { + return ReplicationRecoveryServicesProvidersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to add a recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +// addProviderInput - add provider input. +func (client ReplicationRecoveryServicesProvidersClient) Create(ctx context.Context, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput) (result ReplicationRecoveryServicesProvidersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: addProviderInput, + Constraints: []validation.Constraint{{Target: "addProviderInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.MachineName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.AuthenticationIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.ResourceAccessIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, providerName, addProviderInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationRecoveryServicesProvidersClient) CreatePreparer(ctx context.Context, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithJSON(addProviderInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) CreateSender(req *http.Request) (future ReplicationRecoveryServicesProvidersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) CreateResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to removes/delete(unregister) a recovery services provider from the vault. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Delete(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationRecoveryServicesProvidersClient) DeletePreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) DeleteSender(req *http.Request) (future ReplicationRecoveryServicesProvidersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of registered recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Get(ctx context.Context, fabricName string, providerName string) (result RecoveryServicesProvider, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationRecoveryServicesProvidersClient) GetPreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) GetResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the registered recovery services providers in the vault. +func (client ReplicationRecoveryServicesProvidersClient) List(ctx context.Context) (result RecoveryServicesProviderCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.List") + defer func() { + sc := -1 + if result.rspc.Response.Response != nil { + sc = result.rspc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rspc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", resp, "Failure sending request") + return + } + + result.rspc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", resp, "Failure responding to request") + return + } + if result.rspc.hasNextLink() && result.rspc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationRecoveryServicesProvidersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryServicesProviders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) ListResponder(resp *http.Response) (result RecoveryServicesProviderCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryServicesProvidersClient) listNextResults(ctx context.Context, lastResults RecoveryServicesProviderCollection) (result RecoveryServicesProviderCollection, err error) { + req, err := lastResults.recoveryServicesProviderCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryServicesProvidersClient) ListComplete(ctx context.Context) (result RecoveryServicesProviderCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the registered recovery services providers for the specified fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result RecoveryServicesProviderCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.rspc.Response.Response != nil { + sc = result.rspc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.rspc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.rspc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.rspc.hasNextLink() && result.rspc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsResponder(resp *http.Response) (result RecoveryServicesProviderCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryServicesProvidersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults RecoveryServicesProviderCollection) (result RecoveryServicesProviderCollection, err error) { + req, err := lastResults.recoveryServicesProviderCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result RecoveryServicesProviderCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// Purge the operation to purge(force delete) a recovery services provider from the vault. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Purge(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationRecoveryServicesProvidersClient) PurgePreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) PurgeSender(req *http.Request) (future ReplicationRecoveryServicesProvidersPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RefreshProvider the operation to refresh the information from the recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProvider(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.RefreshProvider") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RefreshProviderPreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "RefreshProvider", nil, "Failure preparing request") + return + } + + result, err = client.RefreshProviderSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "RefreshProvider", result.Response(), "Failure sending request") + return + } + + return +} + +// RefreshProviderPreparer prepares the RefreshProvider request. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderPreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/refreshProvider", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RefreshProviderSender sends the RefreshProvider request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderSender(req *http.Request) (future ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RefreshProviderResponder handles the response to the RefreshProvider request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationstorageclassificationmappings.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationstorageclassificationmappings.go new file mode 100644 index 000000000000..2eb01b9d734c --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationstorageclassificationmappings.go @@ -0,0 +1,517 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationStorageClassificationMappingsClient is the client for the ReplicationStorageClassificationMappings +// methods of the Siterecovery service. +type ReplicationStorageClassificationMappingsClient struct { + BaseClient +} + +// NewReplicationStorageClassificationMappingsClient creates an instance of the +// ReplicationStorageClassificationMappingsClient client. +func NewReplicationStorageClassificationMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationMappingsClient { + return NewReplicationStorageClassificationMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationStorageClassificationMappingsClientWithBaseURI creates an instance of the +// ReplicationStorageClassificationMappingsClient client using a custom endpoint. Use this when interacting with an +// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationStorageClassificationMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationMappingsClient { + return ReplicationStorageClassificationMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +// pairingInput - pairing input. +func (client ReplicationStorageClassificationMappingsClient) Create(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput StorageClassificationMappingInput) (result ReplicationStorageClassificationMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName, pairingInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationStorageClassificationMappingsClient) CreatePreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput StorageClassificationMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithJSON(pairingInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) CreateSender(req *http.Request) (future ReplicationStorageClassificationMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) CreateResponder(resp *http.Response) (result StorageClassificationMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +func (client ReplicationStorageClassificationMappingsClient) Delete(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result ReplicationStorageClassificationMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationStorageClassificationMappingsClient) DeletePreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) DeleteSender(req *http.Request) (future ReplicationStorageClassificationMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the specified storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +func (client ReplicationStorageClassificationMappingsClient) Get(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result StorageClassificationMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationStorageClassificationMappingsClient) GetPreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) GetResponder(resp *http.Response) (result StorageClassificationMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the storage classification mappings in the vault. +func (client ReplicationStorageClassificationMappingsClient) List(ctx context.Context) (result StorageClassificationMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.List") + defer func() { + sc := -1 + if result.scmc.Response.Response != nil { + sc = result.scmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.scmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", resp, "Failure sending request") + return + } + + result.scmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.scmc.hasNextLink() && result.scmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationStorageClassificationMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationStorageClassificationMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) ListResponder(resp *http.Response) (result StorageClassificationMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationMappingsClient) listNextResults(ctx context.Context, lastResults StorageClassificationMappingCollection) (result StorageClassificationMappingCollection, err error) { + req, err := lastResults.storageClassificationMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationMappingsClient) ListComplete(ctx context.Context) (result StorageClassificationMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationStorageClassifications lists the storage classification mappings for the fabric. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassifications(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassificationMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.ListByReplicationStorageClassifications") + defer func() { + sc := -1 + if result.scmc.Response.Response != nil { + sc = result.scmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationStorageClassificationsNextResults + req, err := client.ListByReplicationStorageClassificationsPreparer(ctx, fabricName, storageClassificationName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationStorageClassificationsSender(req) + if err != nil { + result.scmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", resp, "Failure sending request") + return + } + + result.scmc, err = client.ListByReplicationStorageClassificationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", resp, "Failure responding to request") + return + } + if result.scmc.hasNextLink() && result.scmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationStorageClassificationsPreparer prepares the ListByReplicationStorageClassifications request. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsPreparer(ctx context.Context, fabricName string, storageClassificationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationStorageClassificationsSender sends the ListByReplicationStorageClassifications request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationStorageClassificationsResponder handles the response to the ListByReplicationStorageClassifications request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsResponder(resp *http.Response) (result StorageClassificationMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationStorageClassificationsNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationMappingsClient) listByReplicationStorageClassificationsNextResults(ctx context.Context, lastResults StorageClassificationMappingCollection) (result StorageClassificationMappingCollection, err error) { + req, err := lastResults.storageClassificationMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationStorageClassificationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationStorageClassificationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationStorageClassificationsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsComplete(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassificationMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.ListByReplicationStorageClassifications") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationStorageClassifications(ctx, fabricName, storageClassificationName) + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationstorageclassifications.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationstorageclassifications.go new file mode 100644 index 000000000000..f9a79c4c894b --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationstorageclassifications.go @@ -0,0 +1,345 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationStorageClassificationsClient is the client for the ReplicationStorageClassifications methods of the +// Siterecovery service. +type ReplicationStorageClassificationsClient struct { + BaseClient +} + +// NewReplicationStorageClassificationsClient creates an instance of the ReplicationStorageClassificationsClient +// client. +func NewReplicationStorageClassificationsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationsClient { + return NewReplicationStorageClassificationsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationStorageClassificationsClientWithBaseURI creates an instance of the +// ReplicationStorageClassificationsClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationStorageClassificationsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationsClient { + return ReplicationStorageClassificationsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of the specified storage classification. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +func (client ReplicationStorageClassificationsClient) Get(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassification, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, storageClassificationName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationStorageClassificationsClient) GetPreparer(ctx context.Context, fabricName string, storageClassificationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) GetResponder(resp *http.Response) (result StorageClassification, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the storage classifications in the vault. +func (client ReplicationStorageClassificationsClient) List(ctx context.Context) (result StorageClassificationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.List") + defer func() { + sc := -1 + if result.scc.Response.Response != nil { + sc = result.scc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.scc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", resp, "Failure sending request") + return + } + + result.scc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", resp, "Failure responding to request") + return + } + if result.scc.hasNextLink() && result.scc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationStorageClassificationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationStorageClassifications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) ListResponder(resp *http.Response) (result StorageClassificationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationsClient) listNextResults(ctx context.Context, lastResults StorageClassificationCollection) (result StorageClassificationCollection, err error) { + req, err := lastResults.storageClassificationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationsClient) ListComplete(ctx context.Context) (result StorageClassificationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the storage classifications available in the specified fabric. +// Parameters: +// fabricName - site name of interest. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result StorageClassificationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.scc.Response.Response != nil { + sc = result.scc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.scc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.scc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.scc.hasNextLink() && result.scc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsResponder(resp *http.Response) (result StorageClassificationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationsClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults StorageClassificationCollection) (result StorageClassificationCollection, err error) { + req, err := lastResults.storageClassificationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result StorageClassificationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationvaulthealth.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationvaulthealth.go new file mode 100644 index 000000000000..8dba974bde25 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationvaulthealth.go @@ -0,0 +1,181 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationVaultHealthClient is the client for the ReplicationVaultHealth methods of the Siterecovery service. +type ReplicationVaultHealthClient struct { + BaseClient +} + +// NewReplicationVaultHealthClient creates an instance of the ReplicationVaultHealthClient client. +func NewReplicationVaultHealthClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultHealthClient { + return NewReplicationVaultHealthClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationVaultHealthClientWithBaseURI creates an instance of the ReplicationVaultHealthClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewReplicationVaultHealthClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultHealthClient { + return ReplicationVaultHealthClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the health details of the vault. +func (client ReplicationVaultHealthClient) Get(ctx context.Context) (result VaultHealthDetails, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultHealthClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationVaultHealthClient) GetPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultHealthClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationVaultHealthClient) GetResponder(resp *http.Response) (result VaultHealthDetails, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Refresh sends the refresh request. +func (client ReplicationVaultHealthClient) Refresh(ctx context.Context) (result ReplicationVaultHealthRefreshFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultHealthClient.Refresh") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RefreshPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Refresh", nil, "Failure preparing request") + return + } + + result, err = client.RefreshSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Refresh", result.Response(), "Failure sending request") + return + } + + return +} + +// RefreshPreparer prepares the Refresh request. +func (client ReplicationVaultHealthClient) RefreshPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth/default/refresh", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RefreshSender sends the Refresh request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultHealthClient) RefreshSender(req *http.Request) (future ReplicationVaultHealthRefreshFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RefreshResponder handles the response to the Refresh request. The method always +// closes the http.Response Body. +func (client ReplicationVaultHealthClient) RefreshResponder(resp *http.Response) (result VaultHealthDetails, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationvaultsetting.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationvaultsetting.go new file mode 100644 index 000000000000..30d077d15fe5 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationvaultsetting.go @@ -0,0 +1,312 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationVaultSettingClient is the client for the ReplicationVaultSetting methods of the Siterecovery service. +type ReplicationVaultSettingClient struct { + BaseClient +} + +// NewReplicationVaultSettingClient creates an instance of the ReplicationVaultSettingClient client. +func NewReplicationVaultSettingClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultSettingClient { + return NewReplicationVaultSettingClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationVaultSettingClientWithBaseURI creates an instance of the ReplicationVaultSettingClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewReplicationVaultSettingClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultSettingClient { + return ReplicationVaultSettingClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to configure vault setting. +// Parameters: +// vaultSettingName - vault setting name. +// input - vault setting creation input. +func (client ReplicationVaultSettingClient) Create(ctx context.Context, vaultSettingName string, input VaultSettingCreationInput) (result ReplicationVaultSettingCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationVaultSettingClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, vaultSettingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationVaultSettingClient) CreatePreparer(ctx context.Context, vaultSettingName string, input VaultSettingCreationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultSettingName": autorest.Encode("path", vaultSettingName), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) CreateSender(req *http.Request) (future ReplicationVaultSettingCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) CreateResponder(resp *http.Response) (result VaultSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the vault setting. This includes the Migration Hub connection settings. +// Parameters: +// vaultSettingName - vault setting name. +func (client ReplicationVaultSettingClient) Get(ctx context.Context, vaultSettingName string) (result VaultSetting, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, vaultSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationVaultSettingClient) GetPreparer(ctx context.Context, vaultSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultSettingName": autorest.Encode("path", vaultSettingName), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) GetResponder(resp *http.Response) (result VaultSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of vault setting. This includes the Migration Hub connection settings. +func (client ReplicationVaultSettingClient) List(ctx context.Context) (result VaultSettingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.List") + defer func() { + sc := -1 + if result.vsc.Response.Response != nil { + sc = result.vsc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vsc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", resp, "Failure sending request") + return + } + + result.vsc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", resp, "Failure responding to request") + return + } + if result.vsc.hasNextLink() && result.vsc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationVaultSettingClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) ListResponder(resp *http.Response) (result VaultSettingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationVaultSettingClient) listNextResults(ctx context.Context, lastResults VaultSettingCollection) (result VaultSettingCollection, err error) { + req, err := lastResults.vaultSettingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationVaultSettingClient) ListComplete(ctx context.Context) (result VaultSettingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationvcenters.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationvcenters.go new file mode 100644 index 000000000000..ffbefb56d1fa --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/replicationvcenters.go @@ -0,0 +1,591 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationvCentersClient is the client for the ReplicationvCenters methods of the Siterecovery service. +type ReplicationvCentersClient struct { + BaseClient +} + +// NewReplicationvCentersClient creates an instance of the ReplicationvCentersClient client. +func NewReplicationvCentersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationvCentersClient { + return NewReplicationvCentersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationvCentersClientWithBaseURI creates an instance of the ReplicationvCentersClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationvCentersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationvCentersClient { + return ReplicationvCentersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a vCenter object.. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +// addVCenterRequest - the input to the add vCenter operation. +func (client ReplicationvCentersClient) Create(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest) (result ReplicationvCentersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, vcenterName, addVCenterRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationvCentersClient) CreatePreparer(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithJSON(addVCenterRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) CreateSender(req *http.Request) (future ReplicationvCentersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) CreateResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to remove(unregister) a registered vCenter server from the vault. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +func (client ReplicationvCentersClient) Delete(ctx context.Context, fabricName string, vcenterName string) (result ReplicationvCentersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, vcenterName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationvCentersClient) DeletePreparer(ctx context.Context, fabricName string, vcenterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) DeleteSender(req *http.Request) (future ReplicationvCentersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a registered vCenter server(Add vCenter server). +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +func (client ReplicationvCentersClient) Get(ctx context.Context, fabricName string, vcenterName string) (result VCenter, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, vcenterName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationvCentersClient) GetPreparer(ctx context.Context, fabricName string, vcenterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) GetResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the vCenter servers registered in the vault. +func (client ReplicationvCentersClient) List(ctx context.Context) (result VCenterCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.List") + defer func() { + sc := -1 + if result.vcc.Response.Response != nil { + sc = result.vcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", resp, "Failure sending request") + return + } + + result.vcc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", resp, "Failure responding to request") + return + } + if result.vcc.hasNextLink() && result.vcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationvCentersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationvCenters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) ListResponder(resp *http.Response) (result VCenterCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationvCentersClient) listNextResults(ctx context.Context, lastResults VCenterCollection) (result VCenterCollection, err error) { + req, err := lastResults.vCenterCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationvCentersClient) ListComplete(ctx context.Context) (result VCenterCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the vCenter servers registered in a fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationvCentersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result VCenterCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.vcc.Response.Response != nil { + sc = result.vcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.vcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.vcc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.vcc.hasNextLink() && result.vcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationvCentersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) ListByReplicationFabricsResponder(resp *http.Response) (result VCenterCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationvCentersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults VCenterCollection) (result VCenterCollection, err error) { + req, err := lastResults.vCenterCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationvCentersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result VCenterCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// Update the operation to update a registered vCenter. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +// updateVCenterRequest - the input to the update vCenter operation. +func (client ReplicationvCentersClient) Update(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest) (result ReplicationvCentersUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, vcenterName, updateVCenterRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationvCentersClient) UpdatePreparer(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithJSON(updateVCenterRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) UpdateSender(req *http.Request) (future ReplicationvCentersUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) UpdateResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/siterecoveryapi/interfaces.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/siterecoveryapi/interfaces.go new file mode 100644 index 000000000000..8b53116f2b3a --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/siterecoveryapi/interfaces.go @@ -0,0 +1,341 @@ +package siterecoveryapi + +// 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. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-06-01/siterecovery" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result siterecovery.OperationsDiscoveryCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.OperationsDiscoveryCollectionIterator, err error) +} + +var _ OperationsClientAPI = (*siterecovery.OperationsClient)(nil) + +// ReplicationAlertSettingsClientAPI contains the set of methods on the ReplicationAlertSettingsClient type. +type ReplicationAlertSettingsClientAPI interface { + Create(ctx context.Context, alertSettingName string, request siterecovery.ConfigureAlertRequest) (result siterecovery.Alert, err error) + Get(ctx context.Context, alertSettingName string) (result siterecovery.Alert, err error) + List(ctx context.Context) (result siterecovery.AlertCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.AlertCollectionIterator, err error) +} + +var _ ReplicationAlertSettingsClientAPI = (*siterecovery.ReplicationAlertSettingsClient)(nil) + +// ReplicationEligibilityResultsClientAPI contains the set of methods on the ReplicationEligibilityResultsClient type. +type ReplicationEligibilityResultsClientAPI interface { + Get(ctx context.Context, virtualMachineName string) (result siterecovery.ReplicationEligibilityResults, err error) + List(ctx context.Context, virtualMachineName string) (result siterecovery.ReplicationEligibilityResultsCollection, err error) +} + +var _ ReplicationEligibilityResultsClientAPI = (*siterecovery.ReplicationEligibilityResultsClient)(nil) + +// ReplicationEventsClientAPI contains the set of methods on the ReplicationEventsClient type. +type ReplicationEventsClientAPI interface { + Get(ctx context.Context, eventName string) (result siterecovery.Event, err error) + List(ctx context.Context, filter string) (result siterecovery.EventCollectionPage, err error) + ListComplete(ctx context.Context, filter string) (result siterecovery.EventCollectionIterator, err error) +} + +var _ ReplicationEventsClientAPI = (*siterecovery.ReplicationEventsClient)(nil) + +// ReplicationFabricsClientAPI contains the set of methods on the ReplicationFabricsClient type. +type ReplicationFabricsClientAPI interface { + CheckConsistency(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsCheckConsistencyFuture, err error) + Create(ctx context.Context, fabricName string, input siterecovery.FabricCreationInput) (result siterecovery.ReplicationFabricsCreateFuture, err error) + Delete(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, filter string) (result siterecovery.Fabric, err error) + List(ctx context.Context) (result siterecovery.FabricCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.FabricCollectionIterator, err error) + MigrateToAad(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsMigrateToAadFuture, err error) + Purge(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsPurgeFuture, err error) + ReassociateGateway(ctx context.Context, fabricName string, failoverProcessServerRequest siterecovery.FailoverProcessServerRequest) (result siterecovery.ReplicationFabricsReassociateGatewayFuture, err error) + RenewCertificate(ctx context.Context, fabricName string, renewCertificate siterecovery.RenewCertificateInput) (result siterecovery.ReplicationFabricsRenewCertificateFuture, err error) +} + +var _ ReplicationFabricsClientAPI = (*siterecovery.ReplicationFabricsClient)(nil) + +// ReplicationLogicalNetworksClientAPI contains the set of methods on the ReplicationLogicalNetworksClient type. +type ReplicationLogicalNetworksClientAPI interface { + Get(ctx context.Context, fabricName string, logicalNetworkName string) (result siterecovery.LogicalNetwork, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.LogicalNetworkCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.LogicalNetworkCollectionIterator, err error) +} + +var _ ReplicationLogicalNetworksClientAPI = (*siterecovery.ReplicationLogicalNetworksClient)(nil) + +// ReplicationNetworksClientAPI contains the set of methods on the ReplicationNetworksClient type. +type ReplicationNetworksClientAPI interface { + Get(ctx context.Context, fabricName string, networkName string) (result siterecovery.Network, err error) + List(ctx context.Context) (result siterecovery.NetworkCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.NetworkCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.NetworkCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.NetworkCollectionIterator, err error) +} + +var _ ReplicationNetworksClientAPI = (*siterecovery.ReplicationNetworksClient)(nil) + +// ReplicationNetworkMappingsClientAPI contains the set of methods on the ReplicationNetworkMappingsClient type. +type ReplicationNetworkMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, networkName string, networkMappingName string, input siterecovery.CreateNetworkMappingInput) (result siterecovery.ReplicationNetworkMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result siterecovery.ReplicationNetworkMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result siterecovery.NetworkMapping, err error) + List(ctx context.Context) (result siterecovery.NetworkMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.NetworkMappingCollectionIterator, err error) + ListByReplicationNetworks(ctx context.Context, fabricName string, networkName string) (result siterecovery.NetworkMappingCollectionPage, err error) + ListByReplicationNetworksComplete(ctx context.Context, fabricName string, networkName string) (result siterecovery.NetworkMappingCollectionIterator, err error) + Update(ctx context.Context, fabricName string, networkName string, networkMappingName string, input siterecovery.UpdateNetworkMappingInput) (result siterecovery.ReplicationNetworkMappingsUpdateFuture, err error) +} + +var _ ReplicationNetworkMappingsClientAPI = (*siterecovery.ReplicationNetworkMappingsClient)(nil) + +// ReplicationProtectionContainersClientAPI contains the set of methods on the ReplicationProtectionContainersClient type. +type ReplicationProtectionContainersClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, creationInput siterecovery.CreateProtectionContainerInput) (result siterecovery.ReplicationProtectionContainersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectionContainersDeleteFuture, err error) + DiscoverProtectableItem(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest siterecovery.DiscoverProtectableItemRequest) (result siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainer, err error) + List(ctx context.Context) (result siterecovery.ProtectionContainerCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.ProtectionContainerCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.ProtectionContainerCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.ProtectionContainerCollectionIterator, err error) + SwitchProtection(ctx context.Context, fabricName string, protectionContainerName string, switchInput siterecovery.SwitchProtectionInput) (result siterecovery.ReplicationProtectionContainersSwitchProtectionFuture, err error) +} + +var _ ReplicationProtectionContainersClientAPI = (*siterecovery.ReplicationProtectionContainersClient)(nil) + +// ReplicationMigrationItemsClientAPI contains the set of methods on the ReplicationMigrationItemsClient type. +type ReplicationMigrationItemsClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.EnableMigrationInput) (result siterecovery.ReplicationMigrationItemsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (result siterecovery.ReplicationMigrationItemsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationItem, err error) + List(ctx context.Context, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionIterator, err error) + Migrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput siterecovery.MigrateInput) (result siterecovery.ReplicationMigrationItemsMigrateFuture, err error) + Resync(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.ResyncInput) (result siterecovery.ReplicationMigrationItemsResyncFuture, err error) + TestMigrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput siterecovery.TestMigrateInput) (result siterecovery.ReplicationMigrationItemsTestMigrateFuture, err error) + TestMigrateCleanup(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput siterecovery.TestMigrateCleanupInput) (result siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.UpdateMigrationItemInput) (result siterecovery.ReplicationMigrationItemsUpdateFuture, err error) +} + +var _ ReplicationMigrationItemsClientAPI = (*siterecovery.ReplicationMigrationItemsClient)(nil) + +// MigrationRecoveryPointsClientAPI contains the set of methods on the MigrationRecoveryPointsClient type. +type MigrationRecoveryPointsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (result siterecovery.MigrationRecoveryPoint, err error) + ListByReplicationMigrationItems(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationRecoveryPointCollectionPage, err error) + ListByReplicationMigrationItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationRecoveryPointCollectionIterator, err error) +} + +var _ MigrationRecoveryPointsClientAPI = (*siterecovery.MigrationRecoveryPointsClient)(nil) + +// ReplicationProtectableItemsClientAPI contains the set of methods on the ReplicationProtectableItemsClient type. +type ReplicationProtectableItemsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (result siterecovery.ProtectableItem, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result siterecovery.ProtectableItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result siterecovery.ProtectableItemCollectionIterator, err error) +} + +var _ ReplicationProtectableItemsClientAPI = (*siterecovery.ReplicationProtectableItemsClient)(nil) + +// ReplicationProtectedItemsClientAPI contains the set of methods on the ReplicationProtectedItemsClient type. +type ReplicationProtectedItemsClientAPI interface { + AddDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput siterecovery.AddDisksInput) (result siterecovery.ReplicationProtectedItemsAddDisksFuture, err error) + ApplyRecoveryPoint(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput siterecovery.ApplyRecoveryPointInput) (result siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture, err error) + Create(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input siterecovery.EnableProtectionInput) (result siterecovery.ReplicationProtectedItemsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput siterecovery.DisableProtectionInput) (result siterecovery.ReplicationProtectedItemsDeleteFuture, err error) + FailoverCancel(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsFailoverCancelFuture, err error) + FailoverCommit(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsFailoverCommitFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItem, err error) + List(ctx context.Context, skipToken string, filter string) (result siterecovery.ReplicationProtectedItemCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, filter string) (result siterecovery.ReplicationProtectedItemCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectedItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectedItemCollectionIterator, err error) + PlannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput siterecovery.PlannedFailoverInput) (result siterecovery.ReplicationProtectedItemsPlannedFailoverFuture, err error) + Purge(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsPurgeFuture, err error) + RemoveDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput siterecovery.RemoveDisksInput) (result siterecovery.ReplicationProtectedItemsRemoveDisksFuture, err error) + RepairReplication(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsRepairReplicationFuture, err error) + Reprotect(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput siterecovery.ReverseReplicationInput) (result siterecovery.ReplicationProtectedItemsReprotectFuture, err error) + ResolveHealthErrors(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput siterecovery.ResolveHealthInput) (result siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture, err error) + TestFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput siterecovery.TestFailoverInput) (result siterecovery.ReplicationProtectedItemsTestFailoverFuture, err error) + TestFailoverCleanup(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput siterecovery.TestFailoverCleanupInput) (result siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture, err error) + UnplannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput siterecovery.UnplannedFailoverInput) (result siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput siterecovery.UpdateReplicationProtectedItemInput) (result siterecovery.ReplicationProtectedItemsUpdateFuture, err error) + UpdateAppliance(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput siterecovery.UpdateApplianceForReplicationProtectedItemInput) (result siterecovery.ReplicationProtectedItemsUpdateApplianceFuture, err error) + UpdateMobilityService(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest siterecovery.UpdateMobilityServiceRequest) (result siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) +} + +var _ ReplicationProtectedItemsClientAPI = (*siterecovery.ReplicationProtectedItemsClient)(nil) + +// RecoveryPointsClientAPI contains the set of methods on the RecoveryPointsClient type. +type RecoveryPointsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (result siterecovery.RecoveryPoint, err error) + ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.RecoveryPointCollectionPage, err error) + ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.RecoveryPointCollectionIterator, err error) +} + +var _ RecoveryPointsClientAPI = (*siterecovery.RecoveryPointsClient)(nil) + +// TargetComputeSizesClientAPI contains the set of methods on the TargetComputeSizesClient type. +type TargetComputeSizesClientAPI interface { + ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.TargetComputeSizeCollectionPage, err error) + ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.TargetComputeSizeCollectionIterator, err error) +} + +var _ TargetComputeSizesClientAPI = (*siterecovery.TargetComputeSizesClient)(nil) + +// ReplicationProtectionContainerMappingsClientAPI contains the set of methods on the ReplicationProtectionContainerMappingsClient type. +type ReplicationProtectionContainerMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput siterecovery.CreateProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput siterecovery.RemoveProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result siterecovery.ProtectionContainerMapping, err error) + List(ctx context.Context) (result siterecovery.ProtectionContainerMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.ProtectionContainerMappingCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainerMappingCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainerMappingCollectionIterator, err error) + Purge(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result siterecovery.ReplicationProtectionContainerMappingsPurgeFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput siterecovery.UpdateProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsUpdateFuture, err error) +} + +var _ ReplicationProtectionContainerMappingsClientAPI = (*siterecovery.ReplicationProtectionContainerMappingsClient)(nil) + +// ReplicationRecoveryServicesProvidersClientAPI contains the set of methods on the ReplicationRecoveryServicesProvidersClient type. +type ReplicationRecoveryServicesProvidersClientAPI interface { + Create(ctx context.Context, fabricName string, providerName string, addProviderInput siterecovery.AddRecoveryServicesProviderInput) (result siterecovery.ReplicationRecoveryServicesProvidersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture, err error) + Get(ctx context.Context, fabricName string, providerName string) (result siterecovery.RecoveryServicesProvider, err error) + List(ctx context.Context) (result siterecovery.RecoveryServicesProviderCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.RecoveryServicesProviderCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.RecoveryServicesProviderCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.RecoveryServicesProviderCollectionIterator, err error) + Purge(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture, err error) + RefreshProvider(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) +} + +var _ ReplicationRecoveryServicesProvidersClientAPI = (*siterecovery.ReplicationRecoveryServicesProvidersClient)(nil) + +// ReplicationStorageClassificationsClientAPI contains the set of methods on the ReplicationStorageClassificationsClient type. +type ReplicationStorageClassificationsClientAPI interface { + Get(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassification, err error) + List(ctx context.Context) (result siterecovery.StorageClassificationCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.StorageClassificationCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.StorageClassificationCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.StorageClassificationCollectionIterator, err error) +} + +var _ ReplicationStorageClassificationsClientAPI = (*siterecovery.ReplicationStorageClassificationsClient)(nil) + +// ReplicationStorageClassificationMappingsClientAPI contains the set of methods on the ReplicationStorageClassificationMappingsClient type. +type ReplicationStorageClassificationMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput siterecovery.StorageClassificationMappingInput) (result siterecovery.ReplicationStorageClassificationMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result siterecovery.ReplicationStorageClassificationMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result siterecovery.StorageClassificationMapping, err error) + List(ctx context.Context) (result siterecovery.StorageClassificationMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.StorageClassificationMappingCollectionIterator, err error) + ListByReplicationStorageClassifications(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassificationMappingCollectionPage, err error) + ListByReplicationStorageClassificationsComplete(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassificationMappingCollectionIterator, err error) +} + +var _ ReplicationStorageClassificationMappingsClientAPI = (*siterecovery.ReplicationStorageClassificationMappingsClient)(nil) + +// ReplicationvCentersClientAPI contains the set of methods on the ReplicationvCentersClient type. +type ReplicationvCentersClientAPI interface { + Create(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest siterecovery.AddVCenterRequest) (result siterecovery.ReplicationvCentersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, vcenterName string) (result siterecovery.ReplicationvCentersDeleteFuture, err error) + Get(ctx context.Context, fabricName string, vcenterName string) (result siterecovery.VCenter, err error) + List(ctx context.Context) (result siterecovery.VCenterCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.VCenterCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.VCenterCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.VCenterCollectionIterator, err error) + Update(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest siterecovery.UpdateVCenterRequest) (result siterecovery.ReplicationvCentersUpdateFuture, err error) +} + +var _ ReplicationvCentersClientAPI = (*siterecovery.ReplicationvCentersClient)(nil) + +// ReplicationJobsClientAPI contains the set of methods on the ReplicationJobsClient type. +type ReplicationJobsClientAPI interface { + Cancel(ctx context.Context, jobName string) (result siterecovery.ReplicationJobsCancelFuture, err error) + Export(ctx context.Context, jobQueryParameter siterecovery.JobQueryParameter) (result siterecovery.ReplicationJobsExportFuture, err error) + Get(ctx context.Context, jobName string) (result siterecovery.Job, err error) + List(ctx context.Context, filter string) (result siterecovery.JobCollectionPage, err error) + ListComplete(ctx context.Context, filter string) (result siterecovery.JobCollectionIterator, err error) + Restart(ctx context.Context, jobName string) (result siterecovery.ReplicationJobsRestartFuture, err error) + Resume(ctx context.Context, jobName string, resumeJobParams siterecovery.ResumeJobParams) (result siterecovery.ReplicationJobsResumeFuture, err error) +} + +var _ ReplicationJobsClientAPI = (*siterecovery.ReplicationJobsClient)(nil) + +// ReplicationPoliciesClientAPI contains the set of methods on the ReplicationPoliciesClient type. +type ReplicationPoliciesClientAPI interface { + Create(ctx context.Context, policyName string, input siterecovery.CreatePolicyInput) (result siterecovery.ReplicationPoliciesCreateFuture, err error) + Delete(ctx context.Context, policyName string) (result siterecovery.ReplicationPoliciesDeleteFuture, err error) + Get(ctx context.Context, policyName string) (result siterecovery.Policy, err error) + List(ctx context.Context) (result siterecovery.PolicyCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.PolicyCollectionIterator, err error) + Update(ctx context.Context, policyName string, input siterecovery.UpdatePolicyInput) (result siterecovery.ReplicationPoliciesUpdateFuture, err error) +} + +var _ ReplicationPoliciesClientAPI = (*siterecovery.ReplicationPoliciesClient)(nil) + +// ReplicationProtectionIntentsClientAPI contains the set of methods on the ReplicationProtectionIntentsClient type. +type ReplicationProtectionIntentsClientAPI interface { + Create(ctx context.Context, intentObjectName string, input siterecovery.CreateProtectionIntentInput) (result siterecovery.ReplicationProtectionIntent, err error) + Get(ctx context.Context, intentObjectName string) (result siterecovery.ReplicationProtectionIntent, err error) + List(ctx context.Context, skipToken string, takeToken string) (result siterecovery.ReplicationProtectionIntentCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, takeToken string) (result siterecovery.ReplicationProtectionIntentCollectionIterator, err error) +} + +var _ ReplicationProtectionIntentsClientAPI = (*siterecovery.ReplicationProtectionIntentsClient)(nil) + +// ReplicationRecoveryPlansClientAPI contains the set of methods on the ReplicationRecoveryPlansClient type. +type ReplicationRecoveryPlansClientAPI interface { + Create(ctx context.Context, recoveryPlanName string, input siterecovery.CreateRecoveryPlanInput) (result siterecovery.ReplicationRecoveryPlansCreateFuture, err error) + Delete(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansDeleteFuture, err error) + FailoverCancel(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansFailoverCancelFuture, err error) + FailoverCommit(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansFailoverCommitFuture, err error) + Get(ctx context.Context, recoveryPlanName string) (result siterecovery.RecoveryPlan, err error) + List(ctx context.Context) (result siterecovery.RecoveryPlanCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.RecoveryPlanCollectionIterator, err error) + PlannedFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanPlannedFailoverInput) (result siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture, err error) + Reprotect(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansReprotectFuture, err error) + TestFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanTestFailoverInput) (result siterecovery.ReplicationRecoveryPlansTestFailoverFuture, err error) + TestFailoverCleanup(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanTestFailoverCleanupInput) (result siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) + UnplannedFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanUnplannedFailoverInput) (result siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture, err error) + Update(ctx context.Context, recoveryPlanName string, input siterecovery.UpdateRecoveryPlanInput) (result siterecovery.ReplicationRecoveryPlansUpdateFuture, err error) +} + +var _ ReplicationRecoveryPlansClientAPI = (*siterecovery.ReplicationRecoveryPlansClient)(nil) + +// SupportedOperatingSystemsClientAPI contains the set of methods on the SupportedOperatingSystemsClient type. +type SupportedOperatingSystemsClientAPI interface { + Get(ctx context.Context, instanceType string) (result siterecovery.SupportedOperatingSystems, err error) +} + +var _ SupportedOperatingSystemsClientAPI = (*siterecovery.SupportedOperatingSystemsClient)(nil) + +// ReplicationVaultHealthClientAPI contains the set of methods on the ReplicationVaultHealthClient type. +type ReplicationVaultHealthClientAPI interface { + Get(ctx context.Context) (result siterecovery.VaultHealthDetails, err error) + Refresh(ctx context.Context) (result siterecovery.ReplicationVaultHealthRefreshFuture, err error) +} + +var _ ReplicationVaultHealthClientAPI = (*siterecovery.ReplicationVaultHealthClient)(nil) + +// ReplicationVaultSettingClientAPI contains the set of methods on the ReplicationVaultSettingClient type. +type ReplicationVaultSettingClientAPI interface { + Create(ctx context.Context, vaultSettingName string, input siterecovery.VaultSettingCreationInput) (result siterecovery.ReplicationVaultSettingCreateFuture, err error) + Get(ctx context.Context, vaultSettingName string) (result siterecovery.VaultSetting, err error) + List(ctx context.Context) (result siterecovery.VaultSettingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.VaultSettingCollectionIterator, err error) +} + +var _ ReplicationVaultSettingClientAPI = (*siterecovery.ReplicationVaultSettingClient)(nil) diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/supportedoperatingsystems.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/supportedoperatingsystems.go new file mode 100644 index 000000000000..00359ec8cf7a --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/supportedoperatingsystems.go @@ -0,0 +1,110 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SupportedOperatingSystemsClient is the client for the SupportedOperatingSystems methods of the Siterecovery service. +type SupportedOperatingSystemsClient struct { + BaseClient +} + +// NewSupportedOperatingSystemsClient creates an instance of the SupportedOperatingSystemsClient client. +func NewSupportedOperatingSystemsClient(subscriptionID string, resourceGroupName string, resourceName string) SupportedOperatingSystemsClient { + return NewSupportedOperatingSystemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewSupportedOperatingSystemsClientWithBaseURI creates an instance of the SupportedOperatingSystemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewSupportedOperatingSystemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) SupportedOperatingSystemsClient { + return SupportedOperatingSystemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get sends the get request. +// Parameters: +// instanceType - the instance type. +func (client SupportedOperatingSystemsClient) Get(ctx context.Context, instanceType string) (result SupportedOperatingSystems, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SupportedOperatingSystemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, instanceType) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SupportedOperatingSystemsClient) GetPreparer(ctx context.Context, instanceType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(instanceType) > 0 { + queryParameters["instanceType"] = autorest.Encode("query", instanceType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationSupportedOperatingSystems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SupportedOperatingSystemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SupportedOperatingSystemsClient) GetResponder(resp *http.Response) (result SupportedOperatingSystems, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/targetcomputesizes.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/targetcomputesizes.go new file mode 100644 index 000000000000..4b334882eeca --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/targetcomputesizes.go @@ -0,0 +1,154 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// TargetComputeSizesClient is the client for the TargetComputeSizes methods of the Siterecovery service. +type TargetComputeSizesClient struct { + BaseClient +} + +// NewTargetComputeSizesClient creates an instance of the TargetComputeSizesClient client. +func NewTargetComputeSizesClient(subscriptionID string, resourceGroupName string, resourceName string) TargetComputeSizesClient { + return NewTargetComputeSizesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewTargetComputeSizesClientWithBaseURI creates an instance of the TargetComputeSizesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewTargetComputeSizesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) TargetComputeSizesClient { + return TargetComputeSizesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// ListByReplicationProtectedItems lists the available target compute sizes for a replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client TargetComputeSizesClient) ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result TargetComputeSizeCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizesClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.tcsc.Response.Response != nil { + sc = result.tcsc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectedItemsNextResults + req, err := client.ListByReplicationProtectedItemsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.tcsc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", resp, "Failure sending request") + return + } + + result.tcsc, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", resp, "Failure responding to request") + return + } + if result.tcsc.hasNextLink() && result.tcsc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectedItemsPreparer prepares the ListByReplicationProtectedItems request. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/targetComputeSizes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectedItemsSender sends the ListByReplicationProtectedItems request. The method will close the +// http.Response Body if it receives an error. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectedItemsResponder handles the response to the ListByReplicationProtectedItems request. The method always +// closes the http.Response Body. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsResponder(resp *http.Response) (result TargetComputeSizeCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectedItemsNextResults retrieves the next set of results, if any. +func (client TargetComputeSizesClient) listByReplicationProtectedItemsNextResults(ctx context.Context, lastResults TargetComputeSizeCollection) (result TargetComputeSizeCollection, err error) { + req, err := lastResults.targetComputeSizeCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectedItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result TargetComputeSizeCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizesClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectedItems(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + return +} diff --git a/services/recoveryservices/mgmt/2021-06-01/siterecovery/version.go b/services/recoveryservices/mgmt/2021-06-01/siterecovery/version.go new file mode 100644 index 000000000000..e50affaa3f88 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-06-01/siterecovery/version.go @@ -0,0 +1,19 @@ +package siterecovery + +import "github.com/Azure/azure-sdk-for-go/version" + +// 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. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " siterecovery/2021-06-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/CHANGELOG.md b/services/recoveryservices/mgmt/2021-08-01/siterecovery/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/_meta.json b/services/recoveryservices/mgmt/2021-08-01/siterecovery/_meta.json new file mode 100644 index 000000000000..d136382751cc --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "16f5f98c30852b877949ea63418f609233470bf7", + "readme": "/_/azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.md", + "tag": "package-2021-08", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-08 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/client.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/client.go new file mode 100644 index 000000000000..e3e42a0eafc2 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/client.go @@ -0,0 +1,45 @@ +// Package siterecovery implements the Azure ARM Siterecovery service API version 2021-08-01. +// +// +package siterecovery + +// 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. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Siterecovery + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Siterecovery. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string + ResourceGroupName string + ResourceName string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string, resourceGroupName string, resourceName string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + ResourceGroupName: resourceGroupName, + ResourceName: resourceName, + } +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/enums.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/enums.go new file mode 100644 index 000000000000..8f7ef2c7c7a3 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/enums.go @@ -0,0 +1,1884 @@ +package siterecovery + +// 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. + +// A2ARecoveryAvailabilityType enumerates the values for a2a recovery availability type. +type A2ARecoveryAvailabilityType string + +const ( + // AvailabilitySet ... + AvailabilitySet A2ARecoveryAvailabilityType = "AvailabilitySet" + // AvailabilityZone ... + AvailabilityZone A2ARecoveryAvailabilityType = "AvailabilityZone" + // Single ... + Single A2ARecoveryAvailabilityType = "Single" +) + +// PossibleA2ARecoveryAvailabilityTypeValues returns an array of possible values for the A2ARecoveryAvailabilityType const type. +func PossibleA2ARecoveryAvailabilityTypeValues() []A2ARecoveryAvailabilityType { + return []A2ARecoveryAvailabilityType{AvailabilitySet, AvailabilityZone, Single} +} + +// A2ARpRecoveryPointType enumerates the values for a2a rp recovery point type. +type A2ARpRecoveryPointType string + +const ( + // Latest ... + Latest A2ARpRecoveryPointType = "Latest" + // LatestApplicationConsistent ... + LatestApplicationConsistent A2ARpRecoveryPointType = "LatestApplicationConsistent" + // LatestCrashConsistent ... + LatestCrashConsistent A2ARpRecoveryPointType = "LatestCrashConsistent" + // LatestProcessed ... + LatestProcessed A2ARpRecoveryPointType = "LatestProcessed" +) + +// PossibleA2ARpRecoveryPointTypeValues returns an array of possible values for the A2ARpRecoveryPointType const type. +func PossibleA2ARpRecoveryPointTypeValues() []A2ARpRecoveryPointType { + return []A2ARpRecoveryPointType{Latest, LatestApplicationConsistent, LatestCrashConsistent, LatestProcessed} +} + +// AgentAutoUpdateStatus enumerates the values for agent auto update status. +type AgentAutoUpdateStatus string + +const ( + // Disabled ... + Disabled AgentAutoUpdateStatus = "Disabled" + // Enabled ... + Enabled AgentAutoUpdateStatus = "Enabled" +) + +// PossibleAgentAutoUpdateStatusValues returns an array of possible values for the AgentAutoUpdateStatus const type. +func PossibleAgentAutoUpdateStatusValues() []AgentAutoUpdateStatus { + return []AgentAutoUpdateStatus{Disabled, Enabled} +} + +// AgentUpgradeBlockedReason enumerates the values for agent upgrade blocked reason. +type AgentUpgradeBlockedReason string + +const ( + // AgentNoHeartbeat ... + AgentNoHeartbeat AgentUpgradeBlockedReason = "AgentNoHeartbeat" + // AlreadyOnLatestVersion ... + AlreadyOnLatestVersion AgentUpgradeBlockedReason = "AlreadyOnLatestVersion" + // DistroIsNotReported ... + DistroIsNotReported AgentUpgradeBlockedReason = "DistroIsNotReported" + // DistroNotSupportedForUpgrade ... + DistroNotSupportedForUpgrade AgentUpgradeBlockedReason = "DistroNotSupportedForUpgrade" + // IncompatibleApplianceVersion ... + IncompatibleApplianceVersion AgentUpgradeBlockedReason = "IncompatibleApplianceVersion" + // InvalidAgentVersion ... + InvalidAgentVersion AgentUpgradeBlockedReason = "InvalidAgentVersion" + // InvalidDriverVersion ... + InvalidDriverVersion AgentUpgradeBlockedReason = "InvalidDriverVersion" + // MissingUpgradePath ... + MissingUpgradePath AgentUpgradeBlockedReason = "MissingUpgradePath" + // NotProtected ... + NotProtected AgentUpgradeBlockedReason = "NotProtected" + // ProcessServerNoHeartbeat ... + ProcessServerNoHeartbeat AgentUpgradeBlockedReason = "ProcessServerNoHeartbeat" + // RcmProxyNoHeartbeat ... + RcmProxyNoHeartbeat AgentUpgradeBlockedReason = "RcmProxyNoHeartbeat" + // RebootRequired ... + RebootRequired AgentUpgradeBlockedReason = "RebootRequired" + // Unknown ... + Unknown AgentUpgradeBlockedReason = "Unknown" + // UnsupportedProtectionScenario ... + UnsupportedProtectionScenario AgentUpgradeBlockedReason = "UnsupportedProtectionScenario" +) + +// PossibleAgentUpgradeBlockedReasonValues returns an array of possible values for the AgentUpgradeBlockedReason const type. +func PossibleAgentUpgradeBlockedReasonValues() []AgentUpgradeBlockedReason { + return []AgentUpgradeBlockedReason{AgentNoHeartbeat, AlreadyOnLatestVersion, DistroIsNotReported, DistroNotSupportedForUpgrade, IncompatibleApplianceVersion, InvalidAgentVersion, InvalidDriverVersion, MissingUpgradePath, NotProtected, ProcessServerNoHeartbeat, RcmProxyNoHeartbeat, RebootRequired, Unknown, UnsupportedProtectionScenario} +} + +// AgentVersionStatus enumerates the values for agent version status. +type AgentVersionStatus string + +const ( + // Deprecated ... + Deprecated AgentVersionStatus = "Deprecated" + // NotSupported ... + NotSupported AgentVersionStatus = "NotSupported" + // SecurityUpdateRequired ... + SecurityUpdateRequired AgentVersionStatus = "SecurityUpdateRequired" + // Supported ... + Supported AgentVersionStatus = "Supported" + // UpdateRequired ... + UpdateRequired AgentVersionStatus = "UpdateRequired" +) + +// PossibleAgentVersionStatusValues returns an array of possible values for the AgentVersionStatus const type. +func PossibleAgentVersionStatusValues() []AgentVersionStatus { + return []AgentVersionStatus{Deprecated, NotSupported, SecurityUpdateRequired, Supported, UpdateRequired} +} + +// AlternateLocationRecoveryOption enumerates the values for alternate location recovery option. +type AlternateLocationRecoveryOption string + +const ( + // CreateVMIfNotFound ... + CreateVMIfNotFound AlternateLocationRecoveryOption = "CreateVmIfNotFound" + // NoAction ... + NoAction AlternateLocationRecoveryOption = "NoAction" +) + +// PossibleAlternateLocationRecoveryOptionValues returns an array of possible values for the AlternateLocationRecoveryOption const type. +func PossibleAlternateLocationRecoveryOptionValues() []AlternateLocationRecoveryOption { + return []AlternateLocationRecoveryOption{CreateVMIfNotFound, NoAction} +} + +// AutomationAccountAuthenticationType enumerates the values for automation account authentication type. +type AutomationAccountAuthenticationType string + +const ( + // AutomationAccountAuthenticationTypeRunAsAccount ... + AutomationAccountAuthenticationTypeRunAsAccount AutomationAccountAuthenticationType = "RunAsAccount" + // AutomationAccountAuthenticationTypeSystemAssignedIdentity ... + AutomationAccountAuthenticationTypeSystemAssignedIdentity AutomationAccountAuthenticationType = "SystemAssignedIdentity" +) + +// PossibleAutomationAccountAuthenticationTypeValues returns an array of possible values for the AutomationAccountAuthenticationType const type. +func PossibleAutomationAccountAuthenticationTypeValues() []AutomationAccountAuthenticationType { + return []AutomationAccountAuthenticationType{AutomationAccountAuthenticationTypeRunAsAccount, AutomationAccountAuthenticationTypeSystemAssignedIdentity} +} + +// AutoProtectionOfDataDisk enumerates the values for auto protection of data disk. +type AutoProtectionOfDataDisk string + +const ( + // AutoProtectionOfDataDiskDisabled ... + AutoProtectionOfDataDiskDisabled AutoProtectionOfDataDisk = "Disabled" + // AutoProtectionOfDataDiskEnabled ... + AutoProtectionOfDataDiskEnabled AutoProtectionOfDataDisk = "Enabled" +) + +// PossibleAutoProtectionOfDataDiskValues returns an array of possible values for the AutoProtectionOfDataDisk const type. +func PossibleAutoProtectionOfDataDiskValues() []AutoProtectionOfDataDisk { + return []AutoProtectionOfDataDisk{AutoProtectionOfDataDiskDisabled, AutoProtectionOfDataDiskEnabled} +} + +// DataSyncStatus enumerates the values for data sync status. +type DataSyncStatus string + +const ( + // ForDownTime ... + ForDownTime DataSyncStatus = "ForDownTime" + // ForSynchronization ... + ForSynchronization DataSyncStatus = "ForSynchronization" +) + +// PossibleDataSyncStatusValues returns an array of possible values for the DataSyncStatus const type. +func PossibleDataSyncStatusValues() []DataSyncStatus { + return []DataSyncStatus{ForDownTime, ForSynchronization} +} + +// DisableProtectionReason enumerates the values for disable protection reason. +type DisableProtectionReason string + +const ( + // MigrationComplete ... + MigrationComplete DisableProtectionReason = "MigrationComplete" + // NotSpecified ... + NotSpecified DisableProtectionReason = "NotSpecified" +) + +// PossibleDisableProtectionReasonValues returns an array of possible values for the DisableProtectionReason const type. +func PossibleDisableProtectionReasonValues() []DisableProtectionReason { + return []DisableProtectionReason{MigrationComplete, NotSpecified} +} + +// DiskAccountType enumerates the values for disk account type. +type DiskAccountType string + +const ( + // PremiumLRS ... + PremiumLRS DiskAccountType = "Premium_LRS" + // StandardLRS ... + StandardLRS DiskAccountType = "Standard_LRS" + // StandardSSDLRS ... + StandardSSDLRS DiskAccountType = "StandardSSD_LRS" +) + +// PossibleDiskAccountTypeValues returns an array of possible values for the DiskAccountType const type. +func PossibleDiskAccountTypeValues() []DiskAccountType { + return []DiskAccountType{PremiumLRS, StandardLRS, StandardSSDLRS} +} + +// DiskReplicationProgressHealth enumerates the values for disk replication progress health. +type DiskReplicationProgressHealth string + +const ( + // InProgress ... + InProgress DiskReplicationProgressHealth = "InProgress" + // None ... + None DiskReplicationProgressHealth = "None" + // NoProgress ... + NoProgress DiskReplicationProgressHealth = "NoProgress" + // Queued ... + Queued DiskReplicationProgressHealth = "Queued" + // SlowProgress ... + SlowProgress DiskReplicationProgressHealth = "SlowProgress" +) + +// PossibleDiskReplicationProgressHealthValues returns an array of possible values for the DiskReplicationProgressHealth const type. +func PossibleDiskReplicationProgressHealthValues() []DiskReplicationProgressHealth { + return []DiskReplicationProgressHealth{InProgress, None, NoProgress, Queued, SlowProgress} +} + +// EthernetAddressType enumerates the values for ethernet address type. +type EthernetAddressType string + +const ( + // Dynamic ... + Dynamic EthernetAddressType = "Dynamic" + // Static ... + Static EthernetAddressType = "Static" +) + +// PossibleEthernetAddressTypeValues returns an array of possible values for the EthernetAddressType const type. +func PossibleEthernetAddressTypeValues() []EthernetAddressType { + return []EthernetAddressType{Dynamic, Static} +} + +// ExportJobOutputSerializationType enumerates the values for export job output serialization type. +type ExportJobOutputSerializationType string + +const ( + // Excel ... + Excel ExportJobOutputSerializationType = "Excel" + // JSON ... + JSON ExportJobOutputSerializationType = "Json" + // XML ... + XML ExportJobOutputSerializationType = "Xml" +) + +// PossibleExportJobOutputSerializationTypeValues returns an array of possible values for the ExportJobOutputSerializationType const type. +func PossibleExportJobOutputSerializationTypeValues() []ExportJobOutputSerializationType { + return []ExportJobOutputSerializationType{Excel, JSON, XML} +} + +// FailoverDeploymentModel enumerates the values for failover deployment model. +type FailoverDeploymentModel string + +const ( + // Classic ... + Classic FailoverDeploymentModel = "Classic" + // NotApplicable ... + NotApplicable FailoverDeploymentModel = "NotApplicable" + // ResourceManager ... + ResourceManager FailoverDeploymentModel = "ResourceManager" +) + +// PossibleFailoverDeploymentModelValues returns an array of possible values for the FailoverDeploymentModel const type. +func PossibleFailoverDeploymentModelValues() []FailoverDeploymentModel { + return []FailoverDeploymentModel{Classic, NotApplicable, ResourceManager} +} + +// HealthErrorCategory enumerates the values for health error category. +type HealthErrorCategory string + +const ( + // HealthErrorCategoryAgentAutoUpdateArtifactDeleted ... + HealthErrorCategoryAgentAutoUpdateArtifactDeleted HealthErrorCategory = "AgentAutoUpdateArtifactDeleted" + // HealthErrorCategoryAgentAutoUpdateInfra ... + HealthErrorCategoryAgentAutoUpdateInfra HealthErrorCategory = "AgentAutoUpdateInfra" + // HealthErrorCategoryAgentAutoUpdateRunAsAccount ... + HealthErrorCategoryAgentAutoUpdateRunAsAccount HealthErrorCategory = "AgentAutoUpdateRunAsAccount" + // HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired ... + HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired HealthErrorCategory = "AgentAutoUpdateRunAsAccountExpired" + // HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry ... + HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry HealthErrorCategory = "AgentAutoUpdateRunAsAccountExpiry" + // HealthErrorCategoryConfiguration ... + HealthErrorCategoryConfiguration HealthErrorCategory = "Configuration" + // HealthErrorCategoryFabricInfrastructure ... + HealthErrorCategoryFabricInfrastructure HealthErrorCategory = "FabricInfrastructure" + // HealthErrorCategoryNone ... + HealthErrorCategoryNone HealthErrorCategory = "None" + // HealthErrorCategoryReplication ... + HealthErrorCategoryReplication HealthErrorCategory = "Replication" + // HealthErrorCategoryTestFailover ... + HealthErrorCategoryTestFailover HealthErrorCategory = "TestFailover" + // HealthErrorCategoryVersionExpiry ... + HealthErrorCategoryVersionExpiry HealthErrorCategory = "VersionExpiry" +) + +// PossibleHealthErrorCategoryValues returns an array of possible values for the HealthErrorCategory const type. +func PossibleHealthErrorCategoryValues() []HealthErrorCategory { + return []HealthErrorCategory{HealthErrorCategoryAgentAutoUpdateArtifactDeleted, HealthErrorCategoryAgentAutoUpdateInfra, HealthErrorCategoryAgentAutoUpdateRunAsAccount, HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired, HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry, HealthErrorCategoryConfiguration, HealthErrorCategoryFabricInfrastructure, HealthErrorCategoryNone, HealthErrorCategoryReplication, HealthErrorCategoryTestFailover, HealthErrorCategoryVersionExpiry} +} + +// HealthErrorCustomerResolvability enumerates the values for health error customer resolvability. +type HealthErrorCustomerResolvability string + +const ( + // Allowed ... + Allowed HealthErrorCustomerResolvability = "Allowed" + // NotAllowed ... + NotAllowed HealthErrorCustomerResolvability = "NotAllowed" +) + +// PossibleHealthErrorCustomerResolvabilityValues returns an array of possible values for the HealthErrorCustomerResolvability const type. +func PossibleHealthErrorCustomerResolvabilityValues() []HealthErrorCustomerResolvability { + return []HealthErrorCustomerResolvability{Allowed, NotAllowed} +} + +// HyperVReplicaAzureRpRecoveryPointType enumerates the values for hyper v replica azure rp recovery point +// type. +type HyperVReplicaAzureRpRecoveryPointType string + +const ( + // HyperVReplicaAzureRpRecoveryPointTypeLatest ... + HyperVReplicaAzureRpRecoveryPointTypeLatest HyperVReplicaAzureRpRecoveryPointType = "Latest" + // HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent ... + HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent HyperVReplicaAzureRpRecoveryPointType = "LatestApplicationConsistent" + // HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed ... + HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed HyperVReplicaAzureRpRecoveryPointType = "LatestProcessed" +) + +// PossibleHyperVReplicaAzureRpRecoveryPointTypeValues returns an array of possible values for the HyperVReplicaAzureRpRecoveryPointType const type. +func PossibleHyperVReplicaAzureRpRecoveryPointTypeValues() []HyperVReplicaAzureRpRecoveryPointType { + return []HyperVReplicaAzureRpRecoveryPointType{HyperVReplicaAzureRpRecoveryPointTypeLatest, HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent, HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed} +} + +// InMageRcmFailbackRecoveryPointType enumerates the values for in mage rcm failback recovery point type. +type InMageRcmFailbackRecoveryPointType string + +const ( + // ApplicationConsistent ... + ApplicationConsistent InMageRcmFailbackRecoveryPointType = "ApplicationConsistent" + // CrashConsistent ... + CrashConsistent InMageRcmFailbackRecoveryPointType = "CrashConsistent" +) + +// PossibleInMageRcmFailbackRecoveryPointTypeValues returns an array of possible values for the InMageRcmFailbackRecoveryPointType const type. +func PossibleInMageRcmFailbackRecoveryPointTypeValues() []InMageRcmFailbackRecoveryPointType { + return []InMageRcmFailbackRecoveryPointType{ApplicationConsistent, CrashConsistent} +} + +// InMageV2RpRecoveryPointType enumerates the values for in mage v2 rp recovery point type. +type InMageV2RpRecoveryPointType string + +const ( + // InMageV2RpRecoveryPointTypeLatest ... + InMageV2RpRecoveryPointTypeLatest InMageV2RpRecoveryPointType = "Latest" + // InMageV2RpRecoveryPointTypeLatestApplicationConsistent ... + InMageV2RpRecoveryPointTypeLatestApplicationConsistent InMageV2RpRecoveryPointType = "LatestApplicationConsistent" + // InMageV2RpRecoveryPointTypeLatestCrashConsistent ... + InMageV2RpRecoveryPointTypeLatestCrashConsistent InMageV2RpRecoveryPointType = "LatestCrashConsistent" + // InMageV2RpRecoveryPointTypeLatestProcessed ... + InMageV2RpRecoveryPointTypeLatestProcessed InMageV2RpRecoveryPointType = "LatestProcessed" +) + +// PossibleInMageV2RpRecoveryPointTypeValues returns an array of possible values for the InMageV2RpRecoveryPointType const type. +func PossibleInMageV2RpRecoveryPointTypeValues() []InMageV2RpRecoveryPointType { + return []InMageV2RpRecoveryPointType{InMageV2RpRecoveryPointTypeLatest, InMageV2RpRecoveryPointTypeLatestApplicationConsistent, InMageV2RpRecoveryPointTypeLatestCrashConsistent, InMageV2RpRecoveryPointTypeLatestProcessed} +} + +// InstanceType enumerates the values for instance type. +type InstanceType string + +const ( + // InstanceTypeA2A ... + InstanceTypeA2A InstanceType = "A2A" + // InstanceTypeAddDisksProviderSpecificInput ... + InstanceTypeAddDisksProviderSpecificInput InstanceType = "AddDisksProviderSpecificInput" +) + +// PossibleInstanceTypeValues returns an array of possible values for the InstanceType const type. +func PossibleInstanceTypeValues() []InstanceType { + return []InstanceType{InstanceTypeA2A, InstanceTypeAddDisksProviderSpecificInput} +} + +// InstanceTypeBasicApplyRecoveryPointProviderSpecificInput enumerates the values for instance type basic apply +// recovery point provider specific input. +type InstanceTypeBasicApplyRecoveryPointProviderSpecificInput string + +const ( + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "A2A" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "ApplyRecoveryPointProviderSpecificInput" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "InMageRcm" +) + +// PossibleInstanceTypeBasicApplyRecoveryPointProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicApplyRecoveryPointProviderSpecificInput const type. +func PossibleInstanceTypeBasicApplyRecoveryPointProviderSpecificInputValues() []InstanceTypeBasicApplyRecoveryPointProviderSpecificInput { + return []InstanceTypeBasicApplyRecoveryPointProviderSpecificInput{InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm} +} + +// InstanceTypeBasicConfigurationSettings enumerates the values for instance type basic configuration settings. +type InstanceTypeBasicConfigurationSettings string + +const ( + // InstanceTypeConfigurationSettings ... + InstanceTypeConfigurationSettings InstanceTypeBasicConfigurationSettings = "ConfigurationSettings" + // InstanceTypeHyperVVirtualMachine ... + InstanceTypeHyperVVirtualMachine InstanceTypeBasicConfigurationSettings = "HyperVVirtualMachine" + // InstanceTypeReplicationGroupDetails ... + InstanceTypeReplicationGroupDetails InstanceTypeBasicConfigurationSettings = "ReplicationGroupDetails" + // InstanceTypeVmmVirtualMachine ... + InstanceTypeVmmVirtualMachine InstanceTypeBasicConfigurationSettings = "VmmVirtualMachine" + // InstanceTypeVMwareVirtualMachine ... + InstanceTypeVMwareVirtualMachine InstanceTypeBasicConfigurationSettings = "VMwareVirtualMachine" +) + +// PossibleInstanceTypeBasicConfigurationSettingsValues returns an array of possible values for the InstanceTypeBasicConfigurationSettings const type. +func PossibleInstanceTypeBasicConfigurationSettingsValues() []InstanceTypeBasicConfigurationSettings { + return []InstanceTypeBasicConfigurationSettings{InstanceTypeConfigurationSettings, InstanceTypeHyperVVirtualMachine, InstanceTypeReplicationGroupDetails, InstanceTypeVmmVirtualMachine, InstanceTypeVMwareVirtualMachine} +} + +// InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails enumerates the values for instance type basic +// create protection intent provider specific details. +type InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails string + +const ( + // InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails = "A2A" + // InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails ... + InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails = "CreateProtectionIntentProviderSpecificDetails" +) + +// PossibleInstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails const type. +func PossibleInstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsValues() []InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails { + return []InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails{InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails} +} + +// InstanceTypeBasicDisableProtectionProviderSpecificInput enumerates the values for instance type basic +// disable protection provider specific input. +type InstanceTypeBasicDisableProtectionProviderSpecificInput string + +const ( + // InstanceTypeDisableProtectionProviderSpecificInput ... + InstanceTypeDisableProtectionProviderSpecificInput InstanceTypeBasicDisableProtectionProviderSpecificInput = "DisableProtectionProviderSpecificInput" + // InstanceTypeInMage ... + InstanceTypeInMage InstanceTypeBasicDisableProtectionProviderSpecificInput = "InMage" +) + +// PossibleInstanceTypeBasicDisableProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicDisableProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicDisableProtectionProviderSpecificInputValues() []InstanceTypeBasicDisableProtectionProviderSpecificInput { + return []InstanceTypeBasicDisableProtectionProviderSpecificInput{InstanceTypeDisableProtectionProviderSpecificInput, InstanceTypeInMage} +} + +// InstanceTypeBasicEnableMigrationProviderSpecificInput enumerates the values for instance type basic enable +// migration provider specific input. +type InstanceTypeBasicEnableMigrationProviderSpecificInput string + +const ( + // InstanceTypeEnableMigrationProviderSpecificInput ... + InstanceTypeEnableMigrationProviderSpecificInput InstanceTypeBasicEnableMigrationProviderSpecificInput = "EnableMigrationProviderSpecificInput" + // InstanceTypeVMwareCbt ... + InstanceTypeVMwareCbt InstanceTypeBasicEnableMigrationProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicEnableMigrationProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicEnableMigrationProviderSpecificInput const type. +func PossibleInstanceTypeBasicEnableMigrationProviderSpecificInputValues() []InstanceTypeBasicEnableMigrationProviderSpecificInput { + return []InstanceTypeBasicEnableMigrationProviderSpecificInput{InstanceTypeEnableMigrationProviderSpecificInput, InstanceTypeVMwareCbt} +} + +// InstanceTypeBasicEnableProtectionProviderSpecificInput enumerates the values for instance type basic enable +// protection provider specific input. +type InstanceTypeBasicEnableProtectionProviderSpecificInput string + +const ( + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A InstanceTypeBasicEnableProtectionProviderSpecificInput = "A2A" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicEnableProtectionProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput InstanceTypeBasicEnableProtectionProviderSpecificInput = "EnableProtectionProviderSpecificInput" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicEnableProtectionProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMage" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMageRcm" +) + +// PossibleInstanceTypeBasicEnableProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicEnableProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicEnableProtectionProviderSpecificInputValues() []InstanceTypeBasicEnableProtectionProviderSpecificInput { + return []InstanceTypeBasicEnableProtectionProviderSpecificInput{InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm} +} + +// InstanceTypeBasicEventProviderSpecificDetails enumerates the values for instance type basic event provider +// specific details. +type InstanceTypeBasicEventProviderSpecificDetails string + +const ( + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicEventProviderSpecificDetails = "A2A" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails InstanceTypeBasicEventProviderSpecificDetails = "EventProviderSpecificDetails" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplica2012" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplica2012R2" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplicaAzure" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplicaBaseEventDetails" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicEventProviderSpecificDetails = "InMageAzureV2" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicEventProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback InstanceTypeBasicEventProviderSpecificDetails = "InMageRcmFailback" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicEventProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicEventProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicEventProviderSpecificDetails const type. +func PossibleInstanceTypeBasicEventProviderSpecificDetailsValues() []InstanceTypeBasicEventProviderSpecificDetails { + return []InstanceTypeBasicEventProviderSpecificDetails{InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicEventSpecificDetails enumerates the values for instance type basic event specific details. +type InstanceTypeBasicEventSpecificDetails string + +const ( + // InstanceTypeEventSpecificDetails ... + InstanceTypeEventSpecificDetails InstanceTypeBasicEventSpecificDetails = "EventSpecificDetails" + // InstanceTypeJobStatus ... + InstanceTypeJobStatus InstanceTypeBasicEventSpecificDetails = "JobStatus" +) + +// PossibleInstanceTypeBasicEventSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicEventSpecificDetails const type. +func PossibleInstanceTypeBasicEventSpecificDetailsValues() []InstanceTypeBasicEventSpecificDetails { + return []InstanceTypeBasicEventSpecificDetails{InstanceTypeEventSpecificDetails, InstanceTypeJobStatus} +} + +// InstanceTypeBasicFabricSpecificCreateNetworkMappingInput enumerates the values for instance type basic +// fabric specific create network mapping input. +type InstanceTypeBasicFabricSpecificCreateNetworkMappingInput string + +const ( + // InstanceTypeAzureToAzure ... + InstanceTypeAzureToAzure InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "AzureToAzure" + // InstanceTypeFabricSpecificCreateNetworkMappingInput ... + InstanceTypeFabricSpecificCreateNetworkMappingInput InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "FabricSpecificCreateNetworkMappingInput" + // InstanceTypeVmmToAzure ... + InstanceTypeVmmToAzure InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "VmmToAzure" + // InstanceTypeVmmToVmm ... + InstanceTypeVmmToVmm InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "VmmToVmm" +) + +// PossibleInstanceTypeBasicFabricSpecificCreateNetworkMappingInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificCreateNetworkMappingInput const type. +func PossibleInstanceTypeBasicFabricSpecificCreateNetworkMappingInputValues() []InstanceTypeBasicFabricSpecificCreateNetworkMappingInput { + return []InstanceTypeBasicFabricSpecificCreateNetworkMappingInput{InstanceTypeAzureToAzure, InstanceTypeFabricSpecificCreateNetworkMappingInput, InstanceTypeVmmToAzure, InstanceTypeVmmToVmm} +} + +// InstanceTypeBasicFabricSpecificCreationInput enumerates the values for instance type basic fabric specific +// creation input. +type InstanceTypeBasicFabricSpecificCreationInput string + +const ( + // InstanceTypeAzure ... + InstanceTypeAzure InstanceTypeBasicFabricSpecificCreationInput = "Azure" + // InstanceTypeFabricSpecificCreationInput ... + InstanceTypeFabricSpecificCreationInput InstanceTypeBasicFabricSpecificCreationInput = "FabricSpecificCreationInput" + // InstanceTypeInMageRcm ... + InstanceTypeInMageRcm InstanceTypeBasicFabricSpecificCreationInput = "InMageRcm" + // InstanceTypeVMwareV2 ... + InstanceTypeVMwareV2 InstanceTypeBasicFabricSpecificCreationInput = "VMwareV2" +) + +// PossibleInstanceTypeBasicFabricSpecificCreationInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificCreationInput const type. +func PossibleInstanceTypeBasicFabricSpecificCreationInputValues() []InstanceTypeBasicFabricSpecificCreationInput { + return []InstanceTypeBasicFabricSpecificCreationInput{InstanceTypeAzure, InstanceTypeFabricSpecificCreationInput, InstanceTypeInMageRcm, InstanceTypeVMwareV2} +} + +// InstanceTypeBasicFabricSpecificDetails enumerates the values for instance type basic fabric specific +// details. +type InstanceTypeBasicFabricSpecificDetails string + +const ( + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure InstanceTypeBasicFabricSpecificDetails = "Azure" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails InstanceTypeBasicFabricSpecificDetails = "FabricSpecificDetails" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite InstanceTypeBasicFabricSpecificDetails = "HyperVSite" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicFabricSpecificDetails = "InMageRcm" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM InstanceTypeBasicFabricSpecificDetails = "VMM" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware InstanceTypeBasicFabricSpecificDetails = "VMware" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 InstanceTypeBasicFabricSpecificDetails = "VMwareV2" +) + +// PossibleInstanceTypeBasicFabricSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicFabricSpecificDetails const type. +func PossibleInstanceTypeBasicFabricSpecificDetailsValues() []InstanceTypeBasicFabricSpecificDetails { + return []InstanceTypeBasicFabricSpecificDetails{InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure, InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails, InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite, InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2} +} + +// InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput enumerates the values for instance type basic +// fabric specific update network mapping input. +type InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput string + +const ( + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "AzureToAzure" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "FabricSpecificUpdateNetworkMappingInput" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "VmmToAzure" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "VmmToVmm" +) + +// PossibleInstanceTypeBasicFabricSpecificUpdateNetworkMappingInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput const type. +func PossibleInstanceTypeBasicFabricSpecificUpdateNetworkMappingInputValues() []InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput { + return []InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput{InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm} +} + +// InstanceTypeBasicGroupTaskDetails enumerates the values for instance type basic group task details. +type InstanceTypeBasicGroupTaskDetails string + +const ( + // InstanceTypeGroupTaskDetails ... + InstanceTypeGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "GroupTaskDetails" + // InstanceTypeInlineWorkflowTaskDetails ... + InstanceTypeInlineWorkflowTaskDetails InstanceTypeBasicGroupTaskDetails = "InlineWorkflowTaskDetails" + // InstanceTypeRecoveryPlanGroupTaskDetails ... + InstanceTypeRecoveryPlanGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "RecoveryPlanGroupTaskDetails" + // InstanceTypeRecoveryPlanShutdownGroupTaskDetails ... + InstanceTypeRecoveryPlanShutdownGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "RecoveryPlanShutdownGroupTaskDetails" +) + +// PossibleInstanceTypeBasicGroupTaskDetailsValues returns an array of possible values for the InstanceTypeBasicGroupTaskDetails const type. +func PossibleInstanceTypeBasicGroupTaskDetailsValues() []InstanceTypeBasicGroupTaskDetails { + return []InstanceTypeBasicGroupTaskDetails{InstanceTypeGroupTaskDetails, InstanceTypeInlineWorkflowTaskDetails, InstanceTypeRecoveryPlanGroupTaskDetails, InstanceTypeRecoveryPlanShutdownGroupTaskDetails} +} + +// InstanceTypeBasicJobDetails enumerates the values for instance type basic job details. +type InstanceTypeBasicJobDetails string + +const ( + // InstanceTypeAsrJobDetails ... + InstanceTypeAsrJobDetails InstanceTypeBasicJobDetails = "AsrJobDetails" + // InstanceTypeExportJobDetails ... + InstanceTypeExportJobDetails InstanceTypeBasicJobDetails = "ExportJobDetails" + // InstanceTypeFailoverJobDetails ... + InstanceTypeFailoverJobDetails InstanceTypeBasicJobDetails = "FailoverJobDetails" + // InstanceTypeJobDetails ... + InstanceTypeJobDetails InstanceTypeBasicJobDetails = "JobDetails" + // InstanceTypeSwitchProtectionJobDetails ... + InstanceTypeSwitchProtectionJobDetails InstanceTypeBasicJobDetails = "SwitchProtectionJobDetails" + // InstanceTypeTestFailoverJobDetails ... + InstanceTypeTestFailoverJobDetails InstanceTypeBasicJobDetails = "TestFailoverJobDetails" +) + +// PossibleInstanceTypeBasicJobDetailsValues returns an array of possible values for the InstanceTypeBasicJobDetails const type. +func PossibleInstanceTypeBasicJobDetailsValues() []InstanceTypeBasicJobDetails { + return []InstanceTypeBasicJobDetails{InstanceTypeAsrJobDetails, InstanceTypeExportJobDetails, InstanceTypeFailoverJobDetails, InstanceTypeJobDetails, InstanceTypeSwitchProtectionJobDetails, InstanceTypeTestFailoverJobDetails} +} + +// InstanceTypeBasicMigrateProviderSpecificInput enumerates the values for instance type basic migrate provider +// specific input. +type InstanceTypeBasicMigrateProviderSpecificInput string + +const ( + // InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput ... + InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput InstanceTypeBasicMigrateProviderSpecificInput = "MigrateProviderSpecificInput" + // InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicMigrateProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicMigrateProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicMigrateProviderSpecificInput const type. +func PossibleInstanceTypeBasicMigrateProviderSpecificInputValues() []InstanceTypeBasicMigrateProviderSpecificInput { + return []InstanceTypeBasicMigrateProviderSpecificInput{InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput, InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicMigrationProviderSpecificSettings enumerates the values for instance type basic migration +// provider specific settings. +type InstanceTypeBasicMigrationProviderSpecificSettings string + +const ( + // InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings ... + InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings InstanceTypeBasicMigrationProviderSpecificSettings = "MigrationProviderSpecificSettings" + // InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt ... + InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt InstanceTypeBasicMigrationProviderSpecificSettings = "VMwareCbt" +) + +// PossibleInstanceTypeBasicMigrationProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicMigrationProviderSpecificSettings const type. +func PossibleInstanceTypeBasicMigrationProviderSpecificSettingsValues() []InstanceTypeBasicMigrationProviderSpecificSettings { + return []InstanceTypeBasicMigrationProviderSpecificSettings{InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings, InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicNetworkMappingFabricSpecificSettings enumerates the values for instance type basic network +// mapping fabric specific settings. +type InstanceTypeBasicNetworkMappingFabricSpecificSettings string + +const ( + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure InstanceTypeBasicNetworkMappingFabricSpecificSettings = "AzureToAzure" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings InstanceTypeBasicNetworkMappingFabricSpecificSettings = "NetworkMappingFabricSpecificSettings" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure InstanceTypeBasicNetworkMappingFabricSpecificSettings = "VmmToAzure" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm InstanceTypeBasicNetworkMappingFabricSpecificSettings = "VmmToVmm" +) + +// PossibleInstanceTypeBasicNetworkMappingFabricSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicNetworkMappingFabricSpecificSettings const type. +func PossibleInstanceTypeBasicNetworkMappingFabricSpecificSettingsValues() []InstanceTypeBasicNetworkMappingFabricSpecificSettings { + return []InstanceTypeBasicNetworkMappingFabricSpecificSettings{InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm} +} + +// InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput enumerates the values for instance type basic +// planned failover provider specific failover input. +type InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput string + +const ( + // InstanceTypeHyperVReplicaAzure ... + InstanceTypeHyperVReplicaAzure InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "HyperVReplicaAzure" + // InstanceTypeHyperVReplicaAzureFailback ... + InstanceTypeHyperVReplicaAzureFailback InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "HyperVReplicaAzureFailback" + // InstanceTypeInMageRcmFailback ... + InstanceTypeInMageRcmFailback InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "InMageRcmFailback" + // InstanceTypePlannedFailoverProviderSpecificFailoverInput ... + InstanceTypePlannedFailoverProviderSpecificFailoverInput InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "PlannedFailoverProviderSpecificFailoverInput" +) + +// PossibleInstanceTypeBasicPlannedFailoverProviderSpecificFailoverInputValues returns an array of possible values for the InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput const type. +func PossibleInstanceTypeBasicPlannedFailoverProviderSpecificFailoverInputValues() []InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput { + return []InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput{InstanceTypeHyperVReplicaAzure, InstanceTypeHyperVReplicaAzureFailback, InstanceTypeInMageRcmFailback, InstanceTypePlannedFailoverProviderSpecificFailoverInput} +} + +// InstanceTypeBasicPolicyProviderSpecificDetails enumerates the values for instance type basic policy provider +// specific details. +type InstanceTypeBasicPolicyProviderSpecificDetails string + +const ( + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicPolicyProviderSpecificDetails = "A2A" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplica2012" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplica2012R2" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplicaAzure" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplicaBasePolicyDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage InstanceTypeBasicPolicyProviderSpecificDetails = "InMage" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicPolicyProviderSpecificDetails = "InMageAzureV2" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails InstanceTypeBasicPolicyProviderSpecificDetails = "InMageBasePolicyDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicPolicyProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback InstanceTypeBasicPolicyProviderSpecificDetails = "InMageRcmFailback" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails InstanceTypeBasicPolicyProviderSpecificDetails = "PolicyProviderSpecificDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicPolicyProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicPolicyProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicPolicyProviderSpecificDetails const type. +func PossibleInstanceTypeBasicPolicyProviderSpecificDetailsValues() []InstanceTypeBasicPolicyProviderSpecificDetails { + return []InstanceTypeBasicPolicyProviderSpecificDetails{InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicPolicyProviderSpecificInput enumerates the values for instance type basic policy provider +// specific input. +type InstanceTypeBasicPolicyProviderSpecificInput string + +const ( + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A InstanceTypeBasicPolicyProviderSpecificInput = "A2A" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicPolicyProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplica2012" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplica2012R2" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage InstanceTypeBasicPolicyProviderSpecificInput = "InMage" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicPolicyProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicPolicyProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback InstanceTypeBasicPolicyProviderSpecificInput = "InMageRcmFailback" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput InstanceTypeBasicPolicyProviderSpecificInput = "PolicyProviderSpecificInput" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicPolicyProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicPolicyProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicPolicyProviderSpecificInput const type. +func PossibleInstanceTypeBasicPolicyProviderSpecificInputValues() []InstanceTypeBasicPolicyProviderSpecificInput { + return []InstanceTypeBasicPolicyProviderSpecificInput{InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails enumerates the values for instance type +// basic protection container mapping provider specific details. +type InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails string + +const ( + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "A2A" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "ProtectionContainerMappingProviderSpecificDetails" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails const type. +func PossibleInstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsValues() []InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails { + return []InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails{InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicProviderSpecificRecoveryPointDetails enumerates the values for instance type basic provider +// specific recovery point details. +type InstanceTypeBasicProviderSpecificRecoveryPointDetails string + +const ( + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A InstanceTypeBasicProviderSpecificRecoveryPointDetails = "A2A" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicProviderSpecificRecoveryPointDetails = "InMageAzureV2" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm InstanceTypeBasicProviderSpecificRecoveryPointDetails = "InMageRcm" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails InstanceTypeBasicProviderSpecificRecoveryPointDetails = "ProviderSpecificRecoveryPointDetails" +) + +// PossibleInstanceTypeBasicProviderSpecificRecoveryPointDetailsValues returns an array of possible values for the InstanceTypeBasicProviderSpecificRecoveryPointDetails const type. +func PossibleInstanceTypeBasicProviderSpecificRecoveryPointDetailsValues() []InstanceTypeBasicProviderSpecificRecoveryPointDetails { + return []InstanceTypeBasicProviderSpecificRecoveryPointDetails{InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails} +} + +// InstanceTypeBasicRecoveryPlanActionDetails enumerates the values for instance type basic recovery plan +// action details. +type InstanceTypeBasicRecoveryPlanActionDetails string + +const ( + // InstanceTypeAutomationRunbookActionDetails ... + InstanceTypeAutomationRunbookActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "AutomationRunbookActionDetails" + // InstanceTypeManualActionDetails ... + InstanceTypeManualActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "ManualActionDetails" + // InstanceTypeRecoveryPlanActionDetails ... + InstanceTypeRecoveryPlanActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "RecoveryPlanActionDetails" + // InstanceTypeScriptActionDetails ... + InstanceTypeScriptActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "ScriptActionDetails" +) + +// PossibleInstanceTypeBasicRecoveryPlanActionDetailsValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanActionDetails const type. +func PossibleInstanceTypeBasicRecoveryPlanActionDetailsValues() []InstanceTypeBasicRecoveryPlanActionDetails { + return []InstanceTypeBasicRecoveryPlanActionDetails{InstanceTypeAutomationRunbookActionDetails, InstanceTypeManualActionDetails, InstanceTypeRecoveryPlanActionDetails, InstanceTypeScriptActionDetails} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificDetails enumerates the values for instance type basic recovery +// plan provider specific details. +type InstanceTypeBasicRecoveryPlanProviderSpecificDetails string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificDetails = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails ... + InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails InstanceTypeBasicRecoveryPlanProviderSpecificDetails = "RecoveryPlanProviderSpecificDetails" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificDetails const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificDetailsValues() []InstanceTypeBasicRecoveryPlanProviderSpecificDetails { + return []InstanceTypeBasicRecoveryPlanProviderSpecificDetails{InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput enumerates the values for instance type basic +// recovery plan provider specific failover input. +type InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "HyperVReplicaAzure" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "HyperVReplicaAzureFailback" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMage" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageAzureV2" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageRcm" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageRcmFailback" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "RecoveryPlanProviderSpecificFailoverInput" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputValues() []InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput { + return []InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput{InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificInput enumerates the values for instance type basic recovery +// plan provider specific input. +type InstanceTypeBasicRecoveryPlanProviderSpecificInput string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificInput = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput ... + InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput InstanceTypeBasicRecoveryPlanProviderSpecificInput = "RecoveryPlanProviderSpecificInput" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificInput const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificInputValues() []InstanceTypeBasicRecoveryPlanProviderSpecificInput { + return []InstanceTypeBasicRecoveryPlanProviderSpecificInput{InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput} +} + +// InstanceTypeBasicRemoveDisksProviderSpecificInput enumerates the values for instance type basic remove disks +// provider specific input. +type InstanceTypeBasicRemoveDisksProviderSpecificInput string + +const ( + // InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A InstanceTypeBasicRemoveDisksProviderSpecificInput = "A2A" + // InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput ... + InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput InstanceTypeBasicRemoveDisksProviderSpecificInput = "RemoveDisksProviderSpecificInput" +) + +// PossibleInstanceTypeBasicRemoveDisksProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicRemoveDisksProviderSpecificInput const type. +func PossibleInstanceTypeBasicRemoveDisksProviderSpecificInputValues() []InstanceTypeBasicRemoveDisksProviderSpecificInput { + return []InstanceTypeBasicRemoveDisksProviderSpecificInput{InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput} +} + +// InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings enumerates the values for instance type +// basic replication protection intent provider specific settings. +type InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings string + +const ( + // InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A ... + InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings = "A2A" + // InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings ... + InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings = "ReplicationProtectionIntentProviderSpecificSettings" +) + +// PossibleInstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings const type. +func PossibleInstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsValues() []InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings { + return []InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings{InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A, InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings} +} + +// InstanceTypeBasicReplicationProviderSpecificContainerCreationInput enumerates the values for instance type +// basic replication provider specific container creation input. +type InstanceTypeBasicReplicationProviderSpecificContainerCreationInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "A2ACrossClusterMigration" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "ReplicationProviderSpecificContainerCreationInput" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificContainerCreationInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificContainerCreationInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificContainerCreationInputValues() []InstanceTypeBasicReplicationProviderSpecificContainerCreationInput { + return []InstanceTypeBasicReplicationProviderSpecificContainerCreationInput{InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReplicationProviderSpecificContainerMappingInput enumerates the values for instance type +// basic replication provider specific container mapping input. +type InstanceTypeBasicReplicationProviderSpecificContainerMappingInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "ReplicationProviderSpecificContainerMappingInput" + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificContainerMappingInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificContainerMappingInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificContainerMappingInputValues() []InstanceTypeBasicReplicationProviderSpecificContainerMappingInput { + return []InstanceTypeBasicReplicationProviderSpecificContainerMappingInput{InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput, InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReplicationProviderSpecificSettings enumerates the values for instance type basic +// replication provider specific settings. +type InstanceTypeBasicReplicationProviderSpecificSettings string + +const ( + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificSettings = "A2A" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration InstanceTypeBasicReplicationProviderSpecificSettings = "A2ACrossClusterMigration" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplica2012" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplica2012R2" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplicaAzure" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplicaBaseReplicationDetails" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage InstanceTypeBasicReplicationProviderSpecificSettings = "InMage" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 InstanceTypeBasicReplicationProviderSpecificSettings = "InMageAzureV2" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm InstanceTypeBasicReplicationProviderSpecificSettings = "InMageRcm" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback InstanceTypeBasicReplicationProviderSpecificSettings = "InMageRcmFailback" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings InstanceTypeBasicReplicationProviderSpecificSettings = "ReplicationProviderSpecificSettings" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificSettings const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificSettingsValues() []InstanceTypeBasicReplicationProviderSpecificSettings { + return []InstanceTypeBasicReplicationProviderSpecificSettings{InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings} +} + +// InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput enumerates the values for instance +// type basic replication provider specific update container mapping input. +type InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "InMageRcm" + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "ReplicationProviderSpecificUpdateContainerMappingInput" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputValues() []InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput { + return []InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput{InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm, InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput} +} + +// InstanceTypeBasicResyncProviderSpecificInput enumerates the values for instance type basic resync provider +// specific input. +type InstanceTypeBasicResyncProviderSpecificInput string + +const ( + // InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput ... + InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput InstanceTypeBasicResyncProviderSpecificInput = "ResyncProviderSpecificInput" + // InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicResyncProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicResyncProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicResyncProviderSpecificInput const type. +func PossibleInstanceTypeBasicResyncProviderSpecificInputValues() []InstanceTypeBasicResyncProviderSpecificInput { + return []InstanceTypeBasicResyncProviderSpecificInput{InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput, InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReverseReplicationProviderSpecificInput enumerates the values for instance type basic +// reverse replication provider specific input. +type InstanceTypeBasicReverseReplicationProviderSpecificInput string + +const ( + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A InstanceTypeBasicReverseReplicationProviderSpecificInput = "A2A" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicReverseReplicationProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMage" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageRcmFailback" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput InstanceTypeBasicReverseReplicationProviderSpecificInput = "ReverseReplicationProviderSpecificInput" +) + +// PossibleInstanceTypeBasicReverseReplicationProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicReverseReplicationProviderSpecificInput const type. +func PossibleInstanceTypeBasicReverseReplicationProviderSpecificInputValues() []InstanceTypeBasicReverseReplicationProviderSpecificInput { + return []InstanceTypeBasicReverseReplicationProviderSpecificInput{InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput} +} + +// InstanceTypeBasicSwitchProtectionProviderSpecificInput enumerates the values for instance type basic switch +// protection provider specific input. +type InstanceTypeBasicSwitchProtectionProviderSpecificInput string + +const ( + // InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A InstanceTypeBasicSwitchProtectionProviderSpecificInput = "A2A" + // InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput ... + InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput InstanceTypeBasicSwitchProtectionProviderSpecificInput = "SwitchProtectionProviderSpecificInput" +) + +// PossibleInstanceTypeBasicSwitchProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicSwitchProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicSwitchProtectionProviderSpecificInputValues() []InstanceTypeBasicSwitchProtectionProviderSpecificInput { + return []InstanceTypeBasicSwitchProtectionProviderSpecificInput{InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput} +} + +// InstanceTypeBasicTaskTypeDetails enumerates the values for instance type basic task type details. +type InstanceTypeBasicTaskTypeDetails string + +const ( + // InstanceTypeAutomationRunbookTaskDetails ... + InstanceTypeAutomationRunbookTaskDetails InstanceTypeBasicTaskTypeDetails = "AutomationRunbookTaskDetails" + // InstanceTypeConsistencyCheckTaskDetails ... + InstanceTypeConsistencyCheckTaskDetails InstanceTypeBasicTaskTypeDetails = "ConsistencyCheckTaskDetails" + // InstanceTypeFabricReplicationGroupTaskDetails ... + InstanceTypeFabricReplicationGroupTaskDetails InstanceTypeBasicTaskTypeDetails = "FabricReplicationGroupTaskDetails" + // InstanceTypeJobTaskDetails ... + InstanceTypeJobTaskDetails InstanceTypeBasicTaskTypeDetails = "JobTaskDetails" + // InstanceTypeManualActionTaskDetails ... + InstanceTypeManualActionTaskDetails InstanceTypeBasicTaskTypeDetails = "ManualActionTaskDetails" + // InstanceTypeScriptActionTaskDetails ... + InstanceTypeScriptActionTaskDetails InstanceTypeBasicTaskTypeDetails = "ScriptActionTaskDetails" + // InstanceTypeTaskTypeDetails ... + InstanceTypeTaskTypeDetails InstanceTypeBasicTaskTypeDetails = "TaskTypeDetails" + // InstanceTypeVirtualMachineTaskDetails ... + InstanceTypeVirtualMachineTaskDetails InstanceTypeBasicTaskTypeDetails = "VirtualMachineTaskDetails" + // InstanceTypeVMNicUpdatesTaskDetails ... + InstanceTypeVMNicUpdatesTaskDetails InstanceTypeBasicTaskTypeDetails = "VmNicUpdatesTaskDetails" +) + +// PossibleInstanceTypeBasicTaskTypeDetailsValues returns an array of possible values for the InstanceTypeBasicTaskTypeDetails const type. +func PossibleInstanceTypeBasicTaskTypeDetailsValues() []InstanceTypeBasicTaskTypeDetails { + return []InstanceTypeBasicTaskTypeDetails{InstanceTypeAutomationRunbookTaskDetails, InstanceTypeConsistencyCheckTaskDetails, InstanceTypeFabricReplicationGroupTaskDetails, InstanceTypeJobTaskDetails, InstanceTypeManualActionTaskDetails, InstanceTypeScriptActionTaskDetails, InstanceTypeTaskTypeDetails, InstanceTypeVirtualMachineTaskDetails, InstanceTypeVMNicUpdatesTaskDetails} +} + +// InstanceTypeBasicTestFailoverProviderSpecificInput enumerates the values for instance type basic test +// failover provider specific input. +type InstanceTypeBasicTestFailoverProviderSpecificInput string + +const ( + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A InstanceTypeBasicTestFailoverProviderSpecificInput = "A2A" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicTestFailoverProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage InstanceTypeBasicTestFailoverProviderSpecificInput = "InMage" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicTestFailoverProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicTestFailoverProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput InstanceTypeBasicTestFailoverProviderSpecificInput = "TestFailoverProviderSpecificInput" +) + +// PossibleInstanceTypeBasicTestFailoverProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicTestFailoverProviderSpecificInput const type. +func PossibleInstanceTypeBasicTestFailoverProviderSpecificInputValues() []InstanceTypeBasicTestFailoverProviderSpecificInput { + return []InstanceTypeBasicTestFailoverProviderSpecificInput{InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput} +} + +// InstanceTypeBasicTestMigrateProviderSpecificInput enumerates the values for instance type basic test migrate +// provider specific input. +type InstanceTypeBasicTestMigrateProviderSpecificInput string + +const ( + // InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput ... + InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput InstanceTypeBasicTestMigrateProviderSpecificInput = "TestMigrateProviderSpecificInput" + // InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicTestMigrateProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicTestMigrateProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicTestMigrateProviderSpecificInput const type. +func PossibleInstanceTypeBasicTestMigrateProviderSpecificInputValues() []InstanceTypeBasicTestMigrateProviderSpecificInput { + return []InstanceTypeBasicTestMigrateProviderSpecificInput{InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput, InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicUnplannedFailoverProviderSpecificInput enumerates the values for instance type basic +// unplanned failover provider specific input. +type InstanceTypeBasicUnplannedFailoverProviderSpecificInput string + +const ( + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "A2A" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMage" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "UnplannedFailoverProviderSpecificInput" +) + +// PossibleInstanceTypeBasicUnplannedFailoverProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUnplannedFailoverProviderSpecificInput const type. +func PossibleInstanceTypeBasicUnplannedFailoverProviderSpecificInputValues() []InstanceTypeBasicUnplannedFailoverProviderSpecificInput { + return []InstanceTypeBasicUnplannedFailoverProviderSpecificInput{InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput} +} + +// InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput enumerates the values for +// instance type basic update appliance for replication protected item provider specific input. +type InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput string + +const ( + // InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput ... + InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput = "UpdateApplianceForReplicationProtectedItemProviderSpecificInput" +) + +// PossibleInstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput const type. +func PossibleInstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputValues() []InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput { + return []InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput{InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput} +} + +// InstanceTypeBasicUpdateMigrationItemProviderSpecificInput enumerates the values for instance type basic +// update migration item provider specific input. +type InstanceTypeBasicUpdateMigrationItemProviderSpecificInput string + +const ( + // InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput ... + InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput InstanceTypeBasicUpdateMigrationItemProviderSpecificInput = "UpdateMigrationItemProviderSpecificInput" + // InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicUpdateMigrationItemProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicUpdateMigrationItemProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUpdateMigrationItemProviderSpecificInput const type. +func PossibleInstanceTypeBasicUpdateMigrationItemProviderSpecificInputValues() []InstanceTypeBasicUpdateMigrationItemProviderSpecificInput { + return []InstanceTypeBasicUpdateMigrationItemProviderSpecificInput{InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput, InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicUpdateReplicationProtectedItemProviderInput enumerates the values for instance type basic +// update replication protected item provider input. +type InstanceTypeBasicUpdateReplicationProtectedItemProviderInput string + +const ( + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "A2A" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "HyperVReplicaAzure" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "InMageAzureV2" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "InMageRcm" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "UpdateReplicationProtectedItemProviderInput" +) + +// PossibleInstanceTypeBasicUpdateReplicationProtectedItemProviderInputValues returns an array of possible values for the InstanceTypeBasicUpdateReplicationProtectedItemProviderInput const type. +func PossibleInstanceTypeBasicUpdateReplicationProtectedItemProviderInputValues() []InstanceTypeBasicUpdateReplicationProtectedItemProviderInput { + return []InstanceTypeBasicUpdateReplicationProtectedItemProviderInput{InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput} +} + +// LicenseType enumerates the values for license type. +type LicenseType string + +const ( + // LicenseTypeNoLicenseType ... + LicenseTypeNoLicenseType LicenseType = "NoLicenseType" + // LicenseTypeNotSpecified ... + LicenseTypeNotSpecified LicenseType = "NotSpecified" + // LicenseTypeWindowsServer ... + LicenseTypeWindowsServer LicenseType = "WindowsServer" +) + +// PossibleLicenseTypeValues returns an array of possible values for the LicenseType const type. +func PossibleLicenseTypeValues() []LicenseType { + return []LicenseType{LicenseTypeNoLicenseType, LicenseTypeNotSpecified, LicenseTypeWindowsServer} +} + +// MigrationItemOperation enumerates the values for migration item operation. +type MigrationItemOperation string + +const ( + // DisableMigration ... + DisableMigration MigrationItemOperation = "DisableMigration" + // Migrate ... + Migrate MigrationItemOperation = "Migrate" + // StartResync ... + StartResync MigrationItemOperation = "StartResync" + // TestMigrate ... + TestMigrate MigrationItemOperation = "TestMigrate" + // TestMigrateCleanup ... + TestMigrateCleanup MigrationItemOperation = "TestMigrateCleanup" +) + +// PossibleMigrationItemOperationValues returns an array of possible values for the MigrationItemOperation const type. +func PossibleMigrationItemOperationValues() []MigrationItemOperation { + return []MigrationItemOperation{DisableMigration, Migrate, StartResync, TestMigrate, TestMigrateCleanup} +} + +// MigrationRecoveryPointType enumerates the values for migration recovery point type. +type MigrationRecoveryPointType string + +const ( + // MigrationRecoveryPointTypeApplicationConsistent ... + MigrationRecoveryPointTypeApplicationConsistent MigrationRecoveryPointType = "ApplicationConsistent" + // MigrationRecoveryPointTypeCrashConsistent ... + MigrationRecoveryPointTypeCrashConsistent MigrationRecoveryPointType = "CrashConsistent" + // MigrationRecoveryPointTypeNotSpecified ... + MigrationRecoveryPointTypeNotSpecified MigrationRecoveryPointType = "NotSpecified" +) + +// PossibleMigrationRecoveryPointTypeValues returns an array of possible values for the MigrationRecoveryPointType const type. +func PossibleMigrationRecoveryPointTypeValues() []MigrationRecoveryPointType { + return []MigrationRecoveryPointType{MigrationRecoveryPointTypeApplicationConsistent, MigrationRecoveryPointTypeCrashConsistent, MigrationRecoveryPointTypeNotSpecified} +} + +// MigrationState enumerates the values for migration state. +type MigrationState string + +const ( + // MigrationStateDisableMigrationFailed ... + MigrationStateDisableMigrationFailed MigrationState = "DisableMigrationFailed" + // MigrationStateDisableMigrationInProgress ... + MigrationStateDisableMigrationInProgress MigrationState = "DisableMigrationInProgress" + // MigrationStateEnableMigrationFailed ... + MigrationStateEnableMigrationFailed MigrationState = "EnableMigrationFailed" + // MigrationStateEnableMigrationInProgress ... + MigrationStateEnableMigrationInProgress MigrationState = "EnableMigrationInProgress" + // MigrationStateInitialSeedingFailed ... + MigrationStateInitialSeedingFailed MigrationState = "InitialSeedingFailed" + // MigrationStateInitialSeedingInProgress ... + MigrationStateInitialSeedingInProgress MigrationState = "InitialSeedingInProgress" + // MigrationStateMigrationFailed ... + MigrationStateMigrationFailed MigrationState = "MigrationFailed" + // MigrationStateMigrationInProgress ... + MigrationStateMigrationInProgress MigrationState = "MigrationInProgress" + // MigrationStateMigrationSucceeded ... + MigrationStateMigrationSucceeded MigrationState = "MigrationSucceeded" + // MigrationStateNone ... + MigrationStateNone MigrationState = "None" + // MigrationStateReplicating ... + MigrationStateReplicating MigrationState = "Replicating" +) + +// PossibleMigrationStateValues returns an array of possible values for the MigrationState const type. +func PossibleMigrationStateValues() []MigrationState { + return []MigrationState{MigrationStateDisableMigrationFailed, MigrationStateDisableMigrationInProgress, MigrationStateEnableMigrationFailed, MigrationStateEnableMigrationInProgress, MigrationStateInitialSeedingFailed, MigrationStateInitialSeedingInProgress, MigrationStateMigrationFailed, MigrationStateMigrationInProgress, MigrationStateMigrationSucceeded, MigrationStateNone, MigrationStateReplicating} +} + +// MobilityAgentUpgradeState enumerates the values for mobility agent upgrade state. +type MobilityAgentUpgradeState string + +const ( + // MobilityAgentUpgradeStateCommit ... + MobilityAgentUpgradeStateCommit MobilityAgentUpgradeState = "Commit" + // MobilityAgentUpgradeStateCompleted ... + MobilityAgentUpgradeStateCompleted MobilityAgentUpgradeState = "Completed" + // MobilityAgentUpgradeStateNone ... + MobilityAgentUpgradeStateNone MobilityAgentUpgradeState = "None" + // MobilityAgentUpgradeStateStarted ... + MobilityAgentUpgradeStateStarted MobilityAgentUpgradeState = "Started" +) + +// PossibleMobilityAgentUpgradeStateValues returns an array of possible values for the MobilityAgentUpgradeState const type. +func PossibleMobilityAgentUpgradeStateValues() []MobilityAgentUpgradeState { + return []MobilityAgentUpgradeState{MobilityAgentUpgradeStateCommit, MobilityAgentUpgradeStateCompleted, MobilityAgentUpgradeStateNone, MobilityAgentUpgradeStateStarted} +} + +// MultiVMGroupCreateOption enumerates the values for multi vm group create option. +type MultiVMGroupCreateOption string + +const ( + // AutoCreated ... + AutoCreated MultiVMGroupCreateOption = "AutoCreated" + // UserSpecified ... + UserSpecified MultiVMGroupCreateOption = "UserSpecified" +) + +// PossibleMultiVMGroupCreateOptionValues returns an array of possible values for the MultiVMGroupCreateOption const type. +func PossibleMultiVMGroupCreateOptionValues() []MultiVMGroupCreateOption { + return []MultiVMGroupCreateOption{AutoCreated, UserSpecified} +} + +// MultiVMSyncPointOption enumerates the values for multi vm sync point option. +type MultiVMSyncPointOption string + +const ( + // UseMultiVMSyncRecoveryPoint ... + UseMultiVMSyncRecoveryPoint MultiVMSyncPointOption = "UseMultiVmSyncRecoveryPoint" + // UsePerVMRecoveryPoint ... + UsePerVMRecoveryPoint MultiVMSyncPointOption = "UsePerVmRecoveryPoint" +) + +// PossibleMultiVMSyncPointOptionValues returns an array of possible values for the MultiVMSyncPointOption const type. +func PossibleMultiVMSyncPointOptionValues() []MultiVMSyncPointOption { + return []MultiVMSyncPointOption{UseMultiVMSyncRecoveryPoint, UsePerVMRecoveryPoint} +} + +// PlannedFailoverStatus enumerates the values for planned failover status. +type PlannedFailoverStatus string + +const ( + // PlannedFailoverStatusCancelled ... + PlannedFailoverStatusCancelled PlannedFailoverStatus = "Cancelled" + // PlannedFailoverStatusFailed ... + PlannedFailoverStatusFailed PlannedFailoverStatus = "Failed" + // PlannedFailoverStatusSucceeded ... + PlannedFailoverStatusSucceeded PlannedFailoverStatus = "Succeeded" + // PlannedFailoverStatusUnknown ... + PlannedFailoverStatusUnknown PlannedFailoverStatus = "Unknown" +) + +// PossiblePlannedFailoverStatusValues returns an array of possible values for the PlannedFailoverStatus const type. +func PossiblePlannedFailoverStatusValues() []PlannedFailoverStatus { + return []PlannedFailoverStatus{PlannedFailoverStatusCancelled, PlannedFailoverStatusFailed, PlannedFailoverStatusSucceeded, PlannedFailoverStatusUnknown} +} + +// PossibleOperationsDirections enumerates the values for possible operations directions. +type PossibleOperationsDirections string + +const ( + // PrimaryToRecovery ... + PrimaryToRecovery PossibleOperationsDirections = "PrimaryToRecovery" + // RecoveryToPrimary ... + RecoveryToPrimary PossibleOperationsDirections = "RecoveryToPrimary" +) + +// PossiblePossibleOperationsDirectionsValues returns an array of possible values for the PossibleOperationsDirections const type. +func PossiblePossibleOperationsDirectionsValues() []PossibleOperationsDirections { + return []PossibleOperationsDirections{PrimaryToRecovery, RecoveryToPrimary} +} + +// PresenceStatus enumerates the values for presence status. +type PresenceStatus string + +const ( + // PresenceStatusNotPresent ... + PresenceStatusNotPresent PresenceStatus = "NotPresent" + // PresenceStatusPresent ... + PresenceStatusPresent PresenceStatus = "Present" + // PresenceStatusUnknown ... + PresenceStatusUnknown PresenceStatus = "Unknown" +) + +// PossiblePresenceStatusValues returns an array of possible values for the PresenceStatus const type. +func PossiblePresenceStatusValues() []PresenceStatus { + return []PresenceStatus{PresenceStatusNotPresent, PresenceStatusPresent, PresenceStatusUnknown} +} + +// ProtectionHealth enumerates the values for protection health. +type ProtectionHealth string + +const ( + // ProtectionHealthCritical ... + ProtectionHealthCritical ProtectionHealth = "Critical" + // ProtectionHealthNone ... + ProtectionHealthNone ProtectionHealth = "None" + // ProtectionHealthNormal ... + ProtectionHealthNormal ProtectionHealth = "Normal" + // ProtectionHealthWarning ... + ProtectionHealthWarning ProtectionHealth = "Warning" +) + +// PossibleProtectionHealthValues returns an array of possible values for the ProtectionHealth const type. +func PossibleProtectionHealthValues() []ProtectionHealth { + return []ProtectionHealth{ProtectionHealthCritical, ProtectionHealthNone, ProtectionHealthNormal, ProtectionHealthWarning} +} + +// RcmComponentStatus enumerates the values for rcm component status. +type RcmComponentStatus string + +const ( + // RcmComponentStatusCritical ... + RcmComponentStatusCritical RcmComponentStatus = "Critical" + // RcmComponentStatusHealthy ... + RcmComponentStatusHealthy RcmComponentStatus = "Healthy" + // RcmComponentStatusUnknown ... + RcmComponentStatusUnknown RcmComponentStatus = "Unknown" + // RcmComponentStatusWarning ... + RcmComponentStatusWarning RcmComponentStatus = "Warning" +) + +// PossibleRcmComponentStatusValues returns an array of possible values for the RcmComponentStatus const type. +func PossibleRcmComponentStatusValues() []RcmComponentStatus { + return []RcmComponentStatus{RcmComponentStatusCritical, RcmComponentStatusHealthy, RcmComponentStatusUnknown, RcmComponentStatusWarning} +} + +// RecoveryPlanActionLocation enumerates the values for recovery plan action location. +type RecoveryPlanActionLocation string + +const ( + // Primary ... + Primary RecoveryPlanActionLocation = "Primary" + // Recovery ... + Recovery RecoveryPlanActionLocation = "Recovery" +) + +// PossibleRecoveryPlanActionLocationValues returns an array of possible values for the RecoveryPlanActionLocation const type. +func PossibleRecoveryPlanActionLocationValues() []RecoveryPlanActionLocation { + return []RecoveryPlanActionLocation{Primary, Recovery} +} + +// RecoveryPlanGroupType enumerates the values for recovery plan group type. +type RecoveryPlanGroupType string + +const ( + // Boot ... + Boot RecoveryPlanGroupType = "Boot" + // Failover ... + Failover RecoveryPlanGroupType = "Failover" + // Shutdown ... + Shutdown RecoveryPlanGroupType = "Shutdown" +) + +// PossibleRecoveryPlanGroupTypeValues returns an array of possible values for the RecoveryPlanGroupType const type. +func PossibleRecoveryPlanGroupTypeValues() []RecoveryPlanGroupType { + return []RecoveryPlanGroupType{Boot, Failover, Shutdown} +} + +// RecoveryPlanPointType enumerates the values for recovery plan point type. +type RecoveryPlanPointType string + +const ( + // RecoveryPlanPointTypeLatest ... + RecoveryPlanPointTypeLatest RecoveryPlanPointType = "Latest" + // RecoveryPlanPointTypeLatestApplicationConsistent ... + RecoveryPlanPointTypeLatestApplicationConsistent RecoveryPlanPointType = "LatestApplicationConsistent" + // RecoveryPlanPointTypeLatestCrashConsistent ... + RecoveryPlanPointTypeLatestCrashConsistent RecoveryPlanPointType = "LatestCrashConsistent" + // RecoveryPlanPointTypeLatestProcessed ... + RecoveryPlanPointTypeLatestProcessed RecoveryPlanPointType = "LatestProcessed" +) + +// PossibleRecoveryPlanPointTypeValues returns an array of possible values for the RecoveryPlanPointType const type. +func PossibleRecoveryPlanPointTypeValues() []RecoveryPlanPointType { + return []RecoveryPlanPointType{RecoveryPlanPointTypeLatest, RecoveryPlanPointTypeLatestApplicationConsistent, RecoveryPlanPointTypeLatestCrashConsistent, RecoveryPlanPointTypeLatestProcessed} +} + +// RecoveryPointSyncType enumerates the values for recovery point sync type. +type RecoveryPointSyncType string + +const ( + // MultiVMSyncRecoveryPoint ... + MultiVMSyncRecoveryPoint RecoveryPointSyncType = "MultiVmSyncRecoveryPoint" + // PerVMRecoveryPoint ... + PerVMRecoveryPoint RecoveryPointSyncType = "PerVmRecoveryPoint" +) + +// PossibleRecoveryPointSyncTypeValues returns an array of possible values for the RecoveryPointSyncType const type. +func PossibleRecoveryPointSyncTypeValues() []RecoveryPointSyncType { + return []RecoveryPointSyncType{MultiVMSyncRecoveryPoint, PerVMRecoveryPoint} +} + +// RecoveryPointType enumerates the values for recovery point type. +type RecoveryPointType string + +const ( + // Custom ... + Custom RecoveryPointType = "Custom" + // LatestTag ... + LatestTag RecoveryPointType = "LatestTag" + // LatestTime ... + LatestTime RecoveryPointType = "LatestTime" +) + +// PossibleRecoveryPointTypeValues returns an array of possible values for the RecoveryPointType const type. +func PossibleRecoveryPointTypeValues() []RecoveryPointType { + return []RecoveryPointType{Custom, LatestTag, LatestTime} +} + +// ReplicationProtectedItemOperation enumerates the values for replication protected item operation. +type ReplicationProtectedItemOperation string + +const ( + // CancelFailover ... + CancelFailover ReplicationProtectedItemOperation = "CancelFailover" + // ChangePit ... + ChangePit ReplicationProtectedItemOperation = "ChangePit" + // Commit ... + Commit ReplicationProtectedItemOperation = "Commit" + // CompleteMigration ... + CompleteMigration ReplicationProtectedItemOperation = "CompleteMigration" + // DisableProtection ... + DisableProtection ReplicationProtectedItemOperation = "DisableProtection" + // Failback ... + Failback ReplicationProtectedItemOperation = "Failback" + // FinalizeFailback ... + FinalizeFailback ReplicationProtectedItemOperation = "FinalizeFailback" + // PlannedFailover ... + PlannedFailover ReplicationProtectedItemOperation = "PlannedFailover" + // RepairReplication ... + RepairReplication ReplicationProtectedItemOperation = "RepairReplication" + // ReverseReplicate ... + ReverseReplicate ReplicationProtectedItemOperation = "ReverseReplicate" + // SwitchProtection ... + SwitchProtection ReplicationProtectedItemOperation = "SwitchProtection" + // TestFailover ... + TestFailover ReplicationProtectedItemOperation = "TestFailover" + // TestFailoverCleanup ... + TestFailoverCleanup ReplicationProtectedItemOperation = "TestFailoverCleanup" + // UnplannedFailover ... + UnplannedFailover ReplicationProtectedItemOperation = "UnplannedFailover" +) + +// PossibleReplicationProtectedItemOperationValues returns an array of possible values for the ReplicationProtectedItemOperation const type. +func PossibleReplicationProtectedItemOperationValues() []ReplicationProtectedItemOperation { + return []ReplicationProtectedItemOperation{CancelFailover, ChangePit, Commit, CompleteMigration, DisableProtection, Failback, FinalizeFailback, PlannedFailover, RepairReplication, ReverseReplicate, SwitchProtection, TestFailover, TestFailoverCleanup, UnplannedFailover} +} + +// ResourceType enumerates the values for resource type. +type ResourceType string + +const ( + // ResourceTypeExisting ... + ResourceTypeExisting ResourceType = "Existing" + // ResourceTypeNew ... + ResourceTypeNew ResourceType = "New" + // ResourceTypeProtectionProfileCustomDetails ... + ResourceTypeProtectionProfileCustomDetails ResourceType = "ProtectionProfileCustomDetails" +) + +// PossibleResourceTypeValues returns an array of possible values for the ResourceType const type. +func PossibleResourceTypeValues() []ResourceType { + return []ResourceType{ResourceTypeExisting, ResourceTypeNew, ResourceTypeProtectionProfileCustomDetails} +} + +// ResourceTypeBasicRecoveryAvailabilitySetCustomDetails enumerates the values for resource type basic recovery +// availability set custom details. +type ResourceTypeBasicRecoveryAvailabilitySetCustomDetails string + +const ( + // ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryAvailabilitySetCustomDetails = "Existing" + // ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails ... + ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails ResourceTypeBasicRecoveryAvailabilitySetCustomDetails = "RecoveryAvailabilitySetCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryAvailabilitySetCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryAvailabilitySetCustomDetails const type. +func PossibleResourceTypeBasicRecoveryAvailabilitySetCustomDetailsValues() []ResourceTypeBasicRecoveryAvailabilitySetCustomDetails { + return []ResourceTypeBasicRecoveryAvailabilitySetCustomDetails{ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails} +} + +// ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails enumerates the values for resource type basic +// recovery proximity placement group custom details. +type ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails string + +const ( + // ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails = "Existing" + // ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails ... + ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails = "RecoveryProximityPlacementGroupCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails const type. +func PossibleResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsValues() []ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails { + return []ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails{ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails} +} + +// ResourceTypeBasicRecoveryResourceGroupCustomDetails enumerates the values for resource type basic recovery +// resource group custom details. +type ResourceTypeBasicRecoveryResourceGroupCustomDetails string + +const ( + // ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryResourceGroupCustomDetails = "Existing" + // ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails ... + ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails ResourceTypeBasicRecoveryResourceGroupCustomDetails = "RecoveryResourceGroupCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryResourceGroupCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryResourceGroupCustomDetails const type. +func PossibleResourceTypeBasicRecoveryResourceGroupCustomDetailsValues() []ResourceTypeBasicRecoveryResourceGroupCustomDetails { + return []ResourceTypeBasicRecoveryResourceGroupCustomDetails{ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails} +} + +// ResourceTypeBasicRecoveryVirtualNetworkCustomDetails enumerates the values for resource type basic recovery +// virtual network custom details. +type ResourceTypeBasicRecoveryVirtualNetworkCustomDetails string + +const ( + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "Existing" + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "New" + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "RecoveryVirtualNetworkCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryVirtualNetworkCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryVirtualNetworkCustomDetails const type. +func PossibleResourceTypeBasicRecoveryVirtualNetworkCustomDetailsValues() []ResourceTypeBasicRecoveryVirtualNetworkCustomDetails { + return []ResourceTypeBasicRecoveryVirtualNetworkCustomDetails{ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew, ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails} +} + +// ResourceTypeBasicStorageAccountCustomDetails enumerates the values for resource type basic storage account +// custom details. +type ResourceTypeBasicStorageAccountCustomDetails string + +const ( + // ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting ... + ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting ResourceTypeBasicStorageAccountCustomDetails = "Existing" + // ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails ... + ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails ResourceTypeBasicStorageAccountCustomDetails = "StorageAccountCustomDetails" +) + +// PossibleResourceTypeBasicStorageAccountCustomDetailsValues returns an array of possible values for the ResourceTypeBasicStorageAccountCustomDetails const type. +func PossibleResourceTypeBasicStorageAccountCustomDetailsValues() []ResourceTypeBasicStorageAccountCustomDetails { + return []ResourceTypeBasicStorageAccountCustomDetails{ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting, ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails} +} + +// ResyncState enumerates the values for resync state. +type ResyncState string + +const ( + // ResyncStateNone ... + ResyncStateNone ResyncState = "None" + // ResyncStatePreparedForResynchronization ... + ResyncStatePreparedForResynchronization ResyncState = "PreparedForResynchronization" + // ResyncStateStartedResynchronization ... + ResyncStateStartedResynchronization ResyncState = "StartedResynchronization" +) + +// PossibleResyncStateValues returns an array of possible values for the ResyncState const type. +func PossibleResyncStateValues() []ResyncState { + return []ResyncState{ResyncStateNone, ResyncStatePreparedForResynchronization, ResyncStateStartedResynchronization} +} + +// RpInMageRecoveryPointType enumerates the values for rp in mage recovery point type. +type RpInMageRecoveryPointType string + +const ( + // RpInMageRecoveryPointTypeCustom ... + RpInMageRecoveryPointTypeCustom RpInMageRecoveryPointType = "Custom" + // RpInMageRecoveryPointTypeLatestTag ... + RpInMageRecoveryPointTypeLatestTag RpInMageRecoveryPointType = "LatestTag" + // RpInMageRecoveryPointTypeLatestTime ... + RpInMageRecoveryPointTypeLatestTime RpInMageRecoveryPointType = "LatestTime" +) + +// PossibleRpInMageRecoveryPointTypeValues returns an array of possible values for the RpInMageRecoveryPointType const type. +func PossibleRpInMageRecoveryPointTypeValues() []RpInMageRecoveryPointType { + return []RpInMageRecoveryPointType{RpInMageRecoveryPointTypeCustom, RpInMageRecoveryPointTypeLatestTag, RpInMageRecoveryPointTypeLatestTime} +} + +// SetMultiVMSyncStatus enumerates the values for set multi vm sync status. +type SetMultiVMSyncStatus string + +const ( + // Disable ... + Disable SetMultiVMSyncStatus = "Disable" + // Enable ... + Enable SetMultiVMSyncStatus = "Enable" +) + +// PossibleSetMultiVMSyncStatusValues returns an array of possible values for the SetMultiVMSyncStatus const type. +func PossibleSetMultiVMSyncStatusValues() []SetMultiVMSyncStatus { + return []SetMultiVMSyncStatus{Disable, Enable} +} + +// Severity enumerates the values for severity. +type Severity string + +const ( + // Error ... + Error Severity = "Error" + // Info ... + Info Severity = "Info" + // NONE ... + NONE Severity = "NONE" + // Warning ... + Warning Severity = "Warning" +) + +// PossibleSeverityValues returns an array of possible values for the Severity const type. +func PossibleSeverityValues() []Severity { + return []Severity{Error, Info, NONE, Warning} +} + +// SourceSiteOperations enumerates the values for source site operations. +type SourceSiteOperations string + +const ( + // NotRequired ... + NotRequired SourceSiteOperations = "NotRequired" + // Required ... + Required SourceSiteOperations = "Required" +) + +// PossibleSourceSiteOperationsValues returns an array of possible values for the SourceSiteOperations const type. +func PossibleSourceSiteOperationsValues() []SourceSiteOperations { + return []SourceSiteOperations{NotRequired, Required} +} + +// SQLServerLicenseType enumerates the values for sql server license type. +type SQLServerLicenseType string + +const ( + // SQLServerLicenseTypeAHUB ... + SQLServerLicenseTypeAHUB SQLServerLicenseType = "AHUB" + // SQLServerLicenseTypeNoLicenseType ... + SQLServerLicenseTypeNoLicenseType SQLServerLicenseType = "NoLicenseType" + // SQLServerLicenseTypeNotSpecified ... + SQLServerLicenseTypeNotSpecified SQLServerLicenseType = "NotSpecified" + // SQLServerLicenseTypePAYG ... + SQLServerLicenseTypePAYG SQLServerLicenseType = "PAYG" +) + +// PossibleSQLServerLicenseTypeValues returns an array of possible values for the SQLServerLicenseType const type. +func PossibleSQLServerLicenseTypeValues() []SQLServerLicenseType { + return []SQLServerLicenseType{SQLServerLicenseTypeAHUB, SQLServerLicenseTypeNoLicenseType, SQLServerLicenseTypeNotSpecified, SQLServerLicenseTypePAYG} +} + +// TestMigrationState enumerates the values for test migration state. +type TestMigrationState string + +const ( + // TestMigrationStateNone ... + TestMigrationStateNone TestMigrationState = "None" + // TestMigrationStateTestMigrationCleanupInProgress ... + TestMigrationStateTestMigrationCleanupInProgress TestMigrationState = "TestMigrationCleanupInProgress" + // TestMigrationStateTestMigrationFailed ... + TestMigrationStateTestMigrationFailed TestMigrationState = "TestMigrationFailed" + // TestMigrationStateTestMigrationInProgress ... + TestMigrationStateTestMigrationInProgress TestMigrationState = "TestMigrationInProgress" + // TestMigrationStateTestMigrationSucceeded ... + TestMigrationStateTestMigrationSucceeded TestMigrationState = "TestMigrationSucceeded" +) + +// PossibleTestMigrationStateValues returns an array of possible values for the TestMigrationState const type. +func PossibleTestMigrationStateValues() []TestMigrationState { + return []TestMigrationState{TestMigrationStateNone, TestMigrationStateTestMigrationCleanupInProgress, TestMigrationStateTestMigrationFailed, TestMigrationStateTestMigrationInProgress, TestMigrationStateTestMigrationSucceeded} +} + +// VMEncryptionType enumerates the values for vm encryption type. +type VMEncryptionType string + +const ( + // NotEncrypted ... + NotEncrypted VMEncryptionType = "NotEncrypted" + // OnePassEncrypted ... + OnePassEncrypted VMEncryptionType = "OnePassEncrypted" + // TwoPassEncrypted ... + TwoPassEncrypted VMEncryptionType = "TwoPassEncrypted" +) + +// PossibleVMEncryptionTypeValues returns an array of possible values for the VMEncryptionType const type. +func PossibleVMEncryptionTypeValues() []VMEncryptionType { + return []VMEncryptionType{NotEncrypted, OnePassEncrypted, TwoPassEncrypted} +} + +// VMReplicationProgressHealth enumerates the values for vm replication progress health. +type VMReplicationProgressHealth string + +const ( + // VMReplicationProgressHealthInProgress ... + VMReplicationProgressHealthInProgress VMReplicationProgressHealth = "InProgress" + // VMReplicationProgressHealthNone ... + VMReplicationProgressHealthNone VMReplicationProgressHealth = "None" + // VMReplicationProgressHealthNoProgress ... + VMReplicationProgressHealthNoProgress VMReplicationProgressHealth = "NoProgress" + // VMReplicationProgressHealthSlowProgress ... + VMReplicationProgressHealthSlowProgress VMReplicationProgressHealth = "SlowProgress" +) + +// PossibleVMReplicationProgressHealthValues returns an array of possible values for the VMReplicationProgressHealth const type. +func PossibleVMReplicationProgressHealthValues() []VMReplicationProgressHealth { + return []VMReplicationProgressHealth{VMReplicationProgressHealthInProgress, VMReplicationProgressHealthNone, VMReplicationProgressHealthNoProgress, VMReplicationProgressHealthSlowProgress} +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/migrationrecoverypoints.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/migrationrecoverypoints.go new file mode 100644 index 000000000000..9360aaeb8f67 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/migrationrecoverypoints.go @@ -0,0 +1,236 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// MigrationRecoveryPointsClient is the client for the MigrationRecoveryPoints methods of the Siterecovery service. +type MigrationRecoveryPointsClient struct { + BaseClient +} + +// NewMigrationRecoveryPointsClient creates an instance of the MigrationRecoveryPointsClient client. +func NewMigrationRecoveryPointsClient(subscriptionID string, resourceGroupName string, resourceName string) MigrationRecoveryPointsClient { + return NewMigrationRecoveryPointsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewMigrationRecoveryPointsClientWithBaseURI creates an instance of the MigrationRecoveryPointsClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewMigrationRecoveryPointsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) MigrationRecoveryPointsClient { + return MigrationRecoveryPointsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get sends the get request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// migrationRecoveryPointName - the migration recovery point name. +func (client MigrationRecoveryPointsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (result MigrationRecoveryPoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, migrationItemName, migrationRecoveryPointName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client MigrationRecoveryPointsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "migrationRecoveryPointName": autorest.Encode("path", migrationRecoveryPointName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints/{migrationRecoveryPointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client MigrationRecoveryPointsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client MigrationRecoveryPointsClient) GetResponder(resp *http.Response) (result MigrationRecoveryPoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationMigrationItems sends the list by replication migration items request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItems(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationRecoveryPointCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.ListByReplicationMigrationItems") + defer func() { + sc := -1 + if result.mrpc.Response.Response != nil { + sc = result.mrpc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationMigrationItemsNextResults + req, err := client.ListByReplicationMigrationItemsPreparer(ctx, fabricName, protectionContainerName, migrationItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationMigrationItemsSender(req) + if err != nil { + result.mrpc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", resp, "Failure sending request") + return + } + + result.mrpc, err = client.ListByReplicationMigrationItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", resp, "Failure responding to request") + return + } + if result.mrpc.hasNextLink() && result.mrpc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationMigrationItemsPreparer prepares the ListByReplicationMigrationItems request. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationMigrationItemsSender sends the ListByReplicationMigrationItems request. The method will close the +// http.Response Body if it receives an error. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationMigrationItemsResponder handles the response to the ListByReplicationMigrationItems request. The method always +// closes the http.Response Body. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsResponder(resp *http.Response) (result MigrationRecoveryPointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationMigrationItemsNextResults retrieves the next set of results, if any. +func (client MigrationRecoveryPointsClient) listByReplicationMigrationItemsNextResults(ctx context.Context, lastResults MigrationRecoveryPointCollection) (result MigrationRecoveryPointCollection, err error) { + req, err := lastResults.migrationRecoveryPointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationMigrationItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationMigrationItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationMigrationItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationRecoveryPointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.ListByReplicationMigrationItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationMigrationItems(ctx, fabricName, protectionContainerName, migrationItemName) + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/models.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/models.go new file mode 100644 index 000000000000..e6a5162fb390 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/models.go @@ -0,0 +1,32466 @@ +package siterecovery + +// 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. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-08-01/siterecovery" + +// A2AAddDisksInput a2A add disk(s) input. +type A2AAddDisksInput struct { + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeAddDisksProviderSpecificInput', 'InstanceTypeA2A' + InstanceType InstanceType `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AAddDisksInput. +func (aadi A2AAddDisksInput) MarshalJSON() ([]byte, error) { + aadi.InstanceType = InstanceTypeA2A + objectMap := make(map[string]interface{}) + if aadi.VMDisks != nil { + objectMap["vmDisks"] = aadi.VMDisks + } + if aadi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aadi.VMManagedDisks + } + if aadi.InstanceType != "" { + objectMap["instanceType"] = aadi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AAddDisksInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsA2AAddDisksInput() (*A2AAddDisksInput, bool) { + return &aadi, true +} + +// AsAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsBasicAddDisksProviderSpecificInput() (BasicAddDisksProviderSpecificInput, bool) { + return &aadi, true +} + +// A2AApplyRecoveryPointInput applyRecoveryPoint input specific to A2A provider. +type A2AApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + aarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aarpi.InstanceType != "" { + objectMap["instanceType"] = aarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return &aarpi, true +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &aarpi, true +} + +// A2AContainerCreationInput a2A cloud creation input. +type A2AContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) MarshalJSON() ([]byte, error) { + acci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acci.InstanceType != "" { + objectMap["instanceType"] = acci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return &acci, true +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &acci, true +} + +// A2AContainerMappingInput a2A container mapping input. +type A2AContainerMappingInput struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) MarshalJSON() ([]byte, error) { + acmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acmi.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = acmi.AgentAutoUpdateStatus + } + if acmi.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = acmi.AutomationAccountArmID + } + if acmi.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = acmi.AutomationAccountAuthenticationType + } + if acmi.InstanceType != "" { + objectMap["instanceType"] = acmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return &acmi, true +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &acmi, true +} + +// A2ACreateProtectionIntentInput a2A create protection intent input. +type A2ACreateProtectionIntentInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryLocation - The primary location for the virtual machine. + PrimaryLocation *string `json:"primaryLocation,omitempty"` + // RecoveryLocation - The recovery location for the virtual machine. + RecoveryLocation *string `json:"recoveryLocation,omitempty"` + // RecoverySubscriptionID - The recovery subscription Id of the virtual machine. + RecoverySubscriptionID *string `json:"recoverySubscriptionId,omitempty"` + // RecoveryAvailabilityType - The recovery availability type of the virtual machine. Possible values include: 'Single', 'AvailabilitySet', 'AvailabilityZone' + RecoveryAvailabilityType A2ARecoveryAvailabilityType `json:"recoveryAvailabilityType,omitempty"` + // ProtectionProfileCustomInput - The protection profile custom inputs. + ProtectionProfileCustomInput BasicProtectionProfileCustomDetails `json:"protectionProfileCustomInput,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` + // RecoveryAvailabilitySetCustomInput - The recovery availability set input. + RecoveryAvailabilitySetCustomInput BasicRecoveryAvailabilitySetCustomDetails `json:"recoveryAvailabilitySetCustomInput,omitempty"` + // RecoveryVirtualNetworkCustomInput - The recovery virtual network input. + RecoveryVirtualNetworkCustomInput BasicRecoveryVirtualNetworkCustomDetails `json:"recoveryVirtualNetworkCustomInput,omitempty"` + // RecoveryProximityPlacementGroupCustomInput - The recovery proximity placement group custom input. + RecoveryProximityPlacementGroupCustomInput BasicRecoveryProximityPlacementGroupCustomDetails `json:"recoveryProximityPlacementGroupCustomInput,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // VMDisks - The list of vm disk inputs. + VMDisks *[]A2AProtectionIntentDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk inputs. + VMManagedDisks *[]A2AProtectionIntentManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccount - The boot diagnostic storage account. + RecoveryBootDiagStorageAccount BasicStorageAccountCustomDetails `json:"recoveryBootDiagStorageAccount,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the authentication type for automation account. The default value is "RunAsAccount". Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails', 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) MarshalJSON() ([]byte, error) { + acpii.InstanceType = InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acpii.FabricObjectID != nil { + objectMap["fabricObjectId"] = acpii.FabricObjectID + } + if acpii.PrimaryLocation != nil { + objectMap["primaryLocation"] = acpii.PrimaryLocation + } + if acpii.RecoveryLocation != nil { + objectMap["recoveryLocation"] = acpii.RecoveryLocation + } + if acpii.RecoverySubscriptionID != nil { + objectMap["recoverySubscriptionId"] = acpii.RecoverySubscriptionID + } + if acpii.RecoveryAvailabilityType != "" { + objectMap["recoveryAvailabilityType"] = acpii.RecoveryAvailabilityType + } + objectMap["protectionProfileCustomInput"] = acpii.ProtectionProfileCustomInput + if acpii.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = acpii.RecoveryResourceGroupID + } + objectMap["primaryStagingStorageAccountCustomInput"] = acpii.PrimaryStagingStorageAccountCustomInput + objectMap["recoveryAvailabilitySetCustomInput"] = acpii.RecoveryAvailabilitySetCustomInput + objectMap["recoveryVirtualNetworkCustomInput"] = acpii.RecoveryVirtualNetworkCustomInput + objectMap["recoveryProximityPlacementGroupCustomInput"] = acpii.RecoveryProximityPlacementGroupCustomInput + if acpii.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = acpii.AutoProtectionOfDataDisk + } + if acpii.VMDisks != nil { + objectMap["vmDisks"] = acpii.VMDisks + } + if acpii.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = acpii.VMManagedDisks + } + if acpii.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = acpii.MultiVMGroupName + } + if acpii.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = acpii.MultiVMGroupID + } + objectMap["recoveryBootDiagStorageAccount"] = acpii.RecoveryBootDiagStorageAccount + if acpii.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = acpii.DiskEncryptionInfo + } + if acpii.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = acpii.RecoveryAvailabilityZone + } + if acpii.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = acpii.AgentAutoUpdateStatus + } + if acpii.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = acpii.AutomationAccountAuthenticationType + } + if acpii.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = acpii.AutomationAccountArmID + } + if acpii.InstanceType != "" { + objectMap["instanceType"] = acpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACreateProtectionIntentInput is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) { + return &acpii, true +} + +// AsCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsBasicCreateProtectionIntentProviderSpecificDetails() (BasicCreateProtectionIntentProviderSpecificDetails, bool) { + return &acpii, true +} + +// UnmarshalJSON is the custom unmarshaler for A2ACreateProtectionIntentInput struct. +func (acpii *A2ACreateProtectionIntentInput) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "fabricObjectId": + if v != nil { + var fabricObjectID string + err = json.Unmarshal(*v, &fabricObjectID) + if err != nil { + return err + } + acpii.FabricObjectID = &fabricObjectID + } + case "primaryLocation": + if v != nil { + var primaryLocation string + err = json.Unmarshal(*v, &primaryLocation) + if err != nil { + return err + } + acpii.PrimaryLocation = &primaryLocation + } + case "recoveryLocation": + if v != nil { + var recoveryLocation string + err = json.Unmarshal(*v, &recoveryLocation) + if err != nil { + return err + } + acpii.RecoveryLocation = &recoveryLocation + } + case "recoverySubscriptionId": + if v != nil { + var recoverySubscriptionID string + err = json.Unmarshal(*v, &recoverySubscriptionID) + if err != nil { + return err + } + acpii.RecoverySubscriptionID = &recoverySubscriptionID + } + case "recoveryAvailabilityType": + if v != nil { + var recoveryAvailabilityType A2ARecoveryAvailabilityType + err = json.Unmarshal(*v, &recoveryAvailabilityType) + if err != nil { + return err + } + acpii.RecoveryAvailabilityType = recoveryAvailabilityType + } + case "protectionProfileCustomInput": + if v != nil { + protectionProfileCustomInput, err := unmarshalBasicProtectionProfileCustomDetails(*v) + if err != nil { + return err + } + acpii.ProtectionProfileCustomInput = protectionProfileCustomInput + } + case "recoveryResourceGroupId": + if v != nil { + var recoveryResourceGroupID string + err = json.Unmarshal(*v, &recoveryResourceGroupID) + if err != nil { + return err + } + acpii.RecoveryResourceGroupID = &recoveryResourceGroupID + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + acpii.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + case "recoveryAvailabilitySetCustomInput": + if v != nil { + recoveryAvailabilitySetCustomInput, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryAvailabilitySetCustomInput = recoveryAvailabilitySetCustomInput + } + case "recoveryVirtualNetworkCustomInput": + if v != nil { + recoveryVirtualNetworkCustomInput, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryVirtualNetworkCustomInput = recoveryVirtualNetworkCustomInput + } + case "recoveryProximityPlacementGroupCustomInput": + if v != nil { + recoveryProximityPlacementGroupCustomInput, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryProximityPlacementGroupCustomInput = recoveryProximityPlacementGroupCustomInput + } + case "autoProtectionOfDataDisk": + if v != nil { + var autoProtectionOfDataDisk AutoProtectionOfDataDisk + err = json.Unmarshal(*v, &autoProtectionOfDataDisk) + if err != nil { + return err + } + acpii.AutoProtectionOfDataDisk = autoProtectionOfDataDisk + } + case "vmDisks": + if v != nil { + var VMDisks []A2AProtectionIntentDiskInputDetails + err = json.Unmarshal(*v, &VMDisks) + if err != nil { + return err + } + acpii.VMDisks = &VMDisks + } + case "vmManagedDisks": + if v != nil { + var VMManagedDisks []A2AProtectionIntentManagedDiskInputDetails + err = json.Unmarshal(*v, &VMManagedDisks) + if err != nil { + return err + } + acpii.VMManagedDisks = &VMManagedDisks + } + case "multiVmGroupName": + if v != nil { + var multiVMGroupName string + err = json.Unmarshal(*v, &multiVMGroupName) + if err != nil { + return err + } + acpii.MultiVMGroupName = &multiVMGroupName + } + case "multiVmGroupId": + if v != nil { + var multiVMGroupID string + err = json.Unmarshal(*v, &multiVMGroupID) + if err != nil { + return err + } + acpii.MultiVMGroupID = &multiVMGroupID + } + case "recoveryBootDiagStorageAccount": + if v != nil { + recoveryBootDiagStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryBootDiagStorageAccount = recoveryBootDiagStorageAccount + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + acpii.DiskEncryptionInfo = &diskEncryptionInfo + } + case "recoveryAvailabilityZone": + if v != nil { + var recoveryAvailabilityZone string + err = json.Unmarshal(*v, &recoveryAvailabilityZone) + if err != nil { + return err + } + acpii.RecoveryAvailabilityZone = &recoveryAvailabilityZone + } + case "agentAutoUpdateStatus": + if v != nil { + var agentAutoUpdateStatus AgentAutoUpdateStatus + err = json.Unmarshal(*v, &agentAutoUpdateStatus) + if err != nil { + return err + } + acpii.AgentAutoUpdateStatus = agentAutoUpdateStatus + } + case "automationAccountAuthenticationType": + if v != nil { + var automationAccountAuthenticationType AutomationAccountAuthenticationType + err = json.Unmarshal(*v, &automationAccountAuthenticationType) + if err != nil { + return err + } + acpii.AutomationAccountAuthenticationType = automationAccountAuthenticationType + } + case "automationAccountArmId": + if v != nil { + var automationAccountArmID string + err = json.Unmarshal(*v, &automationAccountArmID) + if err != nil { + return err + } + acpii.AutomationAccountArmID = &automationAccountArmID + } + case "instanceType": + if v != nil { + var instanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails + err = json.Unmarshal(*v, &instanceType) + if err != nil { + return err + } + acpii.InstanceType = instanceType + } + } + } + + return nil +} + +// A2ACrossClusterMigrationApplyRecoveryPointInput applyRecoveryPoint input specific to +// A2ACrossClusterMigration provider. +type A2ACrossClusterMigrationApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + accmarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmarpi.InstanceType != "" { + objectMap["instanceType"] = accmarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return &accmarpi, true +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &accmarpi, true +} + +// A2ACrossClusterMigrationContainerCreationInput a2ACrossClusterMigration cloud creation input. +type A2ACrossClusterMigrationContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) MarshalJSON() ([]byte, error) { + accmcci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmcci.InstanceType != "" { + objectMap["instanceType"] = accmcci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return &accmcci, true +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &accmcci, true +} + +// A2ACrossClusterMigrationEnableProtectionInput a2A Cross-Cluster Migration enable protection input. +type A2ACrossClusterMigrationEnableProtectionInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) MarshalJSON() ([]byte, error) { + accmepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmepi.FabricObjectID != nil { + objectMap["fabricObjectId"] = accmepi.FabricObjectID + } + if accmepi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = accmepi.RecoveryContainerID + } + if accmepi.InstanceType != "" { + objectMap["instanceType"] = accmepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return &accmepi, true +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &accmepi, true +} + +// A2ACrossClusterMigrationPolicyCreationInput a2A Cross-Cluster Migration Policy creation input. +type A2ACrossClusterMigrationPolicyCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) MarshalJSON() ([]byte, error) { + accmpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmpci.InstanceType != "" { + objectMap["instanceType"] = accmpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return &accmpci, true +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &accmpci, true +} + +// A2ACrossClusterMigrationReplicationDetails a2A provider specific settings. +type A2ACrossClusterMigrationReplicationDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryFabricLocation - Primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // OsType - The type of operating system. + OsType *string `json:"osType,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // LifecycleID - An id associated with the PE 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 item even though other internal Ids/ARM Id might be changing. + LifecycleID *string `json:"lifecycleId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) MarshalJSON() ([]byte, error) { + accmrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmrd.FabricObjectID != nil { + objectMap["fabricObjectId"] = accmrd.FabricObjectID + } + if accmrd.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = accmrd.PrimaryFabricLocation + } + if accmrd.OsType != nil { + objectMap["osType"] = accmrd.OsType + } + if accmrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = accmrd.VMProtectionState + } + if accmrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = accmrd.VMProtectionStateDescription + } + if accmrd.LifecycleID != nil { + objectMap["lifecycleId"] = accmrd.LifecycleID + } + if accmrd.InstanceType != "" { + objectMap["instanceType"] = accmrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return &accmrd, true +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &accmrd, true +} + +// A2AEnableProtectionInput a2A enable protection input. +type A2AEnableProtectionInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryAzureNetworkID - The recovery Azure virtual network ARM id. + RecoveryAzureNetworkID *string `json:"recoveryAzureNetworkId,omitempty"` + // RecoverySubnetName - The recovery subnet name. + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + // RecoveryVirtualMachineScaleSetID - The virtual machine scale set Id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) MarshalJSON() ([]byte, error) { + aepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aepi.FabricObjectID != nil { + objectMap["fabricObjectId"] = aepi.FabricObjectID + } + if aepi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = aepi.RecoveryContainerID + } + if aepi.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aepi.RecoveryResourceGroupID + } + if aepi.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aepi.RecoveryCloudServiceID + } + if aepi.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = aepi.RecoveryAvailabilitySetID + } + if aepi.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aepi.RecoveryProximityPlacementGroupID + } + if aepi.VMDisks != nil { + objectMap["vmDisks"] = aepi.VMDisks + } + if aepi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aepi.VMManagedDisks + } + if aepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = aepi.MultiVMGroupName + } + if aepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = aepi.MultiVMGroupID + } + if aepi.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aepi.RecoveryBootDiagStorageAccountID + } + if aepi.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aepi.DiskEncryptionInfo + } + if aepi.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = aepi.RecoveryAvailabilityZone + } + if aepi.RecoveryAzureNetworkID != nil { + objectMap["recoveryAzureNetworkId"] = aepi.RecoveryAzureNetworkID + } + if aepi.RecoverySubnetName != nil { + objectMap["recoverySubnetName"] = aepi.RecoverySubnetName + } + if aepi.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aepi.RecoveryVirtualMachineScaleSetID + } + if aepi.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = aepi.RecoveryCapacityReservationGroupID + } + if aepi.InstanceType != "" { + objectMap["instanceType"] = aepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return &aepi, true +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &aepi, true +} + +// A2AEventDetails model class for event details of a A2A event. +type A2AEventDetails struct { + // ProtectedItemName - The protected item arm name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // FabricObjectID - The azure vm arm id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // FabricName - Fabric arm name. + FabricName *string `json:"fabricName,omitempty"` + // FabricLocation - The fabric location. + FabricLocation *string `json:"fabricLocation,omitempty"` + // RemoteFabricName - Remote fabric arm name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // RemoteFabricLocation - Remote fabric location. + RemoteFabricLocation *string `json:"remoteFabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AEventDetails. +func (aed A2AEventDetails) MarshalJSON() ([]byte, error) { + aed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aed.ProtectedItemName != nil { + objectMap["protectedItemName"] = aed.ProtectedItemName + } + if aed.FabricObjectID != nil { + objectMap["fabricObjectId"] = aed.FabricObjectID + } + if aed.FabricName != nil { + objectMap["fabricName"] = aed.FabricName + } + if aed.FabricLocation != nil { + objectMap["fabricLocation"] = aed.FabricLocation + } + if aed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = aed.RemoteFabricName + } + if aed.RemoteFabricLocation != nil { + objectMap["remoteFabricLocation"] = aed.RemoteFabricLocation + } + if aed.InstanceType != "" { + objectMap["instanceType"] = aed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return &aed, true +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &aed, true +} + +// A2APolicyCreationInput a2A Policy creation input. +type A2APolicyCreationInput struct { + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) MarshalJSON() ([]byte, error) { + apci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apci.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = apci.RecoveryPointHistory + } + if apci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = apci.CrashConsistentFrequencyInMinutes + } + if apci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = apci.AppConsistentFrequencyInMinutes + } + if apci.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = apci.MultiVMSyncStatus + } + if apci.InstanceType != "" { + objectMap["instanceType"] = apci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return &apci, true +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &apci, true +} + +// A2APolicyDetails a2A specific policy details. +type A2APolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2APolicyDetails. +func (apd A2APolicyDetails) MarshalJSON() ([]byte, error) { + apd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = apd.RecoveryPointThresholdInMinutes + } + if apd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = apd.RecoveryPointHistory + } + if apd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = apd.AppConsistentFrequencyInMinutes + } + if apd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = apd.MultiVMSyncStatus + } + if apd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = apd.CrashConsistentFrequencyInMinutes + } + if apd.InstanceType != "" { + objectMap["instanceType"] = apd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return &apd, true +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &apd, true +} + +// A2AProtectedDiskDetails a2A protected disk details. +type A2AProtectedDiskDetails struct { + // DiskURI - The disk uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountID - The recovery disk storage account. + RecoveryAzureStorageAccountID *string `json:"recoveryAzureStorageAccountId,omitempty"` + // PrimaryDiskAzureStorageAccountID - The primary disk storage account. + PrimaryDiskAzureStorageAccountID *string `json:"primaryDiskAzureStorageAccountId,omitempty"` + // RecoveryDiskURI - Recovery disk uri. + RecoveryDiskURI *string `json:"recoveryDiskUri,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // DiskType - The type of disk. + DiskType *string `json:"diskType,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *bool `json:"resyncRequired,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // DataPendingInStagingStorageAccountInMB - The data pending for replication in MB at staging account. + DataPendingInStagingStorageAccountInMB *float64 `json:"dataPendingInStagingStorageAccountInMB,omitempty"` + // DataPendingAtSourceAgentInMB - The data pending at source virtual machine in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // DiskState - The disk state. + DiskState *string `json:"diskState,omitempty"` + // AllowedDiskLevelOperation - The disk level operations list. + AllowedDiskLevelOperation *[]string `json:"allowedDiskLevelOperation,omitempty"` + // IsDiskEncrypted - A value indicating whether vm has encrypted os disk or not. + IsDiskEncrypted *bool `json:"isDiskEncrypted,omitempty"` + // SecretIdentifier - The secret URL / identifier (BEK). + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // DekKeyVaultArmID - The KeyVault resource id for secret (BEK). + DekKeyVaultArmID *string `json:"dekKeyVaultArmId,omitempty"` + // IsDiskKeyEncrypted - A value indicating whether disk key got encrypted or not. + IsDiskKeyEncrypted *bool `json:"isDiskKeyEncrypted,omitempty"` + // KeyIdentifier - The key URL / identifier (KEK). + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KekKeyVaultArmID - The KeyVault resource id for key (KEK). + KekKeyVaultArmID *string `json:"kekKeyVaultArmId,omitempty"` + // FailoverDiskName - The failover name for the managed disk. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The test failover name for the managed disk. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AProtectedManagedDiskDetails a2A protected managed disk details. +type A2AProtectedManagedDiskDetails struct { + // DiskID - The managed disk Arm id. + DiskID *string `json:"diskId,omitempty"` + // RecoveryResourceGroupID - The recovery disk resource group Arm Id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryTargetDiskID - Recovery target disk Arm Id. + RecoveryTargetDiskID *string `json:"recoveryTargetDiskId,omitempty"` + // RecoveryReplicaDiskID - Recovery replica disk Arm Id. + RecoveryReplicaDiskID *string `json:"recoveryReplicaDiskId,omitempty"` + // RecoveryOrignalTargetDiskID - Recovery original target disk Arm Id. + RecoveryOrignalTargetDiskID *string `json:"recoveryOrignalTargetDiskId,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // PrimaryDiskEncryptionSetID - The primary disk encryption set Id. + PrimaryDiskEncryptionSetID *string `json:"primaryDiskEncryptionSetId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // DiskType - The type of disk. + DiskType *string `json:"diskType,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *bool `json:"resyncRequired,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // DataPendingInStagingStorageAccountInMB - The data pending for replication in MB at staging account. + DataPendingInStagingStorageAccountInMB *float64 `json:"dataPendingInStagingStorageAccountInMB,omitempty"` + // DataPendingAtSourceAgentInMB - The data pending at source virtual machine in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // DiskState - The disk state. + DiskState *string `json:"diskState,omitempty"` + // AllowedDiskLevelOperation - The disk level operations list. + AllowedDiskLevelOperation *[]string `json:"allowedDiskLevelOperation,omitempty"` + // IsDiskEncrypted - A value indicating whether vm has encrypted os disk or not. + IsDiskEncrypted *bool `json:"isDiskEncrypted,omitempty"` + // SecretIdentifier - The secret URL / identifier (BEK). + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // DekKeyVaultArmID - The KeyVault resource id for secret (BEK). + DekKeyVaultArmID *string `json:"dekKeyVaultArmId,omitempty"` + // IsDiskKeyEncrypted - A value indicating whether disk key got encrypted or not. + IsDiskKeyEncrypted *bool `json:"isDiskKeyEncrypted,omitempty"` + // KeyIdentifier - The key URL / identifier (KEK). + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KekKeyVaultArmID - The KeyVault resource id for key (KEK). + KekKeyVaultArmID *string `json:"kekKeyVaultArmId,omitempty"` + // FailoverDiskName - The failover name for the managed disk. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The test failover name for the managed disk. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AProtectionContainerMappingDetails a2A provider specific settings. +type A2AProtectionContainerMappingDetails struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // ScheduleName - The schedule arm name. + ScheduleName *string `json:"scheduleName,omitempty"` + // JobScheduleName - The job schedule arm name. + JobScheduleName *string `json:"jobScheduleName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + apcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apcmd.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = apcmd.AgentAutoUpdateStatus + } + if apcmd.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = apcmd.AutomationAccountArmID + } + if apcmd.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = apcmd.AutomationAccountAuthenticationType + } + if apcmd.ScheduleName != nil { + objectMap["scheduleName"] = apcmd.ScheduleName + } + if apcmd.JobScheduleName != nil { + objectMap["jobScheduleName"] = apcmd.JobScheduleName + } + if apcmd.InstanceType != "" { + objectMap["instanceType"] = apcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return &apcmd, true +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &apcmd, true +} + +// A2AProtectionIntentDiskInputDetails azure VM unmanaged disk input details. +type A2AProtectionIntentDiskInputDetails struct { + // DiskURI - The disk Uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountCustomInput - The recovery VHD storage account input. + RecoveryAzureStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"recoveryAzureStorageAccountCustomInput,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for A2AProtectionIntentDiskInputDetails struct. +func (apidid *A2AProtectionIntentDiskInputDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "diskUri": + if v != nil { + var diskURI string + err = json.Unmarshal(*v, &diskURI) + if err != nil { + return err + } + apidid.DiskURI = &diskURI + } + case "recoveryAzureStorageAccountCustomInput": + if v != nil { + recoveryAzureStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apidid.RecoveryAzureStorageAccountCustomInput = recoveryAzureStorageAccountCustomInput + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apidid.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + } + } + + return nil +} + +// A2AProtectionIntentManagedDiskInputDetails azure VM managed disk input details. +type A2AProtectionIntentManagedDiskInputDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` + // RecoveryResourceGroupCustomInput - The recovery resource group input. + RecoveryResourceGroupCustomInput BasicRecoveryResourceGroupCustomDetails `json:"recoveryResourceGroupCustomInput,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for one / single pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for A2AProtectionIntentManagedDiskInputDetails struct. +func (apimdid *A2AProtectionIntentManagedDiskInputDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "diskId": + if v != nil { + var diskID string + err = json.Unmarshal(*v, &diskID) + if err != nil { + return err + } + apimdid.DiskID = &diskID + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apimdid.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + case "recoveryResourceGroupCustomInput": + if v != nil { + recoveryResourceGroupCustomInput, err := unmarshalBasicRecoveryResourceGroupCustomDetails(*v) + if err != nil { + return err + } + apimdid.RecoveryResourceGroupCustomInput = recoveryResourceGroupCustomInput + } + case "recoveryReplicaDiskAccountType": + if v != nil { + var recoveryReplicaDiskAccountType string + err = json.Unmarshal(*v, &recoveryReplicaDiskAccountType) + if err != nil { + return err + } + apimdid.RecoveryReplicaDiskAccountType = &recoveryReplicaDiskAccountType + } + case "recoveryTargetDiskAccountType": + if v != nil { + var recoveryTargetDiskAccountType string + err = json.Unmarshal(*v, &recoveryTargetDiskAccountType) + if err != nil { + return err + } + apimdid.RecoveryTargetDiskAccountType = &recoveryTargetDiskAccountType + } + case "recoveryDiskEncryptionSetId": + if v != nil { + var recoveryDiskEncryptionSetID string + err = json.Unmarshal(*v, &recoveryDiskEncryptionSetID) + if err != nil { + return err + } + apimdid.RecoveryDiskEncryptionSetID = &recoveryDiskEncryptionSetID + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + apimdid.DiskEncryptionInfo = &diskEncryptionInfo + } + } + } + + return nil +} + +// A2ARecoveryPointDetails a2A provider specific recovery point details. +type A2ARecoveryPointDetails struct { + // RecoveryPointSyncType - A value indicating whether the recovery point is multi VM consistent. Possible values include: 'MultiVMSyncRecoveryPoint', 'PerVMRecoveryPoint' + RecoveryPointSyncType RecoveryPointSyncType `json:"recoveryPointSyncType,omitempty"` + // Disks - List of disk ids representing a recovery point. + Disks *[]string `json:"disks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) MarshalJSON() ([]byte, error) { + arpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if arpd.RecoveryPointSyncType != "" { + objectMap["recoveryPointSyncType"] = arpd.RecoveryPointSyncType + } + if arpd.Disks != nil { + objectMap["disks"] = arpd.Disks + } + if arpd.InstanceType != "" { + objectMap["instanceType"] = arpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return &arpd, true +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &arpd, true +} + +// A2ARemoveDisksInput a2A remove disk(s) input. +type A2ARemoveDisksInput struct { + // VMDisksUris - The list of vm disk vhd URIs. + VMDisksUris *[]string `json:"vmDisksUris,omitempty"` + // VMManagedDisksIds - The list of vm managed disk Ids. + VMManagedDisksIds *[]string `json:"vmManagedDisksIds,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput', 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRemoveDisksProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) MarshalJSON() ([]byte, error) { + ardi.InstanceType = InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ardi.VMDisksUris != nil { + objectMap["vmDisksUris"] = ardi.VMDisksUris + } + if ardi.VMManagedDisksIds != nil { + objectMap["vmManagedDisksIds"] = ardi.VMManagedDisksIds + } + if ardi.InstanceType != "" { + objectMap["instanceType"] = ardi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARemoveDisksInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) { + return &ardi, true +} + +// AsRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsBasicRemoveDisksProviderSpecificInput() (BasicRemoveDisksProviderSpecificInput, bool) { + return &ardi, true +} + +// A2AReplicationDetails a2A provider specific settings. +type A2AReplicationDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // InitialPrimaryZone - READ-ONLY; The initial primary availability zone. + InitialPrimaryZone *string `json:"initialPrimaryZone,omitempty"` + // InitialPrimaryFabricLocation - READ-ONLY; The initial primary fabric location. + InitialPrimaryFabricLocation *string `json:"initialPrimaryFabricLocation,omitempty"` + // InitialRecoveryZone - READ-ONLY; The initial recovery availability zone. + InitialRecoveryZone *string `json:"initialRecoveryZone,omitempty"` + // InitialRecoveryFabricLocation - READ-ONLY; The initial recovery fabric location. + InitialRecoveryFabricLocation *string `json:"initialRecoveryFabricLocation,omitempty"` + // MultiVMGroupID - The multi vm group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupCreateOption - Whether Multi VM group is auto created or specified by user. Possible values include: 'AutoCreated', 'UserSpecified' + MultiVMGroupCreateOption MultiVMGroupCreateOption `json:"multiVmGroupCreateOption,omitempty"` + // ManagementID - The management Id. + ManagementID *string `json:"managementId,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]A2AProtectedDiskDetails `json:"protectedDisks,omitempty"` + // UnprotectedDisks - The list of unprotected disks. + UnprotectedDisks *[]A2AUnprotectedDiskDetails `json:"unprotectedDisks,omitempty"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]A2AProtectedManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // RecoveryBootDiagStorageAccountID - The recovery boot diagnostic storage account Arm Id. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // PrimaryFabricLocation - Primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // RecoveryFabricLocation - The recovery fabric location. + RecoveryFabricLocation *string `json:"recoveryFabricLocation,omitempty"` + // OsType - The type of operating system. + OsType *string `json:"osType,omitempty"` + // RecoveryAzureVMSize - The size of recovery virtual machine. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureVMName - The name of recovery virtual machine. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureResourceGroupID - The recovery resource group. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryCloudService - The recovery cloud service. + RecoveryCloudService *string `json:"recoveryCloudService,omitempty"` + // RecoveryAvailabilitySet - The recovery availability set. + RecoveryAvailabilitySet *string `json:"recoveryAvailabilitySet,omitempty"` + // SelectedRecoveryAzureNetworkID - The recovery virtual network. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The test failover virtual network. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // VMNics - The virtual machine nic details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMSyncedConfigDetails - The synced configuration details. + VMSyncedConfigDetails *AzureToAzureVMSyncedConfigDetails `json:"vmSyncedConfigDetails,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // IsReplicationAgentUpdateRequired - A value indicating whether replication agent update is required. + IsReplicationAgentUpdateRequired *bool `json:"isReplicationAgentUpdateRequired,omitempty"` + // AgentCertificateExpiryDate - READ-ONLY; Agent certificate expiry date. + AgentCertificateExpiryDate *date.Time `json:"agentCertificateExpiryDate,omitempty"` + // IsReplicationAgentCertificateUpdateRequired - A value indicating whether agent certificate update is required. + IsReplicationAgentCertificateUpdateRequired *bool `json:"isReplicationAgentCertificateUpdateRequired,omitempty"` + // RecoveryFabricObjectID - The recovery fabric object Id. + RecoveryFabricObjectID *string `json:"recoveryFabricObjectId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // LifecycleID - An id associated with the PE 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 item even though other internal Ids/ARM Id might be changing. + LifecycleID *string `json:"lifecycleId,omitempty"` + // TestFailoverRecoveryFabricObjectID - The test failover fabric object Id. + TestFailoverRecoveryFabricObjectID *string `json:"testFailoverRecoveryFabricObjectId,omitempty"` + // RpoInSeconds - The last RPO value in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // LastRpoCalculatedTime - The time (in UTC) when the last RPO value was calculated by Protection Service. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // PrimaryAvailabilityZone - The primary availability zone. + PrimaryAvailabilityZone *string `json:"primaryAvailabilityZone,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // VMEncryptionType - READ-ONLY; The encryption type of the VM. Possible values include: 'NotEncrypted', 'OnePassEncrypted', 'TwoPassEncrypted' + VMEncryptionType VMEncryptionType `json:"vmEncryptionType,omitempty"` + // TfoAzureVMName - The test failover vm name. + TfoAzureVMName *string `json:"tfoAzureVMName,omitempty"` + // RecoveryAzureGeneration - READ-ONLY; The recovery azure generation. + RecoveryAzureGeneration *string `json:"recoveryAzureGeneration,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // RecoveryVirtualMachineScaleSetID - The recovery virtual machine scale set id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReplicationDetails. +func (ard A2AReplicationDetails) MarshalJSON() ([]byte, error) { + ard.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ard.FabricObjectID != nil { + objectMap["fabricObjectId"] = ard.FabricObjectID + } + if ard.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = ard.MultiVMGroupID + } + if ard.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = ard.MultiVMGroupName + } + if ard.MultiVMGroupCreateOption != "" { + objectMap["multiVmGroupCreateOption"] = ard.MultiVMGroupCreateOption + } + if ard.ManagementID != nil { + objectMap["managementId"] = ard.ManagementID + } + if ard.ProtectedDisks != nil { + objectMap["protectedDisks"] = ard.ProtectedDisks + } + if ard.UnprotectedDisks != nil { + objectMap["unprotectedDisks"] = ard.UnprotectedDisks + } + if ard.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = ard.ProtectedManagedDisks + } + if ard.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = ard.RecoveryBootDiagStorageAccountID + } + if ard.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = ard.PrimaryFabricLocation + } + if ard.RecoveryFabricLocation != nil { + objectMap["recoveryFabricLocation"] = ard.RecoveryFabricLocation + } + if ard.OsType != nil { + objectMap["osType"] = ard.OsType + } + if ard.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = ard.RecoveryAzureVMSize + } + if ard.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVMName"] = ard.RecoveryAzureVMName + } + if ard.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = ard.RecoveryAzureResourceGroupID + } + if ard.RecoveryCloudService != nil { + objectMap["recoveryCloudService"] = ard.RecoveryCloudService + } + if ard.RecoveryAvailabilitySet != nil { + objectMap["recoveryAvailabilitySet"] = ard.RecoveryAvailabilitySet + } + if ard.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = ard.SelectedRecoveryAzureNetworkID + } + if ard.SelectedTfoAzureNetworkID != nil { + objectMap["selectedTfoAzureNetworkId"] = ard.SelectedTfoAzureNetworkID + } + if ard.VMNics != nil { + objectMap["vmNics"] = ard.VMNics + } + if ard.VMSyncedConfigDetails != nil { + objectMap["vmSyncedConfigDetails"] = ard.VMSyncedConfigDetails + } + if ard.MonitoringPercentageCompletion != nil { + objectMap["monitoringPercentageCompletion"] = ard.MonitoringPercentageCompletion + } + if ard.MonitoringJobType != nil { + objectMap["monitoringJobType"] = ard.MonitoringJobType + } + if ard.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = ard.LastHeartbeat + } + if ard.AgentVersion != nil { + objectMap["agentVersion"] = ard.AgentVersion + } + if ard.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = ard.AgentExpiryDate + } + if ard.IsReplicationAgentUpdateRequired != nil { + objectMap["isReplicationAgentUpdateRequired"] = ard.IsReplicationAgentUpdateRequired + } + if ard.IsReplicationAgentCertificateUpdateRequired != nil { + objectMap["isReplicationAgentCertificateUpdateRequired"] = ard.IsReplicationAgentCertificateUpdateRequired + } + if ard.RecoveryFabricObjectID != nil { + objectMap["recoveryFabricObjectId"] = ard.RecoveryFabricObjectID + } + if ard.VMProtectionState != nil { + objectMap["vmProtectionState"] = ard.VMProtectionState + } + if ard.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = ard.VMProtectionStateDescription + } + if ard.LifecycleID != nil { + objectMap["lifecycleId"] = ard.LifecycleID + } + if ard.TestFailoverRecoveryFabricObjectID != nil { + objectMap["testFailoverRecoveryFabricObjectId"] = ard.TestFailoverRecoveryFabricObjectID + } + if ard.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = ard.RpoInSeconds + } + if ard.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = ard.LastRpoCalculatedTime + } + if ard.PrimaryAvailabilityZone != nil { + objectMap["primaryAvailabilityZone"] = ard.PrimaryAvailabilityZone + } + if ard.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = ard.RecoveryAvailabilityZone + } + if ard.TfoAzureVMName != nil { + objectMap["tfoAzureVMName"] = ard.TfoAzureVMName + } + if ard.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = ard.RecoveryProximityPlacementGroupID + } + if ard.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = ard.AutoProtectionOfDataDisk + } + if ard.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = ard.RecoveryVirtualMachineScaleSetID + } + if ard.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = ard.RecoveryCapacityReservationGroupID + } + if ard.InstanceType != "" { + objectMap["instanceType"] = ard.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return &ard, true +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &ard, true +} + +// A2AReplicationIntentDetails a2A provider specific settings. +type A2AReplicationIntentDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryLocation - The primary location for the virtual machine. + PrimaryLocation *string `json:"primaryLocation,omitempty"` + // RecoveryLocation - The recovery location for the virtual machine. + RecoveryLocation *string `json:"recoveryLocation,omitempty"` + // RecoverySubscriptionID - The recovery subscription Id of the virtual machine. + RecoverySubscriptionID *string `json:"recoverySubscriptionId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AProtectionIntentDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AProtectionIntentManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ProtectionProfile - The protection profile custom details. + ProtectionProfile BasicProtectionProfileCustomDetails `json:"protectionProfile,omitempty"` + // PrimaryStagingStorageAccount - The primary staging storage account details. + PrimaryStagingStorageAccount BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccount,omitempty"` + // RecoveryAvailabilitySet - The recovery availability set details. + RecoveryAvailabilitySet BasicRecoveryAvailabilitySetCustomDetails `json:"recoveryAvailabilitySet,omitempty"` + // RecoveryVirtualNetwork - The recovery virtual network details. + RecoveryVirtualNetwork BasicRecoveryVirtualNetworkCustomDetails `json:"recoveryVirtualNetwork,omitempty"` + // RecoveryProximityPlacementGroup - The recovery proximity placement group custom details. + RecoveryProximityPlacementGroup BasicRecoveryProximityPlacementGroupCustomDetails `json:"recoveryProximityPlacementGroup,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccount - The boot diagnostic storage account. + RecoveryBootDiagStorageAccount BasicStorageAccountCustomDetails `json:"recoveryBootDiagStorageAccount,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryAvailabilityType - The recovery availability type of the virtual machine. + RecoveryAvailabilityType *string `json:"recoveryAvailabilityType,omitempty"` + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings', 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A' + InstanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) MarshalJSON() ([]byte, error) { + arid.InstanceType = InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if arid.FabricObjectID != nil { + objectMap["fabricObjectId"] = arid.FabricObjectID + } + if arid.PrimaryLocation != nil { + objectMap["primaryLocation"] = arid.PrimaryLocation + } + if arid.RecoveryLocation != nil { + objectMap["recoveryLocation"] = arid.RecoveryLocation + } + if arid.RecoverySubscriptionID != nil { + objectMap["recoverySubscriptionId"] = arid.RecoverySubscriptionID + } + if arid.VMDisks != nil { + objectMap["vmDisks"] = arid.VMDisks + } + if arid.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = arid.VMManagedDisks + } + if arid.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = arid.RecoveryResourceGroupID + } + objectMap["protectionProfile"] = arid.ProtectionProfile + objectMap["primaryStagingStorageAccount"] = arid.PrimaryStagingStorageAccount + objectMap["recoveryAvailabilitySet"] = arid.RecoveryAvailabilitySet + objectMap["recoveryVirtualNetwork"] = arid.RecoveryVirtualNetwork + objectMap["recoveryProximityPlacementGroup"] = arid.RecoveryProximityPlacementGroup + if arid.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = arid.AutoProtectionOfDataDisk + } + if arid.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = arid.MultiVMGroupName + } + if arid.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = arid.MultiVMGroupID + } + objectMap["recoveryBootDiagStorageAccount"] = arid.RecoveryBootDiagStorageAccount + if arid.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = arid.DiskEncryptionInfo + } + if arid.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = arid.RecoveryAvailabilityZone + } + if arid.RecoveryAvailabilityType != nil { + objectMap["recoveryAvailabilityType"] = arid.RecoveryAvailabilityType + } + if arid.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = arid.AgentAutoUpdateStatus + } + if arid.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = arid.AutomationAccountArmID + } + if arid.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = arid.AutomationAccountAuthenticationType + } + if arid.InstanceType != "" { + objectMap["instanceType"] = arid.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReplicationIntentDetails is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) { + return &arid, true +} + +// AsReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsBasicReplicationProtectionIntentProviderSpecificSettings() (BasicReplicationProtectionIntentProviderSpecificSettings, bool) { + return &arid, true +} + +// UnmarshalJSON is the custom unmarshaler for A2AReplicationIntentDetails struct. +func (arid *A2AReplicationIntentDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "fabricObjectId": + if v != nil { + var fabricObjectID string + err = json.Unmarshal(*v, &fabricObjectID) + if err != nil { + return err + } + arid.FabricObjectID = &fabricObjectID + } + case "primaryLocation": + if v != nil { + var primaryLocation string + err = json.Unmarshal(*v, &primaryLocation) + if err != nil { + return err + } + arid.PrimaryLocation = &primaryLocation + } + case "recoveryLocation": + if v != nil { + var recoveryLocation string + err = json.Unmarshal(*v, &recoveryLocation) + if err != nil { + return err + } + arid.RecoveryLocation = &recoveryLocation + } + case "recoverySubscriptionId": + if v != nil { + var recoverySubscriptionID string + err = json.Unmarshal(*v, &recoverySubscriptionID) + if err != nil { + return err + } + arid.RecoverySubscriptionID = &recoverySubscriptionID + } + case "vmDisks": + if v != nil { + var VMDisks []A2AProtectionIntentDiskInputDetails + err = json.Unmarshal(*v, &VMDisks) + if err != nil { + return err + } + arid.VMDisks = &VMDisks + } + case "vmManagedDisks": + if v != nil { + var VMManagedDisks []A2AProtectionIntentManagedDiskInputDetails + err = json.Unmarshal(*v, &VMManagedDisks) + if err != nil { + return err + } + arid.VMManagedDisks = &VMManagedDisks + } + case "recoveryResourceGroupId": + if v != nil { + var recoveryResourceGroupID string + err = json.Unmarshal(*v, &recoveryResourceGroupID) + if err != nil { + return err + } + arid.RecoveryResourceGroupID = &recoveryResourceGroupID + } + case "protectionProfile": + if v != nil { + protectionProfile, err := unmarshalBasicProtectionProfileCustomDetails(*v) + if err != nil { + return err + } + arid.ProtectionProfile = protectionProfile + } + case "primaryStagingStorageAccount": + if v != nil { + primaryStagingStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + arid.PrimaryStagingStorageAccount = primaryStagingStorageAccount + } + case "recoveryAvailabilitySet": + if v != nil { + recoveryAvailabilitySet, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryAvailabilitySet = recoveryAvailabilitySet + } + case "recoveryVirtualNetwork": + if v != nil { + recoveryVirtualNetwork, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryVirtualNetwork = recoveryVirtualNetwork + } + case "recoveryProximityPlacementGroup": + if v != nil { + recoveryProximityPlacementGroup, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryProximityPlacementGroup = recoveryProximityPlacementGroup + } + case "autoProtectionOfDataDisk": + if v != nil { + var autoProtectionOfDataDisk AutoProtectionOfDataDisk + err = json.Unmarshal(*v, &autoProtectionOfDataDisk) + if err != nil { + return err + } + arid.AutoProtectionOfDataDisk = autoProtectionOfDataDisk + } + case "multiVmGroupName": + if v != nil { + var multiVMGroupName string + err = json.Unmarshal(*v, &multiVMGroupName) + if err != nil { + return err + } + arid.MultiVMGroupName = &multiVMGroupName + } + case "multiVmGroupId": + if v != nil { + var multiVMGroupID string + err = json.Unmarshal(*v, &multiVMGroupID) + if err != nil { + return err + } + arid.MultiVMGroupID = &multiVMGroupID + } + case "recoveryBootDiagStorageAccount": + if v != nil { + recoveryBootDiagStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryBootDiagStorageAccount = recoveryBootDiagStorageAccount + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + arid.DiskEncryptionInfo = &diskEncryptionInfo + } + case "recoveryAvailabilityZone": + if v != nil { + var recoveryAvailabilityZone string + err = json.Unmarshal(*v, &recoveryAvailabilityZone) + if err != nil { + return err + } + arid.RecoveryAvailabilityZone = &recoveryAvailabilityZone + } + case "recoveryAvailabilityType": + if v != nil { + var recoveryAvailabilityType string + err = json.Unmarshal(*v, &recoveryAvailabilityType) + if err != nil { + return err + } + arid.RecoveryAvailabilityType = &recoveryAvailabilityType + } + case "agentAutoUpdateStatus": + if v != nil { + var agentAutoUpdateStatus AgentAutoUpdateStatus + err = json.Unmarshal(*v, &agentAutoUpdateStatus) + if err != nil { + return err + } + arid.AgentAutoUpdateStatus = agentAutoUpdateStatus + } + case "automationAccountArmId": + if v != nil { + var automationAccountArmID string + err = json.Unmarshal(*v, &automationAccountArmID) + if err != nil { + return err + } + arid.AutomationAccountArmID = &automationAccountArmID + } + case "automationAccountAuthenticationType": + if v != nil { + var automationAccountAuthenticationType AutomationAccountAuthenticationType + err = json.Unmarshal(*v, &automationAccountAuthenticationType) + if err != nil { + return err + } + arid.AutomationAccountAuthenticationType = automationAccountAuthenticationType + } + case "instanceType": + if v != nil { + var instanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings + err = json.Unmarshal(*v, &instanceType) + if err != nil { + return err + } + arid.InstanceType = instanceType + } + } + } + + return nil +} + +// A2AReprotectInput azure specific reprotect input. +type A2AReprotectInput struct { + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReprotectInput. +func (ari A2AReprotectInput) MarshalJSON() ([]byte, error) { + ari.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ari.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = ari.RecoveryContainerID + } + if ari.VMDisks != nil { + objectMap["vmDisks"] = ari.VMDisks + } + if ari.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = ari.RecoveryResourceGroupID + } + if ari.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = ari.RecoveryCloudServiceID + } + if ari.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = ari.RecoveryAvailabilitySetID + } + if ari.PolicyID != nil { + objectMap["policyId"] = ari.PolicyID + } + if ari.InstanceType != "" { + objectMap["instanceType"] = ari.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return &ari, true +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &ari, true +} + +// A2ASwitchProtectionInput a2A specific switch protection input. +type A2ASwitchProtectionInput struct { + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // RecoveryVirtualMachineScaleSetID - The virtual machine scale set id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput', 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicSwitchProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) MarshalJSON() ([]byte, error) { + aspi.InstanceType = InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aspi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = aspi.RecoveryContainerID + } + if aspi.VMDisks != nil { + objectMap["vmDisks"] = aspi.VMDisks + } + if aspi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aspi.VMManagedDisks + } + if aspi.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aspi.RecoveryResourceGroupID + } + if aspi.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aspi.RecoveryCloudServiceID + } + if aspi.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = aspi.RecoveryAvailabilitySetID + } + if aspi.PolicyID != nil { + objectMap["policyId"] = aspi.PolicyID + } + if aspi.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aspi.RecoveryBootDiagStorageAccountID + } + if aspi.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = aspi.RecoveryAvailabilityZone + } + if aspi.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aspi.RecoveryProximityPlacementGroupID + } + if aspi.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aspi.RecoveryVirtualMachineScaleSetID + } + if aspi.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = aspi.RecoveryCapacityReservationGroupID + } + if aspi.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aspi.DiskEncryptionInfo + } + if aspi.InstanceType != "" { + objectMap["instanceType"] = aspi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ASwitchProtectionInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) { + return &aspi, true +} + +// AsSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsBasicSwitchProtectionProviderSpecificInput() (BasicSwitchProtectionProviderSpecificInput, bool) { + return &aspi, true +} + +// A2ATestFailoverInput a2A provider specific input for test failover. +type A2ATestFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for TFO or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) MarshalJSON() ([]byte, error) { + atfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if atfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = atfi.RecoveryPointID + } + if atfi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = atfi.CloudServiceCreationOption + } + if atfi.InstanceType != "" { + objectMap["instanceType"] = atfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return &atfi, true +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &atfi, true +} + +// A2AUnplannedFailoverInput a2A provider specific input for unplanned failover. +type A2AUnplannedFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for failover or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + aufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = aufi.RecoveryPointID + } + if aufi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = aufi.CloudServiceCreationOption + } + if aufi.InstanceType != "" { + objectMap["instanceType"] = aufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return &aufi, true +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &aufi, true +} + +// A2AUnprotectedDiskDetails a2A unprotected disk details. +type A2AUnprotectedDiskDetails struct { + // DiskLunID - The source lun Id for the data disk. + DiskLunID *int32 `json:"diskLunId,omitempty"` + // DiskAutoProtectionStatus - A value indicating whether the disk auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + DiskAutoProtectionStatus AutoProtectionOfDataDisk `json:"diskAutoProtectionStatus,omitempty"` +} + +// A2AUpdateContainerMappingInput a2A update protection container mapping. +type A2AUpdateContainerMappingInput struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + aucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aucmi.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = aucmi.AgentAutoUpdateStatus + } + if aucmi.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = aucmi.AutomationAccountArmID + } + if aucmi.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = aucmi.AutomationAccountAuthenticationType + } + if aucmi.InstanceType != "" { + objectMap["instanceType"] = aucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return &aucmi, true +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &aucmi, true +} + +// A2AUpdateReplicationProtectedItemInput inMage Azure V2 input to update replication protected item. +type A2AUpdateReplicationProtectedItemInput struct { + // RecoveryCloudServiceID - The target cloud service ARM Id (for V1). + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryResourceGroupID - The target resource group ARM Id (for V2). + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ManagedDiskUpdateDetails - Managed disk update details. + ManagedDiskUpdateDetails *[]A2AVMManagedDiskUpdateDetails `json:"managedDiskUpdateDetails,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // DiskEncryptionInfo - The recovery os disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // TfoAzureVMName - The user given name for Test Failover VM. + TfoAzureVMName *string `json:"tfoAzureVMName,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // RecoveryVirtualMachineScaleSetID - The recovery virtual machine scale set Id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + aurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aurpii.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aurpii.RecoveryCloudServiceID + } + if aurpii.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aurpii.RecoveryResourceGroupID + } + if aurpii.ManagedDiskUpdateDetails != nil { + objectMap["managedDiskUpdateDetails"] = aurpii.ManagedDiskUpdateDetails + } + if aurpii.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aurpii.RecoveryBootDiagStorageAccountID + } + if aurpii.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aurpii.DiskEncryptionInfo + } + if aurpii.TfoAzureVMName != nil { + objectMap["tfoAzureVMName"] = aurpii.TfoAzureVMName + } + if aurpii.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aurpii.RecoveryProximityPlacementGroupID + } + if aurpii.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aurpii.RecoveryVirtualMachineScaleSetID + } + if aurpii.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = aurpii.RecoveryCapacityReservationGroupID + } + if aurpii.InstanceType != "" { + objectMap["instanceType"] = aurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return &aurpii, true +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &aurpii, true +} + +// A2AVMDiskInputDetails a2A disk input details. +type A2AVMDiskInputDetails struct { + // DiskURI - The disk Uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountID - The recovery VHD storage account Id. + RecoveryAzureStorageAccountID *string `json:"recoveryAzureStorageAccountId,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account Id. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` +} + +// A2AVMManagedDiskInputDetails a2A managed disk input details. +type A2AVMManagedDiskInputDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account Arm Id. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // RecoveryResourceGroupID - The target resource group Arm Id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for one / single pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` +} + +// A2AVMManagedDiskUpdateDetails a2A Vm managed disk update details. +type A2AVMManagedDiskUpdateDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type before failover. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type before failover. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // DiskEncryptionInfo - The recovery os disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // FailoverDiskName - The target disk name for unplanned failover operation. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The target disk name for test failover operation. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AZoneDetails zone details data. +type A2AZoneDetails struct { + // Source - Source zone info. + Source *string `json:"source,omitempty"` + // Target - The target zone info. + Target *string `json:"target,omitempty"` +} + +// AddDisksInput input for add disk(s) operation. +type AddDisksInput struct { + // Properties - Add disks input properties. + Properties *AddDisksInputProperties `json:"properties,omitempty"` +} + +// AddDisksInputProperties add Disks input properties. +type AddDisksInputProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicAddDisksProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AddDisksInputProperties struct. +func (adip *AddDisksInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicAddDisksProviderSpecificInput(*v) + if err != nil { + return err + } + adip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicAddDisksProviderSpecificInput add Disks provider specific input. +type BasicAddDisksProviderSpecificInput interface { + AsA2AAddDisksInput() (*A2AAddDisksInput, bool) + AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) +} + +// AddDisksProviderSpecificInput add Disks provider specific input. +type AddDisksProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeAddDisksProviderSpecificInput', 'InstanceTypeA2A' + InstanceType InstanceType `json:"instanceType,omitempty"` +} + +func unmarshalBasicAddDisksProviderSpecificInput(body []byte) (BasicAddDisksProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeA2A): + var aadi A2AAddDisksInput + err := json.Unmarshal(body, &aadi) + return aadi, err + default: + var adpsi AddDisksProviderSpecificInput + err := json.Unmarshal(body, &adpsi) + return adpsi, err + } +} +func unmarshalBasicAddDisksProviderSpecificInputArray(body []byte) ([]BasicAddDisksProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + adpsiArray := make([]BasicAddDisksProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + adpsi, err := unmarshalBasicAddDisksProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + adpsiArray[index] = adpsi + } + return adpsiArray, nil +} + +// MarshalJSON is the custom marshaler for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) MarshalJSON() ([]byte, error) { + adpsi.InstanceType = InstanceTypeAddDisksProviderSpecificInput + objectMap := make(map[string]interface{}) + if adpsi.InstanceType != "" { + objectMap["instanceType"] = adpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AAddDisksInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsA2AAddDisksInput() (*A2AAddDisksInput, bool) { + return nil, false +} + +// AsAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) { + return &adpsi, true +} + +// AsBasicAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsBasicAddDisksProviderSpecificInput() (BasicAddDisksProviderSpecificInput, bool) { + return &adpsi, true +} + +// AddRecoveryServicesProviderInput input required to add a provider. +type AddRecoveryServicesProviderInput struct { + // Properties - The properties of an add provider request. + Properties *AddRecoveryServicesProviderInputProperties `json:"properties,omitempty"` +} + +// AddRecoveryServicesProviderInputProperties the properties of an add provider request. +type AddRecoveryServicesProviderInputProperties struct { + // MachineName - The name of the machine where the provider is getting added. + MachineName *string `json:"machineName,omitempty"` + // MachineID - The Id of the machine where the provider is getting added. + MachineID *string `json:"machineId,omitempty"` + // BiosID - The Bios Id of the machine. + BiosID *string `json:"biosId,omitempty"` + // AuthenticationIdentityInput - The identity provider input for DRA authentication. + AuthenticationIdentityInput *IdentityProviderInput `json:"authenticationIdentityInput,omitempty"` + // ResourceAccessIdentityInput - The identity provider input for resource access. + ResourceAccessIdentityInput *IdentityProviderInput `json:"resourceAccessIdentityInput,omitempty"` + // DataPlaneAuthenticationIdentityInput - The identity provider input for data plane authentication. + DataPlaneAuthenticationIdentityInput *IdentityProviderInput `json:"dataPlaneAuthenticationIdentityInput,omitempty"` +} + +// AddVCenterRequest input required to add vCenter. +type AddVCenterRequest struct { + // Properties - The properties of an add vCenter request. + Properties *AddVCenterRequestProperties `json:"properties,omitempty"` +} + +// AddVCenterRequestProperties the properties of an add vCenter request. +type AddVCenterRequestProperties struct { + // FriendlyName - The friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the vCenter to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // ProcessServerID - The process server Id from where the discovery is orchestrated. + ProcessServerID *string `json:"processServerId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The account Id which has privileges to discover the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// AgentDetails agent details. +type AgentDetails struct { + // AgentID - READ-ONLY; The Id of the agent running on the server. + AgentID *string `json:"agentId,omitempty"` + // MachineID - READ-ONLY; The Id of the machine to which the agent is registered. + MachineID *string `json:"machineId,omitempty"` + // BiosID - READ-ONLY; The machine BIOS Id. + BiosID *string `json:"biosId,omitempty"` + // Fqdn - READ-ONLY; The machine FQDN. + Fqdn *string `json:"fqdn,omitempty"` + // Disks - READ-ONLY; The disks. + Disks *[]AgentDiskDetails `json:"disks,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentDetails. +func (ad AgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AgentDiskDetails agent disk details. +type AgentDiskDetails struct { + // DiskID - READ-ONLY; The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LunID - READ-ONLY; The lun of disk. + LunID *int32 `json:"lunId,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentDiskDetails. +func (add AgentDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Alert implements the Alert class. +type Alert struct { + autorest.Response `json:"-"` + // Properties - Alert related data. + Properties *AlertProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Alert. +func (a Alert) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.Properties != nil { + objectMap["properties"] = a.Properties + } + if a.Location != nil { + objectMap["location"] = a.Location + } + return json.Marshal(objectMap) +} + +// AlertCollection collection of alerts. +type AlertCollection struct { + autorest.Response `json:"-"` + // Value - The list of alerts. + Value *[]Alert `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// AlertCollectionIterator provides access to a complete listing of Alert values. +type AlertCollectionIterator struct { + i int + page AlertCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AlertCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AlertCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AlertCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AlertCollectionIterator) Response() AlertCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AlertCollectionIterator) Value() Alert { + if !iter.page.NotDone() { + return Alert{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AlertCollectionIterator type. +func NewAlertCollectionIterator(page AlertCollectionPage) AlertCollectionIterator { + return AlertCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ac AlertCollection) IsEmpty() bool { + return ac.Value == nil || len(*ac.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ac AlertCollection) hasNextLink() bool { + return ac.NextLink != nil && len(*ac.NextLink) != 0 +} + +// alertCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ac AlertCollection) alertCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ac.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ac.NextLink))) +} + +// AlertCollectionPage contains a page of Alert values. +type AlertCollectionPage struct { + fn func(context.Context, AlertCollection) (AlertCollection, error) + ac AlertCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AlertCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ac) + if err != nil { + return err + } + page.ac = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AlertCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AlertCollectionPage) NotDone() bool { + return !page.ac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AlertCollectionPage) Response() AlertCollection { + return page.ac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AlertCollectionPage) Values() []Alert { + if page.ac.IsEmpty() { + return nil + } + return *page.ac.Value +} + +// Creates a new instance of the AlertCollectionPage type. +func NewAlertCollectionPage(cur AlertCollection, getNextPage func(context.Context, AlertCollection) (AlertCollection, error)) AlertCollectionPage { + return AlertCollectionPage{ + fn: getNextPage, + ac: cur, + } +} + +// AlertProperties the properties of an alert. +type AlertProperties struct { + // SendToOwners - A value indicating whether to send email to subscription administrator. + SendToOwners *string `json:"sendToOwners,omitempty"` + // CustomEmailAddresses - The custom email address for sending emails. + CustomEmailAddresses *[]string `json:"customEmailAddresses,omitempty"` + // Locale - The locale for the email notification. + Locale *string `json:"locale,omitempty"` +} + +// ApplyRecoveryPointInput input to apply recovery point. +type ApplyRecoveryPointInput struct { + // Properties - The input properties to apply recovery point. + Properties *ApplyRecoveryPointInputProperties `json:"properties,omitempty"` +} + +// ApplyRecoveryPointInputProperties input properties to apply recovery point. +type ApplyRecoveryPointInputProperties struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // ProviderSpecificDetails - Provider specific input for applying recovery point. + ProviderSpecificDetails BasicApplyRecoveryPointProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ApplyRecoveryPointInputProperties struct. +func (arpip *ApplyRecoveryPointInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryPointId": + if v != nil { + var recoveryPointID string + err = json.Unmarshal(*v, &recoveryPointID) + if err != nil { + return err + } + arpip.RecoveryPointID = &recoveryPointID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicApplyRecoveryPointProviderSpecificInput(*v) + if err != nil { + return err + } + arpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicApplyRecoveryPointProviderSpecificInput provider specific input for apply recovery point. +type BasicApplyRecoveryPointProviderSpecificInput interface { + AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) + AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) + AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) + AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) + AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) + AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) +} + +// ApplyRecoveryPointProviderSpecificInput provider specific input for apply recovery point. +type ApplyRecoveryPointProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicApplyRecoveryPointProviderSpecificInput(body []byte) (BasicApplyRecoveryPointProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A): + var aarpi A2AApplyRecoveryPointInput + err := json.Unmarshal(body, &aarpi) + return aarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput + err := json.Unmarshal(body, &accmarpi) + return accmarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraarpi HyperVReplicaAzureApplyRecoveryPointInput + err := json.Unmarshal(body, &hvraarpi) + return hvraarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2): + var imavarpi InMageAzureV2ApplyRecoveryPointInput + err := json.Unmarshal(body, &imavarpi) + return imavarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm): + var imrarpi InMageRcmApplyRecoveryPointInput + err := json.Unmarshal(body, &imrarpi) + return imrarpi, err + default: + var arppsi ApplyRecoveryPointProviderSpecificInput + err := json.Unmarshal(body, &arppsi) + return arppsi, err + } +} +func unmarshalBasicApplyRecoveryPointProviderSpecificInputArray(body []byte) ([]BasicApplyRecoveryPointProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + arppsiArray := make([]BasicApplyRecoveryPointProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + arppsi, err := unmarshalBasicApplyRecoveryPointProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + arppsiArray[index] = arppsi + } + return arppsiArray, nil +} + +// MarshalJSON is the custom marshaler for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) MarshalJSON() ([]byte, error) { + arppsi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput + objectMap := make(map[string]interface{}) + if arppsi.InstanceType != "" { + objectMap["instanceType"] = arppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return &arppsi, true +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &arppsi, true +} + +// AsrJobDetails this class represents job details based on specific job type. +type AsrJobDetails struct { + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AsrJobDetails. +func (ajd AsrJobDetails) MarshalJSON() ([]byte, error) { + ajd.InstanceType = InstanceTypeAsrJobDetails + objectMap := make(map[string]interface{}) + if ajd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = ajd.AffectedObjectDetails + } + if ajd.InstanceType != "" { + objectMap["instanceType"] = ajd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return &ajd, true +} + +// AsExportJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &ajd, true +} + +// ASRTask task of the Job. +type ASRTask struct { + // TaskID - The Id. + TaskID *string `json:"taskId,omitempty"` + // Name - The unique Task name. + Name *string `json:"name,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // AllowedActions - The state/actions applicable on this task. + AllowedActions *[]string `json:"allowedActions,omitempty"` + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // State - The State. It is one of these values - NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or Other. + State *string `json:"state,omitempty"` + // StateDescription - The description of the task state. For example - For Succeeded state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. + StateDescription *string `json:"stateDescription,omitempty"` + // TaskType - The type of task. Details in CustomDetails property depend on this type. + TaskType *string `json:"taskType,omitempty"` + // CustomDetails - The custom task details based on the task type. + CustomDetails BasicTaskTypeDetails `json:"customDetails,omitempty"` + // GroupTaskCustomDetails - The custom task details based on the task type, if the task type is GroupTaskDetails or one of the types derived from it. + GroupTaskCustomDetails BasicGroupTaskDetails `json:"groupTaskCustomDetails,omitempty"` + // Errors - The task error details. + Errors *[]JobErrorDetails `json:"errors,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ASRTask struct. +func (at *ASRTask) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "taskId": + if v != nil { + var taskID string + err = json.Unmarshal(*v, &taskID) + if err != nil { + return err + } + at.TaskID = &taskID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + at.Name = &name + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + at.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + at.EndTime = &endTime + } + case "allowedActions": + if v != nil { + var allowedActions []string + err = json.Unmarshal(*v, &allowedActions) + if err != nil { + return err + } + at.AllowedActions = &allowedActions + } + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + at.FriendlyName = &friendlyName + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + at.State = &state + } + case "stateDescription": + if v != nil { + var stateDescription string + err = json.Unmarshal(*v, &stateDescription) + if err != nil { + return err + } + at.StateDescription = &stateDescription + } + case "taskType": + if v != nil { + var taskType string + err = json.Unmarshal(*v, &taskType) + if err != nil { + return err + } + at.TaskType = &taskType + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicTaskTypeDetails(*v) + if err != nil { + return err + } + at.CustomDetails = customDetails + } + case "groupTaskCustomDetails": + if v != nil { + groupTaskCustomDetails, err := unmarshalBasicGroupTaskDetails(*v) + if err != nil { + return err + } + at.GroupTaskCustomDetails = groupTaskCustomDetails + } + case "errors": + if v != nil { + var errorsVar []JobErrorDetails + err = json.Unmarshal(*v, &errorsVar) + if err != nil { + return err + } + at.Errors = &errorsVar + } + } + } + + return nil +} + +// AutomationRunbookTaskDetails this class represents the task details for an automation runbook. +type AutomationRunbookTaskDetails struct { + // Name - The recovery plan task name. + Name *string `json:"name,omitempty"` + // CloudServiceName - The cloud service of the automation runbook account. + CloudServiceName *string `json:"cloudServiceName,omitempty"` + // SubscriptionID - The subscription Id of the automation runbook account. + SubscriptionID *string `json:"subscriptionId,omitempty"` + // AccountName - The automation account name of the runbook. + AccountName *string `json:"accountName,omitempty"` + // RunbookID - The runbook Id. + RunbookID *string `json:"runbookId,omitempty"` + // RunbookName - The runbook name. + RunbookName *string `json:"runbookName,omitempty"` + // JobID - The job Id of the runbook execution. + JobID *string `json:"jobId,omitempty"` + // JobOutput - The execution output of the runbook. + JobOutput *string `json:"jobOutput,omitempty"` + // IsPrimarySideScript - A value indicating whether it is a primary side script or not. + IsPrimarySideScript *bool `json:"isPrimarySideScript,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) MarshalJSON() ([]byte, error) { + artd.InstanceType = InstanceTypeAutomationRunbookTaskDetails + objectMap := make(map[string]interface{}) + if artd.Name != nil { + objectMap["name"] = artd.Name + } + if artd.CloudServiceName != nil { + objectMap["cloudServiceName"] = artd.CloudServiceName + } + if artd.SubscriptionID != nil { + objectMap["subscriptionId"] = artd.SubscriptionID + } + if artd.AccountName != nil { + objectMap["accountName"] = artd.AccountName + } + if artd.RunbookID != nil { + objectMap["runbookId"] = artd.RunbookID + } + if artd.RunbookName != nil { + objectMap["runbookName"] = artd.RunbookName + } + if artd.JobID != nil { + objectMap["jobId"] = artd.JobID + } + if artd.JobOutput != nil { + objectMap["jobOutput"] = artd.JobOutput + } + if artd.IsPrimarySideScript != nil { + objectMap["isPrimarySideScript"] = artd.IsPrimarySideScript + } + if artd.InstanceType != "" { + objectMap["instanceType"] = artd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return &artd, true +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &artd, true +} + +// AzureFabricCreationInput fabric provider specific settings. +type AzureFabricCreationInput struct { + // Location - The Location. + Location *string `json:"location,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreationInput', 'InstanceTypeAzure', 'InstanceTypeInMageRcm', 'InstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) MarshalJSON() ([]byte, error) { + afci.InstanceType = InstanceTypeAzure + objectMap := make(map[string]interface{}) + if afci.Location != nil { + objectMap["location"] = afci.Location + } + if afci.InstanceType != "" { + objectMap["instanceType"] = afci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return &afci, true +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &afci, true +} + +// AzureFabricSpecificDetails azure Fabric Specific Details. +type AzureFabricSpecificDetails struct { + // Location - The Location for the Azure fabric. + Location *string `json:"location,omitempty"` + // ContainerIds - The container Ids for the Azure fabric. + ContainerIds *[]string `json:"containerIds,omitempty"` + // Zones - The zones. + Zones *[]A2AZoneDetails `json:"zones,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) MarshalJSON() ([]byte, error) { + afsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure + objectMap := make(map[string]interface{}) + if afsd.Location != nil { + objectMap["location"] = afsd.Location + } + if afsd.ContainerIds != nil { + objectMap["containerIds"] = afsd.ContainerIds + } + if afsd.Zones != nil { + objectMap["zones"] = afsd.Zones + } + if afsd.InstanceType != "" { + objectMap["instanceType"] = afsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return &afsd, true +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &afsd, true +} + +// AzureToAzureCreateNetworkMappingInput create network mappings input properties/behavior specific to +// Azure to Azure Network mapping. +type AzureToAzureCreateNetworkMappingInput struct { + // PrimaryNetworkID - The primary azure vnet Id. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + atacnmi.InstanceType = InstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if atacnmi.PrimaryNetworkID != nil { + objectMap["primaryNetworkId"] = atacnmi.PrimaryNetworkID + } + if atacnmi.InstanceType != "" { + objectMap["instanceType"] = atacnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return &atacnmi, true +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &atacnmi, true +} + +// AzureToAzureNetworkMappingSettings a2A Network Mapping fabric specific settings. +type AzureToAzureNetworkMappingSettings struct { + // PrimaryFabricLocation - The primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // RecoveryFabricLocation - The recovery fabric location. + RecoveryFabricLocation *string `json:"recoveryFabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) MarshalJSON() ([]byte, error) { + atanms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if atanms.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = atanms.PrimaryFabricLocation + } + if atanms.RecoveryFabricLocation != nil { + objectMap["recoveryFabricLocation"] = atanms.RecoveryFabricLocation + } + if atanms.InstanceType != "" { + objectMap["instanceType"] = atanms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return &atanms, true +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &atanms, true +} + +// AzureToAzureUpdateNetworkMappingInput updates network mappings input. +type AzureToAzureUpdateNetworkMappingInput struct { + // PrimaryNetworkID - The primary azure vnet Id. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + ataunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if ataunmi.PrimaryNetworkID != nil { + objectMap["primaryNetworkId"] = ataunmi.PrimaryNetworkID + } + if ataunmi.InstanceType != "" { + objectMap["instanceType"] = ataunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return &ataunmi, true +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &ataunmi, true +} + +// AzureToAzureVMSyncedConfigDetails azure to Azure VM synced configuration details. +type AzureToAzureVMSyncedConfigDetails struct { + // Tags - The Azure VM tags. + Tags map[string]*string `json:"tags"` + // InputEndpoints - The Azure VM input endpoints. + InputEndpoints *[]InputEndpoint `json:"inputEndpoints,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureVMSyncedConfigDetails. +func (atavscd AzureToAzureVMSyncedConfigDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if atavscd.Tags != nil { + objectMap["tags"] = atavscd.Tags + } + if atavscd.InputEndpoints != nil { + objectMap["inputEndpoints"] = atavscd.InputEndpoints + } + return json.Marshal(objectMap) +} + +// AzureVMDiskDetails disk details for E2A provider. +type AzureVMDiskDetails struct { + // VhdType - VHD type. + VhdType *string `json:"vhdType,omitempty"` + // VhdID - The VHD id. + VhdID *string `json:"vhdId,omitempty"` + // DiskID - The disk resource id. + DiskID *string `json:"diskId,omitempty"` + // VhdName - VHD name. + VhdName *string `json:"vhdName,omitempty"` + // MaxSizeMB - Max side in MB. + MaxSizeMB *string `json:"maxSizeMB,omitempty"` + // TargetDiskLocation - Blob uri of the Azure disk. + TargetDiskLocation *string `json:"targetDiskLocation,omitempty"` + // TargetDiskName - The target Azure disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` + // LunID - Ordinal\LunId of the disk for the Azure VM. + LunID *string `json:"lunId,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // CustomTargetDiskName - The custom target Azure disk name. + CustomTargetDiskName *string `json:"customTargetDiskName,omitempty"` +} + +// ComputeSizeErrorDetails represents the error used to indicate why the target compute size is not +// applicable. +type ComputeSizeErrorDetails struct { + // Message - The error message. + Message *string `json:"message,omitempty"` + // Severity - The severity of the error. + Severity *string `json:"severity,omitempty"` +} + +// BasicConfigurationSettings replication provider specific settings. +type BasicConfigurationSettings interface { + AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) + AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) + AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) + AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) + AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) + AsConfigurationSettings() (*ConfigurationSettings, bool) +} + +// ConfigurationSettings replication provider specific settings. +type ConfigurationSettings struct { + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicConfigurationSettings(body []byte) (BasicConfigurationSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeHyperVVirtualMachine): + var hvvmd HyperVVirtualMachineDetails + err := json.Unmarshal(body, &hvvmd) + return hvvmd, err + case string(InstanceTypeReplicationGroupDetails): + var rgd ReplicationGroupDetails + err := json.Unmarshal(body, &rgd) + return rgd, err + case string(InstanceTypeVmmVirtualMachine): + var vvmd VmmVirtualMachineDetails + err := json.Unmarshal(body, &vvmd) + return vvmd, err + case string(InstanceTypeVMwareVirtualMachine): + var vmvmd VMwareVirtualMachineDetails + err := json.Unmarshal(body, &vmvmd) + return vmvmd, err + default: + var cs ConfigurationSettings + err := json.Unmarshal(body, &cs) + return cs, err + } +} +func unmarshalBasicConfigurationSettingsArray(body []byte) ([]BasicConfigurationSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + csArray := make([]BasicConfigurationSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cs, err := unmarshalBasicConfigurationSettings(*rawMessage) + if err != nil { + return nil, err + } + csArray[index] = cs + } + return csArray, nil +} + +// MarshalJSON is the custom marshaler for ConfigurationSettings. +func (cs ConfigurationSettings) MarshalJSON() ([]byte, error) { + cs.InstanceType = InstanceTypeConfigurationSettings + objectMap := make(map[string]interface{}) + if cs.InstanceType != "" { + objectMap["instanceType"] = cs.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return &cs, true +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &cs, true +} + +// ConfigureAlertRequest request to configure alerts for the system. +type ConfigureAlertRequest struct { + // Properties - The properties of a configure alert request. + Properties *ConfigureAlertRequestProperties `json:"properties,omitempty"` +} + +// ConfigureAlertRequestProperties properties of a configure alert request. +type ConfigureAlertRequestProperties struct { + // SendToOwners - A value indicating whether to send email to subscription administrator. + SendToOwners *string `json:"sendToOwners,omitempty"` + // CustomEmailAddresses - The custom email address for sending emails. + CustomEmailAddresses *[]string `json:"customEmailAddresses,omitempty"` + // Locale - The locale for the email notification. + Locale *string `json:"locale,omitempty"` +} + +// ConsistencyCheckTaskDetails this class contains monitoring details of all the inconsistent Protected +// Entities in Vmm. +type ConsistencyCheckTaskDetails struct { + // VMDetails - The list of inconsistent Vm details. + VMDetails *[]InconsistentVMDetails `json:"vmDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) MarshalJSON() ([]byte, error) { + cctd.InstanceType = InstanceTypeConsistencyCheckTaskDetails + objectMap := make(map[string]interface{}) + if cctd.VMDetails != nil { + objectMap["vmDetails"] = cctd.VMDetails + } + if cctd.InstanceType != "" { + objectMap["instanceType"] = cctd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return &cctd, true +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &cctd, true +} + +// CreateNetworkMappingInput create network mappings input. +type CreateNetworkMappingInput struct { + // Properties - Input properties for creating network mapping. + Properties *CreateNetworkMappingInputProperties `json:"properties,omitempty"` +} + +// CreateNetworkMappingInputProperties common input details for network mapping operation. +type CreateNetworkMappingInputProperties struct { + // RecoveryFabricName - Recovery fabric Name. + RecoveryFabricName *string `json:"recoveryFabricName,omitempty"` + // RecoveryNetworkID - Recovery network Id. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // FabricSpecificDetails - Fabric specific input properties. + FabricSpecificDetails BasicFabricSpecificCreateNetworkMappingInput `json:"fabricSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateNetworkMappingInputProperties struct. +func (cnmip *CreateNetworkMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryFabricName": + if v != nil { + var recoveryFabricName string + err = json.Unmarshal(*v, &recoveryFabricName) + if err != nil { + return err + } + cnmip.RecoveryFabricName = &recoveryFabricName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + cnmip.RecoveryNetworkID = &recoveryNetworkID + } + case "fabricSpecificDetails": + if v != nil { + fabricSpecificDetails, err := unmarshalBasicFabricSpecificCreateNetworkMappingInput(*v) + if err != nil { + return err + } + cnmip.FabricSpecificDetails = fabricSpecificDetails + } + } + } + + return nil +} + +// CreatePolicyInput protection Policy input. +type CreatePolicyInput struct { + // Properties - Policy creation properties. + Properties *CreatePolicyInputProperties `json:"properties,omitempty"` +} + +// CreatePolicyInputProperties policy creation properties. +type CreatePolicyInputProperties struct { + // ProviderSpecificInput - The ReplicationProviderSettings. + ProviderSpecificInput BasicPolicyProviderSpecificInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreatePolicyInputProperties struct. +func (cpip *CreatePolicyInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicPolicyProviderSpecificInput(*v) + if err != nil { + return err + } + cpip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionContainerInput create protection container input. +type CreateProtectionContainerInput struct { + // Properties - Create protection container input properties. + Properties *CreateProtectionContainerInputProperties `json:"properties,omitempty"` +} + +// CreateProtectionContainerInputProperties create protection container input properties. +type CreateProtectionContainerInputProperties struct { + // ProviderSpecificInput - Provider specific inputs for container creation. + ProviderSpecificInput *[]BasicReplicationProviderSpecificContainerCreationInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionContainerInputProperties struct. +func (cpcip *CreateProtectionContainerInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificContainerCreationInputArray(*v) + if err != nil { + return err + } + cpcip.ProviderSpecificInput = &providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionContainerMappingInput configure pairing input. +type CreateProtectionContainerMappingInput struct { + // Properties - Configure protection input properties. + Properties *CreateProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// CreateProtectionContainerMappingInputProperties configure pairing input properties. +type CreateProtectionContainerMappingInputProperties struct { + // TargetProtectionContainerID - The target unique protection container name. + TargetProtectionContainerID *string `json:"targetProtectionContainerId,omitempty"` + // PolicyID - Applicable policy. + PolicyID *string `json:"policyId,omitempty"` + // ProviderSpecificInput - Provider specific input for pairing. + ProviderSpecificInput BasicReplicationProviderSpecificContainerMappingInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionContainerMappingInputProperties struct. +func (cpcmip *CreateProtectionContainerMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetProtectionContainerId": + if v != nil { + var targetProtectionContainerID string + err = json.Unmarshal(*v, &targetProtectionContainerID) + if err != nil { + return err + } + cpcmip.TargetProtectionContainerID = &targetProtectionContainerID + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + cpcmip.PolicyID = &policyID + } + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificContainerMappingInput(*v) + if err != nil { + return err + } + cpcmip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionIntentInput create protection intent input. +type CreateProtectionIntentInput struct { + // Properties - Create protection intent input properties. + Properties *CreateProtectionIntentProperties `json:"properties,omitempty"` +} + +// CreateProtectionIntentProperties create protection intent input properties. +type CreateProtectionIntentProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For A2A provider, it will be A2ACreateProtectionIntentInput object. + ProviderSpecificDetails BasicCreateProtectionIntentProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionIntentProperties struct. +func (cpip *CreateProtectionIntentProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicCreateProtectionIntentProviderSpecificDetails(*v) + if err != nil { + return err + } + cpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicCreateProtectionIntentProviderSpecificDetails create protection intent provider specific input. +type BasicCreateProtectionIntentProviderSpecificDetails interface { + AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) + AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) +} + +// CreateProtectionIntentProviderSpecificDetails create protection intent provider specific input. +type CreateProtectionIntentProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails', 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicCreateProtectionIntentProviderSpecificDetails(body []byte) (BasicCreateProtectionIntentProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A): + var acpii A2ACreateProtectionIntentInput + err := json.Unmarshal(body, &acpii) + return acpii, err + default: + var cpipsd CreateProtectionIntentProviderSpecificDetails + err := json.Unmarshal(body, &cpipsd) + return cpipsd, err + } +} +func unmarshalBasicCreateProtectionIntentProviderSpecificDetailsArray(body []byte) ([]BasicCreateProtectionIntentProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + cpipsdArray := make([]BasicCreateProtectionIntentProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cpipsd, err := unmarshalBasicCreateProtectionIntentProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + cpipsdArray[index] = cpipsd + } + return cpipsdArray, nil +} + +// MarshalJSON is the custom marshaler for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) MarshalJSON() ([]byte, error) { + cpipsd.InstanceType = InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails + objectMap := make(map[string]interface{}) + if cpipsd.InstanceType != "" { + objectMap["instanceType"] = cpipsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACreateProtectionIntentInput is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) { + return nil, false +} + +// AsCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) { + return &cpipsd, true +} + +// AsBasicCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsBasicCreateProtectionIntentProviderSpecificDetails() (BasicCreateProtectionIntentProviderSpecificDetails, bool) { + return &cpipsd, true +} + +// CreateRecoveryPlanInput create recovery plan input class. +type CreateRecoveryPlanInput struct { + // Properties - Recovery plan creation properties. + Properties *CreateRecoveryPlanInputProperties `json:"properties,omitempty"` +} + +// CreateRecoveryPlanInputProperties recovery plan creation properties. +type CreateRecoveryPlanInputProperties struct { + // PrimaryFabricID - The primary fabric Id. + PrimaryFabricID *string `json:"primaryFabricId,omitempty"` + // RecoveryFabricID - The recovery fabric Id. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // FailoverDeploymentModel - The failover deployment model. Possible values include: 'NotApplicable', 'Classic', 'ResourceManager' + FailoverDeploymentModel FailoverDeploymentModel `json:"failoverDeploymentModel,omitempty"` + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` + // ProviderSpecificInput - The provider specific input. + ProviderSpecificInput *[]BasicRecoveryPlanProviderSpecificInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateRecoveryPlanInputProperties struct. +func (crpip *CreateRecoveryPlanInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "primaryFabricId": + if v != nil { + var primaryFabricID string + err = json.Unmarshal(*v, &primaryFabricID) + if err != nil { + return err + } + crpip.PrimaryFabricID = &primaryFabricID + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + crpip.RecoveryFabricID = &recoveryFabricID + } + case "failoverDeploymentModel": + if v != nil { + var failoverDeploymentModel FailoverDeploymentModel + err = json.Unmarshal(*v, &failoverDeploymentModel) + if err != nil { + return err + } + crpip.FailoverDeploymentModel = failoverDeploymentModel + } + case "groups": + if v != nil { + var groups []RecoveryPlanGroup + err = json.Unmarshal(*v, &groups) + if err != nil { + return err + } + crpip.Groups = &groups + } + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicRecoveryPlanProviderSpecificInputArray(*v) + if err != nil { + return err + } + crpip.ProviderSpecificInput = &providerSpecificInput + } + } + } + + return nil +} + +// CurrentJobDetails current job details of the migration item. +type CurrentJobDetails struct { + // JobName - READ-ONLY; The job name. + JobName *string `json:"jobName,omitempty"` + // JobID - READ-ONLY; The ARM Id of the job being executed. + JobID *string `json:"jobId,omitempty"` + // StartTime - READ-ONLY; The start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for CurrentJobDetails. +func (cjd CurrentJobDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CurrentScenarioDetails current scenario details of the protected entity. +type CurrentScenarioDetails struct { + // ScenarioName - Scenario name. + ScenarioName *string `json:"scenarioName,omitempty"` + // JobID - ARM Id of the job being executed. + JobID *string `json:"jobId,omitempty"` + // StartTime - Start time of the workflow. + StartTime *date.Time `json:"startTime,omitempty"` +} + +// DataStore the datastore details of the MT. +type DataStore struct { + // SymbolicName - The symbolic name of data store. + SymbolicName *string `json:"symbolicName,omitempty"` + // UUID - The uuid of data store. + UUID *string `json:"uuid,omitempty"` + // Capacity - The capacity of data store in GBs. + Capacity *string `json:"capacity,omitempty"` + // FreeSpace - The free space of data store in GBs. + FreeSpace *string `json:"freeSpace,omitempty"` + // Type - The type of data store. + Type *string `json:"type,omitempty"` +} + +// DisableProtectionInput disable protection input. +type DisableProtectionInput struct { + // Properties - Disable protection input properties. + Properties *DisableProtectionInputProperties `json:"properties,omitempty"` +} + +// DisableProtectionInputProperties disable protection input properties. +type DisableProtectionInputProperties struct { + // DisableProtectionReason - Disable protection reason. It can have values NotSpecified/MigrationComplete. Possible values include: 'NotSpecified', 'MigrationComplete' + DisableProtectionReason DisableProtectionReason `json:"disableProtectionReason,omitempty"` + // ReplicationProviderInput - Replication provider specific input. + ReplicationProviderInput BasicDisableProtectionProviderSpecificInput `json:"replicationProviderInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DisableProtectionInputProperties struct. +func (dpip *DisableProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "disableProtectionReason": + if v != nil { + var disableProtectionReason DisableProtectionReason + err = json.Unmarshal(*v, &disableProtectionReason) + if err != nil { + return err + } + dpip.DisableProtectionReason = disableProtectionReason + } + case "replicationProviderInput": + if v != nil { + replicationProviderInput, err := unmarshalBasicDisableProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + dpip.ReplicationProviderInput = replicationProviderInput + } + } + } + + return nil +} + +// BasicDisableProtectionProviderSpecificInput disable protection provider specific input. +type BasicDisableProtectionProviderSpecificInput interface { + AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) + AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) +} + +// DisableProtectionProviderSpecificInput disable protection provider specific input. +type DisableProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeDisableProtectionProviderSpecificInput', 'InstanceTypeInMage' + InstanceType InstanceTypeBasicDisableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicDisableProtectionProviderSpecificInput(body []byte) (BasicDisableProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInMage): + var imdppsi InMageDisableProtectionProviderSpecificInput + err := json.Unmarshal(body, &imdppsi) + return imdppsi, err + default: + var dppsi DisableProtectionProviderSpecificInput + err := json.Unmarshal(body, &dppsi) + return dppsi, err + } +} +func unmarshalBasicDisableProtectionProviderSpecificInputArray(body []byte) ([]BasicDisableProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dppsiArray := make([]BasicDisableProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + dppsi, err := unmarshalBasicDisableProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + dppsiArray[index] = dppsi + } + return dppsiArray, nil +} + +// MarshalJSON is the custom marshaler for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + dppsi.InstanceType = InstanceTypeDisableProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if dppsi.InstanceType != "" { + objectMap["instanceType"] = dppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) { + return &dppsi, true +} + +// AsBasicDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsBasicDisableProtectionProviderSpecificInput() (BasicDisableProtectionProviderSpecificInput, bool) { + return &dppsi, true +} + +// DiscoverProtectableItemRequest request to add a physical machine as a protectable item in a container. +type DiscoverProtectableItemRequest struct { + // Properties - The properties of a discover protectable item request. + Properties *DiscoverProtectableItemRequestProperties `json:"properties,omitempty"` +} + +// DiscoverProtectableItemRequestProperties discover protectable item properties. +type DiscoverProtectableItemRequestProperties struct { + // FriendlyName - The friendly name of the physical machine. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the physical machine to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // OsType - The OS type on the physical machine. + OsType *string `json:"osType,omitempty"` +} + +// DiskDetails onprem disk details data. +type DiskDetails struct { + // MaxSizeMB - The hard disk max size in MB. + MaxSizeMB *int64 `json:"maxSizeMB,omitempty"` + // VhdType - The type of the volume. + VhdType *string `json:"vhdType,omitempty"` + // VhdID - The VHD Id. + VhdID *string `json:"vhdId,omitempty"` + // VhdName - The VHD name. + VhdName *string `json:"vhdName,omitempty"` +} + +// DiskEncryptionInfo recovery disk encryption info (BEK and KEK). +type DiskEncryptionInfo struct { + // DiskEncryptionKeyInfo - The recovery KeyVault reference for secret. + DiskEncryptionKeyInfo *DiskEncryptionKeyInfo `json:"diskEncryptionKeyInfo,omitempty"` + // KeyEncryptionKeyInfo - The recovery KeyVault reference for key. + KeyEncryptionKeyInfo *KeyEncryptionKeyInfo `json:"keyEncryptionKeyInfo,omitempty"` +} + +// DiskEncryptionKeyInfo disk Encryption Key Information (BitLocker Encryption Key (BEK) on Windows). +type DiskEncryptionKeyInfo struct { + // SecretIdentifier - The secret url / identifier. + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // KeyVaultResourceArmID - The KeyVault resource ARM id for secret. + KeyVaultResourceArmID *string `json:"keyVaultResourceArmId,omitempty"` +} + +// DiskVolumeDetails volume details. +type DiskVolumeDetails struct { + // Label - The volume label. + Label *string `json:"label,omitempty"` + // Name - The volume name. + Name *string `json:"name,omitempty"` +} + +// Display contains the localized display information for this particular operation / action. These value +// will be used by several clients for (1) custom role definitions for RBAC; (2) complex query filters for +// the event service; and (3) audit history / records for management operations. +type Display struct { + // Provider - The provider. The localized friendly form of the resource provider name - it is expected to also include the publisher/company responsible. It should use Title Casing and begin with "Microsoft" for 1st party services. e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". + Provider *string `json:"provider,omitempty"` + // Resource - The resource. The localized friendly form of the resource related to this action/operation - it should match the public documentation for the resource provider. It should use Title Casing. This value should be unique for a particular URL type (e.g. nested types should *not* reuse their parent's display.resource field). e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual Machine VM Sizes" or "Scheduler Jobs". + Resource *string `json:"resource,omitempty"` + // Operation - The operation. The localized friendly name for the operation, as it should be shown to the user. It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use Title Casing. Prescriptive guidance: Read Create or Update Delete 'ActionName'. + Operation *string `json:"operation,omitempty"` + // Description - The description. The localized friendly description for the operation, as it should be shown to the user. It should be thorough, yet concise - it will be used in tool tips and detailed views. Prescriptive guidance for namespaces: Read any 'display.provider' resource Create or Update any 'display.provider' resource Delete any 'display.provider' resource Perform any other action on any 'display.provider' resource Prescriptive guidance for namespaces: Read any 'display.resource' Create or Update any 'display.resource' Delete any 'display.resource' 'ActionName' any 'display.resources'. + Description *string `json:"description,omitempty"` +} + +// DraDetails DRA details. +type DraDetails struct { + // ID - READ-ONLY; The DRA Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The DRA name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The DRA Bios Id. + BiosID *string `json:"biosId,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the DRA. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // ForwardProtectedItemCount - READ-ONLY; The count of protected items which are protected in forward direction. + ForwardProtectedItemCount *int32 `json:"forwardProtectedItemCount,omitempty"` + // ReverseProtectedItemCount - READ-ONLY; The count of protected items which are protected in reverse direction. + ReverseProtectedItemCount *int32 `json:"reverseProtectedItemCount,omitempty"` +} + +// MarshalJSON is the custom marshaler for DraDetails. +func (dd DraDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// EnableMigrationInput enable migration input. +type EnableMigrationInput struct { + // Properties - Enable migration input properties. + Properties *EnableMigrationInputProperties `json:"properties,omitempty"` +} + +// EnableMigrationInputProperties enable migration input properties. +type EnableMigrationInputProperties struct { + // PolicyID - The policy Id. + PolicyID *string `json:"policyId,omitempty"` + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicEnableMigrationProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EnableMigrationInputProperties struct. +func (emip *EnableMigrationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + emip.PolicyID = &policyID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEnableMigrationProviderSpecificInput(*v) + if err != nil { + return err + } + emip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicEnableMigrationProviderSpecificInput enable migration provider specific input. +type BasicEnableMigrationProviderSpecificInput interface { + AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) + AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) +} + +// EnableMigrationProviderSpecificInput enable migration provider specific input. +type EnableMigrationProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeEnableMigrationProviderSpecificInput', 'InstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEnableMigrationProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicEnableMigrationProviderSpecificInput(body []byte) (BasicEnableMigrationProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeVMwareCbt): + var vmcemi VMwareCbtEnableMigrationInput + err := json.Unmarshal(body, &vmcemi) + return vmcemi, err + default: + var empsi EnableMigrationProviderSpecificInput + err := json.Unmarshal(body, &empsi) + return empsi, err + } +} +func unmarshalBasicEnableMigrationProviderSpecificInputArray(body []byte) ([]BasicEnableMigrationProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + empsiArray := make([]BasicEnableMigrationProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + empsi, err := unmarshalBasicEnableMigrationProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + empsiArray[index] = empsi + } + return empsiArray, nil +} + +// MarshalJSON is the custom marshaler for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) MarshalJSON() ([]byte, error) { + empsi.InstanceType = InstanceTypeEnableMigrationProviderSpecificInput + objectMap := make(map[string]interface{}) + if empsi.InstanceType != "" { + objectMap["instanceType"] = empsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtEnableMigrationInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) { + return nil, false +} + +// AsEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) { + return &empsi, true +} + +// AsBasicEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsBasicEnableMigrationProviderSpecificInput() (BasicEnableMigrationProviderSpecificInput, bool) { + return &empsi, true +} + +// EnableProtectionInput enable protection input. +type EnableProtectionInput struct { + // Properties - Enable protection input properties. + Properties *EnableProtectionInputProperties `json:"properties,omitempty"` +} + +// EnableProtectionInputProperties enable protection input properties. +type EnableProtectionInputProperties struct { + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // ProtectableItemID - The protectable item Id. + ProtectableItemID *string `json:"protectableItemId,omitempty"` + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicEnableProtectionProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EnableProtectionInputProperties struct. +func (epip *EnableProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + epip.PolicyID = &policyID + } + case "protectableItemId": + if v != nil { + var protectableItemID string + err = json.Unmarshal(*v, &protectableItemID) + if err != nil { + return err + } + epip.ProtectableItemID = &protectableItemID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEnableProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + epip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicEnableProtectionProviderSpecificInput enable protection provider specific input. +type BasicEnableProtectionProviderSpecificInput interface { + AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) + AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) + AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) + AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) + AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) + AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) + AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) +} + +// EnableProtectionProviderSpecificInput enable protection provider specific input. +type EnableProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicEnableProtectionProviderSpecificInput(body []byte) (BasicEnableProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmepi A2ACrossClusterMigrationEnableProtectionInput + err := json.Unmarshal(body, &accmepi) + return accmepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A): + var aepi A2AEnableProtectionInput + err := json.Unmarshal(body, &aepi) + return aepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraepi HyperVReplicaAzureEnableProtectionInput + err := json.Unmarshal(body, &hvraepi) + return hvraepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2): + var imavepi InMageAzureV2EnableProtectionInput + err := json.Unmarshal(body, &imavepi) + return imavepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage): + var imepi InMageEnableProtectionInput + err := json.Unmarshal(body, &imepi) + return imepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm): + var imrepi InMageRcmEnableProtectionInput + err := json.Unmarshal(body, &imrepi) + return imrepi, err + default: + var eppsi EnableProtectionProviderSpecificInput + err := json.Unmarshal(body, &eppsi) + return eppsi, err + } +} +func unmarshalBasicEnableProtectionProviderSpecificInputArray(body []byte) ([]BasicEnableProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + eppsiArray := make([]BasicEnableProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + eppsi, err := unmarshalBasicEnableProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + eppsiArray[index] = eppsi + } + return eppsiArray, nil +} + +// MarshalJSON is the custom marshaler for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + eppsi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if eppsi.InstanceType != "" { + objectMap["instanceType"] = eppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return &eppsi, true +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &eppsi, true +} + +// EncryptionDetails encryption details for the fabric. +type EncryptionDetails struct { + // KekState - The key encryption key state for the Vmm. + KekState *string `json:"kekState,omitempty"` + // KekCertThumbprint - The key encryption key certificate thumbprint. + KekCertThumbprint *string `json:"kekCertThumbprint,omitempty"` + // KekCertExpiryDate - The key encryption key certificate expiry date. + KekCertExpiryDate *date.Time `json:"kekCertExpiryDate,omitempty"` +} + +// Event implements the Event class. +type Event struct { + autorest.Response `json:"-"` + // Properties - Event related data. + Properties *EventProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Event. +func (e Event) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if e.Properties != nil { + objectMap["properties"] = e.Properties + } + if e.Location != nil { + objectMap["location"] = e.Location + } + return json.Marshal(objectMap) +} + +// EventCollection collection of fabric details. +type EventCollection struct { + autorest.Response `json:"-"` + // Value - The list of events. + Value *[]Event `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// EventCollectionIterator provides access to a complete listing of Event values. +type EventCollectionIterator struct { + i int + page EventCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *EventCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EventCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *EventCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EventCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter EventCollectionIterator) Response() EventCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter EventCollectionIterator) Value() Event { + if !iter.page.NotDone() { + return Event{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the EventCollectionIterator type. +func NewEventCollectionIterator(page EventCollectionPage) EventCollectionIterator { + return EventCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ec EventCollection) IsEmpty() bool { + return ec.Value == nil || len(*ec.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ec EventCollection) hasNextLink() bool { + return ec.NextLink != nil && len(*ec.NextLink) != 0 +} + +// eventCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ec EventCollection) eventCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ec.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ec.NextLink))) +} + +// EventCollectionPage contains a page of Event values. +type EventCollectionPage struct { + fn func(context.Context, EventCollection) (EventCollection, error) + ec EventCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *EventCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EventCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ec) + if err != nil { + return err + } + page.ec = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *EventCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EventCollectionPage) NotDone() bool { + return !page.ec.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EventCollectionPage) Response() EventCollection { + return page.ec +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EventCollectionPage) Values() []Event { + if page.ec.IsEmpty() { + return nil + } + return *page.ec.Value +} + +// Creates a new instance of the EventCollectionPage type. +func NewEventCollectionPage(cur EventCollection, getNextPage func(context.Context, EventCollection) (EventCollection, error)) EventCollectionPage { + return EventCollectionPage{ + fn: getNextPage, + ec: cur, + } +} + +// EventProperties the properties of a monitoring event. +type EventProperties struct { + // EventCode - The Id of the monitoring event. + EventCode *string `json:"eventCode,omitempty"` + // Description - The event name. + Description *string `json:"description,omitempty"` + // EventType - The type of the event. for example: VM Health, Server Health, Job Failure etc. + EventType *string `json:"eventType,omitempty"` + // AffectedObjectFriendlyName - The friendly name of the source of the event on which it is raised (for example, VM, VMM etc). + AffectedObjectFriendlyName *string `json:"affectedObjectFriendlyName,omitempty"` + // AffectedObjectCorrelationID - The affected object correlationId for the event. + AffectedObjectCorrelationID *string `json:"affectedObjectCorrelationId,omitempty"` + // Severity - The severity of the event. + Severity *string `json:"severity,omitempty"` + // TimeOfOccurrence - The time of occurrence of the event. + TimeOfOccurrence *date.Time `json:"timeOfOccurrence,omitempty"` + // FabricID - The ARM ID of the fabric. + FabricID *string `json:"fabricId,omitempty"` + // ProviderSpecificDetails - The provider specific settings. + ProviderSpecificDetails BasicEventProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` + // EventSpecificDetails - The event specific settings. + EventSpecificDetails BasicEventSpecificDetails `json:"eventSpecificDetails,omitempty"` + // HealthErrors - The list of errors / warnings capturing details associated with the issue(s). + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EventProperties struct. +func (ep *EventProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "eventCode": + if v != nil { + var eventCode string + err = json.Unmarshal(*v, &eventCode) + if err != nil { + return err + } + ep.EventCode = &eventCode + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ep.Description = &description + } + case "eventType": + if v != nil { + var eventType string + err = json.Unmarshal(*v, &eventType) + if err != nil { + return err + } + ep.EventType = &eventType + } + case "affectedObjectFriendlyName": + if v != nil { + var affectedObjectFriendlyName string + err = json.Unmarshal(*v, &affectedObjectFriendlyName) + if err != nil { + return err + } + ep.AffectedObjectFriendlyName = &affectedObjectFriendlyName + } + case "affectedObjectCorrelationId": + if v != nil { + var affectedObjectCorrelationID string + err = json.Unmarshal(*v, &affectedObjectCorrelationID) + if err != nil { + return err + } + ep.AffectedObjectCorrelationID = &affectedObjectCorrelationID + } + case "severity": + if v != nil { + var severity string + err = json.Unmarshal(*v, &severity) + if err != nil { + return err + } + ep.Severity = &severity + } + case "timeOfOccurrence": + if v != nil { + var timeOfOccurrence date.Time + err = json.Unmarshal(*v, &timeOfOccurrence) + if err != nil { + return err + } + ep.TimeOfOccurrence = &timeOfOccurrence + } + case "fabricId": + if v != nil { + var fabricID string + err = json.Unmarshal(*v, &fabricID) + if err != nil { + return err + } + ep.FabricID = &fabricID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEventProviderSpecificDetails(*v) + if err != nil { + return err + } + ep.ProviderSpecificDetails = providerSpecificDetails + } + case "eventSpecificDetails": + if v != nil { + eventSpecificDetails, err := unmarshalBasicEventSpecificDetails(*v) + if err != nil { + return err + } + ep.EventSpecificDetails = eventSpecificDetails + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + ep.HealthErrors = &healthErrors + } + } + } + + return nil +} + +// BasicEventProviderSpecificDetails model class for provider specific details for an event. +type BasicEventProviderSpecificDetails interface { + AsA2AEventDetails() (*A2AEventDetails, bool) + AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) + AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) + AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) + AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) + AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) + AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) + AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) + AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) + AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) +} + +// EventProviderSpecificDetails model class for provider specific details for an event. +type EventProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicEventProviderSpecificDetails(body []byte) (BasicEventProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A): + var aed A2AEventDetails + err := json.Unmarshal(body, &aed) + return aed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012): + var hvr2ed HyperVReplica2012EventDetails + err := json.Unmarshal(body, &hvr2ed) + return hvr2ed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2): + var hvr2ed HyperVReplica2012R2EventDetails + err := json.Unmarshal(body, &hvr2ed) + return hvr2ed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure): + var hvraed HyperVReplicaAzureEventDetails + err := json.Unmarshal(body, &hvraed) + return hvraed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails): + var hvrbed HyperVReplicaBaseEventDetails + err := json.Unmarshal(body, &hvrbed) + return hvrbed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2): + var imaved InMageAzureV2EventDetails + err := json.Unmarshal(body, &imaved) + return imaved, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm): + var imred InMageRcmEventDetails + err := json.Unmarshal(body, &imred) + return imred, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback): + var imrfed InMageRcmFailbackEventDetails + err := json.Unmarshal(body, &imrfed) + return imrfed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt): + var vmced VMwareCbtEventDetails + err := json.Unmarshal(body, &vmced) + return vmced, err + default: + var epsd EventProviderSpecificDetails + err := json.Unmarshal(body, &epsd) + return epsd, err + } +} +func unmarshalBasicEventProviderSpecificDetailsArray(body []byte) ([]BasicEventProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + epsdArray := make([]BasicEventProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + epsd, err := unmarshalBasicEventProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + epsdArray[index] = epsd + } + return epsdArray, nil +} + +// MarshalJSON is the custom marshaler for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) MarshalJSON() ([]byte, error) { + epsd.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails + objectMap := make(map[string]interface{}) + if epsd.InstanceType != "" { + objectMap["instanceType"] = epsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return &epsd, true +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &epsd, true +} + +// EventQueryParameter implements the event query parameter. +type EventQueryParameter struct { + // EventCode - The source id of the events to be queried. + EventCode *string `json:"eventCode,omitempty"` + // Severity - The severity of the events to be queried. + Severity *string `json:"severity,omitempty"` + // EventType - The type of the events to be queried. + EventType *string `json:"eventType,omitempty"` + // FabricName - The affected object server id of the events to be queried. + FabricName *string `json:"fabricName,omitempty"` + // AffectedObjectFriendlyName - The affected object name of the events to be queried. + AffectedObjectFriendlyName *string `json:"affectedObjectFriendlyName,omitempty"` + // AffectedObjectCorrelationID - The affected object correlationId for the events to be queried. + AffectedObjectCorrelationID *string `json:"affectedObjectCorrelationId,omitempty"` + // StartTime - The start time of the time range within which the events are to be queried. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time of the time range within which the events are to be queried. + EndTime *date.Time `json:"endTime,omitempty"` +} + +// BasicEventSpecificDetails model class for event specific details for an event. +type BasicEventSpecificDetails interface { + AsJobStatusEventDetails() (*JobStatusEventDetails, bool) + AsEventSpecificDetails() (*EventSpecificDetails, bool) +} + +// EventSpecificDetails model class for event specific details for an event. +type EventSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeEventSpecificDetails', 'InstanceTypeJobStatus' + InstanceType InstanceTypeBasicEventSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicEventSpecificDetails(body []byte) (BasicEventSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeJobStatus): + var jsed JobStatusEventDetails + err := json.Unmarshal(body, &jsed) + return jsed, err + default: + var esd EventSpecificDetails + err := json.Unmarshal(body, &esd) + return esd, err + } +} +func unmarshalBasicEventSpecificDetailsArray(body []byte) ([]BasicEventSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + esdArray := make([]BasicEventSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + esd, err := unmarshalBasicEventSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + esdArray[index] = esd + } + return esdArray, nil +} + +// MarshalJSON is the custom marshaler for EventSpecificDetails. +func (esd EventSpecificDetails) MarshalJSON() ([]byte, error) { + esd.InstanceType = InstanceTypeEventSpecificDetails + objectMap := make(map[string]interface{}) + if esd.InstanceType != "" { + objectMap["instanceType"] = esd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsJobStatusEventDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsJobStatusEventDetails() (*JobStatusEventDetails, bool) { + return nil, false +} + +// AsEventSpecificDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsEventSpecificDetails() (*EventSpecificDetails, bool) { + return &esd, true +} + +// AsBasicEventSpecificDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsBasicEventSpecificDetails() (BasicEventSpecificDetails, bool) { + return &esd, true +} + +// ExistingProtectionProfile existing storage account input. +type ExistingProtectionProfile struct { + // ProtectionProfileID - The protection profile Arm Id. Throw error, if resource does not exists. + ProtectionProfileID *string `json:"protectionProfileId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) MarshalJSON() ([]byte, error) { + epp.ResourceType = ResourceTypeExisting + objectMap := make(map[string]interface{}) + if epp.ProtectionProfileID != nil { + objectMap["protectionProfileId"] = epp.ProtectionProfileID + } + if epp.ResourceType != "" { + objectMap["resourceType"] = epp.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return &epp, true +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return nil, false +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return nil, false +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &epp, true +} + +// ExistingRecoveryAvailabilitySet existing recovery availability set input. +type ExistingRecoveryAvailabilitySet struct { + // RecoveryAvailabilitySetID - The recovery availability set Id. Will throw error, if resource does not exist. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails', 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryAvailabilitySetCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) MarshalJSON() ([]byte, error) { + eras.ResourceType = ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if eras.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = eras.RecoveryAvailabilitySetID + } + if eras.ResourceType != "" { + objectMap["resourceType"] = eras.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryAvailabilitySet is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) { + return &eras, true +} + +// AsRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsBasicRecoveryAvailabilitySetCustomDetails() (BasicRecoveryAvailabilitySetCustomDetails, bool) { + return &eras, true +} + +// ExistingRecoveryProximityPlacementGroup existing recovery proximity placement group input. +type ExistingRecoveryProximityPlacementGroup struct { + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. Will throw error, if resource does not exist. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails', 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) MarshalJSON() ([]byte, error) { + erppg.ResourceType = ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if erppg.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = erppg.RecoveryProximityPlacementGroupID + } + if erppg.ResourceType != "" { + objectMap["resourceType"] = erppg.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryProximityPlacementGroup is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) { + return &erppg, true +} + +// AsRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsBasicRecoveryProximityPlacementGroupCustomDetails() (BasicRecoveryProximityPlacementGroupCustomDetails, bool) { + return &erppg, true +} + +// ExistingRecoveryRecoveryResourceGroup existing recovery resource group input. +type ExistingRecoveryRecoveryResourceGroup struct { + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails', 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryResourceGroupCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) MarshalJSON() ([]byte, error) { + errrg.ResourceType = ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if errrg.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = errrg.RecoveryResourceGroupID + } + if errrg.ResourceType != "" { + objectMap["resourceType"] = errrg.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryRecoveryResourceGroup is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) { + return &errrg, true +} + +// AsRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsBasicRecoveryResourceGroupCustomDetails() (BasicRecoveryResourceGroupCustomDetails, bool) { + return &errrg, true +} + +// ExistingRecoveryVirtualNetwork existing recovery virtual network input. +type ExistingRecoveryVirtualNetwork struct { + // RecoveryVirtualNetworkID - The recovery virtual network Id. Will throw error, if resource does not exist. + RecoveryVirtualNetworkID *string `json:"recoveryVirtualNetworkId,omitempty"` + // RecoverySubnetName - The recovery subnet name. + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) MarshalJSON() ([]byte, error) { + ervn.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if ervn.RecoveryVirtualNetworkID != nil { + objectMap["recoveryVirtualNetworkId"] = ervn.RecoveryVirtualNetworkID + } + if ervn.RecoverySubnetName != nil { + objectMap["recoverySubnetName"] = ervn.RecoverySubnetName + } + if ervn.ResourceType != "" { + objectMap["resourceType"] = ervn.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return &ervn, true +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &ervn, true +} + +// ExistingStorageAccount existing storage account input. +type ExistingStorageAccount struct { + // AzureStorageAccountID - The storage account Arm Id. Throw error, if resource does not exists. + AzureStorageAccountID *string `json:"azureStorageAccountId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails', 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicStorageAccountCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingStorageAccount. +func (esa ExistingStorageAccount) MarshalJSON() ([]byte, error) { + esa.ResourceType = ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if esa.AzureStorageAccountID != nil { + objectMap["azureStorageAccountId"] = esa.AzureStorageAccountID + } + if esa.ResourceType != "" { + objectMap["resourceType"] = esa.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingStorageAccount is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsExistingStorageAccount() (*ExistingStorageAccount, bool) { + return &esa, true +} + +// AsStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) { + return nil, false +} + +// AsBasicStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsBasicStorageAccountCustomDetails() (BasicStorageAccountCustomDetails, bool) { + return &esa, true +} + +// ExportJobDetails this class represents details for export jobs workflow. +type ExportJobDetails struct { + // BlobURI - BlobUri of the exported jobs. + BlobURI *string `json:"blobUri,omitempty"` + // SasToken - The sas token to access blob. + SasToken *string `json:"sasToken,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExportJobDetails. +func (ejd ExportJobDetails) MarshalJSON() ([]byte, error) { + ejd.InstanceType = InstanceTypeExportJobDetails + objectMap := make(map[string]interface{}) + if ejd.BlobURI != nil { + objectMap["blobUri"] = ejd.BlobURI + } + if ejd.SasToken != nil { + objectMap["sasToken"] = ejd.SasToken + } + if ejd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = ejd.AffectedObjectDetails + } + if ejd.InstanceType != "" { + objectMap["instanceType"] = ejd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return &ejd, true +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &ejd, true +} + +// Fabric fabric definition. +type Fabric struct { + autorest.Response `json:"-"` + // Properties - Fabric related data. + Properties *FabricProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Fabric. +func (f Fabric) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if f.Properties != nil { + objectMap["properties"] = f.Properties + } + if f.Location != nil { + objectMap["location"] = f.Location + } + return json.Marshal(objectMap) +} + +// FabricCollection collection of fabric details. +type FabricCollection struct { + autorest.Response `json:"-"` + // Value - The fabric details. + Value *[]Fabric `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// FabricCollectionIterator provides access to a complete listing of Fabric values. +type FabricCollectionIterator struct { + i int + page FabricCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *FabricCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FabricCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *FabricCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter FabricCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter FabricCollectionIterator) Response() FabricCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter FabricCollectionIterator) Value() Fabric { + if !iter.page.NotDone() { + return Fabric{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the FabricCollectionIterator type. +func NewFabricCollectionIterator(page FabricCollectionPage) FabricCollectionIterator { + return FabricCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (fc FabricCollection) IsEmpty() bool { + return fc.Value == nil || len(*fc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (fc FabricCollection) hasNextLink() bool { + return fc.NextLink != nil && len(*fc.NextLink) != 0 +} + +// fabricCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (fc FabricCollection) fabricCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !fc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(fc.NextLink))) +} + +// FabricCollectionPage contains a page of Fabric values. +type FabricCollectionPage struct { + fn func(context.Context, FabricCollection) (FabricCollection, error) + fc FabricCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *FabricCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FabricCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.fc) + if err != nil { + return err + } + page.fc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *FabricCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page FabricCollectionPage) NotDone() bool { + return !page.fc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page FabricCollectionPage) Response() FabricCollection { + return page.fc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page FabricCollectionPage) Values() []Fabric { + if page.fc.IsEmpty() { + return nil + } + return *page.fc.Value +} + +// Creates a new instance of the FabricCollectionPage type. +func NewFabricCollectionPage(cur FabricCollection, getNextPage func(context.Context, FabricCollection) (FabricCollection, error)) FabricCollectionPage { + return FabricCollectionPage{ + fn: getNextPage, + fc: cur, + } +} + +// FabricCreationInput site details provided during the time of site creation. +type FabricCreationInput struct { + // Properties - Fabric creation input. + Properties *FabricCreationInputProperties `json:"properties,omitempty"` +} + +// FabricCreationInputProperties properties of site details provided during the time of site creation. +type FabricCreationInputProperties struct { + // CustomDetails - Fabric provider specific creation input. + CustomDetails BasicFabricSpecificCreationInput `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for FabricCreationInputProperties struct. +func (fcip *FabricCreationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicFabricSpecificCreationInput(*v) + if err != nil { + return err + } + fcip.CustomDetails = customDetails + } + } + } + + return nil +} + +// FabricProperties fabric properties. +type FabricProperties struct { + // FriendlyName - Friendly name of the fabric. + FriendlyName *string `json:"friendlyName,omitempty"` + // EncryptionDetails - Encryption details for the fabric. + EncryptionDetails *EncryptionDetails `json:"encryptionDetails,omitempty"` + // RolloverEncryptionDetails - Rollover encryption details for the fabric. + RolloverEncryptionDetails *EncryptionDetails `json:"rolloverEncryptionDetails,omitempty"` + // InternalIdentifier - Dra Registration Id. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // BcdrState - BCDR state of the fabric. + BcdrState *string `json:"bcdrState,omitempty"` + // CustomDetails - Fabric specific settings. + CustomDetails BasicFabricSpecificDetails `json:"customDetails,omitempty"` + // HealthErrorDetails - Fabric health error details. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // Health - Health of fabric. + Health *string `json:"health,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for FabricProperties struct. +func (fp *FabricProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + fp.FriendlyName = &friendlyName + } + case "encryptionDetails": + if v != nil { + var encryptionDetails EncryptionDetails + err = json.Unmarshal(*v, &encryptionDetails) + if err != nil { + return err + } + fp.EncryptionDetails = &encryptionDetails + } + case "rolloverEncryptionDetails": + if v != nil { + var rolloverEncryptionDetails EncryptionDetails + err = json.Unmarshal(*v, &rolloverEncryptionDetails) + if err != nil { + return err + } + fp.RolloverEncryptionDetails = &rolloverEncryptionDetails + } + case "internalIdentifier": + if v != nil { + var internalIdentifier string + err = json.Unmarshal(*v, &internalIdentifier) + if err != nil { + return err + } + fp.InternalIdentifier = &internalIdentifier + } + case "bcdrState": + if v != nil { + var bcdrState string + err = json.Unmarshal(*v, &bcdrState) + if err != nil { + return err + } + fp.BcdrState = &bcdrState + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicFabricSpecificDetails(*v) + if err != nil { + return err + } + fp.CustomDetails = customDetails + } + case "healthErrorDetails": + if v != nil { + var healthErrorDetails []HealthError + err = json.Unmarshal(*v, &healthErrorDetails) + if err != nil { + return err + } + fp.HealthErrorDetails = &healthErrorDetails + } + case "health": + if v != nil { + var health string + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + fp.Health = &health + } + } + } + + return nil +} + +// FabricQueryParameter query parameter to get fabric. +type FabricQueryParameter struct { + // ZoneToZoneMappings - A value indicating whether the zone to zone mappings are to be returned. + ZoneToZoneMappings *string `json:"zoneToZoneMappings,omitempty"` + // FetchAgentDetails - A value indicating whether the agent details are to be fetched. + FetchAgentDetails *string `json:"fetchAgentDetails,omitempty"` + // BiosID - The BIOS Id to be used for fetching agent details. + BiosID *string `json:"biosId,omitempty"` + // Fqdn - The FQDN to be used for fetching agent details. + Fqdn *string `json:"fqdn,omitempty"` + // DiscoveryType - The type of the discovered machine to be used for fetching agent details. + DiscoveryType *string `json:"discoveryType,omitempty"` + // OsType - The OS type to be used for fetching agent details. + OsType *string `json:"osType,omitempty"` +} + +// FabricReplicationGroupTaskDetails this class represents the fabric replication group task details. +type FabricReplicationGroupTaskDetails struct { + // SkippedReason - The skipped reason. + SkippedReason *string `json:"skippedReason,omitempty"` + // SkippedReasonString - The skipped reason string. + SkippedReasonString *string `json:"skippedReasonString,omitempty"` + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) MarshalJSON() ([]byte, error) { + frgtd.InstanceType = InstanceTypeFabricReplicationGroupTaskDetails + objectMap := make(map[string]interface{}) + if frgtd.SkippedReason != nil { + objectMap["skippedReason"] = frgtd.SkippedReason + } + if frgtd.SkippedReasonString != nil { + objectMap["skippedReasonString"] = frgtd.SkippedReasonString + } + if frgtd.JobTask != nil { + objectMap["jobTask"] = frgtd.JobTask + } + if frgtd.InstanceType != "" { + objectMap["instanceType"] = frgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return &frgtd, true +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &frgtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &frgtd, true +} + +// BasicFabricSpecificCreateNetworkMappingInput input details specific to fabrics during Network Mapping. +type BasicFabricSpecificCreateNetworkMappingInput interface { + AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) + AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) + AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) + AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) +} + +// FabricSpecificCreateNetworkMappingInput input details specific to fabrics during Network Mapping. +type FabricSpecificCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificCreateNetworkMappingInput(body []byte) (BasicFabricSpecificCreateNetworkMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAzureToAzure): + var atacnmi AzureToAzureCreateNetworkMappingInput + err := json.Unmarshal(body, &atacnmi) + return atacnmi, err + case string(InstanceTypeVmmToAzure): + var vtacnmi VmmToAzureCreateNetworkMappingInput + err := json.Unmarshal(body, &vtacnmi) + return vtacnmi, err + case string(InstanceTypeVmmToVmm): + var vtvcnmi VmmToVmmCreateNetworkMappingInput + err := json.Unmarshal(body, &vtvcnmi) + return vtvcnmi, err + default: + var fscnmi FabricSpecificCreateNetworkMappingInput + err := json.Unmarshal(body, &fscnmi) + return fscnmi, err + } +} +func unmarshalBasicFabricSpecificCreateNetworkMappingInputArray(body []byte) ([]BasicFabricSpecificCreateNetworkMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fscnmiArray := make([]BasicFabricSpecificCreateNetworkMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fscnmi, err := unmarshalBasicFabricSpecificCreateNetworkMappingInput(*rawMessage) + if err != nil { + return nil, err + } + fscnmiArray[index] = fscnmi + } + return fscnmiArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + fscnmi.InstanceType = InstanceTypeFabricSpecificCreateNetworkMappingInput + objectMap := make(map[string]interface{}) + if fscnmi.InstanceType != "" { + objectMap["instanceType"] = fscnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return &fscnmi, true +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &fscnmi, true +} + +// BasicFabricSpecificCreationInput fabric provider specific settings. +type BasicFabricSpecificCreationInput interface { + AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) + AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) + AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) + AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) +} + +// FabricSpecificCreationInput fabric provider specific settings. +type FabricSpecificCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreationInput', 'InstanceTypeAzure', 'InstanceTypeInMageRcm', 'InstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificCreationInput(body []byte) (BasicFabricSpecificCreationInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAzure): + var afci AzureFabricCreationInput + err := json.Unmarshal(body, &afci) + return afci, err + case string(InstanceTypeInMageRcm): + var imrfci InMageRcmFabricCreationInput + err := json.Unmarshal(body, &imrfci) + return imrfci, err + case string(InstanceTypeVMwareV2): + var vmvfci VMwareV2FabricCreationInput + err := json.Unmarshal(body, &vmvfci) + return vmvfci, err + default: + var fsci FabricSpecificCreationInput + err := json.Unmarshal(body, &fsci) + return fsci, err + } +} +func unmarshalBasicFabricSpecificCreationInputArray(body []byte) ([]BasicFabricSpecificCreationInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsciArray := make([]BasicFabricSpecificCreationInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsci, err := unmarshalBasicFabricSpecificCreationInput(*rawMessage) + if err != nil { + return nil, err + } + fsciArray[index] = fsci + } + return fsciArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) MarshalJSON() ([]byte, error) { + fsci.InstanceType = InstanceTypeFabricSpecificCreationInput + objectMap := make(map[string]interface{}) + if fsci.InstanceType != "" { + objectMap["instanceType"] = fsci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return &fsci, true +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &fsci, true +} + +// BasicFabricSpecificDetails fabric specific details. +type BasicFabricSpecificDetails interface { + AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) + AsHyperVSiteDetails() (*HyperVSiteDetails, bool) + AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) + AsVmmDetails() (*VmmDetails, bool) + AsVMwareDetails() (*VMwareDetails, bool) + AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) + AsFabricSpecificDetails() (*FabricSpecificDetails, bool) +} + +// FabricSpecificDetails fabric specific details. +type FabricSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificDetails(body []byte) (BasicFabricSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure): + var afsd AzureFabricSpecificDetails + err := json.Unmarshal(body, &afsd) + return afsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite): + var hvsd HyperVSiteDetails + err := json.Unmarshal(body, &hvsd) + return hvsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm): + var imrfsd InMageRcmFabricSpecificDetails + err := json.Unmarshal(body, &imrfsd) + return imrfsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM): + var vd VmmDetails + err := json.Unmarshal(body, &vd) + return vd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware): + var vmd VMwareDetails + err := json.Unmarshal(body, &vmd) + return vmd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2): + var vmvfsd VMwareV2FabricSpecificDetails + err := json.Unmarshal(body, &vmvfsd) + return vmvfsd, err + default: + var fsd FabricSpecificDetails + err := json.Unmarshal(body, &fsd) + return fsd, err + } +} +func unmarshalBasicFabricSpecificDetailsArray(body []byte) ([]BasicFabricSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsdArray := make([]BasicFabricSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsd, err := unmarshalBasicFabricSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + fsdArray[index] = fsd + } + return fsdArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificDetails. +func (fsd FabricSpecificDetails) MarshalJSON() ([]byte, error) { + fsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails + objectMap := make(map[string]interface{}) + if fsd.InstanceType != "" { + objectMap["instanceType"] = fsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return &fsd, true +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &fsd, true +} + +// BasicFabricSpecificUpdateNetworkMappingInput input details specific to fabrics during Network Mapping. +type BasicFabricSpecificUpdateNetworkMappingInput interface { + AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) + AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) + AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) + AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) +} + +// FabricSpecificUpdateNetworkMappingInput input details specific to fabrics during Network Mapping. +type FabricSpecificUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificUpdateNetworkMappingInput(body []byte) (BasicFabricSpecificUpdateNetworkMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure): + var ataunmi AzureToAzureUpdateNetworkMappingInput + err := json.Unmarshal(body, &ataunmi) + return ataunmi, err + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure): + var vtaunmi VmmToAzureUpdateNetworkMappingInput + err := json.Unmarshal(body, &vtaunmi) + return vtaunmi, err + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm): + var vtvunmi VmmToVmmUpdateNetworkMappingInput + err := json.Unmarshal(body, &vtvunmi) + return vtvunmi, err + default: + var fsunmi FabricSpecificUpdateNetworkMappingInput + err := json.Unmarshal(body, &fsunmi) + return fsunmi, err + } +} +func unmarshalBasicFabricSpecificUpdateNetworkMappingInputArray(body []byte) ([]BasicFabricSpecificUpdateNetworkMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsunmiArray := make([]BasicFabricSpecificUpdateNetworkMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsunmi, err := unmarshalBasicFabricSpecificUpdateNetworkMappingInput(*rawMessage) + if err != nil { + return nil, err + } + fsunmiArray[index] = fsunmi + } + return fsunmiArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + fsunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput + objectMap := make(map[string]interface{}) + if fsunmi.InstanceType != "" { + objectMap["instanceType"] = fsunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return &fsunmi, true +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &fsunmi, true +} + +// FailoverJobDetails this class represents the details for a failover job. +type FailoverJobDetails struct { + // ProtectedItemDetails - The test VM details. + ProtectedItemDetails *[]FailoverReplicationProtectedItemDetails `json:"protectedItemDetails,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for FailoverJobDetails. +func (fjd FailoverJobDetails) MarshalJSON() ([]byte, error) { + fjd.InstanceType = InstanceTypeFailoverJobDetails + objectMap := make(map[string]interface{}) + if fjd.ProtectedItemDetails != nil { + objectMap["protectedItemDetails"] = fjd.ProtectedItemDetails + } + if fjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = fjd.AffectedObjectDetails + } + if fjd.InstanceType != "" { + objectMap["instanceType"] = fjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return &fjd, true +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &fjd, true +} + +// FailoverProcessServerRequest request to failover a process server. +type FailoverProcessServerRequest struct { + // Properties - The properties of the PS Failover request. + Properties *FailoverProcessServerRequestProperties `json:"properties,omitempty"` +} + +// FailoverProcessServerRequestProperties the properties of the Failover Process Server request. +type FailoverProcessServerRequestProperties struct { + // ContainerName - The container identifier. + ContainerName *string `json:"containerName,omitempty"` + // SourceProcessServerID - The source process server. + SourceProcessServerID *string `json:"sourceProcessServerId,omitempty"` + // TargetProcessServerID - The new process server. + TargetProcessServerID *string `json:"targetProcessServerId,omitempty"` + // VmsToMigrate - The VMS to migrate. + VmsToMigrate *[]string `json:"vmsToMigrate,omitempty"` + // UpdateType - A value for failover type. It can be systemlevel/serverlevel. + UpdateType *string `json:"updateType,omitempty"` +} + +// FailoverReplicationProtectedItemDetails failover details for a replication protected item. +type FailoverReplicationProtectedItemDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // FriendlyName - The friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // TestVMName - The test Vm name. + TestVMName *string `json:"testVmName,omitempty"` + // TestVMFriendlyName - The test Vm friendly name. + TestVMFriendlyName *string `json:"testVmFriendlyName,omitempty"` + // NetworkConnectionStatus - The network connection status. + NetworkConnectionStatus *string `json:"networkConnectionStatus,omitempty"` + // NetworkFriendlyName - The network friendly name. + NetworkFriendlyName *string `json:"networkFriendlyName,omitempty"` + // Subnet - The network subnet. + Subnet *string `json:"subnet,omitempty"` + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // RecoveryPointTime - The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` +} + +// BasicGroupTaskDetails this class represents the group task details when parent child relationship exists in the +// drill down. +type BasicGroupTaskDetails interface { + AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) + AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) + AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) + AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) + AsGroupTaskDetails() (*GroupTaskDetails, bool) +} + +// GroupTaskDetails this class represents the group task details when parent child relationship exists in the +// drill down. +type GroupTaskDetails struct { + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicGroupTaskDetails(body []byte) (BasicGroupTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInlineWorkflowTaskDetails): + var iwtd InlineWorkflowTaskDetails + err := json.Unmarshal(body, &iwtd) + return iwtd, err + case string(InstanceTypeRecoveryPlanGroupTaskDetails): + var rpgtd RecoveryPlanGroupTaskDetails + err := json.Unmarshal(body, &rpgtd) + return rpgtd, err + case string(InstanceTypeRecoveryPlanShutdownGroupTaskDetails): + var rpsgtd RecoveryPlanShutdownGroupTaskDetails + err := json.Unmarshal(body, &rpsgtd) + return rpsgtd, err + default: + var gtd GroupTaskDetails + err := json.Unmarshal(body, >d) + return gtd, err + } +} +func unmarshalBasicGroupTaskDetailsArray(body []byte) ([]BasicGroupTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + gtdArray := make([]BasicGroupTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + gtd, err := unmarshalBasicGroupTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + gtdArray[index] = gtd + } + return gtdArray, nil +} + +// MarshalJSON is the custom marshaler for GroupTaskDetails. +func (gtd GroupTaskDetails) MarshalJSON() ([]byte, error) { + gtd.InstanceType = InstanceTypeGroupTaskDetails + objectMap := make(map[string]interface{}) + if gtd.ChildTasks != nil { + objectMap["childTasks"] = gtd.ChildTasks + } + if gtd.InstanceType != "" { + objectMap["instanceType"] = gtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return >d, true +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return >d, true +} + +// HealthError health Error. +type HealthError struct { + // InnerHealthErrors - The inner health errors. HealthError having a list of HealthError as child errors is problematic. InnerHealthError is used because this will prevent an infinite loop of structures when Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health errors and all API consumers can utilize this in the same fashion as Exception -> InnerException. + InnerHealthErrors *[]InnerHealthError `json:"innerHealthErrors,omitempty"` + // ErrorSource - Source of error. + ErrorSource *string `json:"errorSource,omitempty"` + // ErrorType - Type of error. + ErrorType *string `json:"errorType,omitempty"` + // ErrorLevel - Level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // ErrorCategory - Category of error. + ErrorCategory *string `json:"errorCategory,omitempty"` + // ErrorCode - Error code. + ErrorCode *string `json:"errorCode,omitempty"` + // SummaryMessage - Summary message of the entity. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // ErrorMessage - Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // CreationTimeUtc - Error creation time (UTC). + CreationTimeUtc *date.Time `json:"creationTimeUtc,omitempty"` + // RecoveryProviderErrorMessage - DRA error message. + RecoveryProviderErrorMessage *string `json:"recoveryProviderErrorMessage,omitempty"` + // EntityID - ID of the entity. + EntityID *string `json:"entityId,omitempty"` + // ErrorID - The health error unique id. + ErrorID *string `json:"errorId,omitempty"` + // CustomerResolvability - Value indicating whether the health error is customer resolvable. Possible values include: 'Allowed', 'NotAllowed' + CustomerResolvability HealthErrorCustomerResolvability `json:"customerResolvability,omitempty"` +} + +// HealthErrorSummary class to define the summary of the health error details. +type HealthErrorSummary struct { + // SummaryCode - The code of the health error. + SummaryCode *string `json:"summaryCode,omitempty"` + // Category - The category of the health error. Possible values include: 'HealthErrorCategoryNone', 'HealthErrorCategoryReplication', 'HealthErrorCategoryTestFailover', 'HealthErrorCategoryConfiguration', 'HealthErrorCategoryFabricInfrastructure', 'HealthErrorCategoryVersionExpiry', 'HealthErrorCategoryAgentAutoUpdateInfra', 'HealthErrorCategoryAgentAutoUpdateArtifactDeleted', 'HealthErrorCategoryAgentAutoUpdateRunAsAccount', 'HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry', 'HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired' + Category HealthErrorCategory `json:"category,omitempty"` + // Severity - Severity of error. Possible values include: 'NONE', 'Warning', 'Error', 'Info' + Severity Severity `json:"severity,omitempty"` + // SummaryMessage - The summary message of the health error. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // AffectedResourceType - The type of affected ARM resource. + AffectedResourceType *string `json:"affectedResourceType,omitempty"` + // AffectedResourceSubtype - The sub type of any subcomponent within the ARM resource that this might be applicable. Value remains null if not applicable. + AffectedResourceSubtype *string `json:"affectedResourceSubtype,omitempty"` + // AffectedResourceCorrelationIds - The list of affected resource correlation Ids. This can be used to uniquely identify the count of items affected by a specific category and severity as well as count of item affected by an specific issue. + AffectedResourceCorrelationIds *[]string `json:"affectedResourceCorrelationIds,omitempty"` +} + +// HyperVHostDetails hyper-V host details. +type HyperVHostDetails struct { + // ID - READ-ONLY; The Hyper-V host Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The Hyper-V host name. + Name *string `json:"name,omitempty"` + // MarsAgentVersion - READ-ONLY; The Mars agent version. + MarsAgentVersion *string `json:"marsAgentVersion,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVHostDetails. +func (hvhd HyperVHostDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// HyperVReplica2012EventDetails model class for event details of a HyperVReplica E2E event. +type HyperVReplica2012EventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) MarshalJSON() ([]byte, error) { + hvr2ed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvr2ed.ContainerName != nil { + objectMap["containerName"] = hvr2ed.ContainerName + } + if hvr2ed.FabricName != nil { + objectMap["fabricName"] = hvr2ed.FabricName + } + if hvr2ed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvr2ed.RemoteContainerName + } + if hvr2ed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvr2ed.RemoteFabricName + } + if hvr2ed.InstanceType != "" { + objectMap["instanceType"] = hvr2ed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return &hvr2ed, true +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvr2ed, true +} + +// HyperVReplica2012R2EventDetails model class for event details of a HyperVReplica blue E2E event. +type HyperVReplica2012R2EventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) MarshalJSON() ([]byte, error) { + hvr2ed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvr2ed.ContainerName != nil { + objectMap["containerName"] = hvr2ed.ContainerName + } + if hvr2ed.FabricName != nil { + objectMap["fabricName"] = hvr2ed.FabricName + } + if hvr2ed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvr2ed.RemoteContainerName + } + if hvr2ed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvr2ed.RemoteFabricName + } + if hvr2ed.InstanceType != "" { + objectMap["instanceType"] = hvr2ed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return &hvr2ed, true +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvr2ed, true +} + +// HyperVReplicaAzureApplyRecoveryPointInput applyRecoveryPoint input specific to HyperVReplicaAzure +// provider. +type HyperVReplicaAzureApplyRecoveryPointInput struct { + // PrimaryKekCertificatePfx - The primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - The secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + hvraarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraarpi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvraarpi.PrimaryKekCertificatePfx + } + if hvraarpi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvraarpi.SecondaryKekCertificatePfx + } + if hvraarpi.InstanceType != "" { + objectMap["instanceType"] = hvraarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return &hvraarpi, true +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &hvraarpi, true +} + +// HyperVReplicaAzureDiskInputDetails disk input details. +type HyperVReplicaAzureDiskInputDetails struct { + // DiskID - The DiskId. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The LogStorageAccountId. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// HyperVReplicaAzureEnableProtectionInput hyperVReplicaAzure specific enable protection input. +type HyperVReplicaAzureEnableProtectionInput struct { + // HvHostVMID - The Hyper-V host VM Id. + HvHostVMID *string `json:"hvHostVmId,omitempty"` + // VMName - The VM Name. + VMName *string `json:"vmName,omitempty"` + // OsType - The OS type associated with VM. + OsType *string `json:"osType,omitempty"` + // VhdID - The OS disk VHD id associated with VM. + VhdID *string `json:"vhdId,omitempty"` + // TargetStorageAccountID - The storage account Id. + TargetStorageAccountID *string `json:"targetStorageAccountId,omitempty"` + // TargetAzureNetworkID - The selected target Azure network Id. + TargetAzureNetworkID *string `json:"targetAzureNetworkId,omitempty"` + // TargetAzureSubnetID - The selected target Azure subnet Id. + TargetAzureSubnetID *string `json:"targetAzureSubnetId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // TargetAzureVMName - The target azure VM Name. + TargetAzureVMName *string `json:"targetAzureVmName,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DisksToInclude - The list of VHD Ids of disks to be protected. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // TargetAzureV1ResourceGroupID - The Id of the target resource group (for classic deployment) in which the failover VM is to be created. + TargetAzureV1ResourceGroupID *string `json:"targetAzureV1ResourceGroupId,omitempty"` + // TargetAzureV2ResourceGroupID - The Id of the target resource group (for resource manager deployment) in which the failover VM is to be created. + TargetAzureV2ResourceGroupID *string `json:"targetAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id for resource manager deployment. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetProximityPlacementGroupID - The proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisksForReplication - A value indicating whether managed disks should be used during replication. + UseManagedDisksForReplication *string `json:"useManagedDisksForReplication,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DisksToIncludeForManagedDisks - The disks to include list for managed disks. + DisksToIncludeForManagedDisks *[]HyperVReplicaAzureDiskInputDetails `json:"disksToIncludeForManagedDisks,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) MarshalJSON() ([]byte, error) { + hvraepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraepi.HvHostVMID != nil { + objectMap["hvHostVmId"] = hvraepi.HvHostVMID + } + if hvraepi.VMName != nil { + objectMap["vmName"] = hvraepi.VMName + } + if hvraepi.OsType != nil { + objectMap["osType"] = hvraepi.OsType + } + if hvraepi.VhdID != nil { + objectMap["vhdId"] = hvraepi.VhdID + } + if hvraepi.TargetStorageAccountID != nil { + objectMap["targetStorageAccountId"] = hvraepi.TargetStorageAccountID + } + if hvraepi.TargetAzureNetworkID != nil { + objectMap["targetAzureNetworkId"] = hvraepi.TargetAzureNetworkID + } + if hvraepi.TargetAzureSubnetID != nil { + objectMap["targetAzureSubnetId"] = hvraepi.TargetAzureSubnetID + } + if hvraepi.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = hvraepi.EnableRdpOnTargetOption + } + if hvraepi.TargetAzureVMName != nil { + objectMap["targetAzureVmName"] = hvraepi.TargetAzureVMName + } + if hvraepi.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = hvraepi.LogStorageAccountID + } + if hvraepi.DisksToInclude != nil { + objectMap["disksToInclude"] = hvraepi.DisksToInclude + } + if hvraepi.TargetAzureV1ResourceGroupID != nil { + objectMap["targetAzureV1ResourceGroupId"] = hvraepi.TargetAzureV1ResourceGroupID + } + if hvraepi.TargetAzureV2ResourceGroupID != nil { + objectMap["targetAzureV2ResourceGroupId"] = hvraepi.TargetAzureV2ResourceGroupID + } + if hvraepi.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvraepi.UseManagedDisks + } + if hvraepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = hvraepi.TargetAvailabilitySetID + } + if hvraepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvraepi.TargetAvailabilityZone + } + if hvraepi.LicenseType != "" { + objectMap["licenseType"] = hvraepi.LicenseType + } + if hvraepi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = hvraepi.SQLServerLicenseType + } + if hvraepi.TargetVMSize != nil { + objectMap["targetVmSize"] = hvraepi.TargetVMSize + } + if hvraepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvraepi.TargetProximityPlacementGroupID + } + if hvraepi.UseManagedDisksForReplication != nil { + objectMap["useManagedDisksForReplication"] = hvraepi.UseManagedDisksForReplication + } + if hvraepi.DiskType != "" { + objectMap["diskType"] = hvraepi.DiskType + } + if hvraepi.DisksToIncludeForManagedDisks != nil { + objectMap["disksToIncludeForManagedDisks"] = hvraepi.DisksToIncludeForManagedDisks + } + if hvraepi.DiskEncryptionSetID != nil { + objectMap["diskEncryptionSetId"] = hvraepi.DiskEncryptionSetID + } + if hvraepi.TargetVMTags != nil { + objectMap["targetVmTags"] = hvraepi.TargetVMTags + } + if hvraepi.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = hvraepi.SeedManagedDiskTags + } + if hvraepi.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvraepi.TargetManagedDiskTags + } + if hvraepi.TargetNicTags != nil { + objectMap["targetNicTags"] = hvraepi.TargetNicTags + } + if hvraepi.InstanceType != "" { + objectMap["instanceType"] = hvraepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return &hvraepi, true +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &hvraepi, true +} + +// HyperVReplicaAzureEventDetails model class for event details of a HyperVReplica E2A event. +type HyperVReplicaAzureEventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) MarshalJSON() ([]byte, error) { + hvraed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraed.ContainerName != nil { + objectMap["containerName"] = hvraed.ContainerName + } + if hvraed.FabricName != nil { + objectMap["fabricName"] = hvraed.FabricName + } + if hvraed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvraed.RemoteContainerName + } + if hvraed.InstanceType != "" { + objectMap["instanceType"] = hvraed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return &hvraed, true +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvraed, true +} + +// HyperVReplicaAzureFailbackProviderInput hyperVReplicaAzureFailback specific planned failover input. +type HyperVReplicaAzureFailbackProviderInput struct { + // DataSyncOption - Data sync option. + DataSyncOption *string `json:"dataSyncOption,omitempty"` + // RecoveryVMCreationOption - ALR options to create alternate recovery. + RecoveryVMCreationOption *string `json:"recoveryVmCreationOption,omitempty"` + // ProviderIDForAlternateRecovery - Provider Id for alternate location. + ProviderIDForAlternateRecovery *string `json:"providerIdForAlternateRecovery,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) MarshalJSON() ([]byte, error) { + hvrafpi.InstanceType = InstanceTypeHyperVReplicaAzureFailback + objectMap := make(map[string]interface{}) + if hvrafpi.DataSyncOption != nil { + objectMap["dataSyncOption"] = hvrafpi.DataSyncOption + } + if hvrafpi.RecoveryVMCreationOption != nil { + objectMap["recoveryVmCreationOption"] = hvrafpi.RecoveryVMCreationOption + } + if hvrafpi.ProviderIDForAlternateRecovery != nil { + objectMap["providerIdForAlternateRecovery"] = hvrafpi.ProviderIDForAlternateRecovery + } + if hvrafpi.InstanceType != "" { + objectMap["instanceType"] = hvrafpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return &hvrafpi, true +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &hvrafpi, true +} + +// HyperVReplicaAzureManagedDiskDetails hyper-V Managed disk details. +type HyperVReplicaAzureManagedDiskDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // SeedManagedDiskID - Seed managed disk Id. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // ReplicaDiskType - The replica disk type. + ReplicaDiskType *string `json:"replicaDiskType,omitempty"` + // DiskEncryptionSetID - The disk encryption set ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// HyperVReplicaAzurePlannedFailoverProviderInput hyperVReplicaAzure specific planned failover input. +type HyperVReplicaAzurePlannedFailoverProviderInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) MarshalJSON() ([]byte, error) { + hvrapfpi.InstanceType = InstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapfpi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvrapfpi.PrimaryKekCertificatePfx + } + if hvrapfpi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvrapfpi.SecondaryKekCertificatePfx + } + if hvrapfpi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvrapfpi.RecoveryPointID + } + if hvrapfpi.InstanceType != "" { + objectMap["instanceType"] = hvrapfpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return &hvrapfpi, true +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &hvrapfpi, true +} + +// HyperVReplicaAzurePolicyDetails hyper-V Replica Azure specific protection profile details. +type HyperVReplicaAzurePolicyDetails struct { + // RecoveryPointHistoryDurationInHours - The duration (in hours) to which point the recovery history needs to be maintained. + RecoveryPointHistoryDurationInHours *int32 `json:"recoveryPointHistoryDurationInHours,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - The interval (in hours) at which Hyper-V Replica should create an application consistent snapshot within the VM. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // ReplicationInterval - The replication interval. + ReplicationInterval *int32 `json:"replicationInterval,omitempty"` + // OnlineReplicationStartTime - The scheduled start time for the initial replication. If this parameter is Null, the initial replication starts immediately. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // Encryption - A value indicating whether encryption is enabled for virtual machines in this cloud. + Encryption *string `json:"encryption,omitempty"` + // ActiveStorageAccountID - The active storage account Id. + ActiveStorageAccountID *string `json:"activeStorageAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) MarshalJSON() ([]byte, error) { + hvrapd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapd.RecoveryPointHistoryDurationInHours != nil { + objectMap["recoveryPointHistoryDurationInHours"] = hvrapd.RecoveryPointHistoryDurationInHours + } + if hvrapd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrapd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrapd.ReplicationInterval != nil { + objectMap["replicationInterval"] = hvrapd.ReplicationInterval + } + if hvrapd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrapd.OnlineReplicationStartTime + } + if hvrapd.Encryption != nil { + objectMap["encryption"] = hvrapd.Encryption + } + if hvrapd.ActiveStorageAccountID != nil { + objectMap["activeStorageAccountId"] = hvrapd.ActiveStorageAccountID + } + if hvrapd.InstanceType != "" { + objectMap["instanceType"] = hvrapd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return &hvrapd, true +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrapd, true +} + +// HyperVReplicaAzurePolicyInput hyper-V Replica Azure specific input for creating a protection profile. +type HyperVReplicaAzurePolicyInput struct { + // RecoveryPointHistoryDuration - The duration (in hours) to which point the recovery history needs to be maintained. + RecoveryPointHistoryDuration *int32 `json:"recoveryPointHistoryDuration,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - The interval (in hours) at which Hyper-V Replica should create an application consistent snapshot within the VM. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // ReplicationInterval - The replication interval. + ReplicationInterval *int32 `json:"replicationInterval,omitempty"` + // OnlineReplicationStartTime - The scheduled start time for the initial replication. If this parameter is Null, the initial replication starts immediately. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // StorageAccounts - The list of storage accounts to which the VMs in the primary cloud can replicate to. + StorageAccounts *[]string `json:"storageAccounts,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) MarshalJSON() ([]byte, error) { + hvrapi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapi.RecoveryPointHistoryDuration != nil { + objectMap["recoveryPointHistoryDuration"] = hvrapi.RecoveryPointHistoryDuration + } + if hvrapi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrapi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrapi.ReplicationInterval != nil { + objectMap["replicationInterval"] = hvrapi.ReplicationInterval + } + if hvrapi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrapi.OnlineReplicationStartTime + } + if hvrapi.StorageAccounts != nil { + objectMap["storageAccounts"] = hvrapi.StorageAccounts + } + if hvrapi.InstanceType != "" { + objectMap["instanceType"] = hvrapi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return &hvrapi, true +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrapi, true +} + +// HyperVReplicaAzureReplicationDetails hyper V Replica Azure provider specific settings. +type HyperVReplicaAzureReplicationDetails struct { + // AzureVMDiskDetails - Azure VM Disk details. + AzureVMDiskDetails *[]AzureVMDiskDetails `json:"azureVmDiskDetails,omitempty"` + // RecoveryAzureVMName - Recovery Azure given name. + RecoveryAzureVMName *string `json:"recoveryAzureVmName,omitempty"` + // RecoveryAzureVMSize - The Recovery Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureStorageAccount - The recovery Azure storage account. + RecoveryAzureStorageAccount *string `json:"recoveryAzureStorageAccount,omitempty"` + // RecoveryAzureLogStorageAccountID - The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. + RecoveryAzureLogStorageAccountID *string `json:"recoveryAzureLogStorageAccountId,omitempty"` + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // RpoInSeconds - Last RPO value. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // SelectedRecoveryAzureNetworkID - The selected recovery azure network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // Encryption - The encryption info. + Encryption *string `json:"encryption,omitempty"` + // OSDetails - The operating system info. + OSDetails *OSDetails `json:"oSDetails,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // RecoveryAzureResourceGroupID - The target resource group Id. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]HyperVReplicaAzureManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) MarshalJSON() ([]byte, error) { + hvrard.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrard.AzureVMDiskDetails != nil { + objectMap["azureVmDiskDetails"] = hvrard.AzureVMDiskDetails + } + if hvrard.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVmName"] = hvrard.RecoveryAzureVMName + } + if hvrard.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = hvrard.RecoveryAzureVMSize + } + if hvrard.RecoveryAzureStorageAccount != nil { + objectMap["recoveryAzureStorageAccount"] = hvrard.RecoveryAzureStorageAccount + } + if hvrard.RecoveryAzureLogStorageAccountID != nil { + objectMap["recoveryAzureLogStorageAccountId"] = hvrard.RecoveryAzureLogStorageAccountID + } + if hvrard.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrard.LastReplicatedTime + } + if hvrard.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = hvrard.RpoInSeconds + } + if hvrard.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = hvrard.LastRpoCalculatedTime + } + if hvrard.VMID != nil { + objectMap["vmId"] = hvrard.VMID + } + if hvrard.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrard.VMProtectionState + } + if hvrard.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrard.VMProtectionStateDescription + } + if hvrard.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrard.InitialReplicationDetails + } + if hvrard.VMNics != nil { + objectMap["vmNics"] = hvrard.VMNics + } + if hvrard.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = hvrard.SelectedRecoveryAzureNetworkID + } + if hvrard.SelectedSourceNicID != nil { + objectMap["selectedSourceNicId"] = hvrard.SelectedSourceNicID + } + if hvrard.Encryption != nil { + objectMap["encryption"] = hvrard.Encryption + } + if hvrard.OSDetails != nil { + objectMap["oSDetails"] = hvrard.OSDetails + } + if hvrard.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = hvrard.SourceVMRAMSizeInMB + } + if hvrard.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = hvrard.SourceVMCPUCount + } + if hvrard.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = hvrard.EnableRdpOnTargetOption + } + if hvrard.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = hvrard.RecoveryAzureResourceGroupID + } + if hvrard.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = hvrard.RecoveryAvailabilitySetID + } + if hvrard.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvrard.TargetAvailabilityZone + } + if hvrard.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvrard.TargetProximityPlacementGroupID + } + if hvrard.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvrard.UseManagedDisks + } + if hvrard.LicenseType != nil { + objectMap["licenseType"] = hvrard.LicenseType + } + if hvrard.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = hvrard.SQLServerLicenseType + } + if hvrard.TargetVMTags != nil { + objectMap["targetVmTags"] = hvrard.TargetVMTags + } + if hvrard.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = hvrard.SeedManagedDiskTags + } + if hvrard.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvrard.TargetManagedDiskTags + } + if hvrard.TargetNicTags != nil { + objectMap["targetNicTags"] = hvrard.TargetNicTags + } + if hvrard.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = hvrard.ProtectedManagedDisks + } + if hvrard.InstanceType != "" { + objectMap["instanceType"] = hvrard.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return &hvrard, true +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrard, true +} + +// HyperVReplicaAzureReprotectInput azure specific reprotect input. +type HyperVReplicaAzureReprotectInput struct { + // HvHostVMID - The Hyper-V host Vm Id. + HvHostVMID *string `json:"hvHostVmId,omitempty"` + // VMName - The Vm Name. + VMName *string `json:"vmName,omitempty"` + // OsType - The OS type associated with vm. + OsType *string `json:"osType,omitempty"` + // VHDID - The OS disk VHD id associated with vm. + VHDID *string `json:"vHDId,omitempty"` + // StorageAccountID - The storage account name. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) MarshalJSON() ([]byte, error) { + hvrari.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrari.HvHostVMID != nil { + objectMap["hvHostVmId"] = hvrari.HvHostVMID + } + if hvrari.VMName != nil { + objectMap["vmName"] = hvrari.VMName + } + if hvrari.OsType != nil { + objectMap["osType"] = hvrari.OsType + } + if hvrari.VHDID != nil { + objectMap["vHDId"] = hvrari.VHDID + } + if hvrari.StorageAccountID != nil { + objectMap["storageAccountId"] = hvrari.StorageAccountID + } + if hvrari.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = hvrari.LogStorageAccountID + } + if hvrari.InstanceType != "" { + objectMap["instanceType"] = hvrari.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return &hvrari, true +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &hvrari, true +} + +// HyperVReplicaAzureTestFailoverInput hvrA provider specific input for test failover. +type HyperVReplicaAzureTestFailoverInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) MarshalJSON() ([]byte, error) { + hvratfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvratfi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvratfi.PrimaryKekCertificatePfx + } + if hvratfi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvratfi.SecondaryKekCertificatePfx + } + if hvratfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvratfi.RecoveryPointID + } + if hvratfi.InstanceType != "" { + objectMap["instanceType"] = hvratfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return &hvratfi, true +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &hvratfi, true +} + +// HyperVReplicaAzureUnplannedFailoverInput hvrA provider specific input for unplanned failover. +type HyperVReplicaAzureUnplannedFailoverInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + hvraufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraufi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvraufi.PrimaryKekCertificatePfx + } + if hvraufi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvraufi.SecondaryKekCertificatePfx + } + if hvraufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvraufi.RecoveryPointID + } + if hvraufi.InstanceType != "" { + objectMap["instanceType"] = hvraufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return &hvraufi, true +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &hvraufi, true +} + +// HyperVReplicaAzureUpdateReplicationProtectedItemInput hyperV replica Azure input to update replication +// protected item. +type HyperVReplicaAzureUpdateReplicationProtectedItemInput struct { + // RecoveryAzureV1ResourceGroupID - The recovery Azure resource group Id for classic deployment. + RecoveryAzureV1ResourceGroupID *string `json:"recoveryAzureV1ResourceGroupId,omitempty"` + // RecoveryAzureV2ResourceGroupID - The recovery Azure resource group Id for resource manager deployment. + RecoveryAzureV2ResourceGroupID *string `json:"recoveryAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // DiskIDToDiskEncryptionMap - The dictionary of disk resource Id to disk encryption set ARM Id. + DiskIDToDiskEncryptionMap map[string]*string `json:"diskIdToDiskEncryptionMap"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // VMDisks - The list of disk update properties. + VMDisks *[]UpdateDiskInput `json:"vmDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + hvraurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraurpii.RecoveryAzureV1ResourceGroupID != nil { + objectMap["recoveryAzureV1ResourceGroupId"] = hvraurpii.RecoveryAzureV1ResourceGroupID + } + if hvraurpii.RecoveryAzureV2ResourceGroupID != nil { + objectMap["recoveryAzureV2ResourceGroupId"] = hvraurpii.RecoveryAzureV2ResourceGroupID + } + if hvraurpii.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvraurpii.UseManagedDisks + } + if hvraurpii.DiskIDToDiskEncryptionMap != nil { + objectMap["diskIdToDiskEncryptionMap"] = hvraurpii.DiskIDToDiskEncryptionMap + } + if hvraurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvraurpii.TargetProximityPlacementGroupID + } + if hvraurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvraurpii.TargetAvailabilityZone + } + if hvraurpii.TargetVMTags != nil { + objectMap["targetVmTags"] = hvraurpii.TargetVMTags + } + if hvraurpii.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvraurpii.TargetManagedDiskTags + } + if hvraurpii.TargetNicTags != nil { + objectMap["targetNicTags"] = hvraurpii.TargetNicTags + } + if hvraurpii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = hvraurpii.SQLServerLicenseType + } + if hvraurpii.VMDisks != nil { + objectMap["vmDisks"] = hvraurpii.VMDisks + } + if hvraurpii.InstanceType != "" { + objectMap["instanceType"] = hvraurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return &hvraurpii, true +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &hvraurpii, true +} + +// HyperVReplicaBaseEventDetails abstract model class for event details of a HyperVReplica E2E event. +type HyperVReplicaBaseEventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) MarshalJSON() ([]byte, error) { + hvrbed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails + objectMap := make(map[string]interface{}) + if hvrbed.ContainerName != nil { + objectMap["containerName"] = hvrbed.ContainerName + } + if hvrbed.FabricName != nil { + objectMap["fabricName"] = hvrbed.FabricName + } + if hvrbed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvrbed.RemoteContainerName + } + if hvrbed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvrbed.RemoteFabricName + } + if hvrbed.InstanceType != "" { + objectMap["instanceType"] = hvrbed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return &hvrbed, true +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvrbed, true +} + +// HyperVReplicaBasePolicyDetails base class for HyperVReplica policy details. +type HyperVReplicaBasePolicyDetails struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud. + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) MarshalJSON() ([]byte, error) { + hvrbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails + objectMap := make(map[string]interface{}) + if hvrbpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpd.RecoveryPoints + } + if hvrbpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpd.Compression != nil { + objectMap["compression"] = hvrbpd.Compression + } + if hvrbpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpd.InitialReplicationMethod + } + if hvrbpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpd.OnlineReplicationStartTime + } + if hvrbpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpd.OfflineReplicationImportPath + } + if hvrbpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpd.OfflineReplicationExportPath + } + if hvrbpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpd.ReplicationPort + } + if hvrbpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpd.AllowedAuthenticationType + } + if hvrbpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrbpd.ReplicaDeletionOption + } + if hvrbpd.InstanceType != "" { + objectMap["instanceType"] = hvrbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return &hvrbpd, true +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrbpd, true +} + +// HyperVReplicaBaseReplicationDetails hyper V replica provider specific settings base class. +type HyperVReplicaBaseReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) MarshalJSON() ([]byte, error) { + hvrbrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails + objectMap := make(map[string]interface{}) + if hvrbrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrbrd.LastReplicatedTime + } + if hvrbrd.VMNics != nil { + objectMap["vmNics"] = hvrbrd.VMNics + } + if hvrbrd.VMID != nil { + objectMap["vmId"] = hvrbrd.VMID + } + if hvrbrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrbrd.VMProtectionState + } + if hvrbrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrbrd.VMProtectionStateDescription + } + if hvrbrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrbrd.InitialReplicationDetails + } + if hvrbrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrbrd.VMDiskDetails + } + if hvrbrd.InstanceType != "" { + objectMap["instanceType"] = hvrbrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return &hvrbrd, true +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrbrd, true +} + +// HyperVReplicaBluePolicyDetails hyper-V Replica Blue specific protection profile details. +type HyperVReplicaBluePolicyDetails struct { + // ReplicationFrequencyInSeconds - A value indicating the replication interval. + ReplicationFrequencyInSeconds *int32 `json:"replicationFrequencyInSeconds,omitempty"` + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) MarshalJSON() ([]byte, error) { + hvrbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbpd.ReplicationFrequencyInSeconds != nil { + objectMap["replicationFrequencyInSeconds"] = hvrbpd.ReplicationFrequencyInSeconds + } + if hvrbpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpd.RecoveryPoints + } + if hvrbpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpd.Compression != nil { + objectMap["compression"] = hvrbpd.Compression + } + if hvrbpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpd.InitialReplicationMethod + } + if hvrbpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpd.OnlineReplicationStartTime + } + if hvrbpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpd.OfflineReplicationImportPath + } + if hvrbpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpd.OfflineReplicationExportPath + } + if hvrbpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpd.ReplicationPort + } + if hvrbpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpd.AllowedAuthenticationType + } + if hvrbpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrbpd.ReplicaDeletionOption + } + if hvrbpd.InstanceType != "" { + objectMap["instanceType"] = hvrbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return &hvrbpd, true +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrbpd, true +} + +// HyperVReplicaBluePolicyInput hyperV Replica Blue policy input. +type HyperVReplicaBluePolicyInput struct { + // ReplicationFrequencyInSeconds - A value indicating the replication interval. + ReplicationFrequencyInSeconds *int32 `json:"replicationFrequencyInSeconds,omitempty"` + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletion - A value indicating whether the VM has to be auto deleted. + ReplicaDeletion *string `json:"replicaDeletion,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) MarshalJSON() ([]byte, error) { + hvrbpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbpi.ReplicationFrequencyInSeconds != nil { + objectMap["replicationFrequencyInSeconds"] = hvrbpi.ReplicationFrequencyInSeconds + } + if hvrbpi.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpi.RecoveryPoints + } + if hvrbpi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpi.Compression != nil { + objectMap["compression"] = hvrbpi.Compression + } + if hvrbpi.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpi.InitialReplicationMethod + } + if hvrbpi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpi.OnlineReplicationStartTime + } + if hvrbpi.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpi.OfflineReplicationImportPath + } + if hvrbpi.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpi.OfflineReplicationExportPath + } + if hvrbpi.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpi.ReplicationPort + } + if hvrbpi.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpi.AllowedAuthenticationType + } + if hvrbpi.ReplicaDeletion != nil { + objectMap["replicaDeletion"] = hvrbpi.ReplicaDeletion + } + if hvrbpi.InstanceType != "" { + objectMap["instanceType"] = hvrbpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return &hvrbpi, true +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return &hvrbpi, true +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrbpi, true +} + +// HyperVReplicaBlueReplicationDetails hyperV replica 2012 R2 (Blue) replication details. +type HyperVReplicaBlueReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) MarshalJSON() ([]byte, error) { + hvrbrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrbrd.LastReplicatedTime + } + if hvrbrd.VMNics != nil { + objectMap["vmNics"] = hvrbrd.VMNics + } + if hvrbrd.VMID != nil { + objectMap["vmId"] = hvrbrd.VMID + } + if hvrbrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrbrd.VMProtectionState + } + if hvrbrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrbrd.VMProtectionStateDescription + } + if hvrbrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrbrd.InitialReplicationDetails + } + if hvrbrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrbrd.VMDiskDetails + } + if hvrbrd.InstanceType != "" { + objectMap["instanceType"] = hvrbrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return &hvrbrd, true +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrbrd, true +} + +// HyperVReplicaPolicyDetails hyper-V Replica Blue specific protection profile details. +type HyperVReplicaPolicyDetails struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) MarshalJSON() ([]byte, error) { + hvrpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrpd.RecoveryPoints + } + if hvrpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrpd.Compression != nil { + objectMap["compression"] = hvrpd.Compression + } + if hvrpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrpd.InitialReplicationMethod + } + if hvrpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrpd.OnlineReplicationStartTime + } + if hvrpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrpd.OfflineReplicationImportPath + } + if hvrpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrpd.OfflineReplicationExportPath + } + if hvrpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrpd.ReplicationPort + } + if hvrpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrpd.AllowedAuthenticationType + } + if hvrpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrpd.ReplicaDeletionOption + } + if hvrpd.InstanceType != "" { + objectMap["instanceType"] = hvrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return &hvrpd, true +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrpd, true +} + +// BasicHyperVReplicaPolicyInput hyper-V Replica specific policy Input. +type BasicHyperVReplicaPolicyInput interface { + AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) + AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) +} + +// HyperVReplicaPolicyInput hyper-V Replica specific policy Input. +type HyperVReplicaPolicyInput struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletion - A value indicating whether the VM has to be auto deleted. + ReplicaDeletion *string `json:"replicaDeletion,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicHyperVReplicaPolicyInput(body []byte) (BasicHyperVReplicaPolicyInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2): + var hvrbpi HyperVReplicaBluePolicyInput + err := json.Unmarshal(body, &hvrbpi) + return hvrbpi, err + default: + var hvrpi HyperVReplicaPolicyInput + err := json.Unmarshal(body, &hvrpi) + return hvrpi, err + } +} +func unmarshalBasicHyperVReplicaPolicyInputArray(body []byte) ([]BasicHyperVReplicaPolicyInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + hvrpiArray := make([]BasicHyperVReplicaPolicyInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + hvrpi, err := unmarshalBasicHyperVReplicaPolicyInput(*rawMessage) + if err != nil { + return nil, err + } + hvrpiArray[index] = hvrpi + } + return hvrpiArray, nil +} + +// MarshalJSON is the custom marshaler for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) MarshalJSON() ([]byte, error) { + hvrpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrpi.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrpi.RecoveryPoints + } + if hvrpi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrpi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrpi.Compression != nil { + objectMap["compression"] = hvrpi.Compression + } + if hvrpi.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrpi.InitialReplicationMethod + } + if hvrpi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrpi.OnlineReplicationStartTime + } + if hvrpi.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrpi.OfflineReplicationImportPath + } + if hvrpi.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrpi.OfflineReplicationExportPath + } + if hvrpi.ReplicationPort != nil { + objectMap["replicationPort"] = hvrpi.ReplicationPort + } + if hvrpi.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrpi.AllowedAuthenticationType + } + if hvrpi.ReplicaDeletion != nil { + objectMap["replicaDeletion"] = hvrpi.ReplicaDeletion + } + if hvrpi.InstanceType != "" { + objectMap["instanceType"] = hvrpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return &hvrpi, true +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return &hvrpi, true +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrpi, true +} + +// HyperVReplicaReplicationDetails hyperV replica 2012 replication details. +type HyperVReplicaReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) MarshalJSON() ([]byte, error) { + hvrrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrrd.LastReplicatedTime + } + if hvrrd.VMNics != nil { + objectMap["vmNics"] = hvrrd.VMNics + } + if hvrrd.VMID != nil { + objectMap["vmId"] = hvrrd.VMID + } + if hvrrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrrd.VMProtectionState + } + if hvrrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrrd.VMProtectionStateDescription + } + if hvrrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrrd.InitialReplicationDetails + } + if hvrrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrrd.VMDiskDetails + } + if hvrrd.InstanceType != "" { + objectMap["instanceType"] = hvrrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return &hvrrd, true +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrrd, true +} + +// HyperVSiteDetails hyperVSite fabric specific details. +type HyperVSiteDetails struct { + // HyperVHosts - The list of Hyper-V hosts associated with the fabric. + HyperVHosts *[]HyperVHostDetails `json:"hyperVHosts,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) MarshalJSON() ([]byte, error) { + hvsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite + objectMap := make(map[string]interface{}) + if hvsd.HyperVHosts != nil { + objectMap["hyperVHosts"] = hvsd.HyperVHosts + } + if hvsd.InstanceType != "" { + objectMap["instanceType"] = hvsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return &hvsd, true +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &hvsd, true +} + +// BasicHyperVVirtualMachineDetails single Host fabric provider specific VM settings. +type BasicHyperVVirtualMachineDetails interface { + AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) + AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) +} + +// HyperVVirtualMachineDetails single Host fabric provider specific VM settings. +type HyperVVirtualMachineDetails struct { + // SourceItemID - The source id of the object. + SourceItemID *string `json:"sourceItemId,omitempty"` + // Generation - The id of the object in fabric. + Generation *string `json:"generation,omitempty"` + // OsDetails - The Last replication time. + OsDetails *OSDetails `json:"osDetails,omitempty"` + // DiskDetails - The Last successful failover time. + DiskDetails *[]DiskDetails `json:"diskDetails,omitempty"` + // HasPhysicalDisk - A value indicating whether the VM has a physical disk attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasPhysicalDisk PresenceStatus `json:"hasPhysicalDisk,omitempty"` + // HasFibreChannelAdapter - A value indicating whether the VM has a fibre channel adapter attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasFibreChannelAdapter PresenceStatus `json:"hasFibreChannelAdapter,omitempty"` + // HasSharedVhd - A value indicating whether the VM has a shared VHD attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasSharedVhd PresenceStatus `json:"hasSharedVhd,omitempty"` + // HyperVHostID - The Id of the hyper-v host in fabric. + HyperVHostID *string `json:"hyperVHostId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicHyperVVirtualMachineDetails(body []byte) (BasicHyperVVirtualMachineDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeVmmVirtualMachine): + var vvmd VmmVirtualMachineDetails + err := json.Unmarshal(body, &vvmd) + return vvmd, err + default: + var hvvmd HyperVVirtualMachineDetails + err := json.Unmarshal(body, &hvvmd) + return hvvmd, err + } +} +func unmarshalBasicHyperVVirtualMachineDetailsArray(body []byte) ([]BasicHyperVVirtualMachineDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + hvvmdArray := make([]BasicHyperVVirtualMachineDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + hvvmd, err := unmarshalBasicHyperVVirtualMachineDetails(*rawMessage) + if err != nil { + return nil, err + } + hvvmdArray[index] = hvvmd + } + return hvvmdArray, nil +} + +// MarshalJSON is the custom marshaler for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) MarshalJSON() ([]byte, error) { + hvvmd.InstanceType = InstanceTypeHyperVVirtualMachine + objectMap := make(map[string]interface{}) + if hvvmd.SourceItemID != nil { + objectMap["sourceItemId"] = hvvmd.SourceItemID + } + if hvvmd.Generation != nil { + objectMap["generation"] = hvvmd.Generation + } + if hvvmd.OsDetails != nil { + objectMap["osDetails"] = hvvmd.OsDetails + } + if hvvmd.DiskDetails != nil { + objectMap["diskDetails"] = hvvmd.DiskDetails + } + if hvvmd.HasPhysicalDisk != "" { + objectMap["hasPhysicalDisk"] = hvvmd.HasPhysicalDisk + } + if hvvmd.HasFibreChannelAdapter != "" { + objectMap["hasFibreChannelAdapter"] = hvvmd.HasFibreChannelAdapter + } + if hvvmd.HasSharedVhd != "" { + objectMap["hasSharedVhd"] = hvvmd.HasSharedVhd + } + if hvvmd.HyperVHostID != nil { + objectMap["hyperVHostId"] = hvvmd.HyperVHostID + } + if hvvmd.InstanceType != "" { + objectMap["instanceType"] = hvvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return &hvvmd, true +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return &hvvmd, true +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &hvvmd, true +} + +// IdentityProviderDetails identity provider details. +type IdentityProviderDetails struct { + // TenantID - The tenant Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + TenantID *string `json:"tenantId,omitempty"` + // ApplicationID - The application/client Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ApplicationID *string `json:"applicationId,omitempty"` + // ObjectID - The object Id of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ObjectID *string `json:"objectId,omitempty"` + // Audience - The intended Audience of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + Audience *string `json:"audience,omitempty"` + // AadAuthority - The base authority for Azure Active Directory authentication. + AadAuthority *string `json:"aadAuthority,omitempty"` +} + +// IdentityProviderInput identity provider input. +type IdentityProviderInput struct { + // TenantID - The tenant Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + TenantID *string `json:"tenantId,omitempty"` + // ApplicationID - The application/client Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ApplicationID *string `json:"applicationId,omitempty"` + // ObjectID - The object Id of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ObjectID *string `json:"objectId,omitempty"` + // Audience - The intended Audience of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + Audience *string `json:"audience,omitempty"` + // AadAuthority - The base authority for Azure Active Directory authentication. + AadAuthority *string `json:"aadAuthority,omitempty"` +} + +// InconsistentVMDetails this class stores the monitoring details for consistency check of inconsistent +// Protected Entity. +type InconsistentVMDetails struct { + // VMName - The Vm name. + VMName *string `json:"vmName,omitempty"` + // CloudName - The Cloud name. + CloudName *string `json:"cloudName,omitempty"` + // Details - The list of details regarding state of the Protected Entity in SRS and On prem. + Details *[]string `json:"details,omitempty"` + // ErrorIds - The list of error ids. + ErrorIds *[]string `json:"errorIds,omitempty"` +} + +// InitialReplicationDetails initial replication details. +type InitialReplicationDetails struct { + // InitialReplicationType - Initial replication type. + InitialReplicationType *string `json:"initialReplicationType,omitempty"` + // InitialReplicationProgressPercentage - The initial replication progress percentage. + InitialReplicationProgressPercentage *string `json:"initialReplicationProgressPercentage,omitempty"` +} + +// InlineWorkflowTaskDetails this class represents the inline workflow task details. +type InlineWorkflowTaskDetails struct { + // WorkflowIds - The list of child workflow ids. + WorkflowIds *[]string `json:"workflowIds,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) MarshalJSON() ([]byte, error) { + iwtd.InstanceType = InstanceTypeInlineWorkflowTaskDetails + objectMap := make(map[string]interface{}) + if iwtd.WorkflowIds != nil { + objectMap["workflowIds"] = iwtd.WorkflowIds + } + if iwtd.ChildTasks != nil { + objectMap["childTasks"] = iwtd.ChildTasks + } + if iwtd.InstanceType != "" { + objectMap["instanceType"] = iwtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return &iwtd, true +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &iwtd, true +} + +// InMageAgentDetails the details of the InMage agent. +type InMageAgentDetails struct { + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentUpdateStatus - A value indicating whether installed agent needs to be updated. + AgentUpdateStatus *string `json:"agentUpdateStatus,omitempty"` + // PostUpdateRebootStatus - A value indicating whether reboot is required after update is applied. + PostUpdateRebootStatus *string `json:"postUpdateRebootStatus,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` +} + +// InMageAzureV2ApplyRecoveryPointInput applyRecoveryPoint input specific to InMageAzureV2 provider. +type InMageAzureV2ApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + imavarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavarpi.InstanceType != "" { + objectMap["instanceType"] = imavarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return &imavarpi, true +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &imavarpi, true +} + +// InMageAzureV2DiskInputDetails disk input details. +type InMageAzureV2DiskInputDetails struct { + // DiskID - The DiskId. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The LogStorageAccountId. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageAzureV2EnableProtectionInput vMware Azure specific enable protection input. +type InMageAzureV2EnableProtectionInput struct { + // MasterTargetID - The Master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // StorageAccountID - The storage account Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // MultiVMGroupID - The multi VM group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]InMageAzureV2DiskInputDetails `json:"disksToInclude,omitempty"` + // TargetAzureNetworkID - The selected target Azure network Id. + TargetAzureNetworkID *string `json:"targetAzureNetworkId,omitempty"` + // TargetAzureSubnetID - The selected target Azure subnet Id. + TargetAzureSubnetID *string `json:"targetAzureSubnetId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target VM after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // TargetAzureVMName - The target azure VM Name. + TargetAzureVMName *string `json:"targetAzureVmName,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // TargetAzureV1ResourceGroupID - The Id of the target resource group (for classic deployment) in which the failover VM is to be created. + TargetAzureV1ResourceGroupID *string `json:"targetAzureV1ResourceGroupId,omitempty"` + // TargetAzureV2ResourceGroupID - The Id of the target resource group (for resource manager deployment) in which the failover VM is to be created. + TargetAzureV2ResourceGroupID *string `json:"targetAzureV2ResourceGroupId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id for resource manager deployment. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) MarshalJSON() ([]byte, error) { + imavepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavepi.MasterTargetID != nil { + objectMap["masterTargetId"] = imavepi.MasterTargetID + } + if imavepi.ProcessServerID != nil { + objectMap["processServerId"] = imavepi.ProcessServerID + } + if imavepi.StorageAccountID != nil { + objectMap["storageAccountId"] = imavepi.StorageAccountID + } + if imavepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imavepi.RunAsAccountID + } + if imavepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imavepi.MultiVMGroupID + } + if imavepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imavepi.MultiVMGroupName + } + if imavepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imavepi.DisksToInclude + } + if imavepi.TargetAzureNetworkID != nil { + objectMap["targetAzureNetworkId"] = imavepi.TargetAzureNetworkID + } + if imavepi.TargetAzureSubnetID != nil { + objectMap["targetAzureSubnetId"] = imavepi.TargetAzureSubnetID + } + if imavepi.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = imavepi.EnableRdpOnTargetOption + } + if imavepi.TargetAzureVMName != nil { + objectMap["targetAzureVmName"] = imavepi.TargetAzureVMName + } + if imavepi.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imavepi.LogStorageAccountID + } + if imavepi.TargetAzureV1ResourceGroupID != nil { + objectMap["targetAzureV1ResourceGroupId"] = imavepi.TargetAzureV1ResourceGroupID + } + if imavepi.TargetAzureV2ResourceGroupID != nil { + objectMap["targetAzureV2ResourceGroupId"] = imavepi.TargetAzureV2ResourceGroupID + } + if imavepi.DiskType != "" { + objectMap["diskType"] = imavepi.DiskType + } + if imavepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imavepi.TargetAvailabilitySetID + } + if imavepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavepi.TargetAvailabilityZone + } + if imavepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavepi.TargetProximityPlacementGroupID + } + if imavepi.LicenseType != "" { + objectMap["licenseType"] = imavepi.LicenseType + } + if imavepi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = imavepi.SQLServerLicenseType + } + if imavepi.TargetVMSize != nil { + objectMap["targetVmSize"] = imavepi.TargetVMSize + } + if imavepi.DiskEncryptionSetID != nil { + objectMap["diskEncryptionSetId"] = imavepi.DiskEncryptionSetID + } + if imavepi.TargetVMTags != nil { + objectMap["targetVmTags"] = imavepi.TargetVMTags + } + if imavepi.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = imavepi.SeedManagedDiskTags + } + if imavepi.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavepi.TargetManagedDiskTags + } + if imavepi.TargetNicTags != nil { + objectMap["targetNicTags"] = imavepi.TargetNicTags + } + if imavepi.InstanceType != "" { + objectMap["instanceType"] = imavepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return &imavepi, true +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imavepi, true +} + +// InMageAzureV2EventDetails model class for event details of a VMwareAzureV2 event. +type InMageAzureV2EventDetails struct { + // EventType - InMage Event type. Takes one of the values of InMageDataContract.InMageMonitoringEventType. + EventType *string `json:"eventType,omitempty"` + // Category - InMage Event Category. + Category *string `json:"category,omitempty"` + // Component - InMage Event Component. + Component *string `json:"component,omitempty"` + // CorrectiveAction - Corrective Action string for the event. + CorrectiveAction *string `json:"correctiveAction,omitempty"` + // Details - InMage Event Details. + Details *string `json:"details,omitempty"` + // Summary - InMage Event Summary. + Summary *string `json:"summary,omitempty"` + // SiteName - VMware Site name. + SiteName *string `json:"siteName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) MarshalJSON() ([]byte, error) { + imaved.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imaved.EventType != nil { + objectMap["eventType"] = imaved.EventType + } + if imaved.Category != nil { + objectMap["category"] = imaved.Category + } + if imaved.Component != nil { + objectMap["component"] = imaved.Component + } + if imaved.CorrectiveAction != nil { + objectMap["correctiveAction"] = imaved.CorrectiveAction + } + if imaved.Details != nil { + objectMap["details"] = imaved.Details + } + if imaved.Summary != nil { + objectMap["summary"] = imaved.Summary + } + if imaved.SiteName != nil { + objectMap["siteName"] = imaved.SiteName + } + if imaved.InstanceType != "" { + objectMap["instanceType"] = imaved.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return &imaved, true +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imaved, true +} + +// InMageAzureV2ManagedDiskDetails inMageAzureV2 Managed disk details. +type InMageAzureV2ManagedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // SeedManagedDiskID - Seed managed disk Id. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // ReplicaDiskType - The replica disk type. + ReplicaDiskType *string `json:"replicaDiskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetDiskName - The target disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// InMageAzureV2PolicyDetails inMage Azure v2 specific protection profile details. +type InMageAzureV2PolicyDetails struct { + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) MarshalJSON() ([]byte, error) { + imavpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imavpd.CrashConsistentFrequencyInMinutes + } + if imavpd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imavpd.RecoveryPointThresholdInMinutes + } + if imavpd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imavpd.RecoveryPointHistory + } + if imavpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imavpd.AppConsistentFrequencyInMinutes + } + if imavpd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imavpd.MultiVMSyncStatus + } + if imavpd.InstanceType != "" { + objectMap["instanceType"] = imavpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return &imavpd, true +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imavpd, true +} + +// InMageAzureV2PolicyInput vMWare Azure specific policy Input. +type InMageAzureV2PolicyInput struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) MarshalJSON() ([]byte, error) { + imavpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavpi.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imavpi.RecoveryPointThresholdInMinutes + } + if imavpi.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imavpi.RecoveryPointHistory + } + if imavpi.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imavpi.CrashConsistentFrequencyInMinutes + } + if imavpi.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imavpi.AppConsistentFrequencyInMinutes + } + if imavpi.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = imavpi.MultiVMSyncStatus + } + if imavpi.InstanceType != "" { + objectMap["instanceType"] = imavpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return &imavpi, true +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imavpi, true +} + +// InMageAzureV2ProtectedDiskDetails inMageAzureV2 protected disk details. +type InMageAzureV2ProtectedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // HealthErrorCode - The health error code for the disk. + HealthErrorCode *string `json:"healthErrorCode,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncDurationInSeconds - The resync duration in seconds. + ResyncDurationInSeconds *int64 `json:"resyncDurationInSeconds,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // FileSystemCapacityInBytes - The disk file system capacity in bytes. + FileSystemCapacityInBytes *int64 `json:"fileSystemCapacityInBytes,omitempty"` + // SourceDataInMegaBytes - The source data transit in MB. + SourceDataInMegaBytes *float64 `json:"sourceDataInMegaBytes,omitempty"` + // PsDataInMegaBytes - The PS data transit in MB. + PsDataInMegaBytes *float64 `json:"psDataInMegaBytes,omitempty"` + // TargetDataInMegaBytes - The target data transit in MB. + TargetDataInMegaBytes *float64 `json:"targetDataInMegaBytes,omitempty"` + // DiskResized - A value indicating whether disk is resized. + DiskResized *string `json:"diskResized,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // ResyncProcessedBytes - The resync processed bytes. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTotalTransferredBytes - The resync total transferred bytes. + ResyncTotalTransferredBytes *int64 `json:"resyncTotalTransferredBytes,omitempty"` + // ResyncLast15MinutesTransferredBytes - The resync last 15 minutes transferred bytes. + ResyncLast15MinutesTransferredBytes *int64 `json:"resyncLast15MinutesTransferredBytes,omitempty"` + // ResyncLastDataTransferTimeUTC - The last data transfer time in UTC. + ResyncLastDataTransferTimeUTC *date.Time `json:"resyncLastDataTransferTimeUTC,omitempty"` + // ResyncStartTime - The resync start time. + ResyncStartTime *date.Time `json:"resyncStartTime,omitempty"` + // ProgressHealth - The Progress Health. + ProgressHealth *string `json:"progressHealth,omitempty"` + // ProgressStatus - The Progress Status. + ProgressStatus *string `json:"progressStatus,omitempty"` +} + +// InMageAzureV2RecoveryPointDetails inMage Azure V2 provider specific recovery point details. +type InMageAzureV2RecoveryPointDetails struct { + // IsMultiVMSyncPoint - A value indicating whether the recovery point is multi VM consistent. + IsMultiVMSyncPoint *string `json:"isMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) MarshalJSON() ([]byte, error) { + imavrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavrpd.IsMultiVMSyncPoint != nil { + objectMap["isMultiVmSyncPoint"] = imavrpd.IsMultiVMSyncPoint + } + if imavrpd.InstanceType != "" { + objectMap["instanceType"] = imavrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return &imavrpd, true +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &imavrpd, true +} + +// InMageAzureV2ReplicationDetails inMageAzureV2 provider specific settings. +type InMageAzureV2ReplicationDetails struct { + // InfrastructureVMID - The infrastructure VM Id. + InfrastructureVMID *string `json:"infrastructureVmId,omitempty"` + // VCenterInfrastructureID - The vCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // CompressedDataRateInMB - The compressed data change rate in MB. + CompressedDataRateInMB *float64 `json:"compressedDataRateInMB,omitempty"` + // UncompressedDataRateInMB - The uncompressed data change rate in MB. + UncompressedDataRateInMB *float64 `json:"uncompressedDataRateInMB,omitempty"` + // IPAddress - The source IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // IsAgentUpdateRequired - A value indicating whether installed agent needs to be updated. + IsAgentUpdateRequired *string `json:"isAgentUpdateRequired,omitempty"` + // IsRebootAfterUpdateRequired - A value indicating whether the source server requires a restart after update. + IsRebootAfterUpdateRequired *string `json:"isRebootAfterUpdateRequired,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // ProcessServerName - The process server name. + ProcessServerName *string `json:"processServerName,omitempty"` + // MultiVMGroupID - The multi vm group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi vm sync is enabled or disabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageAzureV2ProtectedDiskDetails `json:"protectedDisks,omitempty"` + // DiskResized - A value indicating whether any disk is resized for this VM. + DiskResized *string `json:"diskResized,omitempty"` + // MasterTargetID - The master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // OsType - The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // VhdName - The OS disk VHD name. + VhdName *string `json:"vhdName,omitempty"` + // OsDiskID - The id of the disk containing the OS. + OsDiskID *string `json:"osDiskId,omitempty"` + // AzureVMDiskDetails - Azure VM Disk details. + AzureVMDiskDetails *[]AzureVMDiskDetails `json:"azureVMDiskDetails,omitempty"` + // RecoveryAzureVMName - Recovery Azure given name. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureVMSize - The Recovery Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureStorageAccount - The recovery Azure storage account. + RecoveryAzureStorageAccount *string `json:"recoveryAzureStorageAccount,omitempty"` + // RecoveryAzureLogStorageAccountID - The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. + RecoveryAzureLogStorageAccountID *string `json:"recoveryAzureLogStorageAccountId,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // SelectedRecoveryAzureNetworkID - The selected recovery azure network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The test failover virtual network. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. Value can be vCenter or physical. + DiscoveryType *string `json:"discoveryType,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // Datastores - The datastores of the on-premise machine. Value can be list of strings that contain datastore names. + Datastores *[]string `json:"datastores,omitempty"` + // TargetVMID - The ARM Id of the target Azure VM. This value will be null until the VM is failed over. Only after failure it will be populated with the ARM Id of the Azure VM. + TargetVMID *string `json:"targetVmId,omitempty"` + // RecoveryAzureResourceGroupID - The target resource group Id. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // ValidationErrors - The validation errors of the on-premise machine Value can be list of validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastUpdateReceivedTime - The last update time received from on-prem components. + LastUpdateReceivedTime *date.Time `json:"lastUpdateReceivedTime,omitempty"` + // ReplicaID - The replica id of the protected item. + ReplicaID *string `json:"replicaId,omitempty"` + // OsVersion - The OS Version of the protected item. + OsVersion *string `json:"osVersion,omitempty"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]InMageAzureV2ManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // FirmwareType - The firmware type of this protected item. + FirmwareType *string `json:"firmwareType,omitempty"` + // AzureVMGeneration - The target generation for this protected item. + AzureVMGeneration *string `json:"azureVmGeneration,omitempty"` + // IsAdditionalStatsAvailable - A value indicating whether additional IR stats are available or not. + IsAdditionalStatsAvailable *bool `json:"isAdditionalStatsAvailable,omitempty"` + // TotalDataTransferred - The total transferred data in bytes. + TotalDataTransferred *int64 `json:"totalDataTransferred,omitempty"` + // TotalProgressHealth - The progress health. + TotalProgressHealth *string `json:"totalProgressHealth,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) MarshalJSON() ([]byte, error) { + imavrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavrd.InfrastructureVMID != nil { + objectMap["infrastructureVmId"] = imavrd.InfrastructureVMID + } + if imavrd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = imavrd.VCenterInfrastructureID + } + if imavrd.ProtectionStage != nil { + objectMap["protectionStage"] = imavrd.ProtectionStage + } + if imavrd.VMID != nil { + objectMap["vmId"] = imavrd.VMID + } + if imavrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = imavrd.VMProtectionState + } + if imavrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = imavrd.VMProtectionStateDescription + } + if imavrd.ResyncProgressPercentage != nil { + objectMap["resyncProgressPercentage"] = imavrd.ResyncProgressPercentage + } + if imavrd.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = imavrd.RpoInSeconds + } + if imavrd.CompressedDataRateInMB != nil { + objectMap["compressedDataRateInMB"] = imavrd.CompressedDataRateInMB + } + if imavrd.UncompressedDataRateInMB != nil { + objectMap["uncompressedDataRateInMB"] = imavrd.UncompressedDataRateInMB + } + if imavrd.IPAddress != nil { + objectMap["ipAddress"] = imavrd.IPAddress + } + if imavrd.AgentVersion != nil { + objectMap["agentVersion"] = imavrd.AgentVersion + } + if imavrd.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = imavrd.AgentExpiryDate + } + if imavrd.IsAgentUpdateRequired != nil { + objectMap["isAgentUpdateRequired"] = imavrd.IsAgentUpdateRequired + } + if imavrd.IsRebootAfterUpdateRequired != nil { + objectMap["isRebootAfterUpdateRequired"] = imavrd.IsRebootAfterUpdateRequired + } + if imavrd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = imavrd.LastHeartbeat + } + if imavrd.ProcessServerID != nil { + objectMap["processServerId"] = imavrd.ProcessServerID + } + if imavrd.ProcessServerName != nil { + objectMap["processServerName"] = imavrd.ProcessServerName + } + if imavrd.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imavrd.MultiVMGroupID + } + if imavrd.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imavrd.MultiVMGroupName + } + if imavrd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imavrd.MultiVMSyncStatus + } + if imavrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imavrd.ProtectedDisks + } + if imavrd.DiskResized != nil { + objectMap["diskResized"] = imavrd.DiskResized + } + if imavrd.MasterTargetID != nil { + objectMap["masterTargetId"] = imavrd.MasterTargetID + } + if imavrd.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = imavrd.SourceVMCPUCount + } + if imavrd.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = imavrd.SourceVMRAMSizeInMB + } + if imavrd.OsType != nil { + objectMap["osType"] = imavrd.OsType + } + if imavrd.VhdName != nil { + objectMap["vhdName"] = imavrd.VhdName + } + if imavrd.OsDiskID != nil { + objectMap["osDiskId"] = imavrd.OsDiskID + } + if imavrd.AzureVMDiskDetails != nil { + objectMap["azureVMDiskDetails"] = imavrd.AzureVMDiskDetails + } + if imavrd.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVMName"] = imavrd.RecoveryAzureVMName + } + if imavrd.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = imavrd.RecoveryAzureVMSize + } + if imavrd.RecoveryAzureStorageAccount != nil { + objectMap["recoveryAzureStorageAccount"] = imavrd.RecoveryAzureStorageAccount + } + if imavrd.RecoveryAzureLogStorageAccountID != nil { + objectMap["recoveryAzureLogStorageAccountId"] = imavrd.RecoveryAzureLogStorageAccountID + } + if imavrd.VMNics != nil { + objectMap["vmNics"] = imavrd.VMNics + } + if imavrd.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = imavrd.SelectedRecoveryAzureNetworkID + } + if imavrd.SelectedTfoAzureNetworkID != nil { + objectMap["selectedTfoAzureNetworkId"] = imavrd.SelectedTfoAzureNetworkID + } + if imavrd.SelectedSourceNicID != nil { + objectMap["selectedSourceNicId"] = imavrd.SelectedSourceNicID + } + if imavrd.DiscoveryType != nil { + objectMap["discoveryType"] = imavrd.DiscoveryType + } + if imavrd.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = imavrd.EnableRdpOnTargetOption + } + if imavrd.Datastores != nil { + objectMap["datastores"] = imavrd.Datastores + } + if imavrd.TargetVMID != nil { + objectMap["targetVmId"] = imavrd.TargetVMID + } + if imavrd.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = imavrd.RecoveryAzureResourceGroupID + } + if imavrd.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = imavrd.RecoveryAvailabilitySetID + } + if imavrd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavrd.TargetAvailabilityZone + } + if imavrd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavrd.TargetProximityPlacementGroupID + } + if imavrd.UseManagedDisks != nil { + objectMap["useManagedDisks"] = imavrd.UseManagedDisks + } + if imavrd.LicenseType != nil { + objectMap["licenseType"] = imavrd.LicenseType + } + if imavrd.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = imavrd.SQLServerLicenseType + } + if imavrd.ValidationErrors != nil { + objectMap["validationErrors"] = imavrd.ValidationErrors + } + if imavrd.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = imavrd.LastRpoCalculatedTime + } + if imavrd.LastUpdateReceivedTime != nil { + objectMap["lastUpdateReceivedTime"] = imavrd.LastUpdateReceivedTime + } + if imavrd.ReplicaID != nil { + objectMap["replicaId"] = imavrd.ReplicaID + } + if imavrd.OsVersion != nil { + objectMap["osVersion"] = imavrd.OsVersion + } + if imavrd.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = imavrd.ProtectedManagedDisks + } + if imavrd.FirmwareType != nil { + objectMap["firmwareType"] = imavrd.FirmwareType + } + if imavrd.AzureVMGeneration != nil { + objectMap["azureVmGeneration"] = imavrd.AzureVMGeneration + } + if imavrd.IsAdditionalStatsAvailable != nil { + objectMap["isAdditionalStatsAvailable"] = imavrd.IsAdditionalStatsAvailable + } + if imavrd.TotalDataTransferred != nil { + objectMap["totalDataTransferred"] = imavrd.TotalDataTransferred + } + if imavrd.TotalProgressHealth != nil { + objectMap["totalProgressHealth"] = imavrd.TotalProgressHealth + } + if imavrd.TargetVMTags != nil { + objectMap["targetVmTags"] = imavrd.TargetVMTags + } + if imavrd.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = imavrd.SeedManagedDiskTags + } + if imavrd.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavrd.TargetManagedDiskTags + } + if imavrd.TargetNicTags != nil { + objectMap["targetNicTags"] = imavrd.TargetNicTags + } + if imavrd.InstanceType != "" { + objectMap["instanceType"] = imavrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return &imavrd, true +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imavrd, true +} + +// InMageAzureV2ReprotectInput inMageAzureV2 specific provider input. +type InMageAzureV2ReprotectInput struct { + // MasterTargetID - The Master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // StorageAccountID - The storage account id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) MarshalJSON() ([]byte, error) { + imavri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavri.MasterTargetID != nil { + objectMap["masterTargetId"] = imavri.MasterTargetID + } + if imavri.ProcessServerID != nil { + objectMap["processServerId"] = imavri.ProcessServerID + } + if imavri.StorageAccountID != nil { + objectMap["storageAccountId"] = imavri.StorageAccountID + } + if imavri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imavri.RunAsAccountID + } + if imavri.PolicyID != nil { + objectMap["policyId"] = imavri.PolicyID + } + if imavri.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imavri.LogStorageAccountID + } + if imavri.DisksToInclude != nil { + objectMap["disksToInclude"] = imavri.DisksToInclude + } + if imavri.InstanceType != "" { + objectMap["instanceType"] = imavri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return &imavri, true +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imavri, true +} + +// InMageAzureV2TestFailoverInput inMageAzureV2 provider specific input for test failover. +type InMageAzureV2TestFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) MarshalJSON() ([]byte, error) { + imavtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imavtfi.RecoveryPointID + } + if imavtfi.InstanceType != "" { + objectMap["instanceType"] = imavtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return &imavtfi, true +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imavtfi, true +} + +// InMageAzureV2UnplannedFailoverInput inMageAzureV2 provider specific input for unplanned failover. +type InMageAzureV2UnplannedFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imavufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imavufi.RecoveryPointID + } + if imavufi.InstanceType != "" { + objectMap["instanceType"] = imavufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return &imavufi, true +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imavufi, true +} + +// InMageAzureV2UpdateReplicationProtectedItemInput inMage Azure V2 input to update replication protected +// item. +type InMageAzureV2UpdateReplicationProtectedItemInput struct { + // RecoveryAzureV1ResourceGroupID - The recovery Azure resource group Id for classic deployment. + RecoveryAzureV1ResourceGroupID *string `json:"recoveryAzureV1ResourceGroupId,omitempty"` + // RecoveryAzureV2ResourceGroupID - The recovery Azure resource group Id for resource manager deployment. + RecoveryAzureV2ResourceGroupID *string `json:"recoveryAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // VMDisks - The list of disk update properties. + VMDisks *[]UpdateDiskInput `json:"vmDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imavurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavurpii.RecoveryAzureV1ResourceGroupID != nil { + objectMap["recoveryAzureV1ResourceGroupId"] = imavurpii.RecoveryAzureV1ResourceGroupID + } + if imavurpii.RecoveryAzureV2ResourceGroupID != nil { + objectMap["recoveryAzureV2ResourceGroupId"] = imavurpii.RecoveryAzureV2ResourceGroupID + } + if imavurpii.UseManagedDisks != nil { + objectMap["useManagedDisks"] = imavurpii.UseManagedDisks + } + if imavurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavurpii.TargetProximityPlacementGroupID + } + if imavurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavurpii.TargetAvailabilityZone + } + if imavurpii.TargetVMTags != nil { + objectMap["targetVmTags"] = imavurpii.TargetVMTags + } + if imavurpii.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavurpii.TargetManagedDiskTags + } + if imavurpii.TargetNicTags != nil { + objectMap["targetNicTags"] = imavurpii.TargetNicTags + } + if imavurpii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = imavurpii.SQLServerLicenseType + } + if imavurpii.VMDisks != nil { + objectMap["vmDisks"] = imavurpii.VMDisks + } + if imavurpii.InstanceType != "" { + objectMap["instanceType"] = imavurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return &imavurpii, true +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &imavurpii, true +} + +// InMageBasePolicyDetails base class for the policies of providers using InMage replication. +type InMageBasePolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) MarshalJSON() ([]byte, error) { + imbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails + objectMap := make(map[string]interface{}) + if imbpd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imbpd.RecoveryPointThresholdInMinutes + } + if imbpd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imbpd.RecoveryPointHistory + } + if imbpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imbpd.AppConsistentFrequencyInMinutes + } + if imbpd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imbpd.MultiVMSyncStatus + } + if imbpd.InstanceType != "" { + objectMap["instanceType"] = imbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return &imbpd, true +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imbpd, true +} + +// InMageDisableProtectionProviderSpecificInput inMage disable protection provider specific input. +type InMageDisableProtectionProviderSpecificInput struct { + // ReplicaVMDeletionStatus - A value indicating whether the replica VM should be destroyed or retained. Values from Delete and Retain. + ReplicaVMDeletionStatus *string `json:"replicaVmDeletionStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeDisableProtectionProviderSpecificInput', 'InstanceTypeInMage' + InstanceType InstanceTypeBasicDisableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + imdppsi.InstanceType = InstanceTypeInMage + objectMap := make(map[string]interface{}) + if imdppsi.ReplicaVMDeletionStatus != nil { + objectMap["replicaVmDeletionStatus"] = imdppsi.ReplicaVMDeletionStatus + } + if imdppsi.InstanceType != "" { + objectMap["instanceType"] = imdppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) { + return &imdppsi, true +} + +// AsDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsBasicDisableProtectionProviderSpecificInput() (BasicDisableProtectionProviderSpecificInput, bool) { + return &imdppsi, true +} + +// InMageDiskDetails vMware/Physical specific Disk Details. +type InMageDiskDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskSizeInMB - The disk size in MB. + DiskSizeInMB *string `json:"diskSizeInMB,omitempty"` + // DiskType - Whether disk is system disk or data disk. + DiskType *string `json:"diskType,omitempty"` + // DiskConfiguration - Whether disk is dynamic disk or basic disk. + DiskConfiguration *string `json:"diskConfiguration,omitempty"` + // VolumeList - Volumes of the disk. + VolumeList *[]DiskVolumeDetails `json:"volumeList,omitempty"` +} + +// InMageDiskExclusionInput diskExclusionInput when doing enable protection of virtual machine in InMage +// provider. +type InMageDiskExclusionInput struct { + // VolumeOptions - The volume label based option for disk exclusion. + VolumeOptions *[]InMageVolumeExclusionOptions `json:"volumeOptions,omitempty"` + // DiskSignatureOptions - The guest disk signature based option for disk exclusion. + DiskSignatureOptions *[]InMageDiskSignatureExclusionOptions `json:"diskSignatureOptions,omitempty"` +} + +// InMageDiskSignatureExclusionOptions guest disk signature based disk exclusion option when doing enable +// protection of virtual machine in InMage provider. +type InMageDiskSignatureExclusionOptions struct { + // DiskSignature - The guest signature of disk to be excluded from replication. + DiskSignature *string `json:"diskSignature,omitempty"` +} + +// InMageEnableProtectionInput vMware Azure specific enable protection input. +type InMageEnableProtectionInput struct { + // VMFriendlyName - The VM Name. + VMFriendlyName *string `json:"vmFriendlyName,omitempty"` + // MasterTargetID - The Master Target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RetentionDrive - The retention drive to use on the MT. + RetentionDrive *string `json:"retentionDrive,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // MultiVMGroupID - The multi VM group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // DiskExclusionInput - The enable disk exclusion input. + DiskExclusionInput *InMageDiskExclusionInput `json:"diskExclusionInput,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) MarshalJSON() ([]byte, error) { + imepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imepi.VMFriendlyName != nil { + objectMap["vmFriendlyName"] = imepi.VMFriendlyName + } + if imepi.MasterTargetID != nil { + objectMap["masterTargetId"] = imepi.MasterTargetID + } + if imepi.ProcessServerID != nil { + objectMap["processServerId"] = imepi.ProcessServerID + } + if imepi.RetentionDrive != nil { + objectMap["retentionDrive"] = imepi.RetentionDrive + } + if imepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imepi.RunAsAccountID + } + if imepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imepi.MultiVMGroupID + } + if imepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imepi.MultiVMGroupName + } + if imepi.DatastoreName != nil { + objectMap["datastoreName"] = imepi.DatastoreName + } + if imepi.DiskExclusionInput != nil { + objectMap["diskExclusionInput"] = imepi.DiskExclusionInput + } + if imepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imepi.DisksToInclude + } + if imepi.InstanceType != "" { + objectMap["instanceType"] = imepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return &imepi, true +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imepi, true +} + +// InMagePolicyDetails inMage specific protection profile details. +type InMagePolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMagePolicyDetails. +func (impd InMagePolicyDetails) MarshalJSON() ([]byte, error) { + impd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage + objectMap := make(map[string]interface{}) + if impd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = impd.RecoveryPointThresholdInMinutes + } + if impd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = impd.RecoveryPointHistory + } + if impd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = impd.AppConsistentFrequencyInMinutes + } + if impd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = impd.MultiVMSyncStatus + } + if impd.InstanceType != "" { + objectMap["instanceType"] = impd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return &impd, true +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &impd, true +} + +// InMagePolicyInput vMWare Azure specific protection profile Input. +type InMagePolicyInput struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMagePolicyInput. +func (impi InMagePolicyInput) MarshalJSON() ([]byte, error) { + impi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if impi.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = impi.RecoveryPointThresholdInMinutes + } + if impi.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = impi.RecoveryPointHistory + } + if impi.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = impi.AppConsistentFrequencyInMinutes + } + if impi.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = impi.MultiVMSyncStatus + } + if impi.InstanceType != "" { + objectMap["instanceType"] = impi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return &impi, true +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &impi, true +} + +// InMageProtectedDiskDetails inMage protected disk details. +type InMageProtectedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // HealthErrorCode - The health error code for the disk. + HealthErrorCode *string `json:"healthErrorCode,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncDurationInSeconds - The resync duration in seconds. + ResyncDurationInSeconds *int64 `json:"resyncDurationInSeconds,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // FileSystemCapacityInBytes - The file system capacity in bytes. + FileSystemCapacityInBytes *int64 `json:"fileSystemCapacityInBytes,omitempty"` + // SourceDataInMB - The source data transit in MB. + SourceDataInMB *float64 `json:"sourceDataInMB,omitempty"` + // PsDataInMB - The PS data transit in MB. + PsDataInMB *float64 `json:"psDataInMB,omitempty"` + // TargetDataInMB - The target data transit in MB. + TargetDataInMB *float64 `json:"targetDataInMB,omitempty"` + // DiskResized - A value indicating whether disk is resized. + DiskResized *string `json:"diskResized,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // ResyncProcessedBytes - The resync processed bytes. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTotalTransferredBytes - The resync total transferred bytes. + ResyncTotalTransferredBytes *int64 `json:"resyncTotalTransferredBytes,omitempty"` + // ResyncLast15MinutesTransferredBytes - The resync last 15 minutes transferred bytes. + ResyncLast15MinutesTransferredBytes *int64 `json:"resyncLast15MinutesTransferredBytes,omitempty"` + // ResyncLastDataTransferTimeUTC - The last data transfer time in UTC. + ResyncLastDataTransferTimeUTC *date.Time `json:"resyncLastDataTransferTimeUTC,omitempty"` + // ResyncStartTime - The resync start time. + ResyncStartTime *date.Time `json:"resyncStartTime,omitempty"` + // ProgressHealth - The Progress Health. + ProgressHealth *string `json:"progressHealth,omitempty"` + // ProgressStatus - The Progress Status. + ProgressStatus *string `json:"progressStatus,omitempty"` +} + +// InMageRcmAgentUpgradeBlockingErrorDetails inMageRcm source agent upgrade blocking error details. +type InMageRcmAgentUpgradeBlockingErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageRcmAgentUpgradeBlockingErrorDetails. +func (imraubed InMageRcmAgentUpgradeBlockingErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmApplyRecoveryPointInput applyRecoveryPoint input specific to InMageRcm provider. +type InMageRcmApplyRecoveryPointInput struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + imrarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrarpi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrarpi.RecoveryPointID + } + if imrarpi.InstanceType != "" { + objectMap["instanceType"] = imrarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return &imrarpi, true +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &imrarpi, true +} + +// InMageRcmDiscoveredProtectedVMDetails inMageRcm discovered protected VM details. +type InMageRcmDiscoveredProtectedVMDetails struct { + // VCenterID - READ-ONLY; The VCenter Id. + VCenterID *string `json:"vCenterId,omitempty"` + // VCenterFqdn - READ-ONLY; The VCenter fqdn. + VCenterFqdn *string `json:"vCenterFqdn,omitempty"` + // Datastores - READ-ONLY; The list of datastores. + Datastores *[]string `json:"datastores,omitempty"` + // IPAddresses - READ-ONLY; The list of IP addresses. + IPAddresses *[]string `json:"ipAddresses,omitempty"` + // VmwareToolsStatus - READ-ONLY; The VMware tools status. + VmwareToolsStatus *string `json:"vmwareToolsStatus,omitempty"` + // PowerStatus - READ-ONLY; The VM power status. + PowerStatus *string `json:"powerStatus,omitempty"` + // VMFqdn - READ-ONLY; The VM fqdn. + VMFqdn *string `json:"vmFqdn,omitempty"` + // OsName - READ-ONLY; The VM's OS name. + OsName *string `json:"osName,omitempty"` + // CreatedTimestamp - READ-ONLY; The SDS created timestamp. + CreatedTimestamp *date.Time `json:"createdTimestamp,omitempty"` + // UpdatedTimestamp - READ-ONLY; The SDS updated timestamp. + UpdatedTimestamp *date.Time `json:"updatedTimestamp,omitempty"` + // IsDeleted - READ-ONLY; A value indicating whether the VM is deleted. + IsDeleted *bool `json:"isDeleted,omitempty"` + // LastDiscoveryTimeInUtc - READ-ONLY; The last time when SDS information discovered in SRS. + LastDiscoveryTimeInUtc *date.Time `json:"lastDiscoveryTimeInUtc,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmDiscoveredProtectedVMDetails. +func (imrdpvd InMageRcmDiscoveredProtectedVMDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmDiskInput inMageRcm disk input. +type InMageRcmDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageRcmDisksDefaultInput inMageRcm disk input. +type InMageRcmDisksDefaultInput struct { + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageRcmEnableProtectionInput inMageRcm specific enable protection input. +type InMageRcmEnableProtectionInput struct { + // FabricDiscoveryMachineID - The ARM Id of discovered machine. + FabricDiscoveryMachineID *string `json:"fabricDiscoveryMachineId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]InMageRcmDiskInput `json:"disksToInclude,omitempty"` + // DisksDefault - The default disk input. + DisksDefault *InMageRcmDisksDefaultInput `json:"disksDefault,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetNetworkID - The selected target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The selected test network ARM Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // TargetSubnetName - The selected target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TestSubnetName - The selected test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // RunAsAccountID - The run-as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) MarshalJSON() ([]byte, error) { + imrepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrepi.FabricDiscoveryMachineID != nil { + objectMap["fabricDiscoveryMachineId"] = imrepi.FabricDiscoveryMachineID + } + if imrepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imrepi.DisksToInclude + } + if imrepi.DisksDefault != nil { + objectMap["disksDefault"] = imrepi.DisksDefault + } + if imrepi.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrepi.TargetResourceGroupID + } + if imrepi.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrepi.TargetNetworkID + } + if imrepi.TestNetworkID != nil { + objectMap["testNetworkId"] = imrepi.TestNetworkID + } + if imrepi.TargetSubnetName != nil { + objectMap["targetSubnetName"] = imrepi.TargetSubnetName + } + if imrepi.TestSubnetName != nil { + objectMap["testSubnetName"] = imrepi.TestSubnetName + } + if imrepi.TargetVMName != nil { + objectMap["targetVmName"] = imrepi.TargetVMName + } + if imrepi.TargetVMSize != nil { + objectMap["targetVmSize"] = imrepi.TargetVMSize + } + if imrepi.LicenseType != "" { + objectMap["licenseType"] = imrepi.LicenseType + } + if imrepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrepi.TargetAvailabilitySetID + } + if imrepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrepi.TargetAvailabilityZone + } + if imrepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrepi.TargetProximityPlacementGroupID + } + if imrepi.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrepi.TargetBootDiagnosticsStorageAccountID + } + if imrepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imrepi.RunAsAccountID + } + if imrepi.ProcessServerID != nil { + objectMap["processServerId"] = imrepi.ProcessServerID + } + if imrepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imrepi.MultiVMGroupName + } + if imrepi.InstanceType != "" { + objectMap["instanceType"] = imrepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return &imrepi, true +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imrepi, true +} + +// InMageRcmEventDetails event details for InMageRcm provider. +type InMageRcmEventDetails struct { + // ProtectedItemName - READ-ONLY; The protected item name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // VMName - READ-ONLY; The protected item name. + VMName *string `json:"vmName,omitempty"` + // LatestAgentVersion - READ-ONLY; The latest agent version. + LatestAgentVersion *string `json:"latestAgentVersion,omitempty"` + // JobID - READ-ONLY; The job Id. + JobID *string `json:"jobId,omitempty"` + // FabricName - READ-ONLY; The fabric name. + FabricName *string `json:"fabricName,omitempty"` + // ApplianceName - READ-ONLY; The appliance name. + ApplianceName *string `json:"applianceName,omitempty"` + // ServerType - READ-ONLY; The server type. + ServerType *string `json:"serverType,omitempty"` + // ComponentDisplayName - READ-ONLY; The component display name. + ComponentDisplayName *string `json:"componentDisplayName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) MarshalJSON() ([]byte, error) { + imred.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imred.InstanceType != "" { + objectMap["instanceType"] = imred.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return &imred, true +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imred, true +} + +// InMageRcmFabricCreationInput inMageRcm fabric provider specific settings. +type InMageRcmFabricCreationInput struct { + // VmwareSiteID - The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // SourceAgentIdentity - The identity provider input for source agent authentication. + SourceAgentIdentity *IdentityProviderInput `json:"sourceAgentIdentity,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreationInput', 'InstanceTypeAzure', 'InstanceTypeInMageRcm', 'InstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) MarshalJSON() ([]byte, error) { + imrfci.InstanceType = InstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrfci.VmwareSiteID != nil { + objectMap["vmwareSiteId"] = imrfci.VmwareSiteID + } + if imrfci.PhysicalSiteID != nil { + objectMap["physicalSiteId"] = imrfci.PhysicalSiteID + } + if imrfci.SourceAgentIdentity != nil { + objectMap["sourceAgentIdentity"] = imrfci.SourceAgentIdentity + } + if imrfci.InstanceType != "" { + objectMap["instanceType"] = imrfci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return &imrfci, true +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &imrfci, true +} + +// InMageRcmFabricSpecificDetails inMageRcm fabric specific details. +type InMageRcmFabricSpecificDetails struct { + // VmwareSiteID - READ-ONLY; The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - READ-ONLY; The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // ServiceEndpoint - READ-ONLY; The service endpoint. + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` + // ServiceResourceID - READ-ONLY; The service resource Id. + ServiceResourceID *string `json:"serviceResourceId,omitempty"` + // ServiceContainerID - READ-ONLY; The service container Id. + ServiceContainerID *string `json:"serviceContainerId,omitempty"` + // DataPlaneURI - READ-ONLY; The data plane Uri. + DataPlaneURI *string `json:"dataPlaneUri,omitempty"` + // ControlPlaneURI - READ-ONLY; The control plane Uri. + ControlPlaneURI *string `json:"controlPlaneUri,omitempty"` + // SourceAgentIdentityDetails - The source agent identity details. + SourceAgentIdentityDetails *IdentityProviderDetails `json:"sourceAgentIdentityDetails,omitempty"` + // ProcessServers - READ-ONLY; The list of process servers. + ProcessServers *[]ProcessServerDetails `json:"processServers,omitempty"` + // RcmProxies - READ-ONLY; The list of RCM proxies. + RcmProxies *[]RcmProxyDetails `json:"rcmProxies,omitempty"` + // PushInstallers - READ-ONLY; The list of push installers. + PushInstallers *[]PushInstallerDetails `json:"pushInstallers,omitempty"` + // ReplicationAgents - READ-ONLY; The list of replication agents. + ReplicationAgents *[]ReplicationAgentDetails `json:"replicationAgents,omitempty"` + // ReprotectAgents - READ-ONLY; The list of reprotect agents. + ReprotectAgents *[]ReprotectAgentDetails `json:"reprotectAgents,omitempty"` + // MarsAgents - READ-ONLY; The list of Mars agents. + MarsAgents *[]MarsAgentDetails `json:"marsAgents,omitempty"` + // Dras - READ-ONLY; The list of DRAs. + Dras *[]DraDetails `json:"dras,omitempty"` + // AgentDetails - READ-ONLY; The list of agent details. + AgentDetails *[]AgentDetails `json:"agentDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) MarshalJSON() ([]byte, error) { + imrfsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrfsd.SourceAgentIdentityDetails != nil { + objectMap["sourceAgentIdentityDetails"] = imrfsd.SourceAgentIdentityDetails + } + if imrfsd.InstanceType != "" { + objectMap["instanceType"] = imrfsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return &imrfsd, true +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &imrfsd, true +} + +// InMageRcmFailbackDiscoveredProtectedVMDetails inMageRcmFailback discovered VM details. +type InMageRcmFailbackDiscoveredProtectedVMDetails struct { + // VCenterID - READ-ONLY; The VCenter Id. + VCenterID *string `json:"vCenterId,omitempty"` + // VCenterFqdn - READ-ONLY; The VCenter fqdn. + VCenterFqdn *string `json:"vCenterFqdn,omitempty"` + // Datastores - READ-ONLY; The list of datastores. + Datastores *[]string `json:"datastores,omitempty"` + // IPAddresses - READ-ONLY; The list of IP addresses. + IPAddresses *[]string `json:"ipAddresses,omitempty"` + // VmwareToolsStatus - READ-ONLY; The VMware tools status. + VmwareToolsStatus *string `json:"vmwareToolsStatus,omitempty"` + // PowerStatus - READ-ONLY; The VM power status. + PowerStatus *string `json:"powerStatus,omitempty"` + // VMFqdn - READ-ONLY; The VM fqdn. + VMFqdn *string `json:"vmFqdn,omitempty"` + // OsName - READ-ONLY; The VM's OS name. + OsName *string `json:"osName,omitempty"` + // CreatedTimestamp - READ-ONLY; The SDS created timestamp. + CreatedTimestamp *date.Time `json:"createdTimestamp,omitempty"` + // UpdatedTimestamp - READ-ONLY; The SDS updated timestamp. + UpdatedTimestamp *date.Time `json:"updatedTimestamp,omitempty"` + // IsDeleted - READ-ONLY; A value indicating whether the VM is deleted. + IsDeleted *bool `json:"isDeleted,omitempty"` + // LastDiscoveryTimeInUtc - READ-ONLY; The last time when SDS information discovered in SRS. + LastDiscoveryTimeInUtc *date.Time `json:"lastDiscoveryTimeInUtc,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackDiscoveredProtectedVMDetails. +func (imrfdpvd InMageRcmFailbackDiscoveredProtectedVMDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackEventDetails event details for InMageRcmFailback provider. +type InMageRcmFailbackEventDetails struct { + // ProtectedItemName - READ-ONLY; The protected item name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // VMName - READ-ONLY; The protected item name. + VMName *string `json:"vmName,omitempty"` + // ApplianceName - READ-ONLY; The appliance name. + ApplianceName *string `json:"applianceName,omitempty"` + // ServerType - READ-ONLY; The server type. + ServerType *string `json:"serverType,omitempty"` + // ComponentDisplayName - READ-ONLY; The component display name. + ComponentDisplayName *string `json:"componentDisplayName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) MarshalJSON() ([]byte, error) { + imrfed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfed.InstanceType != "" { + objectMap["instanceType"] = imrfed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return &imrfed, true +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imrfed, true +} + +// InMageRcmFailbackMobilityAgentDetails inMageRcmFailback mobility agent details. +type InMageRcmFailbackMobilityAgentDetails struct { + // Version - READ-ONLY; The agent version. + Version *string `json:"version,omitempty"` + // LatestVersion - READ-ONLY; The latest agent version available. + LatestVersion *string `json:"latestVersion,omitempty"` + // DriverVersion - READ-ONLY; The driver version. + DriverVersion *string `json:"driverVersion,omitempty"` + // LatestUpgradableVersionWithoutReboot - READ-ONLY; The latest upgradeable version available without reboot. + LatestUpgradableVersionWithoutReboot *string `json:"latestUpgradableVersionWithoutReboot,omitempty"` + // AgentVersionExpiryDate - READ-ONLY; The agent version expiry date. + AgentVersionExpiryDate *date.Time `json:"agentVersionExpiryDate,omitempty"` + // DriverVersionExpiryDate - READ-ONLY; The driver version expiry date. + DriverVersionExpiryDate *date.Time `json:"driverVersionExpiryDate,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The time of the last heartbeat received from the agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // ReasonsBlockingUpgrade - READ-ONLY; The whether update is possible or not. + ReasonsBlockingUpgrade *[]AgentUpgradeBlockedReason `json:"reasonsBlockingUpgrade,omitempty"` + // IsUpgradeable - READ-ONLY; A value indicating whether agent is upgradeable or not. + IsUpgradeable *string `json:"isUpgradeable,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackMobilityAgentDetails. +func (imrfmad InMageRcmFailbackMobilityAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackNicDetails inMageRcmFailback NIC details. +type InMageRcmFailbackNicDetails struct { + // MacAddress - READ-ONLY; The mac address. + MacAddress *string `json:"macAddress,omitempty"` + // NetworkName - READ-ONLY; The network name. + NetworkName *string `json:"networkName,omitempty"` + // AdapterType - READ-ONLY; The adapter type. + AdapterType *string `json:"adapterType,omitempty"` + // SourceIPAddress - READ-ONLY; The IP address. + SourceIPAddress *string `json:"sourceIpAddress,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackNicDetails. +func (imrfnd InMageRcmFailbackNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackPlannedFailoverProviderInput provider specific input for InMageRcmFailback failover. +type InMageRcmFailbackPlannedFailoverProviderInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'ApplicationConsistent', 'CrashConsistent' + RecoveryPointType InMageRcmFailbackRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) MarshalJSON() ([]byte, error) { + imrfpfpi.InstanceType = InstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpfpi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imrfpfpi.RecoveryPointType + } + if imrfpfpi.InstanceType != "" { + objectMap["instanceType"] = imrfpfpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return &imrfpfpi, true +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &imrfpfpi, true +} + +// InMageRcmFailbackPolicyCreationInput inMageRcmFailback policy creation input. +type InMageRcmFailbackPolicyCreationInput struct { + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) MarshalJSON() ([]byte, error) { + imrfpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrfpci.CrashConsistentFrequencyInMinutes + } + if imrfpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrfpci.AppConsistentFrequencyInMinutes + } + if imrfpci.InstanceType != "" { + objectMap["instanceType"] = imrfpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return &imrfpci, true +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imrfpci, true +} + +// InMageRcmFailbackPolicyDetails inMageRcm failback specific policy details. +type InMageRcmFailbackPolicyDetails struct { + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) MarshalJSON() ([]byte, error) { + imrfpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrfpd.AppConsistentFrequencyInMinutes + } + if imrfpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrfpd.CrashConsistentFrequencyInMinutes + } + if imrfpd.InstanceType != "" { + objectMap["instanceType"] = imrfpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return &imrfpd, true +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imrfpd, true +} + +// InMageRcmFailbackProtectedDiskDetails inMageRcmFailback protected disk details. +type InMageRcmFailbackProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk Id (reported by source agent). + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // DiskUUID - READ-ONLY; The disk Uuid (reported by vCenter). + DiskUUID *string `json:"diskUuid,omitempty"` + // DataPendingInLogDataStoreInMB - READ-ONLY; The data pending in log data store in MB. + DataPendingInLogDataStoreInMB *float64 `json:"dataPendingInLogDataStoreInMB,omitempty"` + // DataPendingAtSourceAgentInMB - READ-ONLY; The data pending at source agent in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // IsInitialReplicationComplete - READ-ONLY; A value indicating whether initial replication is complete or not. + IsInitialReplicationComplete *string `json:"isInitialReplicationComplete,omitempty"` + // IrDetails - The initial replication details. + IrDetails *InMageRcmFailbackSyncDetails `json:"irDetails,omitempty"` + // ResyncDetails - The resync details. + ResyncDetails *InMageRcmFailbackSyncDetails `json:"resyncDetails,omitempty"` + // LastSyncTime - READ-ONLY; The last sync time. + LastSyncTime *date.Time `json:"lastSyncTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackProtectedDiskDetails. +func (imrfpdd InMageRcmFailbackProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrfpdd.IrDetails != nil { + objectMap["irDetails"] = imrfpdd.IrDetails + } + if imrfpdd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrfpdd.ResyncDetails + } + return json.Marshal(objectMap) +} + +// InMageRcmFailbackReplicationDetails inMageRcmFailback provider specific details. +type InMageRcmFailbackReplicationDetails struct { + // InternalIdentifier - READ-ONLY; The virtual machine internal identifier. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // AzureVirtualMachineID - READ-ONLY; The ARM Id of the azure VM. + AzureVirtualMachineID *string `json:"azureVirtualMachineId,omitempty"` + // MultiVMGroupName - READ-ONLY; The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // ReprotectAgentID - READ-ONLY; The reprotect agent Id. + ReprotectAgentID *string `json:"reprotectAgentId,omitempty"` + // ReprotectAgentName - READ-ONLY; The reprotect agent name. + ReprotectAgentName *string `json:"reprotectAgentName,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // TargetvCenterID - READ-ONLY; The target vCenter Id. + TargetvCenterID *string `json:"targetvCenterId,omitempty"` + // TargetDataStoreName - READ-ONLY; The target datastore name. + TargetDataStoreName *string `json:"targetDataStoreName,omitempty"` + // TargetVMName - READ-ONLY; The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // InitialReplicationProgressPercentage - READ-ONLY; The initial replication progress percentage. + InitialReplicationProgressPercentage *int32 `json:"initialReplicationProgressPercentage,omitempty"` + // InitialReplicationProcessedBytes - READ-ONLY; The initial replication processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + InitialReplicationProcessedBytes *int64 `json:"initialReplicationProcessedBytes,omitempty"` + // InitialReplicationTransferredBytes - READ-ONLY; The initial replication transferred bytes from source VM to target for all selected disks on source VM. + InitialReplicationTransferredBytes *int64 `json:"initialReplicationTransferredBytes,omitempty"` + // InitialReplicationProgressHealth - READ-ONLY; The initial replication progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + InitialReplicationProgressHealth VMReplicationProgressHealth `json:"initialReplicationProgressHealth,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncProcessedBytes - READ-ONLY; The resync processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTransferredBytes - READ-ONLY; The resync transferred bytes from source VM to target for all selected disks on source VM. + ResyncTransferredBytes *int64 `json:"resyncTransferredBytes,omitempty"` + // ResyncProgressHealth - READ-ONLY; The resync progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + ResyncProgressHealth VMReplicationProgressHealth `json:"resyncProgressHealth,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageRcmFailbackProtectedDiskDetails `json:"protectedDisks,omitempty"` + // MobilityAgentDetails - The mobility agent information. + MobilityAgentDetails *InMageRcmFailbackMobilityAgentDetails `json:"mobilityAgentDetails,omitempty"` + // VMNics - The network details. + VMNics *[]InMageRcmFailbackNicDetails `json:"vmNics,omitempty"` + // LastPlannedFailoverStartTime - READ-ONLY; The last planned failover start time. + LastPlannedFailoverStartTime *date.Time `json:"lastPlannedFailoverStartTime,omitempty"` + // LastPlannedFailoverStatus - READ-ONLY; The last planned failover status. Possible values include: 'PlannedFailoverStatusSucceeded', 'PlannedFailoverStatusFailed', 'PlannedFailoverStatusCancelled', 'PlannedFailoverStatusUnknown' + LastPlannedFailoverStatus PlannedFailoverStatus `json:"lastPlannedFailoverStatus,omitempty"` + // DiscoveredVMDetails - The discovered VM information. + DiscoveredVMDetails *InMageRcmFailbackDiscoveredProtectedVMDetails `json:"discoveredVmDetails,omitempty"` + // LastUsedPolicyID - READ-ONLY; The policy Id used by the forward replication. + LastUsedPolicyID *string `json:"lastUsedPolicyId,omitempty"` + // LastUsedPolicyFriendlyName - READ-ONLY; The policy friendly name used by the forward replication. + LastUsedPolicyFriendlyName *string `json:"lastUsedPolicyFriendlyName,omitempty"` + // IsAgentRegistrationSuccessfulAfterFailover - READ-ONLY; A value indicating whether agent registration was successful after failover. + IsAgentRegistrationSuccessfulAfterFailover *bool `json:"isAgentRegistrationSuccessfulAfterFailover,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) MarshalJSON() ([]byte, error) { + imrfrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrfrd.ProtectedDisks + } + if imrfrd.MobilityAgentDetails != nil { + objectMap["mobilityAgentDetails"] = imrfrd.MobilityAgentDetails + } + if imrfrd.VMNics != nil { + objectMap["vmNics"] = imrfrd.VMNics + } + if imrfrd.DiscoveredVMDetails != nil { + objectMap["discoveredVmDetails"] = imrfrd.DiscoveredVMDetails + } + if imrfrd.InstanceType != "" { + objectMap["instanceType"] = imrfrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return &imrfrd, true +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrfrd, true +} + +// InMageRcmFailbackReprotectInput inMageRcmFailback specific provider input. +type InMageRcmFailbackReprotectInput struct { + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RunAsAccountID - The run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) MarshalJSON() ([]byte, error) { + imrfri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfri.ProcessServerID != nil { + objectMap["processServerId"] = imrfri.ProcessServerID + } + if imrfri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imrfri.RunAsAccountID + } + if imrfri.PolicyID != nil { + objectMap["policyId"] = imrfri.PolicyID + } + if imrfri.InstanceType != "" { + objectMap["instanceType"] = imrfri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return &imrfri, true +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imrfri, true +} + +// InMageRcmFailbackSyncDetails inMageRcmFailback disk level sync details. +type InMageRcmFailbackSyncDetails struct { + // ProgressHealth - READ-ONLY; The progress health. Possible values include: 'None', 'InProgress', 'SlowProgress', 'NoProgress', 'Queued' + ProgressHealth DiskReplicationProgressHealth `json:"progressHealth,omitempty"` + // TransferredBytes - READ-ONLY; The transferred bytes from source VM to azure for the disk. + TransferredBytes *int64 `json:"transferredBytes,omitempty"` + // Last15MinutesTransferredBytes - READ-ONLY; The bytes transferred in last 15 minutes from source VM to target. + Last15MinutesTransferredBytes *int64 `json:"last15MinutesTransferredBytes,omitempty"` + // LastDataTransferTimeUtc - READ-ONLY; The time of the last data transfer from source VM to target. + LastDataTransferTimeUtc *string `json:"lastDataTransferTimeUtc,omitempty"` + // ProcessedBytes - READ-ONLY; The total processed bytes. This includes bytes that are transferred from source VM to target and matched bytes. + ProcessedBytes *int64 `json:"processedBytes,omitempty"` + // StartTime - READ-ONLY; The start time. + StartTime *string `json:"startTime,omitempty"` + // LastRefreshTime - READ-ONLY; The last refresh time. + LastRefreshTime *string `json:"lastRefreshTime,omitempty"` + // ProgressPercentage - READ-ONLY; Progress in percentage. Progress percentage is calculated based on processed bytes. + ProgressPercentage *int32 `json:"progressPercentage,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackSyncDetails. +func (imrfsd InMageRcmFailbackSyncDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmLastAgentUpgradeErrorDetails inMageRcm last source agent upgrade error details. +type InMageRcmLastAgentUpgradeErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageRcmLastAgentUpgradeErrorDetails. +func (imrlaued InMageRcmLastAgentUpgradeErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmMobilityAgentDetails inMageRcm mobility agent details. +type InMageRcmMobilityAgentDetails struct { + // Version - READ-ONLY; The agent version. + Version *string `json:"version,omitempty"` + // LatestVersion - READ-ONLY; The latest agent version available. + LatestVersion *string `json:"latestVersion,omitempty"` + // LatestAgentReleaseDate - READ-ONLY; The latest agent version release date. + LatestAgentReleaseDate *string `json:"latestAgentReleaseDate,omitempty"` + // DriverVersion - READ-ONLY; The driver version. + DriverVersion *string `json:"driverVersion,omitempty"` + // LatestUpgradableVersionWithoutReboot - READ-ONLY; The latest upgradeable version available without reboot. + LatestUpgradableVersionWithoutReboot *string `json:"latestUpgradableVersionWithoutReboot,omitempty"` + // AgentVersionExpiryDate - READ-ONLY; The agent version expiry date. + AgentVersionExpiryDate *date.Time `json:"agentVersionExpiryDate,omitempty"` + // DriverVersionExpiryDate - READ-ONLY; The driver version expiry date. + DriverVersionExpiryDate *date.Time `json:"driverVersionExpiryDate,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The time of the last heartbeat received from the agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // ReasonsBlockingUpgrade - READ-ONLY; The whether update is possible or not. + ReasonsBlockingUpgrade *[]AgentUpgradeBlockedReason `json:"reasonsBlockingUpgrade,omitempty"` + // IsUpgradeable - READ-ONLY; A value indicating whether agent is upgradeable or not. + IsUpgradeable *string `json:"isUpgradeable,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmMobilityAgentDetails. +func (imrmad InMageRcmMobilityAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmNicDetails inMageRcm NIC details. +type InMageRcmNicDetails struct { + // NicID - READ-ONLY; The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // IsSelectedForFailover - A value indicating whether this NIC is selected for failover. + IsSelectedForFailover *string `json:"isSelectedForFailover,omitempty"` + // SourceIPAddress - READ-ONLY; The source IP address. + SourceIPAddress *string `json:"sourceIPAddress,omitempty"` + // SourceIPAddressType - READ-ONLY; The source IP address type. Possible values include: 'Dynamic', 'Static' + SourceIPAddressType EthernetAddressType `json:"sourceIPAddressType,omitempty"` + // SourceNetworkID - READ-ONLY; Source network Id. + SourceNetworkID *string `json:"sourceNetworkId,omitempty"` + // SourceSubnetName - READ-ONLY; Source subnet name. + SourceSubnetName *string `json:"sourceSubnetName,omitempty"` + // TargetIPAddress - The target IP address. + TargetIPAddress *string `json:"targetIPAddress,omitempty"` + // TargetIPAddressType - The target IP address type. Possible values include: 'Dynamic', 'Static' + TargetIPAddressType EthernetAddressType `json:"targetIPAddressType,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TestSubnetName - Test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TestIPAddress - The test IP address. + TestIPAddress *string `json:"testIPAddress,omitempty"` + // TestIPAddressType - The test IP address type. Possible values include: 'Dynamic', 'Static' + TestIPAddressType EthernetAddressType `json:"testIPAddressType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmNicDetails. +func (imrnd InMageRcmNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrnd.IsPrimaryNic != nil { + objectMap["isPrimaryNic"] = imrnd.IsPrimaryNic + } + if imrnd.IsSelectedForFailover != nil { + objectMap["isSelectedForFailover"] = imrnd.IsSelectedForFailover + } + if imrnd.TargetIPAddress != nil { + objectMap["targetIPAddress"] = imrnd.TargetIPAddress + } + if imrnd.TargetIPAddressType != "" { + objectMap["targetIPAddressType"] = imrnd.TargetIPAddressType + } + if imrnd.TargetSubnetName != nil { + objectMap["targetSubnetName"] = imrnd.TargetSubnetName + } + if imrnd.TestSubnetName != nil { + objectMap["testSubnetName"] = imrnd.TestSubnetName + } + if imrnd.TestIPAddress != nil { + objectMap["testIPAddress"] = imrnd.TestIPAddress + } + if imrnd.TestIPAddressType != "" { + objectMap["testIPAddressType"] = imrnd.TestIPAddressType + } + return json.Marshal(objectMap) +} + +// InMageRcmNicInput inMageRcm NIC input. +type InMageRcmNicInput struct { + // NicID - The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // IsSelectedForFailover - A value indicating whether this NIC is selected for failover. + IsSelectedForFailover *string `json:"isSelectedForFailover,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetStaticIPAddress - The target static IP address. + TargetStaticIPAddress *string `json:"targetStaticIPAddress,omitempty"` + // TestSubnetName - The test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TestStaticIPAddress - The test static IP address. + TestStaticIPAddress *string `json:"testStaticIPAddress,omitempty"` +} + +// InMageRcmPolicyCreationInput inMageRcm policy creation input. +type InMageRcmPolicyCreationInput struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // EnableMultiVMSync - A value indicating whether multi-VM sync has to be enabled. + EnableMultiVMSync *string `json:"enableMultiVmSync,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) MarshalJSON() ([]byte, error) { + imrpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpci.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = imrpci.RecoveryPointHistoryInMinutes + } + if imrpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrpci.CrashConsistentFrequencyInMinutes + } + if imrpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrpci.AppConsistentFrequencyInMinutes + } + if imrpci.EnableMultiVMSync != nil { + objectMap["enableMultiVmSync"] = imrpci.EnableMultiVMSync + } + if imrpci.InstanceType != "" { + objectMap["instanceType"] = imrpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return &imrpci, true +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imrpci, true +} + +// InMageRcmPolicyDetails inMageRcm specific policy details. +type InMageRcmPolicyDetails struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // EnableMultiVMSync - A value indicating whether multi-VM sync has to be enabled. + EnableMultiVMSync *string `json:"enableMultiVmSync,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) MarshalJSON() ([]byte, error) { + imrpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpd.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = imrpd.RecoveryPointHistoryInMinutes + } + if imrpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrpd.AppConsistentFrequencyInMinutes + } + if imrpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrpd.CrashConsistentFrequencyInMinutes + } + if imrpd.EnableMultiVMSync != nil { + objectMap["enableMultiVmSync"] = imrpd.EnableMultiVMSync + } + if imrpd.InstanceType != "" { + objectMap["instanceType"] = imrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return &imrpd, true +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imrpd, true +} + +// InMageRcmProtectedDiskDetails inMageRcm protected disk details. +type InMageRcmProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskEncryptionSetID - READ-ONLY; The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // SeedManagedDiskID - READ-ONLY; The ARM Id of the seed managed disk. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // TargetManagedDiskID - READ-ONLY; The ARM Id of the target managed disk. + TargetManagedDiskID *string `json:"targetManagedDiskId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DataPendingInLogDataStoreInMB - READ-ONLY; The data pending in log data store in MB. + DataPendingInLogDataStoreInMB *float64 `json:"dataPendingInLogDataStoreInMB,omitempty"` + // DataPendingAtSourceAgentInMB - READ-ONLY; The data pending at source agent in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // IsInitialReplicationComplete - READ-ONLY; A value indicating whether initial replication is complete or not. + IsInitialReplicationComplete *string `json:"isInitialReplicationComplete,omitempty"` + // IrDetails - The initial replication details. + IrDetails *InMageRcmSyncDetails `json:"irDetails,omitempty"` + // ResyncDetails - The resync details. + ResyncDetails *InMageRcmSyncDetails `json:"resyncDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmProtectedDiskDetails. +func (imrpdd InMageRcmProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrpdd.DiskType != "" { + objectMap["diskType"] = imrpdd.DiskType + } + if imrpdd.IrDetails != nil { + objectMap["irDetails"] = imrpdd.IrDetails + } + if imrpdd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrpdd.ResyncDetails + } + return json.Marshal(objectMap) +} + +// InMageRcmProtectionContainerMappingDetails inMageRcm provider specific container mapping details. +type InMageRcmProtectionContainerMappingDetails struct { + // EnableAgentAutoUpgrade - READ-ONLY; A value indicating whether the flag for enable agent auto upgrade. + EnableAgentAutoUpgrade *string `json:"enableAgentAutoUpgrade,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + imrpcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpcmd.InstanceType != "" { + objectMap["instanceType"] = imrpcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return &imrpcmd, true +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &imrpcmd, true +} + +// InMageRcmRecoveryPointDetails inMageRcm provider specific recovery point details. +type InMageRcmRecoveryPointDetails struct { + // IsMultiVMSyncPoint - READ-ONLY; A value indicating whether the recovery point is multi VM consistent. + IsMultiVMSyncPoint *string `json:"isMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) MarshalJSON() ([]byte, error) { + imrrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrrpd.InstanceType != "" { + objectMap["instanceType"] = imrrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return &imrrpd, true +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &imrrpd, true +} + +// InMageRcmReplicationDetails inMageRcm provider specific details. +type InMageRcmReplicationDetails struct { + // InternalIdentifier - READ-ONLY; The virtual machine internal identifier. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // FabricDiscoveryMachineID - READ-ONLY; The ARM Id of the discovered VM. + FabricDiscoveryMachineID *string `json:"fabricDiscoveryMachineId,omitempty"` + // MultiVMGroupName - READ-ONLY; The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DiscoveryType - READ-ONLY; The type of the discovered VM. + DiscoveryType *string `json:"discoveryType,omitempty"` + // ProcessServerID - READ-ONLY; The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // ProcessorCoreCount - READ-ONLY; The processor core count. + ProcessorCoreCount *int32 `json:"processorCoreCount,omitempty"` + // AllocatedMemoryInMB - READ-ONLY; The allocated memory in MB. + AllocatedMemoryInMB *float64 `json:"allocatedMemoryInMB,omitempty"` + // ProcessServerName - READ-ONLY; The process server name. + ProcessServerName *string `json:"processServerName,omitempty"` + // RunAsAccountID - READ-ONLY; The run-as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // FirmwareType - READ-ONLY; The firmware type. + FirmwareType *string `json:"firmwareType,omitempty"` + // PrimaryNicIPAddress - READ-ONLY; The IP address of the primary network interface. + PrimaryNicIPAddress *string `json:"primaryNicIpAddress,omitempty"` + // TargetGeneration - READ-ONLY; The target generation. + TargetGeneration *string `json:"targetGeneration,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // TargetVMName - Target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetLocation - The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // TargetAvailabilitySetID - The target availability set Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The test network Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // FailoverRecoveryPointID - READ-ONLY; The recovery point Id to which the VM was failed over. + FailoverRecoveryPointID *string `json:"failoverRecoveryPointId,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // LastRpoInSeconds - READ-ONLY; The last recovery point objective value. + LastRpoInSeconds *int64 `json:"lastRpoInSeconds,omitempty"` + // LastRpoCalculatedTime - READ-ONLY; The last recovery point objective calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastRecoveryPointID - READ-ONLY; The last recovery point Id. + LastRecoveryPointID *string `json:"lastRecoveryPointId,omitempty"` + // InitialReplicationProgressPercentage - READ-ONLY; The initial replication progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + InitialReplicationProgressPercentage *int32 `json:"initialReplicationProgressPercentage,omitempty"` + // InitialReplicationProcessedBytes - READ-ONLY; The initial replication processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + InitialReplicationProcessedBytes *int64 `json:"initialReplicationProcessedBytes,omitempty"` + // InitialReplicationTransferredBytes - READ-ONLY; The initial replication transferred bytes from source VM to azure for all selected disks on source VM. + InitialReplicationTransferredBytes *int64 `json:"initialReplicationTransferredBytes,omitempty"` + // InitialReplicationProgressHealth - READ-ONLY; The initial replication progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + InitialReplicationProgressHealth VMReplicationProgressHealth `json:"initialReplicationProgressHealth,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncProcessedBytes - READ-ONLY; The resync processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTransferredBytes - READ-ONLY; The resync transferred bytes from source VM to azure for all selected disks on source VM. + ResyncTransferredBytes *int64 `json:"resyncTransferredBytes,omitempty"` + // ResyncProgressHealth - READ-ONLY; The resync progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + ResyncProgressHealth VMReplicationProgressHealth `json:"resyncProgressHealth,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // AgentUpgradeState - READ-ONLY; The agent auto upgrade state. Possible values include: 'MobilityAgentUpgradeStateNone', 'MobilityAgentUpgradeStateStarted', 'MobilityAgentUpgradeStateCompleted', 'MobilityAgentUpgradeStateCommit' + AgentUpgradeState MobilityAgentUpgradeState `json:"agentUpgradeState,omitempty"` + // LastAgentUpgradeType - READ-ONLY; The last agent upgrade type. + LastAgentUpgradeType *string `json:"lastAgentUpgradeType,omitempty"` + // AgentUpgradeJobID - READ-ONLY; The agent upgrade job Id. + AgentUpgradeJobID *string `json:"agentUpgradeJobId,omitempty"` + // AgentUpgradeAttemptToVersion - READ-ONLY; The agent version to which last agent upgrade was attempted. + AgentUpgradeAttemptToVersion *string `json:"agentUpgradeAttemptToVersion,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageRcmProtectedDiskDetails `json:"protectedDisks,omitempty"` + // IsLastUpgradeSuccessful - READ-ONLY; A value indicating whether last agent upgrade was successful or not. + IsLastUpgradeSuccessful *string `json:"isLastUpgradeSuccessful,omitempty"` + // IsAgentRegistrationSuccessfulAfterFailover - READ-ONLY; A value indicating whether agent registration was successful after failover. + IsAgentRegistrationSuccessfulAfterFailover *bool `json:"isAgentRegistrationSuccessfulAfterFailover,omitempty"` + // MobilityAgentDetails - The mobility agent information. + MobilityAgentDetails *InMageRcmMobilityAgentDetails `json:"mobilityAgentDetails,omitempty"` + // LastAgentUpgradeErrorDetails - The last agent upgrade error information. + LastAgentUpgradeErrorDetails *[]InMageRcmLastAgentUpgradeErrorDetails `json:"lastAgentUpgradeErrorDetails,omitempty"` + // AgentUpgradeBlockingErrorDetails - The agent upgrade blocking error information. + AgentUpgradeBlockingErrorDetails *[]InMageRcmAgentUpgradeBlockingErrorDetails `json:"agentUpgradeBlockingErrorDetails,omitempty"` + // VMNics - The network details. + VMNics *[]InMageRcmNicDetails `json:"vmNics,omitempty"` + // DiscoveredVMDetails - The discovered VM details. + DiscoveredVMDetails *InMageRcmDiscoveredProtectedVMDetails `json:"discoveredVmDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) MarshalJSON() ([]byte, error) { + imrrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrrd.LicenseType != nil { + objectMap["licenseType"] = imrrd.LicenseType + } + if imrrd.TargetVMName != nil { + objectMap["targetVmName"] = imrrd.TargetVMName + } + if imrrd.TargetVMSize != nil { + objectMap["targetVmSize"] = imrrd.TargetVMSize + } + if imrrd.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrrd.TargetResourceGroupID + } + if imrrd.TargetLocation != nil { + objectMap["targetLocation"] = imrrd.TargetLocation + } + if imrrd.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrrd.TargetAvailabilitySetID + } + if imrrd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrrd.TargetAvailabilityZone + } + if imrrd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrrd.TargetProximityPlacementGroupID + } + if imrrd.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrrd.TargetBootDiagnosticsStorageAccountID + } + if imrrd.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrrd.TargetNetworkID + } + if imrrd.TestNetworkID != nil { + objectMap["testNetworkId"] = imrrd.TestNetworkID + } + if imrrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrrd.ProtectedDisks + } + if imrrd.MobilityAgentDetails != nil { + objectMap["mobilityAgentDetails"] = imrrd.MobilityAgentDetails + } + if imrrd.LastAgentUpgradeErrorDetails != nil { + objectMap["lastAgentUpgradeErrorDetails"] = imrrd.LastAgentUpgradeErrorDetails + } + if imrrd.AgentUpgradeBlockingErrorDetails != nil { + objectMap["agentUpgradeBlockingErrorDetails"] = imrrd.AgentUpgradeBlockingErrorDetails + } + if imrrd.VMNics != nil { + objectMap["vmNics"] = imrrd.VMNics + } + if imrrd.DiscoveredVMDetails != nil { + objectMap["discoveredVmDetails"] = imrrd.DiscoveredVMDetails + } + if imrrd.InstanceType != "" { + objectMap["instanceType"] = imrrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return &imrrd, true +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrrd, true +} + +// InMageRcmReprotectInput inMageRcm specific provider input. +type InMageRcmReprotectInput struct { + // ReprotectAgentID - The reprotect agent Id. + ReprotectAgentID *string `json:"reprotectAgentId,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) MarshalJSON() ([]byte, error) { + imrri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrri.ReprotectAgentID != nil { + objectMap["reprotectAgentId"] = imrri.ReprotectAgentID + } + if imrri.DatastoreName != nil { + objectMap["datastoreName"] = imrri.DatastoreName + } + if imrri.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imrri.LogStorageAccountID + } + if imrri.PolicyID != nil { + objectMap["policyId"] = imrri.PolicyID + } + if imrri.InstanceType != "" { + objectMap["instanceType"] = imrri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return &imrri, true +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imrri, true +} + +// InMageRcmSyncDetails inMageRcm disk level sync details. +type InMageRcmSyncDetails struct { + // ProgressHealth - READ-ONLY; The progress health. Possible values include: 'None', 'InProgress', 'SlowProgress', 'NoProgress', 'Queued' + ProgressHealth DiskReplicationProgressHealth `json:"progressHealth,omitempty"` + // TransferredBytes - READ-ONLY; The transferred bytes from source VM to azure for the disk. + TransferredBytes *int64 `json:"transferredBytes,omitempty"` + // Last15MinutesTransferredBytes - READ-ONLY; The bytes transferred in last 15 minutes from source VM to azure. + Last15MinutesTransferredBytes *int64 `json:"last15MinutesTransferredBytes,omitempty"` + // LastDataTransferTimeUtc - READ-ONLY; The time of the last data transfer from source VM to azure. + LastDataTransferTimeUtc *string `json:"lastDataTransferTimeUtc,omitempty"` + // ProcessedBytes - READ-ONLY; The total processed bytes. This includes bytes that are transferred from source VM to azure and matched bytes. + ProcessedBytes *int64 `json:"processedBytes,omitempty"` + // StartTime - READ-ONLY; The start time. + StartTime *string `json:"startTime,omitempty"` + // LastRefreshTime - READ-ONLY; The last refresh time. + LastRefreshTime *string `json:"lastRefreshTime,omitempty"` + // ProgressPercentage - READ-ONLY; Progress in percentage. Progress percentage is calculated based on processed bytes. + ProgressPercentage *int32 `json:"progressPercentage,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmSyncDetails. +func (imrsd InMageRcmSyncDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmTestFailoverInput inMageRcm provider specific input for test failover. +type InMageRcmTestFailoverInput struct { + // NetworkID - The test network Id. + NetworkID *string `json:"networkId,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) MarshalJSON() ([]byte, error) { + imrtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrtfi.NetworkID != nil { + objectMap["networkId"] = imrtfi.NetworkID + } + if imrtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrtfi.RecoveryPointID + } + if imrtfi.InstanceType != "" { + objectMap["instanceType"] = imrtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return &imrtfi, true +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imrtfi, true +} + +// InMageRcmUnplannedFailoverInput inMageRcm provider specific input for unplanned failover. +type InMageRcmUnplannedFailoverInput struct { + // PerformShutdown - A value indicating whether VM is to be shutdown. + PerformShutdown *string `json:"performShutdown,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imrufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrufi.PerformShutdown != nil { + objectMap["performShutdown"] = imrufi.PerformShutdown + } + if imrufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrufi.RecoveryPointID + } + if imrufi.InstanceType != "" { + objectMap["instanceType"] = imrufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return &imrufi, true +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imrufi, true +} + +// InMageRcmUpdateApplianceForReplicationProtectedItemInput inMageRcm provider specific input to update +// appliance for replication protected item. +type InMageRcmUpdateApplianceForReplicationProtectedItemInput struct { + // RunAsAccountID - The run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput', 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imruafrpii.InstanceType = InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imruafrpii.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imruafrpii.RunAsAccountID + } + if imruafrpii.InstanceType != "" { + objectMap["instanceType"] = imruafrpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageRcmUpdateApplianceForReplicationProtectedItemInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) AsInMageRcmUpdateApplianceForReplicationProtectedItemInput() (*InMageRcmUpdateApplianceForReplicationProtectedItemInput, bool) { + return &imruafrpii, true +} + +// AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (*UpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return &imruafrpii, true +} + +// InMageRcmUpdateContainerMappingInput inMageRcm update protection container mapping. +type InMageRcmUpdateContainerMappingInput struct { + // EnableAgentAutoUpgrade - A value indicating whether agent auto upgrade has to be enabled. + EnableAgentAutoUpgrade *string `json:"enableAgentAutoUpgrade,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + imrucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrucmi.EnableAgentAutoUpgrade != nil { + objectMap["enableAgentAutoUpgrade"] = imrucmi.EnableAgentAutoUpgrade + } + if imrucmi.InstanceType != "" { + objectMap["instanceType"] = imrucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return &imrucmi, true +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &imrucmi, true +} + +// InMageRcmUpdateReplicationProtectedItemInput inMageRcm provider specific input to update replication +// protected item. +type InMageRcmUpdateReplicationProtectedItemInput struct { + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The test network ARM Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // VMNics - The list of NIC details. + VMNics *[]InMageRcmNicInput `json:"vmNics,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imrurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrurpii.TargetVMName != nil { + objectMap["targetVmName"] = imrurpii.TargetVMName + } + if imrurpii.TargetVMSize != nil { + objectMap["targetVmSize"] = imrurpii.TargetVMSize + } + if imrurpii.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrurpii.TargetResourceGroupID + } + if imrurpii.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrurpii.TargetAvailabilitySetID + } + if imrurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrurpii.TargetAvailabilityZone + } + if imrurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrurpii.TargetProximityPlacementGroupID + } + if imrurpii.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrurpii.TargetBootDiagnosticsStorageAccountID + } + if imrurpii.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrurpii.TargetNetworkID + } + if imrurpii.TestNetworkID != nil { + objectMap["testNetworkId"] = imrurpii.TestNetworkID + } + if imrurpii.VMNics != nil { + objectMap["vmNics"] = imrurpii.VMNics + } + if imrurpii.LicenseType != "" { + objectMap["licenseType"] = imrurpii.LicenseType + } + if imrurpii.InstanceType != "" { + objectMap["instanceType"] = imrurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return &imrurpii, true +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &imrurpii, true +} + +// InMageReplicationDetails inMage provider specific settings. +type InMageReplicationDetails struct { + // ActiveSiteType - The active location of the VM. If the VM is being protected from Azure, this field will take values from { Azure, OnPrem }. If the VM is being protected between two data-centers, this field will be OnPrem always. + ActiveSiteType *string `json:"activeSiteType,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // OsDetails - The OS details. + OsDetails *OSDiskDetails `json:"osDetails,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // ResyncDetails - The resync details of the machine. + ResyncDetails *InitialReplicationDetails `json:"resyncDetails,omitempty"` + // RetentionWindowStart - The retention window start time. + RetentionWindowStart *date.Time `json:"retentionWindowStart,omitempty"` + // RetentionWindowEnd - The retention window end time. + RetentionWindowEnd *date.Time `json:"retentionWindowEnd,omitempty"` + // CompressedDataRateInMB - The compressed data change rate in MB. + CompressedDataRateInMB *float64 `json:"compressedDataRateInMB,omitempty"` + // UncompressedDataRateInMB - The uncompressed data change rate in MB. + UncompressedDataRateInMB *float64 `json:"uncompressedDataRateInMB,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageProtectedDiskDetails `json:"protectedDisks,omitempty"` + // IPAddress - The source IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // MasterTargetID - The master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ConsistencyPoints - The collection of Consistency points. + ConsistencyPoints map[string]*date.Time `json:"consistencyPoints"` + // DiskResized - A value indicating whether any disk is resized for this VM. + DiskResized *string `json:"diskResized,omitempty"` + // RebootAfterUpdateStatus - A value indicating whether the source server requires a restart after update. + RebootAfterUpdateStatus *string `json:"rebootAfterUpdateStatus,omitempty"` + // MultiVMGroupID - The multi vm group Id, if any. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name, if any. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMSyncStatus - A value indicating whether the multi vm sync is enabled or disabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // AgentDetails - The agent details. + AgentDetails *InMageAgentDetails `json:"agentDetails,omitempty"` + // VCenterInfrastructureID - The vCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // InfrastructureVMID - The infrastructure VM Id. + InfrastructureVMID *string `json:"infrastructureVmId,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. + DiscoveryType *string `json:"discoveryType,omitempty"` + // AzureStorageAccountID - A value indicating the underlying Azure storage account. If the VM is not running in Azure, this value shall be set to null. + AzureStorageAccountID *string `json:"azureStorageAccountId,omitempty"` + // Datastores - The datastores of the on-premise machine Value can be list of strings that contain datastore names. + Datastores *[]string `json:"datastores,omitempty"` + // ValidationErrors - The validation errors of the on-premise machine Value can be list of validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastUpdateReceivedTime - The last update time received from on-prem components. + LastUpdateReceivedTime *date.Time `json:"lastUpdateReceivedTime,omitempty"` + // ReplicaID - The replica id of the protected item. + ReplicaID *string `json:"replicaId,omitempty"` + // OsVersion - The OS Version of the protected item. + OsVersion *string `json:"osVersion,omitempty"` + // IsAdditionalStatsAvailable - A value indicating whether additional IR stats are available or not. + IsAdditionalStatsAvailable *bool `json:"isAdditionalStatsAvailable,omitempty"` + // TotalDataTransferred - The total transferred data in bytes. + TotalDataTransferred *int64 `json:"totalDataTransferred,omitempty"` + // TotalProgressHealth - The progress health. + TotalProgressHealth *string `json:"totalProgressHealth,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageReplicationDetails. +func (imrd InMageReplicationDetails) MarshalJSON() ([]byte, error) { + imrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imrd.ActiveSiteType != nil { + objectMap["activeSiteType"] = imrd.ActiveSiteType + } + if imrd.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = imrd.SourceVMCPUCount + } + if imrd.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = imrd.SourceVMRAMSizeInMB + } + if imrd.OsDetails != nil { + objectMap["osDetails"] = imrd.OsDetails + } + if imrd.ProtectionStage != nil { + objectMap["protectionStage"] = imrd.ProtectionStage + } + if imrd.VMID != nil { + objectMap["vmId"] = imrd.VMID + } + if imrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = imrd.VMProtectionState + } + if imrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = imrd.VMProtectionStateDescription + } + if imrd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrd.ResyncDetails + } + if imrd.RetentionWindowStart != nil { + objectMap["retentionWindowStart"] = imrd.RetentionWindowStart + } + if imrd.RetentionWindowEnd != nil { + objectMap["retentionWindowEnd"] = imrd.RetentionWindowEnd + } + if imrd.CompressedDataRateInMB != nil { + objectMap["compressedDataRateInMB"] = imrd.CompressedDataRateInMB + } + if imrd.UncompressedDataRateInMB != nil { + objectMap["uncompressedDataRateInMB"] = imrd.UncompressedDataRateInMB + } + if imrd.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = imrd.RpoInSeconds + } + if imrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrd.ProtectedDisks + } + if imrd.IPAddress != nil { + objectMap["ipAddress"] = imrd.IPAddress + } + if imrd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = imrd.LastHeartbeat + } + if imrd.ProcessServerID != nil { + objectMap["processServerId"] = imrd.ProcessServerID + } + if imrd.MasterTargetID != nil { + objectMap["masterTargetId"] = imrd.MasterTargetID + } + if imrd.ConsistencyPoints != nil { + objectMap["consistencyPoints"] = imrd.ConsistencyPoints + } + if imrd.DiskResized != nil { + objectMap["diskResized"] = imrd.DiskResized + } + if imrd.RebootAfterUpdateStatus != nil { + objectMap["rebootAfterUpdateStatus"] = imrd.RebootAfterUpdateStatus + } + if imrd.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imrd.MultiVMGroupID + } + if imrd.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imrd.MultiVMGroupName + } + if imrd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imrd.MultiVMSyncStatus + } + if imrd.AgentDetails != nil { + objectMap["agentDetails"] = imrd.AgentDetails + } + if imrd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = imrd.VCenterInfrastructureID + } + if imrd.InfrastructureVMID != nil { + objectMap["infrastructureVmId"] = imrd.InfrastructureVMID + } + if imrd.VMNics != nil { + objectMap["vmNics"] = imrd.VMNics + } + if imrd.DiscoveryType != nil { + objectMap["discoveryType"] = imrd.DiscoveryType + } + if imrd.AzureStorageAccountID != nil { + objectMap["azureStorageAccountId"] = imrd.AzureStorageAccountID + } + if imrd.Datastores != nil { + objectMap["datastores"] = imrd.Datastores + } + if imrd.ValidationErrors != nil { + objectMap["validationErrors"] = imrd.ValidationErrors + } + if imrd.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = imrd.LastRpoCalculatedTime + } + if imrd.LastUpdateReceivedTime != nil { + objectMap["lastUpdateReceivedTime"] = imrd.LastUpdateReceivedTime + } + if imrd.ReplicaID != nil { + objectMap["replicaId"] = imrd.ReplicaID + } + if imrd.OsVersion != nil { + objectMap["osVersion"] = imrd.OsVersion + } + if imrd.IsAdditionalStatsAvailable != nil { + objectMap["isAdditionalStatsAvailable"] = imrd.IsAdditionalStatsAvailable + } + if imrd.TotalDataTransferred != nil { + objectMap["totalDataTransferred"] = imrd.TotalDataTransferred + } + if imrd.TotalProgressHealth != nil { + objectMap["totalProgressHealth"] = imrd.TotalProgressHealth + } + if imrd.InstanceType != "" { + objectMap["instanceType"] = imrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return &imrd, true +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrd, true +} + +// InMageReprotectInput inMageAzureV2 specific provider input. +type InMageReprotectInput struct { + // MasterTargetID - The Master Target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RetentionDrive - The retention drive to use on the MT. + RetentionDrive *string `json:"retentionDrive,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // DiskExclusionInput - The enable disk exclusion input. + DiskExclusionInput *InMageDiskExclusionInput `json:"diskExclusionInput,omitempty"` + // ProfileID - The Policy Id. + ProfileID *string `json:"profileId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageReprotectInput. +func (imri InMageReprotectInput) MarshalJSON() ([]byte, error) { + imri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imri.MasterTargetID != nil { + objectMap["masterTargetId"] = imri.MasterTargetID + } + if imri.ProcessServerID != nil { + objectMap["processServerId"] = imri.ProcessServerID + } + if imri.RetentionDrive != nil { + objectMap["retentionDrive"] = imri.RetentionDrive + } + if imri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imri.RunAsAccountID + } + if imri.DatastoreName != nil { + objectMap["datastoreName"] = imri.DatastoreName + } + if imri.DiskExclusionInput != nil { + objectMap["diskExclusionInput"] = imri.DiskExclusionInput + } + if imri.ProfileID != nil { + objectMap["profileId"] = imri.ProfileID + } + if imri.DisksToInclude != nil { + objectMap["disksToInclude"] = imri.DisksToInclude + } + if imri.InstanceType != "" { + objectMap["instanceType"] = imri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return &imri, true +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imri, true +} + +// InMageTestFailoverInput provider specific input for InMage test failover. +type InMageTestFailoverInput struct { + // RecoveryPointType - The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. Possible values include: 'LatestTime', 'LatestTag', 'Custom' + RecoveryPointType RecoveryPointType `json:"recoveryPointType,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) MarshalJSON() ([]byte, error) { + imtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imtfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imtfi.RecoveryPointType + } + if imtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imtfi.RecoveryPointID + } + if imtfi.InstanceType != "" { + objectMap["instanceType"] = imtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return &imtfi, true +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imtfi, true +} + +// InMageUnplannedFailoverInput provider specific input for InMage unplanned failover. +type InMageUnplannedFailoverInput struct { + // RecoveryPointType - The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. Possible values include: 'LatestTime', 'LatestTag', 'Custom' + RecoveryPointType RecoveryPointType `json:"recoveryPointType,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imufi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imufi.RecoveryPointType + } + if imufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imufi.RecoveryPointID + } + if imufi.InstanceType != "" { + objectMap["instanceType"] = imufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return &imufi, true +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imufi, true +} + +// InMageVolumeExclusionOptions guest disk signature based disk exclusion option when doing enable +// protection of virtual machine in InMage provider. +type InMageVolumeExclusionOptions struct { + // VolumeLabel - The volume label. The disk having any volume with this label will be excluded from replication. + VolumeLabel *string `json:"volumeLabel,omitempty"` + // OnlyExcludeIfSingleVolume - The value indicating whether to exclude multi volume disk or not. If a disk has multiple volumes and one of the volume has label matching with VolumeLabel this disk will be excluded from replication if OnlyExcludeIfSingleVolume is false. + OnlyExcludeIfSingleVolume *string `json:"onlyExcludeIfSingleVolume,omitempty"` +} + +// InnerHealthError implements InnerHealthError class. HealthError object has a list of InnerHealthErrors +// as child errors. InnerHealthError is used because this will prevent an infinite loop of structures when +// Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health +// errors and all API consumers can utilize this in the same fashion as Exception -> InnerException. +type InnerHealthError struct { + // ErrorSource - Source of error. + ErrorSource *string `json:"errorSource,omitempty"` + // ErrorType - Type of error. + ErrorType *string `json:"errorType,omitempty"` + // ErrorLevel - Level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // ErrorCategory - Category of error. + ErrorCategory *string `json:"errorCategory,omitempty"` + // ErrorCode - Error code. + ErrorCode *string `json:"errorCode,omitempty"` + // SummaryMessage - Summary message of the entity. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // ErrorMessage - Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // CreationTimeUtc - Error creation time (UTC). + CreationTimeUtc *date.Time `json:"creationTimeUtc,omitempty"` + // RecoveryProviderErrorMessage - DRA error message. + RecoveryProviderErrorMessage *string `json:"recoveryProviderErrorMessage,omitempty"` + // EntityID - ID of the entity. + EntityID *string `json:"entityId,omitempty"` + // ErrorID - The health error unique id. + ErrorID *string `json:"errorId,omitempty"` + // CustomerResolvability - Value indicating whether the health error is customer resolvable. Possible values include: 'Allowed', 'NotAllowed' + CustomerResolvability HealthErrorCustomerResolvability `json:"customerResolvability,omitempty"` +} + +// InputEndpoint ... +type InputEndpoint struct { + EndpointName *string `json:"endpointName,omitempty"` + PrivatePort *int32 `json:"privatePort,omitempty"` + PublicPort *int32 `json:"publicPort,omitempty"` + Protocol *string `json:"protocol,omitempty"` +} + +// IPConfigDetails ... +type IPConfigDetails struct { + Name *string `json:"name,omitempty"` + IsPrimary *bool `json:"isPrimary,omitempty"` + SubnetName *string `json:"subnetName,omitempty"` + StaticIPAddress *string `json:"staticIPAddress,omitempty"` + IPAddressType *string `json:"ipAddressType,omitempty"` + IsSeletedForFailover *bool `json:"isSeletedForFailover,omitempty"` + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + RecoveryStaticIPAddress *string `json:"recoveryStaticIPAddress,omitempty"` + RecoveryIPAddressType *string `json:"recoveryIPAddressType,omitempty"` + RecoveryPublicIPAddressID *string `json:"recoveryPublicIPAddressId,omitempty"` + RecoveryLBBackendAddressPoolIds *[]string `json:"recoveryLBBackendAddressPoolIds,omitempty"` + TfoSubnetName *string `json:"tfoSubnetName,omitempty"` + TfoStaticIPAddress *string `json:"tfoStaticIPAddress,omitempty"` + TfoPublicIPAddressID *string `json:"tfoPublicIPAddressId,omitempty"` + TfoLBBackendAddressPoolIds *[]string `json:"tfoLBBackendAddressPoolIds,omitempty"` +} + +// IPConfigInputDetails ... +type IPConfigInputDetails struct { + IPConfigName *string `json:"ipConfigName,omitempty"` + IsPrimary *bool `json:"isPrimary,omitempty"` + IsSeletedForFailover *bool `json:"isSeletedForFailover,omitempty"` + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + RecoveryStaticIPAddress *string `json:"recoveryStaticIPAddress,omitempty"` + RecoveryPublicIPAddressID *string `json:"recoveryPublicIPAddressId,omitempty"` + RecoveryLBBackendAddressPoolIds *[]string `json:"recoveryLBBackendAddressPoolIds,omitempty"` + TfoSubnetName *string `json:"tfoSubnetName,omitempty"` + TfoStaticIPAddress *string `json:"tfoStaticIPAddress,omitempty"` + TfoPublicIPAddressID *string `json:"tfoPublicIPAddressId,omitempty"` + TfoLBBackendAddressPoolIds *[]string `json:"tfoLBBackendAddressPoolIds,omitempty"` +} + +// Job job details. +type Job struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *JobProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if j.Properties != nil { + objectMap["properties"] = j.Properties + } + if j.Location != nil { + objectMap["location"] = j.Location + } + return json.Marshal(objectMap) +} + +// JobCollection collection of jobs. +type JobCollection struct { + autorest.Response `json:"-"` + // Value - The list of jobs. + Value *[]Job `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// JobCollectionIterator provides access to a complete listing of Job values. +type JobCollectionIterator struct { + i int + page JobCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *JobCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *JobCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter JobCollectionIterator) Response() JobCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter JobCollectionIterator) Value() Job { + if !iter.page.NotDone() { + return Job{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the JobCollectionIterator type. +func NewJobCollectionIterator(page JobCollectionPage) JobCollectionIterator { + return JobCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (jc JobCollection) IsEmpty() bool { + return jc.Value == nil || len(*jc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (jc JobCollection) hasNextLink() bool { + return jc.NextLink != nil && len(*jc.NextLink) != 0 +} + +// jobCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jc JobCollection) jobCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !jc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jc.NextLink))) +} + +// JobCollectionPage contains a page of Job values. +type JobCollectionPage struct { + fn func(context.Context, JobCollection) (JobCollection, error) + jc JobCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *JobCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.jc) + if err != nil { + return err + } + page.jc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *JobCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobCollectionPage) NotDone() bool { + return !page.jc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobCollectionPage) Response() JobCollection { + return page.jc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobCollectionPage) Values() []Job { + if page.jc.IsEmpty() { + return nil + } + return *page.jc.Value +} + +// Creates a new instance of the JobCollectionPage type. +func NewJobCollectionPage(cur JobCollection, getNextPage func(context.Context, JobCollection) (JobCollection, error)) JobCollectionPage { + return JobCollectionPage{ + fn: getNextPage, + jc: cur, + } +} + +// BasicJobDetails job details based on specific job type. +type BasicJobDetails interface { + AsAsrJobDetails() (*AsrJobDetails, bool) + AsExportJobDetails() (*ExportJobDetails, bool) + AsFailoverJobDetails() (*FailoverJobDetails, bool) + AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) + AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) + AsJobDetails() (*JobDetails, bool) +} + +// JobDetails job details based on specific job type. +type JobDetails struct { + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicJobDetails(body []byte) (BasicJobDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAsrJobDetails): + var ajd AsrJobDetails + err := json.Unmarshal(body, &ajd) + return ajd, err + case string(InstanceTypeExportJobDetails): + var ejd ExportJobDetails + err := json.Unmarshal(body, &ejd) + return ejd, err + case string(InstanceTypeFailoverJobDetails): + var fjd FailoverJobDetails + err := json.Unmarshal(body, &fjd) + return fjd, err + case string(InstanceTypeSwitchProtectionJobDetails): + var spjd SwitchProtectionJobDetails + err := json.Unmarshal(body, &spjd) + return spjd, err + case string(InstanceTypeTestFailoverJobDetails): + var tfjd TestFailoverJobDetails + err := json.Unmarshal(body, &tfjd) + return tfjd, err + default: + var jd JobDetails + err := json.Unmarshal(body, &jd) + return jd, err + } +} +func unmarshalBasicJobDetailsArray(body []byte) ([]BasicJobDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jdArray := make([]BasicJobDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + jd, err := unmarshalBasicJobDetails(*rawMessage) + if err != nil { + return nil, err + } + jdArray[index] = jd + } + return jdArray, nil +} + +// MarshalJSON is the custom marshaler for JobDetails. +func (jd JobDetails) MarshalJSON() ([]byte, error) { + jd.InstanceType = InstanceTypeJobDetails + objectMap := make(map[string]interface{}) + if jd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = jd.AffectedObjectDetails + } + if jd.InstanceType != "" { + objectMap["instanceType"] = jd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsJobDetails() (*JobDetails, bool) { + return &jd, true +} + +// AsBasicJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &jd, true +} + +// JobEntity this class contains the minimal job details required to navigate to the desired drill down. +type JobEntity struct { + // JobID - The job id. + JobID *string `json:"jobId,omitempty"` + // JobFriendlyName - The job display name. + JobFriendlyName *string `json:"jobFriendlyName,omitempty"` + // TargetObjectID - The object id. + TargetObjectID *string `json:"targetObjectId,omitempty"` + // TargetObjectName - The object name. + TargetObjectName *string `json:"targetObjectName,omitempty"` + // TargetInstanceType - The workflow affected object type. + TargetInstanceType *string `json:"targetInstanceType,omitempty"` + // JobScenarioName - The job name. Enum type ScenarioName. + JobScenarioName *string `json:"jobScenarioName,omitempty"` +} + +// JobErrorDetails this class contains the error details per object. +type JobErrorDetails struct { + // ServiceErrorDetails - The Service error details. + ServiceErrorDetails *ServiceError `json:"serviceErrorDetails,omitempty"` + // ProviderErrorDetails - The Provider error details. + ProviderErrorDetails *ProviderError `json:"providerErrorDetails,omitempty"` + // ErrorLevel - Error level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // CreationTime - The creation time of job error. + CreationTime *date.Time `json:"creationTime,omitempty"` + // TaskID - The Id of the task. + TaskID *string `json:"taskId,omitempty"` +} + +// JobProperties job custom data details. +type JobProperties struct { + // ActivityID - The activity id. + ActivityID *string `json:"activityId,omitempty"` + // ScenarioName - The ScenarioName. + ScenarioName *string `json:"scenarioName,omitempty"` + // FriendlyName - The DisplayName. + FriendlyName *string `json:"friendlyName,omitempty"` + // State - The status of the Job. It is one of these values - NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or Other. + State *string `json:"state,omitempty"` + // StateDescription - The description of the state of the Job. For e.g. - For Succeeded state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. + StateDescription *string `json:"stateDescription,omitempty"` + // Tasks - The tasks. + Tasks *[]ASRTask `json:"tasks,omitempty"` + // Errors - The errors. + Errors *[]JobErrorDetails `json:"errors,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // AllowedActions - The Allowed action the job. + AllowedActions *[]string `json:"allowedActions,omitempty"` + // TargetObjectID - The affected Object Id. + TargetObjectID *string `json:"targetObjectId,omitempty"` + // TargetObjectName - The name of the affected object. + TargetObjectName *string `json:"targetObjectName,omitempty"` + // TargetInstanceType - The type of the affected object which is of Microsoft.Azure.SiteRecovery.V2015_11_10.AffectedObjectType class. + TargetInstanceType *string `json:"targetInstanceType,omitempty"` + // CustomDetails - The custom job details like test failover job details. + CustomDetails BasicJobDetails `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for JobProperties struct. +func (jp *JobProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "activityId": + if v != nil { + var activityID string + err = json.Unmarshal(*v, &activityID) + if err != nil { + return err + } + jp.ActivityID = &activityID + } + case "scenarioName": + if v != nil { + var scenarioName string + err = json.Unmarshal(*v, &scenarioName) + if err != nil { + return err + } + jp.ScenarioName = &scenarioName + } + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + jp.FriendlyName = &friendlyName + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + jp.State = &state + } + case "stateDescription": + if v != nil { + var stateDescription string + err = json.Unmarshal(*v, &stateDescription) + if err != nil { + return err + } + jp.StateDescription = &stateDescription + } + case "tasks": + if v != nil { + var tasks []ASRTask + err = json.Unmarshal(*v, &tasks) + if err != nil { + return err + } + jp.Tasks = &tasks + } + case "errors": + if v != nil { + var errorsVar []JobErrorDetails + err = json.Unmarshal(*v, &errorsVar) + if err != nil { + return err + } + jp.Errors = &errorsVar + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + jp.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + jp.EndTime = &endTime + } + case "allowedActions": + if v != nil { + var allowedActions []string + err = json.Unmarshal(*v, &allowedActions) + if err != nil { + return err + } + jp.AllowedActions = &allowedActions + } + case "targetObjectId": + if v != nil { + var targetObjectID string + err = json.Unmarshal(*v, &targetObjectID) + if err != nil { + return err + } + jp.TargetObjectID = &targetObjectID + } + case "targetObjectName": + if v != nil { + var targetObjectName string + err = json.Unmarshal(*v, &targetObjectName) + if err != nil { + return err + } + jp.TargetObjectName = &targetObjectName + } + case "targetInstanceType": + if v != nil { + var targetInstanceType string + err = json.Unmarshal(*v, &targetInstanceType) + if err != nil { + return err + } + jp.TargetInstanceType = &targetInstanceType + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicJobDetails(*v) + if err != nil { + return err + } + jp.CustomDetails = customDetails + } + } + } + + return nil +} + +// JobQueryParameter query parameter to enumerate jobs. +type JobQueryParameter struct { + // StartTime - Date time to get jobs from. + StartTime *string `json:"startTime,omitempty"` + // EndTime - Date time to get jobs upto. + EndTime *string `json:"endTime,omitempty"` + // FabricID - The Id of the fabric to search jobs under. + FabricID *string `json:"fabricId,omitempty"` + // AffectedObjectTypes - The type of objects. + AffectedObjectTypes *string `json:"affectedObjectTypes,omitempty"` + // JobStatus - The states of the job to be filtered can be in. + JobStatus *string `json:"jobStatus,omitempty"` + // JobOutputType - The output type of the jobs. Possible values include: 'JSON', 'XML', 'Excel' + JobOutputType ExportJobOutputSerializationType `json:"jobOutputType,omitempty"` + // JobName - The job Name. + JobName *string `json:"jobName,omitempty"` + // TimezoneOffset - The timezone offset for the location of the request (in minutes). + TimezoneOffset *float64 `json:"timezoneOffset,omitempty"` +} + +// JobStatusEventDetails model class for event details of a job status event. +type JobStatusEventDetails struct { + // JobID - Job arm id for the event. + JobID *string `json:"jobId,omitempty"` + // JobFriendlyName - JobName for the Event. + JobFriendlyName *string `json:"jobFriendlyName,omitempty"` + // JobStatus - JobStatus for the Event. + JobStatus *string `json:"jobStatus,omitempty"` + // AffectedObjectType - AffectedObjectType for the event. + AffectedObjectType *string `json:"affectedObjectType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeEventSpecificDetails', 'InstanceTypeJobStatus' + InstanceType InstanceTypeBasicEventSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobStatusEventDetails. +func (jsed JobStatusEventDetails) MarshalJSON() ([]byte, error) { + jsed.InstanceType = InstanceTypeJobStatus + objectMap := make(map[string]interface{}) + if jsed.JobID != nil { + objectMap["jobId"] = jsed.JobID + } + if jsed.JobFriendlyName != nil { + objectMap["jobFriendlyName"] = jsed.JobFriendlyName + } + if jsed.JobStatus != nil { + objectMap["jobStatus"] = jsed.JobStatus + } + if jsed.AffectedObjectType != nil { + objectMap["affectedObjectType"] = jsed.AffectedObjectType + } + if jsed.InstanceType != "" { + objectMap["instanceType"] = jsed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsJobStatusEventDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsJobStatusEventDetails() (*JobStatusEventDetails, bool) { + return &jsed, true +} + +// AsEventSpecificDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsEventSpecificDetails() (*EventSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventSpecificDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsBasicEventSpecificDetails() (BasicEventSpecificDetails, bool) { + return &jsed, true +} + +// BasicJobTaskDetails this class represents a task which is actually a workflow so that one can navigate to its +// individual drill down. +type BasicJobTaskDetails interface { + AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) + AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) + AsJobTaskDetails() (*JobTaskDetails, bool) +} + +// JobTaskDetails this class represents a task which is actually a workflow so that one can navigate to its +// individual drill down. +type JobTaskDetails struct { + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicJobTaskDetails(body []byte) (BasicJobTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeFabricReplicationGroupTaskDetails): + var frgtd FabricReplicationGroupTaskDetails + err := json.Unmarshal(body, &frgtd) + return frgtd, err + case string(InstanceTypeVirtualMachineTaskDetails): + var vmtd VirtualMachineTaskDetails + err := json.Unmarshal(body, &vmtd) + return vmtd, err + default: + var jtd JobTaskDetails + err := json.Unmarshal(body, &jtd) + return jtd, err + } +} +func unmarshalBasicJobTaskDetailsArray(body []byte) ([]BasicJobTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jtdArray := make([]BasicJobTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + jtd, err := unmarshalBasicJobTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + jtdArray[index] = jtd + } + return jtdArray, nil +} + +// MarshalJSON is the custom marshaler for JobTaskDetails. +func (jtd JobTaskDetails) MarshalJSON() ([]byte, error) { + jtd.InstanceType = InstanceTypeJobTaskDetails + objectMap := make(map[string]interface{}) + if jtd.JobTask != nil { + objectMap["jobTask"] = jtd.JobTask + } + if jtd.InstanceType != "" { + objectMap["instanceType"] = jtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return &jtd, true +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &jtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &jtd, true +} + +// KeyEncryptionKeyInfo key Encryption Key (KEK) information. +type KeyEncryptionKeyInfo struct { + // KeyIdentifier - The key URL / identifier. + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KeyVaultResourceArmID - The KeyVault resource ARM Id for key. + KeyVaultResourceArmID *string `json:"keyVaultResourceArmId,omitempty"` +} + +// LogicalNetwork logical network data model. +type LogicalNetwork struct { + autorest.Response `json:"-"` + // Properties - The Logical Network Properties. + Properties *LogicalNetworkProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for LogicalNetwork. +func (ln LogicalNetwork) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ln.Properties != nil { + objectMap["properties"] = ln.Properties + } + if ln.Location != nil { + objectMap["location"] = ln.Location + } + return json.Marshal(objectMap) +} + +// LogicalNetworkCollection list of logical networks. +type LogicalNetworkCollection struct { + autorest.Response `json:"-"` + // Value - The Logical Networks list details. + Value *[]LogicalNetwork `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// LogicalNetworkCollectionIterator provides access to a complete listing of LogicalNetwork values. +type LogicalNetworkCollectionIterator struct { + i int + page LogicalNetworkCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *LogicalNetworkCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LogicalNetworkCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *LogicalNetworkCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter LogicalNetworkCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter LogicalNetworkCollectionIterator) Response() LogicalNetworkCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter LogicalNetworkCollectionIterator) Value() LogicalNetwork { + if !iter.page.NotDone() { + return LogicalNetwork{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the LogicalNetworkCollectionIterator type. +func NewLogicalNetworkCollectionIterator(page LogicalNetworkCollectionPage) LogicalNetworkCollectionIterator { + return LogicalNetworkCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lnc LogicalNetworkCollection) IsEmpty() bool { + return lnc.Value == nil || len(*lnc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (lnc LogicalNetworkCollection) hasNextLink() bool { + return lnc.NextLink != nil && len(*lnc.NextLink) != 0 +} + +// logicalNetworkCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lnc LogicalNetworkCollection) logicalNetworkCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !lnc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lnc.NextLink))) +} + +// LogicalNetworkCollectionPage contains a page of LogicalNetwork values. +type LogicalNetworkCollectionPage struct { + fn func(context.Context, LogicalNetworkCollection) (LogicalNetworkCollection, error) + lnc LogicalNetworkCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *LogicalNetworkCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LogicalNetworkCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.lnc) + if err != nil { + return err + } + page.lnc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *LogicalNetworkCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page LogicalNetworkCollectionPage) NotDone() bool { + return !page.lnc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page LogicalNetworkCollectionPage) Response() LogicalNetworkCollection { + return page.lnc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page LogicalNetworkCollectionPage) Values() []LogicalNetwork { + if page.lnc.IsEmpty() { + return nil + } + return *page.lnc.Value +} + +// Creates a new instance of the LogicalNetworkCollectionPage type. +func NewLogicalNetworkCollectionPage(cur LogicalNetworkCollection, getNextPage func(context.Context, LogicalNetworkCollection) (LogicalNetworkCollection, error)) LogicalNetworkCollectionPage { + return LogicalNetworkCollectionPage{ + fn: getNextPage, + lnc: cur, + } +} + +// LogicalNetworkProperties logical Network Properties. +type LogicalNetworkProperties struct { + // FriendlyName - The Friendly Name. + FriendlyName *string `json:"friendlyName,omitempty"` + // NetworkVirtualizationStatus - A value indicating whether Network Virtualization is enabled for the logical network. + NetworkVirtualizationStatus *string `json:"networkVirtualizationStatus,omitempty"` + // LogicalNetworkUsage - A value indicating whether logical network is used as private test network by test failover. + LogicalNetworkUsage *string `json:"logicalNetworkUsage,omitempty"` + // LogicalNetworkDefinitionsStatus - A value indicating whether logical network definitions are isolated. + LogicalNetworkDefinitionsStatus *string `json:"logicalNetworkDefinitionsStatus,omitempty"` +} + +// ManualActionTaskDetails this class represents the manual action task details. +type ManualActionTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // Instructions - The instructions. + Instructions *string `json:"instructions,omitempty"` + // Observation - The observation. + Observation *string `json:"observation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) MarshalJSON() ([]byte, error) { + matd.InstanceType = InstanceTypeManualActionTaskDetails + objectMap := make(map[string]interface{}) + if matd.Name != nil { + objectMap["name"] = matd.Name + } + if matd.Instructions != nil { + objectMap["instructions"] = matd.Instructions + } + if matd.Observation != nil { + objectMap["observation"] = matd.Observation + } + if matd.InstanceType != "" { + objectMap["instanceType"] = matd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return &matd, true +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &matd, true +} + +// MarsAgentDetails mars agent details. +type MarsAgentDetails struct { + // ID - READ-ONLY; The Mars agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The Mars agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The Mars agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The Mars agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the Mars agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the Mars agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for MarsAgentDetails. +func (mad MarsAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MasterTargetServer details of a Master Target Server. +type MasterTargetServer struct { + // ID - The server Id. + ID *string `json:"id,omitempty"` + // IPAddress - The IP address of the server. + IPAddress *string `json:"ipAddress,omitempty"` + // Name - The server name. + Name *string `json:"name,omitempty"` + // OsType - The OS type of the server. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The version of the scout component on the server. + AgentVersion *string `json:"agentVersion,omitempty"` + // LastHeartbeat - The last heartbeat received from the server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // RetentionVolumes - The retention volumes of Master target Server. + RetentionVolumes *[]RetentionVolume `json:"retentionVolumes,omitempty"` + // DataStores - The list of data stores in the fabric. + DataStores *[]DataStore `json:"dataStores,omitempty"` + // ValidationErrors - Validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // HealthErrors - Health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // DiskCount - Disk count of the master target. + DiskCount *int32 `json:"diskCount,omitempty"` + // OsVersion - OS Version of the master target. + OsVersion *string `json:"osVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // MarsAgentVersion - MARS agent version. + MarsAgentVersion *string `json:"marsAgentVersion,omitempty"` + // MarsAgentExpiryDate - MARS agent expiry date. + MarsAgentExpiryDate *date.Time `json:"marsAgentExpiryDate,omitempty"` + // AgentVersionDetails - Agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // MarsAgentVersionDetails - Mars agent version details. + MarsAgentVersionDetails *VersionDetails `json:"marsAgentVersionDetails,omitempty"` +} + +// MigrateInput input for migrate. +type MigrateInput struct { + // Properties - Migrate input properties. + Properties *MigrateInputProperties `json:"properties,omitempty"` +} + +// MigrateInputProperties migrate input properties. +type MigrateInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicMigrateProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for MigrateInputProperties struct. +func (mip *MigrateInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicMigrateProviderSpecificInput(*v) + if err != nil { + return err + } + mip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicMigrateProviderSpecificInput migrate provider specific input. +type BasicMigrateProviderSpecificInput interface { + AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) + AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) +} + +// MigrateProviderSpecificInput migrate provider specific input. +type MigrateProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput', 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicMigrateProviderSpecificInput(body []byte) (BasicMigrateProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt): + var vmcmi VMwareCbtMigrateInput + err := json.Unmarshal(body, &vmcmi) + return vmcmi, err + default: + var mpsi MigrateProviderSpecificInput + err := json.Unmarshal(body, &mpsi) + return mpsi, err + } +} +func unmarshalBasicMigrateProviderSpecificInputArray(body []byte) ([]BasicMigrateProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + mpsiArray := make([]BasicMigrateProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + mpsi, err := unmarshalBasicMigrateProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + mpsiArray[index] = mpsi + } + return mpsiArray, nil +} + +// MarshalJSON is the custom marshaler for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) MarshalJSON() ([]byte, error) { + mpsi.InstanceType = InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput + objectMap := make(map[string]interface{}) + if mpsi.InstanceType != "" { + objectMap["instanceType"] = mpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrateInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) { + return nil, false +} + +// AsMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) { + return &mpsi, true +} + +// AsBasicMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsBasicMigrateProviderSpecificInput() (BasicMigrateProviderSpecificInput, bool) { + return &mpsi, true +} + +// MigrationItem migration item. +type MigrationItem struct { + autorest.Response `json:"-"` + // Properties - The migration item properties. + Properties *MigrationItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationItem. +func (mi MigrationItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mi.Properties != nil { + objectMap["properties"] = mi.Properties + } + if mi.Location != nil { + objectMap["location"] = mi.Location + } + return json.Marshal(objectMap) +} + +// MigrationItemCollection migration item collection. +type MigrationItemCollection struct { + autorest.Response `json:"-"` + // Value - The list of migration items. + Value *[]MigrationItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MigrationItemCollectionIterator provides access to a complete listing of MigrationItem values. +type MigrationItemCollectionIterator struct { + i int + page MigrationItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *MigrationItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *MigrationItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MigrationItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter MigrationItemCollectionIterator) Response() MigrationItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter MigrationItemCollectionIterator) Value() MigrationItem { + if !iter.page.NotDone() { + return MigrationItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the MigrationItemCollectionIterator type. +func NewMigrationItemCollectionIterator(page MigrationItemCollectionPage) MigrationItemCollectionIterator { + return MigrationItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mic MigrationItemCollection) IsEmpty() bool { + return mic.Value == nil || len(*mic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mic MigrationItemCollection) hasNextLink() bool { + return mic.NextLink != nil && len(*mic.NextLink) != 0 +} + +// migrationItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mic MigrationItemCollection) migrationItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !mic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mic.NextLink))) +} + +// MigrationItemCollectionPage contains a page of MigrationItem values. +type MigrationItemCollectionPage struct { + fn func(context.Context, MigrationItemCollection) (MigrationItemCollection, error) + mic MigrationItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *MigrationItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.mic) + if err != nil { + return err + } + page.mic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *MigrationItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MigrationItemCollectionPage) NotDone() bool { + return !page.mic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MigrationItemCollectionPage) Response() MigrationItemCollection { + return page.mic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MigrationItemCollectionPage) Values() []MigrationItem { + if page.mic.IsEmpty() { + return nil + } + return *page.mic.Value +} + +// Creates a new instance of the MigrationItemCollectionPage type. +func NewMigrationItemCollectionPage(cur MigrationItemCollection, getNextPage func(context.Context, MigrationItemCollection) (MigrationItemCollection, error)) MigrationItemCollectionPage { + return MigrationItemCollectionPage{ + fn: getNextPage, + mic: cur, + } +} + +// MigrationItemProperties migration item properties. +type MigrationItemProperties struct { + // MachineName - READ-ONLY; The on-premise virtual machine name. + MachineName *string `json:"machineName,omitempty"` + // PolicyID - READ-ONLY; The ARM Id of policy governing this item. + PolicyID *string `json:"policyId,omitempty"` + // PolicyFriendlyName - READ-ONLY; The name of policy governing this item. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` + // MigrationState - READ-ONLY; The migration status. Possible values include: 'MigrationStateNone', 'MigrationStateEnableMigrationInProgress', 'MigrationStateEnableMigrationFailed', 'MigrationStateDisableMigrationInProgress', 'MigrationStateDisableMigrationFailed', 'MigrationStateInitialSeedingInProgress', 'MigrationStateInitialSeedingFailed', 'MigrationStateReplicating', 'MigrationStateMigrationInProgress', 'MigrationStateMigrationSucceeded', 'MigrationStateMigrationFailed' + MigrationState MigrationState `json:"migrationState,omitempty"` + // MigrationStateDescription - READ-ONLY; The migration state description. + MigrationStateDescription *string `json:"migrationStateDescription,omitempty"` + // LastTestMigrationTime - READ-ONLY; The last test migration time. + LastTestMigrationTime *date.Time `json:"lastTestMigrationTime,omitempty"` + // LastTestMigrationStatus - READ-ONLY; The status of the last test migration. + LastTestMigrationStatus *string `json:"lastTestMigrationStatus,omitempty"` + // TestMigrateState - READ-ONLY; The test migrate state. Possible values include: 'TestMigrationStateNone', 'TestMigrationStateTestMigrationInProgress', 'TestMigrationStateTestMigrationSucceeded', 'TestMigrationStateTestMigrationFailed', 'TestMigrationStateTestMigrationCleanupInProgress' + TestMigrateState TestMigrationState `json:"testMigrateState,omitempty"` + // TestMigrateStateDescription - READ-ONLY; The test migrate state description. + TestMigrateStateDescription *string `json:"testMigrateStateDescription,omitempty"` + // Health - READ-ONLY; The consolidated health. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The list of health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // AllowedOperations - READ-ONLY; The allowed operations on the migration item based on the current migration state of the item. + AllowedOperations *[]MigrationItemOperation `json:"allowedOperations,omitempty"` + // CurrentJob - READ-ONLY; The current job details. + CurrentJob *CurrentJobDetails `json:"currentJob,omitempty"` + // EventCorrelationID - READ-ONLY; The correlation Id for events associated with this migration item. + EventCorrelationID *string `json:"eventCorrelationId,omitempty"` + // ProviderSpecificDetails - The migration provider custom settings. + ProviderSpecificDetails BasicMigrationProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationItemProperties. +func (mip MigrationItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["providerSpecificDetails"] = mip.ProviderSpecificDetails + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MigrationItemProperties struct. +func (mip *MigrationItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "machineName": + if v != nil { + var machineName string + err = json.Unmarshal(*v, &machineName) + if err != nil { + return err + } + mip.MachineName = &machineName + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + mip.PolicyID = &policyID + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + mip.PolicyFriendlyName = &policyFriendlyName + } + case "migrationState": + if v != nil { + var migrationState MigrationState + err = json.Unmarshal(*v, &migrationState) + if err != nil { + return err + } + mip.MigrationState = migrationState + } + case "migrationStateDescription": + if v != nil { + var migrationStateDescription string + err = json.Unmarshal(*v, &migrationStateDescription) + if err != nil { + return err + } + mip.MigrationStateDescription = &migrationStateDescription + } + case "lastTestMigrationTime": + if v != nil { + var lastTestMigrationTime date.Time + err = json.Unmarshal(*v, &lastTestMigrationTime) + if err != nil { + return err + } + mip.LastTestMigrationTime = &lastTestMigrationTime + } + case "lastTestMigrationStatus": + if v != nil { + var lastTestMigrationStatus string + err = json.Unmarshal(*v, &lastTestMigrationStatus) + if err != nil { + return err + } + mip.LastTestMigrationStatus = &lastTestMigrationStatus + } + case "testMigrateState": + if v != nil { + var testMigrateState TestMigrationState + err = json.Unmarshal(*v, &testMigrateState) + if err != nil { + return err + } + mip.TestMigrateState = testMigrateState + } + case "testMigrateStateDescription": + if v != nil { + var testMigrateStateDescription string + err = json.Unmarshal(*v, &testMigrateStateDescription) + if err != nil { + return err + } + mip.TestMigrateStateDescription = &testMigrateStateDescription + } + case "health": + if v != nil { + var health ProtectionHealth + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + mip.Health = health + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + mip.HealthErrors = &healthErrors + } + case "allowedOperations": + if v != nil { + var allowedOperations []MigrationItemOperation + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + mip.AllowedOperations = &allowedOperations + } + case "currentJob": + if v != nil { + var currentJob CurrentJobDetails + err = json.Unmarshal(*v, ¤tJob) + if err != nil { + return err + } + mip.CurrentJob = ¤tJob + } + case "eventCorrelationId": + if v != nil { + var eventCorrelationID string + err = json.Unmarshal(*v, &eventCorrelationID) + if err != nil { + return err + } + mip.EventCorrelationID = &eventCorrelationID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicMigrationProviderSpecificSettings(*v) + if err != nil { + return err + } + mip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// MigrationItemsQueryParameter query parameter to enumerate migration items. +type MigrationItemsQueryParameter struct { + // SourceFabricName - The source fabric name filter. + SourceFabricName *string `json:"sourceFabricName,omitempty"` + // SourceContainerName - The source container name filter. + SourceContainerName *string `json:"sourceContainerName,omitempty"` + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` +} + +// BasicMigrationProviderSpecificSettings migration provider specific settings. +type BasicMigrationProviderSpecificSettings interface { + AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) + AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) +} + +// MigrationProviderSpecificSettings migration provider specific settings. +type MigrationProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings', 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicMigrationProviderSpecificSettings(body []byte) (BasicMigrationProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt): + var vmcmd VMwareCbtMigrationDetails + err := json.Unmarshal(body, &vmcmd) + return vmcmd, err + default: + var mpss MigrationProviderSpecificSettings + err := json.Unmarshal(body, &mpss) + return mpss, err + } +} +func unmarshalBasicMigrationProviderSpecificSettingsArray(body []byte) ([]BasicMigrationProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + mpssArray := make([]BasicMigrationProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + mpss, err := unmarshalBasicMigrationProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + mpssArray[index] = mpss + } + return mpssArray, nil +} + +// MarshalJSON is the custom marshaler for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) MarshalJSON() ([]byte, error) { + mpss.InstanceType = InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings + objectMap := make(map[string]interface{}) + if mpss.InstanceType != "" { + objectMap["instanceType"] = mpss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrationDetails is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) { + return nil, false +} + +// AsMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) { + return &mpss, true +} + +// AsBasicMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsBasicMigrationProviderSpecificSettings() (BasicMigrationProviderSpecificSettings, bool) { + return &mpss, true +} + +// MigrationRecoveryPoint recovery point for a migration item. +type MigrationRecoveryPoint struct { + autorest.Response `json:"-"` + // Properties - Recovery point properties. + Properties *MigrationRecoveryPointProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationRecoveryPoint. +func (mrp MigrationRecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mrp.Properties != nil { + objectMap["properties"] = mrp.Properties + } + if mrp.Location != nil { + objectMap["location"] = mrp.Location + } + return json.Marshal(objectMap) +} + +// MigrationRecoveryPointCollection collection of migration recovery points. +type MigrationRecoveryPointCollection struct { + autorest.Response `json:"-"` + // Value - The migration recovery point details. + Value *[]MigrationRecoveryPoint `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MigrationRecoveryPointCollectionIterator provides access to a complete listing of MigrationRecoveryPoint +// values. +type MigrationRecoveryPointCollectionIterator struct { + i int + page MigrationRecoveryPointCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *MigrationRecoveryPointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *MigrationRecoveryPointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MigrationRecoveryPointCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter MigrationRecoveryPointCollectionIterator) Response() MigrationRecoveryPointCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter MigrationRecoveryPointCollectionIterator) Value() MigrationRecoveryPoint { + if !iter.page.NotDone() { + return MigrationRecoveryPoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the MigrationRecoveryPointCollectionIterator type. +func NewMigrationRecoveryPointCollectionIterator(page MigrationRecoveryPointCollectionPage) MigrationRecoveryPointCollectionIterator { + return MigrationRecoveryPointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mrpc MigrationRecoveryPointCollection) IsEmpty() bool { + return mrpc.Value == nil || len(*mrpc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mrpc MigrationRecoveryPointCollection) hasNextLink() bool { + return mrpc.NextLink != nil && len(*mrpc.NextLink) != 0 +} + +// migrationRecoveryPointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mrpc MigrationRecoveryPointCollection) migrationRecoveryPointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !mrpc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mrpc.NextLink))) +} + +// MigrationRecoveryPointCollectionPage contains a page of MigrationRecoveryPoint values. +type MigrationRecoveryPointCollectionPage struct { + fn func(context.Context, MigrationRecoveryPointCollection) (MigrationRecoveryPointCollection, error) + mrpc MigrationRecoveryPointCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *MigrationRecoveryPointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.mrpc) + if err != nil { + return err + } + page.mrpc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *MigrationRecoveryPointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MigrationRecoveryPointCollectionPage) NotDone() bool { + return !page.mrpc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MigrationRecoveryPointCollectionPage) Response() MigrationRecoveryPointCollection { + return page.mrpc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MigrationRecoveryPointCollectionPage) Values() []MigrationRecoveryPoint { + if page.mrpc.IsEmpty() { + return nil + } + return *page.mrpc.Value +} + +// Creates a new instance of the MigrationRecoveryPointCollectionPage type. +func NewMigrationRecoveryPointCollectionPage(cur MigrationRecoveryPointCollection, getNextPage func(context.Context, MigrationRecoveryPointCollection) (MigrationRecoveryPointCollection, error)) MigrationRecoveryPointCollectionPage { + return MigrationRecoveryPointCollectionPage{ + fn: getNextPage, + mrpc: cur, + } +} + +// MigrationRecoveryPointProperties migration item recovery point properties. +type MigrationRecoveryPointProperties struct { + // RecoveryPointTime - READ-ONLY; The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointType - READ-ONLY; The recovery point type. Possible values include: 'MigrationRecoveryPointTypeNotSpecified', 'MigrationRecoveryPointTypeApplicationConsistent', 'MigrationRecoveryPointTypeCrashConsistent' + RecoveryPointType MigrationRecoveryPointType `json:"recoveryPointType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationRecoveryPointProperties. +func (mrpp MigrationRecoveryPointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MobilityServiceUpdate the Mobility Service update details. +type MobilityServiceUpdate struct { + // Version - The version of the latest update. + Version *string `json:"version,omitempty"` + // RebootStatus - The reboot status of the update - whether it is required or not. + RebootStatus *string `json:"rebootStatus,omitempty"` + // OsType - The OS type. + OsType *string `json:"osType,omitempty"` +} + +// Network network model. +type Network struct { + autorest.Response `json:"-"` + // Properties - The Network Properties. + Properties *NetworkProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Network. +func (n Network) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if n.Properties != nil { + objectMap["properties"] = n.Properties + } + if n.Location != nil { + objectMap["location"] = n.Location + } + return json.Marshal(objectMap) +} + +// NetworkCollection list of networks. +type NetworkCollection struct { + autorest.Response `json:"-"` + // Value - The Networks list details. + Value *[]Network `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// NetworkCollectionIterator provides access to a complete listing of Network values. +type NetworkCollectionIterator struct { + i int + page NetworkCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *NetworkCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *NetworkCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter NetworkCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter NetworkCollectionIterator) Response() NetworkCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter NetworkCollectionIterator) Value() Network { + if !iter.page.NotDone() { + return Network{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the NetworkCollectionIterator type. +func NewNetworkCollectionIterator(page NetworkCollectionPage) NetworkCollectionIterator { + return NetworkCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (nc NetworkCollection) IsEmpty() bool { + return nc.Value == nil || len(*nc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (nc NetworkCollection) hasNextLink() bool { + return nc.NextLink != nil && len(*nc.NextLink) != 0 +} + +// networkCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (nc NetworkCollection) networkCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !nc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(nc.NextLink))) +} + +// NetworkCollectionPage contains a page of Network values. +type NetworkCollectionPage struct { + fn func(context.Context, NetworkCollection) (NetworkCollection, error) + nc NetworkCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *NetworkCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.nc) + if err != nil { + return err + } + page.nc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *NetworkCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page NetworkCollectionPage) NotDone() bool { + return !page.nc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page NetworkCollectionPage) Response() NetworkCollection { + return page.nc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page NetworkCollectionPage) Values() []Network { + if page.nc.IsEmpty() { + return nil + } + return *page.nc.Value +} + +// Creates a new instance of the NetworkCollectionPage type. +func NewNetworkCollectionPage(cur NetworkCollection, getNextPage func(context.Context, NetworkCollection) (NetworkCollection, error)) NetworkCollectionPage { + return NetworkCollectionPage{ + fn: getNextPage, + nc: cur, + } +} + +// NetworkMapping network Mapping model. Ideally it should have been possible to inherit this class from +// prev version in InheritedModels as long as there is no difference in structure or method signature. +// Since there were no base Models for certain fields and methods viz NetworkMappingProperties and Load +// with required return type, the class has been introduced in its entirety with references to base models +// to facilitate extensions in subsequent versions. +type NetworkMapping struct { + autorest.Response `json:"-"` + // Properties - The Network Mapping Properties. + Properties *NetworkMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for NetworkMapping. +func (nm NetworkMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if nm.Properties != nil { + objectMap["properties"] = nm.Properties + } + if nm.Location != nil { + objectMap["location"] = nm.Location + } + return json.Marshal(objectMap) +} + +// NetworkMappingCollection list of network mappings. As with NetworkMapping, it should be possible to +// reuse a prev version of this class. It doesn't seem likely this class could be anything more than a +// slightly bespoke collection of NetworkMapping. Hence it makes sense to override Load with +// Base.NetworkMapping instead of existing CurrentVersion.NetworkMapping. +type NetworkMappingCollection struct { + autorest.Response `json:"-"` + // Value - The Network Mappings list. + Value *[]NetworkMapping `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// NetworkMappingCollectionIterator provides access to a complete listing of NetworkMapping values. +type NetworkMappingCollectionIterator struct { + i int + page NetworkMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *NetworkMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *NetworkMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter NetworkMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter NetworkMappingCollectionIterator) Response() NetworkMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter NetworkMappingCollectionIterator) Value() NetworkMapping { + if !iter.page.NotDone() { + return NetworkMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the NetworkMappingCollectionIterator type. +func NewNetworkMappingCollectionIterator(page NetworkMappingCollectionPage) NetworkMappingCollectionIterator { + return NetworkMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (nmc NetworkMappingCollection) IsEmpty() bool { + return nmc.Value == nil || len(*nmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (nmc NetworkMappingCollection) hasNextLink() bool { + return nmc.NextLink != nil && len(*nmc.NextLink) != 0 +} + +// networkMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (nmc NetworkMappingCollection) networkMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !nmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(nmc.NextLink))) +} + +// NetworkMappingCollectionPage contains a page of NetworkMapping values. +type NetworkMappingCollectionPage struct { + fn func(context.Context, NetworkMappingCollection) (NetworkMappingCollection, error) + nmc NetworkMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *NetworkMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.nmc) + if err != nil { + return err + } + page.nmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *NetworkMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page NetworkMappingCollectionPage) NotDone() bool { + return !page.nmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page NetworkMappingCollectionPage) Response() NetworkMappingCollection { + return page.nmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page NetworkMappingCollectionPage) Values() []NetworkMapping { + if page.nmc.IsEmpty() { + return nil + } + return *page.nmc.Value +} + +// Creates a new instance of the NetworkMappingCollectionPage type. +func NewNetworkMappingCollectionPage(cur NetworkMappingCollection, getNextPage func(context.Context, NetworkMappingCollection) (NetworkMappingCollection, error)) NetworkMappingCollectionPage { + return NetworkMappingCollectionPage{ + fn: getNextPage, + nmc: cur, + } +} + +// BasicNetworkMappingFabricSpecificSettings network Mapping fabric specific settings. +type BasicNetworkMappingFabricSpecificSettings interface { + AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) + AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) + AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) + AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) +} + +// NetworkMappingFabricSpecificSettings network Mapping fabric specific settings. +type NetworkMappingFabricSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicNetworkMappingFabricSpecificSettings(body []byte) (BasicNetworkMappingFabricSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure): + var atanms AzureToAzureNetworkMappingSettings + err := json.Unmarshal(body, &atanms) + return atanms, err + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure): + var vtanms VmmToAzureNetworkMappingSettings + err := json.Unmarshal(body, &vtanms) + return vtanms, err + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm): + var vtvnms VmmToVmmNetworkMappingSettings + err := json.Unmarshal(body, &vtvnms) + return vtvnms, err + default: + var nmfss NetworkMappingFabricSpecificSettings + err := json.Unmarshal(body, &nmfss) + return nmfss, err + } +} +func unmarshalBasicNetworkMappingFabricSpecificSettingsArray(body []byte) ([]BasicNetworkMappingFabricSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + nmfssArray := make([]BasicNetworkMappingFabricSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + nmfss, err := unmarshalBasicNetworkMappingFabricSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + nmfssArray[index] = nmfss + } + return nmfssArray, nil +} + +// MarshalJSON is the custom marshaler for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) MarshalJSON() ([]byte, error) { + nmfss.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings + objectMap := make(map[string]interface{}) + if nmfss.InstanceType != "" { + objectMap["instanceType"] = nmfss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return &nmfss, true +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &nmfss, true +} + +// NetworkMappingProperties network Mapping Properties. +type NetworkMappingProperties struct { + // State - The pairing state for network mapping. + State *string `json:"state,omitempty"` + // PrimaryNetworkFriendlyName - The primary network friendly name. + PrimaryNetworkFriendlyName *string `json:"primaryNetworkFriendlyName,omitempty"` + // PrimaryNetworkID - The primary network id for network mapping. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // PrimaryFabricFriendlyName - The primary fabric friendly name. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // RecoveryNetworkFriendlyName - The recovery network friendly name. + RecoveryNetworkFriendlyName *string `json:"recoveryNetworkFriendlyName,omitempty"` + // RecoveryNetworkID - The recovery network id for network mapping. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // RecoveryFabricArmID - The recovery fabric ARM id. + RecoveryFabricArmID *string `json:"recoveryFabricArmId,omitempty"` + // RecoveryFabricFriendlyName - The recovery fabric friendly name. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // FabricSpecificSettings - The fabric specific settings. + FabricSpecificSettings BasicNetworkMappingFabricSpecificSettings `json:"fabricSpecificSettings,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for NetworkMappingProperties struct. +func (nmp *NetworkMappingProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + nmp.State = &state + } + case "primaryNetworkFriendlyName": + if v != nil { + var primaryNetworkFriendlyName string + err = json.Unmarshal(*v, &primaryNetworkFriendlyName) + if err != nil { + return err + } + nmp.PrimaryNetworkFriendlyName = &primaryNetworkFriendlyName + } + case "primaryNetworkId": + if v != nil { + var primaryNetworkID string + err = json.Unmarshal(*v, &primaryNetworkID) + if err != nil { + return err + } + nmp.PrimaryNetworkID = &primaryNetworkID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + nmp.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "recoveryNetworkFriendlyName": + if v != nil { + var recoveryNetworkFriendlyName string + err = json.Unmarshal(*v, &recoveryNetworkFriendlyName) + if err != nil { + return err + } + nmp.RecoveryNetworkFriendlyName = &recoveryNetworkFriendlyName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + nmp.RecoveryNetworkID = &recoveryNetworkID + } + case "recoveryFabricArmId": + if v != nil { + var recoveryFabricArmID string + err = json.Unmarshal(*v, &recoveryFabricArmID) + if err != nil { + return err + } + nmp.RecoveryFabricArmID = &recoveryFabricArmID + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + nmp.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "fabricSpecificSettings": + if v != nil { + fabricSpecificSettings, err := unmarshalBasicNetworkMappingFabricSpecificSettings(*v) + if err != nil { + return err + } + nmp.FabricSpecificSettings = fabricSpecificSettings + } + } + } + + return nil +} + +// NetworkProperties network Properties. +type NetworkProperties struct { + // FabricType - The Fabric Type. + FabricType *string `json:"fabricType,omitempty"` + // Subnets - The List of subnets. + Subnets *[]Subnet `json:"subnets,omitempty"` + // FriendlyName - The Friendly Name. + FriendlyName *string `json:"friendlyName,omitempty"` + // NetworkType - The Network Type. + NetworkType *string `json:"networkType,omitempty"` +} + +// NewProtectionProfile new Protection profile input. +type NewProtectionProfile struct { + // PolicyName - The protection profile input. + PolicyName *string `json:"policyName,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for NewProtectionProfile. +func (npp NewProtectionProfile) MarshalJSON() ([]byte, error) { + npp.ResourceType = ResourceTypeNew + objectMap := make(map[string]interface{}) + if npp.PolicyName != nil { + objectMap["policyName"] = npp.PolicyName + } + if npp.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = npp.RecoveryPointHistory + } + if npp.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = npp.CrashConsistentFrequencyInMinutes + } + if npp.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = npp.AppConsistentFrequencyInMinutes + } + if npp.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = npp.MultiVMSyncStatus + } + if npp.ResourceType != "" { + objectMap["resourceType"] = npp.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return nil, false +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return &npp, true +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return nil, false +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &npp, true +} + +// NewRecoveryVirtualNetwork recovery virtual network input to create new virtual network from given source +// network. +type NewRecoveryVirtualNetwork struct { + // RecoveryVirtualNetworkResourceGroupName - The name of the resource group to be used to create the recovery virtual network. If absent, target network would be created in the same resource group as target VM. + RecoveryVirtualNetworkResourceGroupName *string `json:"recoveryVirtualNetworkResourceGroupName,omitempty"` + // RecoveryVirtualNetworkName - The recovery virtual network name. + RecoveryVirtualNetworkName *string `json:"recoveryVirtualNetworkName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) MarshalJSON() ([]byte, error) { + nrvn.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew + objectMap := make(map[string]interface{}) + if nrvn.RecoveryVirtualNetworkResourceGroupName != nil { + objectMap["recoveryVirtualNetworkResourceGroupName"] = nrvn.RecoveryVirtualNetworkResourceGroupName + } + if nrvn.RecoveryVirtualNetworkName != nil { + objectMap["recoveryVirtualNetworkName"] = nrvn.RecoveryVirtualNetworkName + } + if nrvn.ResourceType != "" { + objectMap["resourceType"] = nrvn.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return &nrvn, true +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &nrvn, true +} + +// OperationsDiscovery operations discovery class. +type OperationsDiscovery struct { + // Name - Name of the API. The name of the operation being performed on this particular object. It should match the action name that appears in RBAC / the event service. Examples of operations include: * Microsoft.Compute/virtualMachine/capture/action * Microsoft.Compute/virtualMachine/restart/action * Microsoft.Compute/virtualMachine/write * Microsoft.Compute/virtualMachine/read * Microsoft.Compute/virtualMachine/delete Each action should include, in order: (1) Resource Provider Namespace (2) Type hierarchy for which the action applies (e.g. server/databases for a SQL Azure database) (3) Read, Write, Action or Delete indicating which type applies. If it is a PUT/PATCH on a collection or named value, Write should be used. If it is a GET, Read should be used. If it is a DELETE, Delete should be used. If it is a POST, Action should be used. As a note: all resource providers would need to include the "{Resource Provider Namespace}/register/action" operation in their response. This API is used to register for their service, and should include details about the operation (e.g. a localized name for the resource provider + any special considerations like PII release). + Name *string `json:"name,omitempty"` + // Display - Object type. + Display *Display `json:"display,omitempty"` + // Origin - Origin. The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. Default value is "user,system". + Origin *string `json:"origin,omitempty"` + // Properties - Properties. Reserved for future use. + Properties interface{} `json:"properties,omitempty"` +} + +// OperationsDiscoveryCollection collection of ClientDiscovery details. +type OperationsDiscoveryCollection struct { + autorest.Response `json:"-"` + // Value - The ClientDiscovery details. + Value *[]OperationsDiscovery `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationsDiscoveryCollectionIterator provides access to a complete listing of OperationsDiscovery +// values. +type OperationsDiscoveryCollectionIterator struct { + i int + page OperationsDiscoveryCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationsDiscoveryCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsDiscoveryCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationsDiscoveryCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationsDiscoveryCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationsDiscoveryCollectionIterator) Response() OperationsDiscoveryCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationsDiscoveryCollectionIterator) Value() OperationsDiscovery { + if !iter.page.NotDone() { + return OperationsDiscovery{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationsDiscoveryCollectionIterator type. +func NewOperationsDiscoveryCollectionIterator(page OperationsDiscoveryCollectionPage) OperationsDiscoveryCollectionIterator { + return OperationsDiscoveryCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (odc OperationsDiscoveryCollection) IsEmpty() bool { + return odc.Value == nil || len(*odc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (odc OperationsDiscoveryCollection) hasNextLink() bool { + return odc.NextLink != nil && len(*odc.NextLink) != 0 +} + +// operationsDiscoveryCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (odc OperationsDiscoveryCollection) operationsDiscoveryCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !odc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(odc.NextLink))) +} + +// OperationsDiscoveryCollectionPage contains a page of OperationsDiscovery values. +type OperationsDiscoveryCollectionPage struct { + fn func(context.Context, OperationsDiscoveryCollection) (OperationsDiscoveryCollection, error) + odc OperationsDiscoveryCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationsDiscoveryCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsDiscoveryCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.odc) + if err != nil { + return err + } + page.odc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationsDiscoveryCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationsDiscoveryCollectionPage) NotDone() bool { + return !page.odc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationsDiscoveryCollectionPage) Response() OperationsDiscoveryCollection { + return page.odc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationsDiscoveryCollectionPage) Values() []OperationsDiscovery { + if page.odc.IsEmpty() { + return nil + } + return *page.odc.Value +} + +// Creates a new instance of the OperationsDiscoveryCollectionPage type. +func NewOperationsDiscoveryCollectionPage(cur OperationsDiscoveryCollection, getNextPage func(context.Context, OperationsDiscoveryCollection) (OperationsDiscoveryCollection, error)) OperationsDiscoveryCollectionPage { + return OperationsDiscoveryCollectionPage{ + fn: getNextPage, + odc: cur, + } +} + +// OSDetails disk Details. +type OSDetails struct { + // OsType - VM Disk details. + OsType *string `json:"osType,omitempty"` + // ProductType - Product type. + ProductType *string `json:"productType,omitempty"` + // OsEdition - The OSEdition. + OsEdition *string `json:"osEdition,omitempty"` + // OSVersion - The OS Version. + OSVersion *string `json:"oSVersion,omitempty"` + // OSMajorVersion - The OS Major Version. + OSMajorVersion *string `json:"oSMajorVersion,omitempty"` + // OSMinorVersion - The OS Minor Version. + OSMinorVersion *string `json:"oSMinorVersion,omitempty"` +} + +// OSDiskDetails details of the OS Disk. +type OSDiskDetails struct { + // OsVhdID - The id of the disk containing the OS. + OsVhdID *string `json:"osVhdId,omitempty"` + // OsType - The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // VhdName - The OS disk VHD name. + VhdName *string `json:"vhdName,omitempty"` +} + +// OSVersionWrapper wrapper model for OSVersion to include version and service pack info. +type OSVersionWrapper struct { + // Version - The version. + Version *string `json:"version,omitempty"` + // ServicePack - The service pack. + ServicePack *string `json:"servicePack,omitempty"` +} + +// PlannedFailoverInput input definition for planned failover. +type PlannedFailoverInput struct { + // Properties - Planned failover input properties. + Properties *PlannedFailoverInputProperties `json:"properties,omitempty"` +} + +// PlannedFailoverInputProperties input definition for planned failover input properties. +type PlannedFailoverInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicPlannedFailoverProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for PlannedFailoverInputProperties struct. +func (pfip *PlannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + pfip.FailoverDirection = &failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(*v) + if err != nil { + return err + } + pfip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicPlannedFailoverProviderSpecificFailoverInput provider specific failover input. +type BasicPlannedFailoverProviderSpecificFailoverInput interface { + AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) + AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) + AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) + AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) +} + +// PlannedFailoverProviderSpecificFailoverInput provider specific failover input. +type PlannedFailoverProviderSpecificFailoverInput struct { + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(body []byte) (BasicPlannedFailoverProviderSpecificFailoverInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeHyperVReplicaAzureFailback): + var hvrafpi HyperVReplicaAzureFailbackProviderInput + err := json.Unmarshal(body, &hvrafpi) + return hvrafpi, err + case string(InstanceTypeHyperVReplicaAzure): + var hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput + err := json.Unmarshal(body, &hvrapfpi) + return hvrapfpi, err + case string(InstanceTypeInMageRcmFailback): + var imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput + err := json.Unmarshal(body, &imrfpfpi) + return imrfpfpi, err + default: + var pfpsfi PlannedFailoverProviderSpecificFailoverInput + err := json.Unmarshal(body, &pfpsfi) + return pfpsfi, err + } +} +func unmarshalBasicPlannedFailoverProviderSpecificFailoverInputArray(body []byte) ([]BasicPlannedFailoverProviderSpecificFailoverInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pfpsfiArray := make([]BasicPlannedFailoverProviderSpecificFailoverInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pfpsfi, err := unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(*rawMessage) + if err != nil { + return nil, err + } + pfpsfiArray[index] = pfpsfi + } + return pfpsfiArray, nil +} + +// MarshalJSON is the custom marshaler for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) MarshalJSON() ([]byte, error) { + pfpsfi.InstanceType = InstanceTypePlannedFailoverProviderSpecificFailoverInput + objectMap := make(map[string]interface{}) + if pfpsfi.InstanceType != "" { + objectMap["instanceType"] = pfpsfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return &pfpsfi, true +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &pfpsfi, true +} + +// Policy protection profile details. +type Policy struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *PolicyProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Policy. +func (p Policy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.Properties != nil { + objectMap["properties"] = p.Properties + } + if p.Location != nil { + objectMap["location"] = p.Location + } + return json.Marshal(objectMap) +} + +// PolicyCollection protection Profile Collection details. +type PolicyCollection struct { + autorest.Response `json:"-"` + // Value - The policy details. + Value *[]Policy `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// PolicyCollectionIterator provides access to a complete listing of Policy values. +type PolicyCollectionIterator struct { + i int + page PolicyCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PolicyCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PolicyCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PolicyCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PolicyCollectionIterator) Response() PolicyCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PolicyCollectionIterator) Value() Policy { + if !iter.page.NotDone() { + return Policy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PolicyCollectionIterator type. +func NewPolicyCollectionIterator(page PolicyCollectionPage) PolicyCollectionIterator { + return PolicyCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pc PolicyCollection) IsEmpty() bool { + return pc.Value == nil || len(*pc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pc PolicyCollection) hasNextLink() bool { + return pc.NextLink != nil && len(*pc.NextLink) != 0 +} + +// policyCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pc PolicyCollection) policyCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pc.NextLink))) +} + +// PolicyCollectionPage contains a page of Policy values. +type PolicyCollectionPage struct { + fn func(context.Context, PolicyCollection) (PolicyCollection, error) + pc PolicyCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PolicyCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pc) + if err != nil { + return err + } + page.pc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PolicyCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PolicyCollectionPage) NotDone() bool { + return !page.pc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PolicyCollectionPage) Response() PolicyCollection { + return page.pc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PolicyCollectionPage) Values() []Policy { + if page.pc.IsEmpty() { + return nil + } + return *page.pc.Value +} + +// Creates a new instance of the PolicyCollectionPage type. +func NewPolicyCollectionPage(cur PolicyCollection, getNextPage func(context.Context, PolicyCollection) (PolicyCollection, error)) PolicyCollectionPage { + return PolicyCollectionPage{ + fn: getNextPage, + pc: cur, + } +} + +// PolicyProperties protection profile custom data details. +type PolicyProperties struct { + // FriendlyName - The FriendlyName. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProviderSpecificDetails - The ReplicationChannelSetting. + ProviderSpecificDetails BasicPolicyProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for PolicyProperties struct. +func (pp *PolicyProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + pp.FriendlyName = &friendlyName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicPolicyProviderSpecificDetails(*v) + if err != nil { + return err + } + pp.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicPolicyProviderSpecificDetails base class for Provider specific details for policies. +type BasicPolicyProviderSpecificDetails interface { + AsA2APolicyDetails() (*A2APolicyDetails, bool) + AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) + AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) + AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) + AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) + AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) + AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) + AsInMagePolicyDetails() (*InMagePolicyDetails, bool) + AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) + AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) + AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) + AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) +} + +// PolicyProviderSpecificDetails base class for Provider specific details for policies. +type PolicyProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicPolicyProviderSpecificDetails(body []byte) (BasicPolicyProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A): + var apd A2APolicyDetails + err := json.Unmarshal(body, &apd) + return apd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure): + var hvrapd HyperVReplicaAzurePolicyDetails + err := json.Unmarshal(body, &hvrapd) + return hvrapd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails): + var hvrbpd HyperVReplicaBasePolicyDetails + err := json.Unmarshal(body, &hvrbpd) + return hvrbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2): + var hvrbpd HyperVReplicaBluePolicyDetails + err := json.Unmarshal(body, &hvrbpd) + return hvrbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012): + var hvrpd HyperVReplicaPolicyDetails + err := json.Unmarshal(body, &hvrpd) + return hvrpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2): + var imavpd InMageAzureV2PolicyDetails + err := json.Unmarshal(body, &imavpd) + return imavpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails): + var imbpd InMageBasePolicyDetails + err := json.Unmarshal(body, &imbpd) + return imbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage): + var impd InMagePolicyDetails + err := json.Unmarshal(body, &impd) + return impd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback): + var imrfpd InMageRcmFailbackPolicyDetails + err := json.Unmarshal(body, &imrfpd) + return imrfpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm): + var imrpd InMageRcmPolicyDetails + err := json.Unmarshal(body, &imrpd) + return imrpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt): + var vcpd VmwareCbtPolicyDetails + err := json.Unmarshal(body, &vcpd) + return vcpd, err + default: + var ppsd PolicyProviderSpecificDetails + err := json.Unmarshal(body, &ppsd) + return ppsd, err + } +} +func unmarshalBasicPolicyProviderSpecificDetailsArray(body []byte) ([]BasicPolicyProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppsdArray := make([]BasicPolicyProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppsd, err := unmarshalBasicPolicyProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + ppsdArray[index] = ppsd + } + return ppsdArray, nil +} + +// MarshalJSON is the custom marshaler for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) MarshalJSON() ([]byte, error) { + ppsd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails + objectMap := make(map[string]interface{}) + if ppsd.InstanceType != "" { + objectMap["instanceType"] = ppsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return &ppsd, true +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &ppsd, true +} + +// BasicPolicyProviderSpecificInput base class for provider specific input. +type BasicPolicyProviderSpecificInput interface { + AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) + AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) + AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) + AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) + AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) + AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) + AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) + AsInMagePolicyInput() (*InMagePolicyInput, bool) + AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) + AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) + AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) + AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) +} + +// PolicyProviderSpecificInput base class for provider specific input. +type PolicyProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicPolicyProviderSpecificInput(body []byte) (BasicPolicyProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmpci A2ACrossClusterMigrationPolicyCreationInput + err := json.Unmarshal(body, &accmpci) + return accmpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A): + var apci A2APolicyCreationInput + err := json.Unmarshal(body, &apci) + return apci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvrapi HyperVReplicaAzurePolicyInput + err := json.Unmarshal(body, &hvrapi) + return hvrapi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2): + var hvrbpi HyperVReplicaBluePolicyInput + err := json.Unmarshal(body, &hvrbpi) + return hvrbpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012): + var hvrpi HyperVReplicaPolicyInput + err := json.Unmarshal(body, &hvrpi) + return hvrpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2): + var imavpi InMageAzureV2PolicyInput + err := json.Unmarshal(body, &imavpi) + return imavpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage): + var impi InMagePolicyInput + err := json.Unmarshal(body, &impi) + return impi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback): + var imrfpci InMageRcmFailbackPolicyCreationInput + err := json.Unmarshal(body, &imrfpci) + return imrfpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm): + var imrpci InMageRcmPolicyCreationInput + err := json.Unmarshal(body, &imrpci) + return imrpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt): + var vmcpci VMwareCbtPolicyCreationInput + err := json.Unmarshal(body, &vmcpci) + return vmcpci, err + default: + var ppsi PolicyProviderSpecificInput + err := json.Unmarshal(body, &ppsi) + return ppsi, err + } +} +func unmarshalBasicPolicyProviderSpecificInputArray(body []byte) ([]BasicPolicyProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppsiArray := make([]BasicPolicyProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppsi, err := unmarshalBasicPolicyProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + ppsiArray[index] = ppsi + } + return ppsiArray, nil +} + +// MarshalJSON is the custom marshaler for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) MarshalJSON() ([]byte, error) { + ppsi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput + objectMap := make(map[string]interface{}) + if ppsi.InstanceType != "" { + objectMap["instanceType"] = ppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return &ppsi, true +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &ppsi, true +} + +// ProcessServer details of the Process Server. +type ProcessServer struct { + // FriendlyName - The Process Server's friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ID - The Process Server Id. + ID *string `json:"id,omitempty"` + // IPAddress - The IP address of the server. + IPAddress *string `json:"ipAddress,omitempty"` + // OsType - The OS type of the server. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The version of the scout component on the server. + AgentVersion *string `json:"agentVersion,omitempty"` + // LastHeartbeat - The last heartbeat received from the server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // MobilityServiceUpdates - The list of the mobility service updates available on the Process Server. + MobilityServiceUpdates *[]MobilityServiceUpdate `json:"mobilityServiceUpdates,omitempty"` + // HostID - The agent generated Id. + HostID *string `json:"hostId,omitempty"` + // MachineCount - The servers configured with this PS. + MachineCount *string `json:"machineCount,omitempty"` + // ReplicationPairCount - The number of replication pairs configured in this PS. + ReplicationPairCount *string `json:"replicationPairCount,omitempty"` + // SystemLoad - The percentage of the system load. + SystemLoad *string `json:"systemLoad,omitempty"` + // SystemLoadStatus - The system load status. + SystemLoadStatus *string `json:"systemLoadStatus,omitempty"` + // CPULoad - The percentage of the CPU load. + CPULoad *string `json:"cpuLoad,omitempty"` + // CPULoadStatus - The CPU load status. + CPULoadStatus *string `json:"cpuLoadStatus,omitempty"` + // TotalMemoryInBytes - The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // MemoryUsageStatus - The memory usage status. + MemoryUsageStatus *string `json:"memoryUsageStatus,omitempty"` + // TotalSpaceInBytes - The total space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - The available space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // SpaceUsageStatus - The space usage status. + SpaceUsageStatus *string `json:"spaceUsageStatus,omitempty"` + // PsServiceStatus - The PS service status. + PsServiceStatus *string `json:"psServiceStatus,omitempty"` + // SslCertExpiryDate - The PS SSL cert expiry date. + SslCertExpiryDate *date.Time `json:"sslCertExpiryDate,omitempty"` + // SslCertExpiryRemainingDays - CS SSL cert expiry date. + SslCertExpiryRemainingDays *int32 `json:"sslCertExpiryRemainingDays,omitempty"` + // OsVersion - OS Version of the process server. Note: This will get populated if user has CS version greater than 9.12.0.0. + OsVersion *string `json:"osVersion,omitempty"` + // HealthErrors - Health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // AgentVersionDetails - The agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // Health - READ-ONLY; The health of Process Server. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // PsStatsRefreshTime - READ-ONLY; The process server stats refresh time. + PsStatsRefreshTime *date.Time `json:"psStatsRefreshTime,omitempty"` + // ThroughputUploadPendingDataInBytes - READ-ONLY; The uploading pending data in bytes. + ThroughputUploadPendingDataInBytes *int64 `json:"throughputUploadPendingDataInBytes,omitempty"` + // ThroughputInMBps - READ-ONLY; The throughput in MBps. + ThroughputInMBps *int64 `json:"throughputInMBps,omitempty"` + // ThroughputInBytes - READ-ONLY; The throughput in bytes. + ThroughputInBytes *int64 `json:"throughputInBytes,omitempty"` + // ThroughputStatus - READ-ONLY; The throughput status. + ThroughputStatus *string `json:"throughputStatus,omitempty"` + // MarsCommunicationStatus - READ-ONLY; The MARS communication status. + MarsCommunicationStatus *string `json:"marsCommunicationStatus,omitempty"` + // MarsRegistrationStatus - READ-ONLY; The MARS registration status. + MarsRegistrationStatus *string `json:"marsRegistrationStatus,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessServer. +func (ps ProcessServer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ps.FriendlyName != nil { + objectMap["friendlyName"] = ps.FriendlyName + } + if ps.ID != nil { + objectMap["id"] = ps.ID + } + if ps.IPAddress != nil { + objectMap["ipAddress"] = ps.IPAddress + } + if ps.OsType != nil { + objectMap["osType"] = ps.OsType + } + if ps.AgentVersion != nil { + objectMap["agentVersion"] = ps.AgentVersion + } + if ps.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = ps.LastHeartbeat + } + if ps.VersionStatus != nil { + objectMap["versionStatus"] = ps.VersionStatus + } + if ps.MobilityServiceUpdates != nil { + objectMap["mobilityServiceUpdates"] = ps.MobilityServiceUpdates + } + if ps.HostID != nil { + objectMap["hostId"] = ps.HostID + } + if ps.MachineCount != nil { + objectMap["machineCount"] = ps.MachineCount + } + if ps.ReplicationPairCount != nil { + objectMap["replicationPairCount"] = ps.ReplicationPairCount + } + if ps.SystemLoad != nil { + objectMap["systemLoad"] = ps.SystemLoad + } + if ps.SystemLoadStatus != nil { + objectMap["systemLoadStatus"] = ps.SystemLoadStatus + } + if ps.CPULoad != nil { + objectMap["cpuLoad"] = ps.CPULoad + } + if ps.CPULoadStatus != nil { + objectMap["cpuLoadStatus"] = ps.CPULoadStatus + } + if ps.TotalMemoryInBytes != nil { + objectMap["totalMemoryInBytes"] = ps.TotalMemoryInBytes + } + if ps.AvailableMemoryInBytes != nil { + objectMap["availableMemoryInBytes"] = ps.AvailableMemoryInBytes + } + if ps.MemoryUsageStatus != nil { + objectMap["memoryUsageStatus"] = ps.MemoryUsageStatus + } + if ps.TotalSpaceInBytes != nil { + objectMap["totalSpaceInBytes"] = ps.TotalSpaceInBytes + } + if ps.AvailableSpaceInBytes != nil { + objectMap["availableSpaceInBytes"] = ps.AvailableSpaceInBytes + } + if ps.SpaceUsageStatus != nil { + objectMap["spaceUsageStatus"] = ps.SpaceUsageStatus + } + if ps.PsServiceStatus != nil { + objectMap["psServiceStatus"] = ps.PsServiceStatus + } + if ps.SslCertExpiryDate != nil { + objectMap["sslCertExpiryDate"] = ps.SslCertExpiryDate + } + if ps.SslCertExpiryRemainingDays != nil { + objectMap["sslCertExpiryRemainingDays"] = ps.SslCertExpiryRemainingDays + } + if ps.OsVersion != nil { + objectMap["osVersion"] = ps.OsVersion + } + if ps.HealthErrors != nil { + objectMap["healthErrors"] = ps.HealthErrors + } + if ps.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = ps.AgentExpiryDate + } + if ps.AgentVersionDetails != nil { + objectMap["agentVersionDetails"] = ps.AgentVersionDetails + } + return json.Marshal(objectMap) +} + +// ProcessServerDetails process server details. +type ProcessServerDetails struct { + // ID - READ-ONLY; The process server Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The process server name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The process server Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The process server Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // IPAddresses - READ-ONLY; The list of IP addresses for communicating with the RCM component. + IPAddresses *[]string `json:"ipAddresses,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the process server. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // TotalMemoryInBytes - READ-ONLY; The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - READ-ONLY; The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // UsedMemoryInBytes - READ-ONLY; The used memory. + UsedMemoryInBytes *int64 `json:"usedMemoryInBytes,omitempty"` + // MemoryUsagePercentage - READ-ONLY; The memory usage percentage. + MemoryUsagePercentage *float64 `json:"memoryUsagePercentage,omitempty"` + // TotalSpaceInBytes - READ-ONLY; The total disk space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - READ-ONLY; The available disk space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // UsedSpaceInBytes - READ-ONLY; The used disk space. + UsedSpaceInBytes *int64 `json:"usedSpaceInBytes,omitempty"` + // FreeSpacePercentage - READ-ONLY; The free disk space percentage. + FreeSpacePercentage *float64 `json:"freeSpacePercentage,omitempty"` + // ThroughputUploadPendingDataInBytes - READ-ONLY; The uploading pending data in bytes. + ThroughputUploadPendingDataInBytes *int64 `json:"throughputUploadPendingDataInBytes,omitempty"` + // ThroughputInBytes - READ-ONLY; The throughput in bytes. + ThroughputInBytes *int64 `json:"throughputInBytes,omitempty"` + // ProcessorUsagePercentage - READ-ONLY; The processor usage percentage. + ProcessorUsagePercentage *float64 `json:"processorUsagePercentage,omitempty"` + // ThroughputStatus - READ-ONLY; The throughput status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + ThroughputStatus RcmComponentStatus `json:"throughputStatus,omitempty"` + // SystemLoad - READ-ONLY; The system load. + SystemLoad *int64 `json:"systemLoad,omitempty"` + // SystemLoadStatus - READ-ONLY; The system load status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + SystemLoadStatus RcmComponentStatus `json:"systemLoadStatus,omitempty"` + // DiskUsageStatus - READ-ONLY; The disk usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + DiskUsageStatus RcmComponentStatus `json:"diskUsageStatus,omitempty"` + // MemoryUsageStatus - READ-ONLY; The memory usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + MemoryUsageStatus RcmComponentStatus `json:"memoryUsageStatus,omitempty"` + // ProcessorUsageStatus - READ-ONLY; The processor usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + ProcessorUsageStatus RcmComponentStatus `json:"processorUsageStatus,omitempty"` + // Health - READ-ONLY; The health of the process server. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // ProtectedItemCount - READ-ONLY; The protected item count. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // HistoricHealth - READ-ONLY; The historic health of the process server based on the health in last 24 hours. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + HistoricHealth ProtectionHealth `json:"historicHealth,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessServerDetails. +func (psd ProcessServerDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ProtectableItem replication protected item. +type ProtectableItem struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectableItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectableItem. +func (pi ProtectableItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pi.Properties != nil { + objectMap["properties"] = pi.Properties + } + if pi.Location != nil { + objectMap["location"] = pi.Location + } + return json.Marshal(objectMap) +} + +// ProtectableItemCollection protectable item collection. +type ProtectableItemCollection struct { + autorest.Response `json:"-"` + // Value - The Protectable item details. + Value *[]ProtectableItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectableItemCollectionIterator provides access to a complete listing of ProtectableItem values. +type ProtectableItemCollectionIterator struct { + i int + page ProtectableItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectableItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectableItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectableItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectableItemCollectionIterator) Response() ProtectableItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectableItemCollectionIterator) Value() ProtectableItem { + if !iter.page.NotDone() { + return ProtectableItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectableItemCollectionIterator type. +func NewProtectableItemCollectionIterator(page ProtectableItemCollectionPage) ProtectableItemCollectionIterator { + return ProtectableItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pic ProtectableItemCollection) IsEmpty() bool { + return pic.Value == nil || len(*pic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pic ProtectableItemCollection) hasNextLink() bool { + return pic.NextLink != nil && len(*pic.NextLink) != 0 +} + +// protectableItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pic ProtectableItemCollection) protectableItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pic.NextLink))) +} + +// ProtectableItemCollectionPage contains a page of ProtectableItem values. +type ProtectableItemCollectionPage struct { + fn func(context.Context, ProtectableItemCollection) (ProtectableItemCollection, error) + pic ProtectableItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectableItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pic) + if err != nil { + return err + } + page.pic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectableItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectableItemCollectionPage) NotDone() bool { + return !page.pic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectableItemCollectionPage) Response() ProtectableItemCollection { + return page.pic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectableItemCollectionPage) Values() []ProtectableItem { + if page.pic.IsEmpty() { + return nil + } + return *page.pic.Value +} + +// Creates a new instance of the ProtectableItemCollectionPage type. +func NewProtectableItemCollectionPage(cur ProtectableItemCollection, getNextPage func(context.Context, ProtectableItemCollection) (ProtectableItemCollection, error)) ProtectableItemCollectionPage { + return ProtectableItemCollectionPage{ + fn: getNextPage, + pic: cur, + } +} + +// ProtectableItemProperties replication protected item custom data details. +type ProtectableItemProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionStatus - The protection status. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ReplicationProtectedItemID - The ARM resource of protected items. + ReplicationProtectedItemID *string `json:"replicationProtectedItemId,omitempty"` + // RecoveryServicesProviderID - The recovery provider ARM Id. + RecoveryServicesProviderID *string `json:"recoveryServicesProviderId,omitempty"` + // ProtectionReadinessErrors - The Current protection readiness errors. + ProtectionReadinessErrors *[]string `json:"protectionReadinessErrors,omitempty"` + // SupportedReplicationProviders - The list of replication providers supported for the protectable item. + SupportedReplicationProviders *[]string `json:"supportedReplicationProviders,omitempty"` + // CustomDetails - The Replication provider custom settings. + CustomDetails BasicConfigurationSettings `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ProtectableItemProperties struct. +func (pip *ProtectableItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + pip.FriendlyName = &friendlyName + } + case "protectionStatus": + if v != nil { + var protectionStatus string + err = json.Unmarshal(*v, &protectionStatus) + if err != nil { + return err + } + pip.ProtectionStatus = &protectionStatus + } + case "replicationProtectedItemId": + if v != nil { + var replicationProtectedItemID string + err = json.Unmarshal(*v, &replicationProtectedItemID) + if err != nil { + return err + } + pip.ReplicationProtectedItemID = &replicationProtectedItemID + } + case "recoveryServicesProviderId": + if v != nil { + var recoveryServicesProviderID string + err = json.Unmarshal(*v, &recoveryServicesProviderID) + if err != nil { + return err + } + pip.RecoveryServicesProviderID = &recoveryServicesProviderID + } + case "protectionReadinessErrors": + if v != nil { + var protectionReadinessErrors []string + err = json.Unmarshal(*v, &protectionReadinessErrors) + if err != nil { + return err + } + pip.ProtectionReadinessErrors = &protectionReadinessErrors + } + case "supportedReplicationProviders": + if v != nil { + var supportedReplicationProviders []string + err = json.Unmarshal(*v, &supportedReplicationProviders) + if err != nil { + return err + } + pip.SupportedReplicationProviders = &supportedReplicationProviders + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicConfigurationSettings(*v) + if err != nil { + return err + } + pip.CustomDetails = customDetails + } + } + } + + return nil +} + +// ProtectableItemQueryParameter query parameter to enumerate Protectable items. +type ProtectableItemQueryParameter struct { + // State - State of the Protectable item query filter. + State *string `json:"state,omitempty"` +} + +// ProtectedItemsQueryParameter query parameter to enumerate protected items. +type ProtectedItemsQueryParameter struct { + // SourceFabricName - The source fabric name filter. + SourceFabricName *string `json:"sourceFabricName,omitempty"` + // RecoveryPlanName - The recovery plan filter. + RecoveryPlanName *string `json:"recoveryPlanName,omitempty"` + // SourceFabricLocation - The source fabric location filter. + SourceFabricLocation *string `json:"sourceFabricLocation,omitempty"` + // FabricObjectID - The fabric object Id filter. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // VCenterName - The vCenter name filter. + VCenterName *string `json:"vCenterName,omitempty"` + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` + // MultiVMGroupCreateOption - Whether Multi VM group is auto created or specified by user. Possible values include: 'AutoCreated', 'UserSpecified' + MultiVMGroupCreateOption MultiVMGroupCreateOption `json:"multiVmGroupCreateOption,omitempty"` + // ProcessServerID - The process server Id filter. + ProcessServerID *string `json:"processServerId,omitempty"` +} + +// ProtectionContainer protection container details. +type ProtectionContainer struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectionContainerProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainer. +func (pc ProtectionContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pc.Properties != nil { + objectMap["properties"] = pc.Properties + } + if pc.Location != nil { + objectMap["location"] = pc.Location + } + return json.Marshal(objectMap) +} + +// ProtectionContainerCollection protection Container collection. +type ProtectionContainerCollection struct { + autorest.Response `json:"-"` + // Value - The Protection Container details. + Value *[]ProtectionContainer `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectionContainerCollectionIterator provides access to a complete listing of ProtectionContainer +// values. +type ProtectionContainerCollectionIterator struct { + i int + page ProtectionContainerCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectionContainerCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionContainerCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionContainerCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectionContainerCollectionIterator) Response() ProtectionContainerCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectionContainerCollectionIterator) Value() ProtectionContainer { + if !iter.page.NotDone() { + return ProtectionContainer{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectionContainerCollectionIterator type. +func NewProtectionContainerCollectionIterator(page ProtectionContainerCollectionPage) ProtectionContainerCollectionIterator { + return ProtectionContainerCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcc ProtectionContainerCollection) IsEmpty() bool { + return pcc.Value == nil || len(*pcc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pcc ProtectionContainerCollection) hasNextLink() bool { + return pcc.NextLink != nil && len(*pcc.NextLink) != 0 +} + +// protectionContainerCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcc ProtectionContainerCollection) protectionContainerCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pcc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcc.NextLink))) +} + +// ProtectionContainerCollectionPage contains a page of ProtectionContainer values. +type ProtectionContainerCollectionPage struct { + fn func(context.Context, ProtectionContainerCollection) (ProtectionContainerCollection, error) + pcc ProtectionContainerCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectionContainerCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pcc) + if err != nil { + return err + } + page.pcc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionContainerCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionContainerCollectionPage) NotDone() bool { + return !page.pcc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionContainerCollectionPage) Response() ProtectionContainerCollection { + return page.pcc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionContainerCollectionPage) Values() []ProtectionContainer { + if page.pcc.IsEmpty() { + return nil + } + return *page.pcc.Value +} + +// Creates a new instance of the ProtectionContainerCollectionPage type. +func NewProtectionContainerCollectionPage(cur ProtectionContainerCollection, getNextPage func(context.Context, ProtectionContainerCollection) (ProtectionContainerCollection, error)) ProtectionContainerCollectionPage { + return ProtectionContainerCollectionPage{ + fn: getNextPage, + pcc: cur, + } +} + +// ProtectionContainerFabricSpecificDetails base class for fabric specific details of container. +type ProtectionContainerFabricSpecificDetails struct { + // InstanceType - READ-ONLY; Gets the class type. Overridden in derived classes. + InstanceType *string `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainerFabricSpecificDetails. +func (pcfsd ProtectionContainerFabricSpecificDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ProtectionContainerMapping protection container mapping object. +type ProtectionContainerMapping struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectionContainerMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainerMapping. +func (pcm ProtectionContainerMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pcm.Properties != nil { + objectMap["properties"] = pcm.Properties + } + if pcm.Location != nil { + objectMap["location"] = pcm.Location + } + return json.Marshal(objectMap) +} + +// ProtectionContainerMappingCollection protection container mapping collection class. +type ProtectionContainerMappingCollection struct { + autorest.Response `json:"-"` + // Value - List of container mappings. + Value *[]ProtectionContainerMapping `json:"value,omitempty"` + // NextLink - Link to fetch rest of the data. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectionContainerMappingCollectionIterator provides access to a complete listing of +// ProtectionContainerMapping values. +type ProtectionContainerMappingCollectionIterator struct { + i int + page ProtectionContainerMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectionContainerMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionContainerMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionContainerMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectionContainerMappingCollectionIterator) Response() ProtectionContainerMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectionContainerMappingCollectionIterator) Value() ProtectionContainerMapping { + if !iter.page.NotDone() { + return ProtectionContainerMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectionContainerMappingCollectionIterator type. +func NewProtectionContainerMappingCollectionIterator(page ProtectionContainerMappingCollectionPage) ProtectionContainerMappingCollectionIterator { + return ProtectionContainerMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcmc ProtectionContainerMappingCollection) IsEmpty() bool { + return pcmc.Value == nil || len(*pcmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pcmc ProtectionContainerMappingCollection) hasNextLink() bool { + return pcmc.NextLink != nil && len(*pcmc.NextLink) != 0 +} + +// protectionContainerMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcmc ProtectionContainerMappingCollection) protectionContainerMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pcmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcmc.NextLink))) +} + +// ProtectionContainerMappingCollectionPage contains a page of ProtectionContainerMapping values. +type ProtectionContainerMappingCollectionPage struct { + fn func(context.Context, ProtectionContainerMappingCollection) (ProtectionContainerMappingCollection, error) + pcmc ProtectionContainerMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectionContainerMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pcmc) + if err != nil { + return err + } + page.pcmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionContainerMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionContainerMappingCollectionPage) NotDone() bool { + return !page.pcmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionContainerMappingCollectionPage) Response() ProtectionContainerMappingCollection { + return page.pcmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionContainerMappingCollectionPage) Values() []ProtectionContainerMapping { + if page.pcmc.IsEmpty() { + return nil + } + return *page.pcmc.Value +} + +// Creates a new instance of the ProtectionContainerMappingCollectionPage type. +func NewProtectionContainerMappingCollectionPage(cur ProtectionContainerMappingCollection, getNextPage func(context.Context, ProtectionContainerMappingCollection) (ProtectionContainerMappingCollection, error)) ProtectionContainerMappingCollectionPage { + return ProtectionContainerMappingCollectionPage{ + fn: getNextPage, + pcmc: cur, + } +} + +// ProtectionContainerMappingProperties protection container mapping properties. +type ProtectionContainerMappingProperties struct { + // TargetProtectionContainerID - Paired protection container ARM ID. + TargetProtectionContainerID *string `json:"targetProtectionContainerId,omitempty"` + // TargetProtectionContainerFriendlyName - Friendly name of paired container. + TargetProtectionContainerFriendlyName *string `json:"targetProtectionContainerFriendlyName,omitempty"` + // ProviderSpecificDetails - Provider specific provider details. + ProviderSpecificDetails BasicProtectionContainerMappingProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` + // Health - Health of pairing. + Health *string `json:"health,omitempty"` + // HealthErrorDetails - Health error. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // PolicyID - Policy ARM Id. + PolicyID *string `json:"policyId,omitempty"` + // State - Association Status. + State *string `json:"state,omitempty"` + // SourceProtectionContainerFriendlyName - Friendly name of source protection container. + SourceProtectionContainerFriendlyName *string `json:"sourceProtectionContainerFriendlyName,omitempty"` + // SourceFabricFriendlyName - Friendly name of source fabric. + SourceFabricFriendlyName *string `json:"sourceFabricFriendlyName,omitempty"` + // TargetFabricFriendlyName - Friendly name of target fabric. + TargetFabricFriendlyName *string `json:"targetFabricFriendlyName,omitempty"` + // PolicyFriendlyName - Friendly name of replication policy. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ProtectionContainerMappingProperties struct. +func (pcmp *ProtectionContainerMappingProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetProtectionContainerId": + if v != nil { + var targetProtectionContainerID string + err = json.Unmarshal(*v, &targetProtectionContainerID) + if err != nil { + return err + } + pcmp.TargetProtectionContainerID = &targetProtectionContainerID + } + case "targetProtectionContainerFriendlyName": + if v != nil { + var targetProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &targetProtectionContainerFriendlyName) + if err != nil { + return err + } + pcmp.TargetProtectionContainerFriendlyName = &targetProtectionContainerFriendlyName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicProtectionContainerMappingProviderSpecificDetails(*v) + if err != nil { + return err + } + pcmp.ProviderSpecificDetails = providerSpecificDetails + } + case "health": + if v != nil { + var health string + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + pcmp.Health = &health + } + case "healthErrorDetails": + if v != nil { + var healthErrorDetails []HealthError + err = json.Unmarshal(*v, &healthErrorDetails) + if err != nil { + return err + } + pcmp.HealthErrorDetails = &healthErrorDetails + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + pcmp.PolicyID = &policyID + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + pcmp.State = &state + } + case "sourceProtectionContainerFriendlyName": + if v != nil { + var sourceProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &sourceProtectionContainerFriendlyName) + if err != nil { + return err + } + pcmp.SourceProtectionContainerFriendlyName = &sourceProtectionContainerFriendlyName + } + case "sourceFabricFriendlyName": + if v != nil { + var sourceFabricFriendlyName string + err = json.Unmarshal(*v, &sourceFabricFriendlyName) + if err != nil { + return err + } + pcmp.SourceFabricFriendlyName = &sourceFabricFriendlyName + } + case "targetFabricFriendlyName": + if v != nil { + var targetFabricFriendlyName string + err = json.Unmarshal(*v, &targetFabricFriendlyName) + if err != nil { + return err + } + pcmp.TargetFabricFriendlyName = &targetFabricFriendlyName + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + pcmp.PolicyFriendlyName = &policyFriendlyName + } + } + } + + return nil +} + +// BasicProtectionContainerMappingProviderSpecificDetails container mapping provider specific details. +type BasicProtectionContainerMappingProviderSpecificDetails interface { + AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) + AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) + AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) + AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) +} + +// ProtectionContainerMappingProviderSpecificDetails container mapping provider specific details. +type ProtectionContainerMappingProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicProtectionContainerMappingProviderSpecificDetails(body []byte) (BasicProtectionContainerMappingProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A): + var apcmd A2AProtectionContainerMappingDetails + err := json.Unmarshal(body, &apcmd) + return apcmd, err + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm): + var imrpcmd InMageRcmProtectionContainerMappingDetails + err := json.Unmarshal(body, &imrpcmd) + return imrpcmd, err + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt): + var vmcpcmd VMwareCbtProtectionContainerMappingDetails + err := json.Unmarshal(body, &vmcpcmd) + return vmcpcmd, err + default: + var pcmpsd ProtectionContainerMappingProviderSpecificDetails + err := json.Unmarshal(body, &pcmpsd) + return pcmpsd, err + } +} +func unmarshalBasicProtectionContainerMappingProviderSpecificDetailsArray(body []byte) ([]BasicProtectionContainerMappingProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pcmpsdArray := make([]BasicProtectionContainerMappingProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pcmpsd, err := unmarshalBasicProtectionContainerMappingProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + pcmpsdArray[index] = pcmpsd + } + return pcmpsdArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) MarshalJSON() ([]byte, error) { + pcmpsd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails + objectMap := make(map[string]interface{}) + if pcmpsd.InstanceType != "" { + objectMap["instanceType"] = pcmpsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return &pcmpsd, true +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &pcmpsd, true +} + +// ProtectionContainerProperties protection profile custom data details. +type ProtectionContainerProperties struct { + // FabricFriendlyName - Fabric friendly name. + FabricFriendlyName *string `json:"fabricFriendlyName,omitempty"` + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // FabricType - The fabric type. + FabricType *string `json:"fabricType,omitempty"` + // ProtectedItemCount - Number of protected PEs. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // PairingStatus - The pairing status of this cloud. + PairingStatus *string `json:"pairingStatus,omitempty"` + // Role - The role of this cloud. + Role *string `json:"role,omitempty"` + // FabricSpecificDetails - Fabric specific details. + FabricSpecificDetails *ProtectionContainerFabricSpecificDetails `json:"fabricSpecificDetails,omitempty"` +} + +// BasicProtectionProfileCustomDetails protection Profile custom input. +type BasicProtectionProfileCustomDetails interface { + AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) + AsNewProtectionProfile() (*NewProtectionProfile, bool) + AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) +} + +// ProtectionProfileCustomDetails protection Profile custom input. +type ProtectionProfileCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +func unmarshalBasicProtectionProfileCustomDetails(body []byte) (BasicProtectionProfileCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeExisting): + var epp ExistingProtectionProfile + err := json.Unmarshal(body, &epp) + return epp, err + case string(ResourceTypeNew): + var npp NewProtectionProfile + err := json.Unmarshal(body, &npp) + return npp, err + default: + var ppcd ProtectionProfileCustomDetails + err := json.Unmarshal(body, &ppcd) + return ppcd, err + } +} +func unmarshalBasicProtectionProfileCustomDetailsArray(body []byte) ([]BasicProtectionProfileCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppcdArray := make([]BasicProtectionProfileCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppcd, err := unmarshalBasicProtectionProfileCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + ppcdArray[index] = ppcd + } + return ppcdArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) MarshalJSON() ([]byte, error) { + ppcd.ResourceType = ResourceTypeProtectionProfileCustomDetails + objectMap := make(map[string]interface{}) + if ppcd.ResourceType != "" { + objectMap["resourceType"] = ppcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return nil, false +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return nil, false +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return &ppcd, true +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &ppcd, true +} + +// ProviderError this class contains the error details per object. +type ProviderError struct { + // ErrorCode - The Error code. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorMessage - The Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // ErrorID - The Provider error Id. + ErrorID *string `json:"errorId,omitempty"` + // PossibleCauses - The possible causes for the error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - The recommended action to resolve the error. + RecommendedAction *string `json:"recommendedAction,omitempty"` +} + +// BasicProviderSpecificRecoveryPointDetails replication provider specific recovery point details. +type BasicProviderSpecificRecoveryPointDetails interface { + AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) + AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) + AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) + AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) +} + +// ProviderSpecificRecoveryPointDetails replication provider specific recovery point details. +type ProviderSpecificRecoveryPointDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicProviderSpecificRecoveryPointDetails(body []byte) (BasicProviderSpecificRecoveryPointDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A): + var arpd A2ARecoveryPointDetails + err := json.Unmarshal(body, &arpd) + return arpd, err + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2): + var imavrpd InMageAzureV2RecoveryPointDetails + err := json.Unmarshal(body, &imavrpd) + return imavrpd, err + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm): + var imrrpd InMageRcmRecoveryPointDetails + err := json.Unmarshal(body, &imrrpd) + return imrrpd, err + default: + var psrpd ProviderSpecificRecoveryPointDetails + err := json.Unmarshal(body, &psrpd) + return psrpd, err + } +} +func unmarshalBasicProviderSpecificRecoveryPointDetailsArray(body []byte) ([]BasicProviderSpecificRecoveryPointDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + psrpdArray := make([]BasicProviderSpecificRecoveryPointDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + psrpd, err := unmarshalBasicProviderSpecificRecoveryPointDetails(*rawMessage) + if err != nil { + return nil, err + } + psrpdArray[index] = psrpd + } + return psrpdArray, nil +} + +// MarshalJSON is the custom marshaler for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) MarshalJSON() ([]byte, error) { + psrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails + objectMap := make(map[string]interface{}) + if psrpd.InstanceType != "" { + objectMap["instanceType"] = psrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return &psrpd, true +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &psrpd, true +} + +// PushInstallerDetails push installer details. +type PushInstallerDetails struct { + // ID - READ-ONLY; The push installer Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The push installer name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The push installer Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The push installer Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the push installer. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the push installer. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for PushInstallerDetails. +func (pid PushInstallerDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RcmProxyDetails RCM proxy details. +type RcmProxyDetails struct { + // ID - READ-ONLY; The RCM proxy Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The RCM proxy name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The RCM proxy Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The RCM proxy Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // ClientAuthenticationType - READ-ONLY; The client authentication type. + ClientAuthenticationType *string `json:"clientAuthenticationType,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the RCM proxy. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the RCM proxy. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for RcmProxyDetails. +func (rpd RcmProxyDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// BasicRecoveryAvailabilitySetCustomDetails recovery Availability Set custom input. +type BasicRecoveryAvailabilitySetCustomDetails interface { + AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) + AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) +} + +// RecoveryAvailabilitySetCustomDetails recovery Availability Set custom input. +type RecoveryAvailabilitySetCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails', 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryAvailabilitySetCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryAvailabilitySetCustomDetails(body []byte) (BasicRecoveryAvailabilitySetCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting): + var eras ExistingRecoveryAvailabilitySet + err := json.Unmarshal(body, &eras) + return eras, err + default: + var rascd RecoveryAvailabilitySetCustomDetails + err := json.Unmarshal(body, &rascd) + return rascd, err + } +} +func unmarshalBasicRecoveryAvailabilitySetCustomDetailsArray(body []byte) ([]BasicRecoveryAvailabilitySetCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rascdArray := make([]BasicRecoveryAvailabilitySetCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rascd, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rascdArray[index] = rascd + } + return rascdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) MarshalJSON() ([]byte, error) { + rascd.ResourceType = ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails + objectMap := make(map[string]interface{}) + if rascd.ResourceType != "" { + objectMap["resourceType"] = rascd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryAvailabilitySet is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) { + return nil, false +} + +// AsRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) { + return &rascd, true +} + +// AsBasicRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsBasicRecoveryAvailabilitySetCustomDetails() (BasicRecoveryAvailabilitySetCustomDetails, bool) { + return &rascd, true +} + +// RecoveryPlan recovery plan details. +type RecoveryPlan struct { + autorest.Response `json:"-"` + // Properties - The custom details. + Properties *RecoveryPlanProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlan. +func (rp RecoveryPlan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.Properties != nil { + objectMap["properties"] = rp.Properties + } + if rp.Location != nil { + objectMap["location"] = rp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryPlanA2ADetails recovery plan A2A specific details. +type RecoveryPlanA2ADetails struct { + // PrimaryZone - The primary zone. + PrimaryZone *string `json:"primaryZone,omitempty"` + // RecoveryZone - The recovery zone. + RecoveryZone *string `json:"recoveryZone,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails', 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) MarshalJSON() ([]byte, error) { + rpad.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpad.PrimaryZone != nil { + objectMap["primaryZone"] = rpad.PrimaryZone + } + if rpad.RecoveryZone != nil { + objectMap["recoveryZone"] = rpad.RecoveryZone + } + if rpad.InstanceType != "" { + objectMap["instanceType"] = rpad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2ADetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) { + return &rpad, true +} + +// AsRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsBasicRecoveryPlanProviderSpecificDetails() (BasicRecoveryPlanProviderSpecificDetails, bool) { + return &rpad, true +} + +// RecoveryPlanA2AFailoverInput recovery plan A2A failover input. +type RecoveryPlanA2AFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'Latest', 'LatestApplicationConsistent', 'LatestCrashConsistent', 'LatestProcessed' + RecoveryPointType A2ARpRecoveryPointType `json:"recoveryPointType,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for TFO or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // MultiVMSyncPointOption - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. Possible values include: 'UseMultiVMSyncRecoveryPoint', 'UsePerVMRecoveryPoint' + MultiVMSyncPointOption MultiVMSyncPointOption `json:"multiVmSyncPointOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) MarshalJSON() ([]byte, error) { + rpafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpafi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpafi.RecoveryPointType + } + if rpafi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = rpafi.CloudServiceCreationOption + } + if rpafi.MultiVMSyncPointOption != "" { + objectMap["multiVmSyncPointOption"] = rpafi.MultiVMSyncPointOption + } + if rpafi.InstanceType != "" { + objectMap["instanceType"] = rpafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return &rpafi, true +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpafi, true +} + +// RecoveryPlanA2AInput recovery plan A2A input. +type RecoveryPlanA2AInput struct { + // PrimaryZone - The primary zone. + PrimaryZone *string `json:"primaryZone,omitempty"` + // RecoveryZone - The recovery zone. + RecoveryZone *string `json:"recoveryZone,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) MarshalJSON() ([]byte, error) { + rpai.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpai.PrimaryZone != nil { + objectMap["primaryZone"] = rpai.PrimaryZone + } + if rpai.RecoveryZone != nil { + objectMap["recoveryZone"] = rpai.RecoveryZone + } + if rpai.InstanceType != "" { + objectMap["instanceType"] = rpai.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) { + return &rpai, true +} + +// AsRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsBasicRecoveryPlanProviderSpecificInput() (BasicRecoveryPlanProviderSpecificInput, bool) { + return &rpai, true +} + +// RecoveryPlanAction recovery plan action details. +type RecoveryPlanAction struct { + // ActionName - The action name. + ActionName *string `json:"actionName,omitempty"` + // FailoverTypes - The list of failover types. + FailoverTypes *[]ReplicationProtectedItemOperation `json:"failoverTypes,omitempty"` + // FailoverDirections - The list of failover directions. + FailoverDirections *[]PossibleOperationsDirections `json:"failoverDirections,omitempty"` + // CustomDetails - The custom details. + CustomDetails BasicRecoveryPlanActionDetails `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanAction struct. +func (rpa *RecoveryPlanAction) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "actionName": + if v != nil { + var actionName string + err = json.Unmarshal(*v, &actionName) + if err != nil { + return err + } + rpa.ActionName = &actionName + } + case "failoverTypes": + if v != nil { + var failoverTypes []ReplicationProtectedItemOperation + err = json.Unmarshal(*v, &failoverTypes) + if err != nil { + return err + } + rpa.FailoverTypes = &failoverTypes + } + case "failoverDirections": + if v != nil { + var failoverDirections []PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirections) + if err != nil { + return err + } + rpa.FailoverDirections = &failoverDirections + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicRecoveryPlanActionDetails(*v) + if err != nil { + return err + } + rpa.CustomDetails = customDetails + } + } + } + + return nil +} + +// BasicRecoveryPlanActionDetails recovery plan action custom details. +type BasicRecoveryPlanActionDetails interface { + AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) + AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) + AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) + AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) +} + +// RecoveryPlanActionDetails recovery plan action custom details. +type RecoveryPlanActionDetails struct { + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanActionDetails(body []byte) (BasicRecoveryPlanActionDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAutomationRunbookActionDetails): + var rparad RecoveryPlanAutomationRunbookActionDetails + err := json.Unmarshal(body, &rparad) + return rparad, err + case string(InstanceTypeManualActionDetails): + var rpmad RecoveryPlanManualActionDetails + err := json.Unmarshal(body, &rpmad) + return rpmad, err + case string(InstanceTypeScriptActionDetails): + var rpsad RecoveryPlanScriptActionDetails + err := json.Unmarshal(body, &rpsad) + return rpsad, err + default: + var rpad RecoveryPlanActionDetails + err := json.Unmarshal(body, &rpad) + return rpad, err + } +} +func unmarshalBasicRecoveryPlanActionDetailsArray(body []byte) ([]BasicRecoveryPlanActionDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpadArray := make([]BasicRecoveryPlanActionDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpad, err := unmarshalBasicRecoveryPlanActionDetails(*rawMessage) + if err != nil { + return nil, err + } + rpadArray[index] = rpad + } + return rpadArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) MarshalJSON() ([]byte, error) { + rpad.InstanceType = InstanceTypeRecoveryPlanActionDetails + objectMap := make(map[string]interface{}) + if rpad.InstanceType != "" { + objectMap["instanceType"] = rpad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return &rpad, true +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpad, true +} + +// RecoveryPlanAutomationRunbookActionDetails recovery plan Automation runbook action details. +type RecoveryPlanAutomationRunbookActionDetails struct { + // RunbookID - The runbook ARM Id. + RunbookID *string `json:"runbookId,omitempty"` + // Timeout - The runbook timeout. + Timeout *string `json:"timeout,omitempty"` + // FabricLocation - The fabric location. Possible values include: 'Primary', 'Recovery' + FabricLocation RecoveryPlanActionLocation `json:"fabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) MarshalJSON() ([]byte, error) { + rparad.InstanceType = InstanceTypeAutomationRunbookActionDetails + objectMap := make(map[string]interface{}) + if rparad.RunbookID != nil { + objectMap["runbookId"] = rparad.RunbookID + } + if rparad.Timeout != nil { + objectMap["timeout"] = rparad.Timeout + } + if rparad.FabricLocation != "" { + objectMap["fabricLocation"] = rparad.FabricLocation + } + if rparad.InstanceType != "" { + objectMap["instanceType"] = rparad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return &rparad, true +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rparad, true +} + +// RecoveryPlanCollection recovery plan collection details. +type RecoveryPlanCollection struct { + autorest.Response `json:"-"` + // Value - The list of recovery plans. + Value *[]RecoveryPlan `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryPlanCollectionIterator provides access to a complete listing of RecoveryPlan values. +type RecoveryPlanCollectionIterator struct { + i int + page RecoveryPlanCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryPlanCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPlanCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryPlanCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryPlanCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryPlanCollectionIterator) Response() RecoveryPlanCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryPlanCollectionIterator) Value() RecoveryPlan { + if !iter.page.NotDone() { + return RecoveryPlan{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryPlanCollectionIterator type. +func NewRecoveryPlanCollectionIterator(page RecoveryPlanCollectionPage) RecoveryPlanCollectionIterator { + return RecoveryPlanCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (RPCVar RecoveryPlanCollection) IsEmpty() bool { + return RPCVar.Value == nil || len(*RPCVar.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (RPCVar RecoveryPlanCollection) hasNextLink() bool { + return RPCVar.NextLink != nil && len(*RPCVar.NextLink) != 0 +} + +// recoveryPlanCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (RPCVar RecoveryPlanCollection) recoveryPlanCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !RPCVar.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(RPCVar.NextLink))) +} + +// RecoveryPlanCollectionPage contains a page of RecoveryPlan values. +type RecoveryPlanCollectionPage struct { + fn func(context.Context, RecoveryPlanCollection) (RecoveryPlanCollection, error) + RPCVar RecoveryPlanCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryPlanCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPlanCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.RPCVar) + if err != nil { + return err + } + page.RPCVar = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryPlanCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryPlanCollectionPage) NotDone() bool { + return !page.RPCVar.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryPlanCollectionPage) Response() RecoveryPlanCollection { + return page.RPCVar +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryPlanCollectionPage) Values() []RecoveryPlan { + if page.RPCVar.IsEmpty() { + return nil + } + return *page.RPCVar.Value +} + +// Creates a new instance of the RecoveryPlanCollectionPage type. +func NewRecoveryPlanCollectionPage(cur RecoveryPlanCollection, getNextPage func(context.Context, RecoveryPlanCollection) (RecoveryPlanCollection, error)) RecoveryPlanCollectionPage { + return RecoveryPlanCollectionPage{ + fn: getNextPage, + RPCVar: cur, + } +} + +// RecoveryPlanGroup recovery plan group details. +type RecoveryPlanGroup struct { + // GroupType - The group type. Possible values include: 'Shutdown', 'Boot', 'Failover' + GroupType RecoveryPlanGroupType `json:"groupType,omitempty"` + // ReplicationProtectedItems - The list of protected items. + ReplicationProtectedItems *[]RecoveryPlanProtectedItem `json:"replicationProtectedItems,omitempty"` + // StartGroupActions - The start group actions. + StartGroupActions *[]RecoveryPlanAction `json:"startGroupActions,omitempty"` + // EndGroupActions - The end group actions. + EndGroupActions *[]RecoveryPlanAction `json:"endGroupActions,omitempty"` +} + +// BasicRecoveryPlanGroupTaskDetails this class represents the recovery plan group task. +type BasicRecoveryPlanGroupTaskDetails interface { + AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) + AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) +} + +// RecoveryPlanGroupTaskDetails this class represents the recovery plan group task. +type RecoveryPlanGroupTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // GroupID - The group identifier. + GroupID *string `json:"groupId,omitempty"` + // RpGroupType - The group type. + RpGroupType *string `json:"rpGroupType,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanGroupTaskDetails(body []byte) (BasicRecoveryPlanGroupTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeRecoveryPlanShutdownGroupTaskDetails): + var rpsgtd RecoveryPlanShutdownGroupTaskDetails + err := json.Unmarshal(body, &rpsgtd) + return rpsgtd, err + default: + var rpgtd RecoveryPlanGroupTaskDetails + err := json.Unmarshal(body, &rpgtd) + return rpgtd, err + } +} +func unmarshalBasicRecoveryPlanGroupTaskDetailsArray(body []byte) ([]BasicRecoveryPlanGroupTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpgtdArray := make([]BasicRecoveryPlanGroupTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpgtd, err := unmarshalBasicRecoveryPlanGroupTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + rpgtdArray[index] = rpgtd + } + return rpgtdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) MarshalJSON() ([]byte, error) { + rpgtd.InstanceType = InstanceTypeRecoveryPlanGroupTaskDetails + objectMap := make(map[string]interface{}) + if rpgtd.Name != nil { + objectMap["name"] = rpgtd.Name + } + if rpgtd.GroupID != nil { + objectMap["groupId"] = rpgtd.GroupID + } + if rpgtd.RpGroupType != nil { + objectMap["rpGroupType"] = rpgtd.RpGroupType + } + if rpgtd.ChildTasks != nil { + objectMap["childTasks"] = rpgtd.ChildTasks + } + if rpgtd.InstanceType != "" { + objectMap["instanceType"] = rpgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return &rpgtd, true +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return &rpgtd, true +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &rpgtd, true +} + +// RecoveryPlanHyperVReplicaAzureFailbackInput recovery plan HVR Azure failback input. +type RecoveryPlanHyperVReplicaAzureFailbackInput struct { + // DataSyncOption - The data sync option. Possible values include: 'ForDownTime', 'ForSynchronization' + DataSyncOption DataSyncStatus `json:"dataSyncOption,omitempty"` + // RecoveryVMCreationOption - The ALR option. Possible values include: 'CreateVMIfNotFound', 'NoAction' + RecoveryVMCreationOption AlternateLocationRecoveryOption `json:"recoveryVmCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) MarshalJSON() ([]byte, error) { + rphvrafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback + objectMap := make(map[string]interface{}) + if rphvrafi.DataSyncOption != "" { + objectMap["dataSyncOption"] = rphvrafi.DataSyncOption + } + if rphvrafi.RecoveryVMCreationOption != "" { + objectMap["recoveryVmCreationOption"] = rphvrafi.RecoveryVMCreationOption + } + if rphvrafi.InstanceType != "" { + objectMap["instanceType"] = rphvrafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return &rphvrafi, true +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rphvrafi, true +} + +// RecoveryPlanHyperVReplicaAzureFailoverInput recovery plan HVR Azure failover input. +type RecoveryPlanHyperVReplicaAzureFailoverInput struct { + // PrimaryKekCertificatePfx - The primary KEK certificate PFX. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - The secondary KEK certificate PFX. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointType - The recovery point type. Possible values include: 'HyperVReplicaAzureRpRecoveryPointTypeLatest', 'HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent', 'HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed' + RecoveryPointType HyperVReplicaAzureRpRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) MarshalJSON() ([]byte, error) { + rphvrafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if rphvrafi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = rphvrafi.PrimaryKekCertificatePfx + } + if rphvrafi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = rphvrafi.SecondaryKekCertificatePfx + } + if rphvrafi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rphvrafi.RecoveryPointType + } + if rphvrafi.InstanceType != "" { + objectMap["instanceType"] = rphvrafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return &rphvrafi, true +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rphvrafi, true +} + +// RecoveryPlanInMageAzureV2FailoverInput recovery plan InMageAzureV2 failover input. +type RecoveryPlanInMageAzureV2FailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'InMageV2RpRecoveryPointTypeLatest', 'InMageV2RpRecoveryPointTypeLatestApplicationConsistent', 'InMageV2RpRecoveryPointTypeLatestCrashConsistent', 'InMageV2RpRecoveryPointTypeLatestProcessed' + RecoveryPointType InMageV2RpRecoveryPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) MarshalJSON() ([]byte, error) { + rpimavfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if rpimavfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimavfi.RecoveryPointType + } + if rpimavfi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimavfi.UseMultiVMSyncPoint + } + if rpimavfi.InstanceType != "" { + objectMap["instanceType"] = rpimavfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return &rpimavfi, true +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimavfi, true +} + +// RecoveryPlanInMageFailoverInput recovery plan InMage failover input. +type RecoveryPlanInMageFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'RpInMageRecoveryPointTypeLatestTime', 'RpInMageRecoveryPointTypeLatestTag', 'RpInMageRecoveryPointTypeCustom' + RecoveryPointType RpInMageRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) MarshalJSON() ([]byte, error) { + rpimfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if rpimfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimfi.RecoveryPointType + } + if rpimfi.InstanceType != "" { + objectMap["instanceType"] = rpimfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return &rpimfi, true +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimfi, true +} + +// RecoveryPlanInMageRcmFailbackFailoverInput recovery plan InMageRcmFailback failover input. +type RecoveryPlanInMageRcmFailbackFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'ApplicationConsistent', 'CrashConsistent' + RecoveryPointType InMageRcmFailbackRecoveryPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) MarshalJSON() ([]byte, error) { + rpimrffi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if rpimrffi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimrffi.RecoveryPointType + } + if rpimrffi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimrffi.UseMultiVMSyncPoint + } + if rpimrffi.InstanceType != "" { + objectMap["instanceType"] = rpimrffi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return &rpimrffi, true +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimrffi, true +} + +// RecoveryPlanInMageRcmFailoverInput recovery plan InMageRcm failover input. +type RecoveryPlanInMageRcmFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'RecoveryPlanPointTypeLatest', 'RecoveryPlanPointTypeLatestApplicationConsistent', 'RecoveryPlanPointTypeLatestCrashConsistent', 'RecoveryPlanPointTypeLatestProcessed' + RecoveryPointType RecoveryPlanPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) MarshalJSON() ([]byte, error) { + rpimrfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if rpimrfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimrfi.RecoveryPointType + } + if rpimrfi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimrfi.UseMultiVMSyncPoint + } + if rpimrfi.InstanceType != "" { + objectMap["instanceType"] = rpimrfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return &rpimrfi, true +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimrfi, true +} + +// RecoveryPlanManualActionDetails recovery plan manual action details. +type RecoveryPlanManualActionDetails struct { + // Description - The manual action description. + Description *string `json:"description,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) MarshalJSON() ([]byte, error) { + rpmad.InstanceType = InstanceTypeManualActionDetails + objectMap := make(map[string]interface{}) + if rpmad.Description != nil { + objectMap["description"] = rpmad.Description + } + if rpmad.InstanceType != "" { + objectMap["instanceType"] = rpmad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return &rpmad, true +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpmad, true +} + +// RecoveryPlanPlannedFailoverInput recovery plan planned failover input. +type RecoveryPlanPlannedFailoverInput struct { + // Properties - The recovery plan planned failover input properties. + Properties *RecoveryPlanPlannedFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanPlannedFailoverInputProperties recovery plan planned failover input properties. +type RecoveryPlanPlannedFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanPlannedFailoverInputProperties struct. +func (rppfip *RecoveryPlanPlannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rppfip.FailoverDirection = failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rppfip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanProperties recovery plan properties. +type RecoveryPlanProperties struct { + // FriendlyName - The friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // PrimaryFabricID - The primary fabric Id. + PrimaryFabricID *string `json:"primaryFabricId,omitempty"` + // PrimaryFabricFriendlyName - The primary fabric friendly name. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // RecoveryFabricID - The recovery fabric Id. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // RecoveryFabricFriendlyName - The recovery fabric friendly name. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // FailoverDeploymentModel - The failover deployment model. + FailoverDeploymentModel *string `json:"failoverDeploymentModel,omitempty"` + // ReplicationProviders - The list of replication providers. + ReplicationProviders *[]string `json:"replicationProviders,omitempty"` + // AllowedOperations - The list of allowed operations. + AllowedOperations *[]string `json:"allowedOperations,omitempty"` + // LastPlannedFailoverTime - The start time of the last planned failover. + LastPlannedFailoverTime *date.Time `json:"lastPlannedFailoverTime,omitempty"` + // LastUnplannedFailoverTime - The start time of the last unplanned failover. + LastUnplannedFailoverTime *date.Time `json:"lastUnplannedFailoverTime,omitempty"` + // LastTestFailoverTime - The start time of the last test failover. + LastTestFailoverTime *date.Time `json:"lastTestFailoverTime,omitempty"` + // CurrentScenario - The current scenario details. + CurrentScenario *CurrentScenarioDetails `json:"currentScenario,omitempty"` + // CurrentScenarioStatus - The recovery plan status. + CurrentScenarioStatus *string `json:"currentScenarioStatus,omitempty"` + // CurrentScenarioStatusDescription - The recovery plan status description. + CurrentScenarioStatusDescription *string `json:"currentScenarioStatusDescription,omitempty"` + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` + // ProviderSpecificDetails - The provider id and provider specific details. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanProperties struct. +func (rpp *RecoveryPlanProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpp.FriendlyName = &friendlyName + } + case "primaryFabricId": + if v != nil { + var primaryFabricID string + err = json.Unmarshal(*v, &primaryFabricID) + if err != nil { + return err + } + rpp.PrimaryFabricID = &primaryFabricID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + rpp.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + rpp.RecoveryFabricID = &recoveryFabricID + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + rpp.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "failoverDeploymentModel": + if v != nil { + var failoverDeploymentModel string + err = json.Unmarshal(*v, &failoverDeploymentModel) + if err != nil { + return err + } + rpp.FailoverDeploymentModel = &failoverDeploymentModel + } + case "replicationProviders": + if v != nil { + var replicationProviders []string + err = json.Unmarshal(*v, &replicationProviders) + if err != nil { + return err + } + rpp.ReplicationProviders = &replicationProviders + } + case "allowedOperations": + if v != nil { + var allowedOperations []string + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + rpp.AllowedOperations = &allowedOperations + } + case "lastPlannedFailoverTime": + if v != nil { + var lastPlannedFailoverTime date.Time + err = json.Unmarshal(*v, &lastPlannedFailoverTime) + if err != nil { + return err + } + rpp.LastPlannedFailoverTime = &lastPlannedFailoverTime + } + case "lastUnplannedFailoverTime": + if v != nil { + var lastUnplannedFailoverTime date.Time + err = json.Unmarshal(*v, &lastUnplannedFailoverTime) + if err != nil { + return err + } + rpp.LastUnplannedFailoverTime = &lastUnplannedFailoverTime + } + case "lastTestFailoverTime": + if v != nil { + var lastTestFailoverTime date.Time + err = json.Unmarshal(*v, &lastTestFailoverTime) + if err != nil { + return err + } + rpp.LastTestFailoverTime = &lastTestFailoverTime + } + case "currentScenario": + if v != nil { + var currentScenario CurrentScenarioDetails + err = json.Unmarshal(*v, ¤tScenario) + if err != nil { + return err + } + rpp.CurrentScenario = ¤tScenario + } + case "currentScenarioStatus": + if v != nil { + var currentScenarioStatus string + err = json.Unmarshal(*v, ¤tScenarioStatus) + if err != nil { + return err + } + rpp.CurrentScenarioStatus = ¤tScenarioStatus + } + case "currentScenarioStatusDescription": + if v != nil { + var currentScenarioStatusDescription string + err = json.Unmarshal(*v, ¤tScenarioStatusDescription) + if err != nil { + return err + } + rpp.CurrentScenarioStatusDescription = ¤tScenarioStatusDescription + } + case "groups": + if v != nil { + var groups []RecoveryPlanGroup + err = json.Unmarshal(*v, &groups) + if err != nil { + return err + } + rpp.Groups = &groups + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificDetailsArray(*v) + if err != nil { + return err + } + rpp.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanProtectedItem recovery plan protected item. +type RecoveryPlanProtectedItem struct { + // ID - The ARM Id of the recovery plan protected item. + ID *string `json:"id,omitempty"` + // VirtualMachineID - The virtual machine Id. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` +} + +// BasicRecoveryPlanProviderSpecificDetails recovery plan provider specific details. +type BasicRecoveryPlanProviderSpecificDetails interface { + AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) + AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) +} + +// RecoveryPlanProviderSpecificDetails recovery plan provider specific details. +type RecoveryPlanProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails', 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificDetails(body []byte) (BasicRecoveryPlanProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A): + var rpad RecoveryPlanA2ADetails + err := json.Unmarshal(body, &rpad) + return rpad, err + default: + var rppsd RecoveryPlanProviderSpecificDetails + err := json.Unmarshal(body, &rppsd) + return rppsd, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificDetailsArray(body []byte) ([]BasicRecoveryPlanProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsdArray := make([]BasicRecoveryPlanProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsd, err := unmarshalBasicRecoveryPlanProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + rppsdArray[index] = rppsd + } + return rppsdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) MarshalJSON() ([]byte, error) { + rppsd.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails + objectMap := make(map[string]interface{}) + if rppsd.InstanceType != "" { + objectMap["instanceType"] = rppsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2ADetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) { + return &rppsd, true +} + +// AsBasicRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsBasicRecoveryPlanProviderSpecificDetails() (BasicRecoveryPlanProviderSpecificDetails, bool) { + return &rppsd, true +} + +// BasicRecoveryPlanProviderSpecificFailoverInput recovery plan provider specific failover input. +type BasicRecoveryPlanProviderSpecificFailoverInput interface { + AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) + AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) + AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) + AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) + AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) + AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) + AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) + AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) +} + +// RecoveryPlanProviderSpecificFailoverInput recovery plan provider specific failover input. +type RecoveryPlanProviderSpecificFailoverInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificFailoverInput(body []byte) (BasicRecoveryPlanProviderSpecificFailoverInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A): + var rpafi RecoveryPlanA2AFailoverInput + err := json.Unmarshal(body, &rpafi) + return rpafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback): + var rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput + err := json.Unmarshal(body, &rphvrafi) + return rphvrafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure): + var rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput + err := json.Unmarshal(body, &rphvrafi) + return rphvrafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2): + var rpimavfi RecoveryPlanInMageAzureV2FailoverInput + err := json.Unmarshal(body, &rpimavfi) + return rpimavfi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage): + var rpimfi RecoveryPlanInMageFailoverInput + err := json.Unmarshal(body, &rpimfi) + return rpimfi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback): + var rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput + err := json.Unmarshal(body, &rpimrffi) + return rpimrffi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm): + var rpimrfi RecoveryPlanInMageRcmFailoverInput + err := json.Unmarshal(body, &rpimrfi) + return rpimrfi, err + default: + var rppsfi RecoveryPlanProviderSpecificFailoverInput + err := json.Unmarshal(body, &rppsfi) + return rppsfi, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(body []byte) ([]BasicRecoveryPlanProviderSpecificFailoverInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsfiArray := make([]BasicRecoveryPlanProviderSpecificFailoverInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsfi, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInput(*rawMessage) + if err != nil { + return nil, err + } + rppsfiArray[index] = rppsfi + } + return rppsfiArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) MarshalJSON() ([]byte, error) { + rppsfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput + objectMap := make(map[string]interface{}) + if rppsfi.InstanceType != "" { + objectMap["instanceType"] = rppsfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return &rppsfi, true +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rppsfi, true +} + +// BasicRecoveryPlanProviderSpecificInput recovery plan provider specific input base class. +type BasicRecoveryPlanProviderSpecificInput interface { + AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) + AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) +} + +// RecoveryPlanProviderSpecificInput recovery plan provider specific input base class. +type RecoveryPlanProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificInput(body []byte) (BasicRecoveryPlanProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A): + var rpai RecoveryPlanA2AInput + err := json.Unmarshal(body, &rpai) + return rpai, err + default: + var rppsi RecoveryPlanProviderSpecificInput + err := json.Unmarshal(body, &rppsi) + return rppsi, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificInputArray(body []byte) ([]BasicRecoveryPlanProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsiArray := make([]BasicRecoveryPlanProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsi, err := unmarshalBasicRecoveryPlanProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rppsiArray[index] = rppsi + } + return rppsiArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) MarshalJSON() ([]byte, error) { + rppsi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput + objectMap := make(map[string]interface{}) + if rppsi.InstanceType != "" { + objectMap["instanceType"] = rppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) { + return &rppsi, true +} + +// AsBasicRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsBasicRecoveryPlanProviderSpecificInput() (BasicRecoveryPlanProviderSpecificInput, bool) { + return &rppsi, true +} + +// RecoveryPlanScriptActionDetails recovery plan script action details. +type RecoveryPlanScriptActionDetails struct { + // Path - The script path. + Path *string `json:"path,omitempty"` + // Timeout - The script timeout. + Timeout *string `json:"timeout,omitempty"` + // FabricLocation - The fabric location. Possible values include: 'Primary', 'Recovery' + FabricLocation RecoveryPlanActionLocation `json:"fabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) MarshalJSON() ([]byte, error) { + rpsad.InstanceType = InstanceTypeScriptActionDetails + objectMap := make(map[string]interface{}) + if rpsad.Path != nil { + objectMap["path"] = rpsad.Path + } + if rpsad.Timeout != nil { + objectMap["timeout"] = rpsad.Timeout + } + if rpsad.FabricLocation != "" { + objectMap["fabricLocation"] = rpsad.FabricLocation + } + if rpsad.InstanceType != "" { + objectMap["instanceType"] = rpsad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return &rpsad, true +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpsad, true +} + +// RecoveryPlanShutdownGroupTaskDetails this class represents the recovery plan shutdown group task +// details. +type RecoveryPlanShutdownGroupTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // GroupID - The group identifier. + GroupID *string `json:"groupId,omitempty"` + // RpGroupType - The group type. + RpGroupType *string `json:"rpGroupType,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) MarshalJSON() ([]byte, error) { + rpsgtd.InstanceType = InstanceTypeRecoveryPlanShutdownGroupTaskDetails + objectMap := make(map[string]interface{}) + if rpsgtd.Name != nil { + objectMap["name"] = rpsgtd.Name + } + if rpsgtd.GroupID != nil { + objectMap["groupId"] = rpsgtd.GroupID + } + if rpsgtd.RpGroupType != nil { + objectMap["rpGroupType"] = rpsgtd.RpGroupType + } + if rpsgtd.ChildTasks != nil { + objectMap["childTasks"] = rpsgtd.ChildTasks + } + if rpsgtd.InstanceType != "" { + objectMap["instanceType"] = rpsgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// RecoveryPlanTestFailoverCleanupInput recovery plan test failover cleanup input. +type RecoveryPlanTestFailoverCleanupInput struct { + // Properties - The recovery plan test failover cleanup input properties. + Properties *RecoveryPlanTestFailoverCleanupInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanTestFailoverCleanupInputProperties recovery plan test failover cleanup input properties. +type RecoveryPlanTestFailoverCleanupInputProperties struct { + // Comments - The test failover cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// RecoveryPlanTestFailoverInput recovery plan test failover input. +type RecoveryPlanTestFailoverInput struct { + // Properties - The recovery plan test failover input properties. + Properties *RecoveryPlanTestFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanTestFailoverInputProperties recovery plan test failover input properties. +type RecoveryPlanTestFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // NetworkType - The network type to be used for test failover. + NetworkType *string `json:"networkType,omitempty"` + // NetworkID - The Id of the network to be used for test failover. + NetworkID *string `json:"networkId,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanTestFailoverInputProperties struct. +func (rptfip *RecoveryPlanTestFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rptfip.FailoverDirection = failoverDirection + } + case "networkType": + if v != nil { + var networkType string + err = json.Unmarshal(*v, &networkType) + if err != nil { + return err + } + rptfip.NetworkType = &networkType + } + case "networkId": + if v != nil { + var networkID string + err = json.Unmarshal(*v, &networkID) + if err != nil { + return err + } + rptfip.NetworkID = &networkID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rptfip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanUnplannedFailoverInput recovery plan unplanned failover input. +type RecoveryPlanUnplannedFailoverInput struct { + // Properties - The recovery plan unplanned failover input properties. + Properties *RecoveryPlanUnplannedFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanUnplannedFailoverInputProperties recovery plan unplanned failover input properties. +type RecoveryPlanUnplannedFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // SourceSiteOperations - A value indicating whether source site operations are required. Possible values include: 'Required', 'NotRequired' + SourceSiteOperations SourceSiteOperations `json:"sourceSiteOperations,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanUnplannedFailoverInputProperties struct. +func (rpufip *RecoveryPlanUnplannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rpufip.FailoverDirection = failoverDirection + } + case "sourceSiteOperations": + if v != nil { + var sourceSiteOperations SourceSiteOperations + err = json.Unmarshal(*v, &sourceSiteOperations) + if err != nil { + return err + } + rpufip.SourceSiteOperations = sourceSiteOperations + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rpufip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPoint recovery point. +type RecoveryPoint struct { + autorest.Response `json:"-"` + // Properties - The recovery point properties. + Properties *RecoveryPointProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPoint. +func (rp RecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.Properties != nil { + objectMap["properties"] = rp.Properties + } + if rp.Location != nil { + objectMap["location"] = rp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryPointCollection collection of recovery point details. +type RecoveryPointCollection struct { + autorest.Response `json:"-"` + // Value - The recovery point details. + Value *[]RecoveryPoint `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryPointCollectionIterator provides access to a complete listing of RecoveryPoint values. +type RecoveryPointCollectionIterator struct { + i int + page RecoveryPointCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryPointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryPointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryPointCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryPointCollectionIterator) Response() RecoveryPointCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryPointCollectionIterator) Value() RecoveryPoint { + if !iter.page.NotDone() { + return RecoveryPoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryPointCollectionIterator type. +func NewRecoveryPointCollectionIterator(page RecoveryPointCollectionPage) RecoveryPointCollectionIterator { + return RecoveryPointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (RPCVar RecoveryPointCollection) IsEmpty() bool { + return RPCVar.Value == nil || len(*RPCVar.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (RPCVar RecoveryPointCollection) hasNextLink() bool { + return RPCVar.NextLink != nil && len(*RPCVar.NextLink) != 0 +} + +// recoveryPointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (RPCVar RecoveryPointCollection) recoveryPointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !RPCVar.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(RPCVar.NextLink))) +} + +// RecoveryPointCollectionPage contains a page of RecoveryPoint values. +type RecoveryPointCollectionPage struct { + fn func(context.Context, RecoveryPointCollection) (RecoveryPointCollection, error) + RPCVar RecoveryPointCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryPointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.RPCVar) + if err != nil { + return err + } + page.RPCVar = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryPointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryPointCollectionPage) NotDone() bool { + return !page.RPCVar.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryPointCollectionPage) Response() RecoveryPointCollection { + return page.RPCVar +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryPointCollectionPage) Values() []RecoveryPoint { + if page.RPCVar.IsEmpty() { + return nil + } + return *page.RPCVar.Value +} + +// Creates a new instance of the RecoveryPointCollectionPage type. +func NewRecoveryPointCollectionPage(cur RecoveryPointCollection, getNextPage func(context.Context, RecoveryPointCollection) (RecoveryPointCollection, error)) RecoveryPointCollectionPage { + return RecoveryPointCollectionPage{ + fn: getNextPage, + RPCVar: cur, + } +} + +// RecoveryPointProperties recovery point properties. +type RecoveryPointProperties struct { + // RecoveryPointTime - The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointType - The recovery point type: ApplicationConsistent, CrashConsistent. + RecoveryPointType *string `json:"recoveryPointType,omitempty"` + // ProviderSpecificDetails - The provider specific details for the recovery point. + ProviderSpecificDetails BasicProviderSpecificRecoveryPointDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPointProperties struct. +func (rpp *RecoveryPointProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryPointTime": + if v != nil { + var recoveryPointTime date.Time + err = json.Unmarshal(*v, &recoveryPointTime) + if err != nil { + return err + } + rpp.RecoveryPointTime = &recoveryPointTime + } + case "recoveryPointType": + if v != nil { + var recoveryPointType string + err = json.Unmarshal(*v, &recoveryPointType) + if err != nil { + return err + } + rpp.RecoveryPointType = &recoveryPointType + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicProviderSpecificRecoveryPointDetails(*v) + if err != nil { + return err + } + rpp.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicRecoveryProximityPlacementGroupCustomDetails recovery Proximity placement group custom input. +type BasicRecoveryProximityPlacementGroupCustomDetails interface { + AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) + AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) +} + +// RecoveryProximityPlacementGroupCustomDetails recovery Proximity placement group custom input. +type RecoveryProximityPlacementGroupCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails', 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(body []byte) (BasicRecoveryProximityPlacementGroupCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting): + var erppg ExistingRecoveryProximityPlacementGroup + err := json.Unmarshal(body, &erppg) + return erppg, err + default: + var rppgcd RecoveryProximityPlacementGroupCustomDetails + err := json.Unmarshal(body, &rppgcd) + return rppgcd, err + } +} +func unmarshalBasicRecoveryProximityPlacementGroupCustomDetailsArray(body []byte) ([]BasicRecoveryProximityPlacementGroupCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppgcdArray := make([]BasicRecoveryProximityPlacementGroupCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppgcd, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rppgcdArray[index] = rppgcd + } + return rppgcdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) MarshalJSON() ([]byte, error) { + rppgcd.ResourceType = ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails + objectMap := make(map[string]interface{}) + if rppgcd.ResourceType != "" { + objectMap["resourceType"] = rppgcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryProximityPlacementGroup is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) { + return nil, false +} + +// AsRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) { + return &rppgcd, true +} + +// AsBasicRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsBasicRecoveryProximityPlacementGroupCustomDetails() (BasicRecoveryProximityPlacementGroupCustomDetails, bool) { + return &rppgcd, true +} + +// BasicRecoveryResourceGroupCustomDetails recovery Resource Group custom input. +type BasicRecoveryResourceGroupCustomDetails interface { + AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) + AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) +} + +// RecoveryResourceGroupCustomDetails recovery Resource Group custom input. +type RecoveryResourceGroupCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails', 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryResourceGroupCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryResourceGroupCustomDetails(body []byte) (BasicRecoveryResourceGroupCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting): + var errrg ExistingRecoveryRecoveryResourceGroup + err := json.Unmarshal(body, &errrg) + return errrg, err + default: + var rrgcd RecoveryResourceGroupCustomDetails + err := json.Unmarshal(body, &rrgcd) + return rrgcd, err + } +} +func unmarshalBasicRecoveryResourceGroupCustomDetailsArray(body []byte) ([]BasicRecoveryResourceGroupCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rrgcdArray := make([]BasicRecoveryResourceGroupCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rrgcd, err := unmarshalBasicRecoveryResourceGroupCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rrgcdArray[index] = rrgcd + } + return rrgcdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) MarshalJSON() ([]byte, error) { + rrgcd.ResourceType = ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails + objectMap := make(map[string]interface{}) + if rrgcd.ResourceType != "" { + objectMap["resourceType"] = rrgcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryRecoveryResourceGroup is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) { + return nil, false +} + +// AsRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) { + return &rrgcd, true +} + +// AsBasicRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsBasicRecoveryResourceGroupCustomDetails() (BasicRecoveryResourceGroupCustomDetails, bool) { + return &rrgcd, true +} + +// RecoveryServicesProvider provider details. +type RecoveryServicesProvider struct { + autorest.Response `json:"-"` + // Properties - Provider properties. + Properties *RecoveryServicesProviderProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryServicesProvider. +func (rsp RecoveryServicesProvider) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rsp.Properties != nil { + objectMap["properties"] = rsp.Properties + } + if rsp.Location != nil { + objectMap["location"] = rsp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryServicesProviderCollection collection of providers. +type RecoveryServicesProviderCollection struct { + autorest.Response `json:"-"` + // Value - The Servers details. + Value *[]RecoveryServicesProvider `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryServicesProviderCollectionIterator provides access to a complete listing of +// RecoveryServicesProvider values. +type RecoveryServicesProviderCollectionIterator struct { + i int + page RecoveryServicesProviderCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryServicesProviderCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryServicesProviderCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryServicesProviderCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryServicesProviderCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryServicesProviderCollectionIterator) Response() RecoveryServicesProviderCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryServicesProviderCollectionIterator) Value() RecoveryServicesProvider { + if !iter.page.NotDone() { + return RecoveryServicesProvider{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryServicesProviderCollectionIterator type. +func NewRecoveryServicesProviderCollectionIterator(page RecoveryServicesProviderCollectionPage) RecoveryServicesProviderCollectionIterator { + return RecoveryServicesProviderCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rspc RecoveryServicesProviderCollection) IsEmpty() bool { + return rspc.Value == nil || len(*rspc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rspc RecoveryServicesProviderCollection) hasNextLink() bool { + return rspc.NextLink != nil && len(*rspc.NextLink) != 0 +} + +// recoveryServicesProviderCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rspc RecoveryServicesProviderCollection) recoveryServicesProviderCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rspc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rspc.NextLink))) +} + +// RecoveryServicesProviderCollectionPage contains a page of RecoveryServicesProvider values. +type RecoveryServicesProviderCollectionPage struct { + fn func(context.Context, RecoveryServicesProviderCollection) (RecoveryServicesProviderCollection, error) + rspc RecoveryServicesProviderCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryServicesProviderCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryServicesProviderCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rspc) + if err != nil { + return err + } + page.rspc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryServicesProviderCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryServicesProviderCollectionPage) NotDone() bool { + return !page.rspc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryServicesProviderCollectionPage) Response() RecoveryServicesProviderCollection { + return page.rspc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryServicesProviderCollectionPage) Values() []RecoveryServicesProvider { + if page.rspc.IsEmpty() { + return nil + } + return *page.rspc.Value +} + +// Creates a new instance of the RecoveryServicesProviderCollectionPage type. +func NewRecoveryServicesProviderCollectionPage(cur RecoveryServicesProviderCollection, getNextPage func(context.Context, RecoveryServicesProviderCollection) (RecoveryServicesProviderCollection, error)) RecoveryServicesProviderCollectionPage { + return RecoveryServicesProviderCollectionPage{ + fn: getNextPage, + rspc: cur, + } +} + +// RecoveryServicesProviderProperties recovery services provider properties. +type RecoveryServicesProviderProperties struct { + // FabricType - Type of the site. + FabricType *string `json:"fabricType,omitempty"` + // FriendlyName - Friendly name of the DRA. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProviderVersion - The provider version. + ProviderVersion *string `json:"providerVersion,omitempty"` + // ServerVersion - The fabric provider. + ServerVersion *string `json:"serverVersion,omitempty"` + // ProviderVersionState - DRA version status. + ProviderVersionState *string `json:"providerVersionState,omitempty"` + // ProviderVersionExpiryDate - Expiry date of the version. + ProviderVersionExpiryDate *date.Time `json:"providerVersionExpiryDate,omitempty"` + // FabricFriendlyName - The fabric friendly name. + FabricFriendlyName *string `json:"fabricFriendlyName,omitempty"` + // LastHeartBeat - Time when last heartbeat was sent by the DRA. + LastHeartBeat *date.Time `json:"lastHeartBeat,omitempty"` + // ConnectionStatus - A value indicating whether DRA is responsive. + ConnectionStatus *string `json:"connectionStatus,omitempty"` + // ProtectedItemCount - Number of protected VMs currently managed by the DRA. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // AllowedScenarios - The scenarios allowed on this provider. + AllowedScenarios *[]string `json:"allowedScenarios,omitempty"` + // HealthErrorDetails - The recovery services provider health error details. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // DraIdentifier - The DRA Id. + DraIdentifier *string `json:"draIdentifier,omitempty"` + // MachineID - The machine Id. + MachineID *string `json:"machineId,omitempty"` + // MachineName - The machine name. + MachineName *string `json:"machineName,omitempty"` + // BiosID - The Bios Id. + BiosID *string `json:"biosId,omitempty"` + // AuthenticationIdentityDetails - The authentication identity details. + AuthenticationIdentityDetails *IdentityProviderDetails `json:"authenticationIdentityDetails,omitempty"` + // ResourceAccessIdentityDetails - The resource access identity details. + ResourceAccessIdentityDetails *IdentityProviderDetails `json:"resourceAccessIdentityDetails,omitempty"` + // DataPlaneAuthenticationIdentityDetails - The data plane authentication identity details. + DataPlaneAuthenticationIdentityDetails *IdentityProviderDetails `json:"dataPlaneAuthenticationIdentityDetails,omitempty"` + // ProviderVersionDetails - The provider version details. + ProviderVersionDetails *VersionDetails `json:"providerVersionDetails,omitempty"` +} + +// BasicRecoveryVirtualNetworkCustomDetails recovery Virtual network custom input. +type BasicRecoveryVirtualNetworkCustomDetails interface { + AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) + AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) + AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) +} + +// RecoveryVirtualNetworkCustomDetails recovery Virtual network custom input. +type RecoveryVirtualNetworkCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryVirtualNetworkCustomDetails(body []byte) (BasicRecoveryVirtualNetworkCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting): + var ervn ExistingRecoveryVirtualNetwork + err := json.Unmarshal(body, &ervn) + return ervn, err + case string(ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew): + var nrvn NewRecoveryVirtualNetwork + err := json.Unmarshal(body, &nrvn) + return nrvn, err + default: + var rvncd RecoveryVirtualNetworkCustomDetails + err := json.Unmarshal(body, &rvncd) + return rvncd, err + } +} +func unmarshalBasicRecoveryVirtualNetworkCustomDetailsArray(body []byte) ([]BasicRecoveryVirtualNetworkCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rvncdArray := make([]BasicRecoveryVirtualNetworkCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rvncd, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rvncdArray[index] = rvncd + } + return rvncdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) MarshalJSON() ([]byte, error) { + rvncd.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails + objectMap := make(map[string]interface{}) + if rvncd.ResourceType != "" { + objectMap["resourceType"] = rvncd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return &rvncd, true +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &rvncd, true +} + +// RemoveDisksInput input for remove disk(s) operation. +type RemoveDisksInput struct { + // Properties - Remove disk input properties. + Properties *RemoveDisksInputProperties `json:"properties,omitempty"` +} + +// RemoveDisksInputProperties remove Disk input properties. +type RemoveDisksInputProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicRemoveDisksProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RemoveDisksInputProperties struct. +func (rdip *RemoveDisksInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRemoveDisksProviderSpecificInput(*v) + if err != nil { + return err + } + rdip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicRemoveDisksProviderSpecificInput remove Disk provider specific input. +type BasicRemoveDisksProviderSpecificInput interface { + AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) + AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) +} + +// RemoveDisksProviderSpecificInput remove Disk provider specific input. +type RemoveDisksProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput', 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRemoveDisksProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRemoveDisksProviderSpecificInput(body []byte) (BasicRemoveDisksProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A): + var ardi A2ARemoveDisksInput + err := json.Unmarshal(body, &ardi) + return ardi, err + default: + var rdpsi RemoveDisksProviderSpecificInput + err := json.Unmarshal(body, &rdpsi) + return rdpsi, err + } +} +func unmarshalBasicRemoveDisksProviderSpecificInputArray(body []byte) ([]BasicRemoveDisksProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rdpsiArray := make([]BasicRemoveDisksProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rdpsi, err := unmarshalBasicRemoveDisksProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rdpsiArray[index] = rdpsi + } + return rdpsiArray, nil +} + +// MarshalJSON is the custom marshaler for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) MarshalJSON() ([]byte, error) { + rdpsi.InstanceType = InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput + objectMap := make(map[string]interface{}) + if rdpsi.InstanceType != "" { + objectMap["instanceType"] = rdpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARemoveDisksInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) { + return nil, false +} + +// AsRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) { + return &rdpsi, true +} + +// AsBasicRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsBasicRemoveDisksProviderSpecificInput() (BasicRemoveDisksProviderSpecificInput, bool) { + return &rdpsi, true +} + +// RemoveProtectionContainerMappingInput container unpairing input. +type RemoveProtectionContainerMappingInput struct { + // Properties - Configure protection input properties. + Properties *RemoveProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// RemoveProtectionContainerMappingInputProperties unpairing input properties. +type RemoveProtectionContainerMappingInputProperties struct { + // ProviderSpecificInput - Provider specific input for unpairing. + ProviderSpecificInput *ReplicationProviderContainerUnmappingInput `json:"providerSpecificInput,omitempty"` +} + +// RenewCertificateInput certificate renewal input. +type RenewCertificateInput struct { + // Properties - Renew certificate input properties. + Properties *RenewCertificateInputProperties `json:"properties,omitempty"` +} + +// RenewCertificateInputProperties renew Certificate input properties. +type RenewCertificateInputProperties struct { + // RenewCertificateType - Renew certificate type. + RenewCertificateType *string `json:"renewCertificateType,omitempty"` +} + +// ReplicationAgentDetails replication agent details. +type ReplicationAgentDetails struct { + // ID - READ-ONLY; The replication agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The replication agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The replication agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The replication agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the replication agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the replication agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationAgentDetails. +func (rad ReplicationAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ReplicationEligibilityResults replication eligibility results response model. +type ReplicationEligibilityResults struct { + autorest.Response `json:"-"` + // Name - READ-ONLY; Gets the name of this object. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets the object type. + Type *string `json:"type,omitempty"` + // ID - READ-ONLY; Gets Unique ARM identifier for this object. + ID *string `json:"id,omitempty"` + // Properties - READ-ONLY; Gets properties model for replication eligibility results API. + Properties *ReplicationEligibilityResultsProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResults. +func (rer ReplicationEligibilityResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ReplicationEligibilityResultsCollection replication eligibility results collection response model. +type ReplicationEligibilityResultsCollection struct { + autorest.Response `json:"-"` + // Value - The replication eligibility results details. + Value *[]ReplicationEligibilityResults `json:"value,omitempty"` +} + +// ReplicationEligibilityResultsErrorInfo error model that can be exposed to the user. +type ReplicationEligibilityResultsErrorInfo struct { + // Code - The error code. + Code *string `json:"code,omitempty"` + // Message - The error message. + Message *string `json:"message,omitempty"` + // PossibleCauses - The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // Status - READ-ONLY; The error status. + Status *string `json:"status,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResultsErrorInfo. +func (rerei ReplicationEligibilityResultsErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rerei.Code != nil { + objectMap["code"] = rerei.Code + } + if rerei.Message != nil { + objectMap["message"] = rerei.Message + } + if rerei.PossibleCauses != nil { + objectMap["possibleCauses"] = rerei.PossibleCauses + } + if rerei.RecommendedAction != nil { + objectMap["recommendedAction"] = rerei.RecommendedAction + } + return json.Marshal(objectMap) +} + +// ReplicationEligibilityResultsProperties properties model for replication eligibility results API. +type ReplicationEligibilityResultsProperties struct { + // ClientRequestID - READ-ONLY; The client request Id. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // Errors - The error details. + Errors *[]ReplicationEligibilityResultsErrorInfo `json:"errors,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResultsProperties. +func (rerp ReplicationEligibilityResultsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rerp.Errors != nil { + objectMap["errors"] = rerp.Errors + } + return json.Marshal(objectMap) +} + +// ReplicationFabricsCheckConsistencyFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsCheckConsistencyFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsCheckConsistencyFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsCheckConsistencyFuture.Result. +func (future *ReplicationFabricsCheckConsistencyFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCheckConsistencyFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsCheckConsistencyFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.CheckConsistencyResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCheckConsistencyFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsCreateFuture.Result. +func (future *ReplicationFabricsCreateFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.CreateResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCreateFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsDeleteFuture.Result. +func (future *ReplicationFabricsDeleteFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsMigrateToAadFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsMigrateToAadFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsMigrateToAadFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsMigrateToAadFuture.Result. +func (future *ReplicationFabricsMigrateToAadFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsMigrateToAadFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsMigrateToAadFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsPurgeFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationFabricsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsPurgeFuture.Result. +func (future *ReplicationFabricsPurgeFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsReassociateGatewayFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsReassociateGatewayFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsReassociateGatewayFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsReassociateGatewayFuture.Result. +func (future *ReplicationFabricsReassociateGatewayFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsReassociateGatewayFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsReassociateGatewayFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.ReassociateGatewayResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsReassociateGatewayFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsRenewCertificateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsRenewCertificateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsRenewCertificateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsRenewCertificateFuture.Result. +func (future *ReplicationFabricsRenewCertificateFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsRenewCertificateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsRenewCertificateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.RenewCertificateResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsRenewCertificateFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationGroupDetails replication group details. This will be used in case of San. +type ReplicationGroupDetails struct { + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) MarshalJSON() ([]byte, error) { + rgd.InstanceType = InstanceTypeReplicationGroupDetails + objectMap := make(map[string]interface{}) + if rgd.InstanceType != "" { + objectMap["instanceType"] = rgd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return &rgd, true +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &rgd, true +} + +// ReplicationJobsCancelFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsCancelFuture.Result. +func (future *ReplicationJobsCancelFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.CancelResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsCancelFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsExportFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsExportFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsExportFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsExportFuture.Result. +func (future *ReplicationJobsExportFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsExportFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsExportFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.ExportResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsExportFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsRestartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsRestartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsRestartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsRestartFuture.Result. +func (future *ReplicationJobsRestartFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsRestartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsRestartFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.RestartResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsRestartFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsResumeFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsResumeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsResumeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsResumeFuture.Result. +func (future *ReplicationJobsResumeFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsResumeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsResumeFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.ResumeResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsResumeFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsCreateFuture.Result. +func (future *ReplicationMigrationItemsCreateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.CreateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsCreateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsDeleteFuture.Result. +func (future *ReplicationMigrationItemsDeleteFuture) result(client ReplicationMigrationItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationMigrationItemsMigrateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsMigrateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsMigrateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsMigrateFuture.Result. +func (future *ReplicationMigrationItemsMigrateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsMigrateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsMigrateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.MigrateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsMigrateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsResyncFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsResyncFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsResyncFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsResyncFuture.Result. +func (future *ReplicationMigrationItemsResyncFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsResyncFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsResyncFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.ResyncResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsResyncFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsTestMigrateCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationMigrationItemsTestMigrateCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsTestMigrateCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsTestMigrateCleanupFuture.Result. +func (future *ReplicationMigrationItemsTestMigrateCleanupFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.TestMigrateCleanupResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsTestMigrateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsTestMigrateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsTestMigrateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsTestMigrateFuture.Result. +func (future *ReplicationMigrationItemsTestMigrateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsTestMigrateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.TestMigrateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsUpdateFuture.Result. +func (future *ReplicationMigrationItemsUpdateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.UpdateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsUpdateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationNetworkMappingsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (NetworkMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsCreateFuture.Result. +func (future *ReplicationNetworkMappingsCreateFuture) result(client ReplicationNetworkMappingsClient) (nm NetworkMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + nm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nm.Response.Response, err = future.GetResult(sender); err == nil && nm.Response.Response.StatusCode != http.StatusNoContent { + nm, err = client.CreateResponder(nm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsCreateFuture", "Result", nm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationNetworkMappingsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsDeleteFuture.Result. +func (future *ReplicationNetworkMappingsDeleteFuture) result(client ReplicationNetworkMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationNetworkMappingsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (NetworkMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsUpdateFuture.Result. +func (future *ReplicationNetworkMappingsUpdateFuture) result(client ReplicationNetworkMappingsClient) (nm NetworkMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + nm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nm.Response.Response, err = future.GetResult(sender); err == nil && nm.Response.Response.StatusCode != http.StatusNoContent { + nm, err = client.UpdateResponder(nm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsUpdateFuture", "Result", nm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationPoliciesCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (Policy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesCreateFuture.Result. +func (future *ReplicationPoliciesCreateFuture) result(client ReplicationPoliciesClient) (p Policy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + p.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.CreateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesCreateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesDeleteFuture.Result. +func (future *ReplicationPoliciesDeleteFuture) result(client ReplicationPoliciesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationPoliciesUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (Policy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesUpdateFuture.Result. +func (future *ReplicationPoliciesUpdateFuture) result(client ReplicationPoliciesClient) (p Policy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + p.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.UpdateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesUpdateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItem replication protected item. +type ReplicationProtectedItem struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ReplicationProtectedItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectedItem. +func (rpi ReplicationProtectedItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpi.Properties != nil { + objectMap["properties"] = rpi.Properties + } + if rpi.Location != nil { + objectMap["location"] = rpi.Location + } + return json.Marshal(objectMap) +} + +// ReplicationProtectedItemCollection replication protected item collection. +type ReplicationProtectedItemCollection struct { + autorest.Response `json:"-"` + // Value - The Replication protected item details. + Value *[]ReplicationProtectedItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ReplicationProtectedItemCollectionIterator provides access to a complete listing of +// ReplicationProtectedItem values. +type ReplicationProtectedItemCollectionIterator struct { + i int + page ReplicationProtectedItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ReplicationProtectedItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ReplicationProtectedItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ReplicationProtectedItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ReplicationProtectedItemCollectionIterator) Response() ReplicationProtectedItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ReplicationProtectedItemCollectionIterator) Value() ReplicationProtectedItem { + if !iter.page.NotDone() { + return ReplicationProtectedItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ReplicationProtectedItemCollectionIterator type. +func NewReplicationProtectedItemCollectionIterator(page ReplicationProtectedItemCollectionPage) ReplicationProtectedItemCollectionIterator { + return ReplicationProtectedItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rpic ReplicationProtectedItemCollection) IsEmpty() bool { + return rpic.Value == nil || len(*rpic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rpic ReplicationProtectedItemCollection) hasNextLink() bool { + return rpic.NextLink != nil && len(*rpic.NextLink) != 0 +} + +// replicationProtectedItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rpic ReplicationProtectedItemCollection) replicationProtectedItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rpic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rpic.NextLink))) +} + +// ReplicationProtectedItemCollectionPage contains a page of ReplicationProtectedItem values. +type ReplicationProtectedItemCollectionPage struct { + fn func(context.Context, ReplicationProtectedItemCollection) (ReplicationProtectedItemCollection, error) + rpic ReplicationProtectedItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ReplicationProtectedItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rpic) + if err != nil { + return err + } + page.rpic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ReplicationProtectedItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ReplicationProtectedItemCollectionPage) NotDone() bool { + return !page.rpic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ReplicationProtectedItemCollectionPage) Response() ReplicationProtectedItemCollection { + return page.rpic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ReplicationProtectedItemCollectionPage) Values() []ReplicationProtectedItem { + if page.rpic.IsEmpty() { + return nil + } + return *page.rpic.Value +} + +// Creates a new instance of the ReplicationProtectedItemCollectionPage type. +func NewReplicationProtectedItemCollectionPage(cur ReplicationProtectedItemCollection, getNextPage func(context.Context, ReplicationProtectedItemCollection) (ReplicationProtectedItemCollection, error)) ReplicationProtectedItemCollectionPage { + return ReplicationProtectedItemCollectionPage{ + fn: getNextPage, + rpic: cur, + } +} + +// ReplicationProtectedItemProperties replication protected item custom data details. +type ReplicationProtectedItemProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectedItemType - The type of protected item type. + ProtectedItemType *string `json:"protectedItemType,omitempty"` + // ProtectableItemID - The protected item ARM Id. + ProtectableItemID *string `json:"protectableItemId,omitempty"` + // RecoveryServicesProviderID - The recovery provider ARM Id. + RecoveryServicesProviderID *string `json:"recoveryServicesProviderId,omitempty"` + // PrimaryFabricFriendlyName - The friendly name of the primary fabric. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // PrimaryFabricProvider - The fabric provider of the primary fabric. + PrimaryFabricProvider *string `json:"primaryFabricProvider,omitempty"` + // RecoveryFabricFriendlyName - The friendly name of recovery fabric. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // RecoveryFabricID - The Arm Id of recovery fabric. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // PrimaryProtectionContainerFriendlyName - The name of primary protection container friendly name. + PrimaryProtectionContainerFriendlyName *string `json:"primaryProtectionContainerFriendlyName,omitempty"` + // RecoveryProtectionContainerFriendlyName - The name of recovery container friendly name. + RecoveryProtectionContainerFriendlyName *string `json:"recoveryProtectionContainerFriendlyName,omitempty"` + // ProtectionState - The protection status. + ProtectionState *string `json:"protectionState,omitempty"` + // ProtectionStateDescription - The protection state description. + ProtectionStateDescription *string `json:"protectionStateDescription,omitempty"` + // ActiveLocation - The Current active location of the PE. + ActiveLocation *string `json:"activeLocation,omitempty"` + // TestFailoverState - The Test failover state. + TestFailoverState *string `json:"testFailoverState,omitempty"` + // TestFailoverStateDescription - The Test failover state description. + TestFailoverStateDescription *string `json:"testFailoverStateDescription,omitempty"` + // AllowedOperations - The allowed operations on the Replication protected item. + AllowedOperations *[]string `json:"allowedOperations,omitempty"` + // ReplicationHealth - 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 `json:"replicationHealth,omitempty"` + // FailoverHealth - The consolidated failover health for the VM. + FailoverHealth *string `json:"failoverHealth,omitempty"` + // HealthErrors - List of health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // PolicyID - The ID of Policy governing this PE. + PolicyID *string `json:"policyId,omitempty"` + // PolicyFriendlyName - The name of Policy governing this PE. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` + // LastSuccessfulFailoverTime - The Last successful failover time. + LastSuccessfulFailoverTime *date.Time `json:"lastSuccessfulFailoverTime,omitempty"` + // LastSuccessfulTestFailoverTime - The Last successful test failover time. + LastSuccessfulTestFailoverTime *date.Time `json:"lastSuccessfulTestFailoverTime,omitempty"` + // CurrentScenario - The current scenario. + CurrentScenario *CurrentScenarioDetails `json:"currentScenario,omitempty"` + // FailoverRecoveryPointID - The recovery point ARM Id to which the Vm was failed over. + FailoverRecoveryPointID *string `json:"failoverRecoveryPointId,omitempty"` + // ProviderSpecificDetails - The Replication provider custom settings. + ProviderSpecificDetails BasicReplicationProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // EventCorrelationID - The correlation Id for events associated with this protected item. + EventCorrelationID *string `json:"eventCorrelationId,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ReplicationProtectedItemProperties struct. +func (rpip *ReplicationProtectedItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpip.FriendlyName = &friendlyName + } + case "protectedItemType": + if v != nil { + var protectedItemType string + err = json.Unmarshal(*v, &protectedItemType) + if err != nil { + return err + } + rpip.ProtectedItemType = &protectedItemType + } + case "protectableItemId": + if v != nil { + var protectableItemID string + err = json.Unmarshal(*v, &protectableItemID) + if err != nil { + return err + } + rpip.ProtectableItemID = &protectableItemID + } + case "recoveryServicesProviderId": + if v != nil { + var recoveryServicesProviderID string + err = json.Unmarshal(*v, &recoveryServicesProviderID) + if err != nil { + return err + } + rpip.RecoveryServicesProviderID = &recoveryServicesProviderID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + rpip.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "primaryFabricProvider": + if v != nil { + var primaryFabricProvider string + err = json.Unmarshal(*v, &primaryFabricProvider) + if err != nil { + return err + } + rpip.PrimaryFabricProvider = &primaryFabricProvider + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + rpip.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + rpip.RecoveryFabricID = &recoveryFabricID + } + case "primaryProtectionContainerFriendlyName": + if v != nil { + var primaryProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &primaryProtectionContainerFriendlyName) + if err != nil { + return err + } + rpip.PrimaryProtectionContainerFriendlyName = &primaryProtectionContainerFriendlyName + } + case "recoveryProtectionContainerFriendlyName": + if v != nil { + var recoveryProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &recoveryProtectionContainerFriendlyName) + if err != nil { + return err + } + rpip.RecoveryProtectionContainerFriendlyName = &recoveryProtectionContainerFriendlyName + } + case "protectionState": + if v != nil { + var protectionState string + err = json.Unmarshal(*v, &protectionState) + if err != nil { + return err + } + rpip.ProtectionState = &protectionState + } + case "protectionStateDescription": + if v != nil { + var protectionStateDescription string + err = json.Unmarshal(*v, &protectionStateDescription) + if err != nil { + return err + } + rpip.ProtectionStateDescription = &protectionStateDescription + } + case "activeLocation": + if v != nil { + var activeLocation string + err = json.Unmarshal(*v, &activeLocation) + if err != nil { + return err + } + rpip.ActiveLocation = &activeLocation + } + case "testFailoverState": + if v != nil { + var testFailoverState string + err = json.Unmarshal(*v, &testFailoverState) + if err != nil { + return err + } + rpip.TestFailoverState = &testFailoverState + } + case "testFailoverStateDescription": + if v != nil { + var testFailoverStateDescription string + err = json.Unmarshal(*v, &testFailoverStateDescription) + if err != nil { + return err + } + rpip.TestFailoverStateDescription = &testFailoverStateDescription + } + case "allowedOperations": + if v != nil { + var allowedOperations []string + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + rpip.AllowedOperations = &allowedOperations + } + case "replicationHealth": + if v != nil { + var replicationHealth string + err = json.Unmarshal(*v, &replicationHealth) + if err != nil { + return err + } + rpip.ReplicationHealth = &replicationHealth + } + case "failoverHealth": + if v != nil { + var failoverHealth string + err = json.Unmarshal(*v, &failoverHealth) + if err != nil { + return err + } + rpip.FailoverHealth = &failoverHealth + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + rpip.HealthErrors = &healthErrors + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + rpip.PolicyID = &policyID + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + rpip.PolicyFriendlyName = &policyFriendlyName + } + case "lastSuccessfulFailoverTime": + if v != nil { + var lastSuccessfulFailoverTime date.Time + err = json.Unmarshal(*v, &lastSuccessfulFailoverTime) + if err != nil { + return err + } + rpip.LastSuccessfulFailoverTime = &lastSuccessfulFailoverTime + } + case "lastSuccessfulTestFailoverTime": + if v != nil { + var lastSuccessfulTestFailoverTime date.Time + err = json.Unmarshal(*v, &lastSuccessfulTestFailoverTime) + if err != nil { + return err + } + rpip.LastSuccessfulTestFailoverTime = &lastSuccessfulTestFailoverTime + } + case "currentScenario": + if v != nil { + var currentScenario CurrentScenarioDetails + err = json.Unmarshal(*v, ¤tScenario) + if err != nil { + return err + } + rpip.CurrentScenario = ¤tScenario + } + case "failoverRecoveryPointId": + if v != nil { + var failoverRecoveryPointID string + err = json.Unmarshal(*v, &failoverRecoveryPointID) + if err != nil { + return err + } + rpip.FailoverRecoveryPointID = &failoverRecoveryPointID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReplicationProviderSpecificSettings(*v) + if err != nil { + return err + } + rpip.ProviderSpecificDetails = providerSpecificDetails + } + case "recoveryContainerId": + if v != nil { + var recoveryContainerID string + err = json.Unmarshal(*v, &recoveryContainerID) + if err != nil { + return err + } + rpip.RecoveryContainerID = &recoveryContainerID + } + case "eventCorrelationId": + if v != nil { + var eventCorrelationID string + err = json.Unmarshal(*v, &eventCorrelationID) + if err != nil { + return err + } + rpip.EventCorrelationID = &eventCorrelationID + } + } + } + + return nil +} + +// ReplicationProtectedItemsAddDisksFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsAddDisksFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsAddDisksFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsAddDisksFuture.Result. +func (future *ReplicationProtectedItemsAddDisksFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsAddDisksFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsAddDisksFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.AddDisksResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsAddDisksFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsApplyRecoveryPointFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsApplyRecoveryPointFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsApplyRecoveryPointFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsApplyRecoveryPointFuture.Result. +func (future *ReplicationProtectedItemsApplyRecoveryPointFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ApplyRecoveryPointResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsCreateFuture.Result. +func (future *ReplicationProtectedItemsCreateFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.CreateResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsCreateFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsDeleteFuture.Result. +func (future *ReplicationProtectedItemsDeleteFuture) result(client ReplicationProtectedItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectedItemsFailoverCancelFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsFailoverCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsFailoverCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsFailoverCancelFuture.Result. +func (future *ReplicationProtectedItemsFailoverCancelFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsFailoverCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.FailoverCancelResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCancelFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsFailoverCommitFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsFailoverCommitFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsFailoverCommitFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsFailoverCommitFuture.Result. +func (future *ReplicationProtectedItemsFailoverCommitFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCommitFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsFailoverCommitFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.FailoverCommitResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCommitFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsPlannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsPlannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsPlannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsPlannedFailoverFuture.Result. +func (future *ReplicationProtectedItemsPlannedFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPlannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsPlannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.PlannedFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPlannedFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsPurgeFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsPurgeFuture.Result. +func (future *ReplicationProtectedItemsPurgeFuture) result(client ReplicationProtectedItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectedItemsRemoveDisksFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsRemoveDisksFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsRemoveDisksFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsRemoveDisksFuture.Result. +func (future *ReplicationProtectedItemsRemoveDisksFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRemoveDisksFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsRemoveDisksFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.RemoveDisksResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRemoveDisksFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsRepairReplicationFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsRepairReplicationFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsRepairReplicationFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsRepairReplicationFuture.Result. +func (future *ReplicationProtectedItemsRepairReplicationFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRepairReplicationFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsRepairReplicationFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.RepairReplicationResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRepairReplicationFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsReprotectFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsReprotectFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsReprotectFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsReprotectFuture.Result. +func (future *ReplicationProtectedItemsReprotectFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsReprotectFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsReprotectFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ReprotectResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsReprotectFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsResolveHealthErrorsFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsResolveHealthErrorsFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsResolveHealthErrorsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsResolveHealthErrorsFuture.Result. +func (future *ReplicationProtectedItemsResolveHealthErrorsFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ResolveHealthErrorsResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsTestFailoverCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsTestFailoverCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsTestFailoverCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsTestFailoverCleanupFuture.Result. +func (future *ReplicationProtectedItemsTestFailoverCleanupFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.TestFailoverCleanupResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsTestFailoverFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectedItemsTestFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsTestFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsTestFailoverFuture.Result. +func (future *ReplicationProtectedItemsTestFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsTestFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.TestFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUnplannedFailoverFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsUnplannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUnplannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUnplannedFailoverFuture.Result. +func (future *ReplicationProtectedItemsUnplannedFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UnplannedFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateApplianceFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsUpdateApplianceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateApplianceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateApplianceFuture.Result. +func (future *ReplicationProtectedItemsUpdateApplianceFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateApplianceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateApplianceFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateApplianceResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateApplianceFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateFuture.Result. +func (future *ReplicationProtectedItemsUpdateFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateMobilityServiceFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsUpdateMobilityServiceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateMobilityServiceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateMobilityServiceFuture.Result. +func (future *ReplicationProtectedItemsUpdateMobilityServiceFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateMobilityServiceResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainerMappingsCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (ProtectionContainerMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsCreateFuture.Result. +func (future *ReplicationProtectionContainerMappingsCreateFuture) result(client ReplicationProtectionContainerMappingsClient) (pcm ProtectionContainerMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pcm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pcm.Response.Response, err = future.GetResult(sender); err == nil && pcm.Response.Response.StatusCode != http.StatusNoContent { + pcm, err = client.CreateResponder(pcm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsCreateFuture", "Result", pcm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainerMappingsDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsDeleteFuture.Result. +func (future *ReplicationProtectionContainerMappingsDeleteFuture) result(client ReplicationProtectionContainerMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainerMappingsPurgeFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsPurgeFuture.Result. +func (future *ReplicationProtectionContainerMappingsPurgeFuture) result(client ReplicationProtectionContainerMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainerMappingsUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (ProtectionContainerMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsUpdateFuture.Result. +func (future *ReplicationProtectionContainerMappingsUpdateFuture) result(client ReplicationProtectionContainerMappingsClient) (pcm ProtectionContainerMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pcm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pcm.Response.Response, err = future.GetResult(sender); err == nil && pcm.Response.Response.StatusCode != http.StatusNoContent { + pcm, err = client.UpdateResponder(pcm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsUpdateFuture", "Result", pcm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersCreateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectionContainersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersCreateFuture.Result. +func (future *ReplicationProtectionContainersCreateFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.CreateResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersCreateFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersDeleteFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectionContainersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersDeleteFuture.Result. +func (future *ReplicationProtectionContainersDeleteFuture) result(client ReplicationProtectionContainersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainersDiscoverProtectableItemFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type ReplicationProtectionContainersDiscoverProtectableItemFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersDiscoverProtectableItemFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersDiscoverProtectableItemFuture.Result. +func (future *ReplicationProtectionContainersDiscoverProtectableItemFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.DiscoverProtectableItemResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersSwitchProtectionFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainersSwitchProtectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersSwitchProtectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersSwitchProtectionFuture.Result. +func (future *ReplicationProtectionContainersSwitchProtectionFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersSwitchProtectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersSwitchProtectionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.SwitchProtectionResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersSwitchProtectionFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionIntent replication protection intent. +type ReplicationProtectionIntent struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ReplicationProtectionIntentProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntent. +func (rpi ReplicationProtectionIntent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpi.Properties != nil { + objectMap["properties"] = rpi.Properties + } + if rpi.Location != nil { + objectMap["location"] = rpi.Location + } + return json.Marshal(objectMap) +} + +// ReplicationProtectionIntentCollection replication protection intent objects collection. +type ReplicationProtectionIntentCollection struct { + autorest.Response `json:"-"` + // Value - The Replication protection intent details. + Value *[]ReplicationProtectionIntent `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ReplicationProtectionIntentCollectionIterator provides access to a complete listing of +// ReplicationProtectionIntent values. +type ReplicationProtectionIntentCollectionIterator struct { + i int + page ReplicationProtectionIntentCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ReplicationProtectionIntentCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ReplicationProtectionIntentCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ReplicationProtectionIntentCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ReplicationProtectionIntentCollectionIterator) Response() ReplicationProtectionIntentCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ReplicationProtectionIntentCollectionIterator) Value() ReplicationProtectionIntent { + if !iter.page.NotDone() { + return ReplicationProtectionIntent{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ReplicationProtectionIntentCollectionIterator type. +func NewReplicationProtectionIntentCollectionIterator(page ReplicationProtectionIntentCollectionPage) ReplicationProtectionIntentCollectionIterator { + return ReplicationProtectionIntentCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rpic ReplicationProtectionIntentCollection) IsEmpty() bool { + return rpic.Value == nil || len(*rpic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rpic ReplicationProtectionIntentCollection) hasNextLink() bool { + return rpic.NextLink != nil && len(*rpic.NextLink) != 0 +} + +// replicationProtectionIntentCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rpic ReplicationProtectionIntentCollection) replicationProtectionIntentCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rpic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rpic.NextLink))) +} + +// ReplicationProtectionIntentCollectionPage contains a page of ReplicationProtectionIntent values. +type ReplicationProtectionIntentCollectionPage struct { + fn func(context.Context, ReplicationProtectionIntentCollection) (ReplicationProtectionIntentCollection, error) + rpic ReplicationProtectionIntentCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ReplicationProtectionIntentCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rpic) + if err != nil { + return err + } + page.rpic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ReplicationProtectionIntentCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ReplicationProtectionIntentCollectionPage) NotDone() bool { + return !page.rpic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ReplicationProtectionIntentCollectionPage) Response() ReplicationProtectionIntentCollection { + return page.rpic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ReplicationProtectionIntentCollectionPage) Values() []ReplicationProtectionIntent { + if page.rpic.IsEmpty() { + return nil + } + return *page.rpic.Value +} + +// Creates a new instance of the ReplicationProtectionIntentCollectionPage type. +func NewReplicationProtectionIntentCollectionPage(cur ReplicationProtectionIntentCollection, getNextPage func(context.Context, ReplicationProtectionIntentCollection) (ReplicationProtectionIntentCollection, error)) ReplicationProtectionIntentCollectionPage { + return ReplicationProtectionIntentCollectionPage{ + fn: getNextPage, + rpic: cur, + } +} + +// ReplicationProtectionIntentProperties replication protection intent custom data details. +type ReplicationProtectionIntentProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // JobID - READ-ONLY; The job Id. + JobID *string `json:"jobId,omitempty"` + // JobState - READ-ONLY; The job state. + JobState *string `json:"jobState,omitempty"` + // IsActive - READ-ONLY; A value indicating whether the intent object is active. + IsActive *bool `json:"isActive,omitempty"` + // CreationTimeUTC - READ-ONLY; The creation time in UTC. + CreationTimeUTC *string `json:"creationTimeUTC,omitempty"` + // ProviderSpecificDetails - The Replication provider custom settings. + ProviderSpecificDetails BasicReplicationProtectionIntentProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntentProperties. +func (rpip ReplicationProtectionIntentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpip.FriendlyName != nil { + objectMap["friendlyName"] = rpip.FriendlyName + } + objectMap["providerSpecificDetails"] = rpip.ProviderSpecificDetails + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ReplicationProtectionIntentProperties struct. +func (rpip *ReplicationProtectionIntentProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpip.FriendlyName = &friendlyName + } + case "jobId": + if v != nil { + var jobID string + err = json.Unmarshal(*v, &jobID) + if err != nil { + return err + } + rpip.JobID = &jobID + } + case "jobState": + if v != nil { + var jobState string + err = json.Unmarshal(*v, &jobState) + if err != nil { + return err + } + rpip.JobState = &jobState + } + case "isActive": + if v != nil { + var isActive bool + err = json.Unmarshal(*v, &isActive) + if err != nil { + return err + } + rpip.IsActive = &isActive + } + case "creationTimeUTC": + if v != nil { + var creationTimeUTC string + err = json.Unmarshal(*v, &creationTimeUTC) + if err != nil { + return err + } + rpip.CreationTimeUTC = &creationTimeUTC + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(*v) + if err != nil { + return err + } + rpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicReplicationProtectionIntentProviderSpecificSettings replication provider specific settings. +type BasicReplicationProtectionIntentProviderSpecificSettings interface { + AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) + AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) +} + +// ReplicationProtectionIntentProviderSpecificSettings replication provider specific settings. +type ReplicationProtectionIntentProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings', 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A' + InstanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(body []byte) (BasicReplicationProtectionIntentProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A): + var arid A2AReplicationIntentDetails + err := json.Unmarshal(body, &arid) + return arid, err + default: + var rpipss ReplicationProtectionIntentProviderSpecificSettings + err := json.Unmarshal(body, &rpipss) + return rpipss, err + } +} +func unmarshalBasicReplicationProtectionIntentProviderSpecificSettingsArray(body []byte) ([]BasicReplicationProtectionIntentProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpipssArray := make([]BasicReplicationProtectionIntentProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpipss, err := unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + rpipssArray[index] = rpipss + } + return rpipssArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) MarshalJSON() ([]byte, error) { + rpipss.InstanceType = InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings + objectMap := make(map[string]interface{}) + if rpipss.InstanceType != "" { + objectMap["instanceType"] = rpipss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReplicationIntentDetails is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) { + return nil, false +} + +// AsReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) { + return &rpipss, true +} + +// AsBasicReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsBasicReplicationProtectionIntentProviderSpecificSettings() (BasicReplicationProtectionIntentProviderSpecificSettings, bool) { + return &rpipss, true +} + +// ReplicationProviderContainerUnmappingInput provider specific input for unpairing operations. +type ReplicationProviderContainerUnmappingInput struct { + // InstanceType - The class type. + InstanceType *string `json:"instanceType,omitempty"` +} + +// BasicReplicationProviderSpecificContainerCreationInput provider specific input for container creation operation. +type BasicReplicationProviderSpecificContainerCreationInput interface { + AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) + AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) + AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) + AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) +} + +// ReplicationProviderSpecificContainerCreationInput provider specific input for container creation operation. +type ReplicationProviderSpecificContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificContainerCreationInput(body []byte) (BasicReplicationProviderSpecificContainerCreationInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A): + var acci A2AContainerCreationInput + err := json.Unmarshal(body, &acci) + return acci, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration): + var accmcci A2ACrossClusterMigrationContainerCreationInput + err := json.Unmarshal(body, &accmcci) + return accmcci, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt): + var vmccci VMwareCbtContainerCreationInput + err := json.Unmarshal(body, &vmccci) + return vmccci, err + default: + var rpscci ReplicationProviderSpecificContainerCreationInput + err := json.Unmarshal(body, &rpscci) + return rpscci, err + } +} +func unmarshalBasicReplicationProviderSpecificContainerCreationInputArray(body []byte) ([]BasicReplicationProviderSpecificContainerCreationInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpscciArray := make([]BasicReplicationProviderSpecificContainerCreationInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpscci, err := unmarshalBasicReplicationProviderSpecificContainerCreationInput(*rawMessage) + if err != nil { + return nil, err + } + rpscciArray[index] = rpscci + } + return rpscciArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) MarshalJSON() ([]byte, error) { + rpscci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput + objectMap := make(map[string]interface{}) + if rpscci.InstanceType != "" { + objectMap["instanceType"] = rpscci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return &rpscci, true +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &rpscci, true +} + +// BasicReplicationProviderSpecificContainerMappingInput provider specific input for pairing operations. +type BasicReplicationProviderSpecificContainerMappingInput interface { + AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) + AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) + AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) +} + +// ReplicationProviderSpecificContainerMappingInput provider specific input for pairing operations. +type ReplicationProviderSpecificContainerMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificContainerMappingInput(body []byte) (BasicReplicationProviderSpecificContainerMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A): + var acmi A2AContainerMappingInput + err := json.Unmarshal(body, &acmi) + return acmi, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt): + var vmccmi VMwareCbtContainerMappingInput + err := json.Unmarshal(body, &vmccmi) + return vmccmi, err + default: + var rpscmi ReplicationProviderSpecificContainerMappingInput + err := json.Unmarshal(body, &rpscmi) + return rpscmi, err + } +} +func unmarshalBasicReplicationProviderSpecificContainerMappingInputArray(body []byte) ([]BasicReplicationProviderSpecificContainerMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpscmiArray := make([]BasicReplicationProviderSpecificContainerMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpscmi, err := unmarshalBasicReplicationProviderSpecificContainerMappingInput(*rawMessage) + if err != nil { + return nil, err + } + rpscmiArray[index] = rpscmi + } + return rpscmiArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) MarshalJSON() ([]byte, error) { + rpscmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput + objectMap := make(map[string]interface{}) + if rpscmi.InstanceType != "" { + objectMap["instanceType"] = rpscmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return &rpscmi, true +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &rpscmi, true +} + +// BasicReplicationProviderSpecificSettings replication provider specific settings. +type BasicReplicationProviderSpecificSettings interface { + AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) + AsA2AReplicationDetails() (*A2AReplicationDetails, bool) + AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) + AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) + AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) + AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) + AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) + AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) + AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) + AsInMageReplicationDetails() (*InMageReplicationDetails, bool) + AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) +} + +// ReplicationProviderSpecificSettings replication provider specific settings. +type ReplicationProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificSettings(body []byte) (BasicReplicationProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration): + var accmrd A2ACrossClusterMigrationReplicationDetails + err := json.Unmarshal(body, &accmrd) + return accmrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A): + var ard A2AReplicationDetails + err := json.Unmarshal(body, &ard) + return ard, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure): + var hvrard HyperVReplicaAzureReplicationDetails + err := json.Unmarshal(body, &hvrard) + return hvrard, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails): + var hvrbrd HyperVReplicaBaseReplicationDetails + err := json.Unmarshal(body, &hvrbrd) + return hvrbrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2): + var hvrbrd HyperVReplicaBlueReplicationDetails + err := json.Unmarshal(body, &hvrbrd) + return hvrbrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012): + var hvrrd HyperVReplicaReplicationDetails + err := json.Unmarshal(body, &hvrrd) + return hvrrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2): + var imavrd InMageAzureV2ReplicationDetails + err := json.Unmarshal(body, &imavrd) + return imavrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback): + var imrfrd InMageRcmFailbackReplicationDetails + err := json.Unmarshal(body, &imrfrd) + return imrfrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm): + var imrrd InMageRcmReplicationDetails + err := json.Unmarshal(body, &imrrd) + return imrrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage): + var imrd InMageReplicationDetails + err := json.Unmarshal(body, &imrd) + return imrd, err + default: + var rpss ReplicationProviderSpecificSettings + err := json.Unmarshal(body, &rpss) + return rpss, err + } +} +func unmarshalBasicReplicationProviderSpecificSettingsArray(body []byte) ([]BasicReplicationProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpssArray := make([]BasicReplicationProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpss, err := unmarshalBasicReplicationProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + rpssArray[index] = rpss + } + return rpssArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) MarshalJSON() ([]byte, error) { + rpss.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings + objectMap := make(map[string]interface{}) + if rpss.InstanceType != "" { + objectMap["instanceType"] = rpss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return &rpss, true +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &rpss, true +} + +// BasicReplicationProviderSpecificUpdateContainerMappingInput provider specific input for update pairing operations. +type BasicReplicationProviderSpecificUpdateContainerMappingInput interface { + AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) + AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) + AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) +} + +// ReplicationProviderSpecificUpdateContainerMappingInput provider specific input for update pairing +// operations. +type ReplicationProviderSpecificUpdateContainerMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(body []byte) (BasicReplicationProviderSpecificUpdateContainerMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A): + var aucmi A2AUpdateContainerMappingInput + err := json.Unmarshal(body, &aucmi) + return aucmi, err + case string(InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm): + var imrucmi InMageRcmUpdateContainerMappingInput + err := json.Unmarshal(body, &imrucmi) + return imrucmi, err + default: + var rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput + err := json.Unmarshal(body, &rpsucmi) + return rpsucmi, err + } +} +func unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInputArray(body []byte) ([]BasicReplicationProviderSpecificUpdateContainerMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpsucmiArray := make([]BasicReplicationProviderSpecificUpdateContainerMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpsucmi, err := unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(*rawMessage) + if err != nil { + return nil, err + } + rpsucmiArray[index] = rpsucmi + } + return rpsucmiArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + rpsucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput + objectMap := make(map[string]interface{}) + if rpsucmi.InstanceType != "" { + objectMap["instanceType"] = rpsucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &rpsucmi, true +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &rpsucmi, true +} + +// ReplicationRecoveryPlansCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansCreateFuture.Result. +func (future *ReplicationRecoveryPlansCreateFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.CreateResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansCreateFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansDeleteFuture.Result. +func (future *ReplicationRecoveryPlansDeleteFuture) result(client ReplicationRecoveryPlansClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryPlansFailoverCancelFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationRecoveryPlansFailoverCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansFailoverCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansFailoverCancelFuture.Result. +func (future *ReplicationRecoveryPlansFailoverCancelFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansFailoverCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.FailoverCancelResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCancelFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansFailoverCommitFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationRecoveryPlansFailoverCommitFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansFailoverCommitFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansFailoverCommitFuture.Result. +func (future *ReplicationRecoveryPlansFailoverCommitFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCommitFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansFailoverCommitFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.FailoverCommitResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCommitFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansPlannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryPlansPlannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansPlannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansPlannedFailoverFuture.Result. +func (future *ReplicationRecoveryPlansPlannedFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.PlannedFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansReprotectFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansReprotectFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansReprotectFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansReprotectFuture.Result. +func (future *ReplicationRecoveryPlansReprotectFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansReprotectFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansReprotectFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.ReprotectResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansReprotectFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansTestFailoverCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryPlansTestFailoverCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansTestFailoverCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansTestFailoverCleanupFuture.Result. +func (future *ReplicationRecoveryPlansTestFailoverCleanupFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.TestFailoverCleanupResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansTestFailoverFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansTestFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansTestFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansTestFailoverFuture.Result. +func (future *ReplicationRecoveryPlansTestFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansTestFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.TestFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansUnplannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryPlansUnplannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansUnplannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansUnplannedFailoverFuture.Result. +func (future *ReplicationRecoveryPlansUnplannedFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.UnplannedFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansUpdateFuture.Result. +func (future *ReplicationRecoveryPlansUpdateFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.UpdateResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUpdateFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryServicesProvidersCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryServicesProvidersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (RecoveryServicesProvider, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersCreateFuture.Result. +func (future *ReplicationRecoveryServicesProvidersCreateFuture) result(client ReplicationRecoveryServicesProvidersClient) (rsp RecoveryServicesProvider, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rsp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rsp.Response.Response, err = future.GetResult(sender); err == nil && rsp.Response.Response.StatusCode != http.StatusNoContent { + rsp, err = client.CreateResponder(rsp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersCreateFuture", "Result", rsp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryServicesProvidersDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryServicesProvidersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersDeleteFuture.Result. +func (future *ReplicationRecoveryServicesProvidersDeleteFuture) result(client ReplicationRecoveryServicesProvidersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryServicesProvidersPurgeFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryServicesProvidersPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersPurgeFuture.Result. +func (future *ReplicationRecoveryServicesProvidersPurgeFuture) result(client ReplicationRecoveryServicesProvidersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryServicesProvidersRefreshProviderFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type ReplicationRecoveryServicesProvidersRefreshProviderFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (RecoveryServicesProvider, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersRefreshProviderFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersRefreshProviderFuture.Result. +func (future *ReplicationRecoveryServicesProvidersRefreshProviderFuture) result(client ReplicationRecoveryServicesProvidersClient) (rsp RecoveryServicesProvider, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rsp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rsp.Response.Response, err = future.GetResult(sender); err == nil && rsp.Response.Response.StatusCode != http.StatusNoContent { + rsp, err = client.RefreshProviderResponder(rsp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture", "Result", rsp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationStorageClassificationMappingsCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationStorageClassificationMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationStorageClassificationMappingsClient) (StorageClassificationMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationStorageClassificationMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationStorageClassificationMappingsCreateFuture.Result. +func (future *ReplicationStorageClassificationMappingsCreateFuture) result(client ReplicationStorageClassificationMappingsClient) (scm StorageClassificationMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + scm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationStorageClassificationMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if scm.Response.Response, err = future.GetResult(sender); err == nil && scm.Response.Response.StatusCode != http.StatusNoContent { + scm, err = client.CreateResponder(scm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsCreateFuture", "Result", scm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationStorageClassificationMappingsDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationStorageClassificationMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationStorageClassificationMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationStorageClassificationMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationStorageClassificationMappingsDeleteFuture.Result. +func (future *ReplicationStorageClassificationMappingsDeleteFuture) result(client ReplicationStorageClassificationMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationStorageClassificationMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationVaultHealthRefreshFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationVaultHealthRefreshFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationVaultHealthClient) (VaultHealthDetails, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationVaultHealthRefreshFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationVaultHealthRefreshFuture.Result. +func (future *ReplicationVaultHealthRefreshFuture) result(client ReplicationVaultHealthClient) (vhd VaultHealthDetails, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthRefreshFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vhd.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationVaultHealthRefreshFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vhd.Response.Response, err = future.GetResult(sender); err == nil && vhd.Response.Response.StatusCode != http.StatusNoContent { + vhd, err = client.RefreshResponder(vhd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthRefreshFuture", "Result", vhd.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationVaultSettingCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationVaultSettingCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationVaultSettingClient) (VaultSetting, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationVaultSettingCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationVaultSettingCreateFuture.Result. +func (future *ReplicationVaultSettingCreateFuture) result(client ReplicationVaultSettingClient) (vs VaultSetting, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vs.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationVaultSettingCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vs.Response.Response, err = future.GetResult(sender); err == nil && vs.Response.Response.StatusCode != http.StatusNoContent { + vs, err = client.CreateResponder(vs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingCreateFuture", "Result", vs.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationvCentersCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (VCenter, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersCreateFuture.Result. +func (future *ReplicationvCentersCreateFuture) result(client ReplicationvCentersClient) (vc VCenter, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent { + vc, err = client.CreateResponder(vc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersCreateFuture", "Result", vc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationvCentersDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersDeleteFuture.Result. +func (future *ReplicationvCentersDeleteFuture) result(client ReplicationvCentersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationvCentersUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (VCenter, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersUpdateFuture.Result. +func (future *ReplicationvCentersUpdateFuture) result(client ReplicationvCentersClient) (vc VCenter, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent { + vc, err = client.UpdateResponder(vc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersUpdateFuture", "Result", vc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReprotectAgentDetails reprotect agent details. +type ReprotectAgentDetails struct { + // ID - READ-ONLY; The reprotect agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The reprotect agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The reprotect agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The reprotect agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the reprotect agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the reprotect agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // ProtectedItemCount - READ-ONLY; The protected item count. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // AccessibleDatastores - READ-ONLY; The list of accessible datastores fetched from discovery. + AccessibleDatastores *[]string `json:"accessibleDatastores,omitempty"` + // VcenterID - READ-ONLY; The Vcenter Id. + VcenterID *string `json:"vcenterId,omitempty"` + // LastDiscoveryInUtc - READ-ONLY; The last time when SDS information discovered in SRS. + LastDiscoveryInUtc *date.Time `json:"lastDiscoveryInUtc,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReprotectAgentDetails. +func (rad ReprotectAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResolveHealthError resolve health errors input properties. +type ResolveHealthError struct { + // HealthErrorID - Health error id. + HealthErrorID *string `json:"healthErrorId,omitempty"` +} + +// ResolveHealthInput resolve health input. +type ResolveHealthInput struct { + // Properties - Disable resolve health input properties. + Properties *ResolveHealthInputProperties `json:"properties,omitempty"` +} + +// ResolveHealthInputProperties resolve health input properties. +type ResolveHealthInputProperties struct { + // HealthErrors - Health errors. + HealthErrors *[]ResolveHealthError `json:"healthErrors,omitempty"` +} + +// Resource azure resource. +type Resource struct { + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location + } + return json.Marshal(objectMap) +} + +// ResourceHealthSummary base class to define the health summary of the resources contained under an Arm +// resource. +type ResourceHealthSummary struct { + // ResourceCount - The count of total resources under the container. + ResourceCount *int32 `json:"resourceCount,omitempty"` + // Issues - The list of summary of health errors across the resources under the container. + Issues *[]HealthErrorSummary `json:"issues,omitempty"` + // CategorizedResourceCounts - The categorized resource counts. + CategorizedResourceCounts map[string]*int32 `json:"categorizedResourceCounts"` +} + +// MarshalJSON is the custom marshaler for ResourceHealthSummary. +func (RHS ResourceHealthSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if RHS.ResourceCount != nil { + objectMap["resourceCount"] = RHS.ResourceCount + } + if RHS.Issues != nil { + objectMap["issues"] = RHS.Issues + } + if RHS.CategorizedResourceCounts != nil { + objectMap["categorizedResourceCounts"] = RHS.CategorizedResourceCounts + } + return json.Marshal(objectMap) +} + +// ResumeJobParams resume job params. +type ResumeJobParams struct { + // Properties - Resume job properties. + Properties *ResumeJobParamsProperties `json:"properties,omitempty"` +} + +// ResumeJobParamsProperties resume job properties. +type ResumeJobParamsProperties struct { + // Comments - Resume job comments. + Comments *string `json:"comments,omitempty"` +} + +// ResyncInput resync input. +type ResyncInput struct { + // Properties - Resync input properties. + Properties *ResyncInputProperties `json:"properties,omitempty"` +} + +// ResyncInputProperties resync input properties. +type ResyncInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicResyncProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ResyncInputProperties struct. +func (rip *ResyncInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicResyncProviderSpecificInput(*v) + if err != nil { + return err + } + rip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicResyncProviderSpecificInput resync provider specific input. +type BasicResyncProviderSpecificInput interface { + AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) + AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) +} + +// ResyncProviderSpecificInput resync provider specific input. +type ResyncProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput', 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicResyncProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicResyncProviderSpecificInput(body []byte) (BasicResyncProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt): + var vmcri VMwareCbtResyncInput + err := json.Unmarshal(body, &vmcri) + return vmcri, err + default: + var rpsi ResyncProviderSpecificInput + err := json.Unmarshal(body, &rpsi) + return rpsi, err + } +} +func unmarshalBasicResyncProviderSpecificInputArray(body []byte) ([]BasicResyncProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpsiArray := make([]BasicResyncProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpsi, err := unmarshalBasicResyncProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rpsiArray[index] = rpsi + } + return rpsiArray, nil +} + +// MarshalJSON is the custom marshaler for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) MarshalJSON() ([]byte, error) { + rpsi.InstanceType = InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput + objectMap := make(map[string]interface{}) + if rpsi.InstanceType != "" { + objectMap["instanceType"] = rpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtResyncInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) { + return nil, false +} + +// AsResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) { + return &rpsi, true +} + +// AsBasicResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsBasicResyncProviderSpecificInput() (BasicResyncProviderSpecificInput, bool) { + return &rpsi, true +} + +// RetentionVolume the retention details of the MT. +type RetentionVolume struct { + // VolumeName - The volume name. + VolumeName *string `json:"volumeName,omitempty"` + // CapacityInBytes - The volume capacity. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // FreeSpaceInBytes - The free space available in this volume. + FreeSpaceInBytes *int64 `json:"freeSpaceInBytes,omitempty"` + // ThresholdPercentage - The threshold percentage. + ThresholdPercentage *int32 `json:"thresholdPercentage,omitempty"` +} + +// ReverseReplicationInput reverse replication input. +type ReverseReplicationInput struct { + // Properties - Reverse replication properties. + Properties *ReverseReplicationInputProperties `json:"properties,omitempty"` +} + +// ReverseReplicationInputProperties reverse replication input properties. +type ReverseReplicationInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - Provider specific reverse replication input. + ProviderSpecificDetails BasicReverseReplicationProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ReverseReplicationInputProperties struct. +func (rrip *ReverseReplicationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rrip.FailoverDirection = &failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReverseReplicationProviderSpecificInput(*v) + if err != nil { + return err + } + rrip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicReverseReplicationProviderSpecificInput provider specific reverse replication input. +type BasicReverseReplicationProviderSpecificInput interface { + AsA2AReprotectInput() (*A2AReprotectInput, bool) + AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) + AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) + AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) + AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) + AsInMageReprotectInput() (*InMageReprotectInput, bool) + AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) +} + +// ReverseReplicationProviderSpecificInput provider specific reverse replication input. +type ReverseReplicationProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReverseReplicationProviderSpecificInput(body []byte) (BasicReverseReplicationProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A): + var ari A2AReprotectInput + err := json.Unmarshal(body, &ari) + return ari, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvrari HyperVReplicaAzureReprotectInput + err := json.Unmarshal(body, &hvrari) + return hvrari, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2): + var imavri InMageAzureV2ReprotectInput + err := json.Unmarshal(body, &imavri) + return imavri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback): + var imrfri InMageRcmFailbackReprotectInput + err := json.Unmarshal(body, &imrfri) + return imrfri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm): + var imrri InMageRcmReprotectInput + err := json.Unmarshal(body, &imrri) + return imrri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage): + var imri InMageReprotectInput + err := json.Unmarshal(body, &imri) + return imri, err + default: + var rrpsi ReverseReplicationProviderSpecificInput + err := json.Unmarshal(body, &rrpsi) + return rrpsi, err + } +} +func unmarshalBasicReverseReplicationProviderSpecificInputArray(body []byte) ([]BasicReverseReplicationProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rrpsiArray := make([]BasicReverseReplicationProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rrpsi, err := unmarshalBasicReverseReplicationProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rrpsiArray[index] = rrpsi + } + return rrpsiArray, nil +} + +// MarshalJSON is the custom marshaler for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) MarshalJSON() ([]byte, error) { + rrpsi.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput + objectMap := make(map[string]interface{}) + if rrpsi.InstanceType != "" { + objectMap["instanceType"] = rrpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return &rrpsi, true +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &rrpsi, true +} + +// RoleAssignment azure role assignment details. +type RoleAssignment struct { + // ID - The ARM Id of the role assignment. + ID *string `json:"id,omitempty"` + // Name - The name of the role assignment. + Name *string `json:"name,omitempty"` + // Scope - Role assignment scope. + Scope *string `json:"scope,omitempty"` + // PrincipalID - Principal Id. + PrincipalID *string `json:"principalId,omitempty"` + // RoleDefinitionID - Role definition id. + RoleDefinitionID *string `json:"roleDefinitionId,omitempty"` +} + +// RunAsAccount CS Accounts Details. +type RunAsAccount struct { + // AccountID - The CS RunAs account Id. + AccountID *string `json:"accountId,omitempty"` + // AccountName - The CS RunAs account name. + AccountName *string `json:"accountName,omitempty"` +} + +// ScriptActionTaskDetails this class represents the script action task details. +type ScriptActionTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // Path - The path. + Path *string `json:"path,omitempty"` + // Output - The output. + Output *string `json:"output,omitempty"` + // IsPrimarySideScript - A value indicating whether it is a primary side script or not. + IsPrimarySideScript *bool `json:"isPrimarySideScript,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) MarshalJSON() ([]byte, error) { + satd.InstanceType = InstanceTypeScriptActionTaskDetails + objectMap := make(map[string]interface{}) + if satd.Name != nil { + objectMap["name"] = satd.Name + } + if satd.Path != nil { + objectMap["path"] = satd.Path + } + if satd.Output != nil { + objectMap["output"] = satd.Output + } + if satd.IsPrimarySideScript != nil { + objectMap["isPrimarySideScript"] = satd.IsPrimarySideScript + } + if satd.InstanceType != "" { + objectMap["instanceType"] = satd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return &satd, true +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &satd, true +} + +// ServiceError ASR error model. +type ServiceError struct { + // Code - Error code. + Code *string `json:"code,omitempty"` + // Message - Error message. + Message *string `json:"message,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ActivityID - Activity Id. + ActivityID *string `json:"activityId,omitempty"` +} + +// BasicStorageAccountCustomDetails storage account custom input. +type BasicStorageAccountCustomDetails interface { + AsExistingStorageAccount() (*ExistingStorageAccount, bool) + AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) +} + +// StorageAccountCustomDetails storage account custom input. +type StorageAccountCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails', 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicStorageAccountCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicStorageAccountCustomDetails(body []byte) (BasicStorageAccountCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting): + var esa ExistingStorageAccount + err := json.Unmarshal(body, &esa) + return esa, err + default: + var sacd StorageAccountCustomDetails + err := json.Unmarshal(body, &sacd) + return sacd, err + } +} +func unmarshalBasicStorageAccountCustomDetailsArray(body []byte) ([]BasicStorageAccountCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sacdArray := make([]BasicStorageAccountCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sacd, err := unmarshalBasicStorageAccountCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + sacdArray[index] = sacd + } + return sacdArray, nil +} + +// MarshalJSON is the custom marshaler for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) MarshalJSON() ([]byte, error) { + sacd.ResourceType = ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails + objectMap := make(map[string]interface{}) + if sacd.ResourceType != "" { + objectMap["resourceType"] = sacd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingStorageAccount is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsExistingStorageAccount() (*ExistingStorageAccount, bool) { + return nil, false +} + +// AsStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) { + return &sacd, true +} + +// AsBasicStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsBasicStorageAccountCustomDetails() (BasicStorageAccountCustomDetails, bool) { + return &sacd, true +} + +// StorageClassification storage object definition. +type StorageClassification struct { + autorest.Response `json:"-"` + // Properties - Properties of the storage object. + Properties *StorageClassificationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageClassification. +func (sc StorageClassification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sc.Properties != nil { + objectMap["properties"] = sc.Properties + } + if sc.Location != nil { + objectMap["location"] = sc.Location + } + return json.Marshal(objectMap) +} + +// StorageClassificationCollection collection of storage details. +type StorageClassificationCollection struct { + autorest.Response `json:"-"` + // Value - The storage details. + Value *[]StorageClassification `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// StorageClassificationCollectionIterator provides access to a complete listing of StorageClassification +// values. +type StorageClassificationCollectionIterator struct { + i int + page StorageClassificationCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StorageClassificationCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StorageClassificationCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StorageClassificationCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StorageClassificationCollectionIterator) Response() StorageClassificationCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StorageClassificationCollectionIterator) Value() StorageClassification { + if !iter.page.NotDone() { + return StorageClassification{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StorageClassificationCollectionIterator type. +func NewStorageClassificationCollectionIterator(page StorageClassificationCollectionPage) StorageClassificationCollectionIterator { + return StorageClassificationCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scc StorageClassificationCollection) IsEmpty() bool { + return scc.Value == nil || len(*scc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scc StorageClassificationCollection) hasNextLink() bool { + return scc.NextLink != nil && len(*scc.NextLink) != 0 +} + +// storageClassificationCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scc StorageClassificationCollection) storageClassificationCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !scc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scc.NextLink))) +} + +// StorageClassificationCollectionPage contains a page of StorageClassification values. +type StorageClassificationCollectionPage struct { + fn func(context.Context, StorageClassificationCollection) (StorageClassificationCollection, error) + scc StorageClassificationCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StorageClassificationCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.scc) + if err != nil { + return err + } + page.scc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StorageClassificationCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StorageClassificationCollectionPage) NotDone() bool { + return !page.scc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StorageClassificationCollectionPage) Response() StorageClassificationCollection { + return page.scc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StorageClassificationCollectionPage) Values() []StorageClassification { + if page.scc.IsEmpty() { + return nil + } + return *page.scc.Value +} + +// Creates a new instance of the StorageClassificationCollectionPage type. +func NewStorageClassificationCollectionPage(cur StorageClassificationCollection, getNextPage func(context.Context, StorageClassificationCollection) (StorageClassificationCollection, error)) StorageClassificationCollectionPage { + return StorageClassificationCollectionPage{ + fn: getNextPage, + scc: cur, + } +} + +// StorageClassificationMapping storage mapping object. +type StorageClassificationMapping struct { + autorest.Response `json:"-"` + // Properties - Properties of the storage mapping object. + Properties *StorageClassificationMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageClassificationMapping. +func (scm StorageClassificationMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scm.Properties != nil { + objectMap["properties"] = scm.Properties + } + if scm.Location != nil { + objectMap["location"] = scm.Location + } + return json.Marshal(objectMap) +} + +// StorageClassificationMappingCollection collection of storage mapping details. +type StorageClassificationMappingCollection struct { + autorest.Response `json:"-"` + // Value - The storage details. + Value *[]StorageClassificationMapping `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// StorageClassificationMappingCollectionIterator provides access to a complete listing of +// StorageClassificationMapping values. +type StorageClassificationMappingCollectionIterator struct { + i int + page StorageClassificationMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StorageClassificationMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StorageClassificationMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StorageClassificationMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StorageClassificationMappingCollectionIterator) Response() StorageClassificationMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StorageClassificationMappingCollectionIterator) Value() StorageClassificationMapping { + if !iter.page.NotDone() { + return StorageClassificationMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StorageClassificationMappingCollectionIterator type. +func NewStorageClassificationMappingCollectionIterator(page StorageClassificationMappingCollectionPage) StorageClassificationMappingCollectionIterator { + return StorageClassificationMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scmc StorageClassificationMappingCollection) IsEmpty() bool { + return scmc.Value == nil || len(*scmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scmc StorageClassificationMappingCollection) hasNextLink() bool { + return scmc.NextLink != nil && len(*scmc.NextLink) != 0 +} + +// storageClassificationMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scmc StorageClassificationMappingCollection) storageClassificationMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !scmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scmc.NextLink))) +} + +// StorageClassificationMappingCollectionPage contains a page of StorageClassificationMapping values. +type StorageClassificationMappingCollectionPage struct { + fn func(context.Context, StorageClassificationMappingCollection) (StorageClassificationMappingCollection, error) + scmc StorageClassificationMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StorageClassificationMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.scmc) + if err != nil { + return err + } + page.scmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StorageClassificationMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StorageClassificationMappingCollectionPage) NotDone() bool { + return !page.scmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StorageClassificationMappingCollectionPage) Response() StorageClassificationMappingCollection { + return page.scmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StorageClassificationMappingCollectionPage) Values() []StorageClassificationMapping { + if page.scmc.IsEmpty() { + return nil + } + return *page.scmc.Value +} + +// Creates a new instance of the StorageClassificationMappingCollectionPage type. +func NewStorageClassificationMappingCollectionPage(cur StorageClassificationMappingCollection, getNextPage func(context.Context, StorageClassificationMappingCollection) (StorageClassificationMappingCollection, error)) StorageClassificationMappingCollectionPage { + return StorageClassificationMappingCollectionPage{ + fn: getNextPage, + scmc: cur, + } +} + +// StorageClassificationMappingInput storage mapping input. +type StorageClassificationMappingInput struct { + // Properties - Storage mapping input properties. + Properties *StorageMappingInputProperties `json:"properties,omitempty"` +} + +// StorageClassificationMappingProperties storage mapping properties. +type StorageClassificationMappingProperties struct { + // TargetStorageClassificationID - Target storage object Id. + TargetStorageClassificationID *string `json:"targetStorageClassificationId,omitempty"` +} + +// StorageClassificationProperties storage object properties. +type StorageClassificationProperties struct { + // FriendlyName - Friendly name of the Storage classification. + FriendlyName *string `json:"friendlyName,omitempty"` +} + +// StorageMappingInputProperties storage mapping input properties. +type StorageMappingInputProperties struct { + // TargetStorageClassificationID - The ID of the storage object. + TargetStorageClassificationID *string `json:"targetStorageClassificationId,omitempty"` +} + +// Subnet subnets of the network. +type Subnet struct { + // Name - The subnet name. + Name *string `json:"name,omitempty"` + // FriendlyName - The subnet friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // AddressList - The list of addresses for the subnet. + AddressList *[]string `json:"addressList,omitempty"` +} + +// SupportedOperatingSystems supported operating systems. +type SupportedOperatingSystems struct { + autorest.Response `json:"-"` + // Properties - The supported operating systems properties. + Properties *SupportedOSProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for SupportedOperatingSystems. +func (sos SupportedOperatingSystems) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sos.Properties != nil { + objectMap["properties"] = sos.Properties + } + if sos.Location != nil { + objectMap["location"] = sos.Location + } + return json.Marshal(objectMap) +} + +// SupportedOSDetails supported operating system details. +type SupportedOSDetails struct { + // OsName - The name. + OsName *string `json:"osName,omitempty"` + // OsType - The type. + OsType *string `json:"osType,omitempty"` + // OsVersions - The list of version for operating system. + OsVersions *[]OSVersionWrapper `json:"osVersions,omitempty"` +} + +// SupportedOSProperties supported operating systems properties. +type SupportedOSProperties struct { + // SupportedOsList - The supported operating systems property list. + SupportedOsList *[]SupportedOSProperty `json:"supportedOsList,omitempty"` +} + +// SupportedOSProperty supported operating systems property. +type SupportedOSProperty struct { + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` + // SupportedOs - The list of supported operating systems. + SupportedOs *[]SupportedOSDetails `json:"supportedOs,omitempty"` +} + +// SwitchProtectionInput switch protection input. +type SwitchProtectionInput struct { + // Properties - Switch protection properties. + Properties *SwitchProtectionInputProperties `json:"properties,omitempty"` +} + +// SwitchProtectionInputProperties switch protection input properties. +type SwitchProtectionInputProperties struct { + // ReplicationProtectedItemName - The unique replication protected item name. + ReplicationProtectedItemName *string `json:"replicationProtectedItemName,omitempty"` + // ProviderSpecificDetails - Provider specific switch protection input. + ProviderSpecificDetails BasicSwitchProtectionProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SwitchProtectionInputProperties struct. +func (spip *SwitchProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "replicationProtectedItemName": + if v != nil { + var replicationProtectedItemName string + err = json.Unmarshal(*v, &replicationProtectedItemName) + if err != nil { + return err + } + spip.ReplicationProtectedItemName = &replicationProtectedItemName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicSwitchProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + spip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// SwitchProtectionJobDetails this class represents details for switch protection job. +type SwitchProtectionJobDetails struct { + // NewReplicationProtectedItemID - ARM Id of the new replication protected item. + NewReplicationProtectedItemID *string `json:"newReplicationProtectedItemId,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) MarshalJSON() ([]byte, error) { + spjd.InstanceType = InstanceTypeSwitchProtectionJobDetails + objectMap := make(map[string]interface{}) + if spjd.NewReplicationProtectedItemID != nil { + objectMap["newReplicationProtectedItemId"] = spjd.NewReplicationProtectedItemID + } + if spjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = spjd.AffectedObjectDetails + } + if spjd.InstanceType != "" { + objectMap["instanceType"] = spjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return &spjd, true +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &spjd, true +} + +// BasicSwitchProtectionProviderSpecificInput provider specific switch protection input. +type BasicSwitchProtectionProviderSpecificInput interface { + AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) + AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) +} + +// SwitchProtectionProviderSpecificInput provider specific switch protection input. +type SwitchProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput', 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicSwitchProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicSwitchProtectionProviderSpecificInput(body []byte) (BasicSwitchProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A): + var aspi A2ASwitchProtectionInput + err := json.Unmarshal(body, &aspi) + return aspi, err + default: + var sppsi SwitchProtectionProviderSpecificInput + err := json.Unmarshal(body, &sppsi) + return sppsi, err + } +} +func unmarshalBasicSwitchProtectionProviderSpecificInputArray(body []byte) ([]BasicSwitchProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sppsiArray := make([]BasicSwitchProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sppsi, err := unmarshalBasicSwitchProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + sppsiArray[index] = sppsi + } + return sppsiArray, nil +} + +// MarshalJSON is the custom marshaler for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + sppsi.InstanceType = InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if sppsi.InstanceType != "" { + objectMap["instanceType"] = sppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ASwitchProtectionInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) { + return nil, false +} + +// AsSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) { + return &sppsi, true +} + +// AsBasicSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsBasicSwitchProtectionProviderSpecificInput() (BasicSwitchProtectionProviderSpecificInput, bool) { + return &sppsi, true +} + +// TargetComputeSize represents applicable recovery vm sizes. +type TargetComputeSize struct { + // ID - The Id. + ID *string `json:"id,omitempty"` + // Name - The name. + Name *string `json:"name,omitempty"` + // Type - The Type of the object. + Type *string `json:"type,omitempty"` + // Properties - The custom data. + Properties *TargetComputeSizeProperties `json:"properties,omitempty"` +} + +// TargetComputeSizeCollection target compute size collection. +type TargetComputeSizeCollection struct { + autorest.Response `json:"-"` + // Value - The list of target compute sizes. + Value *[]TargetComputeSize `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// TargetComputeSizeCollectionIterator provides access to a complete listing of TargetComputeSize values. +type TargetComputeSizeCollectionIterator struct { + i int + page TargetComputeSizeCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *TargetComputeSizeCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizeCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *TargetComputeSizeCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TargetComputeSizeCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter TargetComputeSizeCollectionIterator) Response() TargetComputeSizeCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter TargetComputeSizeCollectionIterator) Value() TargetComputeSize { + if !iter.page.NotDone() { + return TargetComputeSize{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the TargetComputeSizeCollectionIterator type. +func NewTargetComputeSizeCollectionIterator(page TargetComputeSizeCollectionPage) TargetComputeSizeCollectionIterator { + return TargetComputeSizeCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (tcsc TargetComputeSizeCollection) IsEmpty() bool { + return tcsc.Value == nil || len(*tcsc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (tcsc TargetComputeSizeCollection) hasNextLink() bool { + return tcsc.NextLink != nil && len(*tcsc.NextLink) != 0 +} + +// targetComputeSizeCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tcsc TargetComputeSizeCollection) targetComputeSizeCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !tcsc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(tcsc.NextLink))) +} + +// TargetComputeSizeCollectionPage contains a page of TargetComputeSize values. +type TargetComputeSizeCollectionPage struct { + fn func(context.Context, TargetComputeSizeCollection) (TargetComputeSizeCollection, error) + tcsc TargetComputeSizeCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *TargetComputeSizeCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizeCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.tcsc) + if err != nil { + return err + } + page.tcsc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *TargetComputeSizeCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TargetComputeSizeCollectionPage) NotDone() bool { + return !page.tcsc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TargetComputeSizeCollectionPage) Response() TargetComputeSizeCollection { + return page.tcsc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TargetComputeSizeCollectionPage) Values() []TargetComputeSize { + if page.tcsc.IsEmpty() { + return nil + } + return *page.tcsc.Value +} + +// Creates a new instance of the TargetComputeSizeCollectionPage type. +func NewTargetComputeSizeCollectionPage(cur TargetComputeSizeCollection, getNextPage func(context.Context, TargetComputeSizeCollection) (TargetComputeSizeCollection, error)) TargetComputeSizeCollectionPage { + return TargetComputeSizeCollectionPage{ + fn: getNextPage, + tcsc: cur, + } +} + +// TargetComputeSizeProperties represents applicable recovery vm sizes properties. +type TargetComputeSizeProperties struct { + // Name - Target compute size name. + Name *string `json:"name,omitempty"` + // FriendlyName - Target compute size display name. + FriendlyName *string `json:"friendlyName,omitempty"` + // CPUCoresCount - The maximum cpu cores count supported by target compute size. + CPUCoresCount *int32 `json:"cpuCoresCount,omitempty"` + // VCPUsAvailable - READ-ONLY; The Available vCPUs supported by target compute size. + VCPUsAvailable *int32 `json:"vCPUsAvailable,omitempty"` + // MemoryInGB - The maximum memory in GB supported by target compute size. + MemoryInGB *float64 `json:"memoryInGB,omitempty"` + // MaxDataDiskCount - The maximum data disks count supported by target compute size. + MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` + // MaxNicsCount - The maximum Nics count supported by target compute size. + MaxNicsCount *int32 `json:"maxNicsCount,omitempty"` + // Errors - The reasons why the target compute size is not applicable for the protected item. + Errors *[]ComputeSizeErrorDetails `json:"errors,omitempty"` + // HighIopsSupported - The value indicating whether the target compute size supports high Iops. + HighIopsSupported *string `json:"highIopsSupported,omitempty"` + // HyperVGenerations - The supported HyperV Generations. + HyperVGenerations *[]string `json:"hyperVGenerations,omitempty"` +} + +// MarshalJSON is the custom marshaler for TargetComputeSizeProperties. +func (tcsp TargetComputeSizeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tcsp.Name != nil { + objectMap["name"] = tcsp.Name + } + if tcsp.FriendlyName != nil { + objectMap["friendlyName"] = tcsp.FriendlyName + } + if tcsp.CPUCoresCount != nil { + objectMap["cpuCoresCount"] = tcsp.CPUCoresCount + } + if tcsp.MemoryInGB != nil { + objectMap["memoryInGB"] = tcsp.MemoryInGB + } + if tcsp.MaxDataDiskCount != nil { + objectMap["maxDataDiskCount"] = tcsp.MaxDataDiskCount + } + if tcsp.MaxNicsCount != nil { + objectMap["maxNicsCount"] = tcsp.MaxNicsCount + } + if tcsp.Errors != nil { + objectMap["errors"] = tcsp.Errors + } + if tcsp.HighIopsSupported != nil { + objectMap["highIopsSupported"] = tcsp.HighIopsSupported + } + if tcsp.HyperVGenerations != nil { + objectMap["hyperVGenerations"] = tcsp.HyperVGenerations + } + return json.Marshal(objectMap) +} + +// BasicTaskTypeDetails task details based on specific task type. +type BasicTaskTypeDetails interface { + AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) + AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) + AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) + AsJobTaskDetails() (*JobTaskDetails, bool) + AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) + AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) + AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) + AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) + AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) + AsTaskTypeDetails() (*TaskTypeDetails, bool) +} + +// TaskTypeDetails task details based on specific task type. +type TaskTypeDetails struct { + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicTaskTypeDetails(body []byte) (BasicTaskTypeDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAutomationRunbookTaskDetails): + var artd AutomationRunbookTaskDetails + err := json.Unmarshal(body, &artd) + return artd, err + case string(InstanceTypeConsistencyCheckTaskDetails): + var cctd ConsistencyCheckTaskDetails + err := json.Unmarshal(body, &cctd) + return cctd, err + case string(InstanceTypeFabricReplicationGroupTaskDetails): + var frgtd FabricReplicationGroupTaskDetails + err := json.Unmarshal(body, &frgtd) + return frgtd, err + case string(InstanceTypeJobTaskDetails): + var jtd JobTaskDetails + err := json.Unmarshal(body, &jtd) + return jtd, err + case string(InstanceTypeManualActionTaskDetails): + var matd ManualActionTaskDetails + err := json.Unmarshal(body, &matd) + return matd, err + case string(InstanceTypeScriptActionTaskDetails): + var satd ScriptActionTaskDetails + err := json.Unmarshal(body, &satd) + return satd, err + case string(InstanceTypeVirtualMachineTaskDetails): + var vmtd VirtualMachineTaskDetails + err := json.Unmarshal(body, &vmtd) + return vmtd, err + case string(InstanceTypeVMNicUpdatesTaskDetails): + var vnutd VMNicUpdatesTaskDetails + err := json.Unmarshal(body, &vnutd) + return vnutd, err + default: + var ttd TaskTypeDetails + err := json.Unmarshal(body, &ttd) + return ttd, err + } +} +func unmarshalBasicTaskTypeDetailsArray(body []byte) ([]BasicTaskTypeDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ttdArray := make([]BasicTaskTypeDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ttd, err := unmarshalBasicTaskTypeDetails(*rawMessage) + if err != nil { + return nil, err + } + ttdArray[index] = ttd + } + return ttdArray, nil +} + +// MarshalJSON is the custom marshaler for TaskTypeDetails. +func (ttd TaskTypeDetails) MarshalJSON() ([]byte, error) { + ttd.InstanceType = InstanceTypeTaskTypeDetails + objectMap := make(map[string]interface{}) + if ttd.InstanceType != "" { + objectMap["instanceType"] = ttd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return &ttd, true +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &ttd, true +} + +// TestFailoverCleanupInput input definition for test failover cleanup. +type TestFailoverCleanupInput struct { + // Properties - Test failover cleanup input properties. + Properties *TestFailoverCleanupInputProperties `json:"properties,omitempty"` +} + +// TestFailoverCleanupInputProperties input definition for test failover cleanup input properties. +type TestFailoverCleanupInputProperties struct { + // Comments - Test failover cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// TestFailoverInput input definition for test failover. +type TestFailoverInput struct { + // Properties - Test failover input properties. + Properties *TestFailoverInputProperties `json:"properties,omitempty"` +} + +// TestFailoverInputProperties input definition for test failover input properties. +type TestFailoverInputProperties struct { + // FailoverDirection - Test failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // NetworkType - Network type to be used for test failover. + NetworkType *string `json:"networkType,omitempty"` + // NetworkID - The id of the network to be used for test failover. + NetworkID *string `json:"networkId,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicTestFailoverProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TestFailoverInputProperties struct. +func (tfip *TestFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + tfip.FailoverDirection = &failoverDirection + } + case "networkType": + if v != nil { + var networkType string + err = json.Unmarshal(*v, &networkType) + if err != nil { + return err + } + tfip.NetworkType = &networkType + } + case "networkId": + if v != nil { + var networkID string + err = json.Unmarshal(*v, &networkID) + if err != nil { + return err + } + tfip.NetworkID = &networkID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicTestFailoverProviderSpecificInput(*v) + if err != nil { + return err + } + tfip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// TestFailoverJobDetails this class represents the details for a test failover job. +type TestFailoverJobDetails struct { + // TestFailoverStatus - The test failover status. + TestFailoverStatus *string `json:"testFailoverStatus,omitempty"` + // Comments - The test failover comments. + Comments *string `json:"comments,omitempty"` + // NetworkName - The test network name. + NetworkName *string `json:"networkName,omitempty"` + // NetworkFriendlyName - The test network friendly name. + NetworkFriendlyName *string `json:"networkFriendlyName,omitempty"` + // NetworkType - The test network type (see TestFailoverInput enum for possible values). + NetworkType *string `json:"networkType,omitempty"` + // ProtectedItemDetails - The test VM details. + ProtectedItemDetails *[]FailoverReplicationProtectedItemDetails `json:"protectedItemDetails,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) MarshalJSON() ([]byte, error) { + tfjd.InstanceType = InstanceTypeTestFailoverJobDetails + objectMap := make(map[string]interface{}) + if tfjd.TestFailoverStatus != nil { + objectMap["testFailoverStatus"] = tfjd.TestFailoverStatus + } + if tfjd.Comments != nil { + objectMap["comments"] = tfjd.Comments + } + if tfjd.NetworkName != nil { + objectMap["networkName"] = tfjd.NetworkName + } + if tfjd.NetworkFriendlyName != nil { + objectMap["networkFriendlyName"] = tfjd.NetworkFriendlyName + } + if tfjd.NetworkType != nil { + objectMap["networkType"] = tfjd.NetworkType + } + if tfjd.ProtectedItemDetails != nil { + objectMap["protectedItemDetails"] = tfjd.ProtectedItemDetails + } + if tfjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = tfjd.AffectedObjectDetails + } + if tfjd.InstanceType != "" { + objectMap["instanceType"] = tfjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return &tfjd, true +} + +// AsJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &tfjd, true +} + +// BasicTestFailoverProviderSpecificInput provider specific test failover input. +type BasicTestFailoverProviderSpecificInput interface { + AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) + AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) + AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) + AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) + AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) + AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) +} + +// TestFailoverProviderSpecificInput provider specific test failover input. +type TestFailoverProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicTestFailoverProviderSpecificInput(body []byte) (BasicTestFailoverProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A): + var atfi A2ATestFailoverInput + err := json.Unmarshal(body, &atfi) + return atfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvratfi HyperVReplicaAzureTestFailoverInput + err := json.Unmarshal(body, &hvratfi) + return hvratfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2): + var imavtfi InMageAzureV2TestFailoverInput + err := json.Unmarshal(body, &imavtfi) + return imavtfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm): + var imrtfi InMageRcmTestFailoverInput + err := json.Unmarshal(body, &imrtfi) + return imrtfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage): + var imtfi InMageTestFailoverInput + err := json.Unmarshal(body, &imtfi) + return imtfi, err + default: + var tfpsi TestFailoverProviderSpecificInput + err := json.Unmarshal(body, &tfpsi) + return tfpsi, err + } +} +func unmarshalBasicTestFailoverProviderSpecificInputArray(body []byte) ([]BasicTestFailoverProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tfpsiArray := make([]BasicTestFailoverProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + tfpsi, err := unmarshalBasicTestFailoverProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + tfpsiArray[index] = tfpsi + } + return tfpsiArray, nil +} + +// MarshalJSON is the custom marshaler for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) MarshalJSON() ([]byte, error) { + tfpsi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput + objectMap := make(map[string]interface{}) + if tfpsi.InstanceType != "" { + objectMap["instanceType"] = tfpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return &tfpsi, true +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &tfpsi, true +} + +// TestMigrateCleanupInput input for test migrate cleanup. +type TestMigrateCleanupInput struct { + // Properties - Test migrate cleanup input properties. + Properties *TestMigrateCleanupInputProperties `json:"properties,omitempty"` +} + +// TestMigrateCleanupInputProperties test migrate cleanup input properties. +type TestMigrateCleanupInputProperties struct { + // Comments - Test migrate cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// TestMigrateInput input for test migrate. +type TestMigrateInput struct { + // Properties - Test migrate input properties. + Properties *TestMigrateInputProperties `json:"properties,omitempty"` +} + +// TestMigrateInputProperties test migrate input properties. +type TestMigrateInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicTestMigrateProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TestMigrateInputProperties struct. +func (tmip *TestMigrateInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicTestMigrateProviderSpecificInput(*v) + if err != nil { + return err + } + tmip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicTestMigrateProviderSpecificInput test migrate provider specific input. +type BasicTestMigrateProviderSpecificInput interface { + AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) + AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) +} + +// TestMigrateProviderSpecificInput test migrate provider specific input. +type TestMigrateProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput', 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicTestMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicTestMigrateProviderSpecificInput(body []byte) (BasicTestMigrateProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt): + var vmctmi VMwareCbtTestMigrateInput + err := json.Unmarshal(body, &vmctmi) + return vmctmi, err + default: + var tmpsi TestMigrateProviderSpecificInput + err := json.Unmarshal(body, &tmpsi) + return tmpsi, err + } +} +func unmarshalBasicTestMigrateProviderSpecificInputArray(body []byte) ([]BasicTestMigrateProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tmpsiArray := make([]BasicTestMigrateProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + tmpsi, err := unmarshalBasicTestMigrateProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + tmpsiArray[index] = tmpsi + } + return tmpsiArray, nil +} + +// MarshalJSON is the custom marshaler for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) MarshalJSON() ([]byte, error) { + tmpsi.InstanceType = InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput + objectMap := make(map[string]interface{}) + if tmpsi.InstanceType != "" { + objectMap["instanceType"] = tmpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtTestMigrateInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) { + return nil, false +} + +// AsTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) { + return &tmpsi, true +} + +// AsBasicTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsBasicTestMigrateProviderSpecificInput() (BasicTestMigrateProviderSpecificInput, bool) { + return &tmpsi, true +} + +// UnplannedFailoverInput input definition for unplanned failover. +type UnplannedFailoverInput struct { + // Properties - Unplanned failover input properties. + Properties *UnplannedFailoverInputProperties `json:"properties,omitempty"` +} + +// UnplannedFailoverInputProperties input definition for unplanned failover input properties. +type UnplannedFailoverInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // SourceSiteOperations - Source site operations status. + SourceSiteOperations *string `json:"sourceSiteOperations,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicUnplannedFailoverProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UnplannedFailoverInputProperties struct. +func (ufip *UnplannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + ufip.FailoverDirection = &failoverDirection + } + case "sourceSiteOperations": + if v != nil { + var sourceSiteOperations string + err = json.Unmarshal(*v, &sourceSiteOperations) + if err != nil { + return err + } + ufip.SourceSiteOperations = &sourceSiteOperations + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUnplannedFailoverProviderSpecificInput(*v) + if err != nil { + return err + } + ufip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUnplannedFailoverProviderSpecificInput provider specific unplanned failover input. +type BasicUnplannedFailoverProviderSpecificInput interface { + AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) + AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) + AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) + AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) + AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) + AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) +} + +// UnplannedFailoverProviderSpecificInput provider specific unplanned failover input. +type UnplannedFailoverProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUnplannedFailoverProviderSpecificInput(body []byte) (BasicUnplannedFailoverProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A): + var aufi A2AUnplannedFailoverInput + err := json.Unmarshal(body, &aufi) + return aufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraufi HyperVReplicaAzureUnplannedFailoverInput + err := json.Unmarshal(body, &hvraufi) + return hvraufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2): + var imavufi InMageAzureV2UnplannedFailoverInput + err := json.Unmarshal(body, &imavufi) + return imavufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm): + var imrufi InMageRcmUnplannedFailoverInput + err := json.Unmarshal(body, &imrufi) + return imrufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage): + var imufi InMageUnplannedFailoverInput + err := json.Unmarshal(body, &imufi) + return imufi, err + default: + var ufpsi UnplannedFailoverProviderSpecificInput + err := json.Unmarshal(body, &ufpsi) + return ufpsi, err + } +} +func unmarshalBasicUnplannedFailoverProviderSpecificInputArray(body []byte) ([]BasicUnplannedFailoverProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ufpsiArray := make([]BasicUnplannedFailoverProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ufpsi, err := unmarshalBasicUnplannedFailoverProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + ufpsiArray[index] = ufpsi + } + return ufpsiArray, nil +} + +// MarshalJSON is the custom marshaler for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) MarshalJSON() ([]byte, error) { + ufpsi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput + objectMap := make(map[string]interface{}) + if ufpsi.InstanceType != "" { + objectMap["instanceType"] = ufpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return &ufpsi, true +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &ufpsi, true +} + +// UpdateApplianceForReplicationProtectedItemInput update appliance for replication protected item input. +type UpdateApplianceForReplicationProtectedItemInput struct { + // Properties - Update appliance replication protected item properties. + Properties *UpdateApplianceForReplicationProtectedItemInputProperties `json:"properties,omitempty"` +} + +// UpdateApplianceForReplicationProtectedItemInputProperties update appliance for protected item input +// properties. +type UpdateApplianceForReplicationProtectedItemInputProperties struct { + // TargetApplianceID - The target appliance Id. + TargetApplianceID *string `json:"targetApplianceId,omitempty"` + // ProviderSpecificDetails - The provider specific input to update replication protected item. + ProviderSpecificDetails BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateApplianceForReplicationProtectedItemInputProperties struct. +func (uafrpiip *UpdateApplianceForReplicationProtectedItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetApplianceId": + if v != nil { + var targetApplianceID string + err = json.Unmarshal(*v, &targetApplianceID) + if err != nil { + return err + } + uafrpiip.TargetApplianceID = &targetApplianceID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput(*v) + if err != nil { + return err + } + uafrpiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput update replication protected item provider +// specific input. +type BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput interface { + AsInMageRcmUpdateApplianceForReplicationProtectedItemInput() (*InMageRcmUpdateApplianceForReplicationProtectedItemInput, bool) + AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (*UpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) +} + +// UpdateApplianceForReplicationProtectedItemProviderSpecificInput update replication protected item provider +// specific input. +type UpdateApplianceForReplicationProtectedItemProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput', 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput(body []byte) (BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm): + var imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput + err := json.Unmarshal(body, &imruafrpii) + return imruafrpii, err + default: + var uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput + err := json.Unmarshal(body, &uafrpipsi) + return uafrpipsi, err + } +} +func unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputArray(body []byte) ([]BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + uafrpipsiArray := make([]BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + uafrpipsi, err := unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + uafrpipsiArray[index] = uafrpipsi + } + return uafrpipsiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) MarshalJSON() ([]byte, error) { + uafrpipsi.InstanceType = InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput + objectMap := make(map[string]interface{}) + if uafrpipsi.InstanceType != "" { + objectMap["instanceType"] = uafrpipsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageRcmUpdateApplianceForReplicationProtectedItemInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) AsInMageRcmUpdateApplianceForReplicationProtectedItemInput() (*InMageRcmUpdateApplianceForReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (*UpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return &uafrpipsi, true +} + +// AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return &uafrpipsi, true +} + +// UpdateDiskInput disk input for update. +type UpdateDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // TargetDiskName - The target disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// UpdateMigrationItemInput update migration item input. +type UpdateMigrationItemInput struct { + // Properties - Update migration item input properties. + Properties *UpdateMigrationItemInputProperties `json:"properties,omitempty"` +} + +// UpdateMigrationItemInputProperties update migration item input properties. +type UpdateMigrationItemInputProperties struct { + // ProviderSpecificDetails - The provider specific input to update migration item. + ProviderSpecificDetails BasicUpdateMigrationItemProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateMigrationItemInputProperties struct. +func (umiip *UpdateMigrationItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateMigrationItemProviderSpecificInput(*v) + if err != nil { + return err + } + umiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateMigrationItemProviderSpecificInput update migration item provider specific input. +type BasicUpdateMigrationItemProviderSpecificInput interface { + AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) + AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) +} + +// UpdateMigrationItemProviderSpecificInput update migration item provider specific input. +type UpdateMigrationItemProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput', 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicUpdateMigrationItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateMigrationItemProviderSpecificInput(body []byte) (BasicUpdateMigrationItemProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt): + var vmcumii VMwareCbtUpdateMigrationItemInput + err := json.Unmarshal(body, &vmcumii) + return vmcumii, err + default: + var umipsi UpdateMigrationItemProviderSpecificInput + err := json.Unmarshal(body, &umipsi) + return umipsi, err + } +} +func unmarshalBasicUpdateMigrationItemProviderSpecificInputArray(body []byte) ([]BasicUpdateMigrationItemProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + umipsiArray := make([]BasicUpdateMigrationItemProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + umipsi, err := unmarshalBasicUpdateMigrationItemProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + umipsiArray[index] = umipsi + } + return umipsiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) MarshalJSON() ([]byte, error) { + umipsi.InstanceType = InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput + objectMap := make(map[string]interface{}) + if umipsi.InstanceType != "" { + objectMap["instanceType"] = umipsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtUpdateMigrationItemInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) { + return nil, false +} + +// AsUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) { + return &umipsi, true +} + +// AsBasicUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsBasicUpdateMigrationItemProviderSpecificInput() (BasicUpdateMigrationItemProviderSpecificInput, bool) { + return &umipsi, true +} + +// UpdateMobilityServiceRequest request to update the mobility service on a protected item. +type UpdateMobilityServiceRequest struct { + // Properties - The properties of the update mobility service request. + Properties *UpdateMobilityServiceRequestProperties `json:"properties,omitempty"` +} + +// UpdateMobilityServiceRequestProperties the properties of an update mobility service request. +type UpdateMobilityServiceRequestProperties struct { + // RunAsAccountID - The CS run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// UpdateNetworkMappingInput update network mapping input. +type UpdateNetworkMappingInput struct { + // Properties - The input properties needed to update network mapping. + Properties *UpdateNetworkMappingInputProperties `json:"properties,omitempty"` +} + +// UpdateNetworkMappingInputProperties common input details for network mapping operation. +type UpdateNetworkMappingInputProperties struct { + // RecoveryFabricName - Recovery fabric name. + RecoveryFabricName *string `json:"recoveryFabricName,omitempty"` + // RecoveryNetworkID - Recovery network Id. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // FabricSpecificDetails - Fabrics specific input network Id. + FabricSpecificDetails BasicFabricSpecificUpdateNetworkMappingInput `json:"fabricSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateNetworkMappingInputProperties struct. +func (unmip *UpdateNetworkMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryFabricName": + if v != nil { + var recoveryFabricName string + err = json.Unmarshal(*v, &recoveryFabricName) + if err != nil { + return err + } + unmip.RecoveryFabricName = &recoveryFabricName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + unmip.RecoveryNetworkID = &recoveryNetworkID + } + case "fabricSpecificDetails": + if v != nil { + fabricSpecificDetails, err := unmarshalBasicFabricSpecificUpdateNetworkMappingInput(*v) + if err != nil { + return err + } + unmip.FabricSpecificDetails = fabricSpecificDetails + } + } + } + + return nil +} + +// UpdatePolicyInput update policy input. +type UpdatePolicyInput struct { + // Properties - The ReplicationProviderSettings. + Properties *UpdatePolicyInputProperties `json:"properties,omitempty"` +} + +// UpdatePolicyInputProperties policy update properties. +type UpdatePolicyInputProperties struct { + // ReplicationProviderSettings - The ReplicationProviderSettings. + ReplicationProviderSettings BasicPolicyProviderSpecificInput `json:"replicationProviderSettings,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdatePolicyInputProperties struct. +func (upip *UpdatePolicyInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "replicationProviderSettings": + if v != nil { + replicationProviderSettings, err := unmarshalBasicPolicyProviderSpecificInput(*v) + if err != nil { + return err + } + upip.ReplicationProviderSettings = replicationProviderSettings + } + } + } + + return nil +} + +// UpdateProtectionContainerMappingInput container pairing update input. +type UpdateProtectionContainerMappingInput struct { + // Properties - Update protection container mapping input properties. + Properties *UpdateProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// UpdateProtectionContainerMappingInputProperties container pairing update input. +type UpdateProtectionContainerMappingInputProperties struct { + // ProviderSpecificInput - Provider specific input for updating protection container mapping. + ProviderSpecificInput BasicReplicationProviderSpecificUpdateContainerMappingInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateProtectionContainerMappingInputProperties struct. +func (upcmip *UpdateProtectionContainerMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(*v) + if err != nil { + return err + } + upcmip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// UpdateRecoveryPlanInput update recovery plan input class. +type UpdateRecoveryPlanInput struct { + // Properties - Recovery plan update properties. + Properties *UpdateRecoveryPlanInputProperties `json:"properties,omitempty"` +} + +// UpdateRecoveryPlanInputProperties recovery plan update properties. +type UpdateRecoveryPlanInputProperties struct { + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` +} + +// UpdateReplicationProtectedItemInput update replication protected item input. +type UpdateReplicationProtectedItemInput struct { + // Properties - Update replication protected item properties. + Properties *UpdateReplicationProtectedItemInputProperties `json:"properties,omitempty"` +} + +// UpdateReplicationProtectedItemInputProperties update protected item input properties. +type UpdateReplicationProtectedItemInputProperties struct { + // RecoveryAzureVMName - Target Azure VM name given by the user. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureVMSize - Target Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // SelectedRecoveryAzureNetworkID - Target Azure Network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The Azure Network Id for test failover. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // VMNics - The list of VM nic details. + VMNics *[]VMNicInputDetails `json:"vmNics,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // RecoveryAvailabilitySetID - The target availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // ProviderSpecificDetails - The provider specific input to update replication protected item. + ProviderSpecificDetails BasicUpdateReplicationProtectedItemProviderInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateReplicationProtectedItemInputProperties struct. +func (urpiip *UpdateReplicationProtectedItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryAzureVMName": + if v != nil { + var recoveryAzureVMName string + err = json.Unmarshal(*v, &recoveryAzureVMName) + if err != nil { + return err + } + urpiip.RecoveryAzureVMName = &recoveryAzureVMName + } + case "recoveryAzureVMSize": + if v != nil { + var recoveryAzureVMSize string + err = json.Unmarshal(*v, &recoveryAzureVMSize) + if err != nil { + return err + } + urpiip.RecoveryAzureVMSize = &recoveryAzureVMSize + } + case "selectedRecoveryAzureNetworkId": + if v != nil { + var selectedRecoveryAzureNetworkID string + err = json.Unmarshal(*v, &selectedRecoveryAzureNetworkID) + if err != nil { + return err + } + urpiip.SelectedRecoveryAzureNetworkID = &selectedRecoveryAzureNetworkID + } + case "selectedTfoAzureNetworkId": + if v != nil { + var selectedTfoAzureNetworkID string + err = json.Unmarshal(*v, &selectedTfoAzureNetworkID) + if err != nil { + return err + } + urpiip.SelectedTfoAzureNetworkID = &selectedTfoAzureNetworkID + } + case "selectedSourceNicId": + if v != nil { + var selectedSourceNicID string + err = json.Unmarshal(*v, &selectedSourceNicID) + if err != nil { + return err + } + urpiip.SelectedSourceNicID = &selectedSourceNicID + } + case "enableRdpOnTargetOption": + if v != nil { + var enableRdpOnTargetOption string + err = json.Unmarshal(*v, &enableRdpOnTargetOption) + if err != nil { + return err + } + urpiip.EnableRdpOnTargetOption = &enableRdpOnTargetOption + } + case "vmNics": + if v != nil { + var VMNics []VMNicInputDetails + err = json.Unmarshal(*v, &VMNics) + if err != nil { + return err + } + urpiip.VMNics = &VMNics + } + case "licenseType": + if v != nil { + var licenseType LicenseType + err = json.Unmarshal(*v, &licenseType) + if err != nil { + return err + } + urpiip.LicenseType = licenseType + } + case "recoveryAvailabilitySetId": + if v != nil { + var recoveryAvailabilitySetID string + err = json.Unmarshal(*v, &recoveryAvailabilitySetID) + if err != nil { + return err + } + urpiip.RecoveryAvailabilitySetID = &recoveryAvailabilitySetID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateReplicationProtectedItemProviderInput(*v) + if err != nil { + return err + } + urpiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateReplicationProtectedItemProviderInput update replication protected item provider specific input. +type BasicUpdateReplicationProtectedItemProviderInput interface { + AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) + AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) + AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) + AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) + AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) +} + +// UpdateReplicationProtectedItemProviderInput update replication protected item provider specific input. +type UpdateReplicationProtectedItemProviderInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateReplicationProtectedItemProviderInput(body []byte) (BasicUpdateReplicationProtectedItemProviderInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A): + var aurpii A2AUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &aurpii) + return aurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure): + var hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &hvraurpii) + return hvraurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2): + var imavurpii InMageAzureV2UpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &imavurpii) + return imavurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm): + var imrurpii InMageRcmUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &imrurpii) + return imrurpii, err + default: + var urpipi UpdateReplicationProtectedItemProviderInput + err := json.Unmarshal(body, &urpipi) + return urpipi, err + } +} +func unmarshalBasicUpdateReplicationProtectedItemProviderInputArray(body []byte) ([]BasicUpdateReplicationProtectedItemProviderInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + urpipiArray := make([]BasicUpdateReplicationProtectedItemProviderInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + urpipi, err := unmarshalBasicUpdateReplicationProtectedItemProviderInput(*rawMessage) + if err != nil { + return nil, err + } + urpipiArray[index] = urpipi + } + return urpipiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) MarshalJSON() ([]byte, error) { + urpipi.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput + objectMap := make(map[string]interface{}) + if urpipi.InstanceType != "" { + objectMap["instanceType"] = urpipi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return &urpipi, true +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &urpipi, true +} + +// UpdateVCenterRequest input required to update vCenter. +type UpdateVCenterRequest struct { + // Properties - The update VCenter Request Properties. + Properties *UpdateVCenterRequestProperties `json:"properties,omitempty"` +} + +// UpdateVCenterRequestProperties the properties of an update vCenter request. +type UpdateVCenterRequestProperties struct { + // FriendlyName - The friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the vCenter to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // ProcessServerID - The process server Id from where the update can be orchestrated. + ProcessServerID *string `json:"processServerId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The CS account Id which has privileges to update the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// VaultHealthDetails vault health details definition. +type VaultHealthDetails struct { + autorest.Response `json:"-"` + // Properties - The vault health related data. + Properties *VaultHealthProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VaultHealthDetails. +func (vhd VaultHealthDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vhd.Properties != nil { + objectMap["properties"] = vhd.Properties + } + if vhd.Location != nil { + objectMap["location"] = vhd.Location + } + return json.Marshal(objectMap) +} + +// VaultHealthProperties class to define the health summary of the Vault. +type VaultHealthProperties struct { + // VaultErrors - The list of errors on the vault. + VaultErrors *[]HealthError `json:"vaultErrors,omitempty"` + // ProtectedItemsHealth - The list of the health detail of the protected items in the vault. + ProtectedItemsHealth *ResourceHealthSummary `json:"protectedItemsHealth,omitempty"` + // FabricsHealth - The list of the health detail of the fabrics in the vault. + FabricsHealth *ResourceHealthSummary `json:"fabricsHealth,omitempty"` + // ContainersHealth - The list of the health detail of the containers in the vault. + ContainersHealth *ResourceHealthSummary `json:"containersHealth,omitempty"` +} + +// VaultSetting vault setting. +type VaultSetting struct { + autorest.Response `json:"-"` + // Properties - The vault setting properties. + Properties *VaultSettingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VaultSetting. +func (vs VaultSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vs.Properties != nil { + objectMap["properties"] = vs.Properties + } + if vs.Location != nil { + objectMap["location"] = vs.Location + } + return json.Marshal(objectMap) +} + +// VaultSettingCollection vault setting collection. +type VaultSettingCollection struct { + autorest.Response `json:"-"` + // Value - The list of vault setting. + Value *[]VaultSetting `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// VaultSettingCollectionIterator provides access to a complete listing of VaultSetting values. +type VaultSettingCollectionIterator struct { + i int + page VaultSettingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VaultSettingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VaultSettingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VaultSettingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VaultSettingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VaultSettingCollectionIterator) Response() VaultSettingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VaultSettingCollectionIterator) Value() VaultSetting { + if !iter.page.NotDone() { + return VaultSetting{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VaultSettingCollectionIterator type. +func NewVaultSettingCollectionIterator(page VaultSettingCollectionPage) VaultSettingCollectionIterator { + return VaultSettingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vsc VaultSettingCollection) IsEmpty() bool { + return vsc.Value == nil || len(*vsc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vsc VaultSettingCollection) hasNextLink() bool { + return vsc.NextLink != nil && len(*vsc.NextLink) != 0 +} + +// vaultSettingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vsc VaultSettingCollection) vaultSettingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !vsc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vsc.NextLink))) +} + +// VaultSettingCollectionPage contains a page of VaultSetting values. +type VaultSettingCollectionPage struct { + fn func(context.Context, VaultSettingCollection) (VaultSettingCollection, error) + vsc VaultSettingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VaultSettingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VaultSettingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vsc) + if err != nil { + return err + } + page.vsc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VaultSettingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VaultSettingCollectionPage) NotDone() bool { + return !page.vsc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VaultSettingCollectionPage) Response() VaultSettingCollection { + return page.vsc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VaultSettingCollectionPage) Values() []VaultSetting { + if page.vsc.IsEmpty() { + return nil + } + return *page.vsc.Value +} + +// Creates a new instance of the VaultSettingCollectionPage type. +func NewVaultSettingCollectionPage(cur VaultSettingCollection, getNextPage func(context.Context, VaultSettingCollection) (VaultSettingCollection, error)) VaultSettingCollectionPage { + return VaultSettingCollectionPage{ + fn: getNextPage, + vsc: cur, + } +} + +// VaultSettingCreationInput input to create vault setting. +type VaultSettingCreationInput struct { + // Properties - Vault setting creation input properties. + Properties *VaultSettingCreationInputProperties `json:"properties,omitempty"` +} + +// VaultSettingCreationInputProperties input to create vault setting. +type VaultSettingCreationInputProperties struct { + // MigrationSolutionID - The migration solution Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // VmwareToAzureProviderType - VMware to Azure provider type. + VmwareToAzureProviderType *string `json:"vmwareToAzureProviderType,omitempty"` +} + +// VaultSettingProperties vault setting properties. +type VaultSettingProperties struct { + // MigrationSolutionID - The migration solution ARM Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // VmwareToAzureProviderType - VMware to Azure provider type. + VmwareToAzureProviderType *string `json:"vmwareToAzureProviderType,omitempty"` +} + +// VCenter vCenter definition. +type VCenter struct { + autorest.Response `json:"-"` + // Properties - VCenter related data. + Properties *VCenterProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VCenter. +func (vc VCenter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vc.Properties != nil { + objectMap["properties"] = vc.Properties + } + if vc.Location != nil { + objectMap["location"] = vc.Location + } + return json.Marshal(objectMap) +} + +// VCenterCollection collection of vCenter details. +type VCenterCollection struct { + autorest.Response `json:"-"` + // Value - The vCenter details. + Value *[]VCenter `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// VCenterCollectionIterator provides access to a complete listing of VCenter values. +type VCenterCollectionIterator struct { + i int + page VCenterCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VCenterCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VCenterCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VCenterCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VCenterCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VCenterCollectionIterator) Response() VCenterCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VCenterCollectionIterator) Value() VCenter { + if !iter.page.NotDone() { + return VCenter{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VCenterCollectionIterator type. +func NewVCenterCollectionIterator(page VCenterCollectionPage) VCenterCollectionIterator { + return VCenterCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vcc VCenterCollection) IsEmpty() bool { + return vcc.Value == nil || len(*vcc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vcc VCenterCollection) hasNextLink() bool { + return vcc.NextLink != nil && len(*vcc.NextLink) != 0 +} + +// vCenterCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vcc VCenterCollection) vCenterCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !vcc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vcc.NextLink))) +} + +// VCenterCollectionPage contains a page of VCenter values. +type VCenterCollectionPage struct { + fn func(context.Context, VCenterCollection) (VCenterCollection, error) + vcc VCenterCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VCenterCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VCenterCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vcc) + if err != nil { + return err + } + page.vcc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VCenterCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VCenterCollectionPage) NotDone() bool { + return !page.vcc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VCenterCollectionPage) Response() VCenterCollection { + return page.vcc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VCenterCollectionPage) Values() []VCenter { + if page.vcc.IsEmpty() { + return nil + } + return *page.vcc.Value +} + +// Creates a new instance of the VCenterCollectionPage type. +func NewVCenterCollectionPage(cur VCenterCollection, getNextPage func(context.Context, VCenterCollection) (VCenterCollection, error)) VCenterCollectionPage { + return VCenterCollectionPage{ + fn: getNextPage, + vcc: cur, + } +} + +// VCenterProperties vCenter properties. +type VCenterProperties struct { + // FriendlyName - Friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // InternalID - VCenter internal ID. + InternalID *string `json:"internalId,omitempty"` + // LastHeartbeat - The time when the last heartbeat was received by vCenter. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // DiscoveryStatus - The VCenter discovery status. + DiscoveryStatus *string `json:"discoveryStatus,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // IPAddress - The IP address of the vCenter. + IPAddress *string `json:"ipAddress,omitempty"` + // InfrastructureID - The infrastructure Id of vCenter. + InfrastructureID *string `json:"infrastructureId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The account Id which has privileges to discover the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // FabricArmResourceName - The ARM resource name of the fabric containing this VCenter. + FabricArmResourceName *string `json:"fabricArmResourceName,omitempty"` + // HealthErrors - The health errors for this VCenter. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// VersionDetails version related details. +type VersionDetails struct { + // Version - The agent version. + Version *string `json:"version,omitempty"` + // ExpiryDate - Version expiry date. + ExpiryDate *date.Time `json:"expiryDate,omitempty"` + // Status - A value indicating whether security update required. Possible values include: 'Supported', 'NotSupported', 'Deprecated', 'UpdateRequired', 'SecurityUpdateRequired' + Status AgentVersionStatus `json:"status,omitempty"` +} + +// VirtualMachineTaskDetails this class represents the virtual machine task details. +type VirtualMachineTaskDetails struct { + // SkippedReason - The skipped reason. + SkippedReason *string `json:"skippedReason,omitempty"` + // SkippedReasonString - The skipped reason string. + SkippedReasonString *string `json:"skippedReasonString,omitempty"` + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) MarshalJSON() ([]byte, error) { + vmtd.InstanceType = InstanceTypeVirtualMachineTaskDetails + objectMap := make(map[string]interface{}) + if vmtd.SkippedReason != nil { + objectMap["skippedReason"] = vmtd.SkippedReason + } + if vmtd.SkippedReasonString != nil { + objectMap["skippedReasonString"] = vmtd.SkippedReasonString + } + if vmtd.JobTask != nil { + objectMap["jobTask"] = vmtd.JobTask + } + if vmtd.InstanceType != "" { + objectMap["instanceType"] = vmtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &vmtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return &vmtd, true +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &vmtd, true +} + +// VmmDetails VMM fabric specific details. +type VmmDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmDetails. +func (vd VmmDetails) MarshalJSON() ([]byte, error) { + vd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM + objectMap := make(map[string]interface{}) + if vd.InstanceType != "" { + objectMap["instanceType"] = vd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVmmDetails() (*VmmDetails, bool) { + return &vd, true +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vd, true +} + +// VmmToAzureCreateNetworkMappingInput create network mappings input properties/behavior specific to Vmm to +// Azure Network mapping. +type VmmToAzureCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtacnmi.InstanceType = InstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtacnmi.InstanceType != "" { + objectMap["instanceType"] = vtacnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return &vtacnmi, true +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &vtacnmi, true +} + +// VmmToAzureNetworkMappingSettings e2A Network Mapping fabric specific settings. +type VmmToAzureNetworkMappingSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) MarshalJSON() ([]byte, error) { + vtanms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtanms.InstanceType != "" { + objectMap["instanceType"] = vtanms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return &vtanms, true +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &vtanms, true +} + +// VmmToAzureUpdateNetworkMappingInput update network mappings input properties/behavior specific to vmm to +// azure. +type VmmToAzureUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtaunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtaunmi.InstanceType != "" { + objectMap["instanceType"] = vtaunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return &vtaunmi, true +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &vtaunmi, true +} + +// VmmToVmmCreateNetworkMappingInput create network mappings input properties/behavior specific to vmm to +// vmm Network mapping. +type VmmToVmmCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtvcnmi.InstanceType = InstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvcnmi.InstanceType != "" { + objectMap["instanceType"] = vtvcnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return &vtvcnmi, true +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &vtvcnmi, true +} + +// VmmToVmmNetworkMappingSettings e2E Network Mapping fabric specific settings. +type VmmToVmmNetworkMappingSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) MarshalJSON() ([]byte, error) { + vtvnms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvnms.InstanceType != "" { + objectMap["instanceType"] = vtvnms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return &vtvnms, true +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &vtvnms, true +} + +// VmmToVmmUpdateNetworkMappingInput update network mappings input properties/behavior specific to vmm to +// vmm. +type VmmToVmmUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtvunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvunmi.InstanceType != "" { + objectMap["instanceType"] = vtvunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return &vtvunmi, true +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &vtvunmi, true +} + +// VmmVirtualMachineDetails VMM fabric provider specific VM settings. +type VmmVirtualMachineDetails struct { + // SourceItemID - The source id of the object. + SourceItemID *string `json:"sourceItemId,omitempty"` + // Generation - The id of the object in fabric. + Generation *string `json:"generation,omitempty"` + // OsDetails - The Last replication time. + OsDetails *OSDetails `json:"osDetails,omitempty"` + // DiskDetails - The Last successful failover time. + DiskDetails *[]DiskDetails `json:"diskDetails,omitempty"` + // HasPhysicalDisk - A value indicating whether the VM has a physical disk attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasPhysicalDisk PresenceStatus `json:"hasPhysicalDisk,omitempty"` + // HasFibreChannelAdapter - A value indicating whether the VM has a fibre channel adapter attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasFibreChannelAdapter PresenceStatus `json:"hasFibreChannelAdapter,omitempty"` + // HasSharedVhd - A value indicating whether the VM has a shared VHD attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasSharedVhd PresenceStatus `json:"hasSharedVhd,omitempty"` + // HyperVHostID - The Id of the hyper-v host in fabric. + HyperVHostID *string `json:"hyperVHostId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) MarshalJSON() ([]byte, error) { + vvmd.InstanceType = InstanceTypeVmmVirtualMachine + objectMap := make(map[string]interface{}) + if vvmd.SourceItemID != nil { + objectMap["sourceItemId"] = vvmd.SourceItemID + } + if vvmd.Generation != nil { + objectMap["generation"] = vvmd.Generation + } + if vvmd.OsDetails != nil { + objectMap["osDetails"] = vvmd.OsDetails + } + if vvmd.DiskDetails != nil { + objectMap["diskDetails"] = vvmd.DiskDetails + } + if vvmd.HasPhysicalDisk != "" { + objectMap["hasPhysicalDisk"] = vvmd.HasPhysicalDisk + } + if vvmd.HasFibreChannelAdapter != "" { + objectMap["hasFibreChannelAdapter"] = vvmd.HasFibreChannelAdapter + } + if vvmd.HasSharedVhd != "" { + objectMap["hasSharedVhd"] = vvmd.HasSharedVhd + } + if vvmd.HyperVHostID != nil { + objectMap["hyperVHostId"] = vvmd.HyperVHostID + } + if vvmd.InstanceType != "" { + objectMap["instanceType"] = vvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return &vvmd, true +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return &vvmd, true +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &vvmd, true +} + +// VMNicDetails hyper V VM network details. +type VMNicDetails struct { + // NicID - The nic Id. + NicID *string `json:"nicId,omitempty"` + // ReplicaNicID - The replica nic Id. + ReplicaNicID *string `json:"replicaNicId,omitempty"` + // SourceNicArmID - The source nic ARM Id. + SourceNicArmID *string `json:"sourceNicArmId,omitempty"` + // VMNetworkName - VM network name. + VMNetworkName *string `json:"vMNetworkName,omitempty"` + // RecoveryVMNetworkID - Recovery VM network Id. + RecoveryVMNetworkID *string `json:"recoveryVMNetworkId,omitempty"` + // IPConfigs - The IP configurations of the NIC. + IPConfigs *[]IPConfigDetails `json:"ipConfigs,omitempty"` + // SelectionType - Selection type for failover. + SelectionType *string `json:"selectionType,omitempty"` + // RecoveryNetworkSecurityGroupID - The id of the NSG associated with the NIC. + RecoveryNetworkSecurityGroupID *string `json:"recoveryNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnRecovery - A value indicating whether the NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnRecovery *bool `json:"enableAcceleratedNetworkingOnRecovery,omitempty"` + // TfoVMNetworkID - The network to be used by NIC during test failover. + TfoVMNetworkID *string `json:"tfoVMNetworkId,omitempty"` + // TfoNetworkSecurityGroupID - The NSG to be used by NIC during test failover. + TfoNetworkSecurityGroupID *string `json:"tfoNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnTfo - Whether the TFO NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnTfo *bool `json:"enableAcceleratedNetworkingOnTfo,omitempty"` + // RecoveryNicName - The name of the NIC to be used when creating target NICs. + RecoveryNicName *string `json:"recoveryNicName,omitempty"` + // RecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs. + RecoveryNicResourceGroupName *string `json:"recoveryNicResourceGroupName,omitempty"` + // ReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during failover subject to availability. + ReuseExistingNic *bool `json:"reuseExistingNic,omitempty"` + // TfoRecoveryNicName - The name of the NIC to be used when creating target NICs in TFO. + TfoRecoveryNicName *string `json:"tfoRecoveryNicName,omitempty"` + // TfoRecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs in TFO. + TfoRecoveryNicResourceGroupName *string `json:"tfoRecoveryNicResourceGroupName,omitempty"` + // TfoReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during test failover subject to availability. + TfoReuseExistingNic *bool `json:"tfoReuseExistingNic,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` +} + +// VMNicInputDetails hyper V VM network input details. +type VMNicInputDetails struct { + // NicID - The nic Id. + NicID *string `json:"nicId,omitempty"` + // IPConfigs - The IP configurations to be used by NIC during test failover and failover. + IPConfigs *[]IPConfigInputDetails `json:"ipConfigs,omitempty"` + // SelectionType - Selection type for failover. + SelectionType *string `json:"selectionType,omitempty"` + // RecoveryNetworkSecurityGroupID - The id of the NSG associated with the NIC. + RecoveryNetworkSecurityGroupID *string `json:"recoveryNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnRecovery - Whether the NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnRecovery *bool `json:"enableAcceleratedNetworkingOnRecovery,omitempty"` + // TfoNetworkSecurityGroupID - The NSG to be used by NIC during test failover. + TfoNetworkSecurityGroupID *string `json:"tfoNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnTfo - Whether the test NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnTfo *bool `json:"enableAcceleratedNetworkingOnTfo,omitempty"` + // RecoveryNicName - The name of the NIC to be used when creating target NICs. + RecoveryNicName *string `json:"recoveryNicName,omitempty"` + // RecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs. + RecoveryNicResourceGroupName *string `json:"recoveryNicResourceGroupName,omitempty"` + // ReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during failover subject to availability. + ReuseExistingNic *bool `json:"reuseExistingNic,omitempty"` + // TfoNicName - The name of the NIC to be used when creating target NICs in TFO. + TfoNicName *string `json:"tfoNicName,omitempty"` + // TfoNicResourceGroupName - The resource group of the NIC to be used when creating target NICs in TFO. + TfoNicResourceGroupName *string `json:"tfoNicResourceGroupName,omitempty"` + // TfoReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during test failover subject to availability. + TfoReuseExistingNic *bool `json:"tfoReuseExistingNic,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` +} + +// VMNicUpdatesTaskDetails this class represents the vm NicUpdates task details. +type VMNicUpdatesTaskDetails struct { + // VMID - Virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // NicID - Nic Id. + NicID *string `json:"nicId,omitempty"` + // Name - Name of the Nic. + Name *string `json:"name,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) MarshalJSON() ([]byte, error) { + vnutd.InstanceType = InstanceTypeVMNicUpdatesTaskDetails + objectMap := make(map[string]interface{}) + if vnutd.VMID != nil { + objectMap["vmId"] = vnutd.VMID + } + if vnutd.NicID != nil { + objectMap["nicId"] = vnutd.NicID + } + if vnutd.Name != nil { + objectMap["name"] = vnutd.Name + } + if vnutd.InstanceType != "" { + objectMap["instanceType"] = vnutd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return &vnutd, true +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &vnutd, true +} + +// VMwareCbtContainerCreationInput vMwareCbt container creation input. +type VMwareCbtContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) MarshalJSON() ([]byte, error) { + vmccci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmccci.InstanceType != "" { + objectMap["instanceType"] = vmccci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return &vmccci, true +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &vmccci, true +} + +// VMwareCbtContainerMappingInput vMwareCbt container mapping input. +type VMwareCbtContainerMappingInput struct { + // KeyVaultID - The target key vault ARM Id. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyVaultURI - The target key vault URL. + KeyVaultURI *string `json:"keyVaultUri,omitempty"` + // StorageAccountID - The storage account ARM Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // StorageAccountSasSecretName - The secret name of the storage account. + StorageAccountSasSecretName *string `json:"storageAccountSasSecretName,omitempty"` + // ServiceBusConnectionStringSecretName - The secret name of the service bus connection string. + ServiceBusConnectionStringSecretName *string `json:"serviceBusConnectionStringSecretName,omitempty"` + // TargetLocation - The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) MarshalJSON() ([]byte, error) { + vmccmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmccmi.KeyVaultID != nil { + objectMap["keyVaultId"] = vmccmi.KeyVaultID + } + if vmccmi.KeyVaultURI != nil { + objectMap["keyVaultUri"] = vmccmi.KeyVaultURI + } + if vmccmi.StorageAccountID != nil { + objectMap["storageAccountId"] = vmccmi.StorageAccountID + } + if vmccmi.StorageAccountSasSecretName != nil { + objectMap["storageAccountSasSecretName"] = vmccmi.StorageAccountSasSecretName + } + if vmccmi.ServiceBusConnectionStringSecretName != nil { + objectMap["serviceBusConnectionStringSecretName"] = vmccmi.ServiceBusConnectionStringSecretName + } + if vmccmi.TargetLocation != nil { + objectMap["targetLocation"] = vmccmi.TargetLocation + } + if vmccmi.InstanceType != "" { + objectMap["instanceType"] = vmccmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return &vmccmi, true +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &vmccmi, true +} + +// VMwareCbtDiskInput vMwareCbt disk input. +type VMwareCbtDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // IsOSDisk - A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // LogStorageAccountSasSecretName - The key vault secret name of the log storage account. + LogStorageAccountSasSecretName *string `json:"logStorageAccountSasSecretName,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// VMwareCbtEnableMigrationInput vMwareCbt specific enable migration input. +type VMwareCbtEnableMigrationInput struct { + // VmwareMachineID - The ARM Id of the VM discovered in VMware. + VmwareMachineID *string `json:"vmwareMachineId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]VMwareCbtDiskInput `json:"disksToInclude,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // DataMoverRunAsAccountID - The data mover run as account Id. + DataMoverRunAsAccountID *string `json:"dataMoverRunAsAccountId,omitempty"` + // SnapshotRunAsAccountID - The snapshot run as account Id. + SnapshotRunAsAccountID *string `json:"snapshotRunAsAccountId,omitempty"` + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TargetSubnetName - The target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedDiskTags - The tags for the seed disks. + SeedDiskTags map[string]*string `json:"seedDiskTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeEnableMigrationProviderSpecificInput', 'InstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEnableMigrationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) MarshalJSON() ([]byte, error) { + vmcemi.InstanceType = InstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcemi.VmwareMachineID != nil { + objectMap["vmwareMachineId"] = vmcemi.VmwareMachineID + } + if vmcemi.DisksToInclude != nil { + objectMap["disksToInclude"] = vmcemi.DisksToInclude + } + if vmcemi.LicenseType != "" { + objectMap["licenseType"] = vmcemi.LicenseType + } + if vmcemi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = vmcemi.SQLServerLicenseType + } + if vmcemi.DataMoverRunAsAccountID != nil { + objectMap["dataMoverRunAsAccountId"] = vmcemi.DataMoverRunAsAccountID + } + if vmcemi.SnapshotRunAsAccountID != nil { + objectMap["snapshotRunAsAccountId"] = vmcemi.SnapshotRunAsAccountID + } + if vmcemi.TargetVMName != nil { + objectMap["targetVmName"] = vmcemi.TargetVMName + } + if vmcemi.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcemi.TargetVMSize + } + if vmcemi.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcemi.TargetResourceGroupID + } + if vmcemi.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcemi.TargetNetworkID + } + if vmcemi.TargetSubnetName != nil { + objectMap["targetSubnetName"] = vmcemi.TargetSubnetName + } + if vmcemi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcemi.TargetAvailabilitySetID + } + if vmcemi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcemi.TargetAvailabilityZone + } + if vmcemi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcemi.TargetProximityPlacementGroupID + } + if vmcemi.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcemi.TargetBootDiagnosticsStorageAccountID + } + if vmcemi.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcemi.PerformAutoResync + } + if vmcemi.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcemi.TargetVMTags + } + if vmcemi.SeedDiskTags != nil { + objectMap["seedDiskTags"] = vmcemi.SeedDiskTags + } + if vmcemi.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcemi.TargetDiskTags + } + if vmcemi.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcemi.TargetNicTags + } + if vmcemi.InstanceType != "" { + objectMap["instanceType"] = vmcemi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtEnableMigrationInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) { + return &vmcemi, true +} + +// AsEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsBasicEnableMigrationProviderSpecificInput() (BasicEnableMigrationProviderSpecificInput, bool) { + return &vmcemi, true +} + +// VMwareCbtEventDetails event details for VMwareCbt provider. +type VMwareCbtEventDetails struct { + // MigrationItemName - READ-ONLY; The migration item name. + MigrationItemName *string `json:"migrationItemName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) MarshalJSON() ([]byte, error) { + vmced.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmced.InstanceType != "" { + objectMap["instanceType"] = vmced.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return &vmced, true +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &vmced, true +} + +// VMwareCbtMigrateInput vMwareCbt specific migrate input. +type VMwareCbtMigrateInput struct { + // PerformShutdown - A value indicating whether VM is to be shutdown. + PerformShutdown *string `json:"performShutdown,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput', 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) MarshalJSON() ([]byte, error) { + vmcmi.InstanceType = InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcmi.PerformShutdown != nil { + objectMap["performShutdown"] = vmcmi.PerformShutdown + } + if vmcmi.InstanceType != "" { + objectMap["instanceType"] = vmcmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrateInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) { + return &vmcmi, true +} + +// AsMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsBasicMigrateProviderSpecificInput() (BasicMigrateProviderSpecificInput, bool) { + return &vmcmi, true +} + +// VMwareCbtMigrationDetails vMwareCbt provider specific settings. +type VMwareCbtMigrationDetails struct { + // VmwareMachineID - READ-ONLY; The ARM Id of the VM discovered in VMware. + VmwareMachineID *string `json:"vmwareMachineId,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // FirmwareType - READ-ONLY; The firmware type. + FirmwareType *string `json:"firmwareType,omitempty"` + // TargetGeneration - READ-ONLY; The target generation. + TargetGeneration *string `json:"targetGeneration,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // DataMoverRunAsAccountID - READ-ONLY; The data mover run as account Id. + DataMoverRunAsAccountID *string `json:"dataMoverRunAsAccountId,omitempty"` + // SnapshotRunAsAccountID - READ-ONLY; The snapshot run as account Id. + SnapshotRunAsAccountID *string `json:"snapshotRunAsAccountId,omitempty"` + // TargetVMName - Target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetLocation - READ-ONLY; The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // TargetResourceGroupID - The target resource group Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]VMwareCbtProtectedDiskDetails `json:"protectedDisks,omitempty"` + // TargetNetworkID - The target network Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // VMNics - The network details. + VMNics *[]VMwareCbtNicDetails `json:"vmNics,omitempty"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // MigrationRecoveryPointID - READ-ONLY; The recovery point Id to which the VM was migrated. + MigrationRecoveryPointID *string `json:"migrationRecoveryPointId,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // LastRecoveryPointID - READ-ONLY; The last recovery point Id. + LastRecoveryPointID *string `json:"lastRecoveryPointId,omitempty"` + // InitialSeedingProgressPercentage - READ-ONLY; The initial seeding progress percentage. + InitialSeedingProgressPercentage *int32 `json:"initialSeedingProgressPercentage,omitempty"` + // MigrationProgressPercentage - READ-ONLY; The migration progress percentage. + MigrationProgressPercentage *int32 `json:"migrationProgressPercentage,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // InitialSeedingRetryCount - READ-ONLY; The initial seeding retry count. + InitialSeedingRetryCount *int64 `json:"initialSeedingRetryCount,omitempty"` + // ResyncRetryCount - READ-ONLY; The resync retry count. + ResyncRetryCount *int64 `json:"resyncRetryCount,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // SeedDiskTags - The tags for the seed disks. + SeedDiskTags map[string]*string `json:"seedDiskTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings', 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) MarshalJSON() ([]byte, error) { + vmcmd.InstanceType = InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcmd.LicenseType != nil { + objectMap["licenseType"] = vmcmd.LicenseType + } + if vmcmd.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = vmcmd.SQLServerLicenseType + } + if vmcmd.TargetVMName != nil { + objectMap["targetVmName"] = vmcmd.TargetVMName + } + if vmcmd.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcmd.TargetVMSize + } + if vmcmd.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcmd.TargetResourceGroupID + } + if vmcmd.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcmd.TargetAvailabilitySetID + } + if vmcmd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcmd.TargetAvailabilityZone + } + if vmcmd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcmd.TargetProximityPlacementGroupID + } + if vmcmd.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcmd.TargetBootDiagnosticsStorageAccountID + } + if vmcmd.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcmd.TargetVMTags + } + if vmcmd.ProtectedDisks != nil { + objectMap["protectedDisks"] = vmcmd.ProtectedDisks + } + if vmcmd.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcmd.TargetNetworkID + } + if vmcmd.VMNics != nil { + objectMap["vmNics"] = vmcmd.VMNics + } + if vmcmd.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcmd.TargetNicTags + } + if vmcmd.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcmd.PerformAutoResync + } + if vmcmd.SeedDiskTags != nil { + objectMap["seedDiskTags"] = vmcmd.SeedDiskTags + } + if vmcmd.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcmd.TargetDiskTags + } + if vmcmd.InstanceType != "" { + objectMap["instanceType"] = vmcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrationDetails is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) { + return &vmcmd, true +} + +// AsMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsBasicMigrationProviderSpecificSettings() (BasicMigrationProviderSpecificSettings, bool) { + return &vmcmd, true +} + +// VMwareCbtNicDetails vMwareCbt NIC details. +type VMwareCbtNicDetails struct { + // NicID - READ-ONLY; The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // SourceIPAddress - READ-ONLY; The source IP address. + SourceIPAddress *string `json:"sourceIPAddress,omitempty"` + // SourceIPAddressType - READ-ONLY; The source IP address type. Possible values include: 'Dynamic', 'Static' + SourceIPAddressType EthernetAddressType `json:"sourceIPAddressType,omitempty"` + // SourceNetworkID - READ-ONLY; Source network Id. + SourceNetworkID *string `json:"sourceNetworkId,omitempty"` + // TargetIPAddress - The target IP address. + TargetIPAddress *string `json:"targetIPAddress,omitempty"` + // TargetIPAddressType - The target IP address type. Possible values include: 'Dynamic', 'Static' + TargetIPAddressType EthernetAddressType `json:"targetIPAddressType,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` + // IsSelectedForMigration - A value indicating whether this NIC is selected for migration. + IsSelectedForMigration *string `json:"isSelectedForMigration,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtNicDetails. +func (vmcnd VMwareCbtNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmcnd.IsPrimaryNic != nil { + objectMap["isPrimaryNic"] = vmcnd.IsPrimaryNic + } + if vmcnd.TargetIPAddress != nil { + objectMap["targetIPAddress"] = vmcnd.TargetIPAddress + } + if vmcnd.TargetIPAddressType != "" { + objectMap["targetIPAddressType"] = vmcnd.TargetIPAddressType + } + if vmcnd.TargetSubnetName != nil { + objectMap["targetSubnetName"] = vmcnd.TargetSubnetName + } + if vmcnd.TargetNicName != nil { + objectMap["targetNicName"] = vmcnd.TargetNicName + } + if vmcnd.IsSelectedForMigration != nil { + objectMap["isSelectedForMigration"] = vmcnd.IsSelectedForMigration + } + return json.Marshal(objectMap) +} + +// VMwareCbtNicInput vMwareCbt NIC input. +type VMwareCbtNicInput struct { + // NicID - The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetStaticIPAddress - The static IP address. + TargetStaticIPAddress *string `json:"targetStaticIPAddress,omitempty"` + // IsSelectedForMigration - A value indicating whether this NIC is selected for migration. + IsSelectedForMigration *string `json:"isSelectedForMigration,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` +} + +// VMwareCbtPolicyCreationInput vMware Cbt policy creation input. +type VMwareCbtPolicyCreationInput struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) MarshalJSON() ([]byte, error) { + vmcpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcpci.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = vmcpci.RecoveryPointHistoryInMinutes + } + if vmcpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = vmcpci.CrashConsistentFrequencyInMinutes + } + if vmcpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = vmcpci.AppConsistentFrequencyInMinutes + } + if vmcpci.InstanceType != "" { + objectMap["instanceType"] = vmcpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return &vmcpci, true +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &vmcpci, true +} + +// VmwareCbtPolicyDetails vMware Cbt specific policy details. +type VmwareCbtPolicyDetails struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) MarshalJSON() ([]byte, error) { + vcpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vcpd.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = vcpd.RecoveryPointHistoryInMinutes + } + if vcpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = vcpd.AppConsistentFrequencyInMinutes + } + if vcpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = vcpd.CrashConsistentFrequencyInMinutes + } + if vcpd.InstanceType != "" { + objectMap["instanceType"] = vcpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return &vcpd, true +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &vcpd, true +} + +// VMwareCbtProtectedDiskDetails vMwareCbt protected disk details. +type VMwareCbtProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskPath - READ-ONLY; The disk path. + DiskPath *string `json:"diskPath,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // LogStorageAccountSasSecretName - READ-ONLY; The key vault secret name of the log storage account. + LogStorageAccountSasSecretName *string `json:"logStorageAccountSasSecretName,omitempty"` + // DiskEncryptionSetID - READ-ONLY; The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // SeedManagedDiskID - READ-ONLY; The ARM Id of the seed managed disk. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // TargetManagedDiskID - READ-ONLY; The ARM Id of the target managed disk. + TargetManagedDiskID *string `json:"targetManagedDiskId,omitempty"` + // TargetDiskName - The name for the target managed disk. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtProtectedDiskDetails. +func (vmcpdd VMwareCbtProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmcpdd.DiskType != "" { + objectMap["diskType"] = vmcpdd.DiskType + } + if vmcpdd.TargetDiskName != nil { + objectMap["targetDiskName"] = vmcpdd.TargetDiskName + } + return json.Marshal(objectMap) +} + +// VMwareCbtProtectionContainerMappingDetails vMwareCbt provider specific container mapping details. +type VMwareCbtProtectionContainerMappingDetails struct { + // KeyVaultID - READ-ONLY; The target key vault ARM Id. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyVaultURI - READ-ONLY; The target key vault URI. + KeyVaultURI *string `json:"keyVaultUri,omitempty"` + // StorageAccountID - READ-ONLY; The storage account ARM Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // StorageAccountSasSecretName - READ-ONLY; The secret name of the storage account. + StorageAccountSasSecretName *string `json:"storageAccountSasSecretName,omitempty"` + // ServiceBusConnectionStringSecretName - READ-ONLY; The secret name of the service bus connection string. + ServiceBusConnectionStringSecretName *string `json:"serviceBusConnectionStringSecretName,omitempty"` + // TargetLocation - READ-ONLY; The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + vmcpcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcpcmd.InstanceType != "" { + objectMap["instanceType"] = vmcpcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return &vmcpcmd, true +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &vmcpcmd, true +} + +// VMwareCbtResyncInput vMwareCbt specific resync input. +type VMwareCbtResyncInput struct { + // SkipCbtReset - A value indicating whether CBT is to be reset. + SkipCbtReset *string `json:"skipCbtReset,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput', 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicResyncProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) MarshalJSON() ([]byte, error) { + vmcri.InstanceType = InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcri.SkipCbtReset != nil { + objectMap["skipCbtReset"] = vmcri.SkipCbtReset + } + if vmcri.InstanceType != "" { + objectMap["instanceType"] = vmcri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtResyncInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) { + return &vmcri, true +} + +// AsResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsBasicResyncProviderSpecificInput() (BasicResyncProviderSpecificInput, bool) { + return &vmcri, true +} + +// VMwareCbtTestMigrateInput vMwareCbt specific test migrate input. +type VMwareCbtTestMigrateInput struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // NetworkID - The test network Id. + NetworkID *string `json:"networkId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput', 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicTestMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) MarshalJSON() ([]byte, error) { + vmctmi.InstanceType = InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmctmi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = vmctmi.RecoveryPointID + } + if vmctmi.NetworkID != nil { + objectMap["networkId"] = vmctmi.NetworkID + } + if vmctmi.InstanceType != "" { + objectMap["instanceType"] = vmctmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtTestMigrateInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) { + return &vmctmi, true +} + +// AsTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsBasicTestMigrateProviderSpecificInput() (BasicTestMigrateProviderSpecificInput, bool) { + return &vmctmi, true +} + +// VMwareCbtUpdateDiskInput vMwareCbt disk input for update. +type VMwareCbtUpdateDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // TargetDiskName - The target disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// VMwareCbtUpdateMigrationItemInput vMwareCbt specific update migration item input. +type VMwareCbtUpdateMigrationItemInput struct { + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // VMNics - The list of NIC details. + VMNics *[]VMwareCbtNicInput `json:"vmNics,omitempty"` + // VMDisks - The list of disk update properties. + VMDisks *[]VMwareCbtUpdateDiskInput `json:"vmDisks,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput', 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicUpdateMigrationItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) MarshalJSON() ([]byte, error) { + vmcumii.InstanceType = InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcumii.TargetVMName != nil { + objectMap["targetVmName"] = vmcumii.TargetVMName + } + if vmcumii.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcumii.TargetVMSize + } + if vmcumii.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcumii.TargetResourceGroupID + } + if vmcumii.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcumii.TargetAvailabilitySetID + } + if vmcumii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcumii.TargetAvailabilityZone + } + if vmcumii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcumii.TargetProximityPlacementGroupID + } + if vmcumii.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcumii.TargetBootDiagnosticsStorageAccountID + } + if vmcumii.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcumii.TargetNetworkID + } + if vmcumii.VMNics != nil { + objectMap["vmNics"] = vmcumii.VMNics + } + if vmcumii.VMDisks != nil { + objectMap["vmDisks"] = vmcumii.VMDisks + } + if vmcumii.LicenseType != "" { + objectMap["licenseType"] = vmcumii.LicenseType + } + if vmcumii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = vmcumii.SQLServerLicenseType + } + if vmcumii.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcumii.PerformAutoResync + } + if vmcumii.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcumii.TargetVMTags + } + if vmcumii.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcumii.TargetDiskTags + } + if vmcumii.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcumii.TargetNicTags + } + if vmcumii.InstanceType != "" { + objectMap["instanceType"] = vmcumii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtUpdateMigrationItemInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) { + return &vmcumii, true +} + +// AsUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsBasicUpdateMigrationItemProviderSpecificInput() (BasicUpdateMigrationItemProviderSpecificInput, bool) { + return &vmcumii, true +} + +// VMwareDetails store the fabric details specific to the VMware fabric. +type VMwareDetails struct { + // ProcessServers - The list of Process Servers associated with the fabric. + ProcessServers *[]ProcessServer `json:"processServers,omitempty"` + // MasterTargetServers - The list of Master Target servers associated with the fabric. + MasterTargetServers *[]MasterTargetServer `json:"masterTargetServers,omitempty"` + // RunAsAccounts - The list of run as accounts created on the server. + RunAsAccounts *[]RunAsAccount `json:"runAsAccounts,omitempty"` + // ReplicationPairCount - The number of replication pairs configured in this CS. + ReplicationPairCount *string `json:"replicationPairCount,omitempty"` + // ProcessServerCount - The number of process servers. + ProcessServerCount *string `json:"processServerCount,omitempty"` + // AgentCount - The number of source and target servers configured to talk to this CS. + AgentCount *string `json:"agentCount,omitempty"` + // ProtectedServers - The number of protected servers. + ProtectedServers *string `json:"protectedServers,omitempty"` + // SystemLoad - The percentage of the system load. + SystemLoad *string `json:"systemLoad,omitempty"` + // SystemLoadStatus - The system load status. + SystemLoadStatus *string `json:"systemLoadStatus,omitempty"` + // CPULoad - The percentage of the CPU load. + CPULoad *string `json:"cpuLoad,omitempty"` + // CPULoadStatus - The CPU load status. + CPULoadStatus *string `json:"cpuLoadStatus,omitempty"` + // TotalMemoryInBytes - The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // MemoryUsageStatus - The memory usage status. + MemoryUsageStatus *string `json:"memoryUsageStatus,omitempty"` + // TotalSpaceInBytes - The total space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - The available space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // SpaceUsageStatus - The space usage status. + SpaceUsageStatus *string `json:"spaceUsageStatus,omitempty"` + // WebLoad - The web load. + WebLoad *string `json:"webLoad,omitempty"` + // WebLoadStatus - The web load status. + WebLoadStatus *string `json:"webLoadStatus,omitempty"` + // DatabaseServerLoad - The database server load. + DatabaseServerLoad *string `json:"databaseServerLoad,omitempty"` + // DatabaseServerLoadStatus - The database server load status. + DatabaseServerLoadStatus *string `json:"databaseServerLoadStatus,omitempty"` + // CsServiceStatus - The CS service status. + CsServiceStatus *string `json:"csServiceStatus,omitempty"` + // IPAddress - The IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // AgentVersion - The agent Version. + AgentVersion *string `json:"agentVersion,omitempty"` + // HostName - The host name. + HostName *string `json:"hostName,omitempty"` + // LastHeartbeat - The last heartbeat received from CS server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // SslCertExpiryDate - CS SSL cert expiry date. + SslCertExpiryDate *date.Time `json:"sslCertExpiryDate,omitempty"` + // SslCertExpiryRemainingDays - CS SSL cert expiry date. + SslCertExpiryRemainingDays *int32 `json:"sslCertExpiryRemainingDays,omitempty"` + // PsTemplateVersion - PS template version. + PsTemplateVersion *string `json:"psTemplateVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // AgentVersionDetails - The agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareDetails. +func (vmd VMwareDetails) MarshalJSON() ([]byte, error) { + vmd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware + objectMap := make(map[string]interface{}) + if vmd.ProcessServers != nil { + objectMap["processServers"] = vmd.ProcessServers + } + if vmd.MasterTargetServers != nil { + objectMap["masterTargetServers"] = vmd.MasterTargetServers + } + if vmd.RunAsAccounts != nil { + objectMap["runAsAccounts"] = vmd.RunAsAccounts + } + if vmd.ReplicationPairCount != nil { + objectMap["replicationPairCount"] = vmd.ReplicationPairCount + } + if vmd.ProcessServerCount != nil { + objectMap["processServerCount"] = vmd.ProcessServerCount + } + if vmd.AgentCount != nil { + objectMap["agentCount"] = vmd.AgentCount + } + if vmd.ProtectedServers != nil { + objectMap["protectedServers"] = vmd.ProtectedServers + } + if vmd.SystemLoad != nil { + objectMap["systemLoad"] = vmd.SystemLoad + } + if vmd.SystemLoadStatus != nil { + objectMap["systemLoadStatus"] = vmd.SystemLoadStatus + } + if vmd.CPULoad != nil { + objectMap["cpuLoad"] = vmd.CPULoad + } + if vmd.CPULoadStatus != nil { + objectMap["cpuLoadStatus"] = vmd.CPULoadStatus + } + if vmd.TotalMemoryInBytes != nil { + objectMap["totalMemoryInBytes"] = vmd.TotalMemoryInBytes + } + if vmd.AvailableMemoryInBytes != nil { + objectMap["availableMemoryInBytes"] = vmd.AvailableMemoryInBytes + } + if vmd.MemoryUsageStatus != nil { + objectMap["memoryUsageStatus"] = vmd.MemoryUsageStatus + } + if vmd.TotalSpaceInBytes != nil { + objectMap["totalSpaceInBytes"] = vmd.TotalSpaceInBytes + } + if vmd.AvailableSpaceInBytes != nil { + objectMap["availableSpaceInBytes"] = vmd.AvailableSpaceInBytes + } + if vmd.SpaceUsageStatus != nil { + objectMap["spaceUsageStatus"] = vmd.SpaceUsageStatus + } + if vmd.WebLoad != nil { + objectMap["webLoad"] = vmd.WebLoad + } + if vmd.WebLoadStatus != nil { + objectMap["webLoadStatus"] = vmd.WebLoadStatus + } + if vmd.DatabaseServerLoad != nil { + objectMap["databaseServerLoad"] = vmd.DatabaseServerLoad + } + if vmd.DatabaseServerLoadStatus != nil { + objectMap["databaseServerLoadStatus"] = vmd.DatabaseServerLoadStatus + } + if vmd.CsServiceStatus != nil { + objectMap["csServiceStatus"] = vmd.CsServiceStatus + } + if vmd.IPAddress != nil { + objectMap["ipAddress"] = vmd.IPAddress + } + if vmd.AgentVersion != nil { + objectMap["agentVersion"] = vmd.AgentVersion + } + if vmd.HostName != nil { + objectMap["hostName"] = vmd.HostName + } + if vmd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = vmd.LastHeartbeat + } + if vmd.VersionStatus != nil { + objectMap["versionStatus"] = vmd.VersionStatus + } + if vmd.SslCertExpiryDate != nil { + objectMap["sslCertExpiryDate"] = vmd.SslCertExpiryDate + } + if vmd.SslCertExpiryRemainingDays != nil { + objectMap["sslCertExpiryRemainingDays"] = vmd.SslCertExpiryRemainingDays + } + if vmd.PsTemplateVersion != nil { + objectMap["psTemplateVersion"] = vmd.PsTemplateVersion + } + if vmd.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = vmd.AgentExpiryDate + } + if vmd.AgentVersionDetails != nil { + objectMap["agentVersionDetails"] = vmd.AgentVersionDetails + } + if vmd.InstanceType != "" { + objectMap["instanceType"] = vmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return &vmd, true +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vmd, true +} + +// VMwareV2FabricCreationInput vMwareV2 fabric provider specific settings. +type VMwareV2FabricCreationInput struct { + // VmwareSiteID - The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // MigrationSolutionID - The ARM Id of the migration solution. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreationInput', 'InstanceTypeAzure', 'InstanceTypeInMageRcm', 'InstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) MarshalJSON() ([]byte, error) { + vmvfci.InstanceType = InstanceTypeVMwareV2 + objectMap := make(map[string]interface{}) + if vmvfci.VmwareSiteID != nil { + objectMap["vmwareSiteId"] = vmvfci.VmwareSiteID + } + if vmvfci.PhysicalSiteID != nil { + objectMap["physicalSiteId"] = vmvfci.PhysicalSiteID + } + if vmvfci.MigrationSolutionID != nil { + objectMap["migrationSolutionId"] = vmvfci.MigrationSolutionID + } + if vmvfci.InstanceType != "" { + objectMap["instanceType"] = vmvfci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return &vmvfci, true +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &vmvfci, true +} + +// VMwareV2FabricSpecificDetails vMwareV2 fabric specific details. +type VMwareV2FabricSpecificDetails struct { + // VmwareSiteID - READ-ONLY; The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - READ-ONLY; The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // MigrationSolutionID - READ-ONLY; The Migration solution ARM Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // ServiceEndpoint - READ-ONLY; The service endpoint. + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` + // ServiceResourceID - READ-ONLY; The service resource Id. + ServiceResourceID *string `json:"serviceResourceId,omitempty"` + // ServiceContainerID - READ-ONLY; The service container Id. + ServiceContainerID *string `json:"serviceContainerId,omitempty"` + // ProcessServers - READ-ONLY; The list of process servers. + ProcessServers *[]ProcessServerDetails `json:"processServers,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) MarshalJSON() ([]byte, error) { + vmvfsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 + objectMap := make(map[string]interface{}) + if vmvfsd.InstanceType != "" { + objectMap["instanceType"] = vmvfsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return &vmvfsd, true +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vmvfsd, true +} + +// VMwareVirtualMachineDetails vMware provider specific settings. +type VMwareVirtualMachineDetails struct { + // AgentGeneratedID - The ID generated by the InMage agent after it gets installed on guest. This is the ID to be used during InMage CreateProtection. + AgentGeneratedID *string `json:"agentGeneratedId,omitempty"` + // AgentInstalled - The value indicating if InMage scout agent is installed on guest. + AgentInstalled *string `json:"agentInstalled,omitempty"` + // OsType - The OsType installed on VM. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // IPAddress - The IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // PoweredOn - The value indicating whether VM is powered on. + PoweredOn *string `json:"poweredOn,omitempty"` + // VCenterInfrastructureID - The VCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. Value can be vCenter or physical. + DiscoveryType *string `json:"discoveryType,omitempty"` + // DiskDetails - The disk details. + DiskDetails *[]InMageDiskDetails `json:"diskDetails,omitempty"` + // ValidationErrors - The validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) MarshalJSON() ([]byte, error) { + vmvmd.InstanceType = InstanceTypeVMwareVirtualMachine + objectMap := make(map[string]interface{}) + if vmvmd.AgentGeneratedID != nil { + objectMap["agentGeneratedId"] = vmvmd.AgentGeneratedID + } + if vmvmd.AgentInstalled != nil { + objectMap["agentInstalled"] = vmvmd.AgentInstalled + } + if vmvmd.OsType != nil { + objectMap["osType"] = vmvmd.OsType + } + if vmvmd.AgentVersion != nil { + objectMap["agentVersion"] = vmvmd.AgentVersion + } + if vmvmd.IPAddress != nil { + objectMap["ipAddress"] = vmvmd.IPAddress + } + if vmvmd.PoweredOn != nil { + objectMap["poweredOn"] = vmvmd.PoweredOn + } + if vmvmd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = vmvmd.VCenterInfrastructureID + } + if vmvmd.DiscoveryType != nil { + objectMap["discoveryType"] = vmvmd.DiscoveryType + } + if vmvmd.DiskDetails != nil { + objectMap["diskDetails"] = vmvmd.DiskDetails + } + if vmvmd.ValidationErrors != nil { + objectMap["validationErrors"] = vmvmd.ValidationErrors + } + if vmvmd.InstanceType != "" { + objectMap["instanceType"] = vmvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return &vmvmd, true +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &vmvmd, true +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/operations.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/operations.go new file mode 100644 index 000000000000..ac7a80ed7718 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/operations.go @@ -0,0 +1,145 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the client for the Operations methods of the Siterecovery service. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string, resourceGroupName string, resourceName string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// List operation to return the list of available operations. +func (client OperationsClient) List(ctx context.Context) (result OperationsDiscoveryCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.odc.Response.Response != nil { + sc = result.odc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.odc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.odc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", resp, "Failure responding to request") + return + } + if result.odc.hasNextLink() && result.odc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/operations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationsDiscoveryCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationsDiscoveryCollection) (result OperationsDiscoveryCollection, err error) { + req, err := lastResults.operationsDiscoveryCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationsDiscoveryCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/recoverypoints.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/recoverypoints.go new file mode 100644 index 000000000000..c4f28d4c88dd --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/recoverypoints.go @@ -0,0 +1,235 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RecoveryPointsClient is the client for the RecoveryPoints methods of the Siterecovery service. +type RecoveryPointsClient struct { + BaseClient +} + +// NewRecoveryPointsClient creates an instance of the RecoveryPointsClient client. +func NewRecoveryPointsClient(subscriptionID string, resourceGroupName string, resourceName string) RecoveryPointsClient { + return NewRecoveryPointsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewRecoveryPointsClientWithBaseURI creates an instance of the RecoveryPointsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewRecoveryPointsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) RecoveryPointsClient { + return RecoveryPointsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get get the details of specified recovery point. +// Parameters: +// fabricName - the fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replication protected item name. +// recoveryPointName - the recovery point name. +func (client RecoveryPointsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (result RecoveryPoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, recoveryPointName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client RecoveryPointsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "recoveryPointName": autorest.Encode("path", recoveryPointName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints/{recoveryPointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RecoveryPointsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RecoveryPointsClient) GetResponder(resp *http.Response) (result RecoveryPoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationProtectedItems lists the available recovery points for a replication protected item. +// Parameters: +// fabricName - the fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replication protected item name. +func (client RecoveryPointsClient) ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result RecoveryPointCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.RPCVar.Response.Response != nil { + sc = result.RPCVar.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectedItemsNextResults + req, err := client.ListByReplicationProtectedItemsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.RPCVar.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", resp, "Failure sending request") + return + } + + result.RPCVar, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", resp, "Failure responding to request") + return + } + if result.RPCVar.hasNextLink() && result.RPCVar.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectedItemsPreparer prepares the ListByReplicationProtectedItems request. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectedItemsSender sends the ListByReplicationProtectedItems request. The method will close the +// http.Response Body if it receives an error. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectedItemsResponder handles the response to the ListByReplicationProtectedItems request. The method always +// closes the http.Response Body. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsResponder(resp *http.Response) (result RecoveryPointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectedItemsNextResults retrieves the next set of results, if any. +func (client RecoveryPointsClient) listByReplicationProtectedItemsNextResults(ctx context.Context, lastResults RecoveryPointCollection) (result RecoveryPointCollection, err error) { + req, err := lastResults.recoveryPointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectedItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result RecoveryPointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectedItems(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationalertsettings.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationalertsettings.go new file mode 100644 index 000000000000..d156c87994a5 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationalertsettings.go @@ -0,0 +1,302 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationAlertSettingsClient is the client for the ReplicationAlertSettings methods of the Siterecovery service. +type ReplicationAlertSettingsClient struct { + BaseClient +} + +// NewReplicationAlertSettingsClient creates an instance of the ReplicationAlertSettingsClient client. +func NewReplicationAlertSettingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationAlertSettingsClient { + return NewReplicationAlertSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationAlertSettingsClientWithBaseURI creates an instance of the ReplicationAlertSettingsClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationAlertSettingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationAlertSettingsClient { + return ReplicationAlertSettingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create create or update an email notification(alert) configuration. +// Parameters: +// alertSettingName - the name of the email notification(alert) configuration. +// request - the input to configure the email notification(alert). +func (client ReplicationAlertSettingsClient) Create(ctx context.Context, alertSettingName string, request ConfigureAlertRequest) (result Alert, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, alertSettingName, request) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationAlertSettingsClient) CreatePreparer(ctx context.Context, alertSettingName string, request ConfigureAlertRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertSettingName": autorest.Encode("path", alertSettingName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) CreateResponder(resp *http.Response) (result Alert, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of the specified email notification(alert) configuration. +// Parameters: +// alertSettingName - the name of the email notification configuration. +func (client ReplicationAlertSettingsClient) Get(ctx context.Context, alertSettingName string) (result Alert, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, alertSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationAlertSettingsClient) GetPreparer(ctx context.Context, alertSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertSettingName": autorest.Encode("path", alertSettingName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) GetResponder(resp *http.Response) (result Alert, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of email notification(alert) configurations for the vault. +func (client ReplicationAlertSettingsClient) List(ctx context.Context) (result AlertCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.List") + defer func() { + sc := -1 + if result.ac.Response.Response != nil { + sc = result.ac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", resp, "Failure sending request") + return + } + + result.ac, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", resp, "Failure responding to request") + return + } + if result.ac.hasNextLink() && result.ac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationAlertSettingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) ListResponder(resp *http.Response) (result AlertCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationAlertSettingsClient) listNextResults(ctx context.Context, lastResults AlertCollection) (result AlertCollection, err error) { + req, err := lastResults.alertCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationAlertSettingsClient) ListComplete(ctx context.Context) (result AlertCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationeligibilityresults.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationeligibilityresults.go new file mode 100644 index 000000000000..32ab4c585a39 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationeligibilityresults.go @@ -0,0 +1,183 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationEligibilityResultsClient is the client for the ReplicationEligibilityResults methods of the Siterecovery +// service. +type ReplicationEligibilityResultsClient struct { + BaseClient +} + +// NewReplicationEligibilityResultsClient creates an instance of the ReplicationEligibilityResultsClient client. +func NewReplicationEligibilityResultsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationEligibilityResultsClient { + return NewReplicationEligibilityResultsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationEligibilityResultsClientWithBaseURI creates an instance of the ReplicationEligibilityResultsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationEligibilityResultsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationEligibilityResultsClient { + return ReplicationEligibilityResultsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get validates whether a given VM can be protected or not in which case returns list of errors. +// Parameters: +// virtualMachineName - virtual Machine name. +func (client ReplicationEligibilityResultsClient) Get(ctx context.Context, virtualMachineName string) (result ReplicationEligibilityResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEligibilityResultsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, virtualMachineName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationEligibilityResultsClient) GetPreparer(ctx context.Context, virtualMachineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineName": autorest.Encode("path", virtualMachineName), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEligibilityResultsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationEligibilityResultsClient) GetResponder(resp *http.Response) (result ReplicationEligibilityResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List validates whether a given VM can be protected or not in which case returns list of errors. +// Parameters: +// virtualMachineName - virtual Machine name. +func (client ReplicationEligibilityResultsClient) List(ctx context.Context, virtualMachineName string) (result ReplicationEligibilityResultsCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEligibilityResultsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, virtualMachineName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationEligibilityResultsClient) ListPreparer(ctx context.Context, virtualMachineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineName": autorest.Encode("path", virtualMachineName), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEligibilityResultsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationEligibilityResultsClient) ListResponder(resp *http.Response) (result ReplicationEligibilityResultsCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationevents.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationevents.go new file mode 100644 index 000000000000..d97313f488e3 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationevents.go @@ -0,0 +1,228 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationEventsClient is the client for the ReplicationEvents methods of the Siterecovery service. +type ReplicationEventsClient struct { + BaseClient +} + +// NewReplicationEventsClient creates an instance of the ReplicationEventsClient client. +func NewReplicationEventsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationEventsClient { + return NewReplicationEventsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationEventsClientWithBaseURI creates an instance of the ReplicationEventsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationEventsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationEventsClient { + return ReplicationEventsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get the operation to get the details of an Azure Site recovery event. +// Parameters: +// eventName - the name of the Azure Site Recovery event. +func (client ReplicationEventsClient) Get(ctx context.Context, eventName string) (result Event, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, eventName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationEventsClient) GetPreparer(ctx context.Context, eventName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "eventName": autorest.Encode("path", eventName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents/{eventName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEventsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationEventsClient) GetResponder(resp *http.Response) (result Event, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of Azure Site Recovery events for the vault. +// Parameters: +// filter - oData filter options. +func (client ReplicationEventsClient) List(ctx context.Context, filter string) (result EventCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.List") + defer func() { + sc := -1 + if result.ec.Response.Response != nil { + sc = result.ec.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ec.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", resp, "Failure sending request") + return + } + + result.ec, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", resp, "Failure responding to request") + return + } + if result.ec.hasNextLink() && result.ec.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationEventsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEventsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationEventsClient) ListResponder(resp *http.Response) (result EventCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationEventsClient) listNextResults(ctx context.Context, lastResults EventCollection) (result EventCollection, err error) { + req, err := lastResults.eventCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationEventsClient) ListComplete(ctx context.Context, filter string) (result EventCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationfabrics.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationfabrics.go new file mode 100644 index 000000000000..cb8dc13782e2 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationfabrics.go @@ -0,0 +1,786 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationFabricsClient is the client for the ReplicationFabrics methods of the Siterecovery service. +type ReplicationFabricsClient struct { + BaseClient +} + +// NewReplicationFabricsClient creates an instance of the ReplicationFabricsClient client. +func NewReplicationFabricsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationFabricsClient { + return NewReplicationFabricsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationFabricsClientWithBaseURI creates an instance of the ReplicationFabricsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationFabricsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationFabricsClient { + return ReplicationFabricsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// CheckConsistency the operation to perform a consistency check on the fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationFabricsClient) CheckConsistency(ctx context.Context, fabricName string) (result ReplicationFabricsCheckConsistencyFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.CheckConsistency") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CheckConsistencyPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "CheckConsistency", nil, "Failure preparing request") + return + } + + result, err = client.CheckConsistencySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "CheckConsistency", result.Response(), "Failure sending request") + return + } + + return +} + +// CheckConsistencyPreparer prepares the CheckConsistency request. +func (client ReplicationFabricsClient) CheckConsistencyPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/checkConsistency", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckConsistencySender sends the CheckConsistency request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) CheckConsistencySender(req *http.Request) (future ReplicationFabricsCheckConsistencyFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CheckConsistencyResponder handles the response to the CheckConsistency request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) CheckConsistencyResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Create the operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). +// Parameters: +// fabricName - name of the ASR fabric. +// input - fabric creation input. +func (client ReplicationFabricsClient) Create(ctx context.Context, fabricName string, input FabricCreationInput) (result ReplicationFabricsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationFabricsClient) CreatePreparer(ctx context.Context, fabricName string, input FabricCreationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) CreateSender(req *http.Request) (future ReplicationFabricsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) CreateResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete or remove an Azure Site Recovery fabric. +// Parameters: +// fabricName - ASR fabric to delete. +func (client ReplicationFabricsClient) Delete(ctx context.Context, fabricName string) (result ReplicationFabricsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationFabricsClient) DeletePreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) DeleteSender(req *http.Request) (future ReplicationFabricsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of an Azure Site Recovery fabric. +// Parameters: +// fabricName - fabric name. +// filter - oData filter options. +func (client ReplicationFabricsClient) Get(ctx context.Context, fabricName string, filter string) (result Fabric, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationFabricsClient) GetPreparer(ctx context.Context, fabricName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) GetResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of the Azure Site Recovery fabrics in the vault. +func (client ReplicationFabricsClient) List(ctx context.Context) (result FabricCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.List") + defer func() { + sc := -1 + if result.fc.Response.Response != nil { + sc = result.fc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.fc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", resp, "Failure sending request") + return + } + + result.fc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", resp, "Failure responding to request") + return + } + if result.fc.hasNextLink() && result.fc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationFabricsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) ListResponder(resp *http.Response) (result FabricCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationFabricsClient) listNextResults(ctx context.Context, lastResults FabricCollection) (result FabricCollection, err error) { + req, err := lastResults.fabricCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationFabricsClient) ListComplete(ctx context.Context) (result FabricCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// MigrateToAad the operation to migrate an Azure Site Recovery fabric to AAD. +// Parameters: +// fabricName - ASR fabric to migrate. +func (client ReplicationFabricsClient) MigrateToAad(ctx context.Context, fabricName string) (result ReplicationFabricsMigrateToAadFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.MigrateToAad") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.MigrateToAadPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "MigrateToAad", nil, "Failure preparing request") + return + } + + result, err = client.MigrateToAadSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "MigrateToAad", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateToAadPreparer prepares the MigrateToAad request. +func (client ReplicationFabricsClient) MigrateToAadPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/migratetoaad", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateToAadSender sends the MigrateToAad request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) MigrateToAadSender(req *http.Request) (future ReplicationFabricsMigrateToAadFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateToAadResponder handles the response to the MigrateToAad request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) MigrateToAadResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Purge the operation to purge(force delete) an Azure Site Recovery fabric. +// Parameters: +// fabricName - ASR fabric to purge. +func (client ReplicationFabricsClient) Purge(ctx context.Context, fabricName string) (result ReplicationFabricsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationFabricsClient) PurgePreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) PurgeSender(req *http.Request) (future ReplicationFabricsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// ReassociateGateway the operation to move replications from a process server to another process server. +// Parameters: +// fabricName - the name of the fabric containing the process server. +// failoverProcessServerRequest - the input to the failover process server operation. +func (client ReplicationFabricsClient) ReassociateGateway(ctx context.Context, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest) (result ReplicationFabricsReassociateGatewayFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.ReassociateGateway") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReassociateGatewayPreparer(ctx, fabricName, failoverProcessServerRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "ReassociateGateway", nil, "Failure preparing request") + return + } + + result, err = client.ReassociateGatewaySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "ReassociateGateway", result.Response(), "Failure sending request") + return + } + + return +} + +// ReassociateGatewayPreparer prepares the ReassociateGateway request. +func (client ReplicationFabricsClient) ReassociateGatewayPreparer(ctx context.Context, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/reassociateGateway", pathParameters), + autorest.WithJSON(failoverProcessServerRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReassociateGatewaySender sends the ReassociateGateway request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) ReassociateGatewaySender(req *http.Request) (future ReplicationFabricsReassociateGatewayFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReassociateGatewayResponder handles the response to the ReassociateGateway request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) ReassociateGatewayResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RenewCertificate renews the connection certificate for the ASR replication fabric. +// Parameters: +// fabricName - fabric name to renew certs for. +// renewCertificate - renew certificate input. +func (client ReplicationFabricsClient) RenewCertificate(ctx context.Context, fabricName string, renewCertificate RenewCertificateInput) (result ReplicationFabricsRenewCertificateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.RenewCertificate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RenewCertificatePreparer(ctx, fabricName, renewCertificate) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "RenewCertificate", nil, "Failure preparing request") + return + } + + result, err = client.RenewCertificateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "RenewCertificate", result.Response(), "Failure sending request") + return + } + + return +} + +// RenewCertificatePreparer prepares the RenewCertificate request. +func (client ReplicationFabricsClient) RenewCertificatePreparer(ctx context.Context, fabricName string, renewCertificate RenewCertificateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/renewCertificate", pathParameters), + autorest.WithJSON(renewCertificate), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RenewCertificateSender sends the RenewCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) RenewCertificateSender(req *http.Request) (future ReplicationFabricsRenewCertificateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RenewCertificateResponder handles the response to the RenewCertificate request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) RenewCertificateResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationjobs.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationjobs.go new file mode 100644 index 000000000000..0df1ae57c095 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationjobs.go @@ -0,0 +1,547 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationJobsClient is the client for the ReplicationJobs methods of the Siterecovery service. +type ReplicationJobsClient struct { + BaseClient +} + +// NewReplicationJobsClient creates an instance of the ReplicationJobsClient client. +func NewReplicationJobsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationJobsClient { + return NewReplicationJobsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationJobsClientWithBaseURI creates an instance of the ReplicationJobsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationJobsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationJobsClient { + return ReplicationJobsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Cancel the operation to cancel an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Cancel(ctx context.Context, jobName string) (result ReplicationJobsCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Cancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CancelPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Cancel", nil, "Failure preparing request") + return + } + + result, err = client.CancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Cancel", result.Response(), "Failure sending request") + return + } + + return +} + +// CancelPreparer prepares the Cancel request. +func (client ReplicationJobsClient) CancelPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/cancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CancelSender sends the Cancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) CancelSender(req *http.Request) (future ReplicationJobsCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CancelResponder handles the response to the Cancel request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) CancelResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Export the operation to export the details of the Azure Site Recovery jobs of the vault. +// Parameters: +// jobQueryParameter - job query filter. +func (client ReplicationJobsClient) Export(ctx context.Context, jobQueryParameter JobQueryParameter) (result ReplicationJobsExportFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Export") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ExportPreparer(ctx, jobQueryParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Export", nil, "Failure preparing request") + return + } + + result, err = client.ExportSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Export", result.Response(), "Failure sending request") + return + } + + return +} + +// ExportPreparer prepares the Export request. +func (client ReplicationJobsClient) ExportPreparer(ctx context.Context, jobQueryParameter JobQueryParameter) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/export", pathParameters), + autorest.WithJSON(jobQueryParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExportSender sends the Export request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ExportSender(req *http.Request) (future ReplicationJobsExportFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ExportResponder handles the response to the Export request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ExportResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get the details of an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Get(ctx context.Context, jobName string) (result Job, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationJobsClient) GetPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) GetResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of Azure Site Recovery Jobs for the vault. +// Parameters: +// filter - oData filter options. +func (client ReplicationJobsClient) List(ctx context.Context, filter string) (result JobCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.List") + defer func() { + sc := -1 + if result.jc.Response.Response != nil { + sc = result.jc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.jc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", resp, "Failure sending request") + return + } + + result.jc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", resp, "Failure responding to request") + return + } + if result.jc.hasNextLink() && result.jc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationJobsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ListResponder(resp *http.Response) (result JobCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationJobsClient) listNextResults(ctx context.Context, lastResults JobCollection) (result JobCollection, err error) { + req, err := lastResults.jobCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationJobsClient) ListComplete(ctx context.Context, filter string) (result JobCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} + +// Restart the operation to restart an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Restart(ctx context.Context, jobName string) (result ReplicationJobsRestartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Restart") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RestartPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Restart", nil, "Failure preparing request") + return + } + + result, err = client.RestartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Restart", result.Response(), "Failure sending request") + return + } + + return +} + +// RestartPreparer prepares the Restart request. +func (client ReplicationJobsClient) RestartPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartSender sends the Restart request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) RestartSender(req *http.Request) (future ReplicationJobsRestartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestartResponder handles the response to the Restart request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) RestartResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Resume the operation to resume an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +// resumeJobParams - resume rob comments. +func (client ReplicationJobsClient) Resume(ctx context.Context, jobName string, resumeJobParams ResumeJobParams) (result ReplicationJobsResumeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Resume") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResumePreparer(ctx, jobName, resumeJobParams) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Resume", nil, "Failure preparing request") + return + } + + result, err = client.ResumeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Resume", result.Response(), "Failure sending request") + return + } + + return +} + +// ResumePreparer prepares the Resume request. +func (client ReplicationJobsClient) ResumePreparer(ctx context.Context, jobName string, resumeJobParams ResumeJobParams) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/resume", pathParameters), + autorest.WithJSON(resumeJobParams), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResumeSender sends the Resume request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ResumeSender(req *http.Request) (future ReplicationJobsResumeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResumeResponder handles the response to the Resume request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ResumeResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationlogicalnetworks.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationlogicalnetworks.go new file mode 100644 index 000000000000..a2498b03e50a --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationlogicalnetworks.go @@ -0,0 +1,229 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationLogicalNetworksClient is the client for the ReplicationLogicalNetworks methods of the Siterecovery +// service. +type ReplicationLogicalNetworksClient struct { + BaseClient +} + +// NewReplicationLogicalNetworksClient creates an instance of the ReplicationLogicalNetworksClient client. +func NewReplicationLogicalNetworksClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationLogicalNetworksClient { + return NewReplicationLogicalNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationLogicalNetworksClientWithBaseURI creates an instance of the ReplicationLogicalNetworksClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationLogicalNetworksClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationLogicalNetworksClient { + return ReplicationLogicalNetworksClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of a logical network. +// Parameters: +// fabricName - server Id. +// logicalNetworkName - logical network name. +func (client ReplicationLogicalNetworksClient) Get(ctx context.Context, fabricName string, logicalNetworkName string) (result LogicalNetwork, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, logicalNetworkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationLogicalNetworksClient) GetPreparer(ctx context.Context, fabricName string, logicalNetworkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "logicalNetworkName": autorest.Encode("path", logicalNetworkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks/{logicalNetworkName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationLogicalNetworksClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationLogicalNetworksClient) GetResponder(resp *http.Response) (result LogicalNetwork, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationFabrics lists all the logical networks of the Azure Site Recovery fabric. +// Parameters: +// fabricName - server Id. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result LogicalNetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.lnc.Response.Response != nil { + sc = result.lnc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.lnc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.lnc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.lnc.hasNextLink() && result.lnc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsResponder(resp *http.Response) (result LogicalNetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationLogicalNetworksClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults LogicalNetworkCollection) (result LogicalNetworkCollection, err error) { + req, err := lastResults.logicalNetworkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result LogicalNetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationmigrationitems.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationmigrationitems.go new file mode 100644 index 000000000000..b5cea70ac37d --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationmigrationitems.go @@ -0,0 +1,1009 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationMigrationItemsClient is the client for the ReplicationMigrationItems methods of the Siterecovery service. +type ReplicationMigrationItemsClient struct { + BaseClient +} + +// NewReplicationMigrationItemsClient creates an instance of the ReplicationMigrationItemsClient client. +func NewReplicationMigrationItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationMigrationItemsClient { + return NewReplicationMigrationItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationMigrationItemsClientWithBaseURI creates an instance of the ReplicationMigrationItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationMigrationItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationMigrationItemsClient { + return ReplicationMigrationItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR migration item (enable migration). +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - enable migration input. +func (client ReplicationMigrationItemsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input EnableMigrationInput) (result ReplicationMigrationItemsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.PolicyID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationMigrationItemsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input EnableMigrationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) CreateSender(req *http.Request) (future ReplicationMigrationItemsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) CreateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// deleteOption - the delete option. +func (client ReplicationMigrationItemsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (result ReplicationMigrationItemsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, migrationItemName, deleteOption) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationMigrationItemsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(deleteOption) > 0 { + queryParameters["deleteOption"] = autorest.Encode("query", deleteOption) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) DeleteSender(req *http.Request) (future ReplicationMigrationItemsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get sends the get request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +func (client ReplicationMigrationItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, migrationItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationMigrationItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) GetResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List sends the list request. +// Parameters: +// skipToken - the pagination token. +// takeToken - the page size. +// filter - oData filter options. +func (client ReplicationMigrationItemsClient) List(ctx context.Context, skipToken string, takeToken string, filter string) (result MigrationItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.List") + defer func() { + sc := -1 + if result.mic.Response.Response != nil { + sc = result.mic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, takeToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.mic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", resp, "Failure sending request") + return + } + + result.mic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", resp, "Failure responding to request") + return + } + if result.mic.hasNextLink() && result.mic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationMigrationItemsClient) ListPreparer(ctx context.Context, skipToken string, takeToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationMigrationItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ListResponder(resp *http.Response) (result MigrationItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationMigrationItemsClient) listNextResults(ctx context.Context, lastResults MigrationItemCollection) (result MigrationItemCollection, err error) { + req, err := lastResults.migrationItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationMigrationItemsClient) ListComplete(ctx context.Context, skipToken string, takeToken string, filter string) (result MigrationItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, takeToken, filter) + return +} + +// ListByReplicationProtectionContainers gets the list of ASR migration items in the protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// skipToken - the pagination token. +// takeToken - the page size. +// filter - oData filter options. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result MigrationItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.mic.Response.Response != nil { + sc = result.mic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName, skipToken, takeToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.mic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.mic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.mic.hasNextLink() && result.mic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result MigrationItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationMigrationItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults MigrationItemCollection) (result MigrationItemCollection, err error) { + req, err := lastResults.migrationItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result MigrationItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName, skipToken, takeToken, filter) + return +} + +// Migrate the operation to initiate migration of the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// migrateInput - migrate input. +func (client ReplicationMigrationItemsClient) Migrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput MigrateInput) (result ReplicationMigrationItemsMigrateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Migrate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: migrateInput, + Constraints: []validation.Constraint{{Target: "migrateInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Migrate", err.Error()) + } + + req, err := client.MigratePreparer(ctx, fabricName, protectionContainerName, migrationItemName, migrateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Migrate", nil, "Failure preparing request") + return + } + + result, err = client.MigrateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Migrate", result.Response(), "Failure sending request") + return + } + + return +} + +// MigratePreparer prepares the Migrate request. +func (client ReplicationMigrationItemsClient) MigratePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput MigrateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrate", pathParameters), + autorest.WithJSON(migrateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateSender sends the Migrate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) MigrateSender(req *http.Request) (future ReplicationMigrationItemsMigrateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateResponder handles the response to the Migrate request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) MigrateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Resync the operation to resynchronize replication of an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - resync input. +func (client ReplicationMigrationItemsClient) Resync(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input ResyncInput) (result ReplicationMigrationItemsResyncFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Resync") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Resync", err.Error()) + } + + req, err := client.ResyncPreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Resync", nil, "Failure preparing request") + return + } + + result, err = client.ResyncSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Resync", result.Response(), "Failure sending request") + return + } + + return +} + +// ResyncPreparer prepares the Resync request. +func (client ReplicationMigrationItemsClient) ResyncPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input ResyncInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/resync", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResyncSender sends the Resync request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ResyncSender(req *http.Request) (future ReplicationMigrationItemsResyncFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResyncResponder handles the response to the Resync request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ResyncResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestMigrate the operation to initiate test migration of the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// testMigrateInput - test migrate input. +func (client ReplicationMigrationItemsClient) TestMigrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput TestMigrateInput) (result ReplicationMigrationItemsTestMigrateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.TestMigrate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testMigrateInput, + Constraints: []validation.Constraint{{Target: "testMigrateInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "TestMigrate", err.Error()) + } + + req, err := client.TestMigratePreparer(ctx, fabricName, protectionContainerName, migrationItemName, testMigrateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrate", nil, "Failure preparing request") + return + } + + result, err = client.TestMigrateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrate", result.Response(), "Failure sending request") + return + } + + return +} + +// TestMigratePreparer prepares the TestMigrate request. +func (client ReplicationMigrationItemsClient) TestMigratePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput TestMigrateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrate", pathParameters), + autorest.WithJSON(testMigrateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestMigrateSender sends the TestMigrate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) TestMigrateSender(req *http.Request) (future ReplicationMigrationItemsTestMigrateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestMigrateResponder handles the response to the TestMigrate request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) TestMigrateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestMigrateCleanup the operation to initiate test migrate cleanup. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// testMigrateCleanupInput - test migrate cleanup input. +func (client ReplicationMigrationItemsClient) TestMigrateCleanup(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput TestMigrateCleanupInput) (result ReplicationMigrationItemsTestMigrateCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.TestMigrateCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testMigrateCleanupInput, + Constraints: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", err.Error()) + } + + req, err := client.TestMigrateCleanupPreparer(ctx, fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestMigrateCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestMigrateCleanupPreparer prepares the TestMigrateCleanup request. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput TestMigrateCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrateCleanup", pathParameters), + autorest.WithJSON(testMigrateCleanupInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestMigrateCleanupSender sends the TestMigrateCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupSender(req *http.Request) (future ReplicationMigrationItemsTestMigrateCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestMigrateCleanupResponder handles the response to the TestMigrateCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update the recovery settings of an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - update migration item input. +func (client ReplicationMigrationItemsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input UpdateMigrationItemInput) (result ReplicationMigrationItemsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationMigrationItemsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input UpdateMigrationItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) UpdateSender(req *http.Request) (future ReplicationMigrationItemsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) UpdateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationnetworkmappings.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationnetworkmappings.go new file mode 100644 index 000000000000..df77fb4627c0 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationnetworkmappings.go @@ -0,0 +1,610 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationNetworkMappingsClient is the client for the ReplicationNetworkMappings methods of the Siterecovery +// service. +type ReplicationNetworkMappingsClient struct { + BaseClient +} + +// NewReplicationNetworkMappingsClient creates an instance of the ReplicationNetworkMappingsClient client. +func NewReplicationNetworkMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworkMappingsClient { + return NewReplicationNetworkMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationNetworkMappingsClientWithBaseURI creates an instance of the ReplicationNetworkMappingsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationNetworkMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworkMappingsClient { + return ReplicationNetworkMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +// input - create network mapping input. +func (client ReplicationNetworkMappingsClient) Create(ctx context.Context, fabricName string, networkName string, networkMappingName string, input CreateNetworkMappingInput) (result ReplicationNetworkMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.RecoveryNetworkID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationNetworkMappingsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, networkName, networkMappingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationNetworkMappingsClient) CreatePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string, input CreateNetworkMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) CreateSender(req *http.Request) (future ReplicationNetworkMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) CreateResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - ARM Resource Name for network mapping. +func (client ReplicationNetworkMappingsClient) Delete(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result ReplicationNetworkMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, networkName, networkMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationNetworkMappingsClient) DeletePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) DeleteSender(req *http.Request) (future ReplicationNetworkMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +func (client ReplicationNetworkMappingsClient) Get(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result NetworkMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, networkName, networkMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationNetworkMappingsClient) GetPreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) GetResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all ASR network mappings in the vault. +func (client ReplicationNetworkMappingsClient) List(ctx context.Context) (result NetworkMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.List") + defer func() { + sc := -1 + if result.nmc.Response.Response != nil { + sc = result.nmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.nmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", resp, "Failure sending request") + return + } + + result.nmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.nmc.hasNextLink() && result.nmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationNetworkMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationNetworkMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) ListResponder(resp *http.Response) (result NetworkMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationNetworkMappingsClient) listNextResults(ctx context.Context, lastResults NetworkMappingCollection) (result NetworkMappingCollection, err error) { + req, err := lastResults.networkMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworkMappingsClient) ListComplete(ctx context.Context) (result NetworkMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationNetworks lists all ASR network mappings for the specified network. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworks(ctx context.Context, fabricName string, networkName string) (result NetworkMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.ListByReplicationNetworks") + defer func() { + sc := -1 + if result.nmc.Response.Response != nil { + sc = result.nmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationNetworksNextResults + req, err := client.ListByReplicationNetworksPreparer(ctx, fabricName, networkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationNetworksSender(req) + if err != nil { + result.nmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", resp, "Failure sending request") + return + } + + result.nmc, err = client.ListByReplicationNetworksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", resp, "Failure responding to request") + return + } + if result.nmc.hasNextLink() && result.nmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationNetworksPreparer prepares the ListByReplicationNetworks request. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksPreparer(ctx context.Context, fabricName string, networkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationNetworksSender sends the ListByReplicationNetworks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationNetworksResponder handles the response to the ListByReplicationNetworks request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksResponder(resp *http.Response) (result NetworkMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationNetworksNextResults retrieves the next set of results, if any. +func (client ReplicationNetworkMappingsClient) listByReplicationNetworksNextResults(ctx context.Context, lastResults NetworkMappingCollection) (result NetworkMappingCollection, err error) { + req, err := lastResults.networkMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationNetworksSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationNetworksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationNetworksComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksComplete(ctx context.Context, fabricName string, networkName string) (result NetworkMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.ListByReplicationNetworks") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationNetworks(ctx, fabricName, networkName) + return +} + +// Update the operation to update an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +// input - update network mapping input. +func (client ReplicationNetworkMappingsClient) Update(ctx context.Context, fabricName string, networkName string, networkMappingName string, input UpdateNetworkMappingInput) (result ReplicationNetworkMappingsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, networkName, networkMappingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationNetworkMappingsClient) UpdatePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string, input UpdateNetworkMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) UpdateSender(req *http.Request) (future ReplicationNetworkMappingsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) UpdateResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationnetworks.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationnetworks.go new file mode 100644 index 000000000000..287935bff42e --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationnetworks.go @@ -0,0 +1,343 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationNetworksClient is the client for the ReplicationNetworks methods of the Siterecovery service. +type ReplicationNetworksClient struct { + BaseClient +} + +// NewReplicationNetworksClient creates an instance of the ReplicationNetworksClient client. +func NewReplicationNetworksClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworksClient { + return NewReplicationNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationNetworksClientWithBaseURI creates an instance of the ReplicationNetworksClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationNetworksClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworksClient { + return ReplicationNetworksClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of a network. +// Parameters: +// fabricName - server Id. +// networkName - primary network name. +func (client ReplicationNetworksClient) Get(ctx context.Context, fabricName string, networkName string) (result Network, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, networkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationNetworksClient) GetPreparer(ctx context.Context, fabricName string, networkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) GetResponder(resp *http.Response) (result Network, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the networks available in a vault. +func (client ReplicationNetworksClient) List(ctx context.Context) (result NetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.List") + defer func() { + sc := -1 + if result.nc.Response.Response != nil { + sc = result.nc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.nc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", resp, "Failure sending request") + return + } + + result.nc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", resp, "Failure responding to request") + return + } + if result.nc.hasNextLink() && result.nc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationNetworksClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) ListResponder(resp *http.Response) (result NetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationNetworksClient) listNextResults(ctx context.Context, lastResults NetworkCollection) (result NetworkCollection, err error) { + req, err := lastResults.networkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworksClient) ListComplete(ctx context.Context) (result NetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the networks available for a fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationNetworksClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result NetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.nc.Response.Response != nil { + sc = result.nc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.nc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.nc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.nc.hasNextLink() && result.nc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationNetworksClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) ListByReplicationFabricsResponder(resp *http.Response) (result NetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationNetworksClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults NetworkCollection) (result NetworkCollection, err error) { + req, err := lastResults.networkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworksClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result NetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationpolicies.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationpolicies.go new file mode 100644 index 000000000000..c95505a5d759 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationpolicies.go @@ -0,0 +1,465 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationPoliciesClient is the client for the ReplicationPolicies methods of the Siterecovery service. +type ReplicationPoliciesClient struct { + BaseClient +} + +// NewReplicationPoliciesClient creates an instance of the ReplicationPoliciesClient client. +func NewReplicationPoliciesClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationPoliciesClient { + return NewReplicationPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationPoliciesClientWithBaseURI creates an instance of the ReplicationPoliciesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationPoliciesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationPoliciesClient { + return ReplicationPoliciesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a replication policy. +// Parameters: +// policyName - replication policy name. +// input - create policy input. +func (client ReplicationPoliciesClient) Create(ctx context.Context, policyName string, input CreatePolicyInput) (result ReplicationPoliciesCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, policyName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationPoliciesClient) CreatePreparer(ctx context.Context, policyName string, input CreatePolicyInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) CreateSender(req *http.Request) (future ReplicationPoliciesCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) CreateResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a replication policy. +// Parameters: +// policyName - replication policy name. +func (client ReplicationPoliciesClient) Delete(ctx context.Context, policyName string) (result ReplicationPoliciesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationPoliciesClient) DeletePreparer(ctx context.Context, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) DeleteSender(req *http.Request) (future ReplicationPoliciesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a replication policy. +// Parameters: +// policyName - replication policy name. +func (client ReplicationPoliciesClient) Get(ctx context.Context, policyName string) (result Policy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationPoliciesClient) GetPreparer(ctx context.Context, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) GetResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the replication policies for a vault. +func (client ReplicationPoliciesClient) List(ctx context.Context) (result PolicyCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.List") + defer func() { + sc := -1 + if result.pc.Response.Response != nil { + sc = result.pc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", resp, "Failure sending request") + return + } + + result.pc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", resp, "Failure responding to request") + return + } + if result.pc.hasNextLink() && result.pc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationPoliciesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) ListResponder(resp *http.Response) (result PolicyCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationPoliciesClient) listNextResults(ctx context.Context, lastResults PolicyCollection) (result PolicyCollection, err error) { + req, err := lastResults.policyCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationPoliciesClient) ListComplete(ctx context.Context) (result PolicyCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// Update the operation to update a replication policy. +// Parameters: +// policyName - policy Id. +// input - update Policy Input. +func (client ReplicationPoliciesClient) Update(ctx context.Context, policyName string, input UpdatePolicyInput) (result ReplicationPoliciesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, policyName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationPoliciesClient) UpdatePreparer(ctx context.Context, policyName string, input UpdatePolicyInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) UpdateSender(req *http.Request) (future ReplicationPoliciesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) UpdateResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationprotectableitems.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationprotectableitems.go new file mode 100644 index 000000000000..e696d4978879 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationprotectableitems.go @@ -0,0 +1,245 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectableItemsClient is the client for the ReplicationProtectableItems methods of the Siterecovery +// service. +type ReplicationProtectableItemsClient struct { + BaseClient +} + +// NewReplicationProtectableItemsClient creates an instance of the ReplicationProtectableItemsClient client. +func NewReplicationProtectableItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectableItemsClient { + return NewReplicationProtectableItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectableItemsClientWithBaseURI creates an instance of the ReplicationProtectableItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationProtectableItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectableItemsClient { + return ReplicationProtectableItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get the operation to get the details of a protectable item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// protectableItemName - protectable item name. +func (client ReplicationProtectableItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (result ProtectableItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, protectableItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectableItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectableItemName": autorest.Encode("path", protectableItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems/{protectableItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectableItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectableItemsClient) GetResponder(resp *http.Response) (result ProtectableItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationProtectionContainers lists the protectable items in a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// filter - oData filter options. +// take - take OData query parameter. +// skipToken - skipToken OData query parameter. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result ProtectableItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.pic.Response.Response != nil { + sc = result.pic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName, filter, take, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.pic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.pic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.pic.hasNextLink() && result.pic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(take) > 0 { + queryParameters["$take"] = autorest.Encode("query", take) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ProtectableItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectableItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ProtectableItemCollection) (result ProtectableItemCollection, err error) { + req, err := lastResults.protectableItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result ProtectableItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName, filter, take, skipToken) + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationprotecteditems.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationprotecteditems.go new file mode 100644 index 000000000000..ccbae06dfbe3 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationprotecteditems.go @@ -0,0 +1,1935 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectedItemsClient is the client for the ReplicationProtectedItems methods of the Siterecovery service. +type ReplicationProtectedItemsClient struct { + BaseClient +} + +// NewReplicationProtectedItemsClient creates an instance of the ReplicationProtectedItemsClient client. +func NewReplicationProtectedItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectedItemsClient { + return NewReplicationProtectedItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectedItemsClientWithBaseURI creates an instance of the ReplicationProtectedItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationProtectedItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectedItemsClient { + return ReplicationProtectedItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// AddDisks operation to add disks(s) to the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// addDisksInput - add disks input. +func (client ReplicationProtectedItemsClient) AddDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput AddDisksInput) (result ReplicationProtectedItemsAddDisksFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.AddDisks") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddDisksPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, addDisksInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "AddDisks", nil, "Failure preparing request") + return + } + + result, err = client.AddDisksSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "AddDisks", result.Response(), "Failure sending request") + return + } + + return +} + +// AddDisksPreparer prepares the AddDisks request. +func (client ReplicationProtectedItemsClient) AddDisksPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput AddDisksInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/addDisks", pathParameters), + autorest.WithJSON(addDisksInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddDisksSender sends the AddDisks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) AddDisksSender(req *http.Request) (future ReplicationProtectedItemsAddDisksFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// AddDisksResponder handles the response to the AddDisks request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) AddDisksResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ApplyRecoveryPoint the operation to change the recovery point of a failed over replication protected item. +// Parameters: +// fabricName - the ARM fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replicated protected item name. +// applyRecoveryPointInput - the ApplyRecoveryPointInput. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPoint(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput ApplyRecoveryPointInput) (result ReplicationProtectedItemsApplyRecoveryPointFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ApplyRecoveryPoint") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: applyRecoveryPointInput, + Constraints: []validation.Constraint{{Target: "applyRecoveryPointInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", err.Error()) + } + + req, err := client.ApplyRecoveryPointPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, applyRecoveryPointInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", nil, "Failure preparing request") + return + } + + result, err = client.ApplyRecoveryPointSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", result.Response(), "Failure sending request") + return + } + + return +} + +// ApplyRecoveryPointPreparer prepares the ApplyRecoveryPoint request. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput ApplyRecoveryPointInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/applyRecoveryPoint", pathParameters), + autorest.WithJSON(applyRecoveryPointInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ApplyRecoveryPointSender sends the ApplyRecoveryPoint request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointSender(req *http.Request) (future ReplicationProtectedItemsApplyRecoveryPointFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ApplyRecoveryPointResponder handles the response to the ApplyRecoveryPoint request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Create the operation to create an ASR replication protected item (Enable replication). +// Parameters: +// fabricName - name of the fabric. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - a name for the replication protected item. +// input - enable Protection Input. +func (client ReplicationProtectedItemsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input EnableProtectionInput) (result ReplicationProtectedItemsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectedItemsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input EnableProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) CreateSender(req *http.Request) (future ReplicationProtectedItemsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) CreateResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to disable replication on a replication protected item. This will also remove the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// disableProtectionInput - disable protection input. +func (client ReplicationProtectedItemsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput DisableProtectionInput) (result ReplicationProtectedItemsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: disableProtectionInput, + Constraints: []validation.Constraint{{Target: "disableProtectionInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, disableProtectionInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectedItemsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput DisableProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/remove", pathParameters), + autorest.WithJSON(disableProtectionInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) DeleteSender(req *http.Request) (future ReplicationProtectedItemsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// FailoverCancel operation to cancel the failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) FailoverCancel(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsFailoverCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.FailoverCancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCancelPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCancel", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCancel", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCancelPreparer prepares the FailoverCancel request. +func (client ReplicationProtectedItemsClient) FailoverCancelPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCancelSender sends the FailoverCancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) FailoverCancelSender(req *http.Request) (future ReplicationProtectedItemsFailoverCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCancelResponder handles the response to the FailoverCancel request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) FailoverCancelResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// FailoverCommit operation to commit the failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) FailoverCommit(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsFailoverCommitFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.FailoverCommit") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCommitPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCommit", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCommitSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCommit", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCommitPreparer prepares the FailoverCommit request. +func (client ReplicationProtectedItemsClient) FailoverCommitPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCommit", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCommitSender sends the FailoverCommit request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) FailoverCommitSender(req *http.Request) (future ReplicationProtectedItemsFailoverCommitFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCommitResponder handles the response to the FailoverCommit request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) FailoverCommitResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of an ASR replication protected item. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectedItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) GetResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of ASR replication protected items in the vault. +// Parameters: +// skipToken - the pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. +// filter - oData filter options. +func (client ReplicationProtectedItemsClient) List(ctx context.Context, skipToken string, filter string) (result ReplicationProtectedItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.List") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectedItemsClient) ListPreparer(ctx context.Context, skipToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectedItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ListResponder(resp *http.Response) (result ReplicationProtectedItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectedItemsClient) listNextResults(ctx context.Context, lastResults ReplicationProtectedItemCollection) (result ReplicationProtectedItemCollection, err error) { + req, err := lastResults.replicationProtectedItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectedItemsClient) ListComplete(ctx context.Context, skipToken string, filter string) (result ReplicationProtectedItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, filter) + return +} + +// ListByReplicationProtectionContainers gets the list of ASR replication protected items in the protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectedItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ReplicationProtectedItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectedItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ReplicationProtectedItemCollection) (result ReplicationProtectedItemCollection, err error) { + req, err := lastResults.replicationProtectedItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectedItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName) + return +} + +// PlannedFailover operation to initiate a planned failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// failoverInput - planned failover input. +func (client ReplicationProtectedItemsClient) PlannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput PlannedFailoverInput) (result ReplicationProtectedItemsPlannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.PlannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PlannedFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "PlannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.PlannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "PlannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// PlannedFailoverPreparer prepares the PlannedFailover request. +func (client ReplicationProtectedItemsClient) PlannedFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput PlannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/plannedFailover", pathParameters), + autorest.WithJSON(failoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PlannedFailoverSender sends the PlannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) PlannedFailoverSender(req *http.Request) (future ReplicationProtectedItemsPlannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PlannedFailoverResponder handles the response to the PlannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) PlannedFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Purge the operation to delete or purge a replication protected item. This operation will force delete the +// replication protected item. Use the remove operation on replication protected item to perform a clean disable +// replication for the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) Purge(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationProtectedItemsClient) PurgePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) PurgeSender(req *http.Request) (future ReplicationProtectedItemsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RemoveDisks operation to remove disk(s) from the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// removeDisksInput - remove disks input. +func (client ReplicationProtectedItemsClient) RemoveDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput RemoveDisksInput) (result ReplicationProtectedItemsRemoveDisksFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.RemoveDisks") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RemoveDisksPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, removeDisksInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RemoveDisks", nil, "Failure preparing request") + return + } + + result, err = client.RemoveDisksSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RemoveDisks", result.Response(), "Failure sending request") + return + } + + return +} + +// RemoveDisksPreparer prepares the RemoveDisks request. +func (client ReplicationProtectedItemsClient) RemoveDisksPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput RemoveDisksInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/removeDisks", pathParameters), + autorest.WithJSON(removeDisksInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RemoveDisksSender sends the RemoveDisks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) RemoveDisksSender(req *http.Request) (future ReplicationProtectedItemsRemoveDisksFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RemoveDisksResponder handles the response to the RemoveDisks request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) RemoveDisksResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RepairReplication the operation to start resynchronize/repair replication for a replication protected item requiring +// resynchronization. +// Parameters: +// fabricName - the name of the fabric. +// protectionContainerName - the name of the container. +// replicatedProtectedItemName - the name of the replication protected item. +func (client ReplicationProtectedItemsClient) RepairReplication(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsRepairReplicationFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.RepairReplication") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RepairReplicationPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RepairReplication", nil, "Failure preparing request") + return + } + + result, err = client.RepairReplicationSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RepairReplication", result.Response(), "Failure sending request") + return + } + + return +} + +// RepairReplicationPreparer prepares the RepairReplication request. +func (client ReplicationProtectedItemsClient) RepairReplicationPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/repairReplication", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RepairReplicationSender sends the RepairReplication request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) RepairReplicationSender(req *http.Request) (future ReplicationProtectedItemsRepairReplicationFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RepairReplicationResponder handles the response to the RepairReplication request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) RepairReplicationResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Reprotect operation to reprotect or reverse replicate a failed over replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// reprotectInput - reverse replication input. +func (client ReplicationProtectedItemsClient) Reprotect(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput ReverseReplicationInput) (result ReplicationProtectedItemsReprotectFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Reprotect") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReprotectPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, reprotectInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Reprotect", nil, "Failure preparing request") + return + } + + result, err = client.ReprotectSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Reprotect", result.Response(), "Failure sending request") + return + } + + return +} + +// ReprotectPreparer prepares the Reprotect request. +func (client ReplicationProtectedItemsClient) ReprotectPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput ReverseReplicationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/reProtect", pathParameters), + autorest.WithJSON(reprotectInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReprotectSender sends the Reprotect request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ReprotectSender(req *http.Request) (future ReplicationProtectedItemsReprotectFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReprotectResponder handles the response to the Reprotect request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ReprotectResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ResolveHealthErrors operation to resolve health issues of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// resolveHealthInput - health issue input object. +func (client ReplicationProtectedItemsClient) ResolveHealthErrors(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput ResolveHealthInput) (result ReplicationProtectedItemsResolveHealthErrorsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ResolveHealthErrors") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResolveHealthErrorsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, resolveHealthInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ResolveHealthErrors", nil, "Failure preparing request") + return + } + + result, err = client.ResolveHealthErrorsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ResolveHealthErrors", result.Response(), "Failure sending request") + return + } + + return +} + +// ResolveHealthErrorsPreparer prepares the ResolveHealthErrors request. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput ResolveHealthInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/resolveHealthErrors", pathParameters), + autorest.WithJSON(resolveHealthInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResolveHealthErrorsSender sends the ResolveHealthErrors request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsSender(req *http.Request) (future ReplicationProtectedItemsResolveHealthErrorsFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResolveHealthErrorsResponder handles the response to the ResolveHealthErrors request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailover operation to perform a test failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// testfailoverInput - test failover input. +func (client ReplicationProtectedItemsClient) TestFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput TestFailoverInput) (result ReplicationProtectedItemsTestFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.TestFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testfailoverInput, + Constraints: []validation.Constraint{{Target: "testfailoverInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "TestFailover", err.Error()) + } + + req, err := client.TestFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, testfailoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailover", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverPreparer prepares the TestFailover request. +func (client ReplicationProtectedItemsClient) TestFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput TestFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailover", pathParameters), + autorest.WithJSON(testfailoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverSender sends the TestFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) TestFailoverSender(req *http.Request) (future ReplicationProtectedItemsTestFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverResponder handles the response to the TestFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) TestFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailoverCleanup operation to clean up the test failover of a replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// cleanupInput - test failover cleanup input. +func (client ReplicationProtectedItemsClient) TestFailoverCleanup(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput TestFailoverCleanupInput) (result ReplicationProtectedItemsTestFailoverCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.TestFailoverCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: cleanupInput, + Constraints: []validation.Constraint{{Target: "cleanupInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "cleanupInput.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "cleanupInput.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", err.Error()) + } + + req, err := client.TestFailoverCleanupPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, cleanupInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverCleanupPreparer prepares the TestFailoverCleanup request. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput TestFailoverCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailoverCleanup", pathParameters), + autorest.WithJSON(cleanupInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverCleanupSender sends the TestFailoverCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupSender(req *http.Request) (future ReplicationProtectedItemsTestFailoverCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverCleanupResponder handles the response to the TestFailoverCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UnplannedFailover operation to initiate a failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// failoverInput - failover input. +func (client ReplicationProtectedItemsClient) UnplannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput UnplannedFailoverInput) (result ReplicationProtectedItemsUnplannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UnplannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: failoverInput, + Constraints: []validation.Constraint{{Target: "failoverInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", err.Error()) + } + + req, err := client.UnplannedFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.UnplannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// UnplannedFailoverPreparer prepares the UnplannedFailover request. +func (client ReplicationProtectedItemsClient) UnplannedFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput UnplannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/unplannedFailover", pathParameters), + autorest.WithJSON(failoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UnplannedFailoverSender sends the UnplannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UnplannedFailoverSender(req *http.Request) (future ReplicationProtectedItemsUnplannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UnplannedFailoverResponder handles the response to the UnplannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UnplannedFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update the recovery settings of an ASR replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// updateProtectionInput - update protection input. +func (client ReplicationProtectedItemsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput UpdateReplicationProtectedItemInput) (result ReplicationProtectedItemsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, updateProtectionInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationProtectedItemsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput UpdateReplicationProtectedItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithJSON(updateProtectionInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateSender(req *http.Request) (future ReplicationProtectedItemsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateAppliance the operation to update appliance of an ASR replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// applianceUpdateInput - appliance update protection input. +func (client ReplicationProtectedItemsClient) UpdateAppliance(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput UpdateApplianceForReplicationProtectedItemInput) (result ReplicationProtectedItemsUpdateApplianceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UpdateAppliance") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: applianceUpdateInput, + Constraints: []validation.Constraint{{Target: "applianceUpdateInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "applianceUpdateInput.Properties.TargetApplianceID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "UpdateAppliance", err.Error()) + } + + req, err := client.UpdateAppliancePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, applianceUpdateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateAppliance", nil, "Failure preparing request") + return + } + + result, err = client.UpdateApplianceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateAppliance", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateAppliancePreparer prepares the UpdateAppliance request. +func (client ReplicationProtectedItemsClient) UpdateAppliancePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput UpdateApplianceForReplicationProtectedItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/updateAppliance", pathParameters), + autorest.WithJSON(applianceUpdateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateApplianceSender sends the UpdateAppliance request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateApplianceSender(req *http.Request) (future ReplicationProtectedItemsUpdateApplianceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateApplianceResponder handles the response to the UpdateAppliance request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateApplianceResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateMobilityService the operation to update(push update) the installed mobility service software on a replication +// protected item to the latest available version. +// Parameters: +// fabricName - the name of the fabric containing the protected item. +// protectionContainerName - the name of the container containing the protected item. +// replicationProtectedItemName - 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. +func (client ReplicationProtectedItemsClient) UpdateMobilityService(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest UpdateMobilityServiceRequest) (result ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UpdateMobilityService") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateMobilityServicePreparer(ctx, fabricName, protectionContainerName, replicationProtectedItemName, updateMobilityServiceRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateMobilityService", nil, "Failure preparing request") + return + } + + result, err = client.UpdateMobilityServiceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateMobilityService", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateMobilityServicePreparer prepares the UpdateMobilityService request. +func (client ReplicationProtectedItemsClient) UpdateMobilityServicePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest UpdateMobilityServiceRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicationProtectedItemName": autorest.Encode("path", replicationProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicationProtectedItemName}/updateMobilityService", pathParameters), + autorest.WithJSON(updateMobilityServiceRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateMobilityServiceSender sends the UpdateMobilityService request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateMobilityServiceSender(req *http.Request) (future ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateMobilityServiceResponder handles the response to the UpdateMobilityService request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateMobilityServiceResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationprotectioncontainermappings.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationprotectioncontainermappings.go new file mode 100644 index 000000000000..963eb754e2fa --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationprotectioncontainermappings.go @@ -0,0 +1,688 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionContainerMappingsClient is the client for the ReplicationProtectionContainerMappings methods of +// the Siterecovery service. +type ReplicationProtectionContainerMappingsClient struct { + BaseClient +} + +// NewReplicationProtectionContainerMappingsClient creates an instance of the +// ReplicationProtectionContainerMappingsClient client. +func NewReplicationProtectionContainerMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainerMappingsClient { + return NewReplicationProtectionContainerMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionContainerMappingsClientWithBaseURI creates an instance of the +// ReplicationProtectionContainerMappingsClient client using a custom endpoint. Use this when interacting with an +// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationProtectionContainerMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainerMappingsClient { + return ReplicationProtectionContainerMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// creationInput - mapping creation input. +func (client ReplicationProtectionContainerMappingsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput CreateProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, mappingName, creationInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionContainerMappingsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput CreateProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithJSON(creationInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) CreateSender(req *http.Request) (future ReplicationProtectionContainerMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) CreateResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete or remove a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// removalInput - removal input. +func (client ReplicationProtectionContainerMappingsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput RemoveProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, mappingName, removalInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectionContainerMappingsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput RemoveProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}/remove", pathParameters), + autorest.WithJSON(removalInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) DeleteSender(req *http.Request) (future ReplicationProtectionContainerMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection Container mapping name. +func (client ReplicationProtectionContainerMappingsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result ProtectionContainerMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, mappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionContainerMappingsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) GetResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the protection container mappings in the vault. +func (client ReplicationProtectionContainerMappingsClient) List(ctx context.Context) (result ProtectionContainerMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.List") + defer func() { + sc := -1 + if result.pcmc.Response.Response != nil { + sc = result.pcmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pcmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", resp, "Failure sending request") + return + } + + result.pcmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.pcmc.hasNextLink() && result.pcmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionContainerMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionContainerMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) ListResponder(resp *http.Response) (result ProtectionContainerMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainerMappingsClient) listNextResults(ctx context.Context, lastResults ProtectionContainerMappingCollection) (result ProtectionContainerMappingCollection, err error) { + req, err := lastResults.protectionContainerMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainerMappingsClient) ListComplete(ctx context.Context) (result ProtectionContainerMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationProtectionContainers lists the protection container mappings for a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainerMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.pcmc.Response.Response != nil { + sc = result.pcmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.pcmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.pcmc, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.pcmc.hasNextLink() && result.pcmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ProtectionContainerMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainerMappingsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ProtectionContainerMappingCollection) (result ProtectionContainerMappingCollection, err error) { + req, err := lastResults.protectionContainerMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainerMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName) + return +} + +// Purge the operation to purge(force delete) a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +func (client ReplicationProtectionContainerMappingsClient) Purge(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result ReplicationProtectionContainerMappingsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, protectionContainerName, mappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationProtectionContainerMappingsClient) PurgePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) PurgeSender(req *http.Request) (future ReplicationProtectionContainerMappingsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update the operation to update protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// updateInput - mapping update input. +func (client ReplicationProtectionContainerMappingsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput UpdateProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, mappingName, updateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationProtectionContainerMappingsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput UpdateProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithJSON(updateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) UpdateSender(req *http.Request) (future ReplicationProtectionContainerMappingsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) UpdateResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationprotectioncontainers.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationprotectioncontainers.go new file mode 100644 index 000000000000..faba8c422fe7 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationprotectioncontainers.go @@ -0,0 +1,677 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionContainersClient is the client for the ReplicationProtectionContainers methods of the +// Siterecovery service. +type ReplicationProtectionContainersClient struct { + BaseClient +} + +// NewReplicationProtectionContainersClient creates an instance of the ReplicationProtectionContainersClient client. +func NewReplicationProtectionContainersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainersClient { + return NewReplicationProtectionContainersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionContainersClientWithBaseURI creates an instance of the ReplicationProtectionContainersClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationProtectionContainersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainersClient { + return ReplicationProtectionContainersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create operation to create a protection container. +// Parameters: +// fabricName - unique fabric ARM name. +// protectionContainerName - unique protection container ARM name. +// creationInput - creation input. +func (client ReplicationProtectionContainersClient) Create(ctx context.Context, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput) (result ReplicationProtectionContainersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, creationInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionContainersClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}", pathParameters), + autorest.WithJSON(creationInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) CreateSender(req *http.Request) (future ReplicationProtectionContainersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) CreateResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete operation to remove a protection container. +// Parameters: +// fabricName - unique fabric ARM name. +// protectionContainerName - unique protection container ARM name. +func (client ReplicationProtectionContainersClient) Delete(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectionContainersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectionContainersClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) DeleteSender(req *http.Request) (future ReplicationProtectionContainersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DiscoverProtectableItem the operation to a add a protectable item to a protection container(Add physical server). +// Parameters: +// fabricName - the name of the fabric. +// protectionContainerName - the name of the protection container. +// discoverProtectableItemRequest - the request object to add a protectable item. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItem(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest) (result ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.DiscoverProtectableItem") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DiscoverProtectableItemPreparer(ctx, fabricName, protectionContainerName, discoverProtectableItemRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "DiscoverProtectableItem", nil, "Failure preparing request") + return + } + + result, err = client.DiscoverProtectableItemSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "DiscoverProtectableItem", result.Response(), "Failure sending request") + return + } + + return +} + +// DiscoverProtectableItemPreparer prepares the DiscoverProtectableItem request. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemPreparer(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/discoverProtectableItem", pathParameters), + autorest.WithJSON(discoverProtectableItemRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DiscoverProtectableItemSender sends the DiscoverProtectableItem request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemSender(req *http.Request) (future ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DiscoverProtectableItemResponder handles the response to the DiscoverProtectableItem request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectionContainersClient) Get(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainer, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionContainersClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) GetResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the protection containers in a vault. +func (client ReplicationProtectionContainersClient) List(ctx context.Context) (result ProtectionContainerCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.List") + defer func() { + sc := -1 + if result.pcc.Response.Response != nil { + sc = result.pcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", resp, "Failure sending request") + return + } + + result.pcc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", resp, "Failure responding to request") + return + } + if result.pcc.hasNextLink() && result.pcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionContainersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionContainers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) ListResponder(resp *http.Response) (result ProtectionContainerCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainersClient) listNextResults(ctx context.Context, lastResults ProtectionContainerCollection) (result ProtectionContainerCollection, err error) { + req, err := lastResults.protectionContainerCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainersClient) ListComplete(ctx context.Context) (result ProtectionContainerCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the protection containers in the specified fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationProtectionContainersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result ProtectionContainerCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.pcc.Response.Response != nil { + sc = result.pcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.pcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.pcc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.pcc.hasNextLink() && result.pcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsResponder(resp *http.Response) (result ProtectionContainerCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults ProtectionContainerCollection) (result ProtectionContainerCollection, err error) { + req, err := lastResults.protectionContainerCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result ProtectionContainerCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// SwitchProtection operation to switch protection from one container to another or one replication provider to +// another. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// switchInput - switch protection input. +func (client ReplicationProtectionContainersClient) SwitchProtection(ctx context.Context, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput) (result ReplicationProtectionContainersSwitchProtectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.SwitchProtection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.SwitchProtectionPreparer(ctx, fabricName, protectionContainerName, switchInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "SwitchProtection", nil, "Failure preparing request") + return + } + + result, err = client.SwitchProtectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "SwitchProtection", result.Response(), "Failure sending request") + return + } + + return +} + +// SwitchProtectionPreparer prepares the SwitchProtection request. +func (client ReplicationProtectionContainersClient) SwitchProtectionPreparer(ctx context.Context, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/switchprotection", pathParameters), + autorest.WithJSON(switchInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SwitchProtectionSender sends the SwitchProtection request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) SwitchProtectionSender(req *http.Request) (future ReplicationProtectionContainersSwitchProtectionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// SwitchProtectionResponder handles the response to the SwitchProtection request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) SwitchProtectionResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationprotectionintents.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationprotectionintents.go new file mode 100644 index 000000000000..c3fc5d43b156 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationprotectionintents.go @@ -0,0 +1,312 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionIntentsClient is the client for the ReplicationProtectionIntents methods of the Siterecovery +// service. +type ReplicationProtectionIntentsClient struct { + BaseClient +} + +// NewReplicationProtectionIntentsClient creates an instance of the ReplicationProtectionIntentsClient client. +func NewReplicationProtectionIntentsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionIntentsClient { + return NewReplicationProtectionIntentsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionIntentsClientWithBaseURI creates an instance of the ReplicationProtectionIntentsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationProtectionIntentsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionIntentsClient { + return ReplicationProtectionIntentsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR replication protection intent item. +// Parameters: +// intentObjectName - a name for the replication protection item. +// input - create Protection Intent Input. +func (client ReplicationProtectionIntentsClient) Create(ctx context.Context, intentObjectName string, input CreateProtectionIntentInput) (result ReplicationProtectionIntent, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, intentObjectName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionIntentsClient) CreatePreparer(ctx context.Context, intentObjectName string, input CreateProtectionIntentInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "intentObjectName": autorest.Encode("path", intentObjectName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) CreateResponder(resp *http.Response) (result ReplicationProtectionIntent, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of an ASR replication protection intent. +// Parameters: +// intentObjectName - replication protection intent name. +func (client ReplicationProtectionIntentsClient) Get(ctx context.Context, intentObjectName string) (result ReplicationProtectionIntent, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, intentObjectName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionIntentsClient) GetPreparer(ctx context.Context, intentObjectName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "intentObjectName": autorest.Encode("path", intentObjectName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) GetResponder(resp *http.Response) (result ReplicationProtectionIntent, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of ASR replication protection intent objects in the vault. +// Parameters: +// skipToken - the pagination token. +// takeToken - the page size. +func (client ReplicationProtectionIntentsClient) List(ctx context.Context, skipToken string, takeToken string) (result ReplicationProtectionIntentCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.List") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, takeToken) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionIntentsClient) ListPreparer(ctx context.Context, skipToken string, takeToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) ListResponder(resp *http.Response) (result ReplicationProtectionIntentCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionIntentsClient) listNextResults(ctx context.Context, lastResults ReplicationProtectionIntentCollection) (result ReplicationProtectionIntentCollection, err error) { + req, err := lastResults.replicationProtectionIntentCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionIntentsClient) ListComplete(ctx context.Context, skipToken string, takeToken string) (result ReplicationProtectionIntentCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, takeToken) + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationrecoveryplans.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationrecoveryplans.go new file mode 100644 index 000000000000..8a035052aeb0 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationrecoveryplans.go @@ -0,0 +1,1069 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationRecoveryPlansClient is the client for the ReplicationRecoveryPlans methods of the Siterecovery service. +type ReplicationRecoveryPlansClient struct { + BaseClient +} + +// NewReplicationRecoveryPlansClient creates an instance of the ReplicationRecoveryPlansClient client. +func NewReplicationRecoveryPlansClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryPlansClient { + return NewReplicationRecoveryPlansClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationRecoveryPlansClientWithBaseURI creates an instance of the ReplicationRecoveryPlansClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationRecoveryPlansClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryPlansClient { + return ReplicationRecoveryPlansClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery Plan creation input. +func (client ReplicationRecoveryPlansClient) Create(ctx context.Context, recoveryPlanName string, input CreateRecoveryPlanInput) (result ReplicationRecoveryPlansCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.PrimaryFabricID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "input.Properties.RecoveryFabricID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "input.Properties.Groups", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationRecoveryPlansClient) CreatePreparer(ctx context.Context, recoveryPlanName string, input CreateRecoveryPlanInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) CreateSender(req *http.Request) (future ReplicationRecoveryPlansCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) CreateResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) Delete(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationRecoveryPlansClient) DeletePreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) DeleteSender(req *http.Request) (future ReplicationRecoveryPlansDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// FailoverCancel the operation to cancel the failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) FailoverCancel(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansFailoverCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.FailoverCancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCancelPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCancel", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCancel", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCancelPreparer prepares the FailoverCancel request. +func (client ReplicationRecoveryPlansClient) FailoverCancelPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCancelSender sends the FailoverCancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) FailoverCancelSender(req *http.Request) (future ReplicationRecoveryPlansFailoverCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCancelResponder handles the response to the FailoverCancel request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) FailoverCancelResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// FailoverCommit the operation to commit the failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) FailoverCommit(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansFailoverCommitFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.FailoverCommit") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCommitPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCommit", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCommitSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCommit", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCommitPreparer prepares the FailoverCommit request. +func (client ReplicationRecoveryPlansClient) FailoverCommitPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCommit", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCommitSender sends the FailoverCommit request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) FailoverCommitSender(req *http.Request) (future ReplicationRecoveryPlansFailoverCommitFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCommitResponder handles the response to the FailoverCommit request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) FailoverCommitResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of the recovery plan. +// Parameters: +// recoveryPlanName - name of the recovery plan. +func (client ReplicationRecoveryPlansClient) Get(ctx context.Context, recoveryPlanName string) (result RecoveryPlan, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationRecoveryPlansClient) GetPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) GetResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the recovery plans in the vault. +func (client ReplicationRecoveryPlansClient) List(ctx context.Context) (result RecoveryPlanCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.List") + defer func() { + sc := -1 + if result.RPCVar.Response.Response != nil { + sc = result.RPCVar.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.RPCVar.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", resp, "Failure sending request") + return + } + + result.RPCVar, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", resp, "Failure responding to request") + return + } + if result.RPCVar.hasNextLink() && result.RPCVar.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationRecoveryPlansClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) ListResponder(resp *http.Response) (result RecoveryPlanCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryPlansClient) listNextResults(ctx context.Context, lastResults RecoveryPlanCollection) (result RecoveryPlanCollection, err error) { + req, err := lastResults.recoveryPlanCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryPlansClient) ListComplete(ctx context.Context) (result RecoveryPlanCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// PlannedFailover the operation to start the planned failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - failover input. +func (client ReplicationRecoveryPlansClient) PlannedFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput) (result ReplicationRecoveryPlansPlannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.PlannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", err.Error()) + } + + req, err := client.PlannedFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.PlannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// PlannedFailoverPreparer prepares the PlannedFailover request. +func (client ReplicationRecoveryPlansClient) PlannedFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/plannedFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PlannedFailoverSender sends the PlannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) PlannedFailoverSender(req *http.Request) (future ReplicationRecoveryPlansPlannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PlannedFailoverResponder handles the response to the PlannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) PlannedFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Reprotect the operation to reprotect(reverse replicate) a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) Reprotect(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansReprotectFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Reprotect") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReprotectPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Reprotect", nil, "Failure preparing request") + return + } + + result, err = client.ReprotectSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Reprotect", result.Response(), "Failure sending request") + return + } + + return +} + +// ReprotectPreparer prepares the Reprotect request. +func (client ReplicationRecoveryPlansClient) ReprotectPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/reProtect", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReprotectSender sends the Reprotect request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) ReprotectSender(req *http.Request) (future ReplicationRecoveryPlansReprotectFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReprotectResponder handles the response to the Reprotect request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) ReprotectResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailover the operation to start the test failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan test failover input. +func (client ReplicationRecoveryPlansClient) TestFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverInput) (result ReplicationRecoveryPlansTestFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.TestFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.NetworkType", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "TestFailover", err.Error()) + } + + req, err := client.TestFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailover", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverPreparer prepares the TestFailover request. +func (client ReplicationRecoveryPlansClient) TestFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverSender sends the TestFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) TestFailoverSender(req *http.Request) (future ReplicationRecoveryPlansTestFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverResponder handles the response to the TestFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) TestFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailoverCleanup the operation to cleanup test failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan test failover cleanup input. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanup(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput) (result ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.TestFailoverCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "input.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", err.Error()) + } + + req, err := client.TestFailoverCleanupPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverCleanupPreparer prepares the TestFailoverCleanup request. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailoverCleanup", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverCleanupSender sends the TestFailoverCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupSender(req *http.Request) (future ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverCleanupResponder handles the response to the TestFailoverCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UnplannedFailover the operation to start the unplanned failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan unplanned failover input. +func (client ReplicationRecoveryPlansClient) UnplannedFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput) (result ReplicationRecoveryPlansUnplannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.UnplannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", err.Error()) + } + + req, err := client.UnplannedFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.UnplannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// UnplannedFailoverPreparer prepares the UnplannedFailover request. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/unplannedFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UnplannedFailoverSender sends the UnplannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverSender(req *http.Request) (future ReplicationRecoveryPlansUnplannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UnplannedFailoverResponder handles the response to the UnplannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - update recovery plan input. +func (client ReplicationRecoveryPlansClient) Update(ctx context.Context, recoveryPlanName string, input UpdateRecoveryPlanInput) (result ReplicationRecoveryPlansUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationRecoveryPlansClient) UpdatePreparer(ctx context.Context, recoveryPlanName string, input UpdateRecoveryPlanInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) UpdateSender(req *http.Request) (future ReplicationRecoveryPlansUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) UpdateResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationrecoveryservicesproviders.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationrecoveryservicesproviders.go new file mode 100644 index 000000000000..af4e106abf0d --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationrecoveryservicesproviders.go @@ -0,0 +1,700 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationRecoveryServicesProvidersClient is the client for the ReplicationRecoveryServicesProviders methods of the +// Siterecovery service. +type ReplicationRecoveryServicesProvidersClient struct { + BaseClient +} + +// NewReplicationRecoveryServicesProvidersClient creates an instance of the ReplicationRecoveryServicesProvidersClient +// client. +func NewReplicationRecoveryServicesProvidersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryServicesProvidersClient { + return NewReplicationRecoveryServicesProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationRecoveryServicesProvidersClientWithBaseURI creates an instance of the +// ReplicationRecoveryServicesProvidersClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationRecoveryServicesProvidersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryServicesProvidersClient { + return ReplicationRecoveryServicesProvidersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to add a recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +// addProviderInput - add provider input. +func (client ReplicationRecoveryServicesProvidersClient) Create(ctx context.Context, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput) (result ReplicationRecoveryServicesProvidersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: addProviderInput, + Constraints: []validation.Constraint{{Target: "addProviderInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.MachineName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.AuthenticationIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.ResourceAccessIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, providerName, addProviderInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationRecoveryServicesProvidersClient) CreatePreparer(ctx context.Context, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithJSON(addProviderInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) CreateSender(req *http.Request) (future ReplicationRecoveryServicesProvidersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) CreateResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to removes/delete(unregister) a recovery services provider from the vault. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Delete(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationRecoveryServicesProvidersClient) DeletePreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) DeleteSender(req *http.Request) (future ReplicationRecoveryServicesProvidersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of registered recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Get(ctx context.Context, fabricName string, providerName string) (result RecoveryServicesProvider, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationRecoveryServicesProvidersClient) GetPreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) GetResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the registered recovery services providers in the vault. +func (client ReplicationRecoveryServicesProvidersClient) List(ctx context.Context) (result RecoveryServicesProviderCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.List") + defer func() { + sc := -1 + if result.rspc.Response.Response != nil { + sc = result.rspc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rspc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", resp, "Failure sending request") + return + } + + result.rspc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", resp, "Failure responding to request") + return + } + if result.rspc.hasNextLink() && result.rspc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationRecoveryServicesProvidersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryServicesProviders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) ListResponder(resp *http.Response) (result RecoveryServicesProviderCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryServicesProvidersClient) listNextResults(ctx context.Context, lastResults RecoveryServicesProviderCollection) (result RecoveryServicesProviderCollection, err error) { + req, err := lastResults.recoveryServicesProviderCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryServicesProvidersClient) ListComplete(ctx context.Context) (result RecoveryServicesProviderCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the registered recovery services providers for the specified fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result RecoveryServicesProviderCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.rspc.Response.Response != nil { + sc = result.rspc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.rspc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.rspc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.rspc.hasNextLink() && result.rspc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsResponder(resp *http.Response) (result RecoveryServicesProviderCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryServicesProvidersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults RecoveryServicesProviderCollection) (result RecoveryServicesProviderCollection, err error) { + req, err := lastResults.recoveryServicesProviderCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result RecoveryServicesProviderCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// Purge the operation to purge(force delete) a recovery services provider from the vault. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Purge(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationRecoveryServicesProvidersClient) PurgePreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) PurgeSender(req *http.Request) (future ReplicationRecoveryServicesProvidersPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RefreshProvider the operation to refresh the information from the recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProvider(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.RefreshProvider") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RefreshProviderPreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "RefreshProvider", nil, "Failure preparing request") + return + } + + result, err = client.RefreshProviderSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "RefreshProvider", result.Response(), "Failure sending request") + return + } + + return +} + +// RefreshProviderPreparer prepares the RefreshProvider request. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderPreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/refreshProvider", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RefreshProviderSender sends the RefreshProvider request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderSender(req *http.Request) (future ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RefreshProviderResponder handles the response to the RefreshProvider request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationstorageclassificationmappings.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationstorageclassificationmappings.go new file mode 100644 index 000000000000..73e5333714cb --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationstorageclassificationmappings.go @@ -0,0 +1,517 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationStorageClassificationMappingsClient is the client for the ReplicationStorageClassificationMappings +// methods of the Siterecovery service. +type ReplicationStorageClassificationMappingsClient struct { + BaseClient +} + +// NewReplicationStorageClassificationMappingsClient creates an instance of the +// ReplicationStorageClassificationMappingsClient client. +func NewReplicationStorageClassificationMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationMappingsClient { + return NewReplicationStorageClassificationMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationStorageClassificationMappingsClientWithBaseURI creates an instance of the +// ReplicationStorageClassificationMappingsClient client using a custom endpoint. Use this when interacting with an +// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationStorageClassificationMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationMappingsClient { + return ReplicationStorageClassificationMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +// pairingInput - pairing input. +func (client ReplicationStorageClassificationMappingsClient) Create(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput StorageClassificationMappingInput) (result ReplicationStorageClassificationMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName, pairingInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationStorageClassificationMappingsClient) CreatePreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput StorageClassificationMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithJSON(pairingInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) CreateSender(req *http.Request) (future ReplicationStorageClassificationMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) CreateResponder(resp *http.Response) (result StorageClassificationMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +func (client ReplicationStorageClassificationMappingsClient) Delete(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result ReplicationStorageClassificationMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationStorageClassificationMappingsClient) DeletePreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) DeleteSender(req *http.Request) (future ReplicationStorageClassificationMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the specified storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +func (client ReplicationStorageClassificationMappingsClient) Get(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result StorageClassificationMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationStorageClassificationMappingsClient) GetPreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) GetResponder(resp *http.Response) (result StorageClassificationMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the storage classification mappings in the vault. +func (client ReplicationStorageClassificationMappingsClient) List(ctx context.Context) (result StorageClassificationMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.List") + defer func() { + sc := -1 + if result.scmc.Response.Response != nil { + sc = result.scmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.scmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", resp, "Failure sending request") + return + } + + result.scmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.scmc.hasNextLink() && result.scmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationStorageClassificationMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationStorageClassificationMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) ListResponder(resp *http.Response) (result StorageClassificationMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationMappingsClient) listNextResults(ctx context.Context, lastResults StorageClassificationMappingCollection) (result StorageClassificationMappingCollection, err error) { + req, err := lastResults.storageClassificationMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationMappingsClient) ListComplete(ctx context.Context) (result StorageClassificationMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationStorageClassifications lists the storage classification mappings for the fabric. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassifications(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassificationMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.ListByReplicationStorageClassifications") + defer func() { + sc := -1 + if result.scmc.Response.Response != nil { + sc = result.scmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationStorageClassificationsNextResults + req, err := client.ListByReplicationStorageClassificationsPreparer(ctx, fabricName, storageClassificationName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationStorageClassificationsSender(req) + if err != nil { + result.scmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", resp, "Failure sending request") + return + } + + result.scmc, err = client.ListByReplicationStorageClassificationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", resp, "Failure responding to request") + return + } + if result.scmc.hasNextLink() && result.scmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationStorageClassificationsPreparer prepares the ListByReplicationStorageClassifications request. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsPreparer(ctx context.Context, fabricName string, storageClassificationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationStorageClassificationsSender sends the ListByReplicationStorageClassifications request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationStorageClassificationsResponder handles the response to the ListByReplicationStorageClassifications request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsResponder(resp *http.Response) (result StorageClassificationMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationStorageClassificationsNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationMappingsClient) listByReplicationStorageClassificationsNextResults(ctx context.Context, lastResults StorageClassificationMappingCollection) (result StorageClassificationMappingCollection, err error) { + req, err := lastResults.storageClassificationMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationStorageClassificationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationStorageClassificationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationStorageClassificationsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsComplete(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassificationMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.ListByReplicationStorageClassifications") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationStorageClassifications(ctx, fabricName, storageClassificationName) + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationstorageclassifications.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationstorageclassifications.go new file mode 100644 index 000000000000..bca3d9a617d8 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationstorageclassifications.go @@ -0,0 +1,345 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationStorageClassificationsClient is the client for the ReplicationStorageClassifications methods of the +// Siterecovery service. +type ReplicationStorageClassificationsClient struct { + BaseClient +} + +// NewReplicationStorageClassificationsClient creates an instance of the ReplicationStorageClassificationsClient +// client. +func NewReplicationStorageClassificationsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationsClient { + return NewReplicationStorageClassificationsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationStorageClassificationsClientWithBaseURI creates an instance of the +// ReplicationStorageClassificationsClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationStorageClassificationsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationsClient { + return ReplicationStorageClassificationsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of the specified storage classification. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +func (client ReplicationStorageClassificationsClient) Get(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassification, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, storageClassificationName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationStorageClassificationsClient) GetPreparer(ctx context.Context, fabricName string, storageClassificationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) GetResponder(resp *http.Response) (result StorageClassification, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the storage classifications in the vault. +func (client ReplicationStorageClassificationsClient) List(ctx context.Context) (result StorageClassificationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.List") + defer func() { + sc := -1 + if result.scc.Response.Response != nil { + sc = result.scc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.scc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", resp, "Failure sending request") + return + } + + result.scc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", resp, "Failure responding to request") + return + } + if result.scc.hasNextLink() && result.scc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationStorageClassificationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationStorageClassifications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) ListResponder(resp *http.Response) (result StorageClassificationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationsClient) listNextResults(ctx context.Context, lastResults StorageClassificationCollection) (result StorageClassificationCollection, err error) { + req, err := lastResults.storageClassificationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationsClient) ListComplete(ctx context.Context) (result StorageClassificationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the storage classifications available in the specified fabric. +// Parameters: +// fabricName - site name of interest. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result StorageClassificationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.scc.Response.Response != nil { + sc = result.scc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.scc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.scc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.scc.hasNextLink() && result.scc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsResponder(resp *http.Response) (result StorageClassificationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationsClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults StorageClassificationCollection) (result StorageClassificationCollection, err error) { + req, err := lastResults.storageClassificationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result StorageClassificationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationvaulthealth.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationvaulthealth.go new file mode 100644 index 000000000000..ce6759513087 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationvaulthealth.go @@ -0,0 +1,181 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationVaultHealthClient is the client for the ReplicationVaultHealth methods of the Siterecovery service. +type ReplicationVaultHealthClient struct { + BaseClient +} + +// NewReplicationVaultHealthClient creates an instance of the ReplicationVaultHealthClient client. +func NewReplicationVaultHealthClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultHealthClient { + return NewReplicationVaultHealthClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationVaultHealthClientWithBaseURI creates an instance of the ReplicationVaultHealthClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewReplicationVaultHealthClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultHealthClient { + return ReplicationVaultHealthClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the health details of the vault. +func (client ReplicationVaultHealthClient) Get(ctx context.Context) (result VaultHealthDetails, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultHealthClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationVaultHealthClient) GetPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultHealthClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationVaultHealthClient) GetResponder(resp *http.Response) (result VaultHealthDetails, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Refresh sends the refresh request. +func (client ReplicationVaultHealthClient) Refresh(ctx context.Context) (result ReplicationVaultHealthRefreshFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultHealthClient.Refresh") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RefreshPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Refresh", nil, "Failure preparing request") + return + } + + result, err = client.RefreshSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Refresh", result.Response(), "Failure sending request") + return + } + + return +} + +// RefreshPreparer prepares the Refresh request. +func (client ReplicationVaultHealthClient) RefreshPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth/default/refresh", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RefreshSender sends the Refresh request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultHealthClient) RefreshSender(req *http.Request) (future ReplicationVaultHealthRefreshFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RefreshResponder handles the response to the Refresh request. The method always +// closes the http.Response Body. +func (client ReplicationVaultHealthClient) RefreshResponder(resp *http.Response) (result VaultHealthDetails, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationvaultsetting.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationvaultsetting.go new file mode 100644 index 000000000000..ef3ed8eef23a --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationvaultsetting.go @@ -0,0 +1,312 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationVaultSettingClient is the client for the ReplicationVaultSetting methods of the Siterecovery service. +type ReplicationVaultSettingClient struct { + BaseClient +} + +// NewReplicationVaultSettingClient creates an instance of the ReplicationVaultSettingClient client. +func NewReplicationVaultSettingClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultSettingClient { + return NewReplicationVaultSettingClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationVaultSettingClientWithBaseURI creates an instance of the ReplicationVaultSettingClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewReplicationVaultSettingClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultSettingClient { + return ReplicationVaultSettingClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to configure vault setting. +// Parameters: +// vaultSettingName - vault setting name. +// input - vault setting creation input. +func (client ReplicationVaultSettingClient) Create(ctx context.Context, vaultSettingName string, input VaultSettingCreationInput) (result ReplicationVaultSettingCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationVaultSettingClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, vaultSettingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationVaultSettingClient) CreatePreparer(ctx context.Context, vaultSettingName string, input VaultSettingCreationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultSettingName": autorest.Encode("path", vaultSettingName), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) CreateSender(req *http.Request) (future ReplicationVaultSettingCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) CreateResponder(resp *http.Response) (result VaultSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the vault setting. This includes the Migration Hub connection settings. +// Parameters: +// vaultSettingName - vault setting name. +func (client ReplicationVaultSettingClient) Get(ctx context.Context, vaultSettingName string) (result VaultSetting, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, vaultSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationVaultSettingClient) GetPreparer(ctx context.Context, vaultSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultSettingName": autorest.Encode("path", vaultSettingName), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) GetResponder(resp *http.Response) (result VaultSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of vault setting. This includes the Migration Hub connection settings. +func (client ReplicationVaultSettingClient) List(ctx context.Context) (result VaultSettingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.List") + defer func() { + sc := -1 + if result.vsc.Response.Response != nil { + sc = result.vsc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vsc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", resp, "Failure sending request") + return + } + + result.vsc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", resp, "Failure responding to request") + return + } + if result.vsc.hasNextLink() && result.vsc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationVaultSettingClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) ListResponder(resp *http.Response) (result VaultSettingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationVaultSettingClient) listNextResults(ctx context.Context, lastResults VaultSettingCollection) (result VaultSettingCollection, err error) { + req, err := lastResults.vaultSettingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationVaultSettingClient) ListComplete(ctx context.Context) (result VaultSettingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationvcenters.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationvcenters.go new file mode 100644 index 000000000000..dc9e8d14c6b7 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/replicationvcenters.go @@ -0,0 +1,591 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationvCentersClient is the client for the ReplicationvCenters methods of the Siterecovery service. +type ReplicationvCentersClient struct { + BaseClient +} + +// NewReplicationvCentersClient creates an instance of the ReplicationvCentersClient client. +func NewReplicationvCentersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationvCentersClient { + return NewReplicationvCentersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationvCentersClientWithBaseURI creates an instance of the ReplicationvCentersClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationvCentersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationvCentersClient { + return ReplicationvCentersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a vCenter object.. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +// addVCenterRequest - the input to the add vCenter operation. +func (client ReplicationvCentersClient) Create(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest) (result ReplicationvCentersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, vcenterName, addVCenterRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationvCentersClient) CreatePreparer(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithJSON(addVCenterRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) CreateSender(req *http.Request) (future ReplicationvCentersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) CreateResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to remove(unregister) a registered vCenter server from the vault. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +func (client ReplicationvCentersClient) Delete(ctx context.Context, fabricName string, vcenterName string) (result ReplicationvCentersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, vcenterName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationvCentersClient) DeletePreparer(ctx context.Context, fabricName string, vcenterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) DeleteSender(req *http.Request) (future ReplicationvCentersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a registered vCenter server(Add vCenter server). +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +func (client ReplicationvCentersClient) Get(ctx context.Context, fabricName string, vcenterName string) (result VCenter, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, vcenterName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationvCentersClient) GetPreparer(ctx context.Context, fabricName string, vcenterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) GetResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the vCenter servers registered in the vault. +func (client ReplicationvCentersClient) List(ctx context.Context) (result VCenterCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.List") + defer func() { + sc := -1 + if result.vcc.Response.Response != nil { + sc = result.vcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", resp, "Failure sending request") + return + } + + result.vcc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", resp, "Failure responding to request") + return + } + if result.vcc.hasNextLink() && result.vcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationvCentersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationvCenters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) ListResponder(resp *http.Response) (result VCenterCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationvCentersClient) listNextResults(ctx context.Context, lastResults VCenterCollection) (result VCenterCollection, err error) { + req, err := lastResults.vCenterCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationvCentersClient) ListComplete(ctx context.Context) (result VCenterCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the vCenter servers registered in a fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationvCentersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result VCenterCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.vcc.Response.Response != nil { + sc = result.vcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.vcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.vcc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.vcc.hasNextLink() && result.vcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationvCentersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) ListByReplicationFabricsResponder(resp *http.Response) (result VCenterCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationvCentersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults VCenterCollection) (result VCenterCollection, err error) { + req, err := lastResults.vCenterCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationvCentersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result VCenterCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// Update the operation to update a registered vCenter. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +// updateVCenterRequest - the input to the update vCenter operation. +func (client ReplicationvCentersClient) Update(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest) (result ReplicationvCentersUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, vcenterName, updateVCenterRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationvCentersClient) UpdatePreparer(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithJSON(updateVCenterRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) UpdateSender(req *http.Request) (future ReplicationvCentersUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) UpdateResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/siterecoveryapi/interfaces.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/siterecoveryapi/interfaces.go new file mode 100644 index 000000000000..c47194512819 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/siterecoveryapi/interfaces.go @@ -0,0 +1,341 @@ +package siterecoveryapi + +// 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. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-08-01/siterecovery" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result siterecovery.OperationsDiscoveryCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.OperationsDiscoveryCollectionIterator, err error) +} + +var _ OperationsClientAPI = (*siterecovery.OperationsClient)(nil) + +// ReplicationAlertSettingsClientAPI contains the set of methods on the ReplicationAlertSettingsClient type. +type ReplicationAlertSettingsClientAPI interface { + Create(ctx context.Context, alertSettingName string, request siterecovery.ConfigureAlertRequest) (result siterecovery.Alert, err error) + Get(ctx context.Context, alertSettingName string) (result siterecovery.Alert, err error) + List(ctx context.Context) (result siterecovery.AlertCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.AlertCollectionIterator, err error) +} + +var _ ReplicationAlertSettingsClientAPI = (*siterecovery.ReplicationAlertSettingsClient)(nil) + +// ReplicationEligibilityResultsClientAPI contains the set of methods on the ReplicationEligibilityResultsClient type. +type ReplicationEligibilityResultsClientAPI interface { + Get(ctx context.Context, virtualMachineName string) (result siterecovery.ReplicationEligibilityResults, err error) + List(ctx context.Context, virtualMachineName string) (result siterecovery.ReplicationEligibilityResultsCollection, err error) +} + +var _ ReplicationEligibilityResultsClientAPI = (*siterecovery.ReplicationEligibilityResultsClient)(nil) + +// ReplicationEventsClientAPI contains the set of methods on the ReplicationEventsClient type. +type ReplicationEventsClientAPI interface { + Get(ctx context.Context, eventName string) (result siterecovery.Event, err error) + List(ctx context.Context, filter string) (result siterecovery.EventCollectionPage, err error) + ListComplete(ctx context.Context, filter string) (result siterecovery.EventCollectionIterator, err error) +} + +var _ ReplicationEventsClientAPI = (*siterecovery.ReplicationEventsClient)(nil) + +// ReplicationFabricsClientAPI contains the set of methods on the ReplicationFabricsClient type. +type ReplicationFabricsClientAPI interface { + CheckConsistency(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsCheckConsistencyFuture, err error) + Create(ctx context.Context, fabricName string, input siterecovery.FabricCreationInput) (result siterecovery.ReplicationFabricsCreateFuture, err error) + Delete(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, filter string) (result siterecovery.Fabric, err error) + List(ctx context.Context) (result siterecovery.FabricCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.FabricCollectionIterator, err error) + MigrateToAad(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsMigrateToAadFuture, err error) + Purge(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsPurgeFuture, err error) + ReassociateGateway(ctx context.Context, fabricName string, failoverProcessServerRequest siterecovery.FailoverProcessServerRequest) (result siterecovery.ReplicationFabricsReassociateGatewayFuture, err error) + RenewCertificate(ctx context.Context, fabricName string, renewCertificate siterecovery.RenewCertificateInput) (result siterecovery.ReplicationFabricsRenewCertificateFuture, err error) +} + +var _ ReplicationFabricsClientAPI = (*siterecovery.ReplicationFabricsClient)(nil) + +// ReplicationLogicalNetworksClientAPI contains the set of methods on the ReplicationLogicalNetworksClient type. +type ReplicationLogicalNetworksClientAPI interface { + Get(ctx context.Context, fabricName string, logicalNetworkName string) (result siterecovery.LogicalNetwork, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.LogicalNetworkCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.LogicalNetworkCollectionIterator, err error) +} + +var _ ReplicationLogicalNetworksClientAPI = (*siterecovery.ReplicationLogicalNetworksClient)(nil) + +// ReplicationNetworksClientAPI contains the set of methods on the ReplicationNetworksClient type. +type ReplicationNetworksClientAPI interface { + Get(ctx context.Context, fabricName string, networkName string) (result siterecovery.Network, err error) + List(ctx context.Context) (result siterecovery.NetworkCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.NetworkCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.NetworkCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.NetworkCollectionIterator, err error) +} + +var _ ReplicationNetworksClientAPI = (*siterecovery.ReplicationNetworksClient)(nil) + +// ReplicationNetworkMappingsClientAPI contains the set of methods on the ReplicationNetworkMappingsClient type. +type ReplicationNetworkMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, networkName string, networkMappingName string, input siterecovery.CreateNetworkMappingInput) (result siterecovery.ReplicationNetworkMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result siterecovery.ReplicationNetworkMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result siterecovery.NetworkMapping, err error) + List(ctx context.Context) (result siterecovery.NetworkMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.NetworkMappingCollectionIterator, err error) + ListByReplicationNetworks(ctx context.Context, fabricName string, networkName string) (result siterecovery.NetworkMappingCollectionPage, err error) + ListByReplicationNetworksComplete(ctx context.Context, fabricName string, networkName string) (result siterecovery.NetworkMappingCollectionIterator, err error) + Update(ctx context.Context, fabricName string, networkName string, networkMappingName string, input siterecovery.UpdateNetworkMappingInput) (result siterecovery.ReplicationNetworkMappingsUpdateFuture, err error) +} + +var _ ReplicationNetworkMappingsClientAPI = (*siterecovery.ReplicationNetworkMappingsClient)(nil) + +// ReplicationProtectionContainersClientAPI contains the set of methods on the ReplicationProtectionContainersClient type. +type ReplicationProtectionContainersClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, creationInput siterecovery.CreateProtectionContainerInput) (result siterecovery.ReplicationProtectionContainersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectionContainersDeleteFuture, err error) + DiscoverProtectableItem(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest siterecovery.DiscoverProtectableItemRequest) (result siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainer, err error) + List(ctx context.Context) (result siterecovery.ProtectionContainerCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.ProtectionContainerCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.ProtectionContainerCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.ProtectionContainerCollectionIterator, err error) + SwitchProtection(ctx context.Context, fabricName string, protectionContainerName string, switchInput siterecovery.SwitchProtectionInput) (result siterecovery.ReplicationProtectionContainersSwitchProtectionFuture, err error) +} + +var _ ReplicationProtectionContainersClientAPI = (*siterecovery.ReplicationProtectionContainersClient)(nil) + +// ReplicationMigrationItemsClientAPI contains the set of methods on the ReplicationMigrationItemsClient type. +type ReplicationMigrationItemsClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.EnableMigrationInput) (result siterecovery.ReplicationMigrationItemsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (result siterecovery.ReplicationMigrationItemsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationItem, err error) + List(ctx context.Context, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionIterator, err error) + Migrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput siterecovery.MigrateInput) (result siterecovery.ReplicationMigrationItemsMigrateFuture, err error) + Resync(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.ResyncInput) (result siterecovery.ReplicationMigrationItemsResyncFuture, err error) + TestMigrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput siterecovery.TestMigrateInput) (result siterecovery.ReplicationMigrationItemsTestMigrateFuture, err error) + TestMigrateCleanup(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput siterecovery.TestMigrateCleanupInput) (result siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.UpdateMigrationItemInput) (result siterecovery.ReplicationMigrationItemsUpdateFuture, err error) +} + +var _ ReplicationMigrationItemsClientAPI = (*siterecovery.ReplicationMigrationItemsClient)(nil) + +// MigrationRecoveryPointsClientAPI contains the set of methods on the MigrationRecoveryPointsClient type. +type MigrationRecoveryPointsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (result siterecovery.MigrationRecoveryPoint, err error) + ListByReplicationMigrationItems(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationRecoveryPointCollectionPage, err error) + ListByReplicationMigrationItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationRecoveryPointCollectionIterator, err error) +} + +var _ MigrationRecoveryPointsClientAPI = (*siterecovery.MigrationRecoveryPointsClient)(nil) + +// ReplicationProtectableItemsClientAPI contains the set of methods on the ReplicationProtectableItemsClient type. +type ReplicationProtectableItemsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (result siterecovery.ProtectableItem, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result siterecovery.ProtectableItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result siterecovery.ProtectableItemCollectionIterator, err error) +} + +var _ ReplicationProtectableItemsClientAPI = (*siterecovery.ReplicationProtectableItemsClient)(nil) + +// ReplicationProtectedItemsClientAPI contains the set of methods on the ReplicationProtectedItemsClient type. +type ReplicationProtectedItemsClientAPI interface { + AddDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput siterecovery.AddDisksInput) (result siterecovery.ReplicationProtectedItemsAddDisksFuture, err error) + ApplyRecoveryPoint(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput siterecovery.ApplyRecoveryPointInput) (result siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture, err error) + Create(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input siterecovery.EnableProtectionInput) (result siterecovery.ReplicationProtectedItemsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput siterecovery.DisableProtectionInput) (result siterecovery.ReplicationProtectedItemsDeleteFuture, err error) + FailoverCancel(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsFailoverCancelFuture, err error) + FailoverCommit(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsFailoverCommitFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItem, err error) + List(ctx context.Context, skipToken string, filter string) (result siterecovery.ReplicationProtectedItemCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, filter string) (result siterecovery.ReplicationProtectedItemCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectedItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectedItemCollectionIterator, err error) + PlannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput siterecovery.PlannedFailoverInput) (result siterecovery.ReplicationProtectedItemsPlannedFailoverFuture, err error) + Purge(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsPurgeFuture, err error) + RemoveDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput siterecovery.RemoveDisksInput) (result siterecovery.ReplicationProtectedItemsRemoveDisksFuture, err error) + RepairReplication(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsRepairReplicationFuture, err error) + Reprotect(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput siterecovery.ReverseReplicationInput) (result siterecovery.ReplicationProtectedItemsReprotectFuture, err error) + ResolveHealthErrors(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput siterecovery.ResolveHealthInput) (result siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture, err error) + TestFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput siterecovery.TestFailoverInput) (result siterecovery.ReplicationProtectedItemsTestFailoverFuture, err error) + TestFailoverCleanup(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput siterecovery.TestFailoverCleanupInput) (result siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture, err error) + UnplannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput siterecovery.UnplannedFailoverInput) (result siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput siterecovery.UpdateReplicationProtectedItemInput) (result siterecovery.ReplicationProtectedItemsUpdateFuture, err error) + UpdateAppliance(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput siterecovery.UpdateApplianceForReplicationProtectedItemInput) (result siterecovery.ReplicationProtectedItemsUpdateApplianceFuture, err error) + UpdateMobilityService(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest siterecovery.UpdateMobilityServiceRequest) (result siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) +} + +var _ ReplicationProtectedItemsClientAPI = (*siterecovery.ReplicationProtectedItemsClient)(nil) + +// RecoveryPointsClientAPI contains the set of methods on the RecoveryPointsClient type. +type RecoveryPointsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (result siterecovery.RecoveryPoint, err error) + ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.RecoveryPointCollectionPage, err error) + ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.RecoveryPointCollectionIterator, err error) +} + +var _ RecoveryPointsClientAPI = (*siterecovery.RecoveryPointsClient)(nil) + +// TargetComputeSizesClientAPI contains the set of methods on the TargetComputeSizesClient type. +type TargetComputeSizesClientAPI interface { + ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.TargetComputeSizeCollectionPage, err error) + ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.TargetComputeSizeCollectionIterator, err error) +} + +var _ TargetComputeSizesClientAPI = (*siterecovery.TargetComputeSizesClient)(nil) + +// ReplicationProtectionContainerMappingsClientAPI contains the set of methods on the ReplicationProtectionContainerMappingsClient type. +type ReplicationProtectionContainerMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput siterecovery.CreateProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput siterecovery.RemoveProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result siterecovery.ProtectionContainerMapping, err error) + List(ctx context.Context) (result siterecovery.ProtectionContainerMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.ProtectionContainerMappingCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainerMappingCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainerMappingCollectionIterator, err error) + Purge(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result siterecovery.ReplicationProtectionContainerMappingsPurgeFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput siterecovery.UpdateProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsUpdateFuture, err error) +} + +var _ ReplicationProtectionContainerMappingsClientAPI = (*siterecovery.ReplicationProtectionContainerMappingsClient)(nil) + +// ReplicationRecoveryServicesProvidersClientAPI contains the set of methods on the ReplicationRecoveryServicesProvidersClient type. +type ReplicationRecoveryServicesProvidersClientAPI interface { + Create(ctx context.Context, fabricName string, providerName string, addProviderInput siterecovery.AddRecoveryServicesProviderInput) (result siterecovery.ReplicationRecoveryServicesProvidersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture, err error) + Get(ctx context.Context, fabricName string, providerName string) (result siterecovery.RecoveryServicesProvider, err error) + List(ctx context.Context) (result siterecovery.RecoveryServicesProviderCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.RecoveryServicesProviderCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.RecoveryServicesProviderCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.RecoveryServicesProviderCollectionIterator, err error) + Purge(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture, err error) + RefreshProvider(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) +} + +var _ ReplicationRecoveryServicesProvidersClientAPI = (*siterecovery.ReplicationRecoveryServicesProvidersClient)(nil) + +// ReplicationStorageClassificationsClientAPI contains the set of methods on the ReplicationStorageClassificationsClient type. +type ReplicationStorageClassificationsClientAPI interface { + Get(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassification, err error) + List(ctx context.Context) (result siterecovery.StorageClassificationCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.StorageClassificationCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.StorageClassificationCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.StorageClassificationCollectionIterator, err error) +} + +var _ ReplicationStorageClassificationsClientAPI = (*siterecovery.ReplicationStorageClassificationsClient)(nil) + +// ReplicationStorageClassificationMappingsClientAPI contains the set of methods on the ReplicationStorageClassificationMappingsClient type. +type ReplicationStorageClassificationMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput siterecovery.StorageClassificationMappingInput) (result siterecovery.ReplicationStorageClassificationMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result siterecovery.ReplicationStorageClassificationMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result siterecovery.StorageClassificationMapping, err error) + List(ctx context.Context) (result siterecovery.StorageClassificationMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.StorageClassificationMappingCollectionIterator, err error) + ListByReplicationStorageClassifications(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassificationMappingCollectionPage, err error) + ListByReplicationStorageClassificationsComplete(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassificationMappingCollectionIterator, err error) +} + +var _ ReplicationStorageClassificationMappingsClientAPI = (*siterecovery.ReplicationStorageClassificationMappingsClient)(nil) + +// ReplicationvCentersClientAPI contains the set of methods on the ReplicationvCentersClient type. +type ReplicationvCentersClientAPI interface { + Create(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest siterecovery.AddVCenterRequest) (result siterecovery.ReplicationvCentersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, vcenterName string) (result siterecovery.ReplicationvCentersDeleteFuture, err error) + Get(ctx context.Context, fabricName string, vcenterName string) (result siterecovery.VCenter, err error) + List(ctx context.Context) (result siterecovery.VCenterCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.VCenterCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.VCenterCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.VCenterCollectionIterator, err error) + Update(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest siterecovery.UpdateVCenterRequest) (result siterecovery.ReplicationvCentersUpdateFuture, err error) +} + +var _ ReplicationvCentersClientAPI = (*siterecovery.ReplicationvCentersClient)(nil) + +// ReplicationJobsClientAPI contains the set of methods on the ReplicationJobsClient type. +type ReplicationJobsClientAPI interface { + Cancel(ctx context.Context, jobName string) (result siterecovery.ReplicationJobsCancelFuture, err error) + Export(ctx context.Context, jobQueryParameter siterecovery.JobQueryParameter) (result siterecovery.ReplicationJobsExportFuture, err error) + Get(ctx context.Context, jobName string) (result siterecovery.Job, err error) + List(ctx context.Context, filter string) (result siterecovery.JobCollectionPage, err error) + ListComplete(ctx context.Context, filter string) (result siterecovery.JobCollectionIterator, err error) + Restart(ctx context.Context, jobName string) (result siterecovery.ReplicationJobsRestartFuture, err error) + Resume(ctx context.Context, jobName string, resumeJobParams siterecovery.ResumeJobParams) (result siterecovery.ReplicationJobsResumeFuture, err error) +} + +var _ ReplicationJobsClientAPI = (*siterecovery.ReplicationJobsClient)(nil) + +// ReplicationPoliciesClientAPI contains the set of methods on the ReplicationPoliciesClient type. +type ReplicationPoliciesClientAPI interface { + Create(ctx context.Context, policyName string, input siterecovery.CreatePolicyInput) (result siterecovery.ReplicationPoliciesCreateFuture, err error) + Delete(ctx context.Context, policyName string) (result siterecovery.ReplicationPoliciesDeleteFuture, err error) + Get(ctx context.Context, policyName string) (result siterecovery.Policy, err error) + List(ctx context.Context) (result siterecovery.PolicyCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.PolicyCollectionIterator, err error) + Update(ctx context.Context, policyName string, input siterecovery.UpdatePolicyInput) (result siterecovery.ReplicationPoliciesUpdateFuture, err error) +} + +var _ ReplicationPoliciesClientAPI = (*siterecovery.ReplicationPoliciesClient)(nil) + +// ReplicationProtectionIntentsClientAPI contains the set of methods on the ReplicationProtectionIntentsClient type. +type ReplicationProtectionIntentsClientAPI interface { + Create(ctx context.Context, intentObjectName string, input siterecovery.CreateProtectionIntentInput) (result siterecovery.ReplicationProtectionIntent, err error) + Get(ctx context.Context, intentObjectName string) (result siterecovery.ReplicationProtectionIntent, err error) + List(ctx context.Context, skipToken string, takeToken string) (result siterecovery.ReplicationProtectionIntentCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, takeToken string) (result siterecovery.ReplicationProtectionIntentCollectionIterator, err error) +} + +var _ ReplicationProtectionIntentsClientAPI = (*siterecovery.ReplicationProtectionIntentsClient)(nil) + +// ReplicationRecoveryPlansClientAPI contains the set of methods on the ReplicationRecoveryPlansClient type. +type ReplicationRecoveryPlansClientAPI interface { + Create(ctx context.Context, recoveryPlanName string, input siterecovery.CreateRecoveryPlanInput) (result siterecovery.ReplicationRecoveryPlansCreateFuture, err error) + Delete(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansDeleteFuture, err error) + FailoverCancel(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansFailoverCancelFuture, err error) + FailoverCommit(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansFailoverCommitFuture, err error) + Get(ctx context.Context, recoveryPlanName string) (result siterecovery.RecoveryPlan, err error) + List(ctx context.Context) (result siterecovery.RecoveryPlanCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.RecoveryPlanCollectionIterator, err error) + PlannedFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanPlannedFailoverInput) (result siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture, err error) + Reprotect(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansReprotectFuture, err error) + TestFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanTestFailoverInput) (result siterecovery.ReplicationRecoveryPlansTestFailoverFuture, err error) + TestFailoverCleanup(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanTestFailoverCleanupInput) (result siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) + UnplannedFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanUnplannedFailoverInput) (result siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture, err error) + Update(ctx context.Context, recoveryPlanName string, input siterecovery.UpdateRecoveryPlanInput) (result siterecovery.ReplicationRecoveryPlansUpdateFuture, err error) +} + +var _ ReplicationRecoveryPlansClientAPI = (*siterecovery.ReplicationRecoveryPlansClient)(nil) + +// SupportedOperatingSystemsClientAPI contains the set of methods on the SupportedOperatingSystemsClient type. +type SupportedOperatingSystemsClientAPI interface { + Get(ctx context.Context, instanceType string) (result siterecovery.SupportedOperatingSystems, err error) +} + +var _ SupportedOperatingSystemsClientAPI = (*siterecovery.SupportedOperatingSystemsClient)(nil) + +// ReplicationVaultHealthClientAPI contains the set of methods on the ReplicationVaultHealthClient type. +type ReplicationVaultHealthClientAPI interface { + Get(ctx context.Context) (result siterecovery.VaultHealthDetails, err error) + Refresh(ctx context.Context) (result siterecovery.ReplicationVaultHealthRefreshFuture, err error) +} + +var _ ReplicationVaultHealthClientAPI = (*siterecovery.ReplicationVaultHealthClient)(nil) + +// ReplicationVaultSettingClientAPI contains the set of methods on the ReplicationVaultSettingClient type. +type ReplicationVaultSettingClientAPI interface { + Create(ctx context.Context, vaultSettingName string, input siterecovery.VaultSettingCreationInput) (result siterecovery.ReplicationVaultSettingCreateFuture, err error) + Get(ctx context.Context, vaultSettingName string) (result siterecovery.VaultSetting, err error) + List(ctx context.Context) (result siterecovery.VaultSettingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.VaultSettingCollectionIterator, err error) +} + +var _ ReplicationVaultSettingClientAPI = (*siterecovery.ReplicationVaultSettingClient)(nil) diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/supportedoperatingsystems.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/supportedoperatingsystems.go new file mode 100644 index 000000000000..7619d3c8f28d --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/supportedoperatingsystems.go @@ -0,0 +1,110 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SupportedOperatingSystemsClient is the client for the SupportedOperatingSystems methods of the Siterecovery service. +type SupportedOperatingSystemsClient struct { + BaseClient +} + +// NewSupportedOperatingSystemsClient creates an instance of the SupportedOperatingSystemsClient client. +func NewSupportedOperatingSystemsClient(subscriptionID string, resourceGroupName string, resourceName string) SupportedOperatingSystemsClient { + return NewSupportedOperatingSystemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewSupportedOperatingSystemsClientWithBaseURI creates an instance of the SupportedOperatingSystemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewSupportedOperatingSystemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) SupportedOperatingSystemsClient { + return SupportedOperatingSystemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get sends the get request. +// Parameters: +// instanceType - the instance type. +func (client SupportedOperatingSystemsClient) Get(ctx context.Context, instanceType string) (result SupportedOperatingSystems, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SupportedOperatingSystemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, instanceType) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SupportedOperatingSystemsClient) GetPreparer(ctx context.Context, instanceType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(instanceType) > 0 { + queryParameters["instanceType"] = autorest.Encode("query", instanceType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationSupportedOperatingSystems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SupportedOperatingSystemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SupportedOperatingSystemsClient) GetResponder(resp *http.Response) (result SupportedOperatingSystems, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/targetcomputesizes.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/targetcomputesizes.go new file mode 100644 index 000000000000..4cab256310bc --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/targetcomputesizes.go @@ -0,0 +1,154 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// TargetComputeSizesClient is the client for the TargetComputeSizes methods of the Siterecovery service. +type TargetComputeSizesClient struct { + BaseClient +} + +// NewTargetComputeSizesClient creates an instance of the TargetComputeSizesClient client. +func NewTargetComputeSizesClient(subscriptionID string, resourceGroupName string, resourceName string) TargetComputeSizesClient { + return NewTargetComputeSizesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewTargetComputeSizesClientWithBaseURI creates an instance of the TargetComputeSizesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewTargetComputeSizesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) TargetComputeSizesClient { + return TargetComputeSizesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// ListByReplicationProtectedItems lists the available target compute sizes for a replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client TargetComputeSizesClient) ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result TargetComputeSizeCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizesClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.tcsc.Response.Response != nil { + sc = result.tcsc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectedItemsNextResults + req, err := client.ListByReplicationProtectedItemsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.tcsc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", resp, "Failure sending request") + return + } + + result.tcsc, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", resp, "Failure responding to request") + return + } + if result.tcsc.hasNextLink() && result.tcsc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectedItemsPreparer prepares the ListByReplicationProtectedItems request. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/targetComputeSizes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectedItemsSender sends the ListByReplicationProtectedItems request. The method will close the +// http.Response Body if it receives an error. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectedItemsResponder handles the response to the ListByReplicationProtectedItems request. The method always +// closes the http.Response Body. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsResponder(resp *http.Response) (result TargetComputeSizeCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectedItemsNextResults retrieves the next set of results, if any. +func (client TargetComputeSizesClient) listByReplicationProtectedItemsNextResults(ctx context.Context, lastResults TargetComputeSizeCollection) (result TargetComputeSizeCollection, err error) { + req, err := lastResults.targetComputeSizeCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectedItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result TargetComputeSizeCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizesClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectedItems(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + return +} diff --git a/services/recoveryservices/mgmt/2021-08-01/siterecovery/version.go b/services/recoveryservices/mgmt/2021-08-01/siterecovery/version.go new file mode 100644 index 000000000000..770d1bd82710 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-08-01/siterecovery/version.go @@ -0,0 +1,19 @@ +package siterecovery + +import "github.com/Azure/azure-sdk-for-go/version" + +// 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. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " siterecovery/2021-08-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/CHANGELOG.md b/services/recoveryservices/mgmt/2021-10-01/siterecovery/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/_meta.json b/services/recoveryservices/mgmt/2021-10-01/siterecovery/_meta.json new file mode 100644 index 000000000000..a23b21d7c0e7 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "16f5f98c30852b877949ea63418f609233470bf7", + "readme": "/_/azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.md", + "tag": "package-2021-10", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-10 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/client.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/client.go new file mode 100644 index 000000000000..6e770b1fe3ed --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/client.go @@ -0,0 +1,45 @@ +// Package siterecovery implements the Azure ARM Siterecovery service API version 2021-10-01. +// +// +package siterecovery + +// 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. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Siterecovery + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Siterecovery. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string + ResourceGroupName string + ResourceName string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string, resourceGroupName string, resourceName string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + ResourceGroupName: resourceGroupName, + ResourceName: resourceName, + } +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/enums.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/enums.go new file mode 100644 index 000000000000..8f7ef2c7c7a3 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/enums.go @@ -0,0 +1,1884 @@ +package siterecovery + +// 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. + +// A2ARecoveryAvailabilityType enumerates the values for a2a recovery availability type. +type A2ARecoveryAvailabilityType string + +const ( + // AvailabilitySet ... + AvailabilitySet A2ARecoveryAvailabilityType = "AvailabilitySet" + // AvailabilityZone ... + AvailabilityZone A2ARecoveryAvailabilityType = "AvailabilityZone" + // Single ... + Single A2ARecoveryAvailabilityType = "Single" +) + +// PossibleA2ARecoveryAvailabilityTypeValues returns an array of possible values for the A2ARecoveryAvailabilityType const type. +func PossibleA2ARecoveryAvailabilityTypeValues() []A2ARecoveryAvailabilityType { + return []A2ARecoveryAvailabilityType{AvailabilitySet, AvailabilityZone, Single} +} + +// A2ARpRecoveryPointType enumerates the values for a2a rp recovery point type. +type A2ARpRecoveryPointType string + +const ( + // Latest ... + Latest A2ARpRecoveryPointType = "Latest" + // LatestApplicationConsistent ... + LatestApplicationConsistent A2ARpRecoveryPointType = "LatestApplicationConsistent" + // LatestCrashConsistent ... + LatestCrashConsistent A2ARpRecoveryPointType = "LatestCrashConsistent" + // LatestProcessed ... + LatestProcessed A2ARpRecoveryPointType = "LatestProcessed" +) + +// PossibleA2ARpRecoveryPointTypeValues returns an array of possible values for the A2ARpRecoveryPointType const type. +func PossibleA2ARpRecoveryPointTypeValues() []A2ARpRecoveryPointType { + return []A2ARpRecoveryPointType{Latest, LatestApplicationConsistent, LatestCrashConsistent, LatestProcessed} +} + +// AgentAutoUpdateStatus enumerates the values for agent auto update status. +type AgentAutoUpdateStatus string + +const ( + // Disabled ... + Disabled AgentAutoUpdateStatus = "Disabled" + // Enabled ... + Enabled AgentAutoUpdateStatus = "Enabled" +) + +// PossibleAgentAutoUpdateStatusValues returns an array of possible values for the AgentAutoUpdateStatus const type. +func PossibleAgentAutoUpdateStatusValues() []AgentAutoUpdateStatus { + return []AgentAutoUpdateStatus{Disabled, Enabled} +} + +// AgentUpgradeBlockedReason enumerates the values for agent upgrade blocked reason. +type AgentUpgradeBlockedReason string + +const ( + // AgentNoHeartbeat ... + AgentNoHeartbeat AgentUpgradeBlockedReason = "AgentNoHeartbeat" + // AlreadyOnLatestVersion ... + AlreadyOnLatestVersion AgentUpgradeBlockedReason = "AlreadyOnLatestVersion" + // DistroIsNotReported ... + DistroIsNotReported AgentUpgradeBlockedReason = "DistroIsNotReported" + // DistroNotSupportedForUpgrade ... + DistroNotSupportedForUpgrade AgentUpgradeBlockedReason = "DistroNotSupportedForUpgrade" + // IncompatibleApplianceVersion ... + IncompatibleApplianceVersion AgentUpgradeBlockedReason = "IncompatibleApplianceVersion" + // InvalidAgentVersion ... + InvalidAgentVersion AgentUpgradeBlockedReason = "InvalidAgentVersion" + // InvalidDriverVersion ... + InvalidDriverVersion AgentUpgradeBlockedReason = "InvalidDriverVersion" + // MissingUpgradePath ... + MissingUpgradePath AgentUpgradeBlockedReason = "MissingUpgradePath" + // NotProtected ... + NotProtected AgentUpgradeBlockedReason = "NotProtected" + // ProcessServerNoHeartbeat ... + ProcessServerNoHeartbeat AgentUpgradeBlockedReason = "ProcessServerNoHeartbeat" + // RcmProxyNoHeartbeat ... + RcmProxyNoHeartbeat AgentUpgradeBlockedReason = "RcmProxyNoHeartbeat" + // RebootRequired ... + RebootRequired AgentUpgradeBlockedReason = "RebootRequired" + // Unknown ... + Unknown AgentUpgradeBlockedReason = "Unknown" + // UnsupportedProtectionScenario ... + UnsupportedProtectionScenario AgentUpgradeBlockedReason = "UnsupportedProtectionScenario" +) + +// PossibleAgentUpgradeBlockedReasonValues returns an array of possible values for the AgentUpgradeBlockedReason const type. +func PossibleAgentUpgradeBlockedReasonValues() []AgentUpgradeBlockedReason { + return []AgentUpgradeBlockedReason{AgentNoHeartbeat, AlreadyOnLatestVersion, DistroIsNotReported, DistroNotSupportedForUpgrade, IncompatibleApplianceVersion, InvalidAgentVersion, InvalidDriverVersion, MissingUpgradePath, NotProtected, ProcessServerNoHeartbeat, RcmProxyNoHeartbeat, RebootRequired, Unknown, UnsupportedProtectionScenario} +} + +// AgentVersionStatus enumerates the values for agent version status. +type AgentVersionStatus string + +const ( + // Deprecated ... + Deprecated AgentVersionStatus = "Deprecated" + // NotSupported ... + NotSupported AgentVersionStatus = "NotSupported" + // SecurityUpdateRequired ... + SecurityUpdateRequired AgentVersionStatus = "SecurityUpdateRequired" + // Supported ... + Supported AgentVersionStatus = "Supported" + // UpdateRequired ... + UpdateRequired AgentVersionStatus = "UpdateRequired" +) + +// PossibleAgentVersionStatusValues returns an array of possible values for the AgentVersionStatus const type. +func PossibleAgentVersionStatusValues() []AgentVersionStatus { + return []AgentVersionStatus{Deprecated, NotSupported, SecurityUpdateRequired, Supported, UpdateRequired} +} + +// AlternateLocationRecoveryOption enumerates the values for alternate location recovery option. +type AlternateLocationRecoveryOption string + +const ( + // CreateVMIfNotFound ... + CreateVMIfNotFound AlternateLocationRecoveryOption = "CreateVmIfNotFound" + // NoAction ... + NoAction AlternateLocationRecoveryOption = "NoAction" +) + +// PossibleAlternateLocationRecoveryOptionValues returns an array of possible values for the AlternateLocationRecoveryOption const type. +func PossibleAlternateLocationRecoveryOptionValues() []AlternateLocationRecoveryOption { + return []AlternateLocationRecoveryOption{CreateVMIfNotFound, NoAction} +} + +// AutomationAccountAuthenticationType enumerates the values for automation account authentication type. +type AutomationAccountAuthenticationType string + +const ( + // AutomationAccountAuthenticationTypeRunAsAccount ... + AutomationAccountAuthenticationTypeRunAsAccount AutomationAccountAuthenticationType = "RunAsAccount" + // AutomationAccountAuthenticationTypeSystemAssignedIdentity ... + AutomationAccountAuthenticationTypeSystemAssignedIdentity AutomationAccountAuthenticationType = "SystemAssignedIdentity" +) + +// PossibleAutomationAccountAuthenticationTypeValues returns an array of possible values for the AutomationAccountAuthenticationType const type. +func PossibleAutomationAccountAuthenticationTypeValues() []AutomationAccountAuthenticationType { + return []AutomationAccountAuthenticationType{AutomationAccountAuthenticationTypeRunAsAccount, AutomationAccountAuthenticationTypeSystemAssignedIdentity} +} + +// AutoProtectionOfDataDisk enumerates the values for auto protection of data disk. +type AutoProtectionOfDataDisk string + +const ( + // AutoProtectionOfDataDiskDisabled ... + AutoProtectionOfDataDiskDisabled AutoProtectionOfDataDisk = "Disabled" + // AutoProtectionOfDataDiskEnabled ... + AutoProtectionOfDataDiskEnabled AutoProtectionOfDataDisk = "Enabled" +) + +// PossibleAutoProtectionOfDataDiskValues returns an array of possible values for the AutoProtectionOfDataDisk const type. +func PossibleAutoProtectionOfDataDiskValues() []AutoProtectionOfDataDisk { + return []AutoProtectionOfDataDisk{AutoProtectionOfDataDiskDisabled, AutoProtectionOfDataDiskEnabled} +} + +// DataSyncStatus enumerates the values for data sync status. +type DataSyncStatus string + +const ( + // ForDownTime ... + ForDownTime DataSyncStatus = "ForDownTime" + // ForSynchronization ... + ForSynchronization DataSyncStatus = "ForSynchronization" +) + +// PossibleDataSyncStatusValues returns an array of possible values for the DataSyncStatus const type. +func PossibleDataSyncStatusValues() []DataSyncStatus { + return []DataSyncStatus{ForDownTime, ForSynchronization} +} + +// DisableProtectionReason enumerates the values for disable protection reason. +type DisableProtectionReason string + +const ( + // MigrationComplete ... + MigrationComplete DisableProtectionReason = "MigrationComplete" + // NotSpecified ... + NotSpecified DisableProtectionReason = "NotSpecified" +) + +// PossibleDisableProtectionReasonValues returns an array of possible values for the DisableProtectionReason const type. +func PossibleDisableProtectionReasonValues() []DisableProtectionReason { + return []DisableProtectionReason{MigrationComplete, NotSpecified} +} + +// DiskAccountType enumerates the values for disk account type. +type DiskAccountType string + +const ( + // PremiumLRS ... + PremiumLRS DiskAccountType = "Premium_LRS" + // StandardLRS ... + StandardLRS DiskAccountType = "Standard_LRS" + // StandardSSDLRS ... + StandardSSDLRS DiskAccountType = "StandardSSD_LRS" +) + +// PossibleDiskAccountTypeValues returns an array of possible values for the DiskAccountType const type. +func PossibleDiskAccountTypeValues() []DiskAccountType { + return []DiskAccountType{PremiumLRS, StandardLRS, StandardSSDLRS} +} + +// DiskReplicationProgressHealth enumerates the values for disk replication progress health. +type DiskReplicationProgressHealth string + +const ( + // InProgress ... + InProgress DiskReplicationProgressHealth = "InProgress" + // None ... + None DiskReplicationProgressHealth = "None" + // NoProgress ... + NoProgress DiskReplicationProgressHealth = "NoProgress" + // Queued ... + Queued DiskReplicationProgressHealth = "Queued" + // SlowProgress ... + SlowProgress DiskReplicationProgressHealth = "SlowProgress" +) + +// PossibleDiskReplicationProgressHealthValues returns an array of possible values for the DiskReplicationProgressHealth const type. +func PossibleDiskReplicationProgressHealthValues() []DiskReplicationProgressHealth { + return []DiskReplicationProgressHealth{InProgress, None, NoProgress, Queued, SlowProgress} +} + +// EthernetAddressType enumerates the values for ethernet address type. +type EthernetAddressType string + +const ( + // Dynamic ... + Dynamic EthernetAddressType = "Dynamic" + // Static ... + Static EthernetAddressType = "Static" +) + +// PossibleEthernetAddressTypeValues returns an array of possible values for the EthernetAddressType const type. +func PossibleEthernetAddressTypeValues() []EthernetAddressType { + return []EthernetAddressType{Dynamic, Static} +} + +// ExportJobOutputSerializationType enumerates the values for export job output serialization type. +type ExportJobOutputSerializationType string + +const ( + // Excel ... + Excel ExportJobOutputSerializationType = "Excel" + // JSON ... + JSON ExportJobOutputSerializationType = "Json" + // XML ... + XML ExportJobOutputSerializationType = "Xml" +) + +// PossibleExportJobOutputSerializationTypeValues returns an array of possible values for the ExportJobOutputSerializationType const type. +func PossibleExportJobOutputSerializationTypeValues() []ExportJobOutputSerializationType { + return []ExportJobOutputSerializationType{Excel, JSON, XML} +} + +// FailoverDeploymentModel enumerates the values for failover deployment model. +type FailoverDeploymentModel string + +const ( + // Classic ... + Classic FailoverDeploymentModel = "Classic" + // NotApplicable ... + NotApplicable FailoverDeploymentModel = "NotApplicable" + // ResourceManager ... + ResourceManager FailoverDeploymentModel = "ResourceManager" +) + +// PossibleFailoverDeploymentModelValues returns an array of possible values for the FailoverDeploymentModel const type. +func PossibleFailoverDeploymentModelValues() []FailoverDeploymentModel { + return []FailoverDeploymentModel{Classic, NotApplicable, ResourceManager} +} + +// HealthErrorCategory enumerates the values for health error category. +type HealthErrorCategory string + +const ( + // HealthErrorCategoryAgentAutoUpdateArtifactDeleted ... + HealthErrorCategoryAgentAutoUpdateArtifactDeleted HealthErrorCategory = "AgentAutoUpdateArtifactDeleted" + // HealthErrorCategoryAgentAutoUpdateInfra ... + HealthErrorCategoryAgentAutoUpdateInfra HealthErrorCategory = "AgentAutoUpdateInfra" + // HealthErrorCategoryAgentAutoUpdateRunAsAccount ... + HealthErrorCategoryAgentAutoUpdateRunAsAccount HealthErrorCategory = "AgentAutoUpdateRunAsAccount" + // HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired ... + HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired HealthErrorCategory = "AgentAutoUpdateRunAsAccountExpired" + // HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry ... + HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry HealthErrorCategory = "AgentAutoUpdateRunAsAccountExpiry" + // HealthErrorCategoryConfiguration ... + HealthErrorCategoryConfiguration HealthErrorCategory = "Configuration" + // HealthErrorCategoryFabricInfrastructure ... + HealthErrorCategoryFabricInfrastructure HealthErrorCategory = "FabricInfrastructure" + // HealthErrorCategoryNone ... + HealthErrorCategoryNone HealthErrorCategory = "None" + // HealthErrorCategoryReplication ... + HealthErrorCategoryReplication HealthErrorCategory = "Replication" + // HealthErrorCategoryTestFailover ... + HealthErrorCategoryTestFailover HealthErrorCategory = "TestFailover" + // HealthErrorCategoryVersionExpiry ... + HealthErrorCategoryVersionExpiry HealthErrorCategory = "VersionExpiry" +) + +// PossibleHealthErrorCategoryValues returns an array of possible values for the HealthErrorCategory const type. +func PossibleHealthErrorCategoryValues() []HealthErrorCategory { + return []HealthErrorCategory{HealthErrorCategoryAgentAutoUpdateArtifactDeleted, HealthErrorCategoryAgentAutoUpdateInfra, HealthErrorCategoryAgentAutoUpdateRunAsAccount, HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired, HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry, HealthErrorCategoryConfiguration, HealthErrorCategoryFabricInfrastructure, HealthErrorCategoryNone, HealthErrorCategoryReplication, HealthErrorCategoryTestFailover, HealthErrorCategoryVersionExpiry} +} + +// HealthErrorCustomerResolvability enumerates the values for health error customer resolvability. +type HealthErrorCustomerResolvability string + +const ( + // Allowed ... + Allowed HealthErrorCustomerResolvability = "Allowed" + // NotAllowed ... + NotAllowed HealthErrorCustomerResolvability = "NotAllowed" +) + +// PossibleHealthErrorCustomerResolvabilityValues returns an array of possible values for the HealthErrorCustomerResolvability const type. +func PossibleHealthErrorCustomerResolvabilityValues() []HealthErrorCustomerResolvability { + return []HealthErrorCustomerResolvability{Allowed, NotAllowed} +} + +// HyperVReplicaAzureRpRecoveryPointType enumerates the values for hyper v replica azure rp recovery point +// type. +type HyperVReplicaAzureRpRecoveryPointType string + +const ( + // HyperVReplicaAzureRpRecoveryPointTypeLatest ... + HyperVReplicaAzureRpRecoveryPointTypeLatest HyperVReplicaAzureRpRecoveryPointType = "Latest" + // HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent ... + HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent HyperVReplicaAzureRpRecoveryPointType = "LatestApplicationConsistent" + // HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed ... + HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed HyperVReplicaAzureRpRecoveryPointType = "LatestProcessed" +) + +// PossibleHyperVReplicaAzureRpRecoveryPointTypeValues returns an array of possible values for the HyperVReplicaAzureRpRecoveryPointType const type. +func PossibleHyperVReplicaAzureRpRecoveryPointTypeValues() []HyperVReplicaAzureRpRecoveryPointType { + return []HyperVReplicaAzureRpRecoveryPointType{HyperVReplicaAzureRpRecoveryPointTypeLatest, HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent, HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed} +} + +// InMageRcmFailbackRecoveryPointType enumerates the values for in mage rcm failback recovery point type. +type InMageRcmFailbackRecoveryPointType string + +const ( + // ApplicationConsistent ... + ApplicationConsistent InMageRcmFailbackRecoveryPointType = "ApplicationConsistent" + // CrashConsistent ... + CrashConsistent InMageRcmFailbackRecoveryPointType = "CrashConsistent" +) + +// PossibleInMageRcmFailbackRecoveryPointTypeValues returns an array of possible values for the InMageRcmFailbackRecoveryPointType const type. +func PossibleInMageRcmFailbackRecoveryPointTypeValues() []InMageRcmFailbackRecoveryPointType { + return []InMageRcmFailbackRecoveryPointType{ApplicationConsistent, CrashConsistent} +} + +// InMageV2RpRecoveryPointType enumerates the values for in mage v2 rp recovery point type. +type InMageV2RpRecoveryPointType string + +const ( + // InMageV2RpRecoveryPointTypeLatest ... + InMageV2RpRecoveryPointTypeLatest InMageV2RpRecoveryPointType = "Latest" + // InMageV2RpRecoveryPointTypeLatestApplicationConsistent ... + InMageV2RpRecoveryPointTypeLatestApplicationConsistent InMageV2RpRecoveryPointType = "LatestApplicationConsistent" + // InMageV2RpRecoveryPointTypeLatestCrashConsistent ... + InMageV2RpRecoveryPointTypeLatestCrashConsistent InMageV2RpRecoveryPointType = "LatestCrashConsistent" + // InMageV2RpRecoveryPointTypeLatestProcessed ... + InMageV2RpRecoveryPointTypeLatestProcessed InMageV2RpRecoveryPointType = "LatestProcessed" +) + +// PossibleInMageV2RpRecoveryPointTypeValues returns an array of possible values for the InMageV2RpRecoveryPointType const type. +func PossibleInMageV2RpRecoveryPointTypeValues() []InMageV2RpRecoveryPointType { + return []InMageV2RpRecoveryPointType{InMageV2RpRecoveryPointTypeLatest, InMageV2RpRecoveryPointTypeLatestApplicationConsistent, InMageV2RpRecoveryPointTypeLatestCrashConsistent, InMageV2RpRecoveryPointTypeLatestProcessed} +} + +// InstanceType enumerates the values for instance type. +type InstanceType string + +const ( + // InstanceTypeA2A ... + InstanceTypeA2A InstanceType = "A2A" + // InstanceTypeAddDisksProviderSpecificInput ... + InstanceTypeAddDisksProviderSpecificInput InstanceType = "AddDisksProviderSpecificInput" +) + +// PossibleInstanceTypeValues returns an array of possible values for the InstanceType const type. +func PossibleInstanceTypeValues() []InstanceType { + return []InstanceType{InstanceTypeA2A, InstanceTypeAddDisksProviderSpecificInput} +} + +// InstanceTypeBasicApplyRecoveryPointProviderSpecificInput enumerates the values for instance type basic apply +// recovery point provider specific input. +type InstanceTypeBasicApplyRecoveryPointProviderSpecificInput string + +const ( + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "A2A" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "ApplyRecoveryPointProviderSpecificInput" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "InMageRcm" +) + +// PossibleInstanceTypeBasicApplyRecoveryPointProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicApplyRecoveryPointProviderSpecificInput const type. +func PossibleInstanceTypeBasicApplyRecoveryPointProviderSpecificInputValues() []InstanceTypeBasicApplyRecoveryPointProviderSpecificInput { + return []InstanceTypeBasicApplyRecoveryPointProviderSpecificInput{InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm} +} + +// InstanceTypeBasicConfigurationSettings enumerates the values for instance type basic configuration settings. +type InstanceTypeBasicConfigurationSettings string + +const ( + // InstanceTypeConfigurationSettings ... + InstanceTypeConfigurationSettings InstanceTypeBasicConfigurationSettings = "ConfigurationSettings" + // InstanceTypeHyperVVirtualMachine ... + InstanceTypeHyperVVirtualMachine InstanceTypeBasicConfigurationSettings = "HyperVVirtualMachine" + // InstanceTypeReplicationGroupDetails ... + InstanceTypeReplicationGroupDetails InstanceTypeBasicConfigurationSettings = "ReplicationGroupDetails" + // InstanceTypeVmmVirtualMachine ... + InstanceTypeVmmVirtualMachine InstanceTypeBasicConfigurationSettings = "VmmVirtualMachine" + // InstanceTypeVMwareVirtualMachine ... + InstanceTypeVMwareVirtualMachine InstanceTypeBasicConfigurationSettings = "VMwareVirtualMachine" +) + +// PossibleInstanceTypeBasicConfigurationSettingsValues returns an array of possible values for the InstanceTypeBasicConfigurationSettings const type. +func PossibleInstanceTypeBasicConfigurationSettingsValues() []InstanceTypeBasicConfigurationSettings { + return []InstanceTypeBasicConfigurationSettings{InstanceTypeConfigurationSettings, InstanceTypeHyperVVirtualMachine, InstanceTypeReplicationGroupDetails, InstanceTypeVmmVirtualMachine, InstanceTypeVMwareVirtualMachine} +} + +// InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails enumerates the values for instance type basic +// create protection intent provider specific details. +type InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails string + +const ( + // InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails = "A2A" + // InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails ... + InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails = "CreateProtectionIntentProviderSpecificDetails" +) + +// PossibleInstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails const type. +func PossibleInstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsValues() []InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails { + return []InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails{InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails} +} + +// InstanceTypeBasicDisableProtectionProviderSpecificInput enumerates the values for instance type basic +// disable protection provider specific input. +type InstanceTypeBasicDisableProtectionProviderSpecificInput string + +const ( + // InstanceTypeDisableProtectionProviderSpecificInput ... + InstanceTypeDisableProtectionProviderSpecificInput InstanceTypeBasicDisableProtectionProviderSpecificInput = "DisableProtectionProviderSpecificInput" + // InstanceTypeInMage ... + InstanceTypeInMage InstanceTypeBasicDisableProtectionProviderSpecificInput = "InMage" +) + +// PossibleInstanceTypeBasicDisableProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicDisableProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicDisableProtectionProviderSpecificInputValues() []InstanceTypeBasicDisableProtectionProviderSpecificInput { + return []InstanceTypeBasicDisableProtectionProviderSpecificInput{InstanceTypeDisableProtectionProviderSpecificInput, InstanceTypeInMage} +} + +// InstanceTypeBasicEnableMigrationProviderSpecificInput enumerates the values for instance type basic enable +// migration provider specific input. +type InstanceTypeBasicEnableMigrationProviderSpecificInput string + +const ( + // InstanceTypeEnableMigrationProviderSpecificInput ... + InstanceTypeEnableMigrationProviderSpecificInput InstanceTypeBasicEnableMigrationProviderSpecificInput = "EnableMigrationProviderSpecificInput" + // InstanceTypeVMwareCbt ... + InstanceTypeVMwareCbt InstanceTypeBasicEnableMigrationProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicEnableMigrationProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicEnableMigrationProviderSpecificInput const type. +func PossibleInstanceTypeBasicEnableMigrationProviderSpecificInputValues() []InstanceTypeBasicEnableMigrationProviderSpecificInput { + return []InstanceTypeBasicEnableMigrationProviderSpecificInput{InstanceTypeEnableMigrationProviderSpecificInput, InstanceTypeVMwareCbt} +} + +// InstanceTypeBasicEnableProtectionProviderSpecificInput enumerates the values for instance type basic enable +// protection provider specific input. +type InstanceTypeBasicEnableProtectionProviderSpecificInput string + +const ( + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A InstanceTypeBasicEnableProtectionProviderSpecificInput = "A2A" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicEnableProtectionProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput InstanceTypeBasicEnableProtectionProviderSpecificInput = "EnableProtectionProviderSpecificInput" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicEnableProtectionProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMage" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMageRcm" +) + +// PossibleInstanceTypeBasicEnableProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicEnableProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicEnableProtectionProviderSpecificInputValues() []InstanceTypeBasicEnableProtectionProviderSpecificInput { + return []InstanceTypeBasicEnableProtectionProviderSpecificInput{InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm} +} + +// InstanceTypeBasicEventProviderSpecificDetails enumerates the values for instance type basic event provider +// specific details. +type InstanceTypeBasicEventProviderSpecificDetails string + +const ( + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicEventProviderSpecificDetails = "A2A" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails InstanceTypeBasicEventProviderSpecificDetails = "EventProviderSpecificDetails" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplica2012" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplica2012R2" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplicaAzure" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplicaBaseEventDetails" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicEventProviderSpecificDetails = "InMageAzureV2" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicEventProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback InstanceTypeBasicEventProviderSpecificDetails = "InMageRcmFailback" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicEventProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicEventProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicEventProviderSpecificDetails const type. +func PossibleInstanceTypeBasicEventProviderSpecificDetailsValues() []InstanceTypeBasicEventProviderSpecificDetails { + return []InstanceTypeBasicEventProviderSpecificDetails{InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicEventSpecificDetails enumerates the values for instance type basic event specific details. +type InstanceTypeBasicEventSpecificDetails string + +const ( + // InstanceTypeEventSpecificDetails ... + InstanceTypeEventSpecificDetails InstanceTypeBasicEventSpecificDetails = "EventSpecificDetails" + // InstanceTypeJobStatus ... + InstanceTypeJobStatus InstanceTypeBasicEventSpecificDetails = "JobStatus" +) + +// PossibleInstanceTypeBasicEventSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicEventSpecificDetails const type. +func PossibleInstanceTypeBasicEventSpecificDetailsValues() []InstanceTypeBasicEventSpecificDetails { + return []InstanceTypeBasicEventSpecificDetails{InstanceTypeEventSpecificDetails, InstanceTypeJobStatus} +} + +// InstanceTypeBasicFabricSpecificCreateNetworkMappingInput enumerates the values for instance type basic +// fabric specific create network mapping input. +type InstanceTypeBasicFabricSpecificCreateNetworkMappingInput string + +const ( + // InstanceTypeAzureToAzure ... + InstanceTypeAzureToAzure InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "AzureToAzure" + // InstanceTypeFabricSpecificCreateNetworkMappingInput ... + InstanceTypeFabricSpecificCreateNetworkMappingInput InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "FabricSpecificCreateNetworkMappingInput" + // InstanceTypeVmmToAzure ... + InstanceTypeVmmToAzure InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "VmmToAzure" + // InstanceTypeVmmToVmm ... + InstanceTypeVmmToVmm InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "VmmToVmm" +) + +// PossibleInstanceTypeBasicFabricSpecificCreateNetworkMappingInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificCreateNetworkMappingInput const type. +func PossibleInstanceTypeBasicFabricSpecificCreateNetworkMappingInputValues() []InstanceTypeBasicFabricSpecificCreateNetworkMappingInput { + return []InstanceTypeBasicFabricSpecificCreateNetworkMappingInput{InstanceTypeAzureToAzure, InstanceTypeFabricSpecificCreateNetworkMappingInput, InstanceTypeVmmToAzure, InstanceTypeVmmToVmm} +} + +// InstanceTypeBasicFabricSpecificCreationInput enumerates the values for instance type basic fabric specific +// creation input. +type InstanceTypeBasicFabricSpecificCreationInput string + +const ( + // InstanceTypeAzure ... + InstanceTypeAzure InstanceTypeBasicFabricSpecificCreationInput = "Azure" + // InstanceTypeFabricSpecificCreationInput ... + InstanceTypeFabricSpecificCreationInput InstanceTypeBasicFabricSpecificCreationInput = "FabricSpecificCreationInput" + // InstanceTypeInMageRcm ... + InstanceTypeInMageRcm InstanceTypeBasicFabricSpecificCreationInput = "InMageRcm" + // InstanceTypeVMwareV2 ... + InstanceTypeVMwareV2 InstanceTypeBasicFabricSpecificCreationInput = "VMwareV2" +) + +// PossibleInstanceTypeBasicFabricSpecificCreationInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificCreationInput const type. +func PossibleInstanceTypeBasicFabricSpecificCreationInputValues() []InstanceTypeBasicFabricSpecificCreationInput { + return []InstanceTypeBasicFabricSpecificCreationInput{InstanceTypeAzure, InstanceTypeFabricSpecificCreationInput, InstanceTypeInMageRcm, InstanceTypeVMwareV2} +} + +// InstanceTypeBasicFabricSpecificDetails enumerates the values for instance type basic fabric specific +// details. +type InstanceTypeBasicFabricSpecificDetails string + +const ( + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure InstanceTypeBasicFabricSpecificDetails = "Azure" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails InstanceTypeBasicFabricSpecificDetails = "FabricSpecificDetails" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite InstanceTypeBasicFabricSpecificDetails = "HyperVSite" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicFabricSpecificDetails = "InMageRcm" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM InstanceTypeBasicFabricSpecificDetails = "VMM" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware InstanceTypeBasicFabricSpecificDetails = "VMware" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 InstanceTypeBasicFabricSpecificDetails = "VMwareV2" +) + +// PossibleInstanceTypeBasicFabricSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicFabricSpecificDetails const type. +func PossibleInstanceTypeBasicFabricSpecificDetailsValues() []InstanceTypeBasicFabricSpecificDetails { + return []InstanceTypeBasicFabricSpecificDetails{InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure, InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails, InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite, InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2} +} + +// InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput enumerates the values for instance type basic +// fabric specific update network mapping input. +type InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput string + +const ( + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "AzureToAzure" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "FabricSpecificUpdateNetworkMappingInput" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "VmmToAzure" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "VmmToVmm" +) + +// PossibleInstanceTypeBasicFabricSpecificUpdateNetworkMappingInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput const type. +func PossibleInstanceTypeBasicFabricSpecificUpdateNetworkMappingInputValues() []InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput { + return []InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput{InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm} +} + +// InstanceTypeBasicGroupTaskDetails enumerates the values for instance type basic group task details. +type InstanceTypeBasicGroupTaskDetails string + +const ( + // InstanceTypeGroupTaskDetails ... + InstanceTypeGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "GroupTaskDetails" + // InstanceTypeInlineWorkflowTaskDetails ... + InstanceTypeInlineWorkflowTaskDetails InstanceTypeBasicGroupTaskDetails = "InlineWorkflowTaskDetails" + // InstanceTypeRecoveryPlanGroupTaskDetails ... + InstanceTypeRecoveryPlanGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "RecoveryPlanGroupTaskDetails" + // InstanceTypeRecoveryPlanShutdownGroupTaskDetails ... + InstanceTypeRecoveryPlanShutdownGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "RecoveryPlanShutdownGroupTaskDetails" +) + +// PossibleInstanceTypeBasicGroupTaskDetailsValues returns an array of possible values for the InstanceTypeBasicGroupTaskDetails const type. +func PossibleInstanceTypeBasicGroupTaskDetailsValues() []InstanceTypeBasicGroupTaskDetails { + return []InstanceTypeBasicGroupTaskDetails{InstanceTypeGroupTaskDetails, InstanceTypeInlineWorkflowTaskDetails, InstanceTypeRecoveryPlanGroupTaskDetails, InstanceTypeRecoveryPlanShutdownGroupTaskDetails} +} + +// InstanceTypeBasicJobDetails enumerates the values for instance type basic job details. +type InstanceTypeBasicJobDetails string + +const ( + // InstanceTypeAsrJobDetails ... + InstanceTypeAsrJobDetails InstanceTypeBasicJobDetails = "AsrJobDetails" + // InstanceTypeExportJobDetails ... + InstanceTypeExportJobDetails InstanceTypeBasicJobDetails = "ExportJobDetails" + // InstanceTypeFailoverJobDetails ... + InstanceTypeFailoverJobDetails InstanceTypeBasicJobDetails = "FailoverJobDetails" + // InstanceTypeJobDetails ... + InstanceTypeJobDetails InstanceTypeBasicJobDetails = "JobDetails" + // InstanceTypeSwitchProtectionJobDetails ... + InstanceTypeSwitchProtectionJobDetails InstanceTypeBasicJobDetails = "SwitchProtectionJobDetails" + // InstanceTypeTestFailoverJobDetails ... + InstanceTypeTestFailoverJobDetails InstanceTypeBasicJobDetails = "TestFailoverJobDetails" +) + +// PossibleInstanceTypeBasicJobDetailsValues returns an array of possible values for the InstanceTypeBasicJobDetails const type. +func PossibleInstanceTypeBasicJobDetailsValues() []InstanceTypeBasicJobDetails { + return []InstanceTypeBasicJobDetails{InstanceTypeAsrJobDetails, InstanceTypeExportJobDetails, InstanceTypeFailoverJobDetails, InstanceTypeJobDetails, InstanceTypeSwitchProtectionJobDetails, InstanceTypeTestFailoverJobDetails} +} + +// InstanceTypeBasicMigrateProviderSpecificInput enumerates the values for instance type basic migrate provider +// specific input. +type InstanceTypeBasicMigrateProviderSpecificInput string + +const ( + // InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput ... + InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput InstanceTypeBasicMigrateProviderSpecificInput = "MigrateProviderSpecificInput" + // InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicMigrateProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicMigrateProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicMigrateProviderSpecificInput const type. +func PossibleInstanceTypeBasicMigrateProviderSpecificInputValues() []InstanceTypeBasicMigrateProviderSpecificInput { + return []InstanceTypeBasicMigrateProviderSpecificInput{InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput, InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicMigrationProviderSpecificSettings enumerates the values for instance type basic migration +// provider specific settings. +type InstanceTypeBasicMigrationProviderSpecificSettings string + +const ( + // InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings ... + InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings InstanceTypeBasicMigrationProviderSpecificSettings = "MigrationProviderSpecificSettings" + // InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt ... + InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt InstanceTypeBasicMigrationProviderSpecificSettings = "VMwareCbt" +) + +// PossibleInstanceTypeBasicMigrationProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicMigrationProviderSpecificSettings const type. +func PossibleInstanceTypeBasicMigrationProviderSpecificSettingsValues() []InstanceTypeBasicMigrationProviderSpecificSettings { + return []InstanceTypeBasicMigrationProviderSpecificSettings{InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings, InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicNetworkMappingFabricSpecificSettings enumerates the values for instance type basic network +// mapping fabric specific settings. +type InstanceTypeBasicNetworkMappingFabricSpecificSettings string + +const ( + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure InstanceTypeBasicNetworkMappingFabricSpecificSettings = "AzureToAzure" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings InstanceTypeBasicNetworkMappingFabricSpecificSettings = "NetworkMappingFabricSpecificSettings" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure InstanceTypeBasicNetworkMappingFabricSpecificSettings = "VmmToAzure" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm InstanceTypeBasicNetworkMappingFabricSpecificSettings = "VmmToVmm" +) + +// PossibleInstanceTypeBasicNetworkMappingFabricSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicNetworkMappingFabricSpecificSettings const type. +func PossibleInstanceTypeBasicNetworkMappingFabricSpecificSettingsValues() []InstanceTypeBasicNetworkMappingFabricSpecificSettings { + return []InstanceTypeBasicNetworkMappingFabricSpecificSettings{InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm} +} + +// InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput enumerates the values for instance type basic +// planned failover provider specific failover input. +type InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput string + +const ( + // InstanceTypeHyperVReplicaAzure ... + InstanceTypeHyperVReplicaAzure InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "HyperVReplicaAzure" + // InstanceTypeHyperVReplicaAzureFailback ... + InstanceTypeHyperVReplicaAzureFailback InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "HyperVReplicaAzureFailback" + // InstanceTypeInMageRcmFailback ... + InstanceTypeInMageRcmFailback InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "InMageRcmFailback" + // InstanceTypePlannedFailoverProviderSpecificFailoverInput ... + InstanceTypePlannedFailoverProviderSpecificFailoverInput InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "PlannedFailoverProviderSpecificFailoverInput" +) + +// PossibleInstanceTypeBasicPlannedFailoverProviderSpecificFailoverInputValues returns an array of possible values for the InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput const type. +func PossibleInstanceTypeBasicPlannedFailoverProviderSpecificFailoverInputValues() []InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput { + return []InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput{InstanceTypeHyperVReplicaAzure, InstanceTypeHyperVReplicaAzureFailback, InstanceTypeInMageRcmFailback, InstanceTypePlannedFailoverProviderSpecificFailoverInput} +} + +// InstanceTypeBasicPolicyProviderSpecificDetails enumerates the values for instance type basic policy provider +// specific details. +type InstanceTypeBasicPolicyProviderSpecificDetails string + +const ( + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicPolicyProviderSpecificDetails = "A2A" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplica2012" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplica2012R2" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplicaAzure" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplicaBasePolicyDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage InstanceTypeBasicPolicyProviderSpecificDetails = "InMage" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicPolicyProviderSpecificDetails = "InMageAzureV2" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails InstanceTypeBasicPolicyProviderSpecificDetails = "InMageBasePolicyDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicPolicyProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback InstanceTypeBasicPolicyProviderSpecificDetails = "InMageRcmFailback" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails InstanceTypeBasicPolicyProviderSpecificDetails = "PolicyProviderSpecificDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicPolicyProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicPolicyProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicPolicyProviderSpecificDetails const type. +func PossibleInstanceTypeBasicPolicyProviderSpecificDetailsValues() []InstanceTypeBasicPolicyProviderSpecificDetails { + return []InstanceTypeBasicPolicyProviderSpecificDetails{InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicPolicyProviderSpecificInput enumerates the values for instance type basic policy provider +// specific input. +type InstanceTypeBasicPolicyProviderSpecificInput string + +const ( + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A InstanceTypeBasicPolicyProviderSpecificInput = "A2A" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicPolicyProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplica2012" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplica2012R2" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage InstanceTypeBasicPolicyProviderSpecificInput = "InMage" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicPolicyProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicPolicyProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback InstanceTypeBasicPolicyProviderSpecificInput = "InMageRcmFailback" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput InstanceTypeBasicPolicyProviderSpecificInput = "PolicyProviderSpecificInput" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicPolicyProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicPolicyProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicPolicyProviderSpecificInput const type. +func PossibleInstanceTypeBasicPolicyProviderSpecificInputValues() []InstanceTypeBasicPolicyProviderSpecificInput { + return []InstanceTypeBasicPolicyProviderSpecificInput{InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails enumerates the values for instance type +// basic protection container mapping provider specific details. +type InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails string + +const ( + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "A2A" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "ProtectionContainerMappingProviderSpecificDetails" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails const type. +func PossibleInstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsValues() []InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails { + return []InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails{InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicProviderSpecificRecoveryPointDetails enumerates the values for instance type basic provider +// specific recovery point details. +type InstanceTypeBasicProviderSpecificRecoveryPointDetails string + +const ( + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A InstanceTypeBasicProviderSpecificRecoveryPointDetails = "A2A" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicProviderSpecificRecoveryPointDetails = "InMageAzureV2" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm InstanceTypeBasicProviderSpecificRecoveryPointDetails = "InMageRcm" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails InstanceTypeBasicProviderSpecificRecoveryPointDetails = "ProviderSpecificRecoveryPointDetails" +) + +// PossibleInstanceTypeBasicProviderSpecificRecoveryPointDetailsValues returns an array of possible values for the InstanceTypeBasicProviderSpecificRecoveryPointDetails const type. +func PossibleInstanceTypeBasicProviderSpecificRecoveryPointDetailsValues() []InstanceTypeBasicProviderSpecificRecoveryPointDetails { + return []InstanceTypeBasicProviderSpecificRecoveryPointDetails{InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails} +} + +// InstanceTypeBasicRecoveryPlanActionDetails enumerates the values for instance type basic recovery plan +// action details. +type InstanceTypeBasicRecoveryPlanActionDetails string + +const ( + // InstanceTypeAutomationRunbookActionDetails ... + InstanceTypeAutomationRunbookActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "AutomationRunbookActionDetails" + // InstanceTypeManualActionDetails ... + InstanceTypeManualActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "ManualActionDetails" + // InstanceTypeRecoveryPlanActionDetails ... + InstanceTypeRecoveryPlanActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "RecoveryPlanActionDetails" + // InstanceTypeScriptActionDetails ... + InstanceTypeScriptActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "ScriptActionDetails" +) + +// PossibleInstanceTypeBasicRecoveryPlanActionDetailsValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanActionDetails const type. +func PossibleInstanceTypeBasicRecoveryPlanActionDetailsValues() []InstanceTypeBasicRecoveryPlanActionDetails { + return []InstanceTypeBasicRecoveryPlanActionDetails{InstanceTypeAutomationRunbookActionDetails, InstanceTypeManualActionDetails, InstanceTypeRecoveryPlanActionDetails, InstanceTypeScriptActionDetails} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificDetails enumerates the values for instance type basic recovery +// plan provider specific details. +type InstanceTypeBasicRecoveryPlanProviderSpecificDetails string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificDetails = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails ... + InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails InstanceTypeBasicRecoveryPlanProviderSpecificDetails = "RecoveryPlanProviderSpecificDetails" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificDetails const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificDetailsValues() []InstanceTypeBasicRecoveryPlanProviderSpecificDetails { + return []InstanceTypeBasicRecoveryPlanProviderSpecificDetails{InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput enumerates the values for instance type basic +// recovery plan provider specific failover input. +type InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "HyperVReplicaAzure" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "HyperVReplicaAzureFailback" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMage" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageAzureV2" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageRcm" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageRcmFailback" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "RecoveryPlanProviderSpecificFailoverInput" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputValues() []InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput { + return []InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput{InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificInput enumerates the values for instance type basic recovery +// plan provider specific input. +type InstanceTypeBasicRecoveryPlanProviderSpecificInput string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificInput = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput ... + InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput InstanceTypeBasicRecoveryPlanProviderSpecificInput = "RecoveryPlanProviderSpecificInput" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificInput const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificInputValues() []InstanceTypeBasicRecoveryPlanProviderSpecificInput { + return []InstanceTypeBasicRecoveryPlanProviderSpecificInput{InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput} +} + +// InstanceTypeBasicRemoveDisksProviderSpecificInput enumerates the values for instance type basic remove disks +// provider specific input. +type InstanceTypeBasicRemoveDisksProviderSpecificInput string + +const ( + // InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A InstanceTypeBasicRemoveDisksProviderSpecificInput = "A2A" + // InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput ... + InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput InstanceTypeBasicRemoveDisksProviderSpecificInput = "RemoveDisksProviderSpecificInput" +) + +// PossibleInstanceTypeBasicRemoveDisksProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicRemoveDisksProviderSpecificInput const type. +func PossibleInstanceTypeBasicRemoveDisksProviderSpecificInputValues() []InstanceTypeBasicRemoveDisksProviderSpecificInput { + return []InstanceTypeBasicRemoveDisksProviderSpecificInput{InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput} +} + +// InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings enumerates the values for instance type +// basic replication protection intent provider specific settings. +type InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings string + +const ( + // InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A ... + InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings = "A2A" + // InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings ... + InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings = "ReplicationProtectionIntentProviderSpecificSettings" +) + +// PossibleInstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings const type. +func PossibleInstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsValues() []InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings { + return []InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings{InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A, InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings} +} + +// InstanceTypeBasicReplicationProviderSpecificContainerCreationInput enumerates the values for instance type +// basic replication provider specific container creation input. +type InstanceTypeBasicReplicationProviderSpecificContainerCreationInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "A2ACrossClusterMigration" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "ReplicationProviderSpecificContainerCreationInput" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificContainerCreationInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificContainerCreationInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificContainerCreationInputValues() []InstanceTypeBasicReplicationProviderSpecificContainerCreationInput { + return []InstanceTypeBasicReplicationProviderSpecificContainerCreationInput{InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReplicationProviderSpecificContainerMappingInput enumerates the values for instance type +// basic replication provider specific container mapping input. +type InstanceTypeBasicReplicationProviderSpecificContainerMappingInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "ReplicationProviderSpecificContainerMappingInput" + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificContainerMappingInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificContainerMappingInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificContainerMappingInputValues() []InstanceTypeBasicReplicationProviderSpecificContainerMappingInput { + return []InstanceTypeBasicReplicationProviderSpecificContainerMappingInput{InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput, InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReplicationProviderSpecificSettings enumerates the values for instance type basic +// replication provider specific settings. +type InstanceTypeBasicReplicationProviderSpecificSettings string + +const ( + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificSettings = "A2A" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration InstanceTypeBasicReplicationProviderSpecificSettings = "A2ACrossClusterMigration" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplica2012" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplica2012R2" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplicaAzure" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplicaBaseReplicationDetails" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage InstanceTypeBasicReplicationProviderSpecificSettings = "InMage" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 InstanceTypeBasicReplicationProviderSpecificSettings = "InMageAzureV2" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm InstanceTypeBasicReplicationProviderSpecificSettings = "InMageRcm" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback InstanceTypeBasicReplicationProviderSpecificSettings = "InMageRcmFailback" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings InstanceTypeBasicReplicationProviderSpecificSettings = "ReplicationProviderSpecificSettings" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificSettings const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificSettingsValues() []InstanceTypeBasicReplicationProviderSpecificSettings { + return []InstanceTypeBasicReplicationProviderSpecificSettings{InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings} +} + +// InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput enumerates the values for instance +// type basic replication provider specific update container mapping input. +type InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "InMageRcm" + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "ReplicationProviderSpecificUpdateContainerMappingInput" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputValues() []InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput { + return []InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput{InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm, InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput} +} + +// InstanceTypeBasicResyncProviderSpecificInput enumerates the values for instance type basic resync provider +// specific input. +type InstanceTypeBasicResyncProviderSpecificInput string + +const ( + // InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput ... + InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput InstanceTypeBasicResyncProviderSpecificInput = "ResyncProviderSpecificInput" + // InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicResyncProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicResyncProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicResyncProviderSpecificInput const type. +func PossibleInstanceTypeBasicResyncProviderSpecificInputValues() []InstanceTypeBasicResyncProviderSpecificInput { + return []InstanceTypeBasicResyncProviderSpecificInput{InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput, InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReverseReplicationProviderSpecificInput enumerates the values for instance type basic +// reverse replication provider specific input. +type InstanceTypeBasicReverseReplicationProviderSpecificInput string + +const ( + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A InstanceTypeBasicReverseReplicationProviderSpecificInput = "A2A" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicReverseReplicationProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMage" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageRcmFailback" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput InstanceTypeBasicReverseReplicationProviderSpecificInput = "ReverseReplicationProviderSpecificInput" +) + +// PossibleInstanceTypeBasicReverseReplicationProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicReverseReplicationProviderSpecificInput const type. +func PossibleInstanceTypeBasicReverseReplicationProviderSpecificInputValues() []InstanceTypeBasicReverseReplicationProviderSpecificInput { + return []InstanceTypeBasicReverseReplicationProviderSpecificInput{InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput} +} + +// InstanceTypeBasicSwitchProtectionProviderSpecificInput enumerates the values for instance type basic switch +// protection provider specific input. +type InstanceTypeBasicSwitchProtectionProviderSpecificInput string + +const ( + // InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A InstanceTypeBasicSwitchProtectionProviderSpecificInput = "A2A" + // InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput ... + InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput InstanceTypeBasicSwitchProtectionProviderSpecificInput = "SwitchProtectionProviderSpecificInput" +) + +// PossibleInstanceTypeBasicSwitchProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicSwitchProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicSwitchProtectionProviderSpecificInputValues() []InstanceTypeBasicSwitchProtectionProviderSpecificInput { + return []InstanceTypeBasicSwitchProtectionProviderSpecificInput{InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput} +} + +// InstanceTypeBasicTaskTypeDetails enumerates the values for instance type basic task type details. +type InstanceTypeBasicTaskTypeDetails string + +const ( + // InstanceTypeAutomationRunbookTaskDetails ... + InstanceTypeAutomationRunbookTaskDetails InstanceTypeBasicTaskTypeDetails = "AutomationRunbookTaskDetails" + // InstanceTypeConsistencyCheckTaskDetails ... + InstanceTypeConsistencyCheckTaskDetails InstanceTypeBasicTaskTypeDetails = "ConsistencyCheckTaskDetails" + // InstanceTypeFabricReplicationGroupTaskDetails ... + InstanceTypeFabricReplicationGroupTaskDetails InstanceTypeBasicTaskTypeDetails = "FabricReplicationGroupTaskDetails" + // InstanceTypeJobTaskDetails ... + InstanceTypeJobTaskDetails InstanceTypeBasicTaskTypeDetails = "JobTaskDetails" + // InstanceTypeManualActionTaskDetails ... + InstanceTypeManualActionTaskDetails InstanceTypeBasicTaskTypeDetails = "ManualActionTaskDetails" + // InstanceTypeScriptActionTaskDetails ... + InstanceTypeScriptActionTaskDetails InstanceTypeBasicTaskTypeDetails = "ScriptActionTaskDetails" + // InstanceTypeTaskTypeDetails ... + InstanceTypeTaskTypeDetails InstanceTypeBasicTaskTypeDetails = "TaskTypeDetails" + // InstanceTypeVirtualMachineTaskDetails ... + InstanceTypeVirtualMachineTaskDetails InstanceTypeBasicTaskTypeDetails = "VirtualMachineTaskDetails" + // InstanceTypeVMNicUpdatesTaskDetails ... + InstanceTypeVMNicUpdatesTaskDetails InstanceTypeBasicTaskTypeDetails = "VmNicUpdatesTaskDetails" +) + +// PossibleInstanceTypeBasicTaskTypeDetailsValues returns an array of possible values for the InstanceTypeBasicTaskTypeDetails const type. +func PossibleInstanceTypeBasicTaskTypeDetailsValues() []InstanceTypeBasicTaskTypeDetails { + return []InstanceTypeBasicTaskTypeDetails{InstanceTypeAutomationRunbookTaskDetails, InstanceTypeConsistencyCheckTaskDetails, InstanceTypeFabricReplicationGroupTaskDetails, InstanceTypeJobTaskDetails, InstanceTypeManualActionTaskDetails, InstanceTypeScriptActionTaskDetails, InstanceTypeTaskTypeDetails, InstanceTypeVirtualMachineTaskDetails, InstanceTypeVMNicUpdatesTaskDetails} +} + +// InstanceTypeBasicTestFailoverProviderSpecificInput enumerates the values for instance type basic test +// failover provider specific input. +type InstanceTypeBasicTestFailoverProviderSpecificInput string + +const ( + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A InstanceTypeBasicTestFailoverProviderSpecificInput = "A2A" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicTestFailoverProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage InstanceTypeBasicTestFailoverProviderSpecificInput = "InMage" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicTestFailoverProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicTestFailoverProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput InstanceTypeBasicTestFailoverProviderSpecificInput = "TestFailoverProviderSpecificInput" +) + +// PossibleInstanceTypeBasicTestFailoverProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicTestFailoverProviderSpecificInput const type. +func PossibleInstanceTypeBasicTestFailoverProviderSpecificInputValues() []InstanceTypeBasicTestFailoverProviderSpecificInput { + return []InstanceTypeBasicTestFailoverProviderSpecificInput{InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput} +} + +// InstanceTypeBasicTestMigrateProviderSpecificInput enumerates the values for instance type basic test migrate +// provider specific input. +type InstanceTypeBasicTestMigrateProviderSpecificInput string + +const ( + // InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput ... + InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput InstanceTypeBasicTestMigrateProviderSpecificInput = "TestMigrateProviderSpecificInput" + // InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicTestMigrateProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicTestMigrateProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicTestMigrateProviderSpecificInput const type. +func PossibleInstanceTypeBasicTestMigrateProviderSpecificInputValues() []InstanceTypeBasicTestMigrateProviderSpecificInput { + return []InstanceTypeBasicTestMigrateProviderSpecificInput{InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput, InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicUnplannedFailoverProviderSpecificInput enumerates the values for instance type basic +// unplanned failover provider specific input. +type InstanceTypeBasicUnplannedFailoverProviderSpecificInput string + +const ( + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "A2A" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMage" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "UnplannedFailoverProviderSpecificInput" +) + +// PossibleInstanceTypeBasicUnplannedFailoverProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUnplannedFailoverProviderSpecificInput const type. +func PossibleInstanceTypeBasicUnplannedFailoverProviderSpecificInputValues() []InstanceTypeBasicUnplannedFailoverProviderSpecificInput { + return []InstanceTypeBasicUnplannedFailoverProviderSpecificInput{InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput} +} + +// InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput enumerates the values for +// instance type basic update appliance for replication protected item provider specific input. +type InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput string + +const ( + // InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput ... + InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput = "UpdateApplianceForReplicationProtectedItemProviderSpecificInput" +) + +// PossibleInstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput const type. +func PossibleInstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputValues() []InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput { + return []InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput{InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput} +} + +// InstanceTypeBasicUpdateMigrationItemProviderSpecificInput enumerates the values for instance type basic +// update migration item provider specific input. +type InstanceTypeBasicUpdateMigrationItemProviderSpecificInput string + +const ( + // InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput ... + InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput InstanceTypeBasicUpdateMigrationItemProviderSpecificInput = "UpdateMigrationItemProviderSpecificInput" + // InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicUpdateMigrationItemProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicUpdateMigrationItemProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUpdateMigrationItemProviderSpecificInput const type. +func PossibleInstanceTypeBasicUpdateMigrationItemProviderSpecificInputValues() []InstanceTypeBasicUpdateMigrationItemProviderSpecificInput { + return []InstanceTypeBasicUpdateMigrationItemProviderSpecificInput{InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput, InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicUpdateReplicationProtectedItemProviderInput enumerates the values for instance type basic +// update replication protected item provider input. +type InstanceTypeBasicUpdateReplicationProtectedItemProviderInput string + +const ( + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "A2A" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "HyperVReplicaAzure" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "InMageAzureV2" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "InMageRcm" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "UpdateReplicationProtectedItemProviderInput" +) + +// PossibleInstanceTypeBasicUpdateReplicationProtectedItemProviderInputValues returns an array of possible values for the InstanceTypeBasicUpdateReplicationProtectedItemProviderInput const type. +func PossibleInstanceTypeBasicUpdateReplicationProtectedItemProviderInputValues() []InstanceTypeBasicUpdateReplicationProtectedItemProviderInput { + return []InstanceTypeBasicUpdateReplicationProtectedItemProviderInput{InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput} +} + +// LicenseType enumerates the values for license type. +type LicenseType string + +const ( + // LicenseTypeNoLicenseType ... + LicenseTypeNoLicenseType LicenseType = "NoLicenseType" + // LicenseTypeNotSpecified ... + LicenseTypeNotSpecified LicenseType = "NotSpecified" + // LicenseTypeWindowsServer ... + LicenseTypeWindowsServer LicenseType = "WindowsServer" +) + +// PossibleLicenseTypeValues returns an array of possible values for the LicenseType const type. +func PossibleLicenseTypeValues() []LicenseType { + return []LicenseType{LicenseTypeNoLicenseType, LicenseTypeNotSpecified, LicenseTypeWindowsServer} +} + +// MigrationItemOperation enumerates the values for migration item operation. +type MigrationItemOperation string + +const ( + // DisableMigration ... + DisableMigration MigrationItemOperation = "DisableMigration" + // Migrate ... + Migrate MigrationItemOperation = "Migrate" + // StartResync ... + StartResync MigrationItemOperation = "StartResync" + // TestMigrate ... + TestMigrate MigrationItemOperation = "TestMigrate" + // TestMigrateCleanup ... + TestMigrateCleanup MigrationItemOperation = "TestMigrateCleanup" +) + +// PossibleMigrationItemOperationValues returns an array of possible values for the MigrationItemOperation const type. +func PossibleMigrationItemOperationValues() []MigrationItemOperation { + return []MigrationItemOperation{DisableMigration, Migrate, StartResync, TestMigrate, TestMigrateCleanup} +} + +// MigrationRecoveryPointType enumerates the values for migration recovery point type. +type MigrationRecoveryPointType string + +const ( + // MigrationRecoveryPointTypeApplicationConsistent ... + MigrationRecoveryPointTypeApplicationConsistent MigrationRecoveryPointType = "ApplicationConsistent" + // MigrationRecoveryPointTypeCrashConsistent ... + MigrationRecoveryPointTypeCrashConsistent MigrationRecoveryPointType = "CrashConsistent" + // MigrationRecoveryPointTypeNotSpecified ... + MigrationRecoveryPointTypeNotSpecified MigrationRecoveryPointType = "NotSpecified" +) + +// PossibleMigrationRecoveryPointTypeValues returns an array of possible values for the MigrationRecoveryPointType const type. +func PossibleMigrationRecoveryPointTypeValues() []MigrationRecoveryPointType { + return []MigrationRecoveryPointType{MigrationRecoveryPointTypeApplicationConsistent, MigrationRecoveryPointTypeCrashConsistent, MigrationRecoveryPointTypeNotSpecified} +} + +// MigrationState enumerates the values for migration state. +type MigrationState string + +const ( + // MigrationStateDisableMigrationFailed ... + MigrationStateDisableMigrationFailed MigrationState = "DisableMigrationFailed" + // MigrationStateDisableMigrationInProgress ... + MigrationStateDisableMigrationInProgress MigrationState = "DisableMigrationInProgress" + // MigrationStateEnableMigrationFailed ... + MigrationStateEnableMigrationFailed MigrationState = "EnableMigrationFailed" + // MigrationStateEnableMigrationInProgress ... + MigrationStateEnableMigrationInProgress MigrationState = "EnableMigrationInProgress" + // MigrationStateInitialSeedingFailed ... + MigrationStateInitialSeedingFailed MigrationState = "InitialSeedingFailed" + // MigrationStateInitialSeedingInProgress ... + MigrationStateInitialSeedingInProgress MigrationState = "InitialSeedingInProgress" + // MigrationStateMigrationFailed ... + MigrationStateMigrationFailed MigrationState = "MigrationFailed" + // MigrationStateMigrationInProgress ... + MigrationStateMigrationInProgress MigrationState = "MigrationInProgress" + // MigrationStateMigrationSucceeded ... + MigrationStateMigrationSucceeded MigrationState = "MigrationSucceeded" + // MigrationStateNone ... + MigrationStateNone MigrationState = "None" + // MigrationStateReplicating ... + MigrationStateReplicating MigrationState = "Replicating" +) + +// PossibleMigrationStateValues returns an array of possible values for the MigrationState const type. +func PossibleMigrationStateValues() []MigrationState { + return []MigrationState{MigrationStateDisableMigrationFailed, MigrationStateDisableMigrationInProgress, MigrationStateEnableMigrationFailed, MigrationStateEnableMigrationInProgress, MigrationStateInitialSeedingFailed, MigrationStateInitialSeedingInProgress, MigrationStateMigrationFailed, MigrationStateMigrationInProgress, MigrationStateMigrationSucceeded, MigrationStateNone, MigrationStateReplicating} +} + +// MobilityAgentUpgradeState enumerates the values for mobility agent upgrade state. +type MobilityAgentUpgradeState string + +const ( + // MobilityAgentUpgradeStateCommit ... + MobilityAgentUpgradeStateCommit MobilityAgentUpgradeState = "Commit" + // MobilityAgentUpgradeStateCompleted ... + MobilityAgentUpgradeStateCompleted MobilityAgentUpgradeState = "Completed" + // MobilityAgentUpgradeStateNone ... + MobilityAgentUpgradeStateNone MobilityAgentUpgradeState = "None" + // MobilityAgentUpgradeStateStarted ... + MobilityAgentUpgradeStateStarted MobilityAgentUpgradeState = "Started" +) + +// PossibleMobilityAgentUpgradeStateValues returns an array of possible values for the MobilityAgentUpgradeState const type. +func PossibleMobilityAgentUpgradeStateValues() []MobilityAgentUpgradeState { + return []MobilityAgentUpgradeState{MobilityAgentUpgradeStateCommit, MobilityAgentUpgradeStateCompleted, MobilityAgentUpgradeStateNone, MobilityAgentUpgradeStateStarted} +} + +// MultiVMGroupCreateOption enumerates the values for multi vm group create option. +type MultiVMGroupCreateOption string + +const ( + // AutoCreated ... + AutoCreated MultiVMGroupCreateOption = "AutoCreated" + // UserSpecified ... + UserSpecified MultiVMGroupCreateOption = "UserSpecified" +) + +// PossibleMultiVMGroupCreateOptionValues returns an array of possible values for the MultiVMGroupCreateOption const type. +func PossibleMultiVMGroupCreateOptionValues() []MultiVMGroupCreateOption { + return []MultiVMGroupCreateOption{AutoCreated, UserSpecified} +} + +// MultiVMSyncPointOption enumerates the values for multi vm sync point option. +type MultiVMSyncPointOption string + +const ( + // UseMultiVMSyncRecoveryPoint ... + UseMultiVMSyncRecoveryPoint MultiVMSyncPointOption = "UseMultiVmSyncRecoveryPoint" + // UsePerVMRecoveryPoint ... + UsePerVMRecoveryPoint MultiVMSyncPointOption = "UsePerVmRecoveryPoint" +) + +// PossibleMultiVMSyncPointOptionValues returns an array of possible values for the MultiVMSyncPointOption const type. +func PossibleMultiVMSyncPointOptionValues() []MultiVMSyncPointOption { + return []MultiVMSyncPointOption{UseMultiVMSyncRecoveryPoint, UsePerVMRecoveryPoint} +} + +// PlannedFailoverStatus enumerates the values for planned failover status. +type PlannedFailoverStatus string + +const ( + // PlannedFailoverStatusCancelled ... + PlannedFailoverStatusCancelled PlannedFailoverStatus = "Cancelled" + // PlannedFailoverStatusFailed ... + PlannedFailoverStatusFailed PlannedFailoverStatus = "Failed" + // PlannedFailoverStatusSucceeded ... + PlannedFailoverStatusSucceeded PlannedFailoverStatus = "Succeeded" + // PlannedFailoverStatusUnknown ... + PlannedFailoverStatusUnknown PlannedFailoverStatus = "Unknown" +) + +// PossiblePlannedFailoverStatusValues returns an array of possible values for the PlannedFailoverStatus const type. +func PossiblePlannedFailoverStatusValues() []PlannedFailoverStatus { + return []PlannedFailoverStatus{PlannedFailoverStatusCancelled, PlannedFailoverStatusFailed, PlannedFailoverStatusSucceeded, PlannedFailoverStatusUnknown} +} + +// PossibleOperationsDirections enumerates the values for possible operations directions. +type PossibleOperationsDirections string + +const ( + // PrimaryToRecovery ... + PrimaryToRecovery PossibleOperationsDirections = "PrimaryToRecovery" + // RecoveryToPrimary ... + RecoveryToPrimary PossibleOperationsDirections = "RecoveryToPrimary" +) + +// PossiblePossibleOperationsDirectionsValues returns an array of possible values for the PossibleOperationsDirections const type. +func PossiblePossibleOperationsDirectionsValues() []PossibleOperationsDirections { + return []PossibleOperationsDirections{PrimaryToRecovery, RecoveryToPrimary} +} + +// PresenceStatus enumerates the values for presence status. +type PresenceStatus string + +const ( + // PresenceStatusNotPresent ... + PresenceStatusNotPresent PresenceStatus = "NotPresent" + // PresenceStatusPresent ... + PresenceStatusPresent PresenceStatus = "Present" + // PresenceStatusUnknown ... + PresenceStatusUnknown PresenceStatus = "Unknown" +) + +// PossiblePresenceStatusValues returns an array of possible values for the PresenceStatus const type. +func PossiblePresenceStatusValues() []PresenceStatus { + return []PresenceStatus{PresenceStatusNotPresent, PresenceStatusPresent, PresenceStatusUnknown} +} + +// ProtectionHealth enumerates the values for protection health. +type ProtectionHealth string + +const ( + // ProtectionHealthCritical ... + ProtectionHealthCritical ProtectionHealth = "Critical" + // ProtectionHealthNone ... + ProtectionHealthNone ProtectionHealth = "None" + // ProtectionHealthNormal ... + ProtectionHealthNormal ProtectionHealth = "Normal" + // ProtectionHealthWarning ... + ProtectionHealthWarning ProtectionHealth = "Warning" +) + +// PossibleProtectionHealthValues returns an array of possible values for the ProtectionHealth const type. +func PossibleProtectionHealthValues() []ProtectionHealth { + return []ProtectionHealth{ProtectionHealthCritical, ProtectionHealthNone, ProtectionHealthNormal, ProtectionHealthWarning} +} + +// RcmComponentStatus enumerates the values for rcm component status. +type RcmComponentStatus string + +const ( + // RcmComponentStatusCritical ... + RcmComponentStatusCritical RcmComponentStatus = "Critical" + // RcmComponentStatusHealthy ... + RcmComponentStatusHealthy RcmComponentStatus = "Healthy" + // RcmComponentStatusUnknown ... + RcmComponentStatusUnknown RcmComponentStatus = "Unknown" + // RcmComponentStatusWarning ... + RcmComponentStatusWarning RcmComponentStatus = "Warning" +) + +// PossibleRcmComponentStatusValues returns an array of possible values for the RcmComponentStatus const type. +func PossibleRcmComponentStatusValues() []RcmComponentStatus { + return []RcmComponentStatus{RcmComponentStatusCritical, RcmComponentStatusHealthy, RcmComponentStatusUnknown, RcmComponentStatusWarning} +} + +// RecoveryPlanActionLocation enumerates the values for recovery plan action location. +type RecoveryPlanActionLocation string + +const ( + // Primary ... + Primary RecoveryPlanActionLocation = "Primary" + // Recovery ... + Recovery RecoveryPlanActionLocation = "Recovery" +) + +// PossibleRecoveryPlanActionLocationValues returns an array of possible values for the RecoveryPlanActionLocation const type. +func PossibleRecoveryPlanActionLocationValues() []RecoveryPlanActionLocation { + return []RecoveryPlanActionLocation{Primary, Recovery} +} + +// RecoveryPlanGroupType enumerates the values for recovery plan group type. +type RecoveryPlanGroupType string + +const ( + // Boot ... + Boot RecoveryPlanGroupType = "Boot" + // Failover ... + Failover RecoveryPlanGroupType = "Failover" + // Shutdown ... + Shutdown RecoveryPlanGroupType = "Shutdown" +) + +// PossibleRecoveryPlanGroupTypeValues returns an array of possible values for the RecoveryPlanGroupType const type. +func PossibleRecoveryPlanGroupTypeValues() []RecoveryPlanGroupType { + return []RecoveryPlanGroupType{Boot, Failover, Shutdown} +} + +// RecoveryPlanPointType enumerates the values for recovery plan point type. +type RecoveryPlanPointType string + +const ( + // RecoveryPlanPointTypeLatest ... + RecoveryPlanPointTypeLatest RecoveryPlanPointType = "Latest" + // RecoveryPlanPointTypeLatestApplicationConsistent ... + RecoveryPlanPointTypeLatestApplicationConsistent RecoveryPlanPointType = "LatestApplicationConsistent" + // RecoveryPlanPointTypeLatestCrashConsistent ... + RecoveryPlanPointTypeLatestCrashConsistent RecoveryPlanPointType = "LatestCrashConsistent" + // RecoveryPlanPointTypeLatestProcessed ... + RecoveryPlanPointTypeLatestProcessed RecoveryPlanPointType = "LatestProcessed" +) + +// PossibleRecoveryPlanPointTypeValues returns an array of possible values for the RecoveryPlanPointType const type. +func PossibleRecoveryPlanPointTypeValues() []RecoveryPlanPointType { + return []RecoveryPlanPointType{RecoveryPlanPointTypeLatest, RecoveryPlanPointTypeLatestApplicationConsistent, RecoveryPlanPointTypeLatestCrashConsistent, RecoveryPlanPointTypeLatestProcessed} +} + +// RecoveryPointSyncType enumerates the values for recovery point sync type. +type RecoveryPointSyncType string + +const ( + // MultiVMSyncRecoveryPoint ... + MultiVMSyncRecoveryPoint RecoveryPointSyncType = "MultiVmSyncRecoveryPoint" + // PerVMRecoveryPoint ... + PerVMRecoveryPoint RecoveryPointSyncType = "PerVmRecoveryPoint" +) + +// PossibleRecoveryPointSyncTypeValues returns an array of possible values for the RecoveryPointSyncType const type. +func PossibleRecoveryPointSyncTypeValues() []RecoveryPointSyncType { + return []RecoveryPointSyncType{MultiVMSyncRecoveryPoint, PerVMRecoveryPoint} +} + +// RecoveryPointType enumerates the values for recovery point type. +type RecoveryPointType string + +const ( + // Custom ... + Custom RecoveryPointType = "Custom" + // LatestTag ... + LatestTag RecoveryPointType = "LatestTag" + // LatestTime ... + LatestTime RecoveryPointType = "LatestTime" +) + +// PossibleRecoveryPointTypeValues returns an array of possible values for the RecoveryPointType const type. +func PossibleRecoveryPointTypeValues() []RecoveryPointType { + return []RecoveryPointType{Custom, LatestTag, LatestTime} +} + +// ReplicationProtectedItemOperation enumerates the values for replication protected item operation. +type ReplicationProtectedItemOperation string + +const ( + // CancelFailover ... + CancelFailover ReplicationProtectedItemOperation = "CancelFailover" + // ChangePit ... + ChangePit ReplicationProtectedItemOperation = "ChangePit" + // Commit ... + Commit ReplicationProtectedItemOperation = "Commit" + // CompleteMigration ... + CompleteMigration ReplicationProtectedItemOperation = "CompleteMigration" + // DisableProtection ... + DisableProtection ReplicationProtectedItemOperation = "DisableProtection" + // Failback ... + Failback ReplicationProtectedItemOperation = "Failback" + // FinalizeFailback ... + FinalizeFailback ReplicationProtectedItemOperation = "FinalizeFailback" + // PlannedFailover ... + PlannedFailover ReplicationProtectedItemOperation = "PlannedFailover" + // RepairReplication ... + RepairReplication ReplicationProtectedItemOperation = "RepairReplication" + // ReverseReplicate ... + ReverseReplicate ReplicationProtectedItemOperation = "ReverseReplicate" + // SwitchProtection ... + SwitchProtection ReplicationProtectedItemOperation = "SwitchProtection" + // TestFailover ... + TestFailover ReplicationProtectedItemOperation = "TestFailover" + // TestFailoverCleanup ... + TestFailoverCleanup ReplicationProtectedItemOperation = "TestFailoverCleanup" + // UnplannedFailover ... + UnplannedFailover ReplicationProtectedItemOperation = "UnplannedFailover" +) + +// PossibleReplicationProtectedItemOperationValues returns an array of possible values for the ReplicationProtectedItemOperation const type. +func PossibleReplicationProtectedItemOperationValues() []ReplicationProtectedItemOperation { + return []ReplicationProtectedItemOperation{CancelFailover, ChangePit, Commit, CompleteMigration, DisableProtection, Failback, FinalizeFailback, PlannedFailover, RepairReplication, ReverseReplicate, SwitchProtection, TestFailover, TestFailoverCleanup, UnplannedFailover} +} + +// ResourceType enumerates the values for resource type. +type ResourceType string + +const ( + // ResourceTypeExisting ... + ResourceTypeExisting ResourceType = "Existing" + // ResourceTypeNew ... + ResourceTypeNew ResourceType = "New" + // ResourceTypeProtectionProfileCustomDetails ... + ResourceTypeProtectionProfileCustomDetails ResourceType = "ProtectionProfileCustomDetails" +) + +// PossibleResourceTypeValues returns an array of possible values for the ResourceType const type. +func PossibleResourceTypeValues() []ResourceType { + return []ResourceType{ResourceTypeExisting, ResourceTypeNew, ResourceTypeProtectionProfileCustomDetails} +} + +// ResourceTypeBasicRecoveryAvailabilitySetCustomDetails enumerates the values for resource type basic recovery +// availability set custom details. +type ResourceTypeBasicRecoveryAvailabilitySetCustomDetails string + +const ( + // ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryAvailabilitySetCustomDetails = "Existing" + // ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails ... + ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails ResourceTypeBasicRecoveryAvailabilitySetCustomDetails = "RecoveryAvailabilitySetCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryAvailabilitySetCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryAvailabilitySetCustomDetails const type. +func PossibleResourceTypeBasicRecoveryAvailabilitySetCustomDetailsValues() []ResourceTypeBasicRecoveryAvailabilitySetCustomDetails { + return []ResourceTypeBasicRecoveryAvailabilitySetCustomDetails{ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails} +} + +// ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails enumerates the values for resource type basic +// recovery proximity placement group custom details. +type ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails string + +const ( + // ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails = "Existing" + // ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails ... + ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails = "RecoveryProximityPlacementGroupCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails const type. +func PossibleResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsValues() []ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails { + return []ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails{ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails} +} + +// ResourceTypeBasicRecoveryResourceGroupCustomDetails enumerates the values for resource type basic recovery +// resource group custom details. +type ResourceTypeBasicRecoveryResourceGroupCustomDetails string + +const ( + // ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryResourceGroupCustomDetails = "Existing" + // ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails ... + ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails ResourceTypeBasicRecoveryResourceGroupCustomDetails = "RecoveryResourceGroupCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryResourceGroupCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryResourceGroupCustomDetails const type. +func PossibleResourceTypeBasicRecoveryResourceGroupCustomDetailsValues() []ResourceTypeBasicRecoveryResourceGroupCustomDetails { + return []ResourceTypeBasicRecoveryResourceGroupCustomDetails{ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails} +} + +// ResourceTypeBasicRecoveryVirtualNetworkCustomDetails enumerates the values for resource type basic recovery +// virtual network custom details. +type ResourceTypeBasicRecoveryVirtualNetworkCustomDetails string + +const ( + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "Existing" + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "New" + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "RecoveryVirtualNetworkCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryVirtualNetworkCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryVirtualNetworkCustomDetails const type. +func PossibleResourceTypeBasicRecoveryVirtualNetworkCustomDetailsValues() []ResourceTypeBasicRecoveryVirtualNetworkCustomDetails { + return []ResourceTypeBasicRecoveryVirtualNetworkCustomDetails{ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew, ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails} +} + +// ResourceTypeBasicStorageAccountCustomDetails enumerates the values for resource type basic storage account +// custom details. +type ResourceTypeBasicStorageAccountCustomDetails string + +const ( + // ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting ... + ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting ResourceTypeBasicStorageAccountCustomDetails = "Existing" + // ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails ... + ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails ResourceTypeBasicStorageAccountCustomDetails = "StorageAccountCustomDetails" +) + +// PossibleResourceTypeBasicStorageAccountCustomDetailsValues returns an array of possible values for the ResourceTypeBasicStorageAccountCustomDetails const type. +func PossibleResourceTypeBasicStorageAccountCustomDetailsValues() []ResourceTypeBasicStorageAccountCustomDetails { + return []ResourceTypeBasicStorageAccountCustomDetails{ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting, ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails} +} + +// ResyncState enumerates the values for resync state. +type ResyncState string + +const ( + // ResyncStateNone ... + ResyncStateNone ResyncState = "None" + // ResyncStatePreparedForResynchronization ... + ResyncStatePreparedForResynchronization ResyncState = "PreparedForResynchronization" + // ResyncStateStartedResynchronization ... + ResyncStateStartedResynchronization ResyncState = "StartedResynchronization" +) + +// PossibleResyncStateValues returns an array of possible values for the ResyncState const type. +func PossibleResyncStateValues() []ResyncState { + return []ResyncState{ResyncStateNone, ResyncStatePreparedForResynchronization, ResyncStateStartedResynchronization} +} + +// RpInMageRecoveryPointType enumerates the values for rp in mage recovery point type. +type RpInMageRecoveryPointType string + +const ( + // RpInMageRecoveryPointTypeCustom ... + RpInMageRecoveryPointTypeCustom RpInMageRecoveryPointType = "Custom" + // RpInMageRecoveryPointTypeLatestTag ... + RpInMageRecoveryPointTypeLatestTag RpInMageRecoveryPointType = "LatestTag" + // RpInMageRecoveryPointTypeLatestTime ... + RpInMageRecoveryPointTypeLatestTime RpInMageRecoveryPointType = "LatestTime" +) + +// PossibleRpInMageRecoveryPointTypeValues returns an array of possible values for the RpInMageRecoveryPointType const type. +func PossibleRpInMageRecoveryPointTypeValues() []RpInMageRecoveryPointType { + return []RpInMageRecoveryPointType{RpInMageRecoveryPointTypeCustom, RpInMageRecoveryPointTypeLatestTag, RpInMageRecoveryPointTypeLatestTime} +} + +// SetMultiVMSyncStatus enumerates the values for set multi vm sync status. +type SetMultiVMSyncStatus string + +const ( + // Disable ... + Disable SetMultiVMSyncStatus = "Disable" + // Enable ... + Enable SetMultiVMSyncStatus = "Enable" +) + +// PossibleSetMultiVMSyncStatusValues returns an array of possible values for the SetMultiVMSyncStatus const type. +func PossibleSetMultiVMSyncStatusValues() []SetMultiVMSyncStatus { + return []SetMultiVMSyncStatus{Disable, Enable} +} + +// Severity enumerates the values for severity. +type Severity string + +const ( + // Error ... + Error Severity = "Error" + // Info ... + Info Severity = "Info" + // NONE ... + NONE Severity = "NONE" + // Warning ... + Warning Severity = "Warning" +) + +// PossibleSeverityValues returns an array of possible values for the Severity const type. +func PossibleSeverityValues() []Severity { + return []Severity{Error, Info, NONE, Warning} +} + +// SourceSiteOperations enumerates the values for source site operations. +type SourceSiteOperations string + +const ( + // NotRequired ... + NotRequired SourceSiteOperations = "NotRequired" + // Required ... + Required SourceSiteOperations = "Required" +) + +// PossibleSourceSiteOperationsValues returns an array of possible values for the SourceSiteOperations const type. +func PossibleSourceSiteOperationsValues() []SourceSiteOperations { + return []SourceSiteOperations{NotRequired, Required} +} + +// SQLServerLicenseType enumerates the values for sql server license type. +type SQLServerLicenseType string + +const ( + // SQLServerLicenseTypeAHUB ... + SQLServerLicenseTypeAHUB SQLServerLicenseType = "AHUB" + // SQLServerLicenseTypeNoLicenseType ... + SQLServerLicenseTypeNoLicenseType SQLServerLicenseType = "NoLicenseType" + // SQLServerLicenseTypeNotSpecified ... + SQLServerLicenseTypeNotSpecified SQLServerLicenseType = "NotSpecified" + // SQLServerLicenseTypePAYG ... + SQLServerLicenseTypePAYG SQLServerLicenseType = "PAYG" +) + +// PossibleSQLServerLicenseTypeValues returns an array of possible values for the SQLServerLicenseType const type. +func PossibleSQLServerLicenseTypeValues() []SQLServerLicenseType { + return []SQLServerLicenseType{SQLServerLicenseTypeAHUB, SQLServerLicenseTypeNoLicenseType, SQLServerLicenseTypeNotSpecified, SQLServerLicenseTypePAYG} +} + +// TestMigrationState enumerates the values for test migration state. +type TestMigrationState string + +const ( + // TestMigrationStateNone ... + TestMigrationStateNone TestMigrationState = "None" + // TestMigrationStateTestMigrationCleanupInProgress ... + TestMigrationStateTestMigrationCleanupInProgress TestMigrationState = "TestMigrationCleanupInProgress" + // TestMigrationStateTestMigrationFailed ... + TestMigrationStateTestMigrationFailed TestMigrationState = "TestMigrationFailed" + // TestMigrationStateTestMigrationInProgress ... + TestMigrationStateTestMigrationInProgress TestMigrationState = "TestMigrationInProgress" + // TestMigrationStateTestMigrationSucceeded ... + TestMigrationStateTestMigrationSucceeded TestMigrationState = "TestMigrationSucceeded" +) + +// PossibleTestMigrationStateValues returns an array of possible values for the TestMigrationState const type. +func PossibleTestMigrationStateValues() []TestMigrationState { + return []TestMigrationState{TestMigrationStateNone, TestMigrationStateTestMigrationCleanupInProgress, TestMigrationStateTestMigrationFailed, TestMigrationStateTestMigrationInProgress, TestMigrationStateTestMigrationSucceeded} +} + +// VMEncryptionType enumerates the values for vm encryption type. +type VMEncryptionType string + +const ( + // NotEncrypted ... + NotEncrypted VMEncryptionType = "NotEncrypted" + // OnePassEncrypted ... + OnePassEncrypted VMEncryptionType = "OnePassEncrypted" + // TwoPassEncrypted ... + TwoPassEncrypted VMEncryptionType = "TwoPassEncrypted" +) + +// PossibleVMEncryptionTypeValues returns an array of possible values for the VMEncryptionType const type. +func PossibleVMEncryptionTypeValues() []VMEncryptionType { + return []VMEncryptionType{NotEncrypted, OnePassEncrypted, TwoPassEncrypted} +} + +// VMReplicationProgressHealth enumerates the values for vm replication progress health. +type VMReplicationProgressHealth string + +const ( + // VMReplicationProgressHealthInProgress ... + VMReplicationProgressHealthInProgress VMReplicationProgressHealth = "InProgress" + // VMReplicationProgressHealthNone ... + VMReplicationProgressHealthNone VMReplicationProgressHealth = "None" + // VMReplicationProgressHealthNoProgress ... + VMReplicationProgressHealthNoProgress VMReplicationProgressHealth = "NoProgress" + // VMReplicationProgressHealthSlowProgress ... + VMReplicationProgressHealthSlowProgress VMReplicationProgressHealth = "SlowProgress" +) + +// PossibleVMReplicationProgressHealthValues returns an array of possible values for the VMReplicationProgressHealth const type. +func PossibleVMReplicationProgressHealthValues() []VMReplicationProgressHealth { + return []VMReplicationProgressHealth{VMReplicationProgressHealthInProgress, VMReplicationProgressHealthNone, VMReplicationProgressHealthNoProgress, VMReplicationProgressHealthSlowProgress} +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/migrationrecoverypoints.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/migrationrecoverypoints.go new file mode 100644 index 000000000000..f3d6cecbc447 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/migrationrecoverypoints.go @@ -0,0 +1,236 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// MigrationRecoveryPointsClient is the client for the MigrationRecoveryPoints methods of the Siterecovery service. +type MigrationRecoveryPointsClient struct { + BaseClient +} + +// NewMigrationRecoveryPointsClient creates an instance of the MigrationRecoveryPointsClient client. +func NewMigrationRecoveryPointsClient(subscriptionID string, resourceGroupName string, resourceName string) MigrationRecoveryPointsClient { + return NewMigrationRecoveryPointsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewMigrationRecoveryPointsClientWithBaseURI creates an instance of the MigrationRecoveryPointsClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewMigrationRecoveryPointsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) MigrationRecoveryPointsClient { + return MigrationRecoveryPointsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get sends the get request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// migrationRecoveryPointName - the migration recovery point name. +func (client MigrationRecoveryPointsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (result MigrationRecoveryPoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, migrationItemName, migrationRecoveryPointName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client MigrationRecoveryPointsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "migrationRecoveryPointName": autorest.Encode("path", migrationRecoveryPointName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints/{migrationRecoveryPointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client MigrationRecoveryPointsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client MigrationRecoveryPointsClient) GetResponder(resp *http.Response) (result MigrationRecoveryPoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationMigrationItems sends the list by replication migration items request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItems(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationRecoveryPointCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.ListByReplicationMigrationItems") + defer func() { + sc := -1 + if result.mrpc.Response.Response != nil { + sc = result.mrpc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationMigrationItemsNextResults + req, err := client.ListByReplicationMigrationItemsPreparer(ctx, fabricName, protectionContainerName, migrationItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationMigrationItemsSender(req) + if err != nil { + result.mrpc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", resp, "Failure sending request") + return + } + + result.mrpc, err = client.ListByReplicationMigrationItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", resp, "Failure responding to request") + return + } + if result.mrpc.hasNextLink() && result.mrpc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationMigrationItemsPreparer prepares the ListByReplicationMigrationItems request. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationMigrationItemsSender sends the ListByReplicationMigrationItems request. The method will close the +// http.Response Body if it receives an error. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationMigrationItemsResponder handles the response to the ListByReplicationMigrationItems request. The method always +// closes the http.Response Body. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsResponder(resp *http.Response) (result MigrationRecoveryPointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationMigrationItemsNextResults retrieves the next set of results, if any. +func (client MigrationRecoveryPointsClient) listByReplicationMigrationItemsNextResults(ctx context.Context, lastResults MigrationRecoveryPointCollection) (result MigrationRecoveryPointCollection, err error) { + req, err := lastResults.migrationRecoveryPointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationMigrationItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationMigrationItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationMigrationItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationRecoveryPointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.ListByReplicationMigrationItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationMigrationItems(ctx, fabricName, protectionContainerName, migrationItemName) + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/models.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/models.go new file mode 100644 index 000000000000..2c5b88db1a06 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/models.go @@ -0,0 +1,32466 @@ +package siterecovery + +// 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. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-10-01/siterecovery" + +// A2AAddDisksInput a2A add disk(s) input. +type A2AAddDisksInput struct { + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeAddDisksProviderSpecificInput', 'InstanceTypeA2A' + InstanceType InstanceType `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AAddDisksInput. +func (aadi A2AAddDisksInput) MarshalJSON() ([]byte, error) { + aadi.InstanceType = InstanceTypeA2A + objectMap := make(map[string]interface{}) + if aadi.VMDisks != nil { + objectMap["vmDisks"] = aadi.VMDisks + } + if aadi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aadi.VMManagedDisks + } + if aadi.InstanceType != "" { + objectMap["instanceType"] = aadi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AAddDisksInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsA2AAddDisksInput() (*A2AAddDisksInput, bool) { + return &aadi, true +} + +// AsAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsBasicAddDisksProviderSpecificInput() (BasicAddDisksProviderSpecificInput, bool) { + return &aadi, true +} + +// A2AApplyRecoveryPointInput applyRecoveryPoint input specific to A2A provider. +type A2AApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + aarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aarpi.InstanceType != "" { + objectMap["instanceType"] = aarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return &aarpi, true +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &aarpi, true +} + +// A2AContainerCreationInput a2A cloud creation input. +type A2AContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) MarshalJSON() ([]byte, error) { + acci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acci.InstanceType != "" { + objectMap["instanceType"] = acci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return &acci, true +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &acci, true +} + +// A2AContainerMappingInput a2A container mapping input. +type A2AContainerMappingInput struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) MarshalJSON() ([]byte, error) { + acmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acmi.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = acmi.AgentAutoUpdateStatus + } + if acmi.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = acmi.AutomationAccountArmID + } + if acmi.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = acmi.AutomationAccountAuthenticationType + } + if acmi.InstanceType != "" { + objectMap["instanceType"] = acmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return &acmi, true +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &acmi, true +} + +// A2ACreateProtectionIntentInput a2A create protection intent input. +type A2ACreateProtectionIntentInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryLocation - The primary location for the virtual machine. + PrimaryLocation *string `json:"primaryLocation,omitempty"` + // RecoveryLocation - The recovery location for the virtual machine. + RecoveryLocation *string `json:"recoveryLocation,omitempty"` + // RecoverySubscriptionID - The recovery subscription Id of the virtual machine. + RecoverySubscriptionID *string `json:"recoverySubscriptionId,omitempty"` + // RecoveryAvailabilityType - The recovery availability type of the virtual machine. Possible values include: 'Single', 'AvailabilitySet', 'AvailabilityZone' + RecoveryAvailabilityType A2ARecoveryAvailabilityType `json:"recoveryAvailabilityType,omitempty"` + // ProtectionProfileCustomInput - The protection profile custom inputs. + ProtectionProfileCustomInput BasicProtectionProfileCustomDetails `json:"protectionProfileCustomInput,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` + // RecoveryAvailabilitySetCustomInput - The recovery availability set input. + RecoveryAvailabilitySetCustomInput BasicRecoveryAvailabilitySetCustomDetails `json:"recoveryAvailabilitySetCustomInput,omitempty"` + // RecoveryVirtualNetworkCustomInput - The recovery virtual network input. + RecoveryVirtualNetworkCustomInput BasicRecoveryVirtualNetworkCustomDetails `json:"recoveryVirtualNetworkCustomInput,omitempty"` + // RecoveryProximityPlacementGroupCustomInput - The recovery proximity placement group custom input. + RecoveryProximityPlacementGroupCustomInput BasicRecoveryProximityPlacementGroupCustomDetails `json:"recoveryProximityPlacementGroupCustomInput,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // VMDisks - The list of vm disk inputs. + VMDisks *[]A2AProtectionIntentDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk inputs. + VMManagedDisks *[]A2AProtectionIntentManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccount - The boot diagnostic storage account. + RecoveryBootDiagStorageAccount BasicStorageAccountCustomDetails `json:"recoveryBootDiagStorageAccount,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the authentication type for automation account. The default value is "RunAsAccount". Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails', 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) MarshalJSON() ([]byte, error) { + acpii.InstanceType = InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acpii.FabricObjectID != nil { + objectMap["fabricObjectId"] = acpii.FabricObjectID + } + if acpii.PrimaryLocation != nil { + objectMap["primaryLocation"] = acpii.PrimaryLocation + } + if acpii.RecoveryLocation != nil { + objectMap["recoveryLocation"] = acpii.RecoveryLocation + } + if acpii.RecoverySubscriptionID != nil { + objectMap["recoverySubscriptionId"] = acpii.RecoverySubscriptionID + } + if acpii.RecoveryAvailabilityType != "" { + objectMap["recoveryAvailabilityType"] = acpii.RecoveryAvailabilityType + } + objectMap["protectionProfileCustomInput"] = acpii.ProtectionProfileCustomInput + if acpii.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = acpii.RecoveryResourceGroupID + } + objectMap["primaryStagingStorageAccountCustomInput"] = acpii.PrimaryStagingStorageAccountCustomInput + objectMap["recoveryAvailabilitySetCustomInput"] = acpii.RecoveryAvailabilitySetCustomInput + objectMap["recoveryVirtualNetworkCustomInput"] = acpii.RecoveryVirtualNetworkCustomInput + objectMap["recoveryProximityPlacementGroupCustomInput"] = acpii.RecoveryProximityPlacementGroupCustomInput + if acpii.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = acpii.AutoProtectionOfDataDisk + } + if acpii.VMDisks != nil { + objectMap["vmDisks"] = acpii.VMDisks + } + if acpii.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = acpii.VMManagedDisks + } + if acpii.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = acpii.MultiVMGroupName + } + if acpii.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = acpii.MultiVMGroupID + } + objectMap["recoveryBootDiagStorageAccount"] = acpii.RecoveryBootDiagStorageAccount + if acpii.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = acpii.DiskEncryptionInfo + } + if acpii.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = acpii.RecoveryAvailabilityZone + } + if acpii.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = acpii.AgentAutoUpdateStatus + } + if acpii.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = acpii.AutomationAccountAuthenticationType + } + if acpii.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = acpii.AutomationAccountArmID + } + if acpii.InstanceType != "" { + objectMap["instanceType"] = acpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACreateProtectionIntentInput is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) { + return &acpii, true +} + +// AsCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsBasicCreateProtectionIntentProviderSpecificDetails() (BasicCreateProtectionIntentProviderSpecificDetails, bool) { + return &acpii, true +} + +// UnmarshalJSON is the custom unmarshaler for A2ACreateProtectionIntentInput struct. +func (acpii *A2ACreateProtectionIntentInput) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "fabricObjectId": + if v != nil { + var fabricObjectID string + err = json.Unmarshal(*v, &fabricObjectID) + if err != nil { + return err + } + acpii.FabricObjectID = &fabricObjectID + } + case "primaryLocation": + if v != nil { + var primaryLocation string + err = json.Unmarshal(*v, &primaryLocation) + if err != nil { + return err + } + acpii.PrimaryLocation = &primaryLocation + } + case "recoveryLocation": + if v != nil { + var recoveryLocation string + err = json.Unmarshal(*v, &recoveryLocation) + if err != nil { + return err + } + acpii.RecoveryLocation = &recoveryLocation + } + case "recoverySubscriptionId": + if v != nil { + var recoverySubscriptionID string + err = json.Unmarshal(*v, &recoverySubscriptionID) + if err != nil { + return err + } + acpii.RecoverySubscriptionID = &recoverySubscriptionID + } + case "recoveryAvailabilityType": + if v != nil { + var recoveryAvailabilityType A2ARecoveryAvailabilityType + err = json.Unmarshal(*v, &recoveryAvailabilityType) + if err != nil { + return err + } + acpii.RecoveryAvailabilityType = recoveryAvailabilityType + } + case "protectionProfileCustomInput": + if v != nil { + protectionProfileCustomInput, err := unmarshalBasicProtectionProfileCustomDetails(*v) + if err != nil { + return err + } + acpii.ProtectionProfileCustomInput = protectionProfileCustomInput + } + case "recoveryResourceGroupId": + if v != nil { + var recoveryResourceGroupID string + err = json.Unmarshal(*v, &recoveryResourceGroupID) + if err != nil { + return err + } + acpii.RecoveryResourceGroupID = &recoveryResourceGroupID + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + acpii.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + case "recoveryAvailabilitySetCustomInput": + if v != nil { + recoveryAvailabilitySetCustomInput, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryAvailabilitySetCustomInput = recoveryAvailabilitySetCustomInput + } + case "recoveryVirtualNetworkCustomInput": + if v != nil { + recoveryVirtualNetworkCustomInput, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryVirtualNetworkCustomInput = recoveryVirtualNetworkCustomInput + } + case "recoveryProximityPlacementGroupCustomInput": + if v != nil { + recoveryProximityPlacementGroupCustomInput, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryProximityPlacementGroupCustomInput = recoveryProximityPlacementGroupCustomInput + } + case "autoProtectionOfDataDisk": + if v != nil { + var autoProtectionOfDataDisk AutoProtectionOfDataDisk + err = json.Unmarshal(*v, &autoProtectionOfDataDisk) + if err != nil { + return err + } + acpii.AutoProtectionOfDataDisk = autoProtectionOfDataDisk + } + case "vmDisks": + if v != nil { + var VMDisks []A2AProtectionIntentDiskInputDetails + err = json.Unmarshal(*v, &VMDisks) + if err != nil { + return err + } + acpii.VMDisks = &VMDisks + } + case "vmManagedDisks": + if v != nil { + var VMManagedDisks []A2AProtectionIntentManagedDiskInputDetails + err = json.Unmarshal(*v, &VMManagedDisks) + if err != nil { + return err + } + acpii.VMManagedDisks = &VMManagedDisks + } + case "multiVmGroupName": + if v != nil { + var multiVMGroupName string + err = json.Unmarshal(*v, &multiVMGroupName) + if err != nil { + return err + } + acpii.MultiVMGroupName = &multiVMGroupName + } + case "multiVmGroupId": + if v != nil { + var multiVMGroupID string + err = json.Unmarshal(*v, &multiVMGroupID) + if err != nil { + return err + } + acpii.MultiVMGroupID = &multiVMGroupID + } + case "recoveryBootDiagStorageAccount": + if v != nil { + recoveryBootDiagStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryBootDiagStorageAccount = recoveryBootDiagStorageAccount + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + acpii.DiskEncryptionInfo = &diskEncryptionInfo + } + case "recoveryAvailabilityZone": + if v != nil { + var recoveryAvailabilityZone string + err = json.Unmarshal(*v, &recoveryAvailabilityZone) + if err != nil { + return err + } + acpii.RecoveryAvailabilityZone = &recoveryAvailabilityZone + } + case "agentAutoUpdateStatus": + if v != nil { + var agentAutoUpdateStatus AgentAutoUpdateStatus + err = json.Unmarshal(*v, &agentAutoUpdateStatus) + if err != nil { + return err + } + acpii.AgentAutoUpdateStatus = agentAutoUpdateStatus + } + case "automationAccountAuthenticationType": + if v != nil { + var automationAccountAuthenticationType AutomationAccountAuthenticationType + err = json.Unmarshal(*v, &automationAccountAuthenticationType) + if err != nil { + return err + } + acpii.AutomationAccountAuthenticationType = automationAccountAuthenticationType + } + case "automationAccountArmId": + if v != nil { + var automationAccountArmID string + err = json.Unmarshal(*v, &automationAccountArmID) + if err != nil { + return err + } + acpii.AutomationAccountArmID = &automationAccountArmID + } + case "instanceType": + if v != nil { + var instanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails + err = json.Unmarshal(*v, &instanceType) + if err != nil { + return err + } + acpii.InstanceType = instanceType + } + } + } + + return nil +} + +// A2ACrossClusterMigrationApplyRecoveryPointInput applyRecoveryPoint input specific to +// A2ACrossClusterMigration provider. +type A2ACrossClusterMigrationApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + accmarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmarpi.InstanceType != "" { + objectMap["instanceType"] = accmarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return &accmarpi, true +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &accmarpi, true +} + +// A2ACrossClusterMigrationContainerCreationInput a2ACrossClusterMigration cloud creation input. +type A2ACrossClusterMigrationContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) MarshalJSON() ([]byte, error) { + accmcci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmcci.InstanceType != "" { + objectMap["instanceType"] = accmcci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return &accmcci, true +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &accmcci, true +} + +// A2ACrossClusterMigrationEnableProtectionInput a2A Cross-Cluster Migration enable protection input. +type A2ACrossClusterMigrationEnableProtectionInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) MarshalJSON() ([]byte, error) { + accmepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmepi.FabricObjectID != nil { + objectMap["fabricObjectId"] = accmepi.FabricObjectID + } + if accmepi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = accmepi.RecoveryContainerID + } + if accmepi.InstanceType != "" { + objectMap["instanceType"] = accmepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return &accmepi, true +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &accmepi, true +} + +// A2ACrossClusterMigrationPolicyCreationInput a2A Cross-Cluster Migration Policy creation input. +type A2ACrossClusterMigrationPolicyCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) MarshalJSON() ([]byte, error) { + accmpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmpci.InstanceType != "" { + objectMap["instanceType"] = accmpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return &accmpci, true +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &accmpci, true +} + +// A2ACrossClusterMigrationReplicationDetails a2A provider specific settings. +type A2ACrossClusterMigrationReplicationDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryFabricLocation - Primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // OsType - The type of operating system. + OsType *string `json:"osType,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // LifecycleID - An id associated with the PE 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 item even though other internal Ids/ARM Id might be changing. + LifecycleID *string `json:"lifecycleId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) MarshalJSON() ([]byte, error) { + accmrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmrd.FabricObjectID != nil { + objectMap["fabricObjectId"] = accmrd.FabricObjectID + } + if accmrd.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = accmrd.PrimaryFabricLocation + } + if accmrd.OsType != nil { + objectMap["osType"] = accmrd.OsType + } + if accmrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = accmrd.VMProtectionState + } + if accmrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = accmrd.VMProtectionStateDescription + } + if accmrd.LifecycleID != nil { + objectMap["lifecycleId"] = accmrd.LifecycleID + } + if accmrd.InstanceType != "" { + objectMap["instanceType"] = accmrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return &accmrd, true +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &accmrd, true +} + +// A2AEnableProtectionInput a2A enable protection input. +type A2AEnableProtectionInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryAzureNetworkID - The recovery Azure virtual network ARM id. + RecoveryAzureNetworkID *string `json:"recoveryAzureNetworkId,omitempty"` + // RecoverySubnetName - The recovery subnet name. + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + // RecoveryVirtualMachineScaleSetID - The virtual machine scale set Id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) MarshalJSON() ([]byte, error) { + aepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aepi.FabricObjectID != nil { + objectMap["fabricObjectId"] = aepi.FabricObjectID + } + if aepi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = aepi.RecoveryContainerID + } + if aepi.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aepi.RecoveryResourceGroupID + } + if aepi.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aepi.RecoveryCloudServiceID + } + if aepi.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = aepi.RecoveryAvailabilitySetID + } + if aepi.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aepi.RecoveryProximityPlacementGroupID + } + if aepi.VMDisks != nil { + objectMap["vmDisks"] = aepi.VMDisks + } + if aepi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aepi.VMManagedDisks + } + if aepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = aepi.MultiVMGroupName + } + if aepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = aepi.MultiVMGroupID + } + if aepi.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aepi.RecoveryBootDiagStorageAccountID + } + if aepi.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aepi.DiskEncryptionInfo + } + if aepi.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = aepi.RecoveryAvailabilityZone + } + if aepi.RecoveryAzureNetworkID != nil { + objectMap["recoveryAzureNetworkId"] = aepi.RecoveryAzureNetworkID + } + if aepi.RecoverySubnetName != nil { + objectMap["recoverySubnetName"] = aepi.RecoverySubnetName + } + if aepi.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aepi.RecoveryVirtualMachineScaleSetID + } + if aepi.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = aepi.RecoveryCapacityReservationGroupID + } + if aepi.InstanceType != "" { + objectMap["instanceType"] = aepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return &aepi, true +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &aepi, true +} + +// A2AEventDetails model class for event details of a A2A event. +type A2AEventDetails struct { + // ProtectedItemName - The protected item arm name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // FabricObjectID - The azure vm arm id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // FabricName - Fabric arm name. + FabricName *string `json:"fabricName,omitempty"` + // FabricLocation - The fabric location. + FabricLocation *string `json:"fabricLocation,omitempty"` + // RemoteFabricName - Remote fabric arm name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // RemoteFabricLocation - Remote fabric location. + RemoteFabricLocation *string `json:"remoteFabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AEventDetails. +func (aed A2AEventDetails) MarshalJSON() ([]byte, error) { + aed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aed.ProtectedItemName != nil { + objectMap["protectedItemName"] = aed.ProtectedItemName + } + if aed.FabricObjectID != nil { + objectMap["fabricObjectId"] = aed.FabricObjectID + } + if aed.FabricName != nil { + objectMap["fabricName"] = aed.FabricName + } + if aed.FabricLocation != nil { + objectMap["fabricLocation"] = aed.FabricLocation + } + if aed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = aed.RemoteFabricName + } + if aed.RemoteFabricLocation != nil { + objectMap["remoteFabricLocation"] = aed.RemoteFabricLocation + } + if aed.InstanceType != "" { + objectMap["instanceType"] = aed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return &aed, true +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &aed, true +} + +// A2APolicyCreationInput a2A Policy creation input. +type A2APolicyCreationInput struct { + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) MarshalJSON() ([]byte, error) { + apci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apci.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = apci.RecoveryPointHistory + } + if apci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = apci.CrashConsistentFrequencyInMinutes + } + if apci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = apci.AppConsistentFrequencyInMinutes + } + if apci.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = apci.MultiVMSyncStatus + } + if apci.InstanceType != "" { + objectMap["instanceType"] = apci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return &apci, true +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &apci, true +} + +// A2APolicyDetails a2A specific policy details. +type A2APolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2APolicyDetails. +func (apd A2APolicyDetails) MarshalJSON() ([]byte, error) { + apd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = apd.RecoveryPointThresholdInMinutes + } + if apd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = apd.RecoveryPointHistory + } + if apd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = apd.AppConsistentFrequencyInMinutes + } + if apd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = apd.MultiVMSyncStatus + } + if apd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = apd.CrashConsistentFrequencyInMinutes + } + if apd.InstanceType != "" { + objectMap["instanceType"] = apd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return &apd, true +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &apd, true +} + +// A2AProtectedDiskDetails a2A protected disk details. +type A2AProtectedDiskDetails struct { + // DiskURI - The disk uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountID - The recovery disk storage account. + RecoveryAzureStorageAccountID *string `json:"recoveryAzureStorageAccountId,omitempty"` + // PrimaryDiskAzureStorageAccountID - The primary disk storage account. + PrimaryDiskAzureStorageAccountID *string `json:"primaryDiskAzureStorageAccountId,omitempty"` + // RecoveryDiskURI - Recovery disk uri. + RecoveryDiskURI *string `json:"recoveryDiskUri,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // DiskType - The type of disk. + DiskType *string `json:"diskType,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *bool `json:"resyncRequired,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // DataPendingInStagingStorageAccountInMB - The data pending for replication in MB at staging account. + DataPendingInStagingStorageAccountInMB *float64 `json:"dataPendingInStagingStorageAccountInMB,omitempty"` + // DataPendingAtSourceAgentInMB - The data pending at source virtual machine in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // DiskState - The disk state. + DiskState *string `json:"diskState,omitempty"` + // AllowedDiskLevelOperation - The disk level operations list. + AllowedDiskLevelOperation *[]string `json:"allowedDiskLevelOperation,omitempty"` + // IsDiskEncrypted - A value indicating whether vm has encrypted os disk or not. + IsDiskEncrypted *bool `json:"isDiskEncrypted,omitempty"` + // SecretIdentifier - The secret URL / identifier (BEK). + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // DekKeyVaultArmID - The KeyVault resource id for secret (BEK). + DekKeyVaultArmID *string `json:"dekKeyVaultArmId,omitempty"` + // IsDiskKeyEncrypted - A value indicating whether disk key got encrypted or not. + IsDiskKeyEncrypted *bool `json:"isDiskKeyEncrypted,omitempty"` + // KeyIdentifier - The key URL / identifier (KEK). + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KekKeyVaultArmID - The KeyVault resource id for key (KEK). + KekKeyVaultArmID *string `json:"kekKeyVaultArmId,omitempty"` + // FailoverDiskName - The failover name for the managed disk. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The test failover name for the managed disk. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AProtectedManagedDiskDetails a2A protected managed disk details. +type A2AProtectedManagedDiskDetails struct { + // DiskID - The managed disk Arm id. + DiskID *string `json:"diskId,omitempty"` + // RecoveryResourceGroupID - The recovery disk resource group Arm Id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryTargetDiskID - Recovery target disk Arm Id. + RecoveryTargetDiskID *string `json:"recoveryTargetDiskId,omitempty"` + // RecoveryReplicaDiskID - Recovery replica disk Arm Id. + RecoveryReplicaDiskID *string `json:"recoveryReplicaDiskId,omitempty"` + // RecoveryOrignalTargetDiskID - Recovery original target disk Arm Id. + RecoveryOrignalTargetDiskID *string `json:"recoveryOrignalTargetDiskId,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // PrimaryDiskEncryptionSetID - The primary disk encryption set Id. + PrimaryDiskEncryptionSetID *string `json:"primaryDiskEncryptionSetId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // DiskType - The type of disk. + DiskType *string `json:"diskType,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *bool `json:"resyncRequired,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // DataPendingInStagingStorageAccountInMB - The data pending for replication in MB at staging account. + DataPendingInStagingStorageAccountInMB *float64 `json:"dataPendingInStagingStorageAccountInMB,omitempty"` + // DataPendingAtSourceAgentInMB - The data pending at source virtual machine in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // DiskState - The disk state. + DiskState *string `json:"diskState,omitempty"` + // AllowedDiskLevelOperation - The disk level operations list. + AllowedDiskLevelOperation *[]string `json:"allowedDiskLevelOperation,omitempty"` + // IsDiskEncrypted - A value indicating whether vm has encrypted os disk or not. + IsDiskEncrypted *bool `json:"isDiskEncrypted,omitempty"` + // SecretIdentifier - The secret URL / identifier (BEK). + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // DekKeyVaultArmID - The KeyVault resource id for secret (BEK). + DekKeyVaultArmID *string `json:"dekKeyVaultArmId,omitempty"` + // IsDiskKeyEncrypted - A value indicating whether disk key got encrypted or not. + IsDiskKeyEncrypted *bool `json:"isDiskKeyEncrypted,omitempty"` + // KeyIdentifier - The key URL / identifier (KEK). + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KekKeyVaultArmID - The KeyVault resource id for key (KEK). + KekKeyVaultArmID *string `json:"kekKeyVaultArmId,omitempty"` + // FailoverDiskName - The failover name for the managed disk. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The test failover name for the managed disk. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AProtectionContainerMappingDetails a2A provider specific settings. +type A2AProtectionContainerMappingDetails struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // ScheduleName - The schedule arm name. + ScheduleName *string `json:"scheduleName,omitempty"` + // JobScheduleName - The job schedule arm name. + JobScheduleName *string `json:"jobScheduleName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + apcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apcmd.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = apcmd.AgentAutoUpdateStatus + } + if apcmd.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = apcmd.AutomationAccountArmID + } + if apcmd.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = apcmd.AutomationAccountAuthenticationType + } + if apcmd.ScheduleName != nil { + objectMap["scheduleName"] = apcmd.ScheduleName + } + if apcmd.JobScheduleName != nil { + objectMap["jobScheduleName"] = apcmd.JobScheduleName + } + if apcmd.InstanceType != "" { + objectMap["instanceType"] = apcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return &apcmd, true +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &apcmd, true +} + +// A2AProtectionIntentDiskInputDetails azure VM unmanaged disk input details. +type A2AProtectionIntentDiskInputDetails struct { + // DiskURI - The disk Uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountCustomInput - The recovery VHD storage account input. + RecoveryAzureStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"recoveryAzureStorageAccountCustomInput,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for A2AProtectionIntentDiskInputDetails struct. +func (apidid *A2AProtectionIntentDiskInputDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "diskUri": + if v != nil { + var diskURI string + err = json.Unmarshal(*v, &diskURI) + if err != nil { + return err + } + apidid.DiskURI = &diskURI + } + case "recoveryAzureStorageAccountCustomInput": + if v != nil { + recoveryAzureStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apidid.RecoveryAzureStorageAccountCustomInput = recoveryAzureStorageAccountCustomInput + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apidid.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + } + } + + return nil +} + +// A2AProtectionIntentManagedDiskInputDetails azure VM managed disk input details. +type A2AProtectionIntentManagedDiskInputDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` + // RecoveryResourceGroupCustomInput - The recovery resource group input. + RecoveryResourceGroupCustomInput BasicRecoveryResourceGroupCustomDetails `json:"recoveryResourceGroupCustomInput,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for one / single pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for A2AProtectionIntentManagedDiskInputDetails struct. +func (apimdid *A2AProtectionIntentManagedDiskInputDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "diskId": + if v != nil { + var diskID string + err = json.Unmarshal(*v, &diskID) + if err != nil { + return err + } + apimdid.DiskID = &diskID + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apimdid.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + case "recoveryResourceGroupCustomInput": + if v != nil { + recoveryResourceGroupCustomInput, err := unmarshalBasicRecoveryResourceGroupCustomDetails(*v) + if err != nil { + return err + } + apimdid.RecoveryResourceGroupCustomInput = recoveryResourceGroupCustomInput + } + case "recoveryReplicaDiskAccountType": + if v != nil { + var recoveryReplicaDiskAccountType string + err = json.Unmarshal(*v, &recoveryReplicaDiskAccountType) + if err != nil { + return err + } + apimdid.RecoveryReplicaDiskAccountType = &recoveryReplicaDiskAccountType + } + case "recoveryTargetDiskAccountType": + if v != nil { + var recoveryTargetDiskAccountType string + err = json.Unmarshal(*v, &recoveryTargetDiskAccountType) + if err != nil { + return err + } + apimdid.RecoveryTargetDiskAccountType = &recoveryTargetDiskAccountType + } + case "recoveryDiskEncryptionSetId": + if v != nil { + var recoveryDiskEncryptionSetID string + err = json.Unmarshal(*v, &recoveryDiskEncryptionSetID) + if err != nil { + return err + } + apimdid.RecoveryDiskEncryptionSetID = &recoveryDiskEncryptionSetID + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + apimdid.DiskEncryptionInfo = &diskEncryptionInfo + } + } + } + + return nil +} + +// A2ARecoveryPointDetails a2A provider specific recovery point details. +type A2ARecoveryPointDetails struct { + // RecoveryPointSyncType - A value indicating whether the recovery point is multi VM consistent. Possible values include: 'MultiVMSyncRecoveryPoint', 'PerVMRecoveryPoint' + RecoveryPointSyncType RecoveryPointSyncType `json:"recoveryPointSyncType,omitempty"` + // Disks - List of disk ids representing a recovery point. + Disks *[]string `json:"disks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) MarshalJSON() ([]byte, error) { + arpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if arpd.RecoveryPointSyncType != "" { + objectMap["recoveryPointSyncType"] = arpd.RecoveryPointSyncType + } + if arpd.Disks != nil { + objectMap["disks"] = arpd.Disks + } + if arpd.InstanceType != "" { + objectMap["instanceType"] = arpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return &arpd, true +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &arpd, true +} + +// A2ARemoveDisksInput a2A remove disk(s) input. +type A2ARemoveDisksInput struct { + // VMDisksUris - The list of vm disk vhd URIs. + VMDisksUris *[]string `json:"vmDisksUris,omitempty"` + // VMManagedDisksIds - The list of vm managed disk Ids. + VMManagedDisksIds *[]string `json:"vmManagedDisksIds,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput', 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRemoveDisksProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) MarshalJSON() ([]byte, error) { + ardi.InstanceType = InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ardi.VMDisksUris != nil { + objectMap["vmDisksUris"] = ardi.VMDisksUris + } + if ardi.VMManagedDisksIds != nil { + objectMap["vmManagedDisksIds"] = ardi.VMManagedDisksIds + } + if ardi.InstanceType != "" { + objectMap["instanceType"] = ardi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARemoveDisksInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) { + return &ardi, true +} + +// AsRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsBasicRemoveDisksProviderSpecificInput() (BasicRemoveDisksProviderSpecificInput, bool) { + return &ardi, true +} + +// A2AReplicationDetails a2A provider specific settings. +type A2AReplicationDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // InitialPrimaryZone - READ-ONLY; The initial primary availability zone. + InitialPrimaryZone *string `json:"initialPrimaryZone,omitempty"` + // InitialPrimaryFabricLocation - READ-ONLY; The initial primary fabric location. + InitialPrimaryFabricLocation *string `json:"initialPrimaryFabricLocation,omitempty"` + // InitialRecoveryZone - READ-ONLY; The initial recovery availability zone. + InitialRecoveryZone *string `json:"initialRecoveryZone,omitempty"` + // InitialRecoveryFabricLocation - READ-ONLY; The initial recovery fabric location. + InitialRecoveryFabricLocation *string `json:"initialRecoveryFabricLocation,omitempty"` + // MultiVMGroupID - The multi vm group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupCreateOption - Whether Multi VM group is auto created or specified by user. Possible values include: 'AutoCreated', 'UserSpecified' + MultiVMGroupCreateOption MultiVMGroupCreateOption `json:"multiVmGroupCreateOption,omitempty"` + // ManagementID - The management Id. + ManagementID *string `json:"managementId,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]A2AProtectedDiskDetails `json:"protectedDisks,omitempty"` + // UnprotectedDisks - The list of unprotected disks. + UnprotectedDisks *[]A2AUnprotectedDiskDetails `json:"unprotectedDisks,omitempty"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]A2AProtectedManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // RecoveryBootDiagStorageAccountID - The recovery boot diagnostic storage account Arm Id. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // PrimaryFabricLocation - Primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // RecoveryFabricLocation - The recovery fabric location. + RecoveryFabricLocation *string `json:"recoveryFabricLocation,omitempty"` + // OsType - The type of operating system. + OsType *string `json:"osType,omitempty"` + // RecoveryAzureVMSize - The size of recovery virtual machine. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureVMName - The name of recovery virtual machine. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureResourceGroupID - The recovery resource group. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryCloudService - The recovery cloud service. + RecoveryCloudService *string `json:"recoveryCloudService,omitempty"` + // RecoveryAvailabilitySet - The recovery availability set. + RecoveryAvailabilitySet *string `json:"recoveryAvailabilitySet,omitempty"` + // SelectedRecoveryAzureNetworkID - The recovery virtual network. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The test failover virtual network. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // VMNics - The virtual machine nic details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMSyncedConfigDetails - The synced configuration details. + VMSyncedConfigDetails *AzureToAzureVMSyncedConfigDetails `json:"vmSyncedConfigDetails,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // IsReplicationAgentUpdateRequired - A value indicating whether replication agent update is required. + IsReplicationAgentUpdateRequired *bool `json:"isReplicationAgentUpdateRequired,omitempty"` + // AgentCertificateExpiryDate - READ-ONLY; Agent certificate expiry date. + AgentCertificateExpiryDate *date.Time `json:"agentCertificateExpiryDate,omitempty"` + // IsReplicationAgentCertificateUpdateRequired - A value indicating whether agent certificate update is required. + IsReplicationAgentCertificateUpdateRequired *bool `json:"isReplicationAgentCertificateUpdateRequired,omitempty"` + // RecoveryFabricObjectID - The recovery fabric object Id. + RecoveryFabricObjectID *string `json:"recoveryFabricObjectId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // LifecycleID - An id associated with the PE 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 item even though other internal Ids/ARM Id might be changing. + LifecycleID *string `json:"lifecycleId,omitempty"` + // TestFailoverRecoveryFabricObjectID - The test failover fabric object Id. + TestFailoverRecoveryFabricObjectID *string `json:"testFailoverRecoveryFabricObjectId,omitempty"` + // RpoInSeconds - The last RPO value in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // LastRpoCalculatedTime - The time (in UTC) when the last RPO value was calculated by Protection Service. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // PrimaryAvailabilityZone - The primary availability zone. + PrimaryAvailabilityZone *string `json:"primaryAvailabilityZone,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // VMEncryptionType - READ-ONLY; The encryption type of the VM. Possible values include: 'NotEncrypted', 'OnePassEncrypted', 'TwoPassEncrypted' + VMEncryptionType VMEncryptionType `json:"vmEncryptionType,omitempty"` + // TfoAzureVMName - The test failover vm name. + TfoAzureVMName *string `json:"tfoAzureVMName,omitempty"` + // RecoveryAzureGeneration - READ-ONLY; The recovery azure generation. + RecoveryAzureGeneration *string `json:"recoveryAzureGeneration,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // RecoveryVirtualMachineScaleSetID - The recovery virtual machine scale set id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReplicationDetails. +func (ard A2AReplicationDetails) MarshalJSON() ([]byte, error) { + ard.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ard.FabricObjectID != nil { + objectMap["fabricObjectId"] = ard.FabricObjectID + } + if ard.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = ard.MultiVMGroupID + } + if ard.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = ard.MultiVMGroupName + } + if ard.MultiVMGroupCreateOption != "" { + objectMap["multiVmGroupCreateOption"] = ard.MultiVMGroupCreateOption + } + if ard.ManagementID != nil { + objectMap["managementId"] = ard.ManagementID + } + if ard.ProtectedDisks != nil { + objectMap["protectedDisks"] = ard.ProtectedDisks + } + if ard.UnprotectedDisks != nil { + objectMap["unprotectedDisks"] = ard.UnprotectedDisks + } + if ard.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = ard.ProtectedManagedDisks + } + if ard.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = ard.RecoveryBootDiagStorageAccountID + } + if ard.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = ard.PrimaryFabricLocation + } + if ard.RecoveryFabricLocation != nil { + objectMap["recoveryFabricLocation"] = ard.RecoveryFabricLocation + } + if ard.OsType != nil { + objectMap["osType"] = ard.OsType + } + if ard.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = ard.RecoveryAzureVMSize + } + if ard.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVMName"] = ard.RecoveryAzureVMName + } + if ard.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = ard.RecoveryAzureResourceGroupID + } + if ard.RecoveryCloudService != nil { + objectMap["recoveryCloudService"] = ard.RecoveryCloudService + } + if ard.RecoveryAvailabilitySet != nil { + objectMap["recoveryAvailabilitySet"] = ard.RecoveryAvailabilitySet + } + if ard.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = ard.SelectedRecoveryAzureNetworkID + } + if ard.SelectedTfoAzureNetworkID != nil { + objectMap["selectedTfoAzureNetworkId"] = ard.SelectedTfoAzureNetworkID + } + if ard.VMNics != nil { + objectMap["vmNics"] = ard.VMNics + } + if ard.VMSyncedConfigDetails != nil { + objectMap["vmSyncedConfigDetails"] = ard.VMSyncedConfigDetails + } + if ard.MonitoringPercentageCompletion != nil { + objectMap["monitoringPercentageCompletion"] = ard.MonitoringPercentageCompletion + } + if ard.MonitoringJobType != nil { + objectMap["monitoringJobType"] = ard.MonitoringJobType + } + if ard.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = ard.LastHeartbeat + } + if ard.AgentVersion != nil { + objectMap["agentVersion"] = ard.AgentVersion + } + if ard.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = ard.AgentExpiryDate + } + if ard.IsReplicationAgentUpdateRequired != nil { + objectMap["isReplicationAgentUpdateRequired"] = ard.IsReplicationAgentUpdateRequired + } + if ard.IsReplicationAgentCertificateUpdateRequired != nil { + objectMap["isReplicationAgentCertificateUpdateRequired"] = ard.IsReplicationAgentCertificateUpdateRequired + } + if ard.RecoveryFabricObjectID != nil { + objectMap["recoveryFabricObjectId"] = ard.RecoveryFabricObjectID + } + if ard.VMProtectionState != nil { + objectMap["vmProtectionState"] = ard.VMProtectionState + } + if ard.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = ard.VMProtectionStateDescription + } + if ard.LifecycleID != nil { + objectMap["lifecycleId"] = ard.LifecycleID + } + if ard.TestFailoverRecoveryFabricObjectID != nil { + objectMap["testFailoverRecoveryFabricObjectId"] = ard.TestFailoverRecoveryFabricObjectID + } + if ard.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = ard.RpoInSeconds + } + if ard.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = ard.LastRpoCalculatedTime + } + if ard.PrimaryAvailabilityZone != nil { + objectMap["primaryAvailabilityZone"] = ard.PrimaryAvailabilityZone + } + if ard.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = ard.RecoveryAvailabilityZone + } + if ard.TfoAzureVMName != nil { + objectMap["tfoAzureVMName"] = ard.TfoAzureVMName + } + if ard.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = ard.RecoveryProximityPlacementGroupID + } + if ard.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = ard.AutoProtectionOfDataDisk + } + if ard.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = ard.RecoveryVirtualMachineScaleSetID + } + if ard.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = ard.RecoveryCapacityReservationGroupID + } + if ard.InstanceType != "" { + objectMap["instanceType"] = ard.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return &ard, true +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &ard, true +} + +// A2AReplicationIntentDetails a2A provider specific settings. +type A2AReplicationIntentDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryLocation - The primary location for the virtual machine. + PrimaryLocation *string `json:"primaryLocation,omitempty"` + // RecoveryLocation - The recovery location for the virtual machine. + RecoveryLocation *string `json:"recoveryLocation,omitempty"` + // RecoverySubscriptionID - The recovery subscription Id of the virtual machine. + RecoverySubscriptionID *string `json:"recoverySubscriptionId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AProtectionIntentDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AProtectionIntentManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ProtectionProfile - The protection profile custom details. + ProtectionProfile BasicProtectionProfileCustomDetails `json:"protectionProfile,omitempty"` + // PrimaryStagingStorageAccount - The primary staging storage account details. + PrimaryStagingStorageAccount BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccount,omitempty"` + // RecoveryAvailabilitySet - The recovery availability set details. + RecoveryAvailabilitySet BasicRecoveryAvailabilitySetCustomDetails `json:"recoveryAvailabilitySet,omitempty"` + // RecoveryVirtualNetwork - The recovery virtual network details. + RecoveryVirtualNetwork BasicRecoveryVirtualNetworkCustomDetails `json:"recoveryVirtualNetwork,omitempty"` + // RecoveryProximityPlacementGroup - The recovery proximity placement group custom details. + RecoveryProximityPlacementGroup BasicRecoveryProximityPlacementGroupCustomDetails `json:"recoveryProximityPlacementGroup,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccount - The boot diagnostic storage account. + RecoveryBootDiagStorageAccount BasicStorageAccountCustomDetails `json:"recoveryBootDiagStorageAccount,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryAvailabilityType - The recovery availability type of the virtual machine. + RecoveryAvailabilityType *string `json:"recoveryAvailabilityType,omitempty"` + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings', 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A' + InstanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) MarshalJSON() ([]byte, error) { + arid.InstanceType = InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if arid.FabricObjectID != nil { + objectMap["fabricObjectId"] = arid.FabricObjectID + } + if arid.PrimaryLocation != nil { + objectMap["primaryLocation"] = arid.PrimaryLocation + } + if arid.RecoveryLocation != nil { + objectMap["recoveryLocation"] = arid.RecoveryLocation + } + if arid.RecoverySubscriptionID != nil { + objectMap["recoverySubscriptionId"] = arid.RecoverySubscriptionID + } + if arid.VMDisks != nil { + objectMap["vmDisks"] = arid.VMDisks + } + if arid.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = arid.VMManagedDisks + } + if arid.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = arid.RecoveryResourceGroupID + } + objectMap["protectionProfile"] = arid.ProtectionProfile + objectMap["primaryStagingStorageAccount"] = arid.PrimaryStagingStorageAccount + objectMap["recoveryAvailabilitySet"] = arid.RecoveryAvailabilitySet + objectMap["recoveryVirtualNetwork"] = arid.RecoveryVirtualNetwork + objectMap["recoveryProximityPlacementGroup"] = arid.RecoveryProximityPlacementGroup + if arid.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = arid.AutoProtectionOfDataDisk + } + if arid.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = arid.MultiVMGroupName + } + if arid.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = arid.MultiVMGroupID + } + objectMap["recoveryBootDiagStorageAccount"] = arid.RecoveryBootDiagStorageAccount + if arid.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = arid.DiskEncryptionInfo + } + if arid.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = arid.RecoveryAvailabilityZone + } + if arid.RecoveryAvailabilityType != nil { + objectMap["recoveryAvailabilityType"] = arid.RecoveryAvailabilityType + } + if arid.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = arid.AgentAutoUpdateStatus + } + if arid.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = arid.AutomationAccountArmID + } + if arid.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = arid.AutomationAccountAuthenticationType + } + if arid.InstanceType != "" { + objectMap["instanceType"] = arid.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReplicationIntentDetails is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) { + return &arid, true +} + +// AsReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsBasicReplicationProtectionIntentProviderSpecificSettings() (BasicReplicationProtectionIntentProviderSpecificSettings, bool) { + return &arid, true +} + +// UnmarshalJSON is the custom unmarshaler for A2AReplicationIntentDetails struct. +func (arid *A2AReplicationIntentDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "fabricObjectId": + if v != nil { + var fabricObjectID string + err = json.Unmarshal(*v, &fabricObjectID) + if err != nil { + return err + } + arid.FabricObjectID = &fabricObjectID + } + case "primaryLocation": + if v != nil { + var primaryLocation string + err = json.Unmarshal(*v, &primaryLocation) + if err != nil { + return err + } + arid.PrimaryLocation = &primaryLocation + } + case "recoveryLocation": + if v != nil { + var recoveryLocation string + err = json.Unmarshal(*v, &recoveryLocation) + if err != nil { + return err + } + arid.RecoveryLocation = &recoveryLocation + } + case "recoverySubscriptionId": + if v != nil { + var recoverySubscriptionID string + err = json.Unmarshal(*v, &recoverySubscriptionID) + if err != nil { + return err + } + arid.RecoverySubscriptionID = &recoverySubscriptionID + } + case "vmDisks": + if v != nil { + var VMDisks []A2AProtectionIntentDiskInputDetails + err = json.Unmarshal(*v, &VMDisks) + if err != nil { + return err + } + arid.VMDisks = &VMDisks + } + case "vmManagedDisks": + if v != nil { + var VMManagedDisks []A2AProtectionIntentManagedDiskInputDetails + err = json.Unmarshal(*v, &VMManagedDisks) + if err != nil { + return err + } + arid.VMManagedDisks = &VMManagedDisks + } + case "recoveryResourceGroupId": + if v != nil { + var recoveryResourceGroupID string + err = json.Unmarshal(*v, &recoveryResourceGroupID) + if err != nil { + return err + } + arid.RecoveryResourceGroupID = &recoveryResourceGroupID + } + case "protectionProfile": + if v != nil { + protectionProfile, err := unmarshalBasicProtectionProfileCustomDetails(*v) + if err != nil { + return err + } + arid.ProtectionProfile = protectionProfile + } + case "primaryStagingStorageAccount": + if v != nil { + primaryStagingStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + arid.PrimaryStagingStorageAccount = primaryStagingStorageAccount + } + case "recoveryAvailabilitySet": + if v != nil { + recoveryAvailabilitySet, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryAvailabilitySet = recoveryAvailabilitySet + } + case "recoveryVirtualNetwork": + if v != nil { + recoveryVirtualNetwork, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryVirtualNetwork = recoveryVirtualNetwork + } + case "recoveryProximityPlacementGroup": + if v != nil { + recoveryProximityPlacementGroup, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryProximityPlacementGroup = recoveryProximityPlacementGroup + } + case "autoProtectionOfDataDisk": + if v != nil { + var autoProtectionOfDataDisk AutoProtectionOfDataDisk + err = json.Unmarshal(*v, &autoProtectionOfDataDisk) + if err != nil { + return err + } + arid.AutoProtectionOfDataDisk = autoProtectionOfDataDisk + } + case "multiVmGroupName": + if v != nil { + var multiVMGroupName string + err = json.Unmarshal(*v, &multiVMGroupName) + if err != nil { + return err + } + arid.MultiVMGroupName = &multiVMGroupName + } + case "multiVmGroupId": + if v != nil { + var multiVMGroupID string + err = json.Unmarshal(*v, &multiVMGroupID) + if err != nil { + return err + } + arid.MultiVMGroupID = &multiVMGroupID + } + case "recoveryBootDiagStorageAccount": + if v != nil { + recoveryBootDiagStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryBootDiagStorageAccount = recoveryBootDiagStorageAccount + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + arid.DiskEncryptionInfo = &diskEncryptionInfo + } + case "recoveryAvailabilityZone": + if v != nil { + var recoveryAvailabilityZone string + err = json.Unmarshal(*v, &recoveryAvailabilityZone) + if err != nil { + return err + } + arid.RecoveryAvailabilityZone = &recoveryAvailabilityZone + } + case "recoveryAvailabilityType": + if v != nil { + var recoveryAvailabilityType string + err = json.Unmarshal(*v, &recoveryAvailabilityType) + if err != nil { + return err + } + arid.RecoveryAvailabilityType = &recoveryAvailabilityType + } + case "agentAutoUpdateStatus": + if v != nil { + var agentAutoUpdateStatus AgentAutoUpdateStatus + err = json.Unmarshal(*v, &agentAutoUpdateStatus) + if err != nil { + return err + } + arid.AgentAutoUpdateStatus = agentAutoUpdateStatus + } + case "automationAccountArmId": + if v != nil { + var automationAccountArmID string + err = json.Unmarshal(*v, &automationAccountArmID) + if err != nil { + return err + } + arid.AutomationAccountArmID = &automationAccountArmID + } + case "automationAccountAuthenticationType": + if v != nil { + var automationAccountAuthenticationType AutomationAccountAuthenticationType + err = json.Unmarshal(*v, &automationAccountAuthenticationType) + if err != nil { + return err + } + arid.AutomationAccountAuthenticationType = automationAccountAuthenticationType + } + case "instanceType": + if v != nil { + var instanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings + err = json.Unmarshal(*v, &instanceType) + if err != nil { + return err + } + arid.InstanceType = instanceType + } + } + } + + return nil +} + +// A2AReprotectInput azure specific reprotect input. +type A2AReprotectInput struct { + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReprotectInput. +func (ari A2AReprotectInput) MarshalJSON() ([]byte, error) { + ari.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ari.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = ari.RecoveryContainerID + } + if ari.VMDisks != nil { + objectMap["vmDisks"] = ari.VMDisks + } + if ari.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = ari.RecoveryResourceGroupID + } + if ari.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = ari.RecoveryCloudServiceID + } + if ari.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = ari.RecoveryAvailabilitySetID + } + if ari.PolicyID != nil { + objectMap["policyId"] = ari.PolicyID + } + if ari.InstanceType != "" { + objectMap["instanceType"] = ari.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return &ari, true +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &ari, true +} + +// A2ASwitchProtectionInput a2A specific switch protection input. +type A2ASwitchProtectionInput struct { + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // RecoveryVirtualMachineScaleSetID - The virtual machine scale set id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput', 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicSwitchProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) MarshalJSON() ([]byte, error) { + aspi.InstanceType = InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aspi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = aspi.RecoveryContainerID + } + if aspi.VMDisks != nil { + objectMap["vmDisks"] = aspi.VMDisks + } + if aspi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aspi.VMManagedDisks + } + if aspi.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aspi.RecoveryResourceGroupID + } + if aspi.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aspi.RecoveryCloudServiceID + } + if aspi.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = aspi.RecoveryAvailabilitySetID + } + if aspi.PolicyID != nil { + objectMap["policyId"] = aspi.PolicyID + } + if aspi.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aspi.RecoveryBootDiagStorageAccountID + } + if aspi.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = aspi.RecoveryAvailabilityZone + } + if aspi.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aspi.RecoveryProximityPlacementGroupID + } + if aspi.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aspi.RecoveryVirtualMachineScaleSetID + } + if aspi.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = aspi.RecoveryCapacityReservationGroupID + } + if aspi.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aspi.DiskEncryptionInfo + } + if aspi.InstanceType != "" { + objectMap["instanceType"] = aspi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ASwitchProtectionInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) { + return &aspi, true +} + +// AsSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsBasicSwitchProtectionProviderSpecificInput() (BasicSwitchProtectionProviderSpecificInput, bool) { + return &aspi, true +} + +// A2ATestFailoverInput a2A provider specific input for test failover. +type A2ATestFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for TFO or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) MarshalJSON() ([]byte, error) { + atfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if atfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = atfi.RecoveryPointID + } + if atfi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = atfi.CloudServiceCreationOption + } + if atfi.InstanceType != "" { + objectMap["instanceType"] = atfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return &atfi, true +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &atfi, true +} + +// A2AUnplannedFailoverInput a2A provider specific input for unplanned failover. +type A2AUnplannedFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for failover or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + aufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = aufi.RecoveryPointID + } + if aufi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = aufi.CloudServiceCreationOption + } + if aufi.InstanceType != "" { + objectMap["instanceType"] = aufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return &aufi, true +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &aufi, true +} + +// A2AUnprotectedDiskDetails a2A unprotected disk details. +type A2AUnprotectedDiskDetails struct { + // DiskLunID - The source lun Id for the data disk. + DiskLunID *int32 `json:"diskLunId,omitempty"` + // DiskAutoProtectionStatus - A value indicating whether the disk auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + DiskAutoProtectionStatus AutoProtectionOfDataDisk `json:"diskAutoProtectionStatus,omitempty"` +} + +// A2AUpdateContainerMappingInput a2A update protection container mapping. +type A2AUpdateContainerMappingInput struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + aucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aucmi.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = aucmi.AgentAutoUpdateStatus + } + if aucmi.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = aucmi.AutomationAccountArmID + } + if aucmi.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = aucmi.AutomationAccountAuthenticationType + } + if aucmi.InstanceType != "" { + objectMap["instanceType"] = aucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return &aucmi, true +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &aucmi, true +} + +// A2AUpdateReplicationProtectedItemInput inMage Azure V2 input to update replication protected item. +type A2AUpdateReplicationProtectedItemInput struct { + // RecoveryCloudServiceID - The target cloud service ARM Id (for V1). + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryResourceGroupID - The target resource group ARM Id (for V2). + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ManagedDiskUpdateDetails - Managed disk update details. + ManagedDiskUpdateDetails *[]A2AVMManagedDiskUpdateDetails `json:"managedDiskUpdateDetails,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // DiskEncryptionInfo - The recovery os disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // TfoAzureVMName - The user given name for Test Failover VM. + TfoAzureVMName *string `json:"tfoAzureVMName,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // RecoveryVirtualMachineScaleSetID - The recovery virtual machine scale set Id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + aurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aurpii.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aurpii.RecoveryCloudServiceID + } + if aurpii.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aurpii.RecoveryResourceGroupID + } + if aurpii.ManagedDiskUpdateDetails != nil { + objectMap["managedDiskUpdateDetails"] = aurpii.ManagedDiskUpdateDetails + } + if aurpii.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aurpii.RecoveryBootDiagStorageAccountID + } + if aurpii.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aurpii.DiskEncryptionInfo + } + if aurpii.TfoAzureVMName != nil { + objectMap["tfoAzureVMName"] = aurpii.TfoAzureVMName + } + if aurpii.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aurpii.RecoveryProximityPlacementGroupID + } + if aurpii.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aurpii.RecoveryVirtualMachineScaleSetID + } + if aurpii.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = aurpii.RecoveryCapacityReservationGroupID + } + if aurpii.InstanceType != "" { + objectMap["instanceType"] = aurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return &aurpii, true +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &aurpii, true +} + +// A2AVMDiskInputDetails a2A disk input details. +type A2AVMDiskInputDetails struct { + // DiskURI - The disk Uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountID - The recovery VHD storage account Id. + RecoveryAzureStorageAccountID *string `json:"recoveryAzureStorageAccountId,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account Id. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` +} + +// A2AVMManagedDiskInputDetails a2A managed disk input details. +type A2AVMManagedDiskInputDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account Arm Id. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // RecoveryResourceGroupID - The target resource group Arm Id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for one / single pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` +} + +// A2AVMManagedDiskUpdateDetails a2A Vm managed disk update details. +type A2AVMManagedDiskUpdateDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type before failover. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type before failover. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // DiskEncryptionInfo - The recovery os disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // FailoverDiskName - The target disk name for unplanned failover operation. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The target disk name for test failover operation. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AZoneDetails zone details data. +type A2AZoneDetails struct { + // Source - Source zone info. + Source *string `json:"source,omitempty"` + // Target - The target zone info. + Target *string `json:"target,omitempty"` +} + +// AddDisksInput input for add disk(s) operation. +type AddDisksInput struct { + // Properties - Add disks input properties. + Properties *AddDisksInputProperties `json:"properties,omitempty"` +} + +// AddDisksInputProperties add Disks input properties. +type AddDisksInputProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicAddDisksProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AddDisksInputProperties struct. +func (adip *AddDisksInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicAddDisksProviderSpecificInput(*v) + if err != nil { + return err + } + adip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicAddDisksProviderSpecificInput add Disks provider specific input. +type BasicAddDisksProviderSpecificInput interface { + AsA2AAddDisksInput() (*A2AAddDisksInput, bool) + AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) +} + +// AddDisksProviderSpecificInput add Disks provider specific input. +type AddDisksProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeAddDisksProviderSpecificInput', 'InstanceTypeA2A' + InstanceType InstanceType `json:"instanceType,omitempty"` +} + +func unmarshalBasicAddDisksProviderSpecificInput(body []byte) (BasicAddDisksProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeA2A): + var aadi A2AAddDisksInput + err := json.Unmarshal(body, &aadi) + return aadi, err + default: + var adpsi AddDisksProviderSpecificInput + err := json.Unmarshal(body, &adpsi) + return adpsi, err + } +} +func unmarshalBasicAddDisksProviderSpecificInputArray(body []byte) ([]BasicAddDisksProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + adpsiArray := make([]BasicAddDisksProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + adpsi, err := unmarshalBasicAddDisksProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + adpsiArray[index] = adpsi + } + return adpsiArray, nil +} + +// MarshalJSON is the custom marshaler for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) MarshalJSON() ([]byte, error) { + adpsi.InstanceType = InstanceTypeAddDisksProviderSpecificInput + objectMap := make(map[string]interface{}) + if adpsi.InstanceType != "" { + objectMap["instanceType"] = adpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AAddDisksInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsA2AAddDisksInput() (*A2AAddDisksInput, bool) { + return nil, false +} + +// AsAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) { + return &adpsi, true +} + +// AsBasicAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsBasicAddDisksProviderSpecificInput() (BasicAddDisksProviderSpecificInput, bool) { + return &adpsi, true +} + +// AddRecoveryServicesProviderInput input required to add a provider. +type AddRecoveryServicesProviderInput struct { + // Properties - The properties of an add provider request. + Properties *AddRecoveryServicesProviderInputProperties `json:"properties,omitempty"` +} + +// AddRecoveryServicesProviderInputProperties the properties of an add provider request. +type AddRecoveryServicesProviderInputProperties struct { + // MachineName - The name of the machine where the provider is getting added. + MachineName *string `json:"machineName,omitempty"` + // MachineID - The Id of the machine where the provider is getting added. + MachineID *string `json:"machineId,omitempty"` + // BiosID - The Bios Id of the machine. + BiosID *string `json:"biosId,omitempty"` + // AuthenticationIdentityInput - The identity provider input for DRA authentication. + AuthenticationIdentityInput *IdentityProviderInput `json:"authenticationIdentityInput,omitempty"` + // ResourceAccessIdentityInput - The identity provider input for resource access. + ResourceAccessIdentityInput *IdentityProviderInput `json:"resourceAccessIdentityInput,omitempty"` + // DataPlaneAuthenticationIdentityInput - The identity provider input for data plane authentication. + DataPlaneAuthenticationIdentityInput *IdentityProviderInput `json:"dataPlaneAuthenticationIdentityInput,omitempty"` +} + +// AddVCenterRequest input required to add vCenter. +type AddVCenterRequest struct { + // Properties - The properties of an add vCenter request. + Properties *AddVCenterRequestProperties `json:"properties,omitempty"` +} + +// AddVCenterRequestProperties the properties of an add vCenter request. +type AddVCenterRequestProperties struct { + // FriendlyName - The friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the vCenter to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // ProcessServerID - The process server Id from where the discovery is orchestrated. + ProcessServerID *string `json:"processServerId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The account Id which has privileges to discover the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// AgentDetails agent details. +type AgentDetails struct { + // AgentID - READ-ONLY; The Id of the agent running on the server. + AgentID *string `json:"agentId,omitempty"` + // MachineID - READ-ONLY; The Id of the machine to which the agent is registered. + MachineID *string `json:"machineId,omitempty"` + // BiosID - READ-ONLY; The machine BIOS Id. + BiosID *string `json:"biosId,omitempty"` + // Fqdn - READ-ONLY; The machine FQDN. + Fqdn *string `json:"fqdn,omitempty"` + // Disks - READ-ONLY; The disks. + Disks *[]AgentDiskDetails `json:"disks,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentDetails. +func (ad AgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AgentDiskDetails agent disk details. +type AgentDiskDetails struct { + // DiskID - READ-ONLY; The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LunID - READ-ONLY; The lun of disk. + LunID *int32 `json:"lunId,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentDiskDetails. +func (add AgentDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Alert implements the Alert class. +type Alert struct { + autorest.Response `json:"-"` + // Properties - Alert related data. + Properties *AlertProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Alert. +func (a Alert) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.Properties != nil { + objectMap["properties"] = a.Properties + } + if a.Location != nil { + objectMap["location"] = a.Location + } + return json.Marshal(objectMap) +} + +// AlertCollection collection of alerts. +type AlertCollection struct { + autorest.Response `json:"-"` + // Value - The list of alerts. + Value *[]Alert `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// AlertCollectionIterator provides access to a complete listing of Alert values. +type AlertCollectionIterator struct { + i int + page AlertCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AlertCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AlertCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AlertCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AlertCollectionIterator) Response() AlertCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AlertCollectionIterator) Value() Alert { + if !iter.page.NotDone() { + return Alert{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AlertCollectionIterator type. +func NewAlertCollectionIterator(page AlertCollectionPage) AlertCollectionIterator { + return AlertCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ac AlertCollection) IsEmpty() bool { + return ac.Value == nil || len(*ac.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ac AlertCollection) hasNextLink() bool { + return ac.NextLink != nil && len(*ac.NextLink) != 0 +} + +// alertCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ac AlertCollection) alertCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ac.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ac.NextLink))) +} + +// AlertCollectionPage contains a page of Alert values. +type AlertCollectionPage struct { + fn func(context.Context, AlertCollection) (AlertCollection, error) + ac AlertCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AlertCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ac) + if err != nil { + return err + } + page.ac = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AlertCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AlertCollectionPage) NotDone() bool { + return !page.ac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AlertCollectionPage) Response() AlertCollection { + return page.ac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AlertCollectionPage) Values() []Alert { + if page.ac.IsEmpty() { + return nil + } + return *page.ac.Value +} + +// Creates a new instance of the AlertCollectionPage type. +func NewAlertCollectionPage(cur AlertCollection, getNextPage func(context.Context, AlertCollection) (AlertCollection, error)) AlertCollectionPage { + return AlertCollectionPage{ + fn: getNextPage, + ac: cur, + } +} + +// AlertProperties the properties of an alert. +type AlertProperties struct { + // SendToOwners - A value indicating whether to send email to subscription administrator. + SendToOwners *string `json:"sendToOwners,omitempty"` + // CustomEmailAddresses - The custom email address for sending emails. + CustomEmailAddresses *[]string `json:"customEmailAddresses,omitempty"` + // Locale - The locale for the email notification. + Locale *string `json:"locale,omitempty"` +} + +// ApplyRecoveryPointInput input to apply recovery point. +type ApplyRecoveryPointInput struct { + // Properties - The input properties to apply recovery point. + Properties *ApplyRecoveryPointInputProperties `json:"properties,omitempty"` +} + +// ApplyRecoveryPointInputProperties input properties to apply recovery point. +type ApplyRecoveryPointInputProperties struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // ProviderSpecificDetails - Provider specific input for applying recovery point. + ProviderSpecificDetails BasicApplyRecoveryPointProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ApplyRecoveryPointInputProperties struct. +func (arpip *ApplyRecoveryPointInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryPointId": + if v != nil { + var recoveryPointID string + err = json.Unmarshal(*v, &recoveryPointID) + if err != nil { + return err + } + arpip.RecoveryPointID = &recoveryPointID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicApplyRecoveryPointProviderSpecificInput(*v) + if err != nil { + return err + } + arpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicApplyRecoveryPointProviderSpecificInput provider specific input for apply recovery point. +type BasicApplyRecoveryPointProviderSpecificInput interface { + AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) + AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) + AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) + AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) + AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) + AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) +} + +// ApplyRecoveryPointProviderSpecificInput provider specific input for apply recovery point. +type ApplyRecoveryPointProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicApplyRecoveryPointProviderSpecificInput(body []byte) (BasicApplyRecoveryPointProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A): + var aarpi A2AApplyRecoveryPointInput + err := json.Unmarshal(body, &aarpi) + return aarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput + err := json.Unmarshal(body, &accmarpi) + return accmarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraarpi HyperVReplicaAzureApplyRecoveryPointInput + err := json.Unmarshal(body, &hvraarpi) + return hvraarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2): + var imavarpi InMageAzureV2ApplyRecoveryPointInput + err := json.Unmarshal(body, &imavarpi) + return imavarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm): + var imrarpi InMageRcmApplyRecoveryPointInput + err := json.Unmarshal(body, &imrarpi) + return imrarpi, err + default: + var arppsi ApplyRecoveryPointProviderSpecificInput + err := json.Unmarshal(body, &arppsi) + return arppsi, err + } +} +func unmarshalBasicApplyRecoveryPointProviderSpecificInputArray(body []byte) ([]BasicApplyRecoveryPointProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + arppsiArray := make([]BasicApplyRecoveryPointProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + arppsi, err := unmarshalBasicApplyRecoveryPointProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + arppsiArray[index] = arppsi + } + return arppsiArray, nil +} + +// MarshalJSON is the custom marshaler for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) MarshalJSON() ([]byte, error) { + arppsi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput + objectMap := make(map[string]interface{}) + if arppsi.InstanceType != "" { + objectMap["instanceType"] = arppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return &arppsi, true +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &arppsi, true +} + +// AsrJobDetails this class represents job details based on specific job type. +type AsrJobDetails struct { + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AsrJobDetails. +func (ajd AsrJobDetails) MarshalJSON() ([]byte, error) { + ajd.InstanceType = InstanceTypeAsrJobDetails + objectMap := make(map[string]interface{}) + if ajd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = ajd.AffectedObjectDetails + } + if ajd.InstanceType != "" { + objectMap["instanceType"] = ajd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return &ajd, true +} + +// AsExportJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &ajd, true +} + +// ASRTask task of the Job. +type ASRTask struct { + // TaskID - The Id. + TaskID *string `json:"taskId,omitempty"` + // Name - The unique Task name. + Name *string `json:"name,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // AllowedActions - The state/actions applicable on this task. + AllowedActions *[]string `json:"allowedActions,omitempty"` + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // State - The State. It is one of these values - NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or Other. + State *string `json:"state,omitempty"` + // StateDescription - The description of the task state. For example - For Succeeded state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. + StateDescription *string `json:"stateDescription,omitempty"` + // TaskType - The type of task. Details in CustomDetails property depend on this type. + TaskType *string `json:"taskType,omitempty"` + // CustomDetails - The custom task details based on the task type. + CustomDetails BasicTaskTypeDetails `json:"customDetails,omitempty"` + // GroupTaskCustomDetails - The custom task details based on the task type, if the task type is GroupTaskDetails or one of the types derived from it. + GroupTaskCustomDetails BasicGroupTaskDetails `json:"groupTaskCustomDetails,omitempty"` + // Errors - The task error details. + Errors *[]JobErrorDetails `json:"errors,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ASRTask struct. +func (at *ASRTask) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "taskId": + if v != nil { + var taskID string + err = json.Unmarshal(*v, &taskID) + if err != nil { + return err + } + at.TaskID = &taskID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + at.Name = &name + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + at.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + at.EndTime = &endTime + } + case "allowedActions": + if v != nil { + var allowedActions []string + err = json.Unmarshal(*v, &allowedActions) + if err != nil { + return err + } + at.AllowedActions = &allowedActions + } + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + at.FriendlyName = &friendlyName + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + at.State = &state + } + case "stateDescription": + if v != nil { + var stateDescription string + err = json.Unmarshal(*v, &stateDescription) + if err != nil { + return err + } + at.StateDescription = &stateDescription + } + case "taskType": + if v != nil { + var taskType string + err = json.Unmarshal(*v, &taskType) + if err != nil { + return err + } + at.TaskType = &taskType + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicTaskTypeDetails(*v) + if err != nil { + return err + } + at.CustomDetails = customDetails + } + case "groupTaskCustomDetails": + if v != nil { + groupTaskCustomDetails, err := unmarshalBasicGroupTaskDetails(*v) + if err != nil { + return err + } + at.GroupTaskCustomDetails = groupTaskCustomDetails + } + case "errors": + if v != nil { + var errorsVar []JobErrorDetails + err = json.Unmarshal(*v, &errorsVar) + if err != nil { + return err + } + at.Errors = &errorsVar + } + } + } + + return nil +} + +// AutomationRunbookTaskDetails this class represents the task details for an automation runbook. +type AutomationRunbookTaskDetails struct { + // Name - The recovery plan task name. + Name *string `json:"name,omitempty"` + // CloudServiceName - The cloud service of the automation runbook account. + CloudServiceName *string `json:"cloudServiceName,omitempty"` + // SubscriptionID - The subscription Id of the automation runbook account. + SubscriptionID *string `json:"subscriptionId,omitempty"` + // AccountName - The automation account name of the runbook. + AccountName *string `json:"accountName,omitempty"` + // RunbookID - The runbook Id. + RunbookID *string `json:"runbookId,omitempty"` + // RunbookName - The runbook name. + RunbookName *string `json:"runbookName,omitempty"` + // JobID - The job Id of the runbook execution. + JobID *string `json:"jobId,omitempty"` + // JobOutput - The execution output of the runbook. + JobOutput *string `json:"jobOutput,omitempty"` + // IsPrimarySideScript - A value indicating whether it is a primary side script or not. + IsPrimarySideScript *bool `json:"isPrimarySideScript,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) MarshalJSON() ([]byte, error) { + artd.InstanceType = InstanceTypeAutomationRunbookTaskDetails + objectMap := make(map[string]interface{}) + if artd.Name != nil { + objectMap["name"] = artd.Name + } + if artd.CloudServiceName != nil { + objectMap["cloudServiceName"] = artd.CloudServiceName + } + if artd.SubscriptionID != nil { + objectMap["subscriptionId"] = artd.SubscriptionID + } + if artd.AccountName != nil { + objectMap["accountName"] = artd.AccountName + } + if artd.RunbookID != nil { + objectMap["runbookId"] = artd.RunbookID + } + if artd.RunbookName != nil { + objectMap["runbookName"] = artd.RunbookName + } + if artd.JobID != nil { + objectMap["jobId"] = artd.JobID + } + if artd.JobOutput != nil { + objectMap["jobOutput"] = artd.JobOutput + } + if artd.IsPrimarySideScript != nil { + objectMap["isPrimarySideScript"] = artd.IsPrimarySideScript + } + if artd.InstanceType != "" { + objectMap["instanceType"] = artd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return &artd, true +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &artd, true +} + +// AzureFabricCreationInput fabric provider specific settings. +type AzureFabricCreationInput struct { + // Location - The Location. + Location *string `json:"location,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreationInput', 'InstanceTypeAzure', 'InstanceTypeInMageRcm', 'InstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) MarshalJSON() ([]byte, error) { + afci.InstanceType = InstanceTypeAzure + objectMap := make(map[string]interface{}) + if afci.Location != nil { + objectMap["location"] = afci.Location + } + if afci.InstanceType != "" { + objectMap["instanceType"] = afci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return &afci, true +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &afci, true +} + +// AzureFabricSpecificDetails azure Fabric Specific Details. +type AzureFabricSpecificDetails struct { + // Location - The Location for the Azure fabric. + Location *string `json:"location,omitempty"` + // ContainerIds - The container Ids for the Azure fabric. + ContainerIds *[]string `json:"containerIds,omitempty"` + // Zones - The zones. + Zones *[]A2AZoneDetails `json:"zones,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) MarshalJSON() ([]byte, error) { + afsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure + objectMap := make(map[string]interface{}) + if afsd.Location != nil { + objectMap["location"] = afsd.Location + } + if afsd.ContainerIds != nil { + objectMap["containerIds"] = afsd.ContainerIds + } + if afsd.Zones != nil { + objectMap["zones"] = afsd.Zones + } + if afsd.InstanceType != "" { + objectMap["instanceType"] = afsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return &afsd, true +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &afsd, true +} + +// AzureToAzureCreateNetworkMappingInput create network mappings input properties/behavior specific to +// Azure to Azure Network mapping. +type AzureToAzureCreateNetworkMappingInput struct { + // PrimaryNetworkID - The primary azure vnet Id. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + atacnmi.InstanceType = InstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if atacnmi.PrimaryNetworkID != nil { + objectMap["primaryNetworkId"] = atacnmi.PrimaryNetworkID + } + if atacnmi.InstanceType != "" { + objectMap["instanceType"] = atacnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return &atacnmi, true +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &atacnmi, true +} + +// AzureToAzureNetworkMappingSettings a2A Network Mapping fabric specific settings. +type AzureToAzureNetworkMappingSettings struct { + // PrimaryFabricLocation - The primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // RecoveryFabricLocation - The recovery fabric location. + RecoveryFabricLocation *string `json:"recoveryFabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) MarshalJSON() ([]byte, error) { + atanms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if atanms.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = atanms.PrimaryFabricLocation + } + if atanms.RecoveryFabricLocation != nil { + objectMap["recoveryFabricLocation"] = atanms.RecoveryFabricLocation + } + if atanms.InstanceType != "" { + objectMap["instanceType"] = atanms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return &atanms, true +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &atanms, true +} + +// AzureToAzureUpdateNetworkMappingInput updates network mappings input. +type AzureToAzureUpdateNetworkMappingInput struct { + // PrimaryNetworkID - The primary azure vnet Id. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + ataunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if ataunmi.PrimaryNetworkID != nil { + objectMap["primaryNetworkId"] = ataunmi.PrimaryNetworkID + } + if ataunmi.InstanceType != "" { + objectMap["instanceType"] = ataunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return &ataunmi, true +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &ataunmi, true +} + +// AzureToAzureVMSyncedConfigDetails azure to Azure VM synced configuration details. +type AzureToAzureVMSyncedConfigDetails struct { + // Tags - The Azure VM tags. + Tags map[string]*string `json:"tags"` + // InputEndpoints - The Azure VM input endpoints. + InputEndpoints *[]InputEndpoint `json:"inputEndpoints,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureVMSyncedConfigDetails. +func (atavscd AzureToAzureVMSyncedConfigDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if atavscd.Tags != nil { + objectMap["tags"] = atavscd.Tags + } + if atavscd.InputEndpoints != nil { + objectMap["inputEndpoints"] = atavscd.InputEndpoints + } + return json.Marshal(objectMap) +} + +// AzureVMDiskDetails disk details for E2A provider. +type AzureVMDiskDetails struct { + // VhdType - VHD type. + VhdType *string `json:"vhdType,omitempty"` + // VhdID - The VHD id. + VhdID *string `json:"vhdId,omitempty"` + // DiskID - The disk resource id. + DiskID *string `json:"diskId,omitempty"` + // VhdName - VHD name. + VhdName *string `json:"vhdName,omitempty"` + // MaxSizeMB - Max side in MB. + MaxSizeMB *string `json:"maxSizeMB,omitempty"` + // TargetDiskLocation - Blob uri of the Azure disk. + TargetDiskLocation *string `json:"targetDiskLocation,omitempty"` + // TargetDiskName - The target Azure disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` + // LunID - Ordinal\LunId of the disk for the Azure VM. + LunID *string `json:"lunId,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // CustomTargetDiskName - The custom target Azure disk name. + CustomTargetDiskName *string `json:"customTargetDiskName,omitempty"` +} + +// ComputeSizeErrorDetails represents the error used to indicate why the target compute size is not +// applicable. +type ComputeSizeErrorDetails struct { + // Message - The error message. + Message *string `json:"message,omitempty"` + // Severity - The severity of the error. + Severity *string `json:"severity,omitempty"` +} + +// BasicConfigurationSettings replication provider specific settings. +type BasicConfigurationSettings interface { + AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) + AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) + AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) + AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) + AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) + AsConfigurationSettings() (*ConfigurationSettings, bool) +} + +// ConfigurationSettings replication provider specific settings. +type ConfigurationSettings struct { + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicConfigurationSettings(body []byte) (BasicConfigurationSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeHyperVVirtualMachine): + var hvvmd HyperVVirtualMachineDetails + err := json.Unmarshal(body, &hvvmd) + return hvvmd, err + case string(InstanceTypeReplicationGroupDetails): + var rgd ReplicationGroupDetails + err := json.Unmarshal(body, &rgd) + return rgd, err + case string(InstanceTypeVmmVirtualMachine): + var vvmd VmmVirtualMachineDetails + err := json.Unmarshal(body, &vvmd) + return vvmd, err + case string(InstanceTypeVMwareVirtualMachine): + var vmvmd VMwareVirtualMachineDetails + err := json.Unmarshal(body, &vmvmd) + return vmvmd, err + default: + var cs ConfigurationSettings + err := json.Unmarshal(body, &cs) + return cs, err + } +} +func unmarshalBasicConfigurationSettingsArray(body []byte) ([]BasicConfigurationSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + csArray := make([]BasicConfigurationSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cs, err := unmarshalBasicConfigurationSettings(*rawMessage) + if err != nil { + return nil, err + } + csArray[index] = cs + } + return csArray, nil +} + +// MarshalJSON is the custom marshaler for ConfigurationSettings. +func (cs ConfigurationSettings) MarshalJSON() ([]byte, error) { + cs.InstanceType = InstanceTypeConfigurationSettings + objectMap := make(map[string]interface{}) + if cs.InstanceType != "" { + objectMap["instanceType"] = cs.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return &cs, true +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &cs, true +} + +// ConfigureAlertRequest request to configure alerts for the system. +type ConfigureAlertRequest struct { + // Properties - The properties of a configure alert request. + Properties *ConfigureAlertRequestProperties `json:"properties,omitempty"` +} + +// ConfigureAlertRequestProperties properties of a configure alert request. +type ConfigureAlertRequestProperties struct { + // SendToOwners - A value indicating whether to send email to subscription administrator. + SendToOwners *string `json:"sendToOwners,omitempty"` + // CustomEmailAddresses - The custom email address for sending emails. + CustomEmailAddresses *[]string `json:"customEmailAddresses,omitempty"` + // Locale - The locale for the email notification. + Locale *string `json:"locale,omitempty"` +} + +// ConsistencyCheckTaskDetails this class contains monitoring details of all the inconsistent Protected +// Entities in Vmm. +type ConsistencyCheckTaskDetails struct { + // VMDetails - The list of inconsistent Vm details. + VMDetails *[]InconsistentVMDetails `json:"vmDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) MarshalJSON() ([]byte, error) { + cctd.InstanceType = InstanceTypeConsistencyCheckTaskDetails + objectMap := make(map[string]interface{}) + if cctd.VMDetails != nil { + objectMap["vmDetails"] = cctd.VMDetails + } + if cctd.InstanceType != "" { + objectMap["instanceType"] = cctd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return &cctd, true +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &cctd, true +} + +// CreateNetworkMappingInput create network mappings input. +type CreateNetworkMappingInput struct { + // Properties - Input properties for creating network mapping. + Properties *CreateNetworkMappingInputProperties `json:"properties,omitempty"` +} + +// CreateNetworkMappingInputProperties common input details for network mapping operation. +type CreateNetworkMappingInputProperties struct { + // RecoveryFabricName - Recovery fabric Name. + RecoveryFabricName *string `json:"recoveryFabricName,omitempty"` + // RecoveryNetworkID - Recovery network Id. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // FabricSpecificDetails - Fabric specific input properties. + FabricSpecificDetails BasicFabricSpecificCreateNetworkMappingInput `json:"fabricSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateNetworkMappingInputProperties struct. +func (cnmip *CreateNetworkMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryFabricName": + if v != nil { + var recoveryFabricName string + err = json.Unmarshal(*v, &recoveryFabricName) + if err != nil { + return err + } + cnmip.RecoveryFabricName = &recoveryFabricName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + cnmip.RecoveryNetworkID = &recoveryNetworkID + } + case "fabricSpecificDetails": + if v != nil { + fabricSpecificDetails, err := unmarshalBasicFabricSpecificCreateNetworkMappingInput(*v) + if err != nil { + return err + } + cnmip.FabricSpecificDetails = fabricSpecificDetails + } + } + } + + return nil +} + +// CreatePolicyInput protection Policy input. +type CreatePolicyInput struct { + // Properties - Policy creation properties. + Properties *CreatePolicyInputProperties `json:"properties,omitempty"` +} + +// CreatePolicyInputProperties policy creation properties. +type CreatePolicyInputProperties struct { + // ProviderSpecificInput - The ReplicationProviderSettings. + ProviderSpecificInput BasicPolicyProviderSpecificInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreatePolicyInputProperties struct. +func (cpip *CreatePolicyInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicPolicyProviderSpecificInput(*v) + if err != nil { + return err + } + cpip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionContainerInput create protection container input. +type CreateProtectionContainerInput struct { + // Properties - Create protection container input properties. + Properties *CreateProtectionContainerInputProperties `json:"properties,omitempty"` +} + +// CreateProtectionContainerInputProperties create protection container input properties. +type CreateProtectionContainerInputProperties struct { + // ProviderSpecificInput - Provider specific inputs for container creation. + ProviderSpecificInput *[]BasicReplicationProviderSpecificContainerCreationInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionContainerInputProperties struct. +func (cpcip *CreateProtectionContainerInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificContainerCreationInputArray(*v) + if err != nil { + return err + } + cpcip.ProviderSpecificInput = &providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionContainerMappingInput configure pairing input. +type CreateProtectionContainerMappingInput struct { + // Properties - Configure protection input properties. + Properties *CreateProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// CreateProtectionContainerMappingInputProperties configure pairing input properties. +type CreateProtectionContainerMappingInputProperties struct { + // TargetProtectionContainerID - The target unique protection container name. + TargetProtectionContainerID *string `json:"targetProtectionContainerId,omitempty"` + // PolicyID - Applicable policy. + PolicyID *string `json:"policyId,omitempty"` + // ProviderSpecificInput - Provider specific input for pairing. + ProviderSpecificInput BasicReplicationProviderSpecificContainerMappingInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionContainerMappingInputProperties struct. +func (cpcmip *CreateProtectionContainerMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetProtectionContainerId": + if v != nil { + var targetProtectionContainerID string + err = json.Unmarshal(*v, &targetProtectionContainerID) + if err != nil { + return err + } + cpcmip.TargetProtectionContainerID = &targetProtectionContainerID + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + cpcmip.PolicyID = &policyID + } + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificContainerMappingInput(*v) + if err != nil { + return err + } + cpcmip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionIntentInput create protection intent input. +type CreateProtectionIntentInput struct { + // Properties - Create protection intent input properties. + Properties *CreateProtectionIntentProperties `json:"properties,omitempty"` +} + +// CreateProtectionIntentProperties create protection intent input properties. +type CreateProtectionIntentProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For A2A provider, it will be A2ACreateProtectionIntentInput object. + ProviderSpecificDetails BasicCreateProtectionIntentProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionIntentProperties struct. +func (cpip *CreateProtectionIntentProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicCreateProtectionIntentProviderSpecificDetails(*v) + if err != nil { + return err + } + cpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicCreateProtectionIntentProviderSpecificDetails create protection intent provider specific input. +type BasicCreateProtectionIntentProviderSpecificDetails interface { + AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) + AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) +} + +// CreateProtectionIntentProviderSpecificDetails create protection intent provider specific input. +type CreateProtectionIntentProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails', 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicCreateProtectionIntentProviderSpecificDetails(body []byte) (BasicCreateProtectionIntentProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A): + var acpii A2ACreateProtectionIntentInput + err := json.Unmarshal(body, &acpii) + return acpii, err + default: + var cpipsd CreateProtectionIntentProviderSpecificDetails + err := json.Unmarshal(body, &cpipsd) + return cpipsd, err + } +} +func unmarshalBasicCreateProtectionIntentProviderSpecificDetailsArray(body []byte) ([]BasicCreateProtectionIntentProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + cpipsdArray := make([]BasicCreateProtectionIntentProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cpipsd, err := unmarshalBasicCreateProtectionIntentProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + cpipsdArray[index] = cpipsd + } + return cpipsdArray, nil +} + +// MarshalJSON is the custom marshaler for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) MarshalJSON() ([]byte, error) { + cpipsd.InstanceType = InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails + objectMap := make(map[string]interface{}) + if cpipsd.InstanceType != "" { + objectMap["instanceType"] = cpipsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACreateProtectionIntentInput is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) { + return nil, false +} + +// AsCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) { + return &cpipsd, true +} + +// AsBasicCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsBasicCreateProtectionIntentProviderSpecificDetails() (BasicCreateProtectionIntentProviderSpecificDetails, bool) { + return &cpipsd, true +} + +// CreateRecoveryPlanInput create recovery plan input class. +type CreateRecoveryPlanInput struct { + // Properties - Recovery plan creation properties. + Properties *CreateRecoveryPlanInputProperties `json:"properties,omitempty"` +} + +// CreateRecoveryPlanInputProperties recovery plan creation properties. +type CreateRecoveryPlanInputProperties struct { + // PrimaryFabricID - The primary fabric Id. + PrimaryFabricID *string `json:"primaryFabricId,omitempty"` + // RecoveryFabricID - The recovery fabric Id. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // FailoverDeploymentModel - The failover deployment model. Possible values include: 'NotApplicable', 'Classic', 'ResourceManager' + FailoverDeploymentModel FailoverDeploymentModel `json:"failoverDeploymentModel,omitempty"` + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` + // ProviderSpecificInput - The provider specific input. + ProviderSpecificInput *[]BasicRecoveryPlanProviderSpecificInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateRecoveryPlanInputProperties struct. +func (crpip *CreateRecoveryPlanInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "primaryFabricId": + if v != nil { + var primaryFabricID string + err = json.Unmarshal(*v, &primaryFabricID) + if err != nil { + return err + } + crpip.PrimaryFabricID = &primaryFabricID + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + crpip.RecoveryFabricID = &recoveryFabricID + } + case "failoverDeploymentModel": + if v != nil { + var failoverDeploymentModel FailoverDeploymentModel + err = json.Unmarshal(*v, &failoverDeploymentModel) + if err != nil { + return err + } + crpip.FailoverDeploymentModel = failoverDeploymentModel + } + case "groups": + if v != nil { + var groups []RecoveryPlanGroup + err = json.Unmarshal(*v, &groups) + if err != nil { + return err + } + crpip.Groups = &groups + } + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicRecoveryPlanProviderSpecificInputArray(*v) + if err != nil { + return err + } + crpip.ProviderSpecificInput = &providerSpecificInput + } + } + } + + return nil +} + +// CurrentJobDetails current job details of the migration item. +type CurrentJobDetails struct { + // JobName - READ-ONLY; The job name. + JobName *string `json:"jobName,omitempty"` + // JobID - READ-ONLY; The ARM Id of the job being executed. + JobID *string `json:"jobId,omitempty"` + // StartTime - READ-ONLY; The start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for CurrentJobDetails. +func (cjd CurrentJobDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CurrentScenarioDetails current scenario details of the protected entity. +type CurrentScenarioDetails struct { + // ScenarioName - Scenario name. + ScenarioName *string `json:"scenarioName,omitempty"` + // JobID - ARM Id of the job being executed. + JobID *string `json:"jobId,omitempty"` + // StartTime - Start time of the workflow. + StartTime *date.Time `json:"startTime,omitempty"` +} + +// DataStore the datastore details of the MT. +type DataStore struct { + // SymbolicName - The symbolic name of data store. + SymbolicName *string `json:"symbolicName,omitempty"` + // UUID - The uuid of data store. + UUID *string `json:"uuid,omitempty"` + // Capacity - The capacity of data store in GBs. + Capacity *string `json:"capacity,omitempty"` + // FreeSpace - The free space of data store in GBs. + FreeSpace *string `json:"freeSpace,omitempty"` + // Type - The type of data store. + Type *string `json:"type,omitempty"` +} + +// DisableProtectionInput disable protection input. +type DisableProtectionInput struct { + // Properties - Disable protection input properties. + Properties *DisableProtectionInputProperties `json:"properties,omitempty"` +} + +// DisableProtectionInputProperties disable protection input properties. +type DisableProtectionInputProperties struct { + // DisableProtectionReason - Disable protection reason. It can have values NotSpecified/MigrationComplete. Possible values include: 'NotSpecified', 'MigrationComplete' + DisableProtectionReason DisableProtectionReason `json:"disableProtectionReason,omitempty"` + // ReplicationProviderInput - Replication provider specific input. + ReplicationProviderInput BasicDisableProtectionProviderSpecificInput `json:"replicationProviderInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DisableProtectionInputProperties struct. +func (dpip *DisableProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "disableProtectionReason": + if v != nil { + var disableProtectionReason DisableProtectionReason + err = json.Unmarshal(*v, &disableProtectionReason) + if err != nil { + return err + } + dpip.DisableProtectionReason = disableProtectionReason + } + case "replicationProviderInput": + if v != nil { + replicationProviderInput, err := unmarshalBasicDisableProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + dpip.ReplicationProviderInput = replicationProviderInput + } + } + } + + return nil +} + +// BasicDisableProtectionProviderSpecificInput disable protection provider specific input. +type BasicDisableProtectionProviderSpecificInput interface { + AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) + AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) +} + +// DisableProtectionProviderSpecificInput disable protection provider specific input. +type DisableProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeDisableProtectionProviderSpecificInput', 'InstanceTypeInMage' + InstanceType InstanceTypeBasicDisableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicDisableProtectionProviderSpecificInput(body []byte) (BasicDisableProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInMage): + var imdppsi InMageDisableProtectionProviderSpecificInput + err := json.Unmarshal(body, &imdppsi) + return imdppsi, err + default: + var dppsi DisableProtectionProviderSpecificInput + err := json.Unmarshal(body, &dppsi) + return dppsi, err + } +} +func unmarshalBasicDisableProtectionProviderSpecificInputArray(body []byte) ([]BasicDisableProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dppsiArray := make([]BasicDisableProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + dppsi, err := unmarshalBasicDisableProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + dppsiArray[index] = dppsi + } + return dppsiArray, nil +} + +// MarshalJSON is the custom marshaler for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + dppsi.InstanceType = InstanceTypeDisableProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if dppsi.InstanceType != "" { + objectMap["instanceType"] = dppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) { + return &dppsi, true +} + +// AsBasicDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsBasicDisableProtectionProviderSpecificInput() (BasicDisableProtectionProviderSpecificInput, bool) { + return &dppsi, true +} + +// DiscoverProtectableItemRequest request to add a physical machine as a protectable item in a container. +type DiscoverProtectableItemRequest struct { + // Properties - The properties of a discover protectable item request. + Properties *DiscoverProtectableItemRequestProperties `json:"properties,omitempty"` +} + +// DiscoverProtectableItemRequestProperties discover protectable item properties. +type DiscoverProtectableItemRequestProperties struct { + // FriendlyName - The friendly name of the physical machine. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the physical machine to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // OsType - The OS type on the physical machine. + OsType *string `json:"osType,omitempty"` +} + +// DiskDetails onprem disk details data. +type DiskDetails struct { + // MaxSizeMB - The hard disk max size in MB. + MaxSizeMB *int64 `json:"maxSizeMB,omitempty"` + // VhdType - The type of the volume. + VhdType *string `json:"vhdType,omitempty"` + // VhdID - The VHD Id. + VhdID *string `json:"vhdId,omitempty"` + // VhdName - The VHD name. + VhdName *string `json:"vhdName,omitempty"` +} + +// DiskEncryptionInfo recovery disk encryption info (BEK and KEK). +type DiskEncryptionInfo struct { + // DiskEncryptionKeyInfo - The recovery KeyVault reference for secret. + DiskEncryptionKeyInfo *DiskEncryptionKeyInfo `json:"diskEncryptionKeyInfo,omitempty"` + // KeyEncryptionKeyInfo - The recovery KeyVault reference for key. + KeyEncryptionKeyInfo *KeyEncryptionKeyInfo `json:"keyEncryptionKeyInfo,omitempty"` +} + +// DiskEncryptionKeyInfo disk Encryption Key Information (BitLocker Encryption Key (BEK) on Windows). +type DiskEncryptionKeyInfo struct { + // SecretIdentifier - The secret url / identifier. + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // KeyVaultResourceArmID - The KeyVault resource ARM id for secret. + KeyVaultResourceArmID *string `json:"keyVaultResourceArmId,omitempty"` +} + +// DiskVolumeDetails volume details. +type DiskVolumeDetails struct { + // Label - The volume label. + Label *string `json:"label,omitempty"` + // Name - The volume name. + Name *string `json:"name,omitempty"` +} + +// Display contains the localized display information for this particular operation / action. These value +// will be used by several clients for (1) custom role definitions for RBAC; (2) complex query filters for +// the event service; and (3) audit history / records for management operations. +type Display struct { + // Provider - The provider. The localized friendly form of the resource provider name - it is expected to also include the publisher/company responsible. It should use Title Casing and begin with "Microsoft" for 1st party services. e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". + Provider *string `json:"provider,omitempty"` + // Resource - The resource. The localized friendly form of the resource related to this action/operation - it should match the public documentation for the resource provider. It should use Title Casing. This value should be unique for a particular URL type (e.g. nested types should *not* reuse their parent's display.resource field). e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual Machine VM Sizes" or "Scheduler Jobs". + Resource *string `json:"resource,omitempty"` + // Operation - The operation. The localized friendly name for the operation, as it should be shown to the user. It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use Title Casing. Prescriptive guidance: Read Create or Update Delete 'ActionName'. + Operation *string `json:"operation,omitempty"` + // Description - The description. The localized friendly description for the operation, as it should be shown to the user. It should be thorough, yet concise - it will be used in tool tips and detailed views. Prescriptive guidance for namespaces: Read any 'display.provider' resource Create or Update any 'display.provider' resource Delete any 'display.provider' resource Perform any other action on any 'display.provider' resource Prescriptive guidance for namespaces: Read any 'display.resource' Create or Update any 'display.resource' Delete any 'display.resource' 'ActionName' any 'display.resources'. + Description *string `json:"description,omitempty"` +} + +// DraDetails DRA details. +type DraDetails struct { + // ID - READ-ONLY; The DRA Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The DRA name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The DRA Bios Id. + BiosID *string `json:"biosId,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the DRA. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // ForwardProtectedItemCount - READ-ONLY; The count of protected items which are protected in forward direction. + ForwardProtectedItemCount *int32 `json:"forwardProtectedItemCount,omitempty"` + // ReverseProtectedItemCount - READ-ONLY; The count of protected items which are protected in reverse direction. + ReverseProtectedItemCount *int32 `json:"reverseProtectedItemCount,omitempty"` +} + +// MarshalJSON is the custom marshaler for DraDetails. +func (dd DraDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// EnableMigrationInput enable migration input. +type EnableMigrationInput struct { + // Properties - Enable migration input properties. + Properties *EnableMigrationInputProperties `json:"properties,omitempty"` +} + +// EnableMigrationInputProperties enable migration input properties. +type EnableMigrationInputProperties struct { + // PolicyID - The policy Id. + PolicyID *string `json:"policyId,omitempty"` + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicEnableMigrationProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EnableMigrationInputProperties struct. +func (emip *EnableMigrationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + emip.PolicyID = &policyID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEnableMigrationProviderSpecificInput(*v) + if err != nil { + return err + } + emip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicEnableMigrationProviderSpecificInput enable migration provider specific input. +type BasicEnableMigrationProviderSpecificInput interface { + AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) + AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) +} + +// EnableMigrationProviderSpecificInput enable migration provider specific input. +type EnableMigrationProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeEnableMigrationProviderSpecificInput', 'InstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEnableMigrationProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicEnableMigrationProviderSpecificInput(body []byte) (BasicEnableMigrationProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeVMwareCbt): + var vmcemi VMwareCbtEnableMigrationInput + err := json.Unmarshal(body, &vmcemi) + return vmcemi, err + default: + var empsi EnableMigrationProviderSpecificInput + err := json.Unmarshal(body, &empsi) + return empsi, err + } +} +func unmarshalBasicEnableMigrationProviderSpecificInputArray(body []byte) ([]BasicEnableMigrationProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + empsiArray := make([]BasicEnableMigrationProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + empsi, err := unmarshalBasicEnableMigrationProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + empsiArray[index] = empsi + } + return empsiArray, nil +} + +// MarshalJSON is the custom marshaler for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) MarshalJSON() ([]byte, error) { + empsi.InstanceType = InstanceTypeEnableMigrationProviderSpecificInput + objectMap := make(map[string]interface{}) + if empsi.InstanceType != "" { + objectMap["instanceType"] = empsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtEnableMigrationInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) { + return nil, false +} + +// AsEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) { + return &empsi, true +} + +// AsBasicEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsBasicEnableMigrationProviderSpecificInput() (BasicEnableMigrationProviderSpecificInput, bool) { + return &empsi, true +} + +// EnableProtectionInput enable protection input. +type EnableProtectionInput struct { + // Properties - Enable protection input properties. + Properties *EnableProtectionInputProperties `json:"properties,omitempty"` +} + +// EnableProtectionInputProperties enable protection input properties. +type EnableProtectionInputProperties struct { + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // ProtectableItemID - The protectable item Id. + ProtectableItemID *string `json:"protectableItemId,omitempty"` + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicEnableProtectionProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EnableProtectionInputProperties struct. +func (epip *EnableProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + epip.PolicyID = &policyID + } + case "protectableItemId": + if v != nil { + var protectableItemID string + err = json.Unmarshal(*v, &protectableItemID) + if err != nil { + return err + } + epip.ProtectableItemID = &protectableItemID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEnableProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + epip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicEnableProtectionProviderSpecificInput enable protection provider specific input. +type BasicEnableProtectionProviderSpecificInput interface { + AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) + AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) + AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) + AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) + AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) + AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) + AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) +} + +// EnableProtectionProviderSpecificInput enable protection provider specific input. +type EnableProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicEnableProtectionProviderSpecificInput(body []byte) (BasicEnableProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmepi A2ACrossClusterMigrationEnableProtectionInput + err := json.Unmarshal(body, &accmepi) + return accmepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A): + var aepi A2AEnableProtectionInput + err := json.Unmarshal(body, &aepi) + return aepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraepi HyperVReplicaAzureEnableProtectionInput + err := json.Unmarshal(body, &hvraepi) + return hvraepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2): + var imavepi InMageAzureV2EnableProtectionInput + err := json.Unmarshal(body, &imavepi) + return imavepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage): + var imepi InMageEnableProtectionInput + err := json.Unmarshal(body, &imepi) + return imepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm): + var imrepi InMageRcmEnableProtectionInput + err := json.Unmarshal(body, &imrepi) + return imrepi, err + default: + var eppsi EnableProtectionProviderSpecificInput + err := json.Unmarshal(body, &eppsi) + return eppsi, err + } +} +func unmarshalBasicEnableProtectionProviderSpecificInputArray(body []byte) ([]BasicEnableProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + eppsiArray := make([]BasicEnableProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + eppsi, err := unmarshalBasicEnableProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + eppsiArray[index] = eppsi + } + return eppsiArray, nil +} + +// MarshalJSON is the custom marshaler for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + eppsi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if eppsi.InstanceType != "" { + objectMap["instanceType"] = eppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return &eppsi, true +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &eppsi, true +} + +// EncryptionDetails encryption details for the fabric. +type EncryptionDetails struct { + // KekState - The key encryption key state for the Vmm. + KekState *string `json:"kekState,omitempty"` + // KekCertThumbprint - The key encryption key certificate thumbprint. + KekCertThumbprint *string `json:"kekCertThumbprint,omitempty"` + // KekCertExpiryDate - The key encryption key certificate expiry date. + KekCertExpiryDate *date.Time `json:"kekCertExpiryDate,omitempty"` +} + +// Event implements the Event class. +type Event struct { + autorest.Response `json:"-"` + // Properties - Event related data. + Properties *EventProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Event. +func (e Event) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if e.Properties != nil { + objectMap["properties"] = e.Properties + } + if e.Location != nil { + objectMap["location"] = e.Location + } + return json.Marshal(objectMap) +} + +// EventCollection collection of fabric details. +type EventCollection struct { + autorest.Response `json:"-"` + // Value - The list of events. + Value *[]Event `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// EventCollectionIterator provides access to a complete listing of Event values. +type EventCollectionIterator struct { + i int + page EventCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *EventCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EventCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *EventCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EventCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter EventCollectionIterator) Response() EventCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter EventCollectionIterator) Value() Event { + if !iter.page.NotDone() { + return Event{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the EventCollectionIterator type. +func NewEventCollectionIterator(page EventCollectionPage) EventCollectionIterator { + return EventCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ec EventCollection) IsEmpty() bool { + return ec.Value == nil || len(*ec.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ec EventCollection) hasNextLink() bool { + return ec.NextLink != nil && len(*ec.NextLink) != 0 +} + +// eventCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ec EventCollection) eventCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ec.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ec.NextLink))) +} + +// EventCollectionPage contains a page of Event values. +type EventCollectionPage struct { + fn func(context.Context, EventCollection) (EventCollection, error) + ec EventCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *EventCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EventCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ec) + if err != nil { + return err + } + page.ec = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *EventCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EventCollectionPage) NotDone() bool { + return !page.ec.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EventCollectionPage) Response() EventCollection { + return page.ec +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EventCollectionPage) Values() []Event { + if page.ec.IsEmpty() { + return nil + } + return *page.ec.Value +} + +// Creates a new instance of the EventCollectionPage type. +func NewEventCollectionPage(cur EventCollection, getNextPage func(context.Context, EventCollection) (EventCollection, error)) EventCollectionPage { + return EventCollectionPage{ + fn: getNextPage, + ec: cur, + } +} + +// EventProperties the properties of a monitoring event. +type EventProperties struct { + // EventCode - The Id of the monitoring event. + EventCode *string `json:"eventCode,omitempty"` + // Description - The event name. + Description *string `json:"description,omitempty"` + // EventType - The type of the event. for example: VM Health, Server Health, Job Failure etc. + EventType *string `json:"eventType,omitempty"` + // AffectedObjectFriendlyName - The friendly name of the source of the event on which it is raised (for example, VM, VMM etc). + AffectedObjectFriendlyName *string `json:"affectedObjectFriendlyName,omitempty"` + // AffectedObjectCorrelationID - The affected object correlationId for the event. + AffectedObjectCorrelationID *string `json:"affectedObjectCorrelationId,omitempty"` + // Severity - The severity of the event. + Severity *string `json:"severity,omitempty"` + // TimeOfOccurrence - The time of occurrence of the event. + TimeOfOccurrence *date.Time `json:"timeOfOccurrence,omitempty"` + // FabricID - The ARM ID of the fabric. + FabricID *string `json:"fabricId,omitempty"` + // ProviderSpecificDetails - The provider specific settings. + ProviderSpecificDetails BasicEventProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` + // EventSpecificDetails - The event specific settings. + EventSpecificDetails BasicEventSpecificDetails `json:"eventSpecificDetails,omitempty"` + // HealthErrors - The list of errors / warnings capturing details associated with the issue(s). + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EventProperties struct. +func (ep *EventProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "eventCode": + if v != nil { + var eventCode string + err = json.Unmarshal(*v, &eventCode) + if err != nil { + return err + } + ep.EventCode = &eventCode + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ep.Description = &description + } + case "eventType": + if v != nil { + var eventType string + err = json.Unmarshal(*v, &eventType) + if err != nil { + return err + } + ep.EventType = &eventType + } + case "affectedObjectFriendlyName": + if v != nil { + var affectedObjectFriendlyName string + err = json.Unmarshal(*v, &affectedObjectFriendlyName) + if err != nil { + return err + } + ep.AffectedObjectFriendlyName = &affectedObjectFriendlyName + } + case "affectedObjectCorrelationId": + if v != nil { + var affectedObjectCorrelationID string + err = json.Unmarshal(*v, &affectedObjectCorrelationID) + if err != nil { + return err + } + ep.AffectedObjectCorrelationID = &affectedObjectCorrelationID + } + case "severity": + if v != nil { + var severity string + err = json.Unmarshal(*v, &severity) + if err != nil { + return err + } + ep.Severity = &severity + } + case "timeOfOccurrence": + if v != nil { + var timeOfOccurrence date.Time + err = json.Unmarshal(*v, &timeOfOccurrence) + if err != nil { + return err + } + ep.TimeOfOccurrence = &timeOfOccurrence + } + case "fabricId": + if v != nil { + var fabricID string + err = json.Unmarshal(*v, &fabricID) + if err != nil { + return err + } + ep.FabricID = &fabricID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEventProviderSpecificDetails(*v) + if err != nil { + return err + } + ep.ProviderSpecificDetails = providerSpecificDetails + } + case "eventSpecificDetails": + if v != nil { + eventSpecificDetails, err := unmarshalBasicEventSpecificDetails(*v) + if err != nil { + return err + } + ep.EventSpecificDetails = eventSpecificDetails + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + ep.HealthErrors = &healthErrors + } + } + } + + return nil +} + +// BasicEventProviderSpecificDetails model class for provider specific details for an event. +type BasicEventProviderSpecificDetails interface { + AsA2AEventDetails() (*A2AEventDetails, bool) + AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) + AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) + AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) + AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) + AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) + AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) + AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) + AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) + AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) +} + +// EventProviderSpecificDetails model class for provider specific details for an event. +type EventProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicEventProviderSpecificDetails(body []byte) (BasicEventProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A): + var aed A2AEventDetails + err := json.Unmarshal(body, &aed) + return aed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012): + var hvr2ed HyperVReplica2012EventDetails + err := json.Unmarshal(body, &hvr2ed) + return hvr2ed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2): + var hvr2ed HyperVReplica2012R2EventDetails + err := json.Unmarshal(body, &hvr2ed) + return hvr2ed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure): + var hvraed HyperVReplicaAzureEventDetails + err := json.Unmarshal(body, &hvraed) + return hvraed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails): + var hvrbed HyperVReplicaBaseEventDetails + err := json.Unmarshal(body, &hvrbed) + return hvrbed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2): + var imaved InMageAzureV2EventDetails + err := json.Unmarshal(body, &imaved) + return imaved, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm): + var imred InMageRcmEventDetails + err := json.Unmarshal(body, &imred) + return imred, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback): + var imrfed InMageRcmFailbackEventDetails + err := json.Unmarshal(body, &imrfed) + return imrfed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt): + var vmced VMwareCbtEventDetails + err := json.Unmarshal(body, &vmced) + return vmced, err + default: + var epsd EventProviderSpecificDetails + err := json.Unmarshal(body, &epsd) + return epsd, err + } +} +func unmarshalBasicEventProviderSpecificDetailsArray(body []byte) ([]BasicEventProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + epsdArray := make([]BasicEventProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + epsd, err := unmarshalBasicEventProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + epsdArray[index] = epsd + } + return epsdArray, nil +} + +// MarshalJSON is the custom marshaler for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) MarshalJSON() ([]byte, error) { + epsd.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails + objectMap := make(map[string]interface{}) + if epsd.InstanceType != "" { + objectMap["instanceType"] = epsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return &epsd, true +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &epsd, true +} + +// EventQueryParameter implements the event query parameter. +type EventQueryParameter struct { + // EventCode - The source id of the events to be queried. + EventCode *string `json:"eventCode,omitempty"` + // Severity - The severity of the events to be queried. + Severity *string `json:"severity,omitempty"` + // EventType - The type of the events to be queried. + EventType *string `json:"eventType,omitempty"` + // FabricName - The affected object server id of the events to be queried. + FabricName *string `json:"fabricName,omitempty"` + // AffectedObjectFriendlyName - The affected object name of the events to be queried. + AffectedObjectFriendlyName *string `json:"affectedObjectFriendlyName,omitempty"` + // AffectedObjectCorrelationID - The affected object correlationId for the events to be queried. + AffectedObjectCorrelationID *string `json:"affectedObjectCorrelationId,omitempty"` + // StartTime - The start time of the time range within which the events are to be queried. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time of the time range within which the events are to be queried. + EndTime *date.Time `json:"endTime,omitempty"` +} + +// BasicEventSpecificDetails model class for event specific details for an event. +type BasicEventSpecificDetails interface { + AsJobStatusEventDetails() (*JobStatusEventDetails, bool) + AsEventSpecificDetails() (*EventSpecificDetails, bool) +} + +// EventSpecificDetails model class for event specific details for an event. +type EventSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeEventSpecificDetails', 'InstanceTypeJobStatus' + InstanceType InstanceTypeBasicEventSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicEventSpecificDetails(body []byte) (BasicEventSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeJobStatus): + var jsed JobStatusEventDetails + err := json.Unmarshal(body, &jsed) + return jsed, err + default: + var esd EventSpecificDetails + err := json.Unmarshal(body, &esd) + return esd, err + } +} +func unmarshalBasicEventSpecificDetailsArray(body []byte) ([]BasicEventSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + esdArray := make([]BasicEventSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + esd, err := unmarshalBasicEventSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + esdArray[index] = esd + } + return esdArray, nil +} + +// MarshalJSON is the custom marshaler for EventSpecificDetails. +func (esd EventSpecificDetails) MarshalJSON() ([]byte, error) { + esd.InstanceType = InstanceTypeEventSpecificDetails + objectMap := make(map[string]interface{}) + if esd.InstanceType != "" { + objectMap["instanceType"] = esd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsJobStatusEventDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsJobStatusEventDetails() (*JobStatusEventDetails, bool) { + return nil, false +} + +// AsEventSpecificDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsEventSpecificDetails() (*EventSpecificDetails, bool) { + return &esd, true +} + +// AsBasicEventSpecificDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsBasicEventSpecificDetails() (BasicEventSpecificDetails, bool) { + return &esd, true +} + +// ExistingProtectionProfile existing storage account input. +type ExistingProtectionProfile struct { + // ProtectionProfileID - The protection profile Arm Id. Throw error, if resource does not exists. + ProtectionProfileID *string `json:"protectionProfileId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) MarshalJSON() ([]byte, error) { + epp.ResourceType = ResourceTypeExisting + objectMap := make(map[string]interface{}) + if epp.ProtectionProfileID != nil { + objectMap["protectionProfileId"] = epp.ProtectionProfileID + } + if epp.ResourceType != "" { + objectMap["resourceType"] = epp.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return &epp, true +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return nil, false +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return nil, false +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &epp, true +} + +// ExistingRecoveryAvailabilitySet existing recovery availability set input. +type ExistingRecoveryAvailabilitySet struct { + // RecoveryAvailabilitySetID - The recovery availability set Id. Will throw error, if resource does not exist. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails', 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryAvailabilitySetCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) MarshalJSON() ([]byte, error) { + eras.ResourceType = ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if eras.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = eras.RecoveryAvailabilitySetID + } + if eras.ResourceType != "" { + objectMap["resourceType"] = eras.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryAvailabilitySet is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) { + return &eras, true +} + +// AsRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsBasicRecoveryAvailabilitySetCustomDetails() (BasicRecoveryAvailabilitySetCustomDetails, bool) { + return &eras, true +} + +// ExistingRecoveryProximityPlacementGroup existing recovery proximity placement group input. +type ExistingRecoveryProximityPlacementGroup struct { + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. Will throw error, if resource does not exist. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails', 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) MarshalJSON() ([]byte, error) { + erppg.ResourceType = ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if erppg.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = erppg.RecoveryProximityPlacementGroupID + } + if erppg.ResourceType != "" { + objectMap["resourceType"] = erppg.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryProximityPlacementGroup is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) { + return &erppg, true +} + +// AsRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsBasicRecoveryProximityPlacementGroupCustomDetails() (BasicRecoveryProximityPlacementGroupCustomDetails, bool) { + return &erppg, true +} + +// ExistingRecoveryRecoveryResourceGroup existing recovery resource group input. +type ExistingRecoveryRecoveryResourceGroup struct { + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails', 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryResourceGroupCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) MarshalJSON() ([]byte, error) { + errrg.ResourceType = ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if errrg.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = errrg.RecoveryResourceGroupID + } + if errrg.ResourceType != "" { + objectMap["resourceType"] = errrg.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryRecoveryResourceGroup is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) { + return &errrg, true +} + +// AsRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsBasicRecoveryResourceGroupCustomDetails() (BasicRecoveryResourceGroupCustomDetails, bool) { + return &errrg, true +} + +// ExistingRecoveryVirtualNetwork existing recovery virtual network input. +type ExistingRecoveryVirtualNetwork struct { + // RecoveryVirtualNetworkID - The recovery virtual network Id. Will throw error, if resource does not exist. + RecoveryVirtualNetworkID *string `json:"recoveryVirtualNetworkId,omitempty"` + // RecoverySubnetName - The recovery subnet name. + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) MarshalJSON() ([]byte, error) { + ervn.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if ervn.RecoveryVirtualNetworkID != nil { + objectMap["recoveryVirtualNetworkId"] = ervn.RecoveryVirtualNetworkID + } + if ervn.RecoverySubnetName != nil { + objectMap["recoverySubnetName"] = ervn.RecoverySubnetName + } + if ervn.ResourceType != "" { + objectMap["resourceType"] = ervn.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return &ervn, true +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &ervn, true +} + +// ExistingStorageAccount existing storage account input. +type ExistingStorageAccount struct { + // AzureStorageAccountID - The storage account Arm Id. Throw error, if resource does not exists. + AzureStorageAccountID *string `json:"azureStorageAccountId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails', 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicStorageAccountCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingStorageAccount. +func (esa ExistingStorageAccount) MarshalJSON() ([]byte, error) { + esa.ResourceType = ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if esa.AzureStorageAccountID != nil { + objectMap["azureStorageAccountId"] = esa.AzureStorageAccountID + } + if esa.ResourceType != "" { + objectMap["resourceType"] = esa.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingStorageAccount is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsExistingStorageAccount() (*ExistingStorageAccount, bool) { + return &esa, true +} + +// AsStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) { + return nil, false +} + +// AsBasicStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsBasicStorageAccountCustomDetails() (BasicStorageAccountCustomDetails, bool) { + return &esa, true +} + +// ExportJobDetails this class represents details for export jobs workflow. +type ExportJobDetails struct { + // BlobURI - BlobUri of the exported jobs. + BlobURI *string `json:"blobUri,omitempty"` + // SasToken - The sas token to access blob. + SasToken *string `json:"sasToken,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExportJobDetails. +func (ejd ExportJobDetails) MarshalJSON() ([]byte, error) { + ejd.InstanceType = InstanceTypeExportJobDetails + objectMap := make(map[string]interface{}) + if ejd.BlobURI != nil { + objectMap["blobUri"] = ejd.BlobURI + } + if ejd.SasToken != nil { + objectMap["sasToken"] = ejd.SasToken + } + if ejd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = ejd.AffectedObjectDetails + } + if ejd.InstanceType != "" { + objectMap["instanceType"] = ejd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return &ejd, true +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &ejd, true +} + +// Fabric fabric definition. +type Fabric struct { + autorest.Response `json:"-"` + // Properties - Fabric related data. + Properties *FabricProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Fabric. +func (f Fabric) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if f.Properties != nil { + objectMap["properties"] = f.Properties + } + if f.Location != nil { + objectMap["location"] = f.Location + } + return json.Marshal(objectMap) +} + +// FabricCollection collection of fabric details. +type FabricCollection struct { + autorest.Response `json:"-"` + // Value - The fabric details. + Value *[]Fabric `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// FabricCollectionIterator provides access to a complete listing of Fabric values. +type FabricCollectionIterator struct { + i int + page FabricCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *FabricCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FabricCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *FabricCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter FabricCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter FabricCollectionIterator) Response() FabricCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter FabricCollectionIterator) Value() Fabric { + if !iter.page.NotDone() { + return Fabric{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the FabricCollectionIterator type. +func NewFabricCollectionIterator(page FabricCollectionPage) FabricCollectionIterator { + return FabricCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (fc FabricCollection) IsEmpty() bool { + return fc.Value == nil || len(*fc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (fc FabricCollection) hasNextLink() bool { + return fc.NextLink != nil && len(*fc.NextLink) != 0 +} + +// fabricCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (fc FabricCollection) fabricCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !fc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(fc.NextLink))) +} + +// FabricCollectionPage contains a page of Fabric values. +type FabricCollectionPage struct { + fn func(context.Context, FabricCollection) (FabricCollection, error) + fc FabricCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *FabricCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FabricCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.fc) + if err != nil { + return err + } + page.fc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *FabricCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page FabricCollectionPage) NotDone() bool { + return !page.fc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page FabricCollectionPage) Response() FabricCollection { + return page.fc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page FabricCollectionPage) Values() []Fabric { + if page.fc.IsEmpty() { + return nil + } + return *page.fc.Value +} + +// Creates a new instance of the FabricCollectionPage type. +func NewFabricCollectionPage(cur FabricCollection, getNextPage func(context.Context, FabricCollection) (FabricCollection, error)) FabricCollectionPage { + return FabricCollectionPage{ + fn: getNextPage, + fc: cur, + } +} + +// FabricCreationInput site details provided during the time of site creation. +type FabricCreationInput struct { + // Properties - Fabric creation input. + Properties *FabricCreationInputProperties `json:"properties,omitempty"` +} + +// FabricCreationInputProperties properties of site details provided during the time of site creation. +type FabricCreationInputProperties struct { + // CustomDetails - Fabric provider specific creation input. + CustomDetails BasicFabricSpecificCreationInput `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for FabricCreationInputProperties struct. +func (fcip *FabricCreationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicFabricSpecificCreationInput(*v) + if err != nil { + return err + } + fcip.CustomDetails = customDetails + } + } + } + + return nil +} + +// FabricProperties fabric properties. +type FabricProperties struct { + // FriendlyName - Friendly name of the fabric. + FriendlyName *string `json:"friendlyName,omitempty"` + // EncryptionDetails - Encryption details for the fabric. + EncryptionDetails *EncryptionDetails `json:"encryptionDetails,omitempty"` + // RolloverEncryptionDetails - Rollover encryption details for the fabric. + RolloverEncryptionDetails *EncryptionDetails `json:"rolloverEncryptionDetails,omitempty"` + // InternalIdentifier - Dra Registration Id. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // BcdrState - BCDR state of the fabric. + BcdrState *string `json:"bcdrState,omitempty"` + // CustomDetails - Fabric specific settings. + CustomDetails BasicFabricSpecificDetails `json:"customDetails,omitempty"` + // HealthErrorDetails - Fabric health error details. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // Health - Health of fabric. + Health *string `json:"health,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for FabricProperties struct. +func (fp *FabricProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + fp.FriendlyName = &friendlyName + } + case "encryptionDetails": + if v != nil { + var encryptionDetails EncryptionDetails + err = json.Unmarshal(*v, &encryptionDetails) + if err != nil { + return err + } + fp.EncryptionDetails = &encryptionDetails + } + case "rolloverEncryptionDetails": + if v != nil { + var rolloverEncryptionDetails EncryptionDetails + err = json.Unmarshal(*v, &rolloverEncryptionDetails) + if err != nil { + return err + } + fp.RolloverEncryptionDetails = &rolloverEncryptionDetails + } + case "internalIdentifier": + if v != nil { + var internalIdentifier string + err = json.Unmarshal(*v, &internalIdentifier) + if err != nil { + return err + } + fp.InternalIdentifier = &internalIdentifier + } + case "bcdrState": + if v != nil { + var bcdrState string + err = json.Unmarshal(*v, &bcdrState) + if err != nil { + return err + } + fp.BcdrState = &bcdrState + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicFabricSpecificDetails(*v) + if err != nil { + return err + } + fp.CustomDetails = customDetails + } + case "healthErrorDetails": + if v != nil { + var healthErrorDetails []HealthError + err = json.Unmarshal(*v, &healthErrorDetails) + if err != nil { + return err + } + fp.HealthErrorDetails = &healthErrorDetails + } + case "health": + if v != nil { + var health string + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + fp.Health = &health + } + } + } + + return nil +} + +// FabricQueryParameter query parameter to get fabric. +type FabricQueryParameter struct { + // ZoneToZoneMappings - A value indicating whether the zone to zone mappings are to be returned. + ZoneToZoneMappings *string `json:"zoneToZoneMappings,omitempty"` + // FetchAgentDetails - A value indicating whether the agent details are to be fetched. + FetchAgentDetails *string `json:"fetchAgentDetails,omitempty"` + // BiosID - The BIOS Id to be used for fetching agent details. + BiosID *string `json:"biosId,omitempty"` + // Fqdn - The FQDN to be used for fetching agent details. + Fqdn *string `json:"fqdn,omitempty"` + // DiscoveryType - The type of the discovered machine to be used for fetching agent details. + DiscoveryType *string `json:"discoveryType,omitempty"` + // OsType - The OS type to be used for fetching agent details. + OsType *string `json:"osType,omitempty"` +} + +// FabricReplicationGroupTaskDetails this class represents the fabric replication group task details. +type FabricReplicationGroupTaskDetails struct { + // SkippedReason - The skipped reason. + SkippedReason *string `json:"skippedReason,omitempty"` + // SkippedReasonString - The skipped reason string. + SkippedReasonString *string `json:"skippedReasonString,omitempty"` + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) MarshalJSON() ([]byte, error) { + frgtd.InstanceType = InstanceTypeFabricReplicationGroupTaskDetails + objectMap := make(map[string]interface{}) + if frgtd.SkippedReason != nil { + objectMap["skippedReason"] = frgtd.SkippedReason + } + if frgtd.SkippedReasonString != nil { + objectMap["skippedReasonString"] = frgtd.SkippedReasonString + } + if frgtd.JobTask != nil { + objectMap["jobTask"] = frgtd.JobTask + } + if frgtd.InstanceType != "" { + objectMap["instanceType"] = frgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return &frgtd, true +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &frgtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &frgtd, true +} + +// BasicFabricSpecificCreateNetworkMappingInput input details specific to fabrics during Network Mapping. +type BasicFabricSpecificCreateNetworkMappingInput interface { + AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) + AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) + AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) + AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) +} + +// FabricSpecificCreateNetworkMappingInput input details specific to fabrics during Network Mapping. +type FabricSpecificCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificCreateNetworkMappingInput(body []byte) (BasicFabricSpecificCreateNetworkMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAzureToAzure): + var atacnmi AzureToAzureCreateNetworkMappingInput + err := json.Unmarshal(body, &atacnmi) + return atacnmi, err + case string(InstanceTypeVmmToAzure): + var vtacnmi VmmToAzureCreateNetworkMappingInput + err := json.Unmarshal(body, &vtacnmi) + return vtacnmi, err + case string(InstanceTypeVmmToVmm): + var vtvcnmi VmmToVmmCreateNetworkMappingInput + err := json.Unmarshal(body, &vtvcnmi) + return vtvcnmi, err + default: + var fscnmi FabricSpecificCreateNetworkMappingInput + err := json.Unmarshal(body, &fscnmi) + return fscnmi, err + } +} +func unmarshalBasicFabricSpecificCreateNetworkMappingInputArray(body []byte) ([]BasicFabricSpecificCreateNetworkMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fscnmiArray := make([]BasicFabricSpecificCreateNetworkMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fscnmi, err := unmarshalBasicFabricSpecificCreateNetworkMappingInput(*rawMessage) + if err != nil { + return nil, err + } + fscnmiArray[index] = fscnmi + } + return fscnmiArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + fscnmi.InstanceType = InstanceTypeFabricSpecificCreateNetworkMappingInput + objectMap := make(map[string]interface{}) + if fscnmi.InstanceType != "" { + objectMap["instanceType"] = fscnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return &fscnmi, true +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &fscnmi, true +} + +// BasicFabricSpecificCreationInput fabric provider specific settings. +type BasicFabricSpecificCreationInput interface { + AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) + AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) + AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) + AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) +} + +// FabricSpecificCreationInput fabric provider specific settings. +type FabricSpecificCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreationInput', 'InstanceTypeAzure', 'InstanceTypeInMageRcm', 'InstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificCreationInput(body []byte) (BasicFabricSpecificCreationInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAzure): + var afci AzureFabricCreationInput + err := json.Unmarshal(body, &afci) + return afci, err + case string(InstanceTypeInMageRcm): + var imrfci InMageRcmFabricCreationInput + err := json.Unmarshal(body, &imrfci) + return imrfci, err + case string(InstanceTypeVMwareV2): + var vmvfci VMwareV2FabricCreationInput + err := json.Unmarshal(body, &vmvfci) + return vmvfci, err + default: + var fsci FabricSpecificCreationInput + err := json.Unmarshal(body, &fsci) + return fsci, err + } +} +func unmarshalBasicFabricSpecificCreationInputArray(body []byte) ([]BasicFabricSpecificCreationInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsciArray := make([]BasicFabricSpecificCreationInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsci, err := unmarshalBasicFabricSpecificCreationInput(*rawMessage) + if err != nil { + return nil, err + } + fsciArray[index] = fsci + } + return fsciArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) MarshalJSON() ([]byte, error) { + fsci.InstanceType = InstanceTypeFabricSpecificCreationInput + objectMap := make(map[string]interface{}) + if fsci.InstanceType != "" { + objectMap["instanceType"] = fsci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return &fsci, true +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &fsci, true +} + +// BasicFabricSpecificDetails fabric specific details. +type BasicFabricSpecificDetails interface { + AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) + AsHyperVSiteDetails() (*HyperVSiteDetails, bool) + AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) + AsVmmDetails() (*VmmDetails, bool) + AsVMwareDetails() (*VMwareDetails, bool) + AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) + AsFabricSpecificDetails() (*FabricSpecificDetails, bool) +} + +// FabricSpecificDetails fabric specific details. +type FabricSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificDetails(body []byte) (BasicFabricSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure): + var afsd AzureFabricSpecificDetails + err := json.Unmarshal(body, &afsd) + return afsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite): + var hvsd HyperVSiteDetails + err := json.Unmarshal(body, &hvsd) + return hvsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm): + var imrfsd InMageRcmFabricSpecificDetails + err := json.Unmarshal(body, &imrfsd) + return imrfsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM): + var vd VmmDetails + err := json.Unmarshal(body, &vd) + return vd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware): + var vmd VMwareDetails + err := json.Unmarshal(body, &vmd) + return vmd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2): + var vmvfsd VMwareV2FabricSpecificDetails + err := json.Unmarshal(body, &vmvfsd) + return vmvfsd, err + default: + var fsd FabricSpecificDetails + err := json.Unmarshal(body, &fsd) + return fsd, err + } +} +func unmarshalBasicFabricSpecificDetailsArray(body []byte) ([]BasicFabricSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsdArray := make([]BasicFabricSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsd, err := unmarshalBasicFabricSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + fsdArray[index] = fsd + } + return fsdArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificDetails. +func (fsd FabricSpecificDetails) MarshalJSON() ([]byte, error) { + fsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails + objectMap := make(map[string]interface{}) + if fsd.InstanceType != "" { + objectMap["instanceType"] = fsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return &fsd, true +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &fsd, true +} + +// BasicFabricSpecificUpdateNetworkMappingInput input details specific to fabrics during Network Mapping. +type BasicFabricSpecificUpdateNetworkMappingInput interface { + AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) + AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) + AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) + AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) +} + +// FabricSpecificUpdateNetworkMappingInput input details specific to fabrics during Network Mapping. +type FabricSpecificUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificUpdateNetworkMappingInput(body []byte) (BasicFabricSpecificUpdateNetworkMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure): + var ataunmi AzureToAzureUpdateNetworkMappingInput + err := json.Unmarshal(body, &ataunmi) + return ataunmi, err + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure): + var vtaunmi VmmToAzureUpdateNetworkMappingInput + err := json.Unmarshal(body, &vtaunmi) + return vtaunmi, err + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm): + var vtvunmi VmmToVmmUpdateNetworkMappingInput + err := json.Unmarshal(body, &vtvunmi) + return vtvunmi, err + default: + var fsunmi FabricSpecificUpdateNetworkMappingInput + err := json.Unmarshal(body, &fsunmi) + return fsunmi, err + } +} +func unmarshalBasicFabricSpecificUpdateNetworkMappingInputArray(body []byte) ([]BasicFabricSpecificUpdateNetworkMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsunmiArray := make([]BasicFabricSpecificUpdateNetworkMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsunmi, err := unmarshalBasicFabricSpecificUpdateNetworkMappingInput(*rawMessage) + if err != nil { + return nil, err + } + fsunmiArray[index] = fsunmi + } + return fsunmiArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + fsunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput + objectMap := make(map[string]interface{}) + if fsunmi.InstanceType != "" { + objectMap["instanceType"] = fsunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return &fsunmi, true +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &fsunmi, true +} + +// FailoverJobDetails this class represents the details for a failover job. +type FailoverJobDetails struct { + // ProtectedItemDetails - The test VM details. + ProtectedItemDetails *[]FailoverReplicationProtectedItemDetails `json:"protectedItemDetails,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for FailoverJobDetails. +func (fjd FailoverJobDetails) MarshalJSON() ([]byte, error) { + fjd.InstanceType = InstanceTypeFailoverJobDetails + objectMap := make(map[string]interface{}) + if fjd.ProtectedItemDetails != nil { + objectMap["protectedItemDetails"] = fjd.ProtectedItemDetails + } + if fjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = fjd.AffectedObjectDetails + } + if fjd.InstanceType != "" { + objectMap["instanceType"] = fjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return &fjd, true +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &fjd, true +} + +// FailoverProcessServerRequest request to failover a process server. +type FailoverProcessServerRequest struct { + // Properties - The properties of the PS Failover request. + Properties *FailoverProcessServerRequestProperties `json:"properties,omitempty"` +} + +// FailoverProcessServerRequestProperties the properties of the Failover Process Server request. +type FailoverProcessServerRequestProperties struct { + // ContainerName - The container identifier. + ContainerName *string `json:"containerName,omitempty"` + // SourceProcessServerID - The source process server. + SourceProcessServerID *string `json:"sourceProcessServerId,omitempty"` + // TargetProcessServerID - The new process server. + TargetProcessServerID *string `json:"targetProcessServerId,omitempty"` + // VmsToMigrate - The VMS to migrate. + VmsToMigrate *[]string `json:"vmsToMigrate,omitempty"` + // UpdateType - A value for failover type. It can be systemlevel/serverlevel. + UpdateType *string `json:"updateType,omitempty"` +} + +// FailoverReplicationProtectedItemDetails failover details for a replication protected item. +type FailoverReplicationProtectedItemDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // FriendlyName - The friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // TestVMName - The test Vm name. + TestVMName *string `json:"testVmName,omitempty"` + // TestVMFriendlyName - The test Vm friendly name. + TestVMFriendlyName *string `json:"testVmFriendlyName,omitempty"` + // NetworkConnectionStatus - The network connection status. + NetworkConnectionStatus *string `json:"networkConnectionStatus,omitempty"` + // NetworkFriendlyName - The network friendly name. + NetworkFriendlyName *string `json:"networkFriendlyName,omitempty"` + // Subnet - The network subnet. + Subnet *string `json:"subnet,omitempty"` + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // RecoveryPointTime - The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` +} + +// BasicGroupTaskDetails this class represents the group task details when parent child relationship exists in the +// drill down. +type BasicGroupTaskDetails interface { + AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) + AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) + AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) + AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) + AsGroupTaskDetails() (*GroupTaskDetails, bool) +} + +// GroupTaskDetails this class represents the group task details when parent child relationship exists in the +// drill down. +type GroupTaskDetails struct { + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicGroupTaskDetails(body []byte) (BasicGroupTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInlineWorkflowTaskDetails): + var iwtd InlineWorkflowTaskDetails + err := json.Unmarshal(body, &iwtd) + return iwtd, err + case string(InstanceTypeRecoveryPlanGroupTaskDetails): + var rpgtd RecoveryPlanGroupTaskDetails + err := json.Unmarshal(body, &rpgtd) + return rpgtd, err + case string(InstanceTypeRecoveryPlanShutdownGroupTaskDetails): + var rpsgtd RecoveryPlanShutdownGroupTaskDetails + err := json.Unmarshal(body, &rpsgtd) + return rpsgtd, err + default: + var gtd GroupTaskDetails + err := json.Unmarshal(body, >d) + return gtd, err + } +} +func unmarshalBasicGroupTaskDetailsArray(body []byte) ([]BasicGroupTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + gtdArray := make([]BasicGroupTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + gtd, err := unmarshalBasicGroupTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + gtdArray[index] = gtd + } + return gtdArray, nil +} + +// MarshalJSON is the custom marshaler for GroupTaskDetails. +func (gtd GroupTaskDetails) MarshalJSON() ([]byte, error) { + gtd.InstanceType = InstanceTypeGroupTaskDetails + objectMap := make(map[string]interface{}) + if gtd.ChildTasks != nil { + objectMap["childTasks"] = gtd.ChildTasks + } + if gtd.InstanceType != "" { + objectMap["instanceType"] = gtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return >d, true +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return >d, true +} + +// HealthError health Error. +type HealthError struct { + // InnerHealthErrors - The inner health errors. HealthError having a list of HealthError as child errors is problematic. InnerHealthError is used because this will prevent an infinite loop of structures when Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health errors and all API consumers can utilize this in the same fashion as Exception -> InnerException. + InnerHealthErrors *[]InnerHealthError `json:"innerHealthErrors,omitempty"` + // ErrorSource - Source of error. + ErrorSource *string `json:"errorSource,omitempty"` + // ErrorType - Type of error. + ErrorType *string `json:"errorType,omitempty"` + // ErrorLevel - Level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // ErrorCategory - Category of error. + ErrorCategory *string `json:"errorCategory,omitempty"` + // ErrorCode - Error code. + ErrorCode *string `json:"errorCode,omitempty"` + // SummaryMessage - Summary message of the entity. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // ErrorMessage - Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // CreationTimeUtc - Error creation time (UTC). + CreationTimeUtc *date.Time `json:"creationTimeUtc,omitempty"` + // RecoveryProviderErrorMessage - DRA error message. + RecoveryProviderErrorMessage *string `json:"recoveryProviderErrorMessage,omitempty"` + // EntityID - ID of the entity. + EntityID *string `json:"entityId,omitempty"` + // ErrorID - The health error unique id. + ErrorID *string `json:"errorId,omitempty"` + // CustomerResolvability - Value indicating whether the health error is customer resolvable. Possible values include: 'Allowed', 'NotAllowed' + CustomerResolvability HealthErrorCustomerResolvability `json:"customerResolvability,omitempty"` +} + +// HealthErrorSummary class to define the summary of the health error details. +type HealthErrorSummary struct { + // SummaryCode - The code of the health error. + SummaryCode *string `json:"summaryCode,omitempty"` + // Category - The category of the health error. Possible values include: 'HealthErrorCategoryNone', 'HealthErrorCategoryReplication', 'HealthErrorCategoryTestFailover', 'HealthErrorCategoryConfiguration', 'HealthErrorCategoryFabricInfrastructure', 'HealthErrorCategoryVersionExpiry', 'HealthErrorCategoryAgentAutoUpdateInfra', 'HealthErrorCategoryAgentAutoUpdateArtifactDeleted', 'HealthErrorCategoryAgentAutoUpdateRunAsAccount', 'HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry', 'HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired' + Category HealthErrorCategory `json:"category,omitempty"` + // Severity - Severity of error. Possible values include: 'NONE', 'Warning', 'Error', 'Info' + Severity Severity `json:"severity,omitempty"` + // SummaryMessage - The summary message of the health error. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // AffectedResourceType - The type of affected ARM resource. + AffectedResourceType *string `json:"affectedResourceType,omitempty"` + // AffectedResourceSubtype - The sub type of any subcomponent within the ARM resource that this might be applicable. Value remains null if not applicable. + AffectedResourceSubtype *string `json:"affectedResourceSubtype,omitempty"` + // AffectedResourceCorrelationIds - The list of affected resource correlation Ids. This can be used to uniquely identify the count of items affected by a specific category and severity as well as count of item affected by an specific issue. + AffectedResourceCorrelationIds *[]string `json:"affectedResourceCorrelationIds,omitempty"` +} + +// HyperVHostDetails hyper-V host details. +type HyperVHostDetails struct { + // ID - READ-ONLY; The Hyper-V host Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The Hyper-V host name. + Name *string `json:"name,omitempty"` + // MarsAgentVersion - READ-ONLY; The Mars agent version. + MarsAgentVersion *string `json:"marsAgentVersion,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVHostDetails. +func (hvhd HyperVHostDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// HyperVReplica2012EventDetails model class for event details of a HyperVReplica E2E event. +type HyperVReplica2012EventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) MarshalJSON() ([]byte, error) { + hvr2ed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvr2ed.ContainerName != nil { + objectMap["containerName"] = hvr2ed.ContainerName + } + if hvr2ed.FabricName != nil { + objectMap["fabricName"] = hvr2ed.FabricName + } + if hvr2ed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvr2ed.RemoteContainerName + } + if hvr2ed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvr2ed.RemoteFabricName + } + if hvr2ed.InstanceType != "" { + objectMap["instanceType"] = hvr2ed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return &hvr2ed, true +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvr2ed, true +} + +// HyperVReplica2012R2EventDetails model class for event details of a HyperVReplica blue E2E event. +type HyperVReplica2012R2EventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) MarshalJSON() ([]byte, error) { + hvr2ed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvr2ed.ContainerName != nil { + objectMap["containerName"] = hvr2ed.ContainerName + } + if hvr2ed.FabricName != nil { + objectMap["fabricName"] = hvr2ed.FabricName + } + if hvr2ed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvr2ed.RemoteContainerName + } + if hvr2ed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvr2ed.RemoteFabricName + } + if hvr2ed.InstanceType != "" { + objectMap["instanceType"] = hvr2ed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return &hvr2ed, true +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvr2ed, true +} + +// HyperVReplicaAzureApplyRecoveryPointInput applyRecoveryPoint input specific to HyperVReplicaAzure +// provider. +type HyperVReplicaAzureApplyRecoveryPointInput struct { + // PrimaryKekCertificatePfx - The primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - The secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + hvraarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraarpi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvraarpi.PrimaryKekCertificatePfx + } + if hvraarpi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvraarpi.SecondaryKekCertificatePfx + } + if hvraarpi.InstanceType != "" { + objectMap["instanceType"] = hvraarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return &hvraarpi, true +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &hvraarpi, true +} + +// HyperVReplicaAzureDiskInputDetails disk input details. +type HyperVReplicaAzureDiskInputDetails struct { + // DiskID - The DiskId. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The LogStorageAccountId. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// HyperVReplicaAzureEnableProtectionInput hyperVReplicaAzure specific enable protection input. +type HyperVReplicaAzureEnableProtectionInput struct { + // HvHostVMID - The Hyper-V host VM Id. + HvHostVMID *string `json:"hvHostVmId,omitempty"` + // VMName - The VM Name. + VMName *string `json:"vmName,omitempty"` + // OsType - The OS type associated with VM. + OsType *string `json:"osType,omitempty"` + // VhdID - The OS disk VHD id associated with VM. + VhdID *string `json:"vhdId,omitempty"` + // TargetStorageAccountID - The storage account Id. + TargetStorageAccountID *string `json:"targetStorageAccountId,omitempty"` + // TargetAzureNetworkID - The selected target Azure network Id. + TargetAzureNetworkID *string `json:"targetAzureNetworkId,omitempty"` + // TargetAzureSubnetID - The selected target Azure subnet Id. + TargetAzureSubnetID *string `json:"targetAzureSubnetId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // TargetAzureVMName - The target azure VM Name. + TargetAzureVMName *string `json:"targetAzureVmName,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DisksToInclude - The list of VHD Ids of disks to be protected. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // TargetAzureV1ResourceGroupID - The Id of the target resource group (for classic deployment) in which the failover VM is to be created. + TargetAzureV1ResourceGroupID *string `json:"targetAzureV1ResourceGroupId,omitempty"` + // TargetAzureV2ResourceGroupID - The Id of the target resource group (for resource manager deployment) in which the failover VM is to be created. + TargetAzureV2ResourceGroupID *string `json:"targetAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id for resource manager deployment. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetProximityPlacementGroupID - The proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisksForReplication - A value indicating whether managed disks should be used during replication. + UseManagedDisksForReplication *string `json:"useManagedDisksForReplication,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DisksToIncludeForManagedDisks - The disks to include list for managed disks. + DisksToIncludeForManagedDisks *[]HyperVReplicaAzureDiskInputDetails `json:"disksToIncludeForManagedDisks,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) MarshalJSON() ([]byte, error) { + hvraepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraepi.HvHostVMID != nil { + objectMap["hvHostVmId"] = hvraepi.HvHostVMID + } + if hvraepi.VMName != nil { + objectMap["vmName"] = hvraepi.VMName + } + if hvraepi.OsType != nil { + objectMap["osType"] = hvraepi.OsType + } + if hvraepi.VhdID != nil { + objectMap["vhdId"] = hvraepi.VhdID + } + if hvraepi.TargetStorageAccountID != nil { + objectMap["targetStorageAccountId"] = hvraepi.TargetStorageAccountID + } + if hvraepi.TargetAzureNetworkID != nil { + objectMap["targetAzureNetworkId"] = hvraepi.TargetAzureNetworkID + } + if hvraepi.TargetAzureSubnetID != nil { + objectMap["targetAzureSubnetId"] = hvraepi.TargetAzureSubnetID + } + if hvraepi.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = hvraepi.EnableRdpOnTargetOption + } + if hvraepi.TargetAzureVMName != nil { + objectMap["targetAzureVmName"] = hvraepi.TargetAzureVMName + } + if hvraepi.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = hvraepi.LogStorageAccountID + } + if hvraepi.DisksToInclude != nil { + objectMap["disksToInclude"] = hvraepi.DisksToInclude + } + if hvraepi.TargetAzureV1ResourceGroupID != nil { + objectMap["targetAzureV1ResourceGroupId"] = hvraepi.TargetAzureV1ResourceGroupID + } + if hvraepi.TargetAzureV2ResourceGroupID != nil { + objectMap["targetAzureV2ResourceGroupId"] = hvraepi.TargetAzureV2ResourceGroupID + } + if hvraepi.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvraepi.UseManagedDisks + } + if hvraepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = hvraepi.TargetAvailabilitySetID + } + if hvraepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvraepi.TargetAvailabilityZone + } + if hvraepi.LicenseType != "" { + objectMap["licenseType"] = hvraepi.LicenseType + } + if hvraepi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = hvraepi.SQLServerLicenseType + } + if hvraepi.TargetVMSize != nil { + objectMap["targetVmSize"] = hvraepi.TargetVMSize + } + if hvraepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvraepi.TargetProximityPlacementGroupID + } + if hvraepi.UseManagedDisksForReplication != nil { + objectMap["useManagedDisksForReplication"] = hvraepi.UseManagedDisksForReplication + } + if hvraepi.DiskType != "" { + objectMap["diskType"] = hvraepi.DiskType + } + if hvraepi.DisksToIncludeForManagedDisks != nil { + objectMap["disksToIncludeForManagedDisks"] = hvraepi.DisksToIncludeForManagedDisks + } + if hvraepi.DiskEncryptionSetID != nil { + objectMap["diskEncryptionSetId"] = hvraepi.DiskEncryptionSetID + } + if hvraepi.TargetVMTags != nil { + objectMap["targetVmTags"] = hvraepi.TargetVMTags + } + if hvraepi.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = hvraepi.SeedManagedDiskTags + } + if hvraepi.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvraepi.TargetManagedDiskTags + } + if hvraepi.TargetNicTags != nil { + objectMap["targetNicTags"] = hvraepi.TargetNicTags + } + if hvraepi.InstanceType != "" { + objectMap["instanceType"] = hvraepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return &hvraepi, true +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &hvraepi, true +} + +// HyperVReplicaAzureEventDetails model class for event details of a HyperVReplica E2A event. +type HyperVReplicaAzureEventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) MarshalJSON() ([]byte, error) { + hvraed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraed.ContainerName != nil { + objectMap["containerName"] = hvraed.ContainerName + } + if hvraed.FabricName != nil { + objectMap["fabricName"] = hvraed.FabricName + } + if hvraed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvraed.RemoteContainerName + } + if hvraed.InstanceType != "" { + objectMap["instanceType"] = hvraed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return &hvraed, true +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvraed, true +} + +// HyperVReplicaAzureFailbackProviderInput hyperVReplicaAzureFailback specific planned failover input. +type HyperVReplicaAzureFailbackProviderInput struct { + // DataSyncOption - Data sync option. + DataSyncOption *string `json:"dataSyncOption,omitempty"` + // RecoveryVMCreationOption - ALR options to create alternate recovery. + RecoveryVMCreationOption *string `json:"recoveryVmCreationOption,omitempty"` + // ProviderIDForAlternateRecovery - Provider Id for alternate location. + ProviderIDForAlternateRecovery *string `json:"providerIdForAlternateRecovery,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) MarshalJSON() ([]byte, error) { + hvrafpi.InstanceType = InstanceTypeHyperVReplicaAzureFailback + objectMap := make(map[string]interface{}) + if hvrafpi.DataSyncOption != nil { + objectMap["dataSyncOption"] = hvrafpi.DataSyncOption + } + if hvrafpi.RecoveryVMCreationOption != nil { + objectMap["recoveryVmCreationOption"] = hvrafpi.RecoveryVMCreationOption + } + if hvrafpi.ProviderIDForAlternateRecovery != nil { + objectMap["providerIdForAlternateRecovery"] = hvrafpi.ProviderIDForAlternateRecovery + } + if hvrafpi.InstanceType != "" { + objectMap["instanceType"] = hvrafpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return &hvrafpi, true +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &hvrafpi, true +} + +// HyperVReplicaAzureManagedDiskDetails hyper-V Managed disk details. +type HyperVReplicaAzureManagedDiskDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // SeedManagedDiskID - Seed managed disk Id. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // ReplicaDiskType - The replica disk type. + ReplicaDiskType *string `json:"replicaDiskType,omitempty"` + // DiskEncryptionSetID - The disk encryption set ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// HyperVReplicaAzurePlannedFailoverProviderInput hyperVReplicaAzure specific planned failover input. +type HyperVReplicaAzurePlannedFailoverProviderInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) MarshalJSON() ([]byte, error) { + hvrapfpi.InstanceType = InstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapfpi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvrapfpi.PrimaryKekCertificatePfx + } + if hvrapfpi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvrapfpi.SecondaryKekCertificatePfx + } + if hvrapfpi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvrapfpi.RecoveryPointID + } + if hvrapfpi.InstanceType != "" { + objectMap["instanceType"] = hvrapfpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return &hvrapfpi, true +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &hvrapfpi, true +} + +// HyperVReplicaAzurePolicyDetails hyper-V Replica Azure specific protection profile details. +type HyperVReplicaAzurePolicyDetails struct { + // RecoveryPointHistoryDurationInHours - The duration (in hours) to which point the recovery history needs to be maintained. + RecoveryPointHistoryDurationInHours *int32 `json:"recoveryPointHistoryDurationInHours,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - The interval (in hours) at which Hyper-V Replica should create an application consistent snapshot within the VM. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // ReplicationInterval - The replication interval. + ReplicationInterval *int32 `json:"replicationInterval,omitempty"` + // OnlineReplicationStartTime - The scheduled start time for the initial replication. If this parameter is Null, the initial replication starts immediately. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // Encryption - A value indicating whether encryption is enabled for virtual machines in this cloud. + Encryption *string `json:"encryption,omitempty"` + // ActiveStorageAccountID - The active storage account Id. + ActiveStorageAccountID *string `json:"activeStorageAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) MarshalJSON() ([]byte, error) { + hvrapd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapd.RecoveryPointHistoryDurationInHours != nil { + objectMap["recoveryPointHistoryDurationInHours"] = hvrapd.RecoveryPointHistoryDurationInHours + } + if hvrapd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrapd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrapd.ReplicationInterval != nil { + objectMap["replicationInterval"] = hvrapd.ReplicationInterval + } + if hvrapd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrapd.OnlineReplicationStartTime + } + if hvrapd.Encryption != nil { + objectMap["encryption"] = hvrapd.Encryption + } + if hvrapd.ActiveStorageAccountID != nil { + objectMap["activeStorageAccountId"] = hvrapd.ActiveStorageAccountID + } + if hvrapd.InstanceType != "" { + objectMap["instanceType"] = hvrapd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return &hvrapd, true +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrapd, true +} + +// HyperVReplicaAzurePolicyInput hyper-V Replica Azure specific input for creating a protection profile. +type HyperVReplicaAzurePolicyInput struct { + // RecoveryPointHistoryDuration - The duration (in hours) to which point the recovery history needs to be maintained. + RecoveryPointHistoryDuration *int32 `json:"recoveryPointHistoryDuration,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - The interval (in hours) at which Hyper-V Replica should create an application consistent snapshot within the VM. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // ReplicationInterval - The replication interval. + ReplicationInterval *int32 `json:"replicationInterval,omitempty"` + // OnlineReplicationStartTime - The scheduled start time for the initial replication. If this parameter is Null, the initial replication starts immediately. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // StorageAccounts - The list of storage accounts to which the VMs in the primary cloud can replicate to. + StorageAccounts *[]string `json:"storageAccounts,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) MarshalJSON() ([]byte, error) { + hvrapi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapi.RecoveryPointHistoryDuration != nil { + objectMap["recoveryPointHistoryDuration"] = hvrapi.RecoveryPointHistoryDuration + } + if hvrapi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrapi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrapi.ReplicationInterval != nil { + objectMap["replicationInterval"] = hvrapi.ReplicationInterval + } + if hvrapi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrapi.OnlineReplicationStartTime + } + if hvrapi.StorageAccounts != nil { + objectMap["storageAccounts"] = hvrapi.StorageAccounts + } + if hvrapi.InstanceType != "" { + objectMap["instanceType"] = hvrapi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return &hvrapi, true +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrapi, true +} + +// HyperVReplicaAzureReplicationDetails hyper V Replica Azure provider specific settings. +type HyperVReplicaAzureReplicationDetails struct { + // AzureVMDiskDetails - Azure VM Disk details. + AzureVMDiskDetails *[]AzureVMDiskDetails `json:"azureVmDiskDetails,omitempty"` + // RecoveryAzureVMName - Recovery Azure given name. + RecoveryAzureVMName *string `json:"recoveryAzureVmName,omitempty"` + // RecoveryAzureVMSize - The Recovery Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureStorageAccount - The recovery Azure storage account. + RecoveryAzureStorageAccount *string `json:"recoveryAzureStorageAccount,omitempty"` + // RecoveryAzureLogStorageAccountID - The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. + RecoveryAzureLogStorageAccountID *string `json:"recoveryAzureLogStorageAccountId,omitempty"` + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // RpoInSeconds - Last RPO value. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // SelectedRecoveryAzureNetworkID - The selected recovery azure network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // Encryption - The encryption info. + Encryption *string `json:"encryption,omitempty"` + // OSDetails - The operating system info. + OSDetails *OSDetails `json:"oSDetails,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // RecoveryAzureResourceGroupID - The target resource group Id. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]HyperVReplicaAzureManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) MarshalJSON() ([]byte, error) { + hvrard.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrard.AzureVMDiskDetails != nil { + objectMap["azureVmDiskDetails"] = hvrard.AzureVMDiskDetails + } + if hvrard.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVmName"] = hvrard.RecoveryAzureVMName + } + if hvrard.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = hvrard.RecoveryAzureVMSize + } + if hvrard.RecoveryAzureStorageAccount != nil { + objectMap["recoveryAzureStorageAccount"] = hvrard.RecoveryAzureStorageAccount + } + if hvrard.RecoveryAzureLogStorageAccountID != nil { + objectMap["recoveryAzureLogStorageAccountId"] = hvrard.RecoveryAzureLogStorageAccountID + } + if hvrard.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrard.LastReplicatedTime + } + if hvrard.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = hvrard.RpoInSeconds + } + if hvrard.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = hvrard.LastRpoCalculatedTime + } + if hvrard.VMID != nil { + objectMap["vmId"] = hvrard.VMID + } + if hvrard.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrard.VMProtectionState + } + if hvrard.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrard.VMProtectionStateDescription + } + if hvrard.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrard.InitialReplicationDetails + } + if hvrard.VMNics != nil { + objectMap["vmNics"] = hvrard.VMNics + } + if hvrard.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = hvrard.SelectedRecoveryAzureNetworkID + } + if hvrard.SelectedSourceNicID != nil { + objectMap["selectedSourceNicId"] = hvrard.SelectedSourceNicID + } + if hvrard.Encryption != nil { + objectMap["encryption"] = hvrard.Encryption + } + if hvrard.OSDetails != nil { + objectMap["oSDetails"] = hvrard.OSDetails + } + if hvrard.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = hvrard.SourceVMRAMSizeInMB + } + if hvrard.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = hvrard.SourceVMCPUCount + } + if hvrard.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = hvrard.EnableRdpOnTargetOption + } + if hvrard.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = hvrard.RecoveryAzureResourceGroupID + } + if hvrard.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = hvrard.RecoveryAvailabilitySetID + } + if hvrard.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvrard.TargetAvailabilityZone + } + if hvrard.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvrard.TargetProximityPlacementGroupID + } + if hvrard.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvrard.UseManagedDisks + } + if hvrard.LicenseType != nil { + objectMap["licenseType"] = hvrard.LicenseType + } + if hvrard.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = hvrard.SQLServerLicenseType + } + if hvrard.TargetVMTags != nil { + objectMap["targetVmTags"] = hvrard.TargetVMTags + } + if hvrard.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = hvrard.SeedManagedDiskTags + } + if hvrard.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvrard.TargetManagedDiskTags + } + if hvrard.TargetNicTags != nil { + objectMap["targetNicTags"] = hvrard.TargetNicTags + } + if hvrard.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = hvrard.ProtectedManagedDisks + } + if hvrard.InstanceType != "" { + objectMap["instanceType"] = hvrard.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return &hvrard, true +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrard, true +} + +// HyperVReplicaAzureReprotectInput azure specific reprotect input. +type HyperVReplicaAzureReprotectInput struct { + // HvHostVMID - The Hyper-V host Vm Id. + HvHostVMID *string `json:"hvHostVmId,omitempty"` + // VMName - The Vm Name. + VMName *string `json:"vmName,omitempty"` + // OsType - The OS type associated with vm. + OsType *string `json:"osType,omitempty"` + // VHDID - The OS disk VHD id associated with vm. + VHDID *string `json:"vHDId,omitempty"` + // StorageAccountID - The storage account name. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) MarshalJSON() ([]byte, error) { + hvrari.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrari.HvHostVMID != nil { + objectMap["hvHostVmId"] = hvrari.HvHostVMID + } + if hvrari.VMName != nil { + objectMap["vmName"] = hvrari.VMName + } + if hvrari.OsType != nil { + objectMap["osType"] = hvrari.OsType + } + if hvrari.VHDID != nil { + objectMap["vHDId"] = hvrari.VHDID + } + if hvrari.StorageAccountID != nil { + objectMap["storageAccountId"] = hvrari.StorageAccountID + } + if hvrari.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = hvrari.LogStorageAccountID + } + if hvrari.InstanceType != "" { + objectMap["instanceType"] = hvrari.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return &hvrari, true +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &hvrari, true +} + +// HyperVReplicaAzureTestFailoverInput hvrA provider specific input for test failover. +type HyperVReplicaAzureTestFailoverInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) MarshalJSON() ([]byte, error) { + hvratfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvratfi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvratfi.PrimaryKekCertificatePfx + } + if hvratfi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvratfi.SecondaryKekCertificatePfx + } + if hvratfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvratfi.RecoveryPointID + } + if hvratfi.InstanceType != "" { + objectMap["instanceType"] = hvratfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return &hvratfi, true +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &hvratfi, true +} + +// HyperVReplicaAzureUnplannedFailoverInput hvrA provider specific input for unplanned failover. +type HyperVReplicaAzureUnplannedFailoverInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + hvraufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraufi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvraufi.PrimaryKekCertificatePfx + } + if hvraufi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvraufi.SecondaryKekCertificatePfx + } + if hvraufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvraufi.RecoveryPointID + } + if hvraufi.InstanceType != "" { + objectMap["instanceType"] = hvraufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return &hvraufi, true +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &hvraufi, true +} + +// HyperVReplicaAzureUpdateReplicationProtectedItemInput hyperV replica Azure input to update replication +// protected item. +type HyperVReplicaAzureUpdateReplicationProtectedItemInput struct { + // RecoveryAzureV1ResourceGroupID - The recovery Azure resource group Id for classic deployment. + RecoveryAzureV1ResourceGroupID *string `json:"recoveryAzureV1ResourceGroupId,omitempty"` + // RecoveryAzureV2ResourceGroupID - The recovery Azure resource group Id for resource manager deployment. + RecoveryAzureV2ResourceGroupID *string `json:"recoveryAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // DiskIDToDiskEncryptionMap - The dictionary of disk resource Id to disk encryption set ARM Id. + DiskIDToDiskEncryptionMap map[string]*string `json:"diskIdToDiskEncryptionMap"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // VMDisks - The list of disk update properties. + VMDisks *[]UpdateDiskInput `json:"vmDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + hvraurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraurpii.RecoveryAzureV1ResourceGroupID != nil { + objectMap["recoveryAzureV1ResourceGroupId"] = hvraurpii.RecoveryAzureV1ResourceGroupID + } + if hvraurpii.RecoveryAzureV2ResourceGroupID != nil { + objectMap["recoveryAzureV2ResourceGroupId"] = hvraurpii.RecoveryAzureV2ResourceGroupID + } + if hvraurpii.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvraurpii.UseManagedDisks + } + if hvraurpii.DiskIDToDiskEncryptionMap != nil { + objectMap["diskIdToDiskEncryptionMap"] = hvraurpii.DiskIDToDiskEncryptionMap + } + if hvraurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvraurpii.TargetProximityPlacementGroupID + } + if hvraurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvraurpii.TargetAvailabilityZone + } + if hvraurpii.TargetVMTags != nil { + objectMap["targetVmTags"] = hvraurpii.TargetVMTags + } + if hvraurpii.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvraurpii.TargetManagedDiskTags + } + if hvraurpii.TargetNicTags != nil { + objectMap["targetNicTags"] = hvraurpii.TargetNicTags + } + if hvraurpii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = hvraurpii.SQLServerLicenseType + } + if hvraurpii.VMDisks != nil { + objectMap["vmDisks"] = hvraurpii.VMDisks + } + if hvraurpii.InstanceType != "" { + objectMap["instanceType"] = hvraurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return &hvraurpii, true +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &hvraurpii, true +} + +// HyperVReplicaBaseEventDetails abstract model class for event details of a HyperVReplica E2E event. +type HyperVReplicaBaseEventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) MarshalJSON() ([]byte, error) { + hvrbed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails + objectMap := make(map[string]interface{}) + if hvrbed.ContainerName != nil { + objectMap["containerName"] = hvrbed.ContainerName + } + if hvrbed.FabricName != nil { + objectMap["fabricName"] = hvrbed.FabricName + } + if hvrbed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvrbed.RemoteContainerName + } + if hvrbed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvrbed.RemoteFabricName + } + if hvrbed.InstanceType != "" { + objectMap["instanceType"] = hvrbed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return &hvrbed, true +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvrbed, true +} + +// HyperVReplicaBasePolicyDetails base class for HyperVReplica policy details. +type HyperVReplicaBasePolicyDetails struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud. + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) MarshalJSON() ([]byte, error) { + hvrbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails + objectMap := make(map[string]interface{}) + if hvrbpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpd.RecoveryPoints + } + if hvrbpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpd.Compression != nil { + objectMap["compression"] = hvrbpd.Compression + } + if hvrbpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpd.InitialReplicationMethod + } + if hvrbpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpd.OnlineReplicationStartTime + } + if hvrbpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpd.OfflineReplicationImportPath + } + if hvrbpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpd.OfflineReplicationExportPath + } + if hvrbpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpd.ReplicationPort + } + if hvrbpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpd.AllowedAuthenticationType + } + if hvrbpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrbpd.ReplicaDeletionOption + } + if hvrbpd.InstanceType != "" { + objectMap["instanceType"] = hvrbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return &hvrbpd, true +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrbpd, true +} + +// HyperVReplicaBaseReplicationDetails hyper V replica provider specific settings base class. +type HyperVReplicaBaseReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) MarshalJSON() ([]byte, error) { + hvrbrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails + objectMap := make(map[string]interface{}) + if hvrbrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrbrd.LastReplicatedTime + } + if hvrbrd.VMNics != nil { + objectMap["vmNics"] = hvrbrd.VMNics + } + if hvrbrd.VMID != nil { + objectMap["vmId"] = hvrbrd.VMID + } + if hvrbrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrbrd.VMProtectionState + } + if hvrbrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrbrd.VMProtectionStateDescription + } + if hvrbrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrbrd.InitialReplicationDetails + } + if hvrbrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrbrd.VMDiskDetails + } + if hvrbrd.InstanceType != "" { + objectMap["instanceType"] = hvrbrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return &hvrbrd, true +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrbrd, true +} + +// HyperVReplicaBluePolicyDetails hyper-V Replica Blue specific protection profile details. +type HyperVReplicaBluePolicyDetails struct { + // ReplicationFrequencyInSeconds - A value indicating the replication interval. + ReplicationFrequencyInSeconds *int32 `json:"replicationFrequencyInSeconds,omitempty"` + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) MarshalJSON() ([]byte, error) { + hvrbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbpd.ReplicationFrequencyInSeconds != nil { + objectMap["replicationFrequencyInSeconds"] = hvrbpd.ReplicationFrequencyInSeconds + } + if hvrbpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpd.RecoveryPoints + } + if hvrbpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpd.Compression != nil { + objectMap["compression"] = hvrbpd.Compression + } + if hvrbpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpd.InitialReplicationMethod + } + if hvrbpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpd.OnlineReplicationStartTime + } + if hvrbpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpd.OfflineReplicationImportPath + } + if hvrbpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpd.OfflineReplicationExportPath + } + if hvrbpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpd.ReplicationPort + } + if hvrbpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpd.AllowedAuthenticationType + } + if hvrbpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrbpd.ReplicaDeletionOption + } + if hvrbpd.InstanceType != "" { + objectMap["instanceType"] = hvrbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return &hvrbpd, true +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrbpd, true +} + +// HyperVReplicaBluePolicyInput hyperV Replica Blue policy input. +type HyperVReplicaBluePolicyInput struct { + // ReplicationFrequencyInSeconds - A value indicating the replication interval. + ReplicationFrequencyInSeconds *int32 `json:"replicationFrequencyInSeconds,omitempty"` + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletion - A value indicating whether the VM has to be auto deleted. + ReplicaDeletion *string `json:"replicaDeletion,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) MarshalJSON() ([]byte, error) { + hvrbpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbpi.ReplicationFrequencyInSeconds != nil { + objectMap["replicationFrequencyInSeconds"] = hvrbpi.ReplicationFrequencyInSeconds + } + if hvrbpi.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpi.RecoveryPoints + } + if hvrbpi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpi.Compression != nil { + objectMap["compression"] = hvrbpi.Compression + } + if hvrbpi.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpi.InitialReplicationMethod + } + if hvrbpi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpi.OnlineReplicationStartTime + } + if hvrbpi.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpi.OfflineReplicationImportPath + } + if hvrbpi.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpi.OfflineReplicationExportPath + } + if hvrbpi.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpi.ReplicationPort + } + if hvrbpi.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpi.AllowedAuthenticationType + } + if hvrbpi.ReplicaDeletion != nil { + objectMap["replicaDeletion"] = hvrbpi.ReplicaDeletion + } + if hvrbpi.InstanceType != "" { + objectMap["instanceType"] = hvrbpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return &hvrbpi, true +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return &hvrbpi, true +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrbpi, true +} + +// HyperVReplicaBlueReplicationDetails hyperV replica 2012 R2 (Blue) replication details. +type HyperVReplicaBlueReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) MarshalJSON() ([]byte, error) { + hvrbrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrbrd.LastReplicatedTime + } + if hvrbrd.VMNics != nil { + objectMap["vmNics"] = hvrbrd.VMNics + } + if hvrbrd.VMID != nil { + objectMap["vmId"] = hvrbrd.VMID + } + if hvrbrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrbrd.VMProtectionState + } + if hvrbrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrbrd.VMProtectionStateDescription + } + if hvrbrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrbrd.InitialReplicationDetails + } + if hvrbrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrbrd.VMDiskDetails + } + if hvrbrd.InstanceType != "" { + objectMap["instanceType"] = hvrbrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return &hvrbrd, true +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrbrd, true +} + +// HyperVReplicaPolicyDetails hyper-V Replica Blue specific protection profile details. +type HyperVReplicaPolicyDetails struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) MarshalJSON() ([]byte, error) { + hvrpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrpd.RecoveryPoints + } + if hvrpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrpd.Compression != nil { + objectMap["compression"] = hvrpd.Compression + } + if hvrpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrpd.InitialReplicationMethod + } + if hvrpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrpd.OnlineReplicationStartTime + } + if hvrpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrpd.OfflineReplicationImportPath + } + if hvrpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrpd.OfflineReplicationExportPath + } + if hvrpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrpd.ReplicationPort + } + if hvrpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrpd.AllowedAuthenticationType + } + if hvrpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrpd.ReplicaDeletionOption + } + if hvrpd.InstanceType != "" { + objectMap["instanceType"] = hvrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return &hvrpd, true +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrpd, true +} + +// BasicHyperVReplicaPolicyInput hyper-V Replica specific policy Input. +type BasicHyperVReplicaPolicyInput interface { + AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) + AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) +} + +// HyperVReplicaPolicyInput hyper-V Replica specific policy Input. +type HyperVReplicaPolicyInput struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletion - A value indicating whether the VM has to be auto deleted. + ReplicaDeletion *string `json:"replicaDeletion,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicHyperVReplicaPolicyInput(body []byte) (BasicHyperVReplicaPolicyInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2): + var hvrbpi HyperVReplicaBluePolicyInput + err := json.Unmarshal(body, &hvrbpi) + return hvrbpi, err + default: + var hvrpi HyperVReplicaPolicyInput + err := json.Unmarshal(body, &hvrpi) + return hvrpi, err + } +} +func unmarshalBasicHyperVReplicaPolicyInputArray(body []byte) ([]BasicHyperVReplicaPolicyInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + hvrpiArray := make([]BasicHyperVReplicaPolicyInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + hvrpi, err := unmarshalBasicHyperVReplicaPolicyInput(*rawMessage) + if err != nil { + return nil, err + } + hvrpiArray[index] = hvrpi + } + return hvrpiArray, nil +} + +// MarshalJSON is the custom marshaler for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) MarshalJSON() ([]byte, error) { + hvrpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrpi.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrpi.RecoveryPoints + } + if hvrpi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrpi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrpi.Compression != nil { + objectMap["compression"] = hvrpi.Compression + } + if hvrpi.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrpi.InitialReplicationMethod + } + if hvrpi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrpi.OnlineReplicationStartTime + } + if hvrpi.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrpi.OfflineReplicationImportPath + } + if hvrpi.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrpi.OfflineReplicationExportPath + } + if hvrpi.ReplicationPort != nil { + objectMap["replicationPort"] = hvrpi.ReplicationPort + } + if hvrpi.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrpi.AllowedAuthenticationType + } + if hvrpi.ReplicaDeletion != nil { + objectMap["replicaDeletion"] = hvrpi.ReplicaDeletion + } + if hvrpi.InstanceType != "" { + objectMap["instanceType"] = hvrpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return &hvrpi, true +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return &hvrpi, true +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrpi, true +} + +// HyperVReplicaReplicationDetails hyperV replica 2012 replication details. +type HyperVReplicaReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) MarshalJSON() ([]byte, error) { + hvrrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrrd.LastReplicatedTime + } + if hvrrd.VMNics != nil { + objectMap["vmNics"] = hvrrd.VMNics + } + if hvrrd.VMID != nil { + objectMap["vmId"] = hvrrd.VMID + } + if hvrrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrrd.VMProtectionState + } + if hvrrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrrd.VMProtectionStateDescription + } + if hvrrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrrd.InitialReplicationDetails + } + if hvrrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrrd.VMDiskDetails + } + if hvrrd.InstanceType != "" { + objectMap["instanceType"] = hvrrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return &hvrrd, true +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrrd, true +} + +// HyperVSiteDetails hyperVSite fabric specific details. +type HyperVSiteDetails struct { + // HyperVHosts - The list of Hyper-V hosts associated with the fabric. + HyperVHosts *[]HyperVHostDetails `json:"hyperVHosts,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) MarshalJSON() ([]byte, error) { + hvsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite + objectMap := make(map[string]interface{}) + if hvsd.HyperVHosts != nil { + objectMap["hyperVHosts"] = hvsd.HyperVHosts + } + if hvsd.InstanceType != "" { + objectMap["instanceType"] = hvsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return &hvsd, true +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &hvsd, true +} + +// BasicHyperVVirtualMachineDetails single Host fabric provider specific VM settings. +type BasicHyperVVirtualMachineDetails interface { + AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) + AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) +} + +// HyperVVirtualMachineDetails single Host fabric provider specific VM settings. +type HyperVVirtualMachineDetails struct { + // SourceItemID - The source id of the object. + SourceItemID *string `json:"sourceItemId,omitempty"` + // Generation - The id of the object in fabric. + Generation *string `json:"generation,omitempty"` + // OsDetails - The Last replication time. + OsDetails *OSDetails `json:"osDetails,omitempty"` + // DiskDetails - The Last successful failover time. + DiskDetails *[]DiskDetails `json:"diskDetails,omitempty"` + // HasPhysicalDisk - A value indicating whether the VM has a physical disk attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasPhysicalDisk PresenceStatus `json:"hasPhysicalDisk,omitempty"` + // HasFibreChannelAdapter - A value indicating whether the VM has a fibre channel adapter attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasFibreChannelAdapter PresenceStatus `json:"hasFibreChannelAdapter,omitempty"` + // HasSharedVhd - A value indicating whether the VM has a shared VHD attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasSharedVhd PresenceStatus `json:"hasSharedVhd,omitempty"` + // HyperVHostID - The Id of the hyper-v host in fabric. + HyperVHostID *string `json:"hyperVHostId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicHyperVVirtualMachineDetails(body []byte) (BasicHyperVVirtualMachineDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeVmmVirtualMachine): + var vvmd VmmVirtualMachineDetails + err := json.Unmarshal(body, &vvmd) + return vvmd, err + default: + var hvvmd HyperVVirtualMachineDetails + err := json.Unmarshal(body, &hvvmd) + return hvvmd, err + } +} +func unmarshalBasicHyperVVirtualMachineDetailsArray(body []byte) ([]BasicHyperVVirtualMachineDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + hvvmdArray := make([]BasicHyperVVirtualMachineDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + hvvmd, err := unmarshalBasicHyperVVirtualMachineDetails(*rawMessage) + if err != nil { + return nil, err + } + hvvmdArray[index] = hvvmd + } + return hvvmdArray, nil +} + +// MarshalJSON is the custom marshaler for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) MarshalJSON() ([]byte, error) { + hvvmd.InstanceType = InstanceTypeHyperVVirtualMachine + objectMap := make(map[string]interface{}) + if hvvmd.SourceItemID != nil { + objectMap["sourceItemId"] = hvvmd.SourceItemID + } + if hvvmd.Generation != nil { + objectMap["generation"] = hvvmd.Generation + } + if hvvmd.OsDetails != nil { + objectMap["osDetails"] = hvvmd.OsDetails + } + if hvvmd.DiskDetails != nil { + objectMap["diskDetails"] = hvvmd.DiskDetails + } + if hvvmd.HasPhysicalDisk != "" { + objectMap["hasPhysicalDisk"] = hvvmd.HasPhysicalDisk + } + if hvvmd.HasFibreChannelAdapter != "" { + objectMap["hasFibreChannelAdapter"] = hvvmd.HasFibreChannelAdapter + } + if hvvmd.HasSharedVhd != "" { + objectMap["hasSharedVhd"] = hvvmd.HasSharedVhd + } + if hvvmd.HyperVHostID != nil { + objectMap["hyperVHostId"] = hvvmd.HyperVHostID + } + if hvvmd.InstanceType != "" { + objectMap["instanceType"] = hvvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return &hvvmd, true +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return &hvvmd, true +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &hvvmd, true +} + +// IdentityProviderDetails identity provider details. +type IdentityProviderDetails struct { + // TenantID - The tenant Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + TenantID *string `json:"tenantId,omitempty"` + // ApplicationID - The application/client Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ApplicationID *string `json:"applicationId,omitempty"` + // ObjectID - The object Id of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ObjectID *string `json:"objectId,omitempty"` + // Audience - The intended Audience of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + Audience *string `json:"audience,omitempty"` + // AadAuthority - The base authority for Azure Active Directory authentication. + AadAuthority *string `json:"aadAuthority,omitempty"` +} + +// IdentityProviderInput identity provider input. +type IdentityProviderInput struct { + // TenantID - The tenant Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + TenantID *string `json:"tenantId,omitempty"` + // ApplicationID - The application/client Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ApplicationID *string `json:"applicationId,omitempty"` + // ObjectID - The object Id of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ObjectID *string `json:"objectId,omitempty"` + // Audience - The intended Audience of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + Audience *string `json:"audience,omitempty"` + // AadAuthority - The base authority for Azure Active Directory authentication. + AadAuthority *string `json:"aadAuthority,omitempty"` +} + +// InconsistentVMDetails this class stores the monitoring details for consistency check of inconsistent +// Protected Entity. +type InconsistentVMDetails struct { + // VMName - The Vm name. + VMName *string `json:"vmName,omitempty"` + // CloudName - The Cloud name. + CloudName *string `json:"cloudName,omitempty"` + // Details - The list of details regarding state of the Protected Entity in SRS and On prem. + Details *[]string `json:"details,omitempty"` + // ErrorIds - The list of error ids. + ErrorIds *[]string `json:"errorIds,omitempty"` +} + +// InitialReplicationDetails initial replication details. +type InitialReplicationDetails struct { + // InitialReplicationType - Initial replication type. + InitialReplicationType *string `json:"initialReplicationType,omitempty"` + // InitialReplicationProgressPercentage - The initial replication progress percentage. + InitialReplicationProgressPercentage *string `json:"initialReplicationProgressPercentage,omitempty"` +} + +// InlineWorkflowTaskDetails this class represents the inline workflow task details. +type InlineWorkflowTaskDetails struct { + // WorkflowIds - The list of child workflow ids. + WorkflowIds *[]string `json:"workflowIds,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) MarshalJSON() ([]byte, error) { + iwtd.InstanceType = InstanceTypeInlineWorkflowTaskDetails + objectMap := make(map[string]interface{}) + if iwtd.WorkflowIds != nil { + objectMap["workflowIds"] = iwtd.WorkflowIds + } + if iwtd.ChildTasks != nil { + objectMap["childTasks"] = iwtd.ChildTasks + } + if iwtd.InstanceType != "" { + objectMap["instanceType"] = iwtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return &iwtd, true +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &iwtd, true +} + +// InMageAgentDetails the details of the InMage agent. +type InMageAgentDetails struct { + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentUpdateStatus - A value indicating whether installed agent needs to be updated. + AgentUpdateStatus *string `json:"agentUpdateStatus,omitempty"` + // PostUpdateRebootStatus - A value indicating whether reboot is required after update is applied. + PostUpdateRebootStatus *string `json:"postUpdateRebootStatus,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` +} + +// InMageAzureV2ApplyRecoveryPointInput applyRecoveryPoint input specific to InMageAzureV2 provider. +type InMageAzureV2ApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + imavarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavarpi.InstanceType != "" { + objectMap["instanceType"] = imavarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return &imavarpi, true +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &imavarpi, true +} + +// InMageAzureV2DiskInputDetails disk input details. +type InMageAzureV2DiskInputDetails struct { + // DiskID - The DiskId. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The LogStorageAccountId. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageAzureV2EnableProtectionInput vMware Azure specific enable protection input. +type InMageAzureV2EnableProtectionInput struct { + // MasterTargetID - The Master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // StorageAccountID - The storage account Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // MultiVMGroupID - The multi VM group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]InMageAzureV2DiskInputDetails `json:"disksToInclude,omitempty"` + // TargetAzureNetworkID - The selected target Azure network Id. + TargetAzureNetworkID *string `json:"targetAzureNetworkId,omitempty"` + // TargetAzureSubnetID - The selected target Azure subnet Id. + TargetAzureSubnetID *string `json:"targetAzureSubnetId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target VM after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // TargetAzureVMName - The target azure VM Name. + TargetAzureVMName *string `json:"targetAzureVmName,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // TargetAzureV1ResourceGroupID - The Id of the target resource group (for classic deployment) in which the failover VM is to be created. + TargetAzureV1ResourceGroupID *string `json:"targetAzureV1ResourceGroupId,omitempty"` + // TargetAzureV2ResourceGroupID - The Id of the target resource group (for resource manager deployment) in which the failover VM is to be created. + TargetAzureV2ResourceGroupID *string `json:"targetAzureV2ResourceGroupId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id for resource manager deployment. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) MarshalJSON() ([]byte, error) { + imavepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavepi.MasterTargetID != nil { + objectMap["masterTargetId"] = imavepi.MasterTargetID + } + if imavepi.ProcessServerID != nil { + objectMap["processServerId"] = imavepi.ProcessServerID + } + if imavepi.StorageAccountID != nil { + objectMap["storageAccountId"] = imavepi.StorageAccountID + } + if imavepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imavepi.RunAsAccountID + } + if imavepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imavepi.MultiVMGroupID + } + if imavepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imavepi.MultiVMGroupName + } + if imavepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imavepi.DisksToInclude + } + if imavepi.TargetAzureNetworkID != nil { + objectMap["targetAzureNetworkId"] = imavepi.TargetAzureNetworkID + } + if imavepi.TargetAzureSubnetID != nil { + objectMap["targetAzureSubnetId"] = imavepi.TargetAzureSubnetID + } + if imavepi.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = imavepi.EnableRdpOnTargetOption + } + if imavepi.TargetAzureVMName != nil { + objectMap["targetAzureVmName"] = imavepi.TargetAzureVMName + } + if imavepi.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imavepi.LogStorageAccountID + } + if imavepi.TargetAzureV1ResourceGroupID != nil { + objectMap["targetAzureV1ResourceGroupId"] = imavepi.TargetAzureV1ResourceGroupID + } + if imavepi.TargetAzureV2ResourceGroupID != nil { + objectMap["targetAzureV2ResourceGroupId"] = imavepi.TargetAzureV2ResourceGroupID + } + if imavepi.DiskType != "" { + objectMap["diskType"] = imavepi.DiskType + } + if imavepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imavepi.TargetAvailabilitySetID + } + if imavepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavepi.TargetAvailabilityZone + } + if imavepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavepi.TargetProximityPlacementGroupID + } + if imavepi.LicenseType != "" { + objectMap["licenseType"] = imavepi.LicenseType + } + if imavepi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = imavepi.SQLServerLicenseType + } + if imavepi.TargetVMSize != nil { + objectMap["targetVmSize"] = imavepi.TargetVMSize + } + if imavepi.DiskEncryptionSetID != nil { + objectMap["diskEncryptionSetId"] = imavepi.DiskEncryptionSetID + } + if imavepi.TargetVMTags != nil { + objectMap["targetVmTags"] = imavepi.TargetVMTags + } + if imavepi.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = imavepi.SeedManagedDiskTags + } + if imavepi.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavepi.TargetManagedDiskTags + } + if imavepi.TargetNicTags != nil { + objectMap["targetNicTags"] = imavepi.TargetNicTags + } + if imavepi.InstanceType != "" { + objectMap["instanceType"] = imavepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return &imavepi, true +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imavepi, true +} + +// InMageAzureV2EventDetails model class for event details of a VMwareAzureV2 event. +type InMageAzureV2EventDetails struct { + // EventType - InMage Event type. Takes one of the values of InMageDataContract.InMageMonitoringEventType. + EventType *string `json:"eventType,omitempty"` + // Category - InMage Event Category. + Category *string `json:"category,omitempty"` + // Component - InMage Event Component. + Component *string `json:"component,omitempty"` + // CorrectiveAction - Corrective Action string for the event. + CorrectiveAction *string `json:"correctiveAction,omitempty"` + // Details - InMage Event Details. + Details *string `json:"details,omitempty"` + // Summary - InMage Event Summary. + Summary *string `json:"summary,omitempty"` + // SiteName - VMware Site name. + SiteName *string `json:"siteName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) MarshalJSON() ([]byte, error) { + imaved.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imaved.EventType != nil { + objectMap["eventType"] = imaved.EventType + } + if imaved.Category != nil { + objectMap["category"] = imaved.Category + } + if imaved.Component != nil { + objectMap["component"] = imaved.Component + } + if imaved.CorrectiveAction != nil { + objectMap["correctiveAction"] = imaved.CorrectiveAction + } + if imaved.Details != nil { + objectMap["details"] = imaved.Details + } + if imaved.Summary != nil { + objectMap["summary"] = imaved.Summary + } + if imaved.SiteName != nil { + objectMap["siteName"] = imaved.SiteName + } + if imaved.InstanceType != "" { + objectMap["instanceType"] = imaved.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return &imaved, true +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imaved, true +} + +// InMageAzureV2ManagedDiskDetails inMageAzureV2 Managed disk details. +type InMageAzureV2ManagedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // SeedManagedDiskID - Seed managed disk Id. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // ReplicaDiskType - The replica disk type. + ReplicaDiskType *string `json:"replicaDiskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetDiskName - The target disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// InMageAzureV2PolicyDetails inMage Azure v2 specific protection profile details. +type InMageAzureV2PolicyDetails struct { + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) MarshalJSON() ([]byte, error) { + imavpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imavpd.CrashConsistentFrequencyInMinutes + } + if imavpd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imavpd.RecoveryPointThresholdInMinutes + } + if imavpd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imavpd.RecoveryPointHistory + } + if imavpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imavpd.AppConsistentFrequencyInMinutes + } + if imavpd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imavpd.MultiVMSyncStatus + } + if imavpd.InstanceType != "" { + objectMap["instanceType"] = imavpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return &imavpd, true +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imavpd, true +} + +// InMageAzureV2PolicyInput vMWare Azure specific policy Input. +type InMageAzureV2PolicyInput struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) MarshalJSON() ([]byte, error) { + imavpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavpi.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imavpi.RecoveryPointThresholdInMinutes + } + if imavpi.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imavpi.RecoveryPointHistory + } + if imavpi.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imavpi.CrashConsistentFrequencyInMinutes + } + if imavpi.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imavpi.AppConsistentFrequencyInMinutes + } + if imavpi.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = imavpi.MultiVMSyncStatus + } + if imavpi.InstanceType != "" { + objectMap["instanceType"] = imavpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return &imavpi, true +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imavpi, true +} + +// InMageAzureV2ProtectedDiskDetails inMageAzureV2 protected disk details. +type InMageAzureV2ProtectedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // HealthErrorCode - The health error code for the disk. + HealthErrorCode *string `json:"healthErrorCode,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncDurationInSeconds - The resync duration in seconds. + ResyncDurationInSeconds *int64 `json:"resyncDurationInSeconds,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // FileSystemCapacityInBytes - The disk file system capacity in bytes. + FileSystemCapacityInBytes *int64 `json:"fileSystemCapacityInBytes,omitempty"` + // SourceDataInMegaBytes - The source data transit in MB. + SourceDataInMegaBytes *float64 `json:"sourceDataInMegaBytes,omitempty"` + // PsDataInMegaBytes - The PS data transit in MB. + PsDataInMegaBytes *float64 `json:"psDataInMegaBytes,omitempty"` + // TargetDataInMegaBytes - The target data transit in MB. + TargetDataInMegaBytes *float64 `json:"targetDataInMegaBytes,omitempty"` + // DiskResized - A value indicating whether disk is resized. + DiskResized *string `json:"diskResized,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // ResyncProcessedBytes - The resync processed bytes. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTotalTransferredBytes - The resync total transferred bytes. + ResyncTotalTransferredBytes *int64 `json:"resyncTotalTransferredBytes,omitempty"` + // ResyncLast15MinutesTransferredBytes - The resync last 15 minutes transferred bytes. + ResyncLast15MinutesTransferredBytes *int64 `json:"resyncLast15MinutesTransferredBytes,omitempty"` + // ResyncLastDataTransferTimeUTC - The last data transfer time in UTC. + ResyncLastDataTransferTimeUTC *date.Time `json:"resyncLastDataTransferTimeUTC,omitempty"` + // ResyncStartTime - The resync start time. + ResyncStartTime *date.Time `json:"resyncStartTime,omitempty"` + // ProgressHealth - The Progress Health. + ProgressHealth *string `json:"progressHealth,omitempty"` + // ProgressStatus - The Progress Status. + ProgressStatus *string `json:"progressStatus,omitempty"` +} + +// InMageAzureV2RecoveryPointDetails inMage Azure V2 provider specific recovery point details. +type InMageAzureV2RecoveryPointDetails struct { + // IsMultiVMSyncPoint - A value indicating whether the recovery point is multi VM consistent. + IsMultiVMSyncPoint *string `json:"isMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) MarshalJSON() ([]byte, error) { + imavrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavrpd.IsMultiVMSyncPoint != nil { + objectMap["isMultiVmSyncPoint"] = imavrpd.IsMultiVMSyncPoint + } + if imavrpd.InstanceType != "" { + objectMap["instanceType"] = imavrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return &imavrpd, true +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &imavrpd, true +} + +// InMageAzureV2ReplicationDetails inMageAzureV2 provider specific settings. +type InMageAzureV2ReplicationDetails struct { + // InfrastructureVMID - The infrastructure VM Id. + InfrastructureVMID *string `json:"infrastructureVmId,omitempty"` + // VCenterInfrastructureID - The vCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // CompressedDataRateInMB - The compressed data change rate in MB. + CompressedDataRateInMB *float64 `json:"compressedDataRateInMB,omitempty"` + // UncompressedDataRateInMB - The uncompressed data change rate in MB. + UncompressedDataRateInMB *float64 `json:"uncompressedDataRateInMB,omitempty"` + // IPAddress - The source IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // IsAgentUpdateRequired - A value indicating whether installed agent needs to be updated. + IsAgentUpdateRequired *string `json:"isAgentUpdateRequired,omitempty"` + // IsRebootAfterUpdateRequired - A value indicating whether the source server requires a restart after update. + IsRebootAfterUpdateRequired *string `json:"isRebootAfterUpdateRequired,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // ProcessServerName - The process server name. + ProcessServerName *string `json:"processServerName,omitempty"` + // MultiVMGroupID - The multi vm group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi vm sync is enabled or disabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageAzureV2ProtectedDiskDetails `json:"protectedDisks,omitempty"` + // DiskResized - A value indicating whether any disk is resized for this VM. + DiskResized *string `json:"diskResized,omitempty"` + // MasterTargetID - The master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // OsType - The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // VhdName - The OS disk VHD name. + VhdName *string `json:"vhdName,omitempty"` + // OsDiskID - The id of the disk containing the OS. + OsDiskID *string `json:"osDiskId,omitempty"` + // AzureVMDiskDetails - Azure VM Disk details. + AzureVMDiskDetails *[]AzureVMDiskDetails `json:"azureVMDiskDetails,omitempty"` + // RecoveryAzureVMName - Recovery Azure given name. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureVMSize - The Recovery Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureStorageAccount - The recovery Azure storage account. + RecoveryAzureStorageAccount *string `json:"recoveryAzureStorageAccount,omitempty"` + // RecoveryAzureLogStorageAccountID - The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. + RecoveryAzureLogStorageAccountID *string `json:"recoveryAzureLogStorageAccountId,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // SelectedRecoveryAzureNetworkID - The selected recovery azure network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The test failover virtual network. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. Value can be vCenter or physical. + DiscoveryType *string `json:"discoveryType,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // Datastores - The datastores of the on-premise machine. Value can be list of strings that contain datastore names. + Datastores *[]string `json:"datastores,omitempty"` + // TargetVMID - The ARM Id of the target Azure VM. This value will be null until the VM is failed over. Only after failure it will be populated with the ARM Id of the Azure VM. + TargetVMID *string `json:"targetVmId,omitempty"` + // RecoveryAzureResourceGroupID - The target resource group Id. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // ValidationErrors - The validation errors of the on-premise machine Value can be list of validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastUpdateReceivedTime - The last update time received from on-prem components. + LastUpdateReceivedTime *date.Time `json:"lastUpdateReceivedTime,omitempty"` + // ReplicaID - The replica id of the protected item. + ReplicaID *string `json:"replicaId,omitempty"` + // OsVersion - The OS Version of the protected item. + OsVersion *string `json:"osVersion,omitempty"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]InMageAzureV2ManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // FirmwareType - The firmware type of this protected item. + FirmwareType *string `json:"firmwareType,omitempty"` + // AzureVMGeneration - The target generation for this protected item. + AzureVMGeneration *string `json:"azureVmGeneration,omitempty"` + // IsAdditionalStatsAvailable - A value indicating whether additional IR stats are available or not. + IsAdditionalStatsAvailable *bool `json:"isAdditionalStatsAvailable,omitempty"` + // TotalDataTransferred - The total transferred data in bytes. + TotalDataTransferred *int64 `json:"totalDataTransferred,omitempty"` + // TotalProgressHealth - The progress health. + TotalProgressHealth *string `json:"totalProgressHealth,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) MarshalJSON() ([]byte, error) { + imavrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavrd.InfrastructureVMID != nil { + objectMap["infrastructureVmId"] = imavrd.InfrastructureVMID + } + if imavrd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = imavrd.VCenterInfrastructureID + } + if imavrd.ProtectionStage != nil { + objectMap["protectionStage"] = imavrd.ProtectionStage + } + if imavrd.VMID != nil { + objectMap["vmId"] = imavrd.VMID + } + if imavrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = imavrd.VMProtectionState + } + if imavrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = imavrd.VMProtectionStateDescription + } + if imavrd.ResyncProgressPercentage != nil { + objectMap["resyncProgressPercentage"] = imavrd.ResyncProgressPercentage + } + if imavrd.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = imavrd.RpoInSeconds + } + if imavrd.CompressedDataRateInMB != nil { + objectMap["compressedDataRateInMB"] = imavrd.CompressedDataRateInMB + } + if imavrd.UncompressedDataRateInMB != nil { + objectMap["uncompressedDataRateInMB"] = imavrd.UncompressedDataRateInMB + } + if imavrd.IPAddress != nil { + objectMap["ipAddress"] = imavrd.IPAddress + } + if imavrd.AgentVersion != nil { + objectMap["agentVersion"] = imavrd.AgentVersion + } + if imavrd.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = imavrd.AgentExpiryDate + } + if imavrd.IsAgentUpdateRequired != nil { + objectMap["isAgentUpdateRequired"] = imavrd.IsAgentUpdateRequired + } + if imavrd.IsRebootAfterUpdateRequired != nil { + objectMap["isRebootAfterUpdateRequired"] = imavrd.IsRebootAfterUpdateRequired + } + if imavrd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = imavrd.LastHeartbeat + } + if imavrd.ProcessServerID != nil { + objectMap["processServerId"] = imavrd.ProcessServerID + } + if imavrd.ProcessServerName != nil { + objectMap["processServerName"] = imavrd.ProcessServerName + } + if imavrd.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imavrd.MultiVMGroupID + } + if imavrd.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imavrd.MultiVMGroupName + } + if imavrd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imavrd.MultiVMSyncStatus + } + if imavrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imavrd.ProtectedDisks + } + if imavrd.DiskResized != nil { + objectMap["diskResized"] = imavrd.DiskResized + } + if imavrd.MasterTargetID != nil { + objectMap["masterTargetId"] = imavrd.MasterTargetID + } + if imavrd.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = imavrd.SourceVMCPUCount + } + if imavrd.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = imavrd.SourceVMRAMSizeInMB + } + if imavrd.OsType != nil { + objectMap["osType"] = imavrd.OsType + } + if imavrd.VhdName != nil { + objectMap["vhdName"] = imavrd.VhdName + } + if imavrd.OsDiskID != nil { + objectMap["osDiskId"] = imavrd.OsDiskID + } + if imavrd.AzureVMDiskDetails != nil { + objectMap["azureVMDiskDetails"] = imavrd.AzureVMDiskDetails + } + if imavrd.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVMName"] = imavrd.RecoveryAzureVMName + } + if imavrd.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = imavrd.RecoveryAzureVMSize + } + if imavrd.RecoveryAzureStorageAccount != nil { + objectMap["recoveryAzureStorageAccount"] = imavrd.RecoveryAzureStorageAccount + } + if imavrd.RecoveryAzureLogStorageAccountID != nil { + objectMap["recoveryAzureLogStorageAccountId"] = imavrd.RecoveryAzureLogStorageAccountID + } + if imavrd.VMNics != nil { + objectMap["vmNics"] = imavrd.VMNics + } + if imavrd.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = imavrd.SelectedRecoveryAzureNetworkID + } + if imavrd.SelectedTfoAzureNetworkID != nil { + objectMap["selectedTfoAzureNetworkId"] = imavrd.SelectedTfoAzureNetworkID + } + if imavrd.SelectedSourceNicID != nil { + objectMap["selectedSourceNicId"] = imavrd.SelectedSourceNicID + } + if imavrd.DiscoveryType != nil { + objectMap["discoveryType"] = imavrd.DiscoveryType + } + if imavrd.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = imavrd.EnableRdpOnTargetOption + } + if imavrd.Datastores != nil { + objectMap["datastores"] = imavrd.Datastores + } + if imavrd.TargetVMID != nil { + objectMap["targetVmId"] = imavrd.TargetVMID + } + if imavrd.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = imavrd.RecoveryAzureResourceGroupID + } + if imavrd.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = imavrd.RecoveryAvailabilitySetID + } + if imavrd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavrd.TargetAvailabilityZone + } + if imavrd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavrd.TargetProximityPlacementGroupID + } + if imavrd.UseManagedDisks != nil { + objectMap["useManagedDisks"] = imavrd.UseManagedDisks + } + if imavrd.LicenseType != nil { + objectMap["licenseType"] = imavrd.LicenseType + } + if imavrd.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = imavrd.SQLServerLicenseType + } + if imavrd.ValidationErrors != nil { + objectMap["validationErrors"] = imavrd.ValidationErrors + } + if imavrd.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = imavrd.LastRpoCalculatedTime + } + if imavrd.LastUpdateReceivedTime != nil { + objectMap["lastUpdateReceivedTime"] = imavrd.LastUpdateReceivedTime + } + if imavrd.ReplicaID != nil { + objectMap["replicaId"] = imavrd.ReplicaID + } + if imavrd.OsVersion != nil { + objectMap["osVersion"] = imavrd.OsVersion + } + if imavrd.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = imavrd.ProtectedManagedDisks + } + if imavrd.FirmwareType != nil { + objectMap["firmwareType"] = imavrd.FirmwareType + } + if imavrd.AzureVMGeneration != nil { + objectMap["azureVmGeneration"] = imavrd.AzureVMGeneration + } + if imavrd.IsAdditionalStatsAvailable != nil { + objectMap["isAdditionalStatsAvailable"] = imavrd.IsAdditionalStatsAvailable + } + if imavrd.TotalDataTransferred != nil { + objectMap["totalDataTransferred"] = imavrd.TotalDataTransferred + } + if imavrd.TotalProgressHealth != nil { + objectMap["totalProgressHealth"] = imavrd.TotalProgressHealth + } + if imavrd.TargetVMTags != nil { + objectMap["targetVmTags"] = imavrd.TargetVMTags + } + if imavrd.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = imavrd.SeedManagedDiskTags + } + if imavrd.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavrd.TargetManagedDiskTags + } + if imavrd.TargetNicTags != nil { + objectMap["targetNicTags"] = imavrd.TargetNicTags + } + if imavrd.InstanceType != "" { + objectMap["instanceType"] = imavrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return &imavrd, true +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imavrd, true +} + +// InMageAzureV2ReprotectInput inMageAzureV2 specific provider input. +type InMageAzureV2ReprotectInput struct { + // MasterTargetID - The Master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // StorageAccountID - The storage account id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) MarshalJSON() ([]byte, error) { + imavri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavri.MasterTargetID != nil { + objectMap["masterTargetId"] = imavri.MasterTargetID + } + if imavri.ProcessServerID != nil { + objectMap["processServerId"] = imavri.ProcessServerID + } + if imavri.StorageAccountID != nil { + objectMap["storageAccountId"] = imavri.StorageAccountID + } + if imavri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imavri.RunAsAccountID + } + if imavri.PolicyID != nil { + objectMap["policyId"] = imavri.PolicyID + } + if imavri.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imavri.LogStorageAccountID + } + if imavri.DisksToInclude != nil { + objectMap["disksToInclude"] = imavri.DisksToInclude + } + if imavri.InstanceType != "" { + objectMap["instanceType"] = imavri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return &imavri, true +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imavri, true +} + +// InMageAzureV2TestFailoverInput inMageAzureV2 provider specific input for test failover. +type InMageAzureV2TestFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) MarshalJSON() ([]byte, error) { + imavtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imavtfi.RecoveryPointID + } + if imavtfi.InstanceType != "" { + objectMap["instanceType"] = imavtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return &imavtfi, true +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imavtfi, true +} + +// InMageAzureV2UnplannedFailoverInput inMageAzureV2 provider specific input for unplanned failover. +type InMageAzureV2UnplannedFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imavufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imavufi.RecoveryPointID + } + if imavufi.InstanceType != "" { + objectMap["instanceType"] = imavufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return &imavufi, true +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imavufi, true +} + +// InMageAzureV2UpdateReplicationProtectedItemInput inMage Azure V2 input to update replication protected +// item. +type InMageAzureV2UpdateReplicationProtectedItemInput struct { + // RecoveryAzureV1ResourceGroupID - The recovery Azure resource group Id for classic deployment. + RecoveryAzureV1ResourceGroupID *string `json:"recoveryAzureV1ResourceGroupId,omitempty"` + // RecoveryAzureV2ResourceGroupID - The recovery Azure resource group Id for resource manager deployment. + RecoveryAzureV2ResourceGroupID *string `json:"recoveryAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // VMDisks - The list of disk update properties. + VMDisks *[]UpdateDiskInput `json:"vmDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imavurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavurpii.RecoveryAzureV1ResourceGroupID != nil { + objectMap["recoveryAzureV1ResourceGroupId"] = imavurpii.RecoveryAzureV1ResourceGroupID + } + if imavurpii.RecoveryAzureV2ResourceGroupID != nil { + objectMap["recoveryAzureV2ResourceGroupId"] = imavurpii.RecoveryAzureV2ResourceGroupID + } + if imavurpii.UseManagedDisks != nil { + objectMap["useManagedDisks"] = imavurpii.UseManagedDisks + } + if imavurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavurpii.TargetProximityPlacementGroupID + } + if imavurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavurpii.TargetAvailabilityZone + } + if imavurpii.TargetVMTags != nil { + objectMap["targetVmTags"] = imavurpii.TargetVMTags + } + if imavurpii.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavurpii.TargetManagedDiskTags + } + if imavurpii.TargetNicTags != nil { + objectMap["targetNicTags"] = imavurpii.TargetNicTags + } + if imavurpii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = imavurpii.SQLServerLicenseType + } + if imavurpii.VMDisks != nil { + objectMap["vmDisks"] = imavurpii.VMDisks + } + if imavurpii.InstanceType != "" { + objectMap["instanceType"] = imavurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return &imavurpii, true +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &imavurpii, true +} + +// InMageBasePolicyDetails base class for the policies of providers using InMage replication. +type InMageBasePolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) MarshalJSON() ([]byte, error) { + imbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails + objectMap := make(map[string]interface{}) + if imbpd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imbpd.RecoveryPointThresholdInMinutes + } + if imbpd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imbpd.RecoveryPointHistory + } + if imbpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imbpd.AppConsistentFrequencyInMinutes + } + if imbpd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imbpd.MultiVMSyncStatus + } + if imbpd.InstanceType != "" { + objectMap["instanceType"] = imbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return &imbpd, true +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imbpd, true +} + +// InMageDisableProtectionProviderSpecificInput inMage disable protection provider specific input. +type InMageDisableProtectionProviderSpecificInput struct { + // ReplicaVMDeletionStatus - A value indicating whether the replica VM should be destroyed or retained. Values from Delete and Retain. + ReplicaVMDeletionStatus *string `json:"replicaVmDeletionStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeDisableProtectionProviderSpecificInput', 'InstanceTypeInMage' + InstanceType InstanceTypeBasicDisableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + imdppsi.InstanceType = InstanceTypeInMage + objectMap := make(map[string]interface{}) + if imdppsi.ReplicaVMDeletionStatus != nil { + objectMap["replicaVmDeletionStatus"] = imdppsi.ReplicaVMDeletionStatus + } + if imdppsi.InstanceType != "" { + objectMap["instanceType"] = imdppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) { + return &imdppsi, true +} + +// AsDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsBasicDisableProtectionProviderSpecificInput() (BasicDisableProtectionProviderSpecificInput, bool) { + return &imdppsi, true +} + +// InMageDiskDetails vMware/Physical specific Disk Details. +type InMageDiskDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskSizeInMB - The disk size in MB. + DiskSizeInMB *string `json:"diskSizeInMB,omitempty"` + // DiskType - Whether disk is system disk or data disk. + DiskType *string `json:"diskType,omitempty"` + // DiskConfiguration - Whether disk is dynamic disk or basic disk. + DiskConfiguration *string `json:"diskConfiguration,omitempty"` + // VolumeList - Volumes of the disk. + VolumeList *[]DiskVolumeDetails `json:"volumeList,omitempty"` +} + +// InMageDiskExclusionInput diskExclusionInput when doing enable protection of virtual machine in InMage +// provider. +type InMageDiskExclusionInput struct { + // VolumeOptions - The volume label based option for disk exclusion. + VolumeOptions *[]InMageVolumeExclusionOptions `json:"volumeOptions,omitempty"` + // DiskSignatureOptions - The guest disk signature based option for disk exclusion. + DiskSignatureOptions *[]InMageDiskSignatureExclusionOptions `json:"diskSignatureOptions,omitempty"` +} + +// InMageDiskSignatureExclusionOptions guest disk signature based disk exclusion option when doing enable +// protection of virtual machine in InMage provider. +type InMageDiskSignatureExclusionOptions struct { + // DiskSignature - The guest signature of disk to be excluded from replication. + DiskSignature *string `json:"diskSignature,omitempty"` +} + +// InMageEnableProtectionInput vMware Azure specific enable protection input. +type InMageEnableProtectionInput struct { + // VMFriendlyName - The VM Name. + VMFriendlyName *string `json:"vmFriendlyName,omitempty"` + // MasterTargetID - The Master Target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RetentionDrive - The retention drive to use on the MT. + RetentionDrive *string `json:"retentionDrive,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // MultiVMGroupID - The multi VM group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // DiskExclusionInput - The enable disk exclusion input. + DiskExclusionInput *InMageDiskExclusionInput `json:"diskExclusionInput,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) MarshalJSON() ([]byte, error) { + imepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imepi.VMFriendlyName != nil { + objectMap["vmFriendlyName"] = imepi.VMFriendlyName + } + if imepi.MasterTargetID != nil { + objectMap["masterTargetId"] = imepi.MasterTargetID + } + if imepi.ProcessServerID != nil { + objectMap["processServerId"] = imepi.ProcessServerID + } + if imepi.RetentionDrive != nil { + objectMap["retentionDrive"] = imepi.RetentionDrive + } + if imepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imepi.RunAsAccountID + } + if imepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imepi.MultiVMGroupID + } + if imepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imepi.MultiVMGroupName + } + if imepi.DatastoreName != nil { + objectMap["datastoreName"] = imepi.DatastoreName + } + if imepi.DiskExclusionInput != nil { + objectMap["diskExclusionInput"] = imepi.DiskExclusionInput + } + if imepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imepi.DisksToInclude + } + if imepi.InstanceType != "" { + objectMap["instanceType"] = imepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return &imepi, true +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imepi, true +} + +// InMagePolicyDetails inMage specific protection profile details. +type InMagePolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMagePolicyDetails. +func (impd InMagePolicyDetails) MarshalJSON() ([]byte, error) { + impd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage + objectMap := make(map[string]interface{}) + if impd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = impd.RecoveryPointThresholdInMinutes + } + if impd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = impd.RecoveryPointHistory + } + if impd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = impd.AppConsistentFrequencyInMinutes + } + if impd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = impd.MultiVMSyncStatus + } + if impd.InstanceType != "" { + objectMap["instanceType"] = impd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return &impd, true +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &impd, true +} + +// InMagePolicyInput vMWare Azure specific protection profile Input. +type InMagePolicyInput struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMagePolicyInput. +func (impi InMagePolicyInput) MarshalJSON() ([]byte, error) { + impi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if impi.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = impi.RecoveryPointThresholdInMinutes + } + if impi.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = impi.RecoveryPointHistory + } + if impi.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = impi.AppConsistentFrequencyInMinutes + } + if impi.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = impi.MultiVMSyncStatus + } + if impi.InstanceType != "" { + objectMap["instanceType"] = impi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return &impi, true +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &impi, true +} + +// InMageProtectedDiskDetails inMage protected disk details. +type InMageProtectedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // HealthErrorCode - The health error code for the disk. + HealthErrorCode *string `json:"healthErrorCode,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncDurationInSeconds - The resync duration in seconds. + ResyncDurationInSeconds *int64 `json:"resyncDurationInSeconds,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // FileSystemCapacityInBytes - The file system capacity in bytes. + FileSystemCapacityInBytes *int64 `json:"fileSystemCapacityInBytes,omitempty"` + // SourceDataInMB - The source data transit in MB. + SourceDataInMB *float64 `json:"sourceDataInMB,omitempty"` + // PsDataInMB - The PS data transit in MB. + PsDataInMB *float64 `json:"psDataInMB,omitempty"` + // TargetDataInMB - The target data transit in MB. + TargetDataInMB *float64 `json:"targetDataInMB,omitempty"` + // DiskResized - A value indicating whether disk is resized. + DiskResized *string `json:"diskResized,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // ResyncProcessedBytes - The resync processed bytes. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTotalTransferredBytes - The resync total transferred bytes. + ResyncTotalTransferredBytes *int64 `json:"resyncTotalTransferredBytes,omitempty"` + // ResyncLast15MinutesTransferredBytes - The resync last 15 minutes transferred bytes. + ResyncLast15MinutesTransferredBytes *int64 `json:"resyncLast15MinutesTransferredBytes,omitempty"` + // ResyncLastDataTransferTimeUTC - The last data transfer time in UTC. + ResyncLastDataTransferTimeUTC *date.Time `json:"resyncLastDataTransferTimeUTC,omitempty"` + // ResyncStartTime - The resync start time. + ResyncStartTime *date.Time `json:"resyncStartTime,omitempty"` + // ProgressHealth - The Progress Health. + ProgressHealth *string `json:"progressHealth,omitempty"` + // ProgressStatus - The Progress Status. + ProgressStatus *string `json:"progressStatus,omitempty"` +} + +// InMageRcmAgentUpgradeBlockingErrorDetails inMageRcm source agent upgrade blocking error details. +type InMageRcmAgentUpgradeBlockingErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageRcmAgentUpgradeBlockingErrorDetails. +func (imraubed InMageRcmAgentUpgradeBlockingErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmApplyRecoveryPointInput applyRecoveryPoint input specific to InMageRcm provider. +type InMageRcmApplyRecoveryPointInput struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + imrarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrarpi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrarpi.RecoveryPointID + } + if imrarpi.InstanceType != "" { + objectMap["instanceType"] = imrarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return &imrarpi, true +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &imrarpi, true +} + +// InMageRcmDiscoveredProtectedVMDetails inMageRcm discovered protected VM details. +type InMageRcmDiscoveredProtectedVMDetails struct { + // VCenterID - READ-ONLY; The VCenter Id. + VCenterID *string `json:"vCenterId,omitempty"` + // VCenterFqdn - READ-ONLY; The VCenter fqdn. + VCenterFqdn *string `json:"vCenterFqdn,omitempty"` + // Datastores - READ-ONLY; The list of datastores. + Datastores *[]string `json:"datastores,omitempty"` + // IPAddresses - READ-ONLY; The list of IP addresses. + IPAddresses *[]string `json:"ipAddresses,omitempty"` + // VmwareToolsStatus - READ-ONLY; The VMware tools status. + VmwareToolsStatus *string `json:"vmwareToolsStatus,omitempty"` + // PowerStatus - READ-ONLY; The VM power status. + PowerStatus *string `json:"powerStatus,omitempty"` + // VMFqdn - READ-ONLY; The VM fqdn. + VMFqdn *string `json:"vmFqdn,omitempty"` + // OsName - READ-ONLY; The VM's OS name. + OsName *string `json:"osName,omitempty"` + // CreatedTimestamp - READ-ONLY; The SDS created timestamp. + CreatedTimestamp *date.Time `json:"createdTimestamp,omitempty"` + // UpdatedTimestamp - READ-ONLY; The SDS updated timestamp. + UpdatedTimestamp *date.Time `json:"updatedTimestamp,omitempty"` + // IsDeleted - READ-ONLY; A value indicating whether the VM is deleted. + IsDeleted *bool `json:"isDeleted,omitempty"` + // LastDiscoveryTimeInUtc - READ-ONLY; The last time when SDS information discovered in SRS. + LastDiscoveryTimeInUtc *date.Time `json:"lastDiscoveryTimeInUtc,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmDiscoveredProtectedVMDetails. +func (imrdpvd InMageRcmDiscoveredProtectedVMDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmDiskInput inMageRcm disk input. +type InMageRcmDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageRcmDisksDefaultInput inMageRcm disk input. +type InMageRcmDisksDefaultInput struct { + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageRcmEnableProtectionInput inMageRcm specific enable protection input. +type InMageRcmEnableProtectionInput struct { + // FabricDiscoveryMachineID - The ARM Id of discovered machine. + FabricDiscoveryMachineID *string `json:"fabricDiscoveryMachineId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]InMageRcmDiskInput `json:"disksToInclude,omitempty"` + // DisksDefault - The default disk input. + DisksDefault *InMageRcmDisksDefaultInput `json:"disksDefault,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetNetworkID - The selected target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The selected test network ARM Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // TargetSubnetName - The selected target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TestSubnetName - The selected test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // RunAsAccountID - The run-as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) MarshalJSON() ([]byte, error) { + imrepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrepi.FabricDiscoveryMachineID != nil { + objectMap["fabricDiscoveryMachineId"] = imrepi.FabricDiscoveryMachineID + } + if imrepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imrepi.DisksToInclude + } + if imrepi.DisksDefault != nil { + objectMap["disksDefault"] = imrepi.DisksDefault + } + if imrepi.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrepi.TargetResourceGroupID + } + if imrepi.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrepi.TargetNetworkID + } + if imrepi.TestNetworkID != nil { + objectMap["testNetworkId"] = imrepi.TestNetworkID + } + if imrepi.TargetSubnetName != nil { + objectMap["targetSubnetName"] = imrepi.TargetSubnetName + } + if imrepi.TestSubnetName != nil { + objectMap["testSubnetName"] = imrepi.TestSubnetName + } + if imrepi.TargetVMName != nil { + objectMap["targetVmName"] = imrepi.TargetVMName + } + if imrepi.TargetVMSize != nil { + objectMap["targetVmSize"] = imrepi.TargetVMSize + } + if imrepi.LicenseType != "" { + objectMap["licenseType"] = imrepi.LicenseType + } + if imrepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrepi.TargetAvailabilitySetID + } + if imrepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrepi.TargetAvailabilityZone + } + if imrepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrepi.TargetProximityPlacementGroupID + } + if imrepi.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrepi.TargetBootDiagnosticsStorageAccountID + } + if imrepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imrepi.RunAsAccountID + } + if imrepi.ProcessServerID != nil { + objectMap["processServerId"] = imrepi.ProcessServerID + } + if imrepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imrepi.MultiVMGroupName + } + if imrepi.InstanceType != "" { + objectMap["instanceType"] = imrepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return &imrepi, true +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imrepi, true +} + +// InMageRcmEventDetails event details for InMageRcm provider. +type InMageRcmEventDetails struct { + // ProtectedItemName - READ-ONLY; The protected item name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // VMName - READ-ONLY; The protected item name. + VMName *string `json:"vmName,omitempty"` + // LatestAgentVersion - READ-ONLY; The latest agent version. + LatestAgentVersion *string `json:"latestAgentVersion,omitempty"` + // JobID - READ-ONLY; The job Id. + JobID *string `json:"jobId,omitempty"` + // FabricName - READ-ONLY; The fabric name. + FabricName *string `json:"fabricName,omitempty"` + // ApplianceName - READ-ONLY; The appliance name. + ApplianceName *string `json:"applianceName,omitempty"` + // ServerType - READ-ONLY; The server type. + ServerType *string `json:"serverType,omitempty"` + // ComponentDisplayName - READ-ONLY; The component display name. + ComponentDisplayName *string `json:"componentDisplayName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) MarshalJSON() ([]byte, error) { + imred.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imred.InstanceType != "" { + objectMap["instanceType"] = imred.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return &imred, true +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imred, true +} + +// InMageRcmFabricCreationInput inMageRcm fabric provider specific settings. +type InMageRcmFabricCreationInput struct { + // VmwareSiteID - The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // SourceAgentIdentity - The identity provider input for source agent authentication. + SourceAgentIdentity *IdentityProviderInput `json:"sourceAgentIdentity,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreationInput', 'InstanceTypeAzure', 'InstanceTypeInMageRcm', 'InstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) MarshalJSON() ([]byte, error) { + imrfci.InstanceType = InstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrfci.VmwareSiteID != nil { + objectMap["vmwareSiteId"] = imrfci.VmwareSiteID + } + if imrfci.PhysicalSiteID != nil { + objectMap["physicalSiteId"] = imrfci.PhysicalSiteID + } + if imrfci.SourceAgentIdentity != nil { + objectMap["sourceAgentIdentity"] = imrfci.SourceAgentIdentity + } + if imrfci.InstanceType != "" { + objectMap["instanceType"] = imrfci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return &imrfci, true +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &imrfci, true +} + +// InMageRcmFabricSpecificDetails inMageRcm fabric specific details. +type InMageRcmFabricSpecificDetails struct { + // VmwareSiteID - READ-ONLY; The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - READ-ONLY; The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // ServiceEndpoint - READ-ONLY; The service endpoint. + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` + // ServiceResourceID - READ-ONLY; The service resource Id. + ServiceResourceID *string `json:"serviceResourceId,omitempty"` + // ServiceContainerID - READ-ONLY; The service container Id. + ServiceContainerID *string `json:"serviceContainerId,omitempty"` + // DataPlaneURI - READ-ONLY; The data plane Uri. + DataPlaneURI *string `json:"dataPlaneUri,omitempty"` + // ControlPlaneURI - READ-ONLY; The control plane Uri. + ControlPlaneURI *string `json:"controlPlaneUri,omitempty"` + // SourceAgentIdentityDetails - The source agent identity details. + SourceAgentIdentityDetails *IdentityProviderDetails `json:"sourceAgentIdentityDetails,omitempty"` + // ProcessServers - READ-ONLY; The list of process servers. + ProcessServers *[]ProcessServerDetails `json:"processServers,omitempty"` + // RcmProxies - READ-ONLY; The list of RCM proxies. + RcmProxies *[]RcmProxyDetails `json:"rcmProxies,omitempty"` + // PushInstallers - READ-ONLY; The list of push installers. + PushInstallers *[]PushInstallerDetails `json:"pushInstallers,omitempty"` + // ReplicationAgents - READ-ONLY; The list of replication agents. + ReplicationAgents *[]ReplicationAgentDetails `json:"replicationAgents,omitempty"` + // ReprotectAgents - READ-ONLY; The list of reprotect agents. + ReprotectAgents *[]ReprotectAgentDetails `json:"reprotectAgents,omitempty"` + // MarsAgents - READ-ONLY; The list of Mars agents. + MarsAgents *[]MarsAgentDetails `json:"marsAgents,omitempty"` + // Dras - READ-ONLY; The list of DRAs. + Dras *[]DraDetails `json:"dras,omitempty"` + // AgentDetails - READ-ONLY; The list of agent details. + AgentDetails *[]AgentDetails `json:"agentDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) MarshalJSON() ([]byte, error) { + imrfsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrfsd.SourceAgentIdentityDetails != nil { + objectMap["sourceAgentIdentityDetails"] = imrfsd.SourceAgentIdentityDetails + } + if imrfsd.InstanceType != "" { + objectMap["instanceType"] = imrfsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return &imrfsd, true +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &imrfsd, true +} + +// InMageRcmFailbackDiscoveredProtectedVMDetails inMageRcmFailback discovered VM details. +type InMageRcmFailbackDiscoveredProtectedVMDetails struct { + // VCenterID - READ-ONLY; The VCenter Id. + VCenterID *string `json:"vCenterId,omitempty"` + // VCenterFqdn - READ-ONLY; The VCenter fqdn. + VCenterFqdn *string `json:"vCenterFqdn,omitempty"` + // Datastores - READ-ONLY; The list of datastores. + Datastores *[]string `json:"datastores,omitempty"` + // IPAddresses - READ-ONLY; The list of IP addresses. + IPAddresses *[]string `json:"ipAddresses,omitempty"` + // VmwareToolsStatus - READ-ONLY; The VMware tools status. + VmwareToolsStatus *string `json:"vmwareToolsStatus,omitempty"` + // PowerStatus - READ-ONLY; The VM power status. + PowerStatus *string `json:"powerStatus,omitempty"` + // VMFqdn - READ-ONLY; The VM fqdn. + VMFqdn *string `json:"vmFqdn,omitempty"` + // OsName - READ-ONLY; The VM's OS name. + OsName *string `json:"osName,omitempty"` + // CreatedTimestamp - READ-ONLY; The SDS created timestamp. + CreatedTimestamp *date.Time `json:"createdTimestamp,omitempty"` + // UpdatedTimestamp - READ-ONLY; The SDS updated timestamp. + UpdatedTimestamp *date.Time `json:"updatedTimestamp,omitempty"` + // IsDeleted - READ-ONLY; A value indicating whether the VM is deleted. + IsDeleted *bool `json:"isDeleted,omitempty"` + // LastDiscoveryTimeInUtc - READ-ONLY; The last time when SDS information discovered in SRS. + LastDiscoveryTimeInUtc *date.Time `json:"lastDiscoveryTimeInUtc,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackDiscoveredProtectedVMDetails. +func (imrfdpvd InMageRcmFailbackDiscoveredProtectedVMDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackEventDetails event details for InMageRcmFailback provider. +type InMageRcmFailbackEventDetails struct { + // ProtectedItemName - READ-ONLY; The protected item name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // VMName - READ-ONLY; The protected item name. + VMName *string `json:"vmName,omitempty"` + // ApplianceName - READ-ONLY; The appliance name. + ApplianceName *string `json:"applianceName,omitempty"` + // ServerType - READ-ONLY; The server type. + ServerType *string `json:"serverType,omitempty"` + // ComponentDisplayName - READ-ONLY; The component display name. + ComponentDisplayName *string `json:"componentDisplayName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) MarshalJSON() ([]byte, error) { + imrfed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfed.InstanceType != "" { + objectMap["instanceType"] = imrfed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return &imrfed, true +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imrfed, true +} + +// InMageRcmFailbackMobilityAgentDetails inMageRcmFailback mobility agent details. +type InMageRcmFailbackMobilityAgentDetails struct { + // Version - READ-ONLY; The agent version. + Version *string `json:"version,omitempty"` + // LatestVersion - READ-ONLY; The latest agent version available. + LatestVersion *string `json:"latestVersion,omitempty"` + // DriverVersion - READ-ONLY; The driver version. + DriverVersion *string `json:"driverVersion,omitempty"` + // LatestUpgradableVersionWithoutReboot - READ-ONLY; The latest upgradeable version available without reboot. + LatestUpgradableVersionWithoutReboot *string `json:"latestUpgradableVersionWithoutReboot,omitempty"` + // AgentVersionExpiryDate - READ-ONLY; The agent version expiry date. + AgentVersionExpiryDate *date.Time `json:"agentVersionExpiryDate,omitempty"` + // DriverVersionExpiryDate - READ-ONLY; The driver version expiry date. + DriverVersionExpiryDate *date.Time `json:"driverVersionExpiryDate,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The time of the last heartbeat received from the agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // ReasonsBlockingUpgrade - READ-ONLY; The whether update is possible or not. + ReasonsBlockingUpgrade *[]AgentUpgradeBlockedReason `json:"reasonsBlockingUpgrade,omitempty"` + // IsUpgradeable - READ-ONLY; A value indicating whether agent is upgradeable or not. + IsUpgradeable *string `json:"isUpgradeable,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackMobilityAgentDetails. +func (imrfmad InMageRcmFailbackMobilityAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackNicDetails inMageRcmFailback NIC details. +type InMageRcmFailbackNicDetails struct { + // MacAddress - READ-ONLY; The mac address. + MacAddress *string `json:"macAddress,omitempty"` + // NetworkName - READ-ONLY; The network name. + NetworkName *string `json:"networkName,omitempty"` + // AdapterType - READ-ONLY; The adapter type. + AdapterType *string `json:"adapterType,omitempty"` + // SourceIPAddress - READ-ONLY; The IP address. + SourceIPAddress *string `json:"sourceIpAddress,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackNicDetails. +func (imrfnd InMageRcmFailbackNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackPlannedFailoverProviderInput provider specific input for InMageRcmFailback failover. +type InMageRcmFailbackPlannedFailoverProviderInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'ApplicationConsistent', 'CrashConsistent' + RecoveryPointType InMageRcmFailbackRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) MarshalJSON() ([]byte, error) { + imrfpfpi.InstanceType = InstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpfpi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imrfpfpi.RecoveryPointType + } + if imrfpfpi.InstanceType != "" { + objectMap["instanceType"] = imrfpfpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return &imrfpfpi, true +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &imrfpfpi, true +} + +// InMageRcmFailbackPolicyCreationInput inMageRcmFailback policy creation input. +type InMageRcmFailbackPolicyCreationInput struct { + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) MarshalJSON() ([]byte, error) { + imrfpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrfpci.CrashConsistentFrequencyInMinutes + } + if imrfpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrfpci.AppConsistentFrequencyInMinutes + } + if imrfpci.InstanceType != "" { + objectMap["instanceType"] = imrfpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return &imrfpci, true +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imrfpci, true +} + +// InMageRcmFailbackPolicyDetails inMageRcm failback specific policy details. +type InMageRcmFailbackPolicyDetails struct { + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) MarshalJSON() ([]byte, error) { + imrfpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrfpd.AppConsistentFrequencyInMinutes + } + if imrfpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrfpd.CrashConsistentFrequencyInMinutes + } + if imrfpd.InstanceType != "" { + objectMap["instanceType"] = imrfpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return &imrfpd, true +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imrfpd, true +} + +// InMageRcmFailbackProtectedDiskDetails inMageRcmFailback protected disk details. +type InMageRcmFailbackProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk Id (reported by source agent). + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // DiskUUID - READ-ONLY; The disk Uuid (reported by vCenter). + DiskUUID *string `json:"diskUuid,omitempty"` + // DataPendingInLogDataStoreInMB - READ-ONLY; The data pending in log data store in MB. + DataPendingInLogDataStoreInMB *float64 `json:"dataPendingInLogDataStoreInMB,omitempty"` + // DataPendingAtSourceAgentInMB - READ-ONLY; The data pending at source agent in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // IsInitialReplicationComplete - READ-ONLY; A value indicating whether initial replication is complete or not. + IsInitialReplicationComplete *string `json:"isInitialReplicationComplete,omitempty"` + // IrDetails - The initial replication details. + IrDetails *InMageRcmFailbackSyncDetails `json:"irDetails,omitempty"` + // ResyncDetails - The resync details. + ResyncDetails *InMageRcmFailbackSyncDetails `json:"resyncDetails,omitempty"` + // LastSyncTime - READ-ONLY; The last sync time. + LastSyncTime *date.Time `json:"lastSyncTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackProtectedDiskDetails. +func (imrfpdd InMageRcmFailbackProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrfpdd.IrDetails != nil { + objectMap["irDetails"] = imrfpdd.IrDetails + } + if imrfpdd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrfpdd.ResyncDetails + } + return json.Marshal(objectMap) +} + +// InMageRcmFailbackReplicationDetails inMageRcmFailback provider specific details. +type InMageRcmFailbackReplicationDetails struct { + // InternalIdentifier - READ-ONLY; The virtual machine internal identifier. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // AzureVirtualMachineID - READ-ONLY; The ARM Id of the azure VM. + AzureVirtualMachineID *string `json:"azureVirtualMachineId,omitempty"` + // MultiVMGroupName - READ-ONLY; The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // ReprotectAgentID - READ-ONLY; The reprotect agent Id. + ReprotectAgentID *string `json:"reprotectAgentId,omitempty"` + // ReprotectAgentName - READ-ONLY; The reprotect agent name. + ReprotectAgentName *string `json:"reprotectAgentName,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // TargetvCenterID - READ-ONLY; The target vCenter Id. + TargetvCenterID *string `json:"targetvCenterId,omitempty"` + // TargetDataStoreName - READ-ONLY; The target datastore name. + TargetDataStoreName *string `json:"targetDataStoreName,omitempty"` + // TargetVMName - READ-ONLY; The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // InitialReplicationProgressPercentage - READ-ONLY; The initial replication progress percentage. + InitialReplicationProgressPercentage *int32 `json:"initialReplicationProgressPercentage,omitempty"` + // InitialReplicationProcessedBytes - READ-ONLY; The initial replication processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + InitialReplicationProcessedBytes *int64 `json:"initialReplicationProcessedBytes,omitempty"` + // InitialReplicationTransferredBytes - READ-ONLY; The initial replication transferred bytes from source VM to target for all selected disks on source VM. + InitialReplicationTransferredBytes *int64 `json:"initialReplicationTransferredBytes,omitempty"` + // InitialReplicationProgressHealth - READ-ONLY; The initial replication progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + InitialReplicationProgressHealth VMReplicationProgressHealth `json:"initialReplicationProgressHealth,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncProcessedBytes - READ-ONLY; The resync processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTransferredBytes - READ-ONLY; The resync transferred bytes from source VM to target for all selected disks on source VM. + ResyncTransferredBytes *int64 `json:"resyncTransferredBytes,omitempty"` + // ResyncProgressHealth - READ-ONLY; The resync progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + ResyncProgressHealth VMReplicationProgressHealth `json:"resyncProgressHealth,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageRcmFailbackProtectedDiskDetails `json:"protectedDisks,omitempty"` + // MobilityAgentDetails - The mobility agent information. + MobilityAgentDetails *InMageRcmFailbackMobilityAgentDetails `json:"mobilityAgentDetails,omitempty"` + // VMNics - The network details. + VMNics *[]InMageRcmFailbackNicDetails `json:"vmNics,omitempty"` + // LastPlannedFailoverStartTime - READ-ONLY; The last planned failover start time. + LastPlannedFailoverStartTime *date.Time `json:"lastPlannedFailoverStartTime,omitempty"` + // LastPlannedFailoverStatus - READ-ONLY; The last planned failover status. Possible values include: 'PlannedFailoverStatusSucceeded', 'PlannedFailoverStatusFailed', 'PlannedFailoverStatusCancelled', 'PlannedFailoverStatusUnknown' + LastPlannedFailoverStatus PlannedFailoverStatus `json:"lastPlannedFailoverStatus,omitempty"` + // DiscoveredVMDetails - The discovered VM information. + DiscoveredVMDetails *InMageRcmFailbackDiscoveredProtectedVMDetails `json:"discoveredVmDetails,omitempty"` + // LastUsedPolicyID - READ-ONLY; The policy Id used by the forward replication. + LastUsedPolicyID *string `json:"lastUsedPolicyId,omitempty"` + // LastUsedPolicyFriendlyName - READ-ONLY; The policy friendly name used by the forward replication. + LastUsedPolicyFriendlyName *string `json:"lastUsedPolicyFriendlyName,omitempty"` + // IsAgentRegistrationSuccessfulAfterFailover - READ-ONLY; A value indicating whether agent registration was successful after failover. + IsAgentRegistrationSuccessfulAfterFailover *bool `json:"isAgentRegistrationSuccessfulAfterFailover,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) MarshalJSON() ([]byte, error) { + imrfrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrfrd.ProtectedDisks + } + if imrfrd.MobilityAgentDetails != nil { + objectMap["mobilityAgentDetails"] = imrfrd.MobilityAgentDetails + } + if imrfrd.VMNics != nil { + objectMap["vmNics"] = imrfrd.VMNics + } + if imrfrd.DiscoveredVMDetails != nil { + objectMap["discoveredVmDetails"] = imrfrd.DiscoveredVMDetails + } + if imrfrd.InstanceType != "" { + objectMap["instanceType"] = imrfrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return &imrfrd, true +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrfrd, true +} + +// InMageRcmFailbackReprotectInput inMageRcmFailback specific provider input. +type InMageRcmFailbackReprotectInput struct { + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RunAsAccountID - The run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) MarshalJSON() ([]byte, error) { + imrfri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfri.ProcessServerID != nil { + objectMap["processServerId"] = imrfri.ProcessServerID + } + if imrfri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imrfri.RunAsAccountID + } + if imrfri.PolicyID != nil { + objectMap["policyId"] = imrfri.PolicyID + } + if imrfri.InstanceType != "" { + objectMap["instanceType"] = imrfri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return &imrfri, true +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imrfri, true +} + +// InMageRcmFailbackSyncDetails inMageRcmFailback disk level sync details. +type InMageRcmFailbackSyncDetails struct { + // ProgressHealth - READ-ONLY; The progress health. Possible values include: 'None', 'InProgress', 'SlowProgress', 'NoProgress', 'Queued' + ProgressHealth DiskReplicationProgressHealth `json:"progressHealth,omitempty"` + // TransferredBytes - READ-ONLY; The transferred bytes from source VM to azure for the disk. + TransferredBytes *int64 `json:"transferredBytes,omitempty"` + // Last15MinutesTransferredBytes - READ-ONLY; The bytes transferred in last 15 minutes from source VM to target. + Last15MinutesTransferredBytes *int64 `json:"last15MinutesTransferredBytes,omitempty"` + // LastDataTransferTimeUtc - READ-ONLY; The time of the last data transfer from source VM to target. + LastDataTransferTimeUtc *string `json:"lastDataTransferTimeUtc,omitempty"` + // ProcessedBytes - READ-ONLY; The total processed bytes. This includes bytes that are transferred from source VM to target and matched bytes. + ProcessedBytes *int64 `json:"processedBytes,omitempty"` + // StartTime - READ-ONLY; The start time. + StartTime *string `json:"startTime,omitempty"` + // LastRefreshTime - READ-ONLY; The last refresh time. + LastRefreshTime *string `json:"lastRefreshTime,omitempty"` + // ProgressPercentage - READ-ONLY; Progress in percentage. Progress percentage is calculated based on processed bytes. + ProgressPercentage *int32 `json:"progressPercentage,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackSyncDetails. +func (imrfsd InMageRcmFailbackSyncDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmLastAgentUpgradeErrorDetails inMageRcm last source agent upgrade error details. +type InMageRcmLastAgentUpgradeErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageRcmLastAgentUpgradeErrorDetails. +func (imrlaued InMageRcmLastAgentUpgradeErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmMobilityAgentDetails inMageRcm mobility agent details. +type InMageRcmMobilityAgentDetails struct { + // Version - READ-ONLY; The agent version. + Version *string `json:"version,omitempty"` + // LatestVersion - READ-ONLY; The latest agent version available. + LatestVersion *string `json:"latestVersion,omitempty"` + // LatestAgentReleaseDate - READ-ONLY; The latest agent version release date. + LatestAgentReleaseDate *string `json:"latestAgentReleaseDate,omitempty"` + // DriverVersion - READ-ONLY; The driver version. + DriverVersion *string `json:"driverVersion,omitempty"` + // LatestUpgradableVersionWithoutReboot - READ-ONLY; The latest upgradeable version available without reboot. + LatestUpgradableVersionWithoutReboot *string `json:"latestUpgradableVersionWithoutReboot,omitempty"` + // AgentVersionExpiryDate - READ-ONLY; The agent version expiry date. + AgentVersionExpiryDate *date.Time `json:"agentVersionExpiryDate,omitempty"` + // DriverVersionExpiryDate - READ-ONLY; The driver version expiry date. + DriverVersionExpiryDate *date.Time `json:"driverVersionExpiryDate,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The time of the last heartbeat received from the agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // ReasonsBlockingUpgrade - READ-ONLY; The whether update is possible or not. + ReasonsBlockingUpgrade *[]AgentUpgradeBlockedReason `json:"reasonsBlockingUpgrade,omitempty"` + // IsUpgradeable - READ-ONLY; A value indicating whether agent is upgradeable or not. + IsUpgradeable *string `json:"isUpgradeable,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmMobilityAgentDetails. +func (imrmad InMageRcmMobilityAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmNicDetails inMageRcm NIC details. +type InMageRcmNicDetails struct { + // NicID - READ-ONLY; The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // IsSelectedForFailover - A value indicating whether this NIC is selected for failover. + IsSelectedForFailover *string `json:"isSelectedForFailover,omitempty"` + // SourceIPAddress - READ-ONLY; The source IP address. + SourceIPAddress *string `json:"sourceIPAddress,omitempty"` + // SourceIPAddressType - READ-ONLY; The source IP address type. Possible values include: 'Dynamic', 'Static' + SourceIPAddressType EthernetAddressType `json:"sourceIPAddressType,omitempty"` + // SourceNetworkID - READ-ONLY; Source network Id. + SourceNetworkID *string `json:"sourceNetworkId,omitempty"` + // SourceSubnetName - READ-ONLY; Source subnet name. + SourceSubnetName *string `json:"sourceSubnetName,omitempty"` + // TargetIPAddress - The target IP address. + TargetIPAddress *string `json:"targetIPAddress,omitempty"` + // TargetIPAddressType - The target IP address type. Possible values include: 'Dynamic', 'Static' + TargetIPAddressType EthernetAddressType `json:"targetIPAddressType,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TestSubnetName - Test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TestIPAddress - The test IP address. + TestIPAddress *string `json:"testIPAddress,omitempty"` + // TestIPAddressType - The test IP address type. Possible values include: 'Dynamic', 'Static' + TestIPAddressType EthernetAddressType `json:"testIPAddressType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmNicDetails. +func (imrnd InMageRcmNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrnd.IsPrimaryNic != nil { + objectMap["isPrimaryNic"] = imrnd.IsPrimaryNic + } + if imrnd.IsSelectedForFailover != nil { + objectMap["isSelectedForFailover"] = imrnd.IsSelectedForFailover + } + if imrnd.TargetIPAddress != nil { + objectMap["targetIPAddress"] = imrnd.TargetIPAddress + } + if imrnd.TargetIPAddressType != "" { + objectMap["targetIPAddressType"] = imrnd.TargetIPAddressType + } + if imrnd.TargetSubnetName != nil { + objectMap["targetSubnetName"] = imrnd.TargetSubnetName + } + if imrnd.TestSubnetName != nil { + objectMap["testSubnetName"] = imrnd.TestSubnetName + } + if imrnd.TestIPAddress != nil { + objectMap["testIPAddress"] = imrnd.TestIPAddress + } + if imrnd.TestIPAddressType != "" { + objectMap["testIPAddressType"] = imrnd.TestIPAddressType + } + return json.Marshal(objectMap) +} + +// InMageRcmNicInput inMageRcm NIC input. +type InMageRcmNicInput struct { + // NicID - The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // IsSelectedForFailover - A value indicating whether this NIC is selected for failover. + IsSelectedForFailover *string `json:"isSelectedForFailover,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetStaticIPAddress - The target static IP address. + TargetStaticIPAddress *string `json:"targetStaticIPAddress,omitempty"` + // TestSubnetName - The test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TestStaticIPAddress - The test static IP address. + TestStaticIPAddress *string `json:"testStaticIPAddress,omitempty"` +} + +// InMageRcmPolicyCreationInput inMageRcm policy creation input. +type InMageRcmPolicyCreationInput struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // EnableMultiVMSync - A value indicating whether multi-VM sync has to be enabled. + EnableMultiVMSync *string `json:"enableMultiVmSync,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) MarshalJSON() ([]byte, error) { + imrpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpci.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = imrpci.RecoveryPointHistoryInMinutes + } + if imrpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrpci.CrashConsistentFrequencyInMinutes + } + if imrpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrpci.AppConsistentFrequencyInMinutes + } + if imrpci.EnableMultiVMSync != nil { + objectMap["enableMultiVmSync"] = imrpci.EnableMultiVMSync + } + if imrpci.InstanceType != "" { + objectMap["instanceType"] = imrpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return &imrpci, true +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imrpci, true +} + +// InMageRcmPolicyDetails inMageRcm specific policy details. +type InMageRcmPolicyDetails struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // EnableMultiVMSync - A value indicating whether multi-VM sync has to be enabled. + EnableMultiVMSync *string `json:"enableMultiVmSync,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) MarshalJSON() ([]byte, error) { + imrpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpd.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = imrpd.RecoveryPointHistoryInMinutes + } + if imrpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrpd.AppConsistentFrequencyInMinutes + } + if imrpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrpd.CrashConsistentFrequencyInMinutes + } + if imrpd.EnableMultiVMSync != nil { + objectMap["enableMultiVmSync"] = imrpd.EnableMultiVMSync + } + if imrpd.InstanceType != "" { + objectMap["instanceType"] = imrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return &imrpd, true +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imrpd, true +} + +// InMageRcmProtectedDiskDetails inMageRcm protected disk details. +type InMageRcmProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskEncryptionSetID - READ-ONLY; The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // SeedManagedDiskID - READ-ONLY; The ARM Id of the seed managed disk. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // TargetManagedDiskID - READ-ONLY; The ARM Id of the target managed disk. + TargetManagedDiskID *string `json:"targetManagedDiskId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DataPendingInLogDataStoreInMB - READ-ONLY; The data pending in log data store in MB. + DataPendingInLogDataStoreInMB *float64 `json:"dataPendingInLogDataStoreInMB,omitempty"` + // DataPendingAtSourceAgentInMB - READ-ONLY; The data pending at source agent in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // IsInitialReplicationComplete - READ-ONLY; A value indicating whether initial replication is complete or not. + IsInitialReplicationComplete *string `json:"isInitialReplicationComplete,omitempty"` + // IrDetails - The initial replication details. + IrDetails *InMageRcmSyncDetails `json:"irDetails,omitempty"` + // ResyncDetails - The resync details. + ResyncDetails *InMageRcmSyncDetails `json:"resyncDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmProtectedDiskDetails. +func (imrpdd InMageRcmProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrpdd.DiskType != "" { + objectMap["diskType"] = imrpdd.DiskType + } + if imrpdd.IrDetails != nil { + objectMap["irDetails"] = imrpdd.IrDetails + } + if imrpdd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrpdd.ResyncDetails + } + return json.Marshal(objectMap) +} + +// InMageRcmProtectionContainerMappingDetails inMageRcm provider specific container mapping details. +type InMageRcmProtectionContainerMappingDetails struct { + // EnableAgentAutoUpgrade - READ-ONLY; A value indicating whether the flag for enable agent auto upgrade. + EnableAgentAutoUpgrade *string `json:"enableAgentAutoUpgrade,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + imrpcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpcmd.InstanceType != "" { + objectMap["instanceType"] = imrpcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return &imrpcmd, true +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &imrpcmd, true +} + +// InMageRcmRecoveryPointDetails inMageRcm provider specific recovery point details. +type InMageRcmRecoveryPointDetails struct { + // IsMultiVMSyncPoint - READ-ONLY; A value indicating whether the recovery point is multi VM consistent. + IsMultiVMSyncPoint *string `json:"isMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) MarshalJSON() ([]byte, error) { + imrrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrrpd.InstanceType != "" { + objectMap["instanceType"] = imrrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return &imrrpd, true +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &imrrpd, true +} + +// InMageRcmReplicationDetails inMageRcm provider specific details. +type InMageRcmReplicationDetails struct { + // InternalIdentifier - READ-ONLY; The virtual machine internal identifier. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // FabricDiscoveryMachineID - READ-ONLY; The ARM Id of the discovered VM. + FabricDiscoveryMachineID *string `json:"fabricDiscoveryMachineId,omitempty"` + // MultiVMGroupName - READ-ONLY; The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DiscoveryType - READ-ONLY; The type of the discovered VM. + DiscoveryType *string `json:"discoveryType,omitempty"` + // ProcessServerID - READ-ONLY; The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // ProcessorCoreCount - READ-ONLY; The processor core count. + ProcessorCoreCount *int32 `json:"processorCoreCount,omitempty"` + // AllocatedMemoryInMB - READ-ONLY; The allocated memory in MB. + AllocatedMemoryInMB *float64 `json:"allocatedMemoryInMB,omitempty"` + // ProcessServerName - READ-ONLY; The process server name. + ProcessServerName *string `json:"processServerName,omitempty"` + // RunAsAccountID - READ-ONLY; The run-as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // FirmwareType - READ-ONLY; The firmware type. + FirmwareType *string `json:"firmwareType,omitempty"` + // PrimaryNicIPAddress - READ-ONLY; The IP address of the primary network interface. + PrimaryNicIPAddress *string `json:"primaryNicIpAddress,omitempty"` + // TargetGeneration - READ-ONLY; The target generation. + TargetGeneration *string `json:"targetGeneration,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // TargetVMName - Target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetLocation - The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // TargetAvailabilitySetID - The target availability set Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The test network Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // FailoverRecoveryPointID - READ-ONLY; The recovery point Id to which the VM was failed over. + FailoverRecoveryPointID *string `json:"failoverRecoveryPointId,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // LastRpoInSeconds - READ-ONLY; The last recovery point objective value. + LastRpoInSeconds *int64 `json:"lastRpoInSeconds,omitempty"` + // LastRpoCalculatedTime - READ-ONLY; The last recovery point objective calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastRecoveryPointID - READ-ONLY; The last recovery point Id. + LastRecoveryPointID *string `json:"lastRecoveryPointId,omitempty"` + // InitialReplicationProgressPercentage - READ-ONLY; The initial replication progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + InitialReplicationProgressPercentage *int32 `json:"initialReplicationProgressPercentage,omitempty"` + // InitialReplicationProcessedBytes - READ-ONLY; The initial replication processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + InitialReplicationProcessedBytes *int64 `json:"initialReplicationProcessedBytes,omitempty"` + // InitialReplicationTransferredBytes - READ-ONLY; The initial replication transferred bytes from source VM to azure for all selected disks on source VM. + InitialReplicationTransferredBytes *int64 `json:"initialReplicationTransferredBytes,omitempty"` + // InitialReplicationProgressHealth - READ-ONLY; The initial replication progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + InitialReplicationProgressHealth VMReplicationProgressHealth `json:"initialReplicationProgressHealth,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncProcessedBytes - READ-ONLY; The resync processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTransferredBytes - READ-ONLY; The resync transferred bytes from source VM to azure for all selected disks on source VM. + ResyncTransferredBytes *int64 `json:"resyncTransferredBytes,omitempty"` + // ResyncProgressHealth - READ-ONLY; The resync progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + ResyncProgressHealth VMReplicationProgressHealth `json:"resyncProgressHealth,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // AgentUpgradeState - READ-ONLY; The agent auto upgrade state. Possible values include: 'MobilityAgentUpgradeStateNone', 'MobilityAgentUpgradeStateStarted', 'MobilityAgentUpgradeStateCompleted', 'MobilityAgentUpgradeStateCommit' + AgentUpgradeState MobilityAgentUpgradeState `json:"agentUpgradeState,omitempty"` + // LastAgentUpgradeType - READ-ONLY; The last agent upgrade type. + LastAgentUpgradeType *string `json:"lastAgentUpgradeType,omitempty"` + // AgentUpgradeJobID - READ-ONLY; The agent upgrade job Id. + AgentUpgradeJobID *string `json:"agentUpgradeJobId,omitempty"` + // AgentUpgradeAttemptToVersion - READ-ONLY; The agent version to which last agent upgrade was attempted. + AgentUpgradeAttemptToVersion *string `json:"agentUpgradeAttemptToVersion,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageRcmProtectedDiskDetails `json:"protectedDisks,omitempty"` + // IsLastUpgradeSuccessful - READ-ONLY; A value indicating whether last agent upgrade was successful or not. + IsLastUpgradeSuccessful *string `json:"isLastUpgradeSuccessful,omitempty"` + // IsAgentRegistrationSuccessfulAfterFailover - READ-ONLY; A value indicating whether agent registration was successful after failover. + IsAgentRegistrationSuccessfulAfterFailover *bool `json:"isAgentRegistrationSuccessfulAfterFailover,omitempty"` + // MobilityAgentDetails - The mobility agent information. + MobilityAgentDetails *InMageRcmMobilityAgentDetails `json:"mobilityAgentDetails,omitempty"` + // LastAgentUpgradeErrorDetails - The last agent upgrade error information. + LastAgentUpgradeErrorDetails *[]InMageRcmLastAgentUpgradeErrorDetails `json:"lastAgentUpgradeErrorDetails,omitempty"` + // AgentUpgradeBlockingErrorDetails - The agent upgrade blocking error information. + AgentUpgradeBlockingErrorDetails *[]InMageRcmAgentUpgradeBlockingErrorDetails `json:"agentUpgradeBlockingErrorDetails,omitempty"` + // VMNics - The network details. + VMNics *[]InMageRcmNicDetails `json:"vmNics,omitempty"` + // DiscoveredVMDetails - The discovered VM details. + DiscoveredVMDetails *InMageRcmDiscoveredProtectedVMDetails `json:"discoveredVmDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) MarshalJSON() ([]byte, error) { + imrrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrrd.LicenseType != nil { + objectMap["licenseType"] = imrrd.LicenseType + } + if imrrd.TargetVMName != nil { + objectMap["targetVmName"] = imrrd.TargetVMName + } + if imrrd.TargetVMSize != nil { + objectMap["targetVmSize"] = imrrd.TargetVMSize + } + if imrrd.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrrd.TargetResourceGroupID + } + if imrrd.TargetLocation != nil { + objectMap["targetLocation"] = imrrd.TargetLocation + } + if imrrd.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrrd.TargetAvailabilitySetID + } + if imrrd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrrd.TargetAvailabilityZone + } + if imrrd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrrd.TargetProximityPlacementGroupID + } + if imrrd.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrrd.TargetBootDiagnosticsStorageAccountID + } + if imrrd.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrrd.TargetNetworkID + } + if imrrd.TestNetworkID != nil { + objectMap["testNetworkId"] = imrrd.TestNetworkID + } + if imrrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrrd.ProtectedDisks + } + if imrrd.MobilityAgentDetails != nil { + objectMap["mobilityAgentDetails"] = imrrd.MobilityAgentDetails + } + if imrrd.LastAgentUpgradeErrorDetails != nil { + objectMap["lastAgentUpgradeErrorDetails"] = imrrd.LastAgentUpgradeErrorDetails + } + if imrrd.AgentUpgradeBlockingErrorDetails != nil { + objectMap["agentUpgradeBlockingErrorDetails"] = imrrd.AgentUpgradeBlockingErrorDetails + } + if imrrd.VMNics != nil { + objectMap["vmNics"] = imrrd.VMNics + } + if imrrd.DiscoveredVMDetails != nil { + objectMap["discoveredVmDetails"] = imrrd.DiscoveredVMDetails + } + if imrrd.InstanceType != "" { + objectMap["instanceType"] = imrrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return &imrrd, true +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrrd, true +} + +// InMageRcmReprotectInput inMageRcm specific provider input. +type InMageRcmReprotectInput struct { + // ReprotectAgentID - The reprotect agent Id. + ReprotectAgentID *string `json:"reprotectAgentId,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) MarshalJSON() ([]byte, error) { + imrri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrri.ReprotectAgentID != nil { + objectMap["reprotectAgentId"] = imrri.ReprotectAgentID + } + if imrri.DatastoreName != nil { + objectMap["datastoreName"] = imrri.DatastoreName + } + if imrri.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imrri.LogStorageAccountID + } + if imrri.PolicyID != nil { + objectMap["policyId"] = imrri.PolicyID + } + if imrri.InstanceType != "" { + objectMap["instanceType"] = imrri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return &imrri, true +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imrri, true +} + +// InMageRcmSyncDetails inMageRcm disk level sync details. +type InMageRcmSyncDetails struct { + // ProgressHealth - READ-ONLY; The progress health. Possible values include: 'None', 'InProgress', 'SlowProgress', 'NoProgress', 'Queued' + ProgressHealth DiskReplicationProgressHealth `json:"progressHealth,omitempty"` + // TransferredBytes - READ-ONLY; The transferred bytes from source VM to azure for the disk. + TransferredBytes *int64 `json:"transferredBytes,omitempty"` + // Last15MinutesTransferredBytes - READ-ONLY; The bytes transferred in last 15 minutes from source VM to azure. + Last15MinutesTransferredBytes *int64 `json:"last15MinutesTransferredBytes,omitempty"` + // LastDataTransferTimeUtc - READ-ONLY; The time of the last data transfer from source VM to azure. + LastDataTransferTimeUtc *string `json:"lastDataTransferTimeUtc,omitempty"` + // ProcessedBytes - READ-ONLY; The total processed bytes. This includes bytes that are transferred from source VM to azure and matched bytes. + ProcessedBytes *int64 `json:"processedBytes,omitempty"` + // StartTime - READ-ONLY; The start time. + StartTime *string `json:"startTime,omitempty"` + // LastRefreshTime - READ-ONLY; The last refresh time. + LastRefreshTime *string `json:"lastRefreshTime,omitempty"` + // ProgressPercentage - READ-ONLY; Progress in percentage. Progress percentage is calculated based on processed bytes. + ProgressPercentage *int32 `json:"progressPercentage,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmSyncDetails. +func (imrsd InMageRcmSyncDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmTestFailoverInput inMageRcm provider specific input for test failover. +type InMageRcmTestFailoverInput struct { + // NetworkID - The test network Id. + NetworkID *string `json:"networkId,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) MarshalJSON() ([]byte, error) { + imrtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrtfi.NetworkID != nil { + objectMap["networkId"] = imrtfi.NetworkID + } + if imrtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrtfi.RecoveryPointID + } + if imrtfi.InstanceType != "" { + objectMap["instanceType"] = imrtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return &imrtfi, true +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imrtfi, true +} + +// InMageRcmUnplannedFailoverInput inMageRcm provider specific input for unplanned failover. +type InMageRcmUnplannedFailoverInput struct { + // PerformShutdown - A value indicating whether VM is to be shutdown. + PerformShutdown *string `json:"performShutdown,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imrufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrufi.PerformShutdown != nil { + objectMap["performShutdown"] = imrufi.PerformShutdown + } + if imrufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrufi.RecoveryPointID + } + if imrufi.InstanceType != "" { + objectMap["instanceType"] = imrufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return &imrufi, true +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imrufi, true +} + +// InMageRcmUpdateApplianceForReplicationProtectedItemInput inMageRcm provider specific input to update +// appliance for replication protected item. +type InMageRcmUpdateApplianceForReplicationProtectedItemInput struct { + // RunAsAccountID - The run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput', 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imruafrpii.InstanceType = InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imruafrpii.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imruafrpii.RunAsAccountID + } + if imruafrpii.InstanceType != "" { + objectMap["instanceType"] = imruafrpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageRcmUpdateApplianceForReplicationProtectedItemInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) AsInMageRcmUpdateApplianceForReplicationProtectedItemInput() (*InMageRcmUpdateApplianceForReplicationProtectedItemInput, bool) { + return &imruafrpii, true +} + +// AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (*UpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return &imruafrpii, true +} + +// InMageRcmUpdateContainerMappingInput inMageRcm update protection container mapping. +type InMageRcmUpdateContainerMappingInput struct { + // EnableAgentAutoUpgrade - A value indicating whether agent auto upgrade has to be enabled. + EnableAgentAutoUpgrade *string `json:"enableAgentAutoUpgrade,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + imrucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrucmi.EnableAgentAutoUpgrade != nil { + objectMap["enableAgentAutoUpgrade"] = imrucmi.EnableAgentAutoUpgrade + } + if imrucmi.InstanceType != "" { + objectMap["instanceType"] = imrucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return &imrucmi, true +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &imrucmi, true +} + +// InMageRcmUpdateReplicationProtectedItemInput inMageRcm provider specific input to update replication +// protected item. +type InMageRcmUpdateReplicationProtectedItemInput struct { + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The test network ARM Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // VMNics - The list of NIC details. + VMNics *[]InMageRcmNicInput `json:"vmNics,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imrurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrurpii.TargetVMName != nil { + objectMap["targetVmName"] = imrurpii.TargetVMName + } + if imrurpii.TargetVMSize != nil { + objectMap["targetVmSize"] = imrurpii.TargetVMSize + } + if imrurpii.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrurpii.TargetResourceGroupID + } + if imrurpii.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrurpii.TargetAvailabilitySetID + } + if imrurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrurpii.TargetAvailabilityZone + } + if imrurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrurpii.TargetProximityPlacementGroupID + } + if imrurpii.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrurpii.TargetBootDiagnosticsStorageAccountID + } + if imrurpii.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrurpii.TargetNetworkID + } + if imrurpii.TestNetworkID != nil { + objectMap["testNetworkId"] = imrurpii.TestNetworkID + } + if imrurpii.VMNics != nil { + objectMap["vmNics"] = imrurpii.VMNics + } + if imrurpii.LicenseType != "" { + objectMap["licenseType"] = imrurpii.LicenseType + } + if imrurpii.InstanceType != "" { + objectMap["instanceType"] = imrurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return &imrurpii, true +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &imrurpii, true +} + +// InMageReplicationDetails inMage provider specific settings. +type InMageReplicationDetails struct { + // ActiveSiteType - The active location of the VM. If the VM is being protected from Azure, this field will take values from { Azure, OnPrem }. If the VM is being protected between two data-centers, this field will be OnPrem always. + ActiveSiteType *string `json:"activeSiteType,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // OsDetails - The OS details. + OsDetails *OSDiskDetails `json:"osDetails,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // ResyncDetails - The resync details of the machine. + ResyncDetails *InitialReplicationDetails `json:"resyncDetails,omitempty"` + // RetentionWindowStart - The retention window start time. + RetentionWindowStart *date.Time `json:"retentionWindowStart,omitempty"` + // RetentionWindowEnd - The retention window end time. + RetentionWindowEnd *date.Time `json:"retentionWindowEnd,omitempty"` + // CompressedDataRateInMB - The compressed data change rate in MB. + CompressedDataRateInMB *float64 `json:"compressedDataRateInMB,omitempty"` + // UncompressedDataRateInMB - The uncompressed data change rate in MB. + UncompressedDataRateInMB *float64 `json:"uncompressedDataRateInMB,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageProtectedDiskDetails `json:"protectedDisks,omitempty"` + // IPAddress - The source IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // MasterTargetID - The master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ConsistencyPoints - The collection of Consistency points. + ConsistencyPoints map[string]*date.Time `json:"consistencyPoints"` + // DiskResized - A value indicating whether any disk is resized for this VM. + DiskResized *string `json:"diskResized,omitempty"` + // RebootAfterUpdateStatus - A value indicating whether the source server requires a restart after update. + RebootAfterUpdateStatus *string `json:"rebootAfterUpdateStatus,omitempty"` + // MultiVMGroupID - The multi vm group Id, if any. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name, if any. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMSyncStatus - A value indicating whether the multi vm sync is enabled or disabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // AgentDetails - The agent details. + AgentDetails *InMageAgentDetails `json:"agentDetails,omitempty"` + // VCenterInfrastructureID - The vCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // InfrastructureVMID - The infrastructure VM Id. + InfrastructureVMID *string `json:"infrastructureVmId,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. + DiscoveryType *string `json:"discoveryType,omitempty"` + // AzureStorageAccountID - A value indicating the underlying Azure storage account. If the VM is not running in Azure, this value shall be set to null. + AzureStorageAccountID *string `json:"azureStorageAccountId,omitempty"` + // Datastores - The datastores of the on-premise machine Value can be list of strings that contain datastore names. + Datastores *[]string `json:"datastores,omitempty"` + // ValidationErrors - The validation errors of the on-premise machine Value can be list of validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastUpdateReceivedTime - The last update time received from on-prem components. + LastUpdateReceivedTime *date.Time `json:"lastUpdateReceivedTime,omitempty"` + // ReplicaID - The replica id of the protected item. + ReplicaID *string `json:"replicaId,omitempty"` + // OsVersion - The OS Version of the protected item. + OsVersion *string `json:"osVersion,omitempty"` + // IsAdditionalStatsAvailable - A value indicating whether additional IR stats are available or not. + IsAdditionalStatsAvailable *bool `json:"isAdditionalStatsAvailable,omitempty"` + // TotalDataTransferred - The total transferred data in bytes. + TotalDataTransferred *int64 `json:"totalDataTransferred,omitempty"` + // TotalProgressHealth - The progress health. + TotalProgressHealth *string `json:"totalProgressHealth,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageReplicationDetails. +func (imrd InMageReplicationDetails) MarshalJSON() ([]byte, error) { + imrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imrd.ActiveSiteType != nil { + objectMap["activeSiteType"] = imrd.ActiveSiteType + } + if imrd.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = imrd.SourceVMCPUCount + } + if imrd.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = imrd.SourceVMRAMSizeInMB + } + if imrd.OsDetails != nil { + objectMap["osDetails"] = imrd.OsDetails + } + if imrd.ProtectionStage != nil { + objectMap["protectionStage"] = imrd.ProtectionStage + } + if imrd.VMID != nil { + objectMap["vmId"] = imrd.VMID + } + if imrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = imrd.VMProtectionState + } + if imrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = imrd.VMProtectionStateDescription + } + if imrd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrd.ResyncDetails + } + if imrd.RetentionWindowStart != nil { + objectMap["retentionWindowStart"] = imrd.RetentionWindowStart + } + if imrd.RetentionWindowEnd != nil { + objectMap["retentionWindowEnd"] = imrd.RetentionWindowEnd + } + if imrd.CompressedDataRateInMB != nil { + objectMap["compressedDataRateInMB"] = imrd.CompressedDataRateInMB + } + if imrd.UncompressedDataRateInMB != nil { + objectMap["uncompressedDataRateInMB"] = imrd.UncompressedDataRateInMB + } + if imrd.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = imrd.RpoInSeconds + } + if imrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrd.ProtectedDisks + } + if imrd.IPAddress != nil { + objectMap["ipAddress"] = imrd.IPAddress + } + if imrd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = imrd.LastHeartbeat + } + if imrd.ProcessServerID != nil { + objectMap["processServerId"] = imrd.ProcessServerID + } + if imrd.MasterTargetID != nil { + objectMap["masterTargetId"] = imrd.MasterTargetID + } + if imrd.ConsistencyPoints != nil { + objectMap["consistencyPoints"] = imrd.ConsistencyPoints + } + if imrd.DiskResized != nil { + objectMap["diskResized"] = imrd.DiskResized + } + if imrd.RebootAfterUpdateStatus != nil { + objectMap["rebootAfterUpdateStatus"] = imrd.RebootAfterUpdateStatus + } + if imrd.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imrd.MultiVMGroupID + } + if imrd.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imrd.MultiVMGroupName + } + if imrd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imrd.MultiVMSyncStatus + } + if imrd.AgentDetails != nil { + objectMap["agentDetails"] = imrd.AgentDetails + } + if imrd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = imrd.VCenterInfrastructureID + } + if imrd.InfrastructureVMID != nil { + objectMap["infrastructureVmId"] = imrd.InfrastructureVMID + } + if imrd.VMNics != nil { + objectMap["vmNics"] = imrd.VMNics + } + if imrd.DiscoveryType != nil { + objectMap["discoveryType"] = imrd.DiscoveryType + } + if imrd.AzureStorageAccountID != nil { + objectMap["azureStorageAccountId"] = imrd.AzureStorageAccountID + } + if imrd.Datastores != nil { + objectMap["datastores"] = imrd.Datastores + } + if imrd.ValidationErrors != nil { + objectMap["validationErrors"] = imrd.ValidationErrors + } + if imrd.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = imrd.LastRpoCalculatedTime + } + if imrd.LastUpdateReceivedTime != nil { + objectMap["lastUpdateReceivedTime"] = imrd.LastUpdateReceivedTime + } + if imrd.ReplicaID != nil { + objectMap["replicaId"] = imrd.ReplicaID + } + if imrd.OsVersion != nil { + objectMap["osVersion"] = imrd.OsVersion + } + if imrd.IsAdditionalStatsAvailable != nil { + objectMap["isAdditionalStatsAvailable"] = imrd.IsAdditionalStatsAvailable + } + if imrd.TotalDataTransferred != nil { + objectMap["totalDataTransferred"] = imrd.TotalDataTransferred + } + if imrd.TotalProgressHealth != nil { + objectMap["totalProgressHealth"] = imrd.TotalProgressHealth + } + if imrd.InstanceType != "" { + objectMap["instanceType"] = imrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return &imrd, true +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrd, true +} + +// InMageReprotectInput inMageAzureV2 specific provider input. +type InMageReprotectInput struct { + // MasterTargetID - The Master Target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RetentionDrive - The retention drive to use on the MT. + RetentionDrive *string `json:"retentionDrive,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // DiskExclusionInput - The enable disk exclusion input. + DiskExclusionInput *InMageDiskExclusionInput `json:"diskExclusionInput,omitempty"` + // ProfileID - The Policy Id. + ProfileID *string `json:"profileId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageReprotectInput. +func (imri InMageReprotectInput) MarshalJSON() ([]byte, error) { + imri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imri.MasterTargetID != nil { + objectMap["masterTargetId"] = imri.MasterTargetID + } + if imri.ProcessServerID != nil { + objectMap["processServerId"] = imri.ProcessServerID + } + if imri.RetentionDrive != nil { + objectMap["retentionDrive"] = imri.RetentionDrive + } + if imri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imri.RunAsAccountID + } + if imri.DatastoreName != nil { + objectMap["datastoreName"] = imri.DatastoreName + } + if imri.DiskExclusionInput != nil { + objectMap["diskExclusionInput"] = imri.DiskExclusionInput + } + if imri.ProfileID != nil { + objectMap["profileId"] = imri.ProfileID + } + if imri.DisksToInclude != nil { + objectMap["disksToInclude"] = imri.DisksToInclude + } + if imri.InstanceType != "" { + objectMap["instanceType"] = imri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return &imri, true +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imri, true +} + +// InMageTestFailoverInput provider specific input for InMage test failover. +type InMageTestFailoverInput struct { + // RecoveryPointType - The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. Possible values include: 'LatestTime', 'LatestTag', 'Custom' + RecoveryPointType RecoveryPointType `json:"recoveryPointType,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) MarshalJSON() ([]byte, error) { + imtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imtfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imtfi.RecoveryPointType + } + if imtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imtfi.RecoveryPointID + } + if imtfi.InstanceType != "" { + objectMap["instanceType"] = imtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return &imtfi, true +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imtfi, true +} + +// InMageUnplannedFailoverInput provider specific input for InMage unplanned failover. +type InMageUnplannedFailoverInput struct { + // RecoveryPointType - The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. Possible values include: 'LatestTime', 'LatestTag', 'Custom' + RecoveryPointType RecoveryPointType `json:"recoveryPointType,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imufi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imufi.RecoveryPointType + } + if imufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imufi.RecoveryPointID + } + if imufi.InstanceType != "" { + objectMap["instanceType"] = imufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return &imufi, true +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imufi, true +} + +// InMageVolumeExclusionOptions guest disk signature based disk exclusion option when doing enable +// protection of virtual machine in InMage provider. +type InMageVolumeExclusionOptions struct { + // VolumeLabel - The volume label. The disk having any volume with this label will be excluded from replication. + VolumeLabel *string `json:"volumeLabel,omitempty"` + // OnlyExcludeIfSingleVolume - The value indicating whether to exclude multi volume disk or not. If a disk has multiple volumes and one of the volume has label matching with VolumeLabel this disk will be excluded from replication if OnlyExcludeIfSingleVolume is false. + OnlyExcludeIfSingleVolume *string `json:"onlyExcludeIfSingleVolume,omitempty"` +} + +// InnerHealthError implements InnerHealthError class. HealthError object has a list of InnerHealthErrors +// as child errors. InnerHealthError is used because this will prevent an infinite loop of structures when +// Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health +// errors and all API consumers can utilize this in the same fashion as Exception -> InnerException. +type InnerHealthError struct { + // ErrorSource - Source of error. + ErrorSource *string `json:"errorSource,omitempty"` + // ErrorType - Type of error. + ErrorType *string `json:"errorType,omitempty"` + // ErrorLevel - Level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // ErrorCategory - Category of error. + ErrorCategory *string `json:"errorCategory,omitempty"` + // ErrorCode - Error code. + ErrorCode *string `json:"errorCode,omitempty"` + // SummaryMessage - Summary message of the entity. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // ErrorMessage - Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // CreationTimeUtc - Error creation time (UTC). + CreationTimeUtc *date.Time `json:"creationTimeUtc,omitempty"` + // RecoveryProviderErrorMessage - DRA error message. + RecoveryProviderErrorMessage *string `json:"recoveryProviderErrorMessage,omitempty"` + // EntityID - ID of the entity. + EntityID *string `json:"entityId,omitempty"` + // ErrorID - The health error unique id. + ErrorID *string `json:"errorId,omitempty"` + // CustomerResolvability - Value indicating whether the health error is customer resolvable. Possible values include: 'Allowed', 'NotAllowed' + CustomerResolvability HealthErrorCustomerResolvability `json:"customerResolvability,omitempty"` +} + +// InputEndpoint ... +type InputEndpoint struct { + EndpointName *string `json:"endpointName,omitempty"` + PrivatePort *int32 `json:"privatePort,omitempty"` + PublicPort *int32 `json:"publicPort,omitempty"` + Protocol *string `json:"protocol,omitempty"` +} + +// IPConfigDetails ... +type IPConfigDetails struct { + Name *string `json:"name,omitempty"` + IsPrimary *bool `json:"isPrimary,omitempty"` + SubnetName *string `json:"subnetName,omitempty"` + StaticIPAddress *string `json:"staticIPAddress,omitempty"` + IPAddressType *string `json:"ipAddressType,omitempty"` + IsSeletedForFailover *bool `json:"isSeletedForFailover,omitempty"` + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + RecoveryStaticIPAddress *string `json:"recoveryStaticIPAddress,omitempty"` + RecoveryIPAddressType *string `json:"recoveryIPAddressType,omitempty"` + RecoveryPublicIPAddressID *string `json:"recoveryPublicIPAddressId,omitempty"` + RecoveryLBBackendAddressPoolIds *[]string `json:"recoveryLBBackendAddressPoolIds,omitempty"` + TfoSubnetName *string `json:"tfoSubnetName,omitempty"` + TfoStaticIPAddress *string `json:"tfoStaticIPAddress,omitempty"` + TfoPublicIPAddressID *string `json:"tfoPublicIPAddressId,omitempty"` + TfoLBBackendAddressPoolIds *[]string `json:"tfoLBBackendAddressPoolIds,omitempty"` +} + +// IPConfigInputDetails ... +type IPConfigInputDetails struct { + IPConfigName *string `json:"ipConfigName,omitempty"` + IsPrimary *bool `json:"isPrimary,omitempty"` + IsSeletedForFailover *bool `json:"isSeletedForFailover,omitempty"` + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + RecoveryStaticIPAddress *string `json:"recoveryStaticIPAddress,omitempty"` + RecoveryPublicIPAddressID *string `json:"recoveryPublicIPAddressId,omitempty"` + RecoveryLBBackendAddressPoolIds *[]string `json:"recoveryLBBackendAddressPoolIds,omitempty"` + TfoSubnetName *string `json:"tfoSubnetName,omitempty"` + TfoStaticIPAddress *string `json:"tfoStaticIPAddress,omitempty"` + TfoPublicIPAddressID *string `json:"tfoPublicIPAddressId,omitempty"` + TfoLBBackendAddressPoolIds *[]string `json:"tfoLBBackendAddressPoolIds,omitempty"` +} + +// Job job details. +type Job struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *JobProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if j.Properties != nil { + objectMap["properties"] = j.Properties + } + if j.Location != nil { + objectMap["location"] = j.Location + } + return json.Marshal(objectMap) +} + +// JobCollection collection of jobs. +type JobCollection struct { + autorest.Response `json:"-"` + // Value - The list of jobs. + Value *[]Job `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// JobCollectionIterator provides access to a complete listing of Job values. +type JobCollectionIterator struct { + i int + page JobCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *JobCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *JobCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter JobCollectionIterator) Response() JobCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter JobCollectionIterator) Value() Job { + if !iter.page.NotDone() { + return Job{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the JobCollectionIterator type. +func NewJobCollectionIterator(page JobCollectionPage) JobCollectionIterator { + return JobCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (jc JobCollection) IsEmpty() bool { + return jc.Value == nil || len(*jc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (jc JobCollection) hasNextLink() bool { + return jc.NextLink != nil && len(*jc.NextLink) != 0 +} + +// jobCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jc JobCollection) jobCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !jc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jc.NextLink))) +} + +// JobCollectionPage contains a page of Job values. +type JobCollectionPage struct { + fn func(context.Context, JobCollection) (JobCollection, error) + jc JobCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *JobCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.jc) + if err != nil { + return err + } + page.jc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *JobCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobCollectionPage) NotDone() bool { + return !page.jc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobCollectionPage) Response() JobCollection { + return page.jc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobCollectionPage) Values() []Job { + if page.jc.IsEmpty() { + return nil + } + return *page.jc.Value +} + +// Creates a new instance of the JobCollectionPage type. +func NewJobCollectionPage(cur JobCollection, getNextPage func(context.Context, JobCollection) (JobCollection, error)) JobCollectionPage { + return JobCollectionPage{ + fn: getNextPage, + jc: cur, + } +} + +// BasicJobDetails job details based on specific job type. +type BasicJobDetails interface { + AsAsrJobDetails() (*AsrJobDetails, bool) + AsExportJobDetails() (*ExportJobDetails, bool) + AsFailoverJobDetails() (*FailoverJobDetails, bool) + AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) + AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) + AsJobDetails() (*JobDetails, bool) +} + +// JobDetails job details based on specific job type. +type JobDetails struct { + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicJobDetails(body []byte) (BasicJobDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAsrJobDetails): + var ajd AsrJobDetails + err := json.Unmarshal(body, &ajd) + return ajd, err + case string(InstanceTypeExportJobDetails): + var ejd ExportJobDetails + err := json.Unmarshal(body, &ejd) + return ejd, err + case string(InstanceTypeFailoverJobDetails): + var fjd FailoverJobDetails + err := json.Unmarshal(body, &fjd) + return fjd, err + case string(InstanceTypeSwitchProtectionJobDetails): + var spjd SwitchProtectionJobDetails + err := json.Unmarshal(body, &spjd) + return spjd, err + case string(InstanceTypeTestFailoverJobDetails): + var tfjd TestFailoverJobDetails + err := json.Unmarshal(body, &tfjd) + return tfjd, err + default: + var jd JobDetails + err := json.Unmarshal(body, &jd) + return jd, err + } +} +func unmarshalBasicJobDetailsArray(body []byte) ([]BasicJobDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jdArray := make([]BasicJobDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + jd, err := unmarshalBasicJobDetails(*rawMessage) + if err != nil { + return nil, err + } + jdArray[index] = jd + } + return jdArray, nil +} + +// MarshalJSON is the custom marshaler for JobDetails. +func (jd JobDetails) MarshalJSON() ([]byte, error) { + jd.InstanceType = InstanceTypeJobDetails + objectMap := make(map[string]interface{}) + if jd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = jd.AffectedObjectDetails + } + if jd.InstanceType != "" { + objectMap["instanceType"] = jd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsJobDetails() (*JobDetails, bool) { + return &jd, true +} + +// AsBasicJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &jd, true +} + +// JobEntity this class contains the minimal job details required to navigate to the desired drill down. +type JobEntity struct { + // JobID - The job id. + JobID *string `json:"jobId,omitempty"` + // JobFriendlyName - The job display name. + JobFriendlyName *string `json:"jobFriendlyName,omitempty"` + // TargetObjectID - The object id. + TargetObjectID *string `json:"targetObjectId,omitempty"` + // TargetObjectName - The object name. + TargetObjectName *string `json:"targetObjectName,omitempty"` + // TargetInstanceType - The workflow affected object type. + TargetInstanceType *string `json:"targetInstanceType,omitempty"` + // JobScenarioName - The job name. Enum type ScenarioName. + JobScenarioName *string `json:"jobScenarioName,omitempty"` +} + +// JobErrorDetails this class contains the error details per object. +type JobErrorDetails struct { + // ServiceErrorDetails - The Service error details. + ServiceErrorDetails *ServiceError `json:"serviceErrorDetails,omitempty"` + // ProviderErrorDetails - The Provider error details. + ProviderErrorDetails *ProviderError `json:"providerErrorDetails,omitempty"` + // ErrorLevel - Error level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // CreationTime - The creation time of job error. + CreationTime *date.Time `json:"creationTime,omitempty"` + // TaskID - The Id of the task. + TaskID *string `json:"taskId,omitempty"` +} + +// JobProperties job custom data details. +type JobProperties struct { + // ActivityID - The activity id. + ActivityID *string `json:"activityId,omitempty"` + // ScenarioName - The ScenarioName. + ScenarioName *string `json:"scenarioName,omitempty"` + // FriendlyName - The DisplayName. + FriendlyName *string `json:"friendlyName,omitempty"` + // State - The status of the Job. It is one of these values - NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or Other. + State *string `json:"state,omitempty"` + // StateDescription - The description of the state of the Job. For e.g. - For Succeeded state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. + StateDescription *string `json:"stateDescription,omitempty"` + // Tasks - The tasks. + Tasks *[]ASRTask `json:"tasks,omitempty"` + // Errors - The errors. + Errors *[]JobErrorDetails `json:"errors,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // AllowedActions - The Allowed action the job. + AllowedActions *[]string `json:"allowedActions,omitempty"` + // TargetObjectID - The affected Object Id. + TargetObjectID *string `json:"targetObjectId,omitempty"` + // TargetObjectName - The name of the affected object. + TargetObjectName *string `json:"targetObjectName,omitempty"` + // TargetInstanceType - The type of the affected object which is of Microsoft.Azure.SiteRecovery.V2015_11_10.AffectedObjectType class. + TargetInstanceType *string `json:"targetInstanceType,omitempty"` + // CustomDetails - The custom job details like test failover job details. + CustomDetails BasicJobDetails `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for JobProperties struct. +func (jp *JobProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "activityId": + if v != nil { + var activityID string + err = json.Unmarshal(*v, &activityID) + if err != nil { + return err + } + jp.ActivityID = &activityID + } + case "scenarioName": + if v != nil { + var scenarioName string + err = json.Unmarshal(*v, &scenarioName) + if err != nil { + return err + } + jp.ScenarioName = &scenarioName + } + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + jp.FriendlyName = &friendlyName + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + jp.State = &state + } + case "stateDescription": + if v != nil { + var stateDescription string + err = json.Unmarshal(*v, &stateDescription) + if err != nil { + return err + } + jp.StateDescription = &stateDescription + } + case "tasks": + if v != nil { + var tasks []ASRTask + err = json.Unmarshal(*v, &tasks) + if err != nil { + return err + } + jp.Tasks = &tasks + } + case "errors": + if v != nil { + var errorsVar []JobErrorDetails + err = json.Unmarshal(*v, &errorsVar) + if err != nil { + return err + } + jp.Errors = &errorsVar + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + jp.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + jp.EndTime = &endTime + } + case "allowedActions": + if v != nil { + var allowedActions []string + err = json.Unmarshal(*v, &allowedActions) + if err != nil { + return err + } + jp.AllowedActions = &allowedActions + } + case "targetObjectId": + if v != nil { + var targetObjectID string + err = json.Unmarshal(*v, &targetObjectID) + if err != nil { + return err + } + jp.TargetObjectID = &targetObjectID + } + case "targetObjectName": + if v != nil { + var targetObjectName string + err = json.Unmarshal(*v, &targetObjectName) + if err != nil { + return err + } + jp.TargetObjectName = &targetObjectName + } + case "targetInstanceType": + if v != nil { + var targetInstanceType string + err = json.Unmarshal(*v, &targetInstanceType) + if err != nil { + return err + } + jp.TargetInstanceType = &targetInstanceType + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicJobDetails(*v) + if err != nil { + return err + } + jp.CustomDetails = customDetails + } + } + } + + return nil +} + +// JobQueryParameter query parameter to enumerate jobs. +type JobQueryParameter struct { + // StartTime - Date time to get jobs from. + StartTime *string `json:"startTime,omitempty"` + // EndTime - Date time to get jobs upto. + EndTime *string `json:"endTime,omitempty"` + // FabricID - The Id of the fabric to search jobs under. + FabricID *string `json:"fabricId,omitempty"` + // AffectedObjectTypes - The type of objects. + AffectedObjectTypes *string `json:"affectedObjectTypes,omitempty"` + // JobStatus - The states of the job to be filtered can be in. + JobStatus *string `json:"jobStatus,omitempty"` + // JobOutputType - The output type of the jobs. Possible values include: 'JSON', 'XML', 'Excel' + JobOutputType ExportJobOutputSerializationType `json:"jobOutputType,omitempty"` + // JobName - The job Name. + JobName *string `json:"jobName,omitempty"` + // TimezoneOffset - The timezone offset for the location of the request (in minutes). + TimezoneOffset *float64 `json:"timezoneOffset,omitempty"` +} + +// JobStatusEventDetails model class for event details of a job status event. +type JobStatusEventDetails struct { + // JobID - Job arm id for the event. + JobID *string `json:"jobId,omitempty"` + // JobFriendlyName - JobName for the Event. + JobFriendlyName *string `json:"jobFriendlyName,omitempty"` + // JobStatus - JobStatus for the Event. + JobStatus *string `json:"jobStatus,omitempty"` + // AffectedObjectType - AffectedObjectType for the event. + AffectedObjectType *string `json:"affectedObjectType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeEventSpecificDetails', 'InstanceTypeJobStatus' + InstanceType InstanceTypeBasicEventSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobStatusEventDetails. +func (jsed JobStatusEventDetails) MarshalJSON() ([]byte, error) { + jsed.InstanceType = InstanceTypeJobStatus + objectMap := make(map[string]interface{}) + if jsed.JobID != nil { + objectMap["jobId"] = jsed.JobID + } + if jsed.JobFriendlyName != nil { + objectMap["jobFriendlyName"] = jsed.JobFriendlyName + } + if jsed.JobStatus != nil { + objectMap["jobStatus"] = jsed.JobStatus + } + if jsed.AffectedObjectType != nil { + objectMap["affectedObjectType"] = jsed.AffectedObjectType + } + if jsed.InstanceType != "" { + objectMap["instanceType"] = jsed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsJobStatusEventDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsJobStatusEventDetails() (*JobStatusEventDetails, bool) { + return &jsed, true +} + +// AsEventSpecificDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsEventSpecificDetails() (*EventSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventSpecificDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsBasicEventSpecificDetails() (BasicEventSpecificDetails, bool) { + return &jsed, true +} + +// BasicJobTaskDetails this class represents a task which is actually a workflow so that one can navigate to its +// individual drill down. +type BasicJobTaskDetails interface { + AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) + AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) + AsJobTaskDetails() (*JobTaskDetails, bool) +} + +// JobTaskDetails this class represents a task which is actually a workflow so that one can navigate to its +// individual drill down. +type JobTaskDetails struct { + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicJobTaskDetails(body []byte) (BasicJobTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeFabricReplicationGroupTaskDetails): + var frgtd FabricReplicationGroupTaskDetails + err := json.Unmarshal(body, &frgtd) + return frgtd, err + case string(InstanceTypeVirtualMachineTaskDetails): + var vmtd VirtualMachineTaskDetails + err := json.Unmarshal(body, &vmtd) + return vmtd, err + default: + var jtd JobTaskDetails + err := json.Unmarshal(body, &jtd) + return jtd, err + } +} +func unmarshalBasicJobTaskDetailsArray(body []byte) ([]BasicJobTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jtdArray := make([]BasicJobTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + jtd, err := unmarshalBasicJobTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + jtdArray[index] = jtd + } + return jtdArray, nil +} + +// MarshalJSON is the custom marshaler for JobTaskDetails. +func (jtd JobTaskDetails) MarshalJSON() ([]byte, error) { + jtd.InstanceType = InstanceTypeJobTaskDetails + objectMap := make(map[string]interface{}) + if jtd.JobTask != nil { + objectMap["jobTask"] = jtd.JobTask + } + if jtd.InstanceType != "" { + objectMap["instanceType"] = jtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return &jtd, true +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &jtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &jtd, true +} + +// KeyEncryptionKeyInfo key Encryption Key (KEK) information. +type KeyEncryptionKeyInfo struct { + // KeyIdentifier - The key URL / identifier. + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KeyVaultResourceArmID - The KeyVault resource ARM Id for key. + KeyVaultResourceArmID *string `json:"keyVaultResourceArmId,omitempty"` +} + +// LogicalNetwork logical network data model. +type LogicalNetwork struct { + autorest.Response `json:"-"` + // Properties - The Logical Network Properties. + Properties *LogicalNetworkProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for LogicalNetwork. +func (ln LogicalNetwork) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ln.Properties != nil { + objectMap["properties"] = ln.Properties + } + if ln.Location != nil { + objectMap["location"] = ln.Location + } + return json.Marshal(objectMap) +} + +// LogicalNetworkCollection list of logical networks. +type LogicalNetworkCollection struct { + autorest.Response `json:"-"` + // Value - The Logical Networks list details. + Value *[]LogicalNetwork `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// LogicalNetworkCollectionIterator provides access to a complete listing of LogicalNetwork values. +type LogicalNetworkCollectionIterator struct { + i int + page LogicalNetworkCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *LogicalNetworkCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LogicalNetworkCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *LogicalNetworkCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter LogicalNetworkCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter LogicalNetworkCollectionIterator) Response() LogicalNetworkCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter LogicalNetworkCollectionIterator) Value() LogicalNetwork { + if !iter.page.NotDone() { + return LogicalNetwork{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the LogicalNetworkCollectionIterator type. +func NewLogicalNetworkCollectionIterator(page LogicalNetworkCollectionPage) LogicalNetworkCollectionIterator { + return LogicalNetworkCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lnc LogicalNetworkCollection) IsEmpty() bool { + return lnc.Value == nil || len(*lnc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (lnc LogicalNetworkCollection) hasNextLink() bool { + return lnc.NextLink != nil && len(*lnc.NextLink) != 0 +} + +// logicalNetworkCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lnc LogicalNetworkCollection) logicalNetworkCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !lnc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lnc.NextLink))) +} + +// LogicalNetworkCollectionPage contains a page of LogicalNetwork values. +type LogicalNetworkCollectionPage struct { + fn func(context.Context, LogicalNetworkCollection) (LogicalNetworkCollection, error) + lnc LogicalNetworkCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *LogicalNetworkCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LogicalNetworkCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.lnc) + if err != nil { + return err + } + page.lnc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *LogicalNetworkCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page LogicalNetworkCollectionPage) NotDone() bool { + return !page.lnc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page LogicalNetworkCollectionPage) Response() LogicalNetworkCollection { + return page.lnc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page LogicalNetworkCollectionPage) Values() []LogicalNetwork { + if page.lnc.IsEmpty() { + return nil + } + return *page.lnc.Value +} + +// Creates a new instance of the LogicalNetworkCollectionPage type. +func NewLogicalNetworkCollectionPage(cur LogicalNetworkCollection, getNextPage func(context.Context, LogicalNetworkCollection) (LogicalNetworkCollection, error)) LogicalNetworkCollectionPage { + return LogicalNetworkCollectionPage{ + fn: getNextPage, + lnc: cur, + } +} + +// LogicalNetworkProperties logical Network Properties. +type LogicalNetworkProperties struct { + // FriendlyName - The Friendly Name. + FriendlyName *string `json:"friendlyName,omitempty"` + // NetworkVirtualizationStatus - A value indicating whether Network Virtualization is enabled for the logical network. + NetworkVirtualizationStatus *string `json:"networkVirtualizationStatus,omitempty"` + // LogicalNetworkUsage - A value indicating whether logical network is used as private test network by test failover. + LogicalNetworkUsage *string `json:"logicalNetworkUsage,omitempty"` + // LogicalNetworkDefinitionsStatus - A value indicating whether logical network definitions are isolated. + LogicalNetworkDefinitionsStatus *string `json:"logicalNetworkDefinitionsStatus,omitempty"` +} + +// ManualActionTaskDetails this class represents the manual action task details. +type ManualActionTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // Instructions - The instructions. + Instructions *string `json:"instructions,omitempty"` + // Observation - The observation. + Observation *string `json:"observation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) MarshalJSON() ([]byte, error) { + matd.InstanceType = InstanceTypeManualActionTaskDetails + objectMap := make(map[string]interface{}) + if matd.Name != nil { + objectMap["name"] = matd.Name + } + if matd.Instructions != nil { + objectMap["instructions"] = matd.Instructions + } + if matd.Observation != nil { + objectMap["observation"] = matd.Observation + } + if matd.InstanceType != "" { + objectMap["instanceType"] = matd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return &matd, true +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &matd, true +} + +// MarsAgentDetails mars agent details. +type MarsAgentDetails struct { + // ID - READ-ONLY; The Mars agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The Mars agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The Mars agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The Mars agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the Mars agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the Mars agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for MarsAgentDetails. +func (mad MarsAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MasterTargetServer details of a Master Target Server. +type MasterTargetServer struct { + // ID - The server Id. + ID *string `json:"id,omitempty"` + // IPAddress - The IP address of the server. + IPAddress *string `json:"ipAddress,omitempty"` + // Name - The server name. + Name *string `json:"name,omitempty"` + // OsType - The OS type of the server. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The version of the scout component on the server. + AgentVersion *string `json:"agentVersion,omitempty"` + // LastHeartbeat - The last heartbeat received from the server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // RetentionVolumes - The retention volumes of Master target Server. + RetentionVolumes *[]RetentionVolume `json:"retentionVolumes,omitempty"` + // DataStores - The list of data stores in the fabric. + DataStores *[]DataStore `json:"dataStores,omitempty"` + // ValidationErrors - Validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // HealthErrors - Health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // DiskCount - Disk count of the master target. + DiskCount *int32 `json:"diskCount,omitempty"` + // OsVersion - OS Version of the master target. + OsVersion *string `json:"osVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // MarsAgentVersion - MARS agent version. + MarsAgentVersion *string `json:"marsAgentVersion,omitempty"` + // MarsAgentExpiryDate - MARS agent expiry date. + MarsAgentExpiryDate *date.Time `json:"marsAgentExpiryDate,omitempty"` + // AgentVersionDetails - Agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // MarsAgentVersionDetails - Mars agent version details. + MarsAgentVersionDetails *VersionDetails `json:"marsAgentVersionDetails,omitempty"` +} + +// MigrateInput input for migrate. +type MigrateInput struct { + // Properties - Migrate input properties. + Properties *MigrateInputProperties `json:"properties,omitempty"` +} + +// MigrateInputProperties migrate input properties. +type MigrateInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicMigrateProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for MigrateInputProperties struct. +func (mip *MigrateInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicMigrateProviderSpecificInput(*v) + if err != nil { + return err + } + mip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicMigrateProviderSpecificInput migrate provider specific input. +type BasicMigrateProviderSpecificInput interface { + AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) + AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) +} + +// MigrateProviderSpecificInput migrate provider specific input. +type MigrateProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput', 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicMigrateProviderSpecificInput(body []byte) (BasicMigrateProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt): + var vmcmi VMwareCbtMigrateInput + err := json.Unmarshal(body, &vmcmi) + return vmcmi, err + default: + var mpsi MigrateProviderSpecificInput + err := json.Unmarshal(body, &mpsi) + return mpsi, err + } +} +func unmarshalBasicMigrateProviderSpecificInputArray(body []byte) ([]BasicMigrateProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + mpsiArray := make([]BasicMigrateProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + mpsi, err := unmarshalBasicMigrateProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + mpsiArray[index] = mpsi + } + return mpsiArray, nil +} + +// MarshalJSON is the custom marshaler for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) MarshalJSON() ([]byte, error) { + mpsi.InstanceType = InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput + objectMap := make(map[string]interface{}) + if mpsi.InstanceType != "" { + objectMap["instanceType"] = mpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrateInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) { + return nil, false +} + +// AsMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) { + return &mpsi, true +} + +// AsBasicMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsBasicMigrateProviderSpecificInput() (BasicMigrateProviderSpecificInput, bool) { + return &mpsi, true +} + +// MigrationItem migration item. +type MigrationItem struct { + autorest.Response `json:"-"` + // Properties - The migration item properties. + Properties *MigrationItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationItem. +func (mi MigrationItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mi.Properties != nil { + objectMap["properties"] = mi.Properties + } + if mi.Location != nil { + objectMap["location"] = mi.Location + } + return json.Marshal(objectMap) +} + +// MigrationItemCollection migration item collection. +type MigrationItemCollection struct { + autorest.Response `json:"-"` + // Value - The list of migration items. + Value *[]MigrationItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MigrationItemCollectionIterator provides access to a complete listing of MigrationItem values. +type MigrationItemCollectionIterator struct { + i int + page MigrationItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *MigrationItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *MigrationItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MigrationItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter MigrationItemCollectionIterator) Response() MigrationItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter MigrationItemCollectionIterator) Value() MigrationItem { + if !iter.page.NotDone() { + return MigrationItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the MigrationItemCollectionIterator type. +func NewMigrationItemCollectionIterator(page MigrationItemCollectionPage) MigrationItemCollectionIterator { + return MigrationItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mic MigrationItemCollection) IsEmpty() bool { + return mic.Value == nil || len(*mic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mic MigrationItemCollection) hasNextLink() bool { + return mic.NextLink != nil && len(*mic.NextLink) != 0 +} + +// migrationItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mic MigrationItemCollection) migrationItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !mic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mic.NextLink))) +} + +// MigrationItemCollectionPage contains a page of MigrationItem values. +type MigrationItemCollectionPage struct { + fn func(context.Context, MigrationItemCollection) (MigrationItemCollection, error) + mic MigrationItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *MigrationItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.mic) + if err != nil { + return err + } + page.mic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *MigrationItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MigrationItemCollectionPage) NotDone() bool { + return !page.mic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MigrationItemCollectionPage) Response() MigrationItemCollection { + return page.mic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MigrationItemCollectionPage) Values() []MigrationItem { + if page.mic.IsEmpty() { + return nil + } + return *page.mic.Value +} + +// Creates a new instance of the MigrationItemCollectionPage type. +func NewMigrationItemCollectionPage(cur MigrationItemCollection, getNextPage func(context.Context, MigrationItemCollection) (MigrationItemCollection, error)) MigrationItemCollectionPage { + return MigrationItemCollectionPage{ + fn: getNextPage, + mic: cur, + } +} + +// MigrationItemProperties migration item properties. +type MigrationItemProperties struct { + // MachineName - READ-ONLY; The on-premise virtual machine name. + MachineName *string `json:"machineName,omitempty"` + // PolicyID - READ-ONLY; The ARM Id of policy governing this item. + PolicyID *string `json:"policyId,omitempty"` + // PolicyFriendlyName - READ-ONLY; The name of policy governing this item. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` + // MigrationState - READ-ONLY; The migration status. Possible values include: 'MigrationStateNone', 'MigrationStateEnableMigrationInProgress', 'MigrationStateEnableMigrationFailed', 'MigrationStateDisableMigrationInProgress', 'MigrationStateDisableMigrationFailed', 'MigrationStateInitialSeedingInProgress', 'MigrationStateInitialSeedingFailed', 'MigrationStateReplicating', 'MigrationStateMigrationInProgress', 'MigrationStateMigrationSucceeded', 'MigrationStateMigrationFailed' + MigrationState MigrationState `json:"migrationState,omitempty"` + // MigrationStateDescription - READ-ONLY; The migration state description. + MigrationStateDescription *string `json:"migrationStateDescription,omitempty"` + // LastTestMigrationTime - READ-ONLY; The last test migration time. + LastTestMigrationTime *date.Time `json:"lastTestMigrationTime,omitempty"` + // LastTestMigrationStatus - READ-ONLY; The status of the last test migration. + LastTestMigrationStatus *string `json:"lastTestMigrationStatus,omitempty"` + // TestMigrateState - READ-ONLY; The test migrate state. Possible values include: 'TestMigrationStateNone', 'TestMigrationStateTestMigrationInProgress', 'TestMigrationStateTestMigrationSucceeded', 'TestMigrationStateTestMigrationFailed', 'TestMigrationStateTestMigrationCleanupInProgress' + TestMigrateState TestMigrationState `json:"testMigrateState,omitempty"` + // TestMigrateStateDescription - READ-ONLY; The test migrate state description. + TestMigrateStateDescription *string `json:"testMigrateStateDescription,omitempty"` + // Health - READ-ONLY; The consolidated health. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The list of health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // AllowedOperations - READ-ONLY; The allowed operations on the migration item based on the current migration state of the item. + AllowedOperations *[]MigrationItemOperation `json:"allowedOperations,omitempty"` + // CurrentJob - READ-ONLY; The current job details. + CurrentJob *CurrentJobDetails `json:"currentJob,omitempty"` + // EventCorrelationID - READ-ONLY; The correlation Id for events associated with this migration item. + EventCorrelationID *string `json:"eventCorrelationId,omitempty"` + // ProviderSpecificDetails - The migration provider custom settings. + ProviderSpecificDetails BasicMigrationProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationItemProperties. +func (mip MigrationItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["providerSpecificDetails"] = mip.ProviderSpecificDetails + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MigrationItemProperties struct. +func (mip *MigrationItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "machineName": + if v != nil { + var machineName string + err = json.Unmarshal(*v, &machineName) + if err != nil { + return err + } + mip.MachineName = &machineName + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + mip.PolicyID = &policyID + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + mip.PolicyFriendlyName = &policyFriendlyName + } + case "migrationState": + if v != nil { + var migrationState MigrationState + err = json.Unmarshal(*v, &migrationState) + if err != nil { + return err + } + mip.MigrationState = migrationState + } + case "migrationStateDescription": + if v != nil { + var migrationStateDescription string + err = json.Unmarshal(*v, &migrationStateDescription) + if err != nil { + return err + } + mip.MigrationStateDescription = &migrationStateDescription + } + case "lastTestMigrationTime": + if v != nil { + var lastTestMigrationTime date.Time + err = json.Unmarshal(*v, &lastTestMigrationTime) + if err != nil { + return err + } + mip.LastTestMigrationTime = &lastTestMigrationTime + } + case "lastTestMigrationStatus": + if v != nil { + var lastTestMigrationStatus string + err = json.Unmarshal(*v, &lastTestMigrationStatus) + if err != nil { + return err + } + mip.LastTestMigrationStatus = &lastTestMigrationStatus + } + case "testMigrateState": + if v != nil { + var testMigrateState TestMigrationState + err = json.Unmarshal(*v, &testMigrateState) + if err != nil { + return err + } + mip.TestMigrateState = testMigrateState + } + case "testMigrateStateDescription": + if v != nil { + var testMigrateStateDescription string + err = json.Unmarshal(*v, &testMigrateStateDescription) + if err != nil { + return err + } + mip.TestMigrateStateDescription = &testMigrateStateDescription + } + case "health": + if v != nil { + var health ProtectionHealth + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + mip.Health = health + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + mip.HealthErrors = &healthErrors + } + case "allowedOperations": + if v != nil { + var allowedOperations []MigrationItemOperation + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + mip.AllowedOperations = &allowedOperations + } + case "currentJob": + if v != nil { + var currentJob CurrentJobDetails + err = json.Unmarshal(*v, ¤tJob) + if err != nil { + return err + } + mip.CurrentJob = ¤tJob + } + case "eventCorrelationId": + if v != nil { + var eventCorrelationID string + err = json.Unmarshal(*v, &eventCorrelationID) + if err != nil { + return err + } + mip.EventCorrelationID = &eventCorrelationID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicMigrationProviderSpecificSettings(*v) + if err != nil { + return err + } + mip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// MigrationItemsQueryParameter query parameter to enumerate migration items. +type MigrationItemsQueryParameter struct { + // SourceFabricName - The source fabric name filter. + SourceFabricName *string `json:"sourceFabricName,omitempty"` + // SourceContainerName - The source container name filter. + SourceContainerName *string `json:"sourceContainerName,omitempty"` + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` +} + +// BasicMigrationProviderSpecificSettings migration provider specific settings. +type BasicMigrationProviderSpecificSettings interface { + AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) + AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) +} + +// MigrationProviderSpecificSettings migration provider specific settings. +type MigrationProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings', 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicMigrationProviderSpecificSettings(body []byte) (BasicMigrationProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt): + var vmcmd VMwareCbtMigrationDetails + err := json.Unmarshal(body, &vmcmd) + return vmcmd, err + default: + var mpss MigrationProviderSpecificSettings + err := json.Unmarshal(body, &mpss) + return mpss, err + } +} +func unmarshalBasicMigrationProviderSpecificSettingsArray(body []byte) ([]BasicMigrationProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + mpssArray := make([]BasicMigrationProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + mpss, err := unmarshalBasicMigrationProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + mpssArray[index] = mpss + } + return mpssArray, nil +} + +// MarshalJSON is the custom marshaler for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) MarshalJSON() ([]byte, error) { + mpss.InstanceType = InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings + objectMap := make(map[string]interface{}) + if mpss.InstanceType != "" { + objectMap["instanceType"] = mpss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrationDetails is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) { + return nil, false +} + +// AsMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) { + return &mpss, true +} + +// AsBasicMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsBasicMigrationProviderSpecificSettings() (BasicMigrationProviderSpecificSettings, bool) { + return &mpss, true +} + +// MigrationRecoveryPoint recovery point for a migration item. +type MigrationRecoveryPoint struct { + autorest.Response `json:"-"` + // Properties - Recovery point properties. + Properties *MigrationRecoveryPointProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationRecoveryPoint. +func (mrp MigrationRecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mrp.Properties != nil { + objectMap["properties"] = mrp.Properties + } + if mrp.Location != nil { + objectMap["location"] = mrp.Location + } + return json.Marshal(objectMap) +} + +// MigrationRecoveryPointCollection collection of migration recovery points. +type MigrationRecoveryPointCollection struct { + autorest.Response `json:"-"` + // Value - The migration recovery point details. + Value *[]MigrationRecoveryPoint `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MigrationRecoveryPointCollectionIterator provides access to a complete listing of MigrationRecoveryPoint +// values. +type MigrationRecoveryPointCollectionIterator struct { + i int + page MigrationRecoveryPointCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *MigrationRecoveryPointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *MigrationRecoveryPointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MigrationRecoveryPointCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter MigrationRecoveryPointCollectionIterator) Response() MigrationRecoveryPointCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter MigrationRecoveryPointCollectionIterator) Value() MigrationRecoveryPoint { + if !iter.page.NotDone() { + return MigrationRecoveryPoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the MigrationRecoveryPointCollectionIterator type. +func NewMigrationRecoveryPointCollectionIterator(page MigrationRecoveryPointCollectionPage) MigrationRecoveryPointCollectionIterator { + return MigrationRecoveryPointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mrpc MigrationRecoveryPointCollection) IsEmpty() bool { + return mrpc.Value == nil || len(*mrpc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mrpc MigrationRecoveryPointCollection) hasNextLink() bool { + return mrpc.NextLink != nil && len(*mrpc.NextLink) != 0 +} + +// migrationRecoveryPointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mrpc MigrationRecoveryPointCollection) migrationRecoveryPointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !mrpc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mrpc.NextLink))) +} + +// MigrationRecoveryPointCollectionPage contains a page of MigrationRecoveryPoint values. +type MigrationRecoveryPointCollectionPage struct { + fn func(context.Context, MigrationRecoveryPointCollection) (MigrationRecoveryPointCollection, error) + mrpc MigrationRecoveryPointCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *MigrationRecoveryPointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.mrpc) + if err != nil { + return err + } + page.mrpc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *MigrationRecoveryPointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MigrationRecoveryPointCollectionPage) NotDone() bool { + return !page.mrpc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MigrationRecoveryPointCollectionPage) Response() MigrationRecoveryPointCollection { + return page.mrpc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MigrationRecoveryPointCollectionPage) Values() []MigrationRecoveryPoint { + if page.mrpc.IsEmpty() { + return nil + } + return *page.mrpc.Value +} + +// Creates a new instance of the MigrationRecoveryPointCollectionPage type. +func NewMigrationRecoveryPointCollectionPage(cur MigrationRecoveryPointCollection, getNextPage func(context.Context, MigrationRecoveryPointCollection) (MigrationRecoveryPointCollection, error)) MigrationRecoveryPointCollectionPage { + return MigrationRecoveryPointCollectionPage{ + fn: getNextPage, + mrpc: cur, + } +} + +// MigrationRecoveryPointProperties migration item recovery point properties. +type MigrationRecoveryPointProperties struct { + // RecoveryPointTime - READ-ONLY; The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointType - READ-ONLY; The recovery point type. Possible values include: 'MigrationRecoveryPointTypeNotSpecified', 'MigrationRecoveryPointTypeApplicationConsistent', 'MigrationRecoveryPointTypeCrashConsistent' + RecoveryPointType MigrationRecoveryPointType `json:"recoveryPointType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationRecoveryPointProperties. +func (mrpp MigrationRecoveryPointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MobilityServiceUpdate the Mobility Service update details. +type MobilityServiceUpdate struct { + // Version - The version of the latest update. + Version *string `json:"version,omitempty"` + // RebootStatus - The reboot status of the update - whether it is required or not. + RebootStatus *string `json:"rebootStatus,omitempty"` + // OsType - The OS type. + OsType *string `json:"osType,omitempty"` +} + +// Network network model. +type Network struct { + autorest.Response `json:"-"` + // Properties - The Network Properties. + Properties *NetworkProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Network. +func (n Network) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if n.Properties != nil { + objectMap["properties"] = n.Properties + } + if n.Location != nil { + objectMap["location"] = n.Location + } + return json.Marshal(objectMap) +} + +// NetworkCollection list of networks. +type NetworkCollection struct { + autorest.Response `json:"-"` + // Value - The Networks list details. + Value *[]Network `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// NetworkCollectionIterator provides access to a complete listing of Network values. +type NetworkCollectionIterator struct { + i int + page NetworkCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *NetworkCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *NetworkCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter NetworkCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter NetworkCollectionIterator) Response() NetworkCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter NetworkCollectionIterator) Value() Network { + if !iter.page.NotDone() { + return Network{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the NetworkCollectionIterator type. +func NewNetworkCollectionIterator(page NetworkCollectionPage) NetworkCollectionIterator { + return NetworkCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (nc NetworkCollection) IsEmpty() bool { + return nc.Value == nil || len(*nc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (nc NetworkCollection) hasNextLink() bool { + return nc.NextLink != nil && len(*nc.NextLink) != 0 +} + +// networkCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (nc NetworkCollection) networkCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !nc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(nc.NextLink))) +} + +// NetworkCollectionPage contains a page of Network values. +type NetworkCollectionPage struct { + fn func(context.Context, NetworkCollection) (NetworkCollection, error) + nc NetworkCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *NetworkCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.nc) + if err != nil { + return err + } + page.nc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *NetworkCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page NetworkCollectionPage) NotDone() bool { + return !page.nc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page NetworkCollectionPage) Response() NetworkCollection { + return page.nc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page NetworkCollectionPage) Values() []Network { + if page.nc.IsEmpty() { + return nil + } + return *page.nc.Value +} + +// Creates a new instance of the NetworkCollectionPage type. +func NewNetworkCollectionPage(cur NetworkCollection, getNextPage func(context.Context, NetworkCollection) (NetworkCollection, error)) NetworkCollectionPage { + return NetworkCollectionPage{ + fn: getNextPage, + nc: cur, + } +} + +// NetworkMapping network Mapping model. Ideally it should have been possible to inherit this class from +// prev version in InheritedModels as long as there is no difference in structure or method signature. +// Since there were no base Models for certain fields and methods viz NetworkMappingProperties and Load +// with required return type, the class has been introduced in its entirety with references to base models +// to facilitate extensions in subsequent versions. +type NetworkMapping struct { + autorest.Response `json:"-"` + // Properties - The Network Mapping Properties. + Properties *NetworkMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for NetworkMapping. +func (nm NetworkMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if nm.Properties != nil { + objectMap["properties"] = nm.Properties + } + if nm.Location != nil { + objectMap["location"] = nm.Location + } + return json.Marshal(objectMap) +} + +// NetworkMappingCollection list of network mappings. As with NetworkMapping, it should be possible to +// reuse a prev version of this class. It doesn't seem likely this class could be anything more than a +// slightly bespoke collection of NetworkMapping. Hence it makes sense to override Load with +// Base.NetworkMapping instead of existing CurrentVersion.NetworkMapping. +type NetworkMappingCollection struct { + autorest.Response `json:"-"` + // Value - The Network Mappings list. + Value *[]NetworkMapping `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// NetworkMappingCollectionIterator provides access to a complete listing of NetworkMapping values. +type NetworkMappingCollectionIterator struct { + i int + page NetworkMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *NetworkMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *NetworkMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter NetworkMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter NetworkMappingCollectionIterator) Response() NetworkMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter NetworkMappingCollectionIterator) Value() NetworkMapping { + if !iter.page.NotDone() { + return NetworkMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the NetworkMappingCollectionIterator type. +func NewNetworkMappingCollectionIterator(page NetworkMappingCollectionPage) NetworkMappingCollectionIterator { + return NetworkMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (nmc NetworkMappingCollection) IsEmpty() bool { + return nmc.Value == nil || len(*nmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (nmc NetworkMappingCollection) hasNextLink() bool { + return nmc.NextLink != nil && len(*nmc.NextLink) != 0 +} + +// networkMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (nmc NetworkMappingCollection) networkMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !nmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(nmc.NextLink))) +} + +// NetworkMappingCollectionPage contains a page of NetworkMapping values. +type NetworkMappingCollectionPage struct { + fn func(context.Context, NetworkMappingCollection) (NetworkMappingCollection, error) + nmc NetworkMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *NetworkMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.nmc) + if err != nil { + return err + } + page.nmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *NetworkMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page NetworkMappingCollectionPage) NotDone() bool { + return !page.nmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page NetworkMappingCollectionPage) Response() NetworkMappingCollection { + return page.nmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page NetworkMappingCollectionPage) Values() []NetworkMapping { + if page.nmc.IsEmpty() { + return nil + } + return *page.nmc.Value +} + +// Creates a new instance of the NetworkMappingCollectionPage type. +func NewNetworkMappingCollectionPage(cur NetworkMappingCollection, getNextPage func(context.Context, NetworkMappingCollection) (NetworkMappingCollection, error)) NetworkMappingCollectionPage { + return NetworkMappingCollectionPage{ + fn: getNextPage, + nmc: cur, + } +} + +// BasicNetworkMappingFabricSpecificSettings network Mapping fabric specific settings. +type BasicNetworkMappingFabricSpecificSettings interface { + AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) + AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) + AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) + AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) +} + +// NetworkMappingFabricSpecificSettings network Mapping fabric specific settings. +type NetworkMappingFabricSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicNetworkMappingFabricSpecificSettings(body []byte) (BasicNetworkMappingFabricSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure): + var atanms AzureToAzureNetworkMappingSettings + err := json.Unmarshal(body, &atanms) + return atanms, err + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure): + var vtanms VmmToAzureNetworkMappingSettings + err := json.Unmarshal(body, &vtanms) + return vtanms, err + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm): + var vtvnms VmmToVmmNetworkMappingSettings + err := json.Unmarshal(body, &vtvnms) + return vtvnms, err + default: + var nmfss NetworkMappingFabricSpecificSettings + err := json.Unmarshal(body, &nmfss) + return nmfss, err + } +} +func unmarshalBasicNetworkMappingFabricSpecificSettingsArray(body []byte) ([]BasicNetworkMappingFabricSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + nmfssArray := make([]BasicNetworkMappingFabricSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + nmfss, err := unmarshalBasicNetworkMappingFabricSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + nmfssArray[index] = nmfss + } + return nmfssArray, nil +} + +// MarshalJSON is the custom marshaler for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) MarshalJSON() ([]byte, error) { + nmfss.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings + objectMap := make(map[string]interface{}) + if nmfss.InstanceType != "" { + objectMap["instanceType"] = nmfss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return &nmfss, true +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &nmfss, true +} + +// NetworkMappingProperties network Mapping Properties. +type NetworkMappingProperties struct { + // State - The pairing state for network mapping. + State *string `json:"state,omitempty"` + // PrimaryNetworkFriendlyName - The primary network friendly name. + PrimaryNetworkFriendlyName *string `json:"primaryNetworkFriendlyName,omitempty"` + // PrimaryNetworkID - The primary network id for network mapping. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // PrimaryFabricFriendlyName - The primary fabric friendly name. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // RecoveryNetworkFriendlyName - The recovery network friendly name. + RecoveryNetworkFriendlyName *string `json:"recoveryNetworkFriendlyName,omitempty"` + // RecoveryNetworkID - The recovery network id for network mapping. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // RecoveryFabricArmID - The recovery fabric ARM id. + RecoveryFabricArmID *string `json:"recoveryFabricArmId,omitempty"` + // RecoveryFabricFriendlyName - The recovery fabric friendly name. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // FabricSpecificSettings - The fabric specific settings. + FabricSpecificSettings BasicNetworkMappingFabricSpecificSettings `json:"fabricSpecificSettings,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for NetworkMappingProperties struct. +func (nmp *NetworkMappingProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + nmp.State = &state + } + case "primaryNetworkFriendlyName": + if v != nil { + var primaryNetworkFriendlyName string + err = json.Unmarshal(*v, &primaryNetworkFriendlyName) + if err != nil { + return err + } + nmp.PrimaryNetworkFriendlyName = &primaryNetworkFriendlyName + } + case "primaryNetworkId": + if v != nil { + var primaryNetworkID string + err = json.Unmarshal(*v, &primaryNetworkID) + if err != nil { + return err + } + nmp.PrimaryNetworkID = &primaryNetworkID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + nmp.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "recoveryNetworkFriendlyName": + if v != nil { + var recoveryNetworkFriendlyName string + err = json.Unmarshal(*v, &recoveryNetworkFriendlyName) + if err != nil { + return err + } + nmp.RecoveryNetworkFriendlyName = &recoveryNetworkFriendlyName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + nmp.RecoveryNetworkID = &recoveryNetworkID + } + case "recoveryFabricArmId": + if v != nil { + var recoveryFabricArmID string + err = json.Unmarshal(*v, &recoveryFabricArmID) + if err != nil { + return err + } + nmp.RecoveryFabricArmID = &recoveryFabricArmID + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + nmp.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "fabricSpecificSettings": + if v != nil { + fabricSpecificSettings, err := unmarshalBasicNetworkMappingFabricSpecificSettings(*v) + if err != nil { + return err + } + nmp.FabricSpecificSettings = fabricSpecificSettings + } + } + } + + return nil +} + +// NetworkProperties network Properties. +type NetworkProperties struct { + // FabricType - The Fabric Type. + FabricType *string `json:"fabricType,omitempty"` + // Subnets - The List of subnets. + Subnets *[]Subnet `json:"subnets,omitempty"` + // FriendlyName - The Friendly Name. + FriendlyName *string `json:"friendlyName,omitempty"` + // NetworkType - The Network Type. + NetworkType *string `json:"networkType,omitempty"` +} + +// NewProtectionProfile new Protection profile input. +type NewProtectionProfile struct { + // PolicyName - The protection profile input. + PolicyName *string `json:"policyName,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for NewProtectionProfile. +func (npp NewProtectionProfile) MarshalJSON() ([]byte, error) { + npp.ResourceType = ResourceTypeNew + objectMap := make(map[string]interface{}) + if npp.PolicyName != nil { + objectMap["policyName"] = npp.PolicyName + } + if npp.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = npp.RecoveryPointHistory + } + if npp.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = npp.CrashConsistentFrequencyInMinutes + } + if npp.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = npp.AppConsistentFrequencyInMinutes + } + if npp.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = npp.MultiVMSyncStatus + } + if npp.ResourceType != "" { + objectMap["resourceType"] = npp.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return nil, false +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return &npp, true +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return nil, false +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &npp, true +} + +// NewRecoveryVirtualNetwork recovery virtual network input to create new virtual network from given source +// network. +type NewRecoveryVirtualNetwork struct { + // RecoveryVirtualNetworkResourceGroupName - The name of the resource group to be used to create the recovery virtual network. If absent, target network would be created in the same resource group as target VM. + RecoveryVirtualNetworkResourceGroupName *string `json:"recoveryVirtualNetworkResourceGroupName,omitempty"` + // RecoveryVirtualNetworkName - The recovery virtual network name. + RecoveryVirtualNetworkName *string `json:"recoveryVirtualNetworkName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) MarshalJSON() ([]byte, error) { + nrvn.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew + objectMap := make(map[string]interface{}) + if nrvn.RecoveryVirtualNetworkResourceGroupName != nil { + objectMap["recoveryVirtualNetworkResourceGroupName"] = nrvn.RecoveryVirtualNetworkResourceGroupName + } + if nrvn.RecoveryVirtualNetworkName != nil { + objectMap["recoveryVirtualNetworkName"] = nrvn.RecoveryVirtualNetworkName + } + if nrvn.ResourceType != "" { + objectMap["resourceType"] = nrvn.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return &nrvn, true +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &nrvn, true +} + +// OperationsDiscovery operations discovery class. +type OperationsDiscovery struct { + // Name - Name of the API. The name of the operation being performed on this particular object. It should match the action name that appears in RBAC / the event service. Examples of operations include: * Microsoft.Compute/virtualMachine/capture/action * Microsoft.Compute/virtualMachine/restart/action * Microsoft.Compute/virtualMachine/write * Microsoft.Compute/virtualMachine/read * Microsoft.Compute/virtualMachine/delete Each action should include, in order: (1) Resource Provider Namespace (2) Type hierarchy for which the action applies (e.g. server/databases for a SQL Azure database) (3) Read, Write, Action or Delete indicating which type applies. If it is a PUT/PATCH on a collection or named value, Write should be used. If it is a GET, Read should be used. If it is a DELETE, Delete should be used. If it is a POST, Action should be used. As a note: all resource providers would need to include the "{Resource Provider Namespace}/register/action" operation in their response. This API is used to register for their service, and should include details about the operation (e.g. a localized name for the resource provider + any special considerations like PII release). + Name *string `json:"name,omitempty"` + // Display - Object type. + Display *Display `json:"display,omitempty"` + // Origin - Origin. The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. Default value is "user,system". + Origin *string `json:"origin,omitempty"` + // Properties - Properties. Reserved for future use. + Properties interface{} `json:"properties,omitempty"` +} + +// OperationsDiscoveryCollection collection of ClientDiscovery details. +type OperationsDiscoveryCollection struct { + autorest.Response `json:"-"` + // Value - The ClientDiscovery details. + Value *[]OperationsDiscovery `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationsDiscoveryCollectionIterator provides access to a complete listing of OperationsDiscovery +// values. +type OperationsDiscoveryCollectionIterator struct { + i int + page OperationsDiscoveryCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationsDiscoveryCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsDiscoveryCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationsDiscoveryCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationsDiscoveryCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationsDiscoveryCollectionIterator) Response() OperationsDiscoveryCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationsDiscoveryCollectionIterator) Value() OperationsDiscovery { + if !iter.page.NotDone() { + return OperationsDiscovery{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationsDiscoveryCollectionIterator type. +func NewOperationsDiscoveryCollectionIterator(page OperationsDiscoveryCollectionPage) OperationsDiscoveryCollectionIterator { + return OperationsDiscoveryCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (odc OperationsDiscoveryCollection) IsEmpty() bool { + return odc.Value == nil || len(*odc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (odc OperationsDiscoveryCollection) hasNextLink() bool { + return odc.NextLink != nil && len(*odc.NextLink) != 0 +} + +// operationsDiscoveryCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (odc OperationsDiscoveryCollection) operationsDiscoveryCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !odc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(odc.NextLink))) +} + +// OperationsDiscoveryCollectionPage contains a page of OperationsDiscovery values. +type OperationsDiscoveryCollectionPage struct { + fn func(context.Context, OperationsDiscoveryCollection) (OperationsDiscoveryCollection, error) + odc OperationsDiscoveryCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationsDiscoveryCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsDiscoveryCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.odc) + if err != nil { + return err + } + page.odc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationsDiscoveryCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationsDiscoveryCollectionPage) NotDone() bool { + return !page.odc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationsDiscoveryCollectionPage) Response() OperationsDiscoveryCollection { + return page.odc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationsDiscoveryCollectionPage) Values() []OperationsDiscovery { + if page.odc.IsEmpty() { + return nil + } + return *page.odc.Value +} + +// Creates a new instance of the OperationsDiscoveryCollectionPage type. +func NewOperationsDiscoveryCollectionPage(cur OperationsDiscoveryCollection, getNextPage func(context.Context, OperationsDiscoveryCollection) (OperationsDiscoveryCollection, error)) OperationsDiscoveryCollectionPage { + return OperationsDiscoveryCollectionPage{ + fn: getNextPage, + odc: cur, + } +} + +// OSDetails disk Details. +type OSDetails struct { + // OsType - VM Disk details. + OsType *string `json:"osType,omitempty"` + // ProductType - Product type. + ProductType *string `json:"productType,omitempty"` + // OsEdition - The OSEdition. + OsEdition *string `json:"osEdition,omitempty"` + // OSVersion - The OS Version. + OSVersion *string `json:"oSVersion,omitempty"` + // OSMajorVersion - The OS Major Version. + OSMajorVersion *string `json:"oSMajorVersion,omitempty"` + // OSMinorVersion - The OS Minor Version. + OSMinorVersion *string `json:"oSMinorVersion,omitempty"` +} + +// OSDiskDetails details of the OS Disk. +type OSDiskDetails struct { + // OsVhdID - The id of the disk containing the OS. + OsVhdID *string `json:"osVhdId,omitempty"` + // OsType - The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // VhdName - The OS disk VHD name. + VhdName *string `json:"vhdName,omitempty"` +} + +// OSVersionWrapper wrapper model for OSVersion to include version and service pack info. +type OSVersionWrapper struct { + // Version - The version. + Version *string `json:"version,omitempty"` + // ServicePack - The service pack. + ServicePack *string `json:"servicePack,omitempty"` +} + +// PlannedFailoverInput input definition for planned failover. +type PlannedFailoverInput struct { + // Properties - Planned failover input properties. + Properties *PlannedFailoverInputProperties `json:"properties,omitempty"` +} + +// PlannedFailoverInputProperties input definition for planned failover input properties. +type PlannedFailoverInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicPlannedFailoverProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for PlannedFailoverInputProperties struct. +func (pfip *PlannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + pfip.FailoverDirection = &failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(*v) + if err != nil { + return err + } + pfip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicPlannedFailoverProviderSpecificFailoverInput provider specific failover input. +type BasicPlannedFailoverProviderSpecificFailoverInput interface { + AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) + AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) + AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) + AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) +} + +// PlannedFailoverProviderSpecificFailoverInput provider specific failover input. +type PlannedFailoverProviderSpecificFailoverInput struct { + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(body []byte) (BasicPlannedFailoverProviderSpecificFailoverInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeHyperVReplicaAzureFailback): + var hvrafpi HyperVReplicaAzureFailbackProviderInput + err := json.Unmarshal(body, &hvrafpi) + return hvrafpi, err + case string(InstanceTypeHyperVReplicaAzure): + var hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput + err := json.Unmarshal(body, &hvrapfpi) + return hvrapfpi, err + case string(InstanceTypeInMageRcmFailback): + var imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput + err := json.Unmarshal(body, &imrfpfpi) + return imrfpfpi, err + default: + var pfpsfi PlannedFailoverProviderSpecificFailoverInput + err := json.Unmarshal(body, &pfpsfi) + return pfpsfi, err + } +} +func unmarshalBasicPlannedFailoverProviderSpecificFailoverInputArray(body []byte) ([]BasicPlannedFailoverProviderSpecificFailoverInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pfpsfiArray := make([]BasicPlannedFailoverProviderSpecificFailoverInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pfpsfi, err := unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(*rawMessage) + if err != nil { + return nil, err + } + pfpsfiArray[index] = pfpsfi + } + return pfpsfiArray, nil +} + +// MarshalJSON is the custom marshaler for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) MarshalJSON() ([]byte, error) { + pfpsfi.InstanceType = InstanceTypePlannedFailoverProviderSpecificFailoverInput + objectMap := make(map[string]interface{}) + if pfpsfi.InstanceType != "" { + objectMap["instanceType"] = pfpsfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return &pfpsfi, true +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &pfpsfi, true +} + +// Policy protection profile details. +type Policy struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *PolicyProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Policy. +func (p Policy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.Properties != nil { + objectMap["properties"] = p.Properties + } + if p.Location != nil { + objectMap["location"] = p.Location + } + return json.Marshal(objectMap) +} + +// PolicyCollection protection Profile Collection details. +type PolicyCollection struct { + autorest.Response `json:"-"` + // Value - The policy details. + Value *[]Policy `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// PolicyCollectionIterator provides access to a complete listing of Policy values. +type PolicyCollectionIterator struct { + i int + page PolicyCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PolicyCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PolicyCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PolicyCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PolicyCollectionIterator) Response() PolicyCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PolicyCollectionIterator) Value() Policy { + if !iter.page.NotDone() { + return Policy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PolicyCollectionIterator type. +func NewPolicyCollectionIterator(page PolicyCollectionPage) PolicyCollectionIterator { + return PolicyCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pc PolicyCollection) IsEmpty() bool { + return pc.Value == nil || len(*pc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pc PolicyCollection) hasNextLink() bool { + return pc.NextLink != nil && len(*pc.NextLink) != 0 +} + +// policyCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pc PolicyCollection) policyCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pc.NextLink))) +} + +// PolicyCollectionPage contains a page of Policy values. +type PolicyCollectionPage struct { + fn func(context.Context, PolicyCollection) (PolicyCollection, error) + pc PolicyCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PolicyCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pc) + if err != nil { + return err + } + page.pc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PolicyCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PolicyCollectionPage) NotDone() bool { + return !page.pc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PolicyCollectionPage) Response() PolicyCollection { + return page.pc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PolicyCollectionPage) Values() []Policy { + if page.pc.IsEmpty() { + return nil + } + return *page.pc.Value +} + +// Creates a new instance of the PolicyCollectionPage type. +func NewPolicyCollectionPage(cur PolicyCollection, getNextPage func(context.Context, PolicyCollection) (PolicyCollection, error)) PolicyCollectionPage { + return PolicyCollectionPage{ + fn: getNextPage, + pc: cur, + } +} + +// PolicyProperties protection profile custom data details. +type PolicyProperties struct { + // FriendlyName - The FriendlyName. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProviderSpecificDetails - The ReplicationChannelSetting. + ProviderSpecificDetails BasicPolicyProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for PolicyProperties struct. +func (pp *PolicyProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + pp.FriendlyName = &friendlyName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicPolicyProviderSpecificDetails(*v) + if err != nil { + return err + } + pp.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicPolicyProviderSpecificDetails base class for Provider specific details for policies. +type BasicPolicyProviderSpecificDetails interface { + AsA2APolicyDetails() (*A2APolicyDetails, bool) + AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) + AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) + AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) + AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) + AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) + AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) + AsInMagePolicyDetails() (*InMagePolicyDetails, bool) + AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) + AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) + AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) + AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) +} + +// PolicyProviderSpecificDetails base class for Provider specific details for policies. +type PolicyProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicPolicyProviderSpecificDetails(body []byte) (BasicPolicyProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A): + var apd A2APolicyDetails + err := json.Unmarshal(body, &apd) + return apd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure): + var hvrapd HyperVReplicaAzurePolicyDetails + err := json.Unmarshal(body, &hvrapd) + return hvrapd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails): + var hvrbpd HyperVReplicaBasePolicyDetails + err := json.Unmarshal(body, &hvrbpd) + return hvrbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2): + var hvrbpd HyperVReplicaBluePolicyDetails + err := json.Unmarshal(body, &hvrbpd) + return hvrbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012): + var hvrpd HyperVReplicaPolicyDetails + err := json.Unmarshal(body, &hvrpd) + return hvrpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2): + var imavpd InMageAzureV2PolicyDetails + err := json.Unmarshal(body, &imavpd) + return imavpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails): + var imbpd InMageBasePolicyDetails + err := json.Unmarshal(body, &imbpd) + return imbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage): + var impd InMagePolicyDetails + err := json.Unmarshal(body, &impd) + return impd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback): + var imrfpd InMageRcmFailbackPolicyDetails + err := json.Unmarshal(body, &imrfpd) + return imrfpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm): + var imrpd InMageRcmPolicyDetails + err := json.Unmarshal(body, &imrpd) + return imrpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt): + var vcpd VmwareCbtPolicyDetails + err := json.Unmarshal(body, &vcpd) + return vcpd, err + default: + var ppsd PolicyProviderSpecificDetails + err := json.Unmarshal(body, &ppsd) + return ppsd, err + } +} +func unmarshalBasicPolicyProviderSpecificDetailsArray(body []byte) ([]BasicPolicyProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppsdArray := make([]BasicPolicyProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppsd, err := unmarshalBasicPolicyProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + ppsdArray[index] = ppsd + } + return ppsdArray, nil +} + +// MarshalJSON is the custom marshaler for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) MarshalJSON() ([]byte, error) { + ppsd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails + objectMap := make(map[string]interface{}) + if ppsd.InstanceType != "" { + objectMap["instanceType"] = ppsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return &ppsd, true +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &ppsd, true +} + +// BasicPolicyProviderSpecificInput base class for provider specific input. +type BasicPolicyProviderSpecificInput interface { + AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) + AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) + AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) + AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) + AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) + AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) + AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) + AsInMagePolicyInput() (*InMagePolicyInput, bool) + AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) + AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) + AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) + AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) +} + +// PolicyProviderSpecificInput base class for provider specific input. +type PolicyProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicPolicyProviderSpecificInput(body []byte) (BasicPolicyProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmpci A2ACrossClusterMigrationPolicyCreationInput + err := json.Unmarshal(body, &accmpci) + return accmpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A): + var apci A2APolicyCreationInput + err := json.Unmarshal(body, &apci) + return apci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvrapi HyperVReplicaAzurePolicyInput + err := json.Unmarshal(body, &hvrapi) + return hvrapi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2): + var hvrbpi HyperVReplicaBluePolicyInput + err := json.Unmarshal(body, &hvrbpi) + return hvrbpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012): + var hvrpi HyperVReplicaPolicyInput + err := json.Unmarshal(body, &hvrpi) + return hvrpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2): + var imavpi InMageAzureV2PolicyInput + err := json.Unmarshal(body, &imavpi) + return imavpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage): + var impi InMagePolicyInput + err := json.Unmarshal(body, &impi) + return impi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback): + var imrfpci InMageRcmFailbackPolicyCreationInput + err := json.Unmarshal(body, &imrfpci) + return imrfpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm): + var imrpci InMageRcmPolicyCreationInput + err := json.Unmarshal(body, &imrpci) + return imrpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt): + var vmcpci VMwareCbtPolicyCreationInput + err := json.Unmarshal(body, &vmcpci) + return vmcpci, err + default: + var ppsi PolicyProviderSpecificInput + err := json.Unmarshal(body, &ppsi) + return ppsi, err + } +} +func unmarshalBasicPolicyProviderSpecificInputArray(body []byte) ([]BasicPolicyProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppsiArray := make([]BasicPolicyProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppsi, err := unmarshalBasicPolicyProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + ppsiArray[index] = ppsi + } + return ppsiArray, nil +} + +// MarshalJSON is the custom marshaler for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) MarshalJSON() ([]byte, error) { + ppsi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput + objectMap := make(map[string]interface{}) + if ppsi.InstanceType != "" { + objectMap["instanceType"] = ppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return &ppsi, true +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &ppsi, true +} + +// ProcessServer details of the Process Server. +type ProcessServer struct { + // FriendlyName - The Process Server's friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ID - The Process Server Id. + ID *string `json:"id,omitempty"` + // IPAddress - The IP address of the server. + IPAddress *string `json:"ipAddress,omitempty"` + // OsType - The OS type of the server. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The version of the scout component on the server. + AgentVersion *string `json:"agentVersion,omitempty"` + // LastHeartbeat - The last heartbeat received from the server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // MobilityServiceUpdates - The list of the mobility service updates available on the Process Server. + MobilityServiceUpdates *[]MobilityServiceUpdate `json:"mobilityServiceUpdates,omitempty"` + // HostID - The agent generated Id. + HostID *string `json:"hostId,omitempty"` + // MachineCount - The servers configured with this PS. + MachineCount *string `json:"machineCount,omitempty"` + // ReplicationPairCount - The number of replication pairs configured in this PS. + ReplicationPairCount *string `json:"replicationPairCount,omitempty"` + // SystemLoad - The percentage of the system load. + SystemLoad *string `json:"systemLoad,omitempty"` + // SystemLoadStatus - The system load status. + SystemLoadStatus *string `json:"systemLoadStatus,omitempty"` + // CPULoad - The percentage of the CPU load. + CPULoad *string `json:"cpuLoad,omitempty"` + // CPULoadStatus - The CPU load status. + CPULoadStatus *string `json:"cpuLoadStatus,omitempty"` + // TotalMemoryInBytes - The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // MemoryUsageStatus - The memory usage status. + MemoryUsageStatus *string `json:"memoryUsageStatus,omitempty"` + // TotalSpaceInBytes - The total space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - The available space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // SpaceUsageStatus - The space usage status. + SpaceUsageStatus *string `json:"spaceUsageStatus,omitempty"` + // PsServiceStatus - The PS service status. + PsServiceStatus *string `json:"psServiceStatus,omitempty"` + // SslCertExpiryDate - The PS SSL cert expiry date. + SslCertExpiryDate *date.Time `json:"sslCertExpiryDate,omitempty"` + // SslCertExpiryRemainingDays - CS SSL cert expiry date. + SslCertExpiryRemainingDays *int32 `json:"sslCertExpiryRemainingDays,omitempty"` + // OsVersion - OS Version of the process server. Note: This will get populated if user has CS version greater than 9.12.0.0. + OsVersion *string `json:"osVersion,omitempty"` + // HealthErrors - Health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // AgentVersionDetails - The agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // Health - READ-ONLY; The health of Process Server. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // PsStatsRefreshTime - READ-ONLY; The process server stats refresh time. + PsStatsRefreshTime *date.Time `json:"psStatsRefreshTime,omitempty"` + // ThroughputUploadPendingDataInBytes - READ-ONLY; The uploading pending data in bytes. + ThroughputUploadPendingDataInBytes *int64 `json:"throughputUploadPendingDataInBytes,omitempty"` + // ThroughputInMBps - READ-ONLY; The throughput in MBps. + ThroughputInMBps *int64 `json:"throughputInMBps,omitempty"` + // ThroughputInBytes - READ-ONLY; The throughput in bytes. + ThroughputInBytes *int64 `json:"throughputInBytes,omitempty"` + // ThroughputStatus - READ-ONLY; The throughput status. + ThroughputStatus *string `json:"throughputStatus,omitempty"` + // MarsCommunicationStatus - READ-ONLY; The MARS communication status. + MarsCommunicationStatus *string `json:"marsCommunicationStatus,omitempty"` + // MarsRegistrationStatus - READ-ONLY; The MARS registration status. + MarsRegistrationStatus *string `json:"marsRegistrationStatus,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessServer. +func (ps ProcessServer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ps.FriendlyName != nil { + objectMap["friendlyName"] = ps.FriendlyName + } + if ps.ID != nil { + objectMap["id"] = ps.ID + } + if ps.IPAddress != nil { + objectMap["ipAddress"] = ps.IPAddress + } + if ps.OsType != nil { + objectMap["osType"] = ps.OsType + } + if ps.AgentVersion != nil { + objectMap["agentVersion"] = ps.AgentVersion + } + if ps.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = ps.LastHeartbeat + } + if ps.VersionStatus != nil { + objectMap["versionStatus"] = ps.VersionStatus + } + if ps.MobilityServiceUpdates != nil { + objectMap["mobilityServiceUpdates"] = ps.MobilityServiceUpdates + } + if ps.HostID != nil { + objectMap["hostId"] = ps.HostID + } + if ps.MachineCount != nil { + objectMap["machineCount"] = ps.MachineCount + } + if ps.ReplicationPairCount != nil { + objectMap["replicationPairCount"] = ps.ReplicationPairCount + } + if ps.SystemLoad != nil { + objectMap["systemLoad"] = ps.SystemLoad + } + if ps.SystemLoadStatus != nil { + objectMap["systemLoadStatus"] = ps.SystemLoadStatus + } + if ps.CPULoad != nil { + objectMap["cpuLoad"] = ps.CPULoad + } + if ps.CPULoadStatus != nil { + objectMap["cpuLoadStatus"] = ps.CPULoadStatus + } + if ps.TotalMemoryInBytes != nil { + objectMap["totalMemoryInBytes"] = ps.TotalMemoryInBytes + } + if ps.AvailableMemoryInBytes != nil { + objectMap["availableMemoryInBytes"] = ps.AvailableMemoryInBytes + } + if ps.MemoryUsageStatus != nil { + objectMap["memoryUsageStatus"] = ps.MemoryUsageStatus + } + if ps.TotalSpaceInBytes != nil { + objectMap["totalSpaceInBytes"] = ps.TotalSpaceInBytes + } + if ps.AvailableSpaceInBytes != nil { + objectMap["availableSpaceInBytes"] = ps.AvailableSpaceInBytes + } + if ps.SpaceUsageStatus != nil { + objectMap["spaceUsageStatus"] = ps.SpaceUsageStatus + } + if ps.PsServiceStatus != nil { + objectMap["psServiceStatus"] = ps.PsServiceStatus + } + if ps.SslCertExpiryDate != nil { + objectMap["sslCertExpiryDate"] = ps.SslCertExpiryDate + } + if ps.SslCertExpiryRemainingDays != nil { + objectMap["sslCertExpiryRemainingDays"] = ps.SslCertExpiryRemainingDays + } + if ps.OsVersion != nil { + objectMap["osVersion"] = ps.OsVersion + } + if ps.HealthErrors != nil { + objectMap["healthErrors"] = ps.HealthErrors + } + if ps.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = ps.AgentExpiryDate + } + if ps.AgentVersionDetails != nil { + objectMap["agentVersionDetails"] = ps.AgentVersionDetails + } + return json.Marshal(objectMap) +} + +// ProcessServerDetails process server details. +type ProcessServerDetails struct { + // ID - READ-ONLY; The process server Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The process server name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The process server Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The process server Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // IPAddresses - READ-ONLY; The list of IP addresses for communicating with the RCM component. + IPAddresses *[]string `json:"ipAddresses,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the process server. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // TotalMemoryInBytes - READ-ONLY; The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - READ-ONLY; The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // UsedMemoryInBytes - READ-ONLY; The used memory. + UsedMemoryInBytes *int64 `json:"usedMemoryInBytes,omitempty"` + // MemoryUsagePercentage - READ-ONLY; The memory usage percentage. + MemoryUsagePercentage *float64 `json:"memoryUsagePercentage,omitempty"` + // TotalSpaceInBytes - READ-ONLY; The total disk space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - READ-ONLY; The available disk space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // UsedSpaceInBytes - READ-ONLY; The used disk space. + UsedSpaceInBytes *int64 `json:"usedSpaceInBytes,omitempty"` + // FreeSpacePercentage - READ-ONLY; The free disk space percentage. + FreeSpacePercentage *float64 `json:"freeSpacePercentage,omitempty"` + // ThroughputUploadPendingDataInBytes - READ-ONLY; The uploading pending data in bytes. + ThroughputUploadPendingDataInBytes *int64 `json:"throughputUploadPendingDataInBytes,omitempty"` + // ThroughputInBytes - READ-ONLY; The throughput in bytes. + ThroughputInBytes *int64 `json:"throughputInBytes,omitempty"` + // ProcessorUsagePercentage - READ-ONLY; The processor usage percentage. + ProcessorUsagePercentage *float64 `json:"processorUsagePercentage,omitempty"` + // ThroughputStatus - READ-ONLY; The throughput status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + ThroughputStatus RcmComponentStatus `json:"throughputStatus,omitempty"` + // SystemLoad - READ-ONLY; The system load. + SystemLoad *int64 `json:"systemLoad,omitempty"` + // SystemLoadStatus - READ-ONLY; The system load status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + SystemLoadStatus RcmComponentStatus `json:"systemLoadStatus,omitempty"` + // DiskUsageStatus - READ-ONLY; The disk usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + DiskUsageStatus RcmComponentStatus `json:"diskUsageStatus,omitempty"` + // MemoryUsageStatus - READ-ONLY; The memory usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + MemoryUsageStatus RcmComponentStatus `json:"memoryUsageStatus,omitempty"` + // ProcessorUsageStatus - READ-ONLY; The processor usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + ProcessorUsageStatus RcmComponentStatus `json:"processorUsageStatus,omitempty"` + // Health - READ-ONLY; The health of the process server. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // ProtectedItemCount - READ-ONLY; The protected item count. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // HistoricHealth - READ-ONLY; The historic health of the process server based on the health in last 24 hours. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + HistoricHealth ProtectionHealth `json:"historicHealth,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessServerDetails. +func (psd ProcessServerDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ProtectableItem replication protected item. +type ProtectableItem struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectableItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectableItem. +func (pi ProtectableItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pi.Properties != nil { + objectMap["properties"] = pi.Properties + } + if pi.Location != nil { + objectMap["location"] = pi.Location + } + return json.Marshal(objectMap) +} + +// ProtectableItemCollection protectable item collection. +type ProtectableItemCollection struct { + autorest.Response `json:"-"` + // Value - The Protectable item details. + Value *[]ProtectableItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectableItemCollectionIterator provides access to a complete listing of ProtectableItem values. +type ProtectableItemCollectionIterator struct { + i int + page ProtectableItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectableItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectableItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectableItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectableItemCollectionIterator) Response() ProtectableItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectableItemCollectionIterator) Value() ProtectableItem { + if !iter.page.NotDone() { + return ProtectableItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectableItemCollectionIterator type. +func NewProtectableItemCollectionIterator(page ProtectableItemCollectionPage) ProtectableItemCollectionIterator { + return ProtectableItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pic ProtectableItemCollection) IsEmpty() bool { + return pic.Value == nil || len(*pic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pic ProtectableItemCollection) hasNextLink() bool { + return pic.NextLink != nil && len(*pic.NextLink) != 0 +} + +// protectableItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pic ProtectableItemCollection) protectableItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pic.NextLink))) +} + +// ProtectableItemCollectionPage contains a page of ProtectableItem values. +type ProtectableItemCollectionPage struct { + fn func(context.Context, ProtectableItemCollection) (ProtectableItemCollection, error) + pic ProtectableItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectableItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pic) + if err != nil { + return err + } + page.pic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectableItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectableItemCollectionPage) NotDone() bool { + return !page.pic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectableItemCollectionPage) Response() ProtectableItemCollection { + return page.pic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectableItemCollectionPage) Values() []ProtectableItem { + if page.pic.IsEmpty() { + return nil + } + return *page.pic.Value +} + +// Creates a new instance of the ProtectableItemCollectionPage type. +func NewProtectableItemCollectionPage(cur ProtectableItemCollection, getNextPage func(context.Context, ProtectableItemCollection) (ProtectableItemCollection, error)) ProtectableItemCollectionPage { + return ProtectableItemCollectionPage{ + fn: getNextPage, + pic: cur, + } +} + +// ProtectableItemProperties replication protected item custom data details. +type ProtectableItemProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionStatus - The protection status. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ReplicationProtectedItemID - The ARM resource of protected items. + ReplicationProtectedItemID *string `json:"replicationProtectedItemId,omitempty"` + // RecoveryServicesProviderID - The recovery provider ARM Id. + RecoveryServicesProviderID *string `json:"recoveryServicesProviderId,omitempty"` + // ProtectionReadinessErrors - The Current protection readiness errors. + ProtectionReadinessErrors *[]string `json:"protectionReadinessErrors,omitempty"` + // SupportedReplicationProviders - The list of replication providers supported for the protectable item. + SupportedReplicationProviders *[]string `json:"supportedReplicationProviders,omitempty"` + // CustomDetails - The Replication provider custom settings. + CustomDetails BasicConfigurationSettings `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ProtectableItemProperties struct. +func (pip *ProtectableItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + pip.FriendlyName = &friendlyName + } + case "protectionStatus": + if v != nil { + var protectionStatus string + err = json.Unmarshal(*v, &protectionStatus) + if err != nil { + return err + } + pip.ProtectionStatus = &protectionStatus + } + case "replicationProtectedItemId": + if v != nil { + var replicationProtectedItemID string + err = json.Unmarshal(*v, &replicationProtectedItemID) + if err != nil { + return err + } + pip.ReplicationProtectedItemID = &replicationProtectedItemID + } + case "recoveryServicesProviderId": + if v != nil { + var recoveryServicesProviderID string + err = json.Unmarshal(*v, &recoveryServicesProviderID) + if err != nil { + return err + } + pip.RecoveryServicesProviderID = &recoveryServicesProviderID + } + case "protectionReadinessErrors": + if v != nil { + var protectionReadinessErrors []string + err = json.Unmarshal(*v, &protectionReadinessErrors) + if err != nil { + return err + } + pip.ProtectionReadinessErrors = &protectionReadinessErrors + } + case "supportedReplicationProviders": + if v != nil { + var supportedReplicationProviders []string + err = json.Unmarshal(*v, &supportedReplicationProviders) + if err != nil { + return err + } + pip.SupportedReplicationProviders = &supportedReplicationProviders + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicConfigurationSettings(*v) + if err != nil { + return err + } + pip.CustomDetails = customDetails + } + } + } + + return nil +} + +// ProtectableItemQueryParameter query parameter to enumerate Protectable items. +type ProtectableItemQueryParameter struct { + // State - State of the Protectable item query filter. + State *string `json:"state,omitempty"` +} + +// ProtectedItemsQueryParameter query parameter to enumerate protected items. +type ProtectedItemsQueryParameter struct { + // SourceFabricName - The source fabric name filter. + SourceFabricName *string `json:"sourceFabricName,omitempty"` + // RecoveryPlanName - The recovery plan filter. + RecoveryPlanName *string `json:"recoveryPlanName,omitempty"` + // SourceFabricLocation - The source fabric location filter. + SourceFabricLocation *string `json:"sourceFabricLocation,omitempty"` + // FabricObjectID - The fabric object Id filter. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // VCenterName - The vCenter name filter. + VCenterName *string `json:"vCenterName,omitempty"` + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` + // MultiVMGroupCreateOption - Whether Multi VM group is auto created or specified by user. Possible values include: 'AutoCreated', 'UserSpecified' + MultiVMGroupCreateOption MultiVMGroupCreateOption `json:"multiVmGroupCreateOption,omitempty"` + // ProcessServerID - The process server Id filter. + ProcessServerID *string `json:"processServerId,omitempty"` +} + +// ProtectionContainer protection container details. +type ProtectionContainer struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectionContainerProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainer. +func (pc ProtectionContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pc.Properties != nil { + objectMap["properties"] = pc.Properties + } + if pc.Location != nil { + objectMap["location"] = pc.Location + } + return json.Marshal(objectMap) +} + +// ProtectionContainerCollection protection Container collection. +type ProtectionContainerCollection struct { + autorest.Response `json:"-"` + // Value - The Protection Container details. + Value *[]ProtectionContainer `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectionContainerCollectionIterator provides access to a complete listing of ProtectionContainer +// values. +type ProtectionContainerCollectionIterator struct { + i int + page ProtectionContainerCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectionContainerCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionContainerCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionContainerCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectionContainerCollectionIterator) Response() ProtectionContainerCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectionContainerCollectionIterator) Value() ProtectionContainer { + if !iter.page.NotDone() { + return ProtectionContainer{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectionContainerCollectionIterator type. +func NewProtectionContainerCollectionIterator(page ProtectionContainerCollectionPage) ProtectionContainerCollectionIterator { + return ProtectionContainerCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcc ProtectionContainerCollection) IsEmpty() bool { + return pcc.Value == nil || len(*pcc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pcc ProtectionContainerCollection) hasNextLink() bool { + return pcc.NextLink != nil && len(*pcc.NextLink) != 0 +} + +// protectionContainerCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcc ProtectionContainerCollection) protectionContainerCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pcc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcc.NextLink))) +} + +// ProtectionContainerCollectionPage contains a page of ProtectionContainer values. +type ProtectionContainerCollectionPage struct { + fn func(context.Context, ProtectionContainerCollection) (ProtectionContainerCollection, error) + pcc ProtectionContainerCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectionContainerCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pcc) + if err != nil { + return err + } + page.pcc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionContainerCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionContainerCollectionPage) NotDone() bool { + return !page.pcc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionContainerCollectionPage) Response() ProtectionContainerCollection { + return page.pcc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionContainerCollectionPage) Values() []ProtectionContainer { + if page.pcc.IsEmpty() { + return nil + } + return *page.pcc.Value +} + +// Creates a new instance of the ProtectionContainerCollectionPage type. +func NewProtectionContainerCollectionPage(cur ProtectionContainerCollection, getNextPage func(context.Context, ProtectionContainerCollection) (ProtectionContainerCollection, error)) ProtectionContainerCollectionPage { + return ProtectionContainerCollectionPage{ + fn: getNextPage, + pcc: cur, + } +} + +// ProtectionContainerFabricSpecificDetails base class for fabric specific details of container. +type ProtectionContainerFabricSpecificDetails struct { + // InstanceType - READ-ONLY; Gets the class type. Overridden in derived classes. + InstanceType *string `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainerFabricSpecificDetails. +func (pcfsd ProtectionContainerFabricSpecificDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ProtectionContainerMapping protection container mapping object. +type ProtectionContainerMapping struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectionContainerMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainerMapping. +func (pcm ProtectionContainerMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pcm.Properties != nil { + objectMap["properties"] = pcm.Properties + } + if pcm.Location != nil { + objectMap["location"] = pcm.Location + } + return json.Marshal(objectMap) +} + +// ProtectionContainerMappingCollection protection container mapping collection class. +type ProtectionContainerMappingCollection struct { + autorest.Response `json:"-"` + // Value - List of container mappings. + Value *[]ProtectionContainerMapping `json:"value,omitempty"` + // NextLink - Link to fetch rest of the data. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectionContainerMappingCollectionIterator provides access to a complete listing of +// ProtectionContainerMapping values. +type ProtectionContainerMappingCollectionIterator struct { + i int + page ProtectionContainerMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectionContainerMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionContainerMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionContainerMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectionContainerMappingCollectionIterator) Response() ProtectionContainerMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectionContainerMappingCollectionIterator) Value() ProtectionContainerMapping { + if !iter.page.NotDone() { + return ProtectionContainerMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectionContainerMappingCollectionIterator type. +func NewProtectionContainerMappingCollectionIterator(page ProtectionContainerMappingCollectionPage) ProtectionContainerMappingCollectionIterator { + return ProtectionContainerMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcmc ProtectionContainerMappingCollection) IsEmpty() bool { + return pcmc.Value == nil || len(*pcmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pcmc ProtectionContainerMappingCollection) hasNextLink() bool { + return pcmc.NextLink != nil && len(*pcmc.NextLink) != 0 +} + +// protectionContainerMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcmc ProtectionContainerMappingCollection) protectionContainerMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pcmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcmc.NextLink))) +} + +// ProtectionContainerMappingCollectionPage contains a page of ProtectionContainerMapping values. +type ProtectionContainerMappingCollectionPage struct { + fn func(context.Context, ProtectionContainerMappingCollection) (ProtectionContainerMappingCollection, error) + pcmc ProtectionContainerMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectionContainerMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pcmc) + if err != nil { + return err + } + page.pcmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionContainerMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionContainerMappingCollectionPage) NotDone() bool { + return !page.pcmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionContainerMappingCollectionPage) Response() ProtectionContainerMappingCollection { + return page.pcmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionContainerMappingCollectionPage) Values() []ProtectionContainerMapping { + if page.pcmc.IsEmpty() { + return nil + } + return *page.pcmc.Value +} + +// Creates a new instance of the ProtectionContainerMappingCollectionPage type. +func NewProtectionContainerMappingCollectionPage(cur ProtectionContainerMappingCollection, getNextPage func(context.Context, ProtectionContainerMappingCollection) (ProtectionContainerMappingCollection, error)) ProtectionContainerMappingCollectionPage { + return ProtectionContainerMappingCollectionPage{ + fn: getNextPage, + pcmc: cur, + } +} + +// ProtectionContainerMappingProperties protection container mapping properties. +type ProtectionContainerMappingProperties struct { + // TargetProtectionContainerID - Paired protection container ARM ID. + TargetProtectionContainerID *string `json:"targetProtectionContainerId,omitempty"` + // TargetProtectionContainerFriendlyName - Friendly name of paired container. + TargetProtectionContainerFriendlyName *string `json:"targetProtectionContainerFriendlyName,omitempty"` + // ProviderSpecificDetails - Provider specific provider details. + ProviderSpecificDetails BasicProtectionContainerMappingProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` + // Health - Health of pairing. + Health *string `json:"health,omitempty"` + // HealthErrorDetails - Health error. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // PolicyID - Policy ARM Id. + PolicyID *string `json:"policyId,omitempty"` + // State - Association Status. + State *string `json:"state,omitempty"` + // SourceProtectionContainerFriendlyName - Friendly name of source protection container. + SourceProtectionContainerFriendlyName *string `json:"sourceProtectionContainerFriendlyName,omitempty"` + // SourceFabricFriendlyName - Friendly name of source fabric. + SourceFabricFriendlyName *string `json:"sourceFabricFriendlyName,omitempty"` + // TargetFabricFriendlyName - Friendly name of target fabric. + TargetFabricFriendlyName *string `json:"targetFabricFriendlyName,omitempty"` + // PolicyFriendlyName - Friendly name of replication policy. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ProtectionContainerMappingProperties struct. +func (pcmp *ProtectionContainerMappingProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetProtectionContainerId": + if v != nil { + var targetProtectionContainerID string + err = json.Unmarshal(*v, &targetProtectionContainerID) + if err != nil { + return err + } + pcmp.TargetProtectionContainerID = &targetProtectionContainerID + } + case "targetProtectionContainerFriendlyName": + if v != nil { + var targetProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &targetProtectionContainerFriendlyName) + if err != nil { + return err + } + pcmp.TargetProtectionContainerFriendlyName = &targetProtectionContainerFriendlyName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicProtectionContainerMappingProviderSpecificDetails(*v) + if err != nil { + return err + } + pcmp.ProviderSpecificDetails = providerSpecificDetails + } + case "health": + if v != nil { + var health string + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + pcmp.Health = &health + } + case "healthErrorDetails": + if v != nil { + var healthErrorDetails []HealthError + err = json.Unmarshal(*v, &healthErrorDetails) + if err != nil { + return err + } + pcmp.HealthErrorDetails = &healthErrorDetails + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + pcmp.PolicyID = &policyID + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + pcmp.State = &state + } + case "sourceProtectionContainerFriendlyName": + if v != nil { + var sourceProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &sourceProtectionContainerFriendlyName) + if err != nil { + return err + } + pcmp.SourceProtectionContainerFriendlyName = &sourceProtectionContainerFriendlyName + } + case "sourceFabricFriendlyName": + if v != nil { + var sourceFabricFriendlyName string + err = json.Unmarshal(*v, &sourceFabricFriendlyName) + if err != nil { + return err + } + pcmp.SourceFabricFriendlyName = &sourceFabricFriendlyName + } + case "targetFabricFriendlyName": + if v != nil { + var targetFabricFriendlyName string + err = json.Unmarshal(*v, &targetFabricFriendlyName) + if err != nil { + return err + } + pcmp.TargetFabricFriendlyName = &targetFabricFriendlyName + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + pcmp.PolicyFriendlyName = &policyFriendlyName + } + } + } + + return nil +} + +// BasicProtectionContainerMappingProviderSpecificDetails container mapping provider specific details. +type BasicProtectionContainerMappingProviderSpecificDetails interface { + AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) + AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) + AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) + AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) +} + +// ProtectionContainerMappingProviderSpecificDetails container mapping provider specific details. +type ProtectionContainerMappingProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicProtectionContainerMappingProviderSpecificDetails(body []byte) (BasicProtectionContainerMappingProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A): + var apcmd A2AProtectionContainerMappingDetails + err := json.Unmarshal(body, &apcmd) + return apcmd, err + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm): + var imrpcmd InMageRcmProtectionContainerMappingDetails + err := json.Unmarshal(body, &imrpcmd) + return imrpcmd, err + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt): + var vmcpcmd VMwareCbtProtectionContainerMappingDetails + err := json.Unmarshal(body, &vmcpcmd) + return vmcpcmd, err + default: + var pcmpsd ProtectionContainerMappingProviderSpecificDetails + err := json.Unmarshal(body, &pcmpsd) + return pcmpsd, err + } +} +func unmarshalBasicProtectionContainerMappingProviderSpecificDetailsArray(body []byte) ([]BasicProtectionContainerMappingProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pcmpsdArray := make([]BasicProtectionContainerMappingProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pcmpsd, err := unmarshalBasicProtectionContainerMappingProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + pcmpsdArray[index] = pcmpsd + } + return pcmpsdArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) MarshalJSON() ([]byte, error) { + pcmpsd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails + objectMap := make(map[string]interface{}) + if pcmpsd.InstanceType != "" { + objectMap["instanceType"] = pcmpsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return &pcmpsd, true +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &pcmpsd, true +} + +// ProtectionContainerProperties protection profile custom data details. +type ProtectionContainerProperties struct { + // FabricFriendlyName - Fabric friendly name. + FabricFriendlyName *string `json:"fabricFriendlyName,omitempty"` + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // FabricType - The fabric type. + FabricType *string `json:"fabricType,omitempty"` + // ProtectedItemCount - Number of protected PEs. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // PairingStatus - The pairing status of this cloud. + PairingStatus *string `json:"pairingStatus,omitempty"` + // Role - The role of this cloud. + Role *string `json:"role,omitempty"` + // FabricSpecificDetails - Fabric specific details. + FabricSpecificDetails *ProtectionContainerFabricSpecificDetails `json:"fabricSpecificDetails,omitempty"` +} + +// BasicProtectionProfileCustomDetails protection Profile custom input. +type BasicProtectionProfileCustomDetails interface { + AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) + AsNewProtectionProfile() (*NewProtectionProfile, bool) + AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) +} + +// ProtectionProfileCustomDetails protection Profile custom input. +type ProtectionProfileCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +func unmarshalBasicProtectionProfileCustomDetails(body []byte) (BasicProtectionProfileCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeExisting): + var epp ExistingProtectionProfile + err := json.Unmarshal(body, &epp) + return epp, err + case string(ResourceTypeNew): + var npp NewProtectionProfile + err := json.Unmarshal(body, &npp) + return npp, err + default: + var ppcd ProtectionProfileCustomDetails + err := json.Unmarshal(body, &ppcd) + return ppcd, err + } +} +func unmarshalBasicProtectionProfileCustomDetailsArray(body []byte) ([]BasicProtectionProfileCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppcdArray := make([]BasicProtectionProfileCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppcd, err := unmarshalBasicProtectionProfileCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + ppcdArray[index] = ppcd + } + return ppcdArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) MarshalJSON() ([]byte, error) { + ppcd.ResourceType = ResourceTypeProtectionProfileCustomDetails + objectMap := make(map[string]interface{}) + if ppcd.ResourceType != "" { + objectMap["resourceType"] = ppcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return nil, false +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return nil, false +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return &ppcd, true +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &ppcd, true +} + +// ProviderError this class contains the error details per object. +type ProviderError struct { + // ErrorCode - The Error code. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorMessage - The Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // ErrorID - The Provider error Id. + ErrorID *string `json:"errorId,omitempty"` + // PossibleCauses - The possible causes for the error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - The recommended action to resolve the error. + RecommendedAction *string `json:"recommendedAction,omitempty"` +} + +// BasicProviderSpecificRecoveryPointDetails replication provider specific recovery point details. +type BasicProviderSpecificRecoveryPointDetails interface { + AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) + AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) + AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) + AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) +} + +// ProviderSpecificRecoveryPointDetails replication provider specific recovery point details. +type ProviderSpecificRecoveryPointDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicProviderSpecificRecoveryPointDetails(body []byte) (BasicProviderSpecificRecoveryPointDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A): + var arpd A2ARecoveryPointDetails + err := json.Unmarshal(body, &arpd) + return arpd, err + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2): + var imavrpd InMageAzureV2RecoveryPointDetails + err := json.Unmarshal(body, &imavrpd) + return imavrpd, err + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm): + var imrrpd InMageRcmRecoveryPointDetails + err := json.Unmarshal(body, &imrrpd) + return imrrpd, err + default: + var psrpd ProviderSpecificRecoveryPointDetails + err := json.Unmarshal(body, &psrpd) + return psrpd, err + } +} +func unmarshalBasicProviderSpecificRecoveryPointDetailsArray(body []byte) ([]BasicProviderSpecificRecoveryPointDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + psrpdArray := make([]BasicProviderSpecificRecoveryPointDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + psrpd, err := unmarshalBasicProviderSpecificRecoveryPointDetails(*rawMessage) + if err != nil { + return nil, err + } + psrpdArray[index] = psrpd + } + return psrpdArray, nil +} + +// MarshalJSON is the custom marshaler for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) MarshalJSON() ([]byte, error) { + psrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails + objectMap := make(map[string]interface{}) + if psrpd.InstanceType != "" { + objectMap["instanceType"] = psrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return &psrpd, true +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &psrpd, true +} + +// PushInstallerDetails push installer details. +type PushInstallerDetails struct { + // ID - READ-ONLY; The push installer Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The push installer name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The push installer Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The push installer Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the push installer. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the push installer. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for PushInstallerDetails. +func (pid PushInstallerDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RcmProxyDetails RCM proxy details. +type RcmProxyDetails struct { + // ID - READ-ONLY; The RCM proxy Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The RCM proxy name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The RCM proxy Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The RCM proxy Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // ClientAuthenticationType - READ-ONLY; The client authentication type. + ClientAuthenticationType *string `json:"clientAuthenticationType,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the RCM proxy. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the RCM proxy. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for RcmProxyDetails. +func (rpd RcmProxyDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// BasicRecoveryAvailabilitySetCustomDetails recovery Availability Set custom input. +type BasicRecoveryAvailabilitySetCustomDetails interface { + AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) + AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) +} + +// RecoveryAvailabilitySetCustomDetails recovery Availability Set custom input. +type RecoveryAvailabilitySetCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails', 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryAvailabilitySetCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryAvailabilitySetCustomDetails(body []byte) (BasicRecoveryAvailabilitySetCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting): + var eras ExistingRecoveryAvailabilitySet + err := json.Unmarshal(body, &eras) + return eras, err + default: + var rascd RecoveryAvailabilitySetCustomDetails + err := json.Unmarshal(body, &rascd) + return rascd, err + } +} +func unmarshalBasicRecoveryAvailabilitySetCustomDetailsArray(body []byte) ([]BasicRecoveryAvailabilitySetCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rascdArray := make([]BasicRecoveryAvailabilitySetCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rascd, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rascdArray[index] = rascd + } + return rascdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) MarshalJSON() ([]byte, error) { + rascd.ResourceType = ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails + objectMap := make(map[string]interface{}) + if rascd.ResourceType != "" { + objectMap["resourceType"] = rascd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryAvailabilitySet is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) { + return nil, false +} + +// AsRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) { + return &rascd, true +} + +// AsBasicRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsBasicRecoveryAvailabilitySetCustomDetails() (BasicRecoveryAvailabilitySetCustomDetails, bool) { + return &rascd, true +} + +// RecoveryPlan recovery plan details. +type RecoveryPlan struct { + autorest.Response `json:"-"` + // Properties - The custom details. + Properties *RecoveryPlanProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlan. +func (rp RecoveryPlan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.Properties != nil { + objectMap["properties"] = rp.Properties + } + if rp.Location != nil { + objectMap["location"] = rp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryPlanA2ADetails recovery plan A2A specific details. +type RecoveryPlanA2ADetails struct { + // PrimaryZone - The primary zone. + PrimaryZone *string `json:"primaryZone,omitempty"` + // RecoveryZone - The recovery zone. + RecoveryZone *string `json:"recoveryZone,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails', 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) MarshalJSON() ([]byte, error) { + rpad.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpad.PrimaryZone != nil { + objectMap["primaryZone"] = rpad.PrimaryZone + } + if rpad.RecoveryZone != nil { + objectMap["recoveryZone"] = rpad.RecoveryZone + } + if rpad.InstanceType != "" { + objectMap["instanceType"] = rpad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2ADetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) { + return &rpad, true +} + +// AsRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsBasicRecoveryPlanProviderSpecificDetails() (BasicRecoveryPlanProviderSpecificDetails, bool) { + return &rpad, true +} + +// RecoveryPlanA2AFailoverInput recovery plan A2A failover input. +type RecoveryPlanA2AFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'Latest', 'LatestApplicationConsistent', 'LatestCrashConsistent', 'LatestProcessed' + RecoveryPointType A2ARpRecoveryPointType `json:"recoveryPointType,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for TFO or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // MultiVMSyncPointOption - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. Possible values include: 'UseMultiVMSyncRecoveryPoint', 'UsePerVMRecoveryPoint' + MultiVMSyncPointOption MultiVMSyncPointOption `json:"multiVmSyncPointOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) MarshalJSON() ([]byte, error) { + rpafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpafi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpafi.RecoveryPointType + } + if rpafi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = rpafi.CloudServiceCreationOption + } + if rpafi.MultiVMSyncPointOption != "" { + objectMap["multiVmSyncPointOption"] = rpafi.MultiVMSyncPointOption + } + if rpafi.InstanceType != "" { + objectMap["instanceType"] = rpafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return &rpafi, true +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpafi, true +} + +// RecoveryPlanA2AInput recovery plan A2A input. +type RecoveryPlanA2AInput struct { + // PrimaryZone - The primary zone. + PrimaryZone *string `json:"primaryZone,omitempty"` + // RecoveryZone - The recovery zone. + RecoveryZone *string `json:"recoveryZone,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) MarshalJSON() ([]byte, error) { + rpai.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpai.PrimaryZone != nil { + objectMap["primaryZone"] = rpai.PrimaryZone + } + if rpai.RecoveryZone != nil { + objectMap["recoveryZone"] = rpai.RecoveryZone + } + if rpai.InstanceType != "" { + objectMap["instanceType"] = rpai.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) { + return &rpai, true +} + +// AsRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsBasicRecoveryPlanProviderSpecificInput() (BasicRecoveryPlanProviderSpecificInput, bool) { + return &rpai, true +} + +// RecoveryPlanAction recovery plan action details. +type RecoveryPlanAction struct { + // ActionName - The action name. + ActionName *string `json:"actionName,omitempty"` + // FailoverTypes - The list of failover types. + FailoverTypes *[]ReplicationProtectedItemOperation `json:"failoverTypes,omitempty"` + // FailoverDirections - The list of failover directions. + FailoverDirections *[]PossibleOperationsDirections `json:"failoverDirections,omitempty"` + // CustomDetails - The custom details. + CustomDetails BasicRecoveryPlanActionDetails `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanAction struct. +func (rpa *RecoveryPlanAction) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "actionName": + if v != nil { + var actionName string + err = json.Unmarshal(*v, &actionName) + if err != nil { + return err + } + rpa.ActionName = &actionName + } + case "failoverTypes": + if v != nil { + var failoverTypes []ReplicationProtectedItemOperation + err = json.Unmarshal(*v, &failoverTypes) + if err != nil { + return err + } + rpa.FailoverTypes = &failoverTypes + } + case "failoverDirections": + if v != nil { + var failoverDirections []PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirections) + if err != nil { + return err + } + rpa.FailoverDirections = &failoverDirections + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicRecoveryPlanActionDetails(*v) + if err != nil { + return err + } + rpa.CustomDetails = customDetails + } + } + } + + return nil +} + +// BasicRecoveryPlanActionDetails recovery plan action custom details. +type BasicRecoveryPlanActionDetails interface { + AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) + AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) + AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) + AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) +} + +// RecoveryPlanActionDetails recovery plan action custom details. +type RecoveryPlanActionDetails struct { + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanActionDetails(body []byte) (BasicRecoveryPlanActionDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAutomationRunbookActionDetails): + var rparad RecoveryPlanAutomationRunbookActionDetails + err := json.Unmarshal(body, &rparad) + return rparad, err + case string(InstanceTypeManualActionDetails): + var rpmad RecoveryPlanManualActionDetails + err := json.Unmarshal(body, &rpmad) + return rpmad, err + case string(InstanceTypeScriptActionDetails): + var rpsad RecoveryPlanScriptActionDetails + err := json.Unmarshal(body, &rpsad) + return rpsad, err + default: + var rpad RecoveryPlanActionDetails + err := json.Unmarshal(body, &rpad) + return rpad, err + } +} +func unmarshalBasicRecoveryPlanActionDetailsArray(body []byte) ([]BasicRecoveryPlanActionDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpadArray := make([]BasicRecoveryPlanActionDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpad, err := unmarshalBasicRecoveryPlanActionDetails(*rawMessage) + if err != nil { + return nil, err + } + rpadArray[index] = rpad + } + return rpadArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) MarshalJSON() ([]byte, error) { + rpad.InstanceType = InstanceTypeRecoveryPlanActionDetails + objectMap := make(map[string]interface{}) + if rpad.InstanceType != "" { + objectMap["instanceType"] = rpad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return &rpad, true +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpad, true +} + +// RecoveryPlanAutomationRunbookActionDetails recovery plan Automation runbook action details. +type RecoveryPlanAutomationRunbookActionDetails struct { + // RunbookID - The runbook ARM Id. + RunbookID *string `json:"runbookId,omitempty"` + // Timeout - The runbook timeout. + Timeout *string `json:"timeout,omitempty"` + // FabricLocation - The fabric location. Possible values include: 'Primary', 'Recovery' + FabricLocation RecoveryPlanActionLocation `json:"fabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) MarshalJSON() ([]byte, error) { + rparad.InstanceType = InstanceTypeAutomationRunbookActionDetails + objectMap := make(map[string]interface{}) + if rparad.RunbookID != nil { + objectMap["runbookId"] = rparad.RunbookID + } + if rparad.Timeout != nil { + objectMap["timeout"] = rparad.Timeout + } + if rparad.FabricLocation != "" { + objectMap["fabricLocation"] = rparad.FabricLocation + } + if rparad.InstanceType != "" { + objectMap["instanceType"] = rparad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return &rparad, true +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rparad, true +} + +// RecoveryPlanCollection recovery plan collection details. +type RecoveryPlanCollection struct { + autorest.Response `json:"-"` + // Value - The list of recovery plans. + Value *[]RecoveryPlan `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryPlanCollectionIterator provides access to a complete listing of RecoveryPlan values. +type RecoveryPlanCollectionIterator struct { + i int + page RecoveryPlanCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryPlanCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPlanCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryPlanCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryPlanCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryPlanCollectionIterator) Response() RecoveryPlanCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryPlanCollectionIterator) Value() RecoveryPlan { + if !iter.page.NotDone() { + return RecoveryPlan{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryPlanCollectionIterator type. +func NewRecoveryPlanCollectionIterator(page RecoveryPlanCollectionPage) RecoveryPlanCollectionIterator { + return RecoveryPlanCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (RPCVar RecoveryPlanCollection) IsEmpty() bool { + return RPCVar.Value == nil || len(*RPCVar.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (RPCVar RecoveryPlanCollection) hasNextLink() bool { + return RPCVar.NextLink != nil && len(*RPCVar.NextLink) != 0 +} + +// recoveryPlanCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (RPCVar RecoveryPlanCollection) recoveryPlanCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !RPCVar.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(RPCVar.NextLink))) +} + +// RecoveryPlanCollectionPage contains a page of RecoveryPlan values. +type RecoveryPlanCollectionPage struct { + fn func(context.Context, RecoveryPlanCollection) (RecoveryPlanCollection, error) + RPCVar RecoveryPlanCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryPlanCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPlanCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.RPCVar) + if err != nil { + return err + } + page.RPCVar = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryPlanCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryPlanCollectionPage) NotDone() bool { + return !page.RPCVar.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryPlanCollectionPage) Response() RecoveryPlanCollection { + return page.RPCVar +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryPlanCollectionPage) Values() []RecoveryPlan { + if page.RPCVar.IsEmpty() { + return nil + } + return *page.RPCVar.Value +} + +// Creates a new instance of the RecoveryPlanCollectionPage type. +func NewRecoveryPlanCollectionPage(cur RecoveryPlanCollection, getNextPage func(context.Context, RecoveryPlanCollection) (RecoveryPlanCollection, error)) RecoveryPlanCollectionPage { + return RecoveryPlanCollectionPage{ + fn: getNextPage, + RPCVar: cur, + } +} + +// RecoveryPlanGroup recovery plan group details. +type RecoveryPlanGroup struct { + // GroupType - The group type. Possible values include: 'Shutdown', 'Boot', 'Failover' + GroupType RecoveryPlanGroupType `json:"groupType,omitempty"` + // ReplicationProtectedItems - The list of protected items. + ReplicationProtectedItems *[]RecoveryPlanProtectedItem `json:"replicationProtectedItems,omitempty"` + // StartGroupActions - The start group actions. + StartGroupActions *[]RecoveryPlanAction `json:"startGroupActions,omitempty"` + // EndGroupActions - The end group actions. + EndGroupActions *[]RecoveryPlanAction `json:"endGroupActions,omitempty"` +} + +// BasicRecoveryPlanGroupTaskDetails this class represents the recovery plan group task. +type BasicRecoveryPlanGroupTaskDetails interface { + AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) + AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) +} + +// RecoveryPlanGroupTaskDetails this class represents the recovery plan group task. +type RecoveryPlanGroupTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // GroupID - The group identifier. + GroupID *string `json:"groupId,omitempty"` + // RpGroupType - The group type. + RpGroupType *string `json:"rpGroupType,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanGroupTaskDetails(body []byte) (BasicRecoveryPlanGroupTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeRecoveryPlanShutdownGroupTaskDetails): + var rpsgtd RecoveryPlanShutdownGroupTaskDetails + err := json.Unmarshal(body, &rpsgtd) + return rpsgtd, err + default: + var rpgtd RecoveryPlanGroupTaskDetails + err := json.Unmarshal(body, &rpgtd) + return rpgtd, err + } +} +func unmarshalBasicRecoveryPlanGroupTaskDetailsArray(body []byte) ([]BasicRecoveryPlanGroupTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpgtdArray := make([]BasicRecoveryPlanGroupTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpgtd, err := unmarshalBasicRecoveryPlanGroupTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + rpgtdArray[index] = rpgtd + } + return rpgtdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) MarshalJSON() ([]byte, error) { + rpgtd.InstanceType = InstanceTypeRecoveryPlanGroupTaskDetails + objectMap := make(map[string]interface{}) + if rpgtd.Name != nil { + objectMap["name"] = rpgtd.Name + } + if rpgtd.GroupID != nil { + objectMap["groupId"] = rpgtd.GroupID + } + if rpgtd.RpGroupType != nil { + objectMap["rpGroupType"] = rpgtd.RpGroupType + } + if rpgtd.ChildTasks != nil { + objectMap["childTasks"] = rpgtd.ChildTasks + } + if rpgtd.InstanceType != "" { + objectMap["instanceType"] = rpgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return &rpgtd, true +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return &rpgtd, true +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &rpgtd, true +} + +// RecoveryPlanHyperVReplicaAzureFailbackInput recovery plan HVR Azure failback input. +type RecoveryPlanHyperVReplicaAzureFailbackInput struct { + // DataSyncOption - The data sync option. Possible values include: 'ForDownTime', 'ForSynchronization' + DataSyncOption DataSyncStatus `json:"dataSyncOption,omitempty"` + // RecoveryVMCreationOption - The ALR option. Possible values include: 'CreateVMIfNotFound', 'NoAction' + RecoveryVMCreationOption AlternateLocationRecoveryOption `json:"recoveryVmCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) MarshalJSON() ([]byte, error) { + rphvrafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback + objectMap := make(map[string]interface{}) + if rphvrafi.DataSyncOption != "" { + objectMap["dataSyncOption"] = rphvrafi.DataSyncOption + } + if rphvrafi.RecoveryVMCreationOption != "" { + objectMap["recoveryVmCreationOption"] = rphvrafi.RecoveryVMCreationOption + } + if rphvrafi.InstanceType != "" { + objectMap["instanceType"] = rphvrafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return &rphvrafi, true +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rphvrafi, true +} + +// RecoveryPlanHyperVReplicaAzureFailoverInput recovery plan HVR Azure failover input. +type RecoveryPlanHyperVReplicaAzureFailoverInput struct { + // PrimaryKekCertificatePfx - The primary KEK certificate PFX. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - The secondary KEK certificate PFX. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointType - The recovery point type. Possible values include: 'HyperVReplicaAzureRpRecoveryPointTypeLatest', 'HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent', 'HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed' + RecoveryPointType HyperVReplicaAzureRpRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) MarshalJSON() ([]byte, error) { + rphvrafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if rphvrafi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = rphvrafi.PrimaryKekCertificatePfx + } + if rphvrafi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = rphvrafi.SecondaryKekCertificatePfx + } + if rphvrafi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rphvrafi.RecoveryPointType + } + if rphvrafi.InstanceType != "" { + objectMap["instanceType"] = rphvrafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return &rphvrafi, true +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rphvrafi, true +} + +// RecoveryPlanInMageAzureV2FailoverInput recovery plan InMageAzureV2 failover input. +type RecoveryPlanInMageAzureV2FailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'InMageV2RpRecoveryPointTypeLatest', 'InMageV2RpRecoveryPointTypeLatestApplicationConsistent', 'InMageV2RpRecoveryPointTypeLatestCrashConsistent', 'InMageV2RpRecoveryPointTypeLatestProcessed' + RecoveryPointType InMageV2RpRecoveryPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) MarshalJSON() ([]byte, error) { + rpimavfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if rpimavfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimavfi.RecoveryPointType + } + if rpimavfi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimavfi.UseMultiVMSyncPoint + } + if rpimavfi.InstanceType != "" { + objectMap["instanceType"] = rpimavfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return &rpimavfi, true +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimavfi, true +} + +// RecoveryPlanInMageFailoverInput recovery plan InMage failover input. +type RecoveryPlanInMageFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'RpInMageRecoveryPointTypeLatestTime', 'RpInMageRecoveryPointTypeLatestTag', 'RpInMageRecoveryPointTypeCustom' + RecoveryPointType RpInMageRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) MarshalJSON() ([]byte, error) { + rpimfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if rpimfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimfi.RecoveryPointType + } + if rpimfi.InstanceType != "" { + objectMap["instanceType"] = rpimfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return &rpimfi, true +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimfi, true +} + +// RecoveryPlanInMageRcmFailbackFailoverInput recovery plan InMageRcmFailback failover input. +type RecoveryPlanInMageRcmFailbackFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'ApplicationConsistent', 'CrashConsistent' + RecoveryPointType InMageRcmFailbackRecoveryPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) MarshalJSON() ([]byte, error) { + rpimrffi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if rpimrffi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimrffi.RecoveryPointType + } + if rpimrffi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimrffi.UseMultiVMSyncPoint + } + if rpimrffi.InstanceType != "" { + objectMap["instanceType"] = rpimrffi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return &rpimrffi, true +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimrffi, true +} + +// RecoveryPlanInMageRcmFailoverInput recovery plan InMageRcm failover input. +type RecoveryPlanInMageRcmFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'RecoveryPlanPointTypeLatest', 'RecoveryPlanPointTypeLatestApplicationConsistent', 'RecoveryPlanPointTypeLatestCrashConsistent', 'RecoveryPlanPointTypeLatestProcessed' + RecoveryPointType RecoveryPlanPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) MarshalJSON() ([]byte, error) { + rpimrfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if rpimrfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimrfi.RecoveryPointType + } + if rpimrfi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimrfi.UseMultiVMSyncPoint + } + if rpimrfi.InstanceType != "" { + objectMap["instanceType"] = rpimrfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return &rpimrfi, true +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimrfi, true +} + +// RecoveryPlanManualActionDetails recovery plan manual action details. +type RecoveryPlanManualActionDetails struct { + // Description - The manual action description. + Description *string `json:"description,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) MarshalJSON() ([]byte, error) { + rpmad.InstanceType = InstanceTypeManualActionDetails + objectMap := make(map[string]interface{}) + if rpmad.Description != nil { + objectMap["description"] = rpmad.Description + } + if rpmad.InstanceType != "" { + objectMap["instanceType"] = rpmad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return &rpmad, true +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpmad, true +} + +// RecoveryPlanPlannedFailoverInput recovery plan planned failover input. +type RecoveryPlanPlannedFailoverInput struct { + // Properties - The recovery plan planned failover input properties. + Properties *RecoveryPlanPlannedFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanPlannedFailoverInputProperties recovery plan planned failover input properties. +type RecoveryPlanPlannedFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanPlannedFailoverInputProperties struct. +func (rppfip *RecoveryPlanPlannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rppfip.FailoverDirection = failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rppfip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanProperties recovery plan properties. +type RecoveryPlanProperties struct { + // FriendlyName - The friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // PrimaryFabricID - The primary fabric Id. + PrimaryFabricID *string `json:"primaryFabricId,omitempty"` + // PrimaryFabricFriendlyName - The primary fabric friendly name. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // RecoveryFabricID - The recovery fabric Id. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // RecoveryFabricFriendlyName - The recovery fabric friendly name. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // FailoverDeploymentModel - The failover deployment model. + FailoverDeploymentModel *string `json:"failoverDeploymentModel,omitempty"` + // ReplicationProviders - The list of replication providers. + ReplicationProviders *[]string `json:"replicationProviders,omitempty"` + // AllowedOperations - The list of allowed operations. + AllowedOperations *[]string `json:"allowedOperations,omitempty"` + // LastPlannedFailoverTime - The start time of the last planned failover. + LastPlannedFailoverTime *date.Time `json:"lastPlannedFailoverTime,omitempty"` + // LastUnplannedFailoverTime - The start time of the last unplanned failover. + LastUnplannedFailoverTime *date.Time `json:"lastUnplannedFailoverTime,omitempty"` + // LastTestFailoverTime - The start time of the last test failover. + LastTestFailoverTime *date.Time `json:"lastTestFailoverTime,omitempty"` + // CurrentScenario - The current scenario details. + CurrentScenario *CurrentScenarioDetails `json:"currentScenario,omitempty"` + // CurrentScenarioStatus - The recovery plan status. + CurrentScenarioStatus *string `json:"currentScenarioStatus,omitempty"` + // CurrentScenarioStatusDescription - The recovery plan status description. + CurrentScenarioStatusDescription *string `json:"currentScenarioStatusDescription,omitempty"` + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` + // ProviderSpecificDetails - The provider id and provider specific details. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanProperties struct. +func (rpp *RecoveryPlanProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpp.FriendlyName = &friendlyName + } + case "primaryFabricId": + if v != nil { + var primaryFabricID string + err = json.Unmarshal(*v, &primaryFabricID) + if err != nil { + return err + } + rpp.PrimaryFabricID = &primaryFabricID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + rpp.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + rpp.RecoveryFabricID = &recoveryFabricID + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + rpp.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "failoverDeploymentModel": + if v != nil { + var failoverDeploymentModel string + err = json.Unmarshal(*v, &failoverDeploymentModel) + if err != nil { + return err + } + rpp.FailoverDeploymentModel = &failoverDeploymentModel + } + case "replicationProviders": + if v != nil { + var replicationProviders []string + err = json.Unmarshal(*v, &replicationProviders) + if err != nil { + return err + } + rpp.ReplicationProviders = &replicationProviders + } + case "allowedOperations": + if v != nil { + var allowedOperations []string + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + rpp.AllowedOperations = &allowedOperations + } + case "lastPlannedFailoverTime": + if v != nil { + var lastPlannedFailoverTime date.Time + err = json.Unmarshal(*v, &lastPlannedFailoverTime) + if err != nil { + return err + } + rpp.LastPlannedFailoverTime = &lastPlannedFailoverTime + } + case "lastUnplannedFailoverTime": + if v != nil { + var lastUnplannedFailoverTime date.Time + err = json.Unmarshal(*v, &lastUnplannedFailoverTime) + if err != nil { + return err + } + rpp.LastUnplannedFailoverTime = &lastUnplannedFailoverTime + } + case "lastTestFailoverTime": + if v != nil { + var lastTestFailoverTime date.Time + err = json.Unmarshal(*v, &lastTestFailoverTime) + if err != nil { + return err + } + rpp.LastTestFailoverTime = &lastTestFailoverTime + } + case "currentScenario": + if v != nil { + var currentScenario CurrentScenarioDetails + err = json.Unmarshal(*v, ¤tScenario) + if err != nil { + return err + } + rpp.CurrentScenario = ¤tScenario + } + case "currentScenarioStatus": + if v != nil { + var currentScenarioStatus string + err = json.Unmarshal(*v, ¤tScenarioStatus) + if err != nil { + return err + } + rpp.CurrentScenarioStatus = ¤tScenarioStatus + } + case "currentScenarioStatusDescription": + if v != nil { + var currentScenarioStatusDescription string + err = json.Unmarshal(*v, ¤tScenarioStatusDescription) + if err != nil { + return err + } + rpp.CurrentScenarioStatusDescription = ¤tScenarioStatusDescription + } + case "groups": + if v != nil { + var groups []RecoveryPlanGroup + err = json.Unmarshal(*v, &groups) + if err != nil { + return err + } + rpp.Groups = &groups + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificDetailsArray(*v) + if err != nil { + return err + } + rpp.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanProtectedItem recovery plan protected item. +type RecoveryPlanProtectedItem struct { + // ID - The ARM Id of the recovery plan protected item. + ID *string `json:"id,omitempty"` + // VirtualMachineID - The virtual machine Id. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` +} + +// BasicRecoveryPlanProviderSpecificDetails recovery plan provider specific details. +type BasicRecoveryPlanProviderSpecificDetails interface { + AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) + AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) +} + +// RecoveryPlanProviderSpecificDetails recovery plan provider specific details. +type RecoveryPlanProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails', 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificDetails(body []byte) (BasicRecoveryPlanProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A): + var rpad RecoveryPlanA2ADetails + err := json.Unmarshal(body, &rpad) + return rpad, err + default: + var rppsd RecoveryPlanProviderSpecificDetails + err := json.Unmarshal(body, &rppsd) + return rppsd, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificDetailsArray(body []byte) ([]BasicRecoveryPlanProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsdArray := make([]BasicRecoveryPlanProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsd, err := unmarshalBasicRecoveryPlanProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + rppsdArray[index] = rppsd + } + return rppsdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) MarshalJSON() ([]byte, error) { + rppsd.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails + objectMap := make(map[string]interface{}) + if rppsd.InstanceType != "" { + objectMap["instanceType"] = rppsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2ADetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) { + return &rppsd, true +} + +// AsBasicRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsBasicRecoveryPlanProviderSpecificDetails() (BasicRecoveryPlanProviderSpecificDetails, bool) { + return &rppsd, true +} + +// BasicRecoveryPlanProviderSpecificFailoverInput recovery plan provider specific failover input. +type BasicRecoveryPlanProviderSpecificFailoverInput interface { + AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) + AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) + AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) + AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) + AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) + AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) + AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) + AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) +} + +// RecoveryPlanProviderSpecificFailoverInput recovery plan provider specific failover input. +type RecoveryPlanProviderSpecificFailoverInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificFailoverInput(body []byte) (BasicRecoveryPlanProviderSpecificFailoverInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A): + var rpafi RecoveryPlanA2AFailoverInput + err := json.Unmarshal(body, &rpafi) + return rpafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback): + var rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput + err := json.Unmarshal(body, &rphvrafi) + return rphvrafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure): + var rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput + err := json.Unmarshal(body, &rphvrafi) + return rphvrafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2): + var rpimavfi RecoveryPlanInMageAzureV2FailoverInput + err := json.Unmarshal(body, &rpimavfi) + return rpimavfi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage): + var rpimfi RecoveryPlanInMageFailoverInput + err := json.Unmarshal(body, &rpimfi) + return rpimfi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback): + var rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput + err := json.Unmarshal(body, &rpimrffi) + return rpimrffi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm): + var rpimrfi RecoveryPlanInMageRcmFailoverInput + err := json.Unmarshal(body, &rpimrfi) + return rpimrfi, err + default: + var rppsfi RecoveryPlanProviderSpecificFailoverInput + err := json.Unmarshal(body, &rppsfi) + return rppsfi, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(body []byte) ([]BasicRecoveryPlanProviderSpecificFailoverInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsfiArray := make([]BasicRecoveryPlanProviderSpecificFailoverInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsfi, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInput(*rawMessage) + if err != nil { + return nil, err + } + rppsfiArray[index] = rppsfi + } + return rppsfiArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) MarshalJSON() ([]byte, error) { + rppsfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput + objectMap := make(map[string]interface{}) + if rppsfi.InstanceType != "" { + objectMap["instanceType"] = rppsfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return &rppsfi, true +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rppsfi, true +} + +// BasicRecoveryPlanProviderSpecificInput recovery plan provider specific input base class. +type BasicRecoveryPlanProviderSpecificInput interface { + AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) + AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) +} + +// RecoveryPlanProviderSpecificInput recovery plan provider specific input base class. +type RecoveryPlanProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificInput(body []byte) (BasicRecoveryPlanProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A): + var rpai RecoveryPlanA2AInput + err := json.Unmarshal(body, &rpai) + return rpai, err + default: + var rppsi RecoveryPlanProviderSpecificInput + err := json.Unmarshal(body, &rppsi) + return rppsi, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificInputArray(body []byte) ([]BasicRecoveryPlanProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsiArray := make([]BasicRecoveryPlanProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsi, err := unmarshalBasicRecoveryPlanProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rppsiArray[index] = rppsi + } + return rppsiArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) MarshalJSON() ([]byte, error) { + rppsi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput + objectMap := make(map[string]interface{}) + if rppsi.InstanceType != "" { + objectMap["instanceType"] = rppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) { + return &rppsi, true +} + +// AsBasicRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsBasicRecoveryPlanProviderSpecificInput() (BasicRecoveryPlanProviderSpecificInput, bool) { + return &rppsi, true +} + +// RecoveryPlanScriptActionDetails recovery plan script action details. +type RecoveryPlanScriptActionDetails struct { + // Path - The script path. + Path *string `json:"path,omitempty"` + // Timeout - The script timeout. + Timeout *string `json:"timeout,omitempty"` + // FabricLocation - The fabric location. Possible values include: 'Primary', 'Recovery' + FabricLocation RecoveryPlanActionLocation `json:"fabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) MarshalJSON() ([]byte, error) { + rpsad.InstanceType = InstanceTypeScriptActionDetails + objectMap := make(map[string]interface{}) + if rpsad.Path != nil { + objectMap["path"] = rpsad.Path + } + if rpsad.Timeout != nil { + objectMap["timeout"] = rpsad.Timeout + } + if rpsad.FabricLocation != "" { + objectMap["fabricLocation"] = rpsad.FabricLocation + } + if rpsad.InstanceType != "" { + objectMap["instanceType"] = rpsad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return &rpsad, true +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpsad, true +} + +// RecoveryPlanShutdownGroupTaskDetails this class represents the recovery plan shutdown group task +// details. +type RecoveryPlanShutdownGroupTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // GroupID - The group identifier. + GroupID *string `json:"groupId,omitempty"` + // RpGroupType - The group type. + RpGroupType *string `json:"rpGroupType,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) MarshalJSON() ([]byte, error) { + rpsgtd.InstanceType = InstanceTypeRecoveryPlanShutdownGroupTaskDetails + objectMap := make(map[string]interface{}) + if rpsgtd.Name != nil { + objectMap["name"] = rpsgtd.Name + } + if rpsgtd.GroupID != nil { + objectMap["groupId"] = rpsgtd.GroupID + } + if rpsgtd.RpGroupType != nil { + objectMap["rpGroupType"] = rpsgtd.RpGroupType + } + if rpsgtd.ChildTasks != nil { + objectMap["childTasks"] = rpsgtd.ChildTasks + } + if rpsgtd.InstanceType != "" { + objectMap["instanceType"] = rpsgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// RecoveryPlanTestFailoverCleanupInput recovery plan test failover cleanup input. +type RecoveryPlanTestFailoverCleanupInput struct { + // Properties - The recovery plan test failover cleanup input properties. + Properties *RecoveryPlanTestFailoverCleanupInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanTestFailoverCleanupInputProperties recovery plan test failover cleanup input properties. +type RecoveryPlanTestFailoverCleanupInputProperties struct { + // Comments - The test failover cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// RecoveryPlanTestFailoverInput recovery plan test failover input. +type RecoveryPlanTestFailoverInput struct { + // Properties - The recovery plan test failover input properties. + Properties *RecoveryPlanTestFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanTestFailoverInputProperties recovery plan test failover input properties. +type RecoveryPlanTestFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // NetworkType - The network type to be used for test failover. + NetworkType *string `json:"networkType,omitempty"` + // NetworkID - The Id of the network to be used for test failover. + NetworkID *string `json:"networkId,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanTestFailoverInputProperties struct. +func (rptfip *RecoveryPlanTestFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rptfip.FailoverDirection = failoverDirection + } + case "networkType": + if v != nil { + var networkType string + err = json.Unmarshal(*v, &networkType) + if err != nil { + return err + } + rptfip.NetworkType = &networkType + } + case "networkId": + if v != nil { + var networkID string + err = json.Unmarshal(*v, &networkID) + if err != nil { + return err + } + rptfip.NetworkID = &networkID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rptfip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanUnplannedFailoverInput recovery plan unplanned failover input. +type RecoveryPlanUnplannedFailoverInput struct { + // Properties - The recovery plan unplanned failover input properties. + Properties *RecoveryPlanUnplannedFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanUnplannedFailoverInputProperties recovery plan unplanned failover input properties. +type RecoveryPlanUnplannedFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // SourceSiteOperations - A value indicating whether source site operations are required. Possible values include: 'Required', 'NotRequired' + SourceSiteOperations SourceSiteOperations `json:"sourceSiteOperations,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanUnplannedFailoverInputProperties struct. +func (rpufip *RecoveryPlanUnplannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rpufip.FailoverDirection = failoverDirection + } + case "sourceSiteOperations": + if v != nil { + var sourceSiteOperations SourceSiteOperations + err = json.Unmarshal(*v, &sourceSiteOperations) + if err != nil { + return err + } + rpufip.SourceSiteOperations = sourceSiteOperations + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rpufip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPoint recovery point. +type RecoveryPoint struct { + autorest.Response `json:"-"` + // Properties - The recovery point properties. + Properties *RecoveryPointProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPoint. +func (rp RecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.Properties != nil { + objectMap["properties"] = rp.Properties + } + if rp.Location != nil { + objectMap["location"] = rp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryPointCollection collection of recovery point details. +type RecoveryPointCollection struct { + autorest.Response `json:"-"` + // Value - The recovery point details. + Value *[]RecoveryPoint `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryPointCollectionIterator provides access to a complete listing of RecoveryPoint values. +type RecoveryPointCollectionIterator struct { + i int + page RecoveryPointCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryPointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryPointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryPointCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryPointCollectionIterator) Response() RecoveryPointCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryPointCollectionIterator) Value() RecoveryPoint { + if !iter.page.NotDone() { + return RecoveryPoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryPointCollectionIterator type. +func NewRecoveryPointCollectionIterator(page RecoveryPointCollectionPage) RecoveryPointCollectionIterator { + return RecoveryPointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (RPCVar RecoveryPointCollection) IsEmpty() bool { + return RPCVar.Value == nil || len(*RPCVar.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (RPCVar RecoveryPointCollection) hasNextLink() bool { + return RPCVar.NextLink != nil && len(*RPCVar.NextLink) != 0 +} + +// recoveryPointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (RPCVar RecoveryPointCollection) recoveryPointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !RPCVar.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(RPCVar.NextLink))) +} + +// RecoveryPointCollectionPage contains a page of RecoveryPoint values. +type RecoveryPointCollectionPage struct { + fn func(context.Context, RecoveryPointCollection) (RecoveryPointCollection, error) + RPCVar RecoveryPointCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryPointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.RPCVar) + if err != nil { + return err + } + page.RPCVar = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryPointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryPointCollectionPage) NotDone() bool { + return !page.RPCVar.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryPointCollectionPage) Response() RecoveryPointCollection { + return page.RPCVar +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryPointCollectionPage) Values() []RecoveryPoint { + if page.RPCVar.IsEmpty() { + return nil + } + return *page.RPCVar.Value +} + +// Creates a new instance of the RecoveryPointCollectionPage type. +func NewRecoveryPointCollectionPage(cur RecoveryPointCollection, getNextPage func(context.Context, RecoveryPointCollection) (RecoveryPointCollection, error)) RecoveryPointCollectionPage { + return RecoveryPointCollectionPage{ + fn: getNextPage, + RPCVar: cur, + } +} + +// RecoveryPointProperties recovery point properties. +type RecoveryPointProperties struct { + // RecoveryPointTime - The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointType - The recovery point type: ApplicationConsistent, CrashConsistent. + RecoveryPointType *string `json:"recoveryPointType,omitempty"` + // ProviderSpecificDetails - The provider specific details for the recovery point. + ProviderSpecificDetails BasicProviderSpecificRecoveryPointDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPointProperties struct. +func (rpp *RecoveryPointProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryPointTime": + if v != nil { + var recoveryPointTime date.Time + err = json.Unmarshal(*v, &recoveryPointTime) + if err != nil { + return err + } + rpp.RecoveryPointTime = &recoveryPointTime + } + case "recoveryPointType": + if v != nil { + var recoveryPointType string + err = json.Unmarshal(*v, &recoveryPointType) + if err != nil { + return err + } + rpp.RecoveryPointType = &recoveryPointType + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicProviderSpecificRecoveryPointDetails(*v) + if err != nil { + return err + } + rpp.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicRecoveryProximityPlacementGroupCustomDetails recovery Proximity placement group custom input. +type BasicRecoveryProximityPlacementGroupCustomDetails interface { + AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) + AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) +} + +// RecoveryProximityPlacementGroupCustomDetails recovery Proximity placement group custom input. +type RecoveryProximityPlacementGroupCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails', 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(body []byte) (BasicRecoveryProximityPlacementGroupCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting): + var erppg ExistingRecoveryProximityPlacementGroup + err := json.Unmarshal(body, &erppg) + return erppg, err + default: + var rppgcd RecoveryProximityPlacementGroupCustomDetails + err := json.Unmarshal(body, &rppgcd) + return rppgcd, err + } +} +func unmarshalBasicRecoveryProximityPlacementGroupCustomDetailsArray(body []byte) ([]BasicRecoveryProximityPlacementGroupCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppgcdArray := make([]BasicRecoveryProximityPlacementGroupCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppgcd, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rppgcdArray[index] = rppgcd + } + return rppgcdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) MarshalJSON() ([]byte, error) { + rppgcd.ResourceType = ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails + objectMap := make(map[string]interface{}) + if rppgcd.ResourceType != "" { + objectMap["resourceType"] = rppgcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryProximityPlacementGroup is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) { + return nil, false +} + +// AsRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) { + return &rppgcd, true +} + +// AsBasicRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsBasicRecoveryProximityPlacementGroupCustomDetails() (BasicRecoveryProximityPlacementGroupCustomDetails, bool) { + return &rppgcd, true +} + +// BasicRecoveryResourceGroupCustomDetails recovery Resource Group custom input. +type BasicRecoveryResourceGroupCustomDetails interface { + AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) + AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) +} + +// RecoveryResourceGroupCustomDetails recovery Resource Group custom input. +type RecoveryResourceGroupCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails', 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryResourceGroupCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryResourceGroupCustomDetails(body []byte) (BasicRecoveryResourceGroupCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting): + var errrg ExistingRecoveryRecoveryResourceGroup + err := json.Unmarshal(body, &errrg) + return errrg, err + default: + var rrgcd RecoveryResourceGroupCustomDetails + err := json.Unmarshal(body, &rrgcd) + return rrgcd, err + } +} +func unmarshalBasicRecoveryResourceGroupCustomDetailsArray(body []byte) ([]BasicRecoveryResourceGroupCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rrgcdArray := make([]BasicRecoveryResourceGroupCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rrgcd, err := unmarshalBasicRecoveryResourceGroupCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rrgcdArray[index] = rrgcd + } + return rrgcdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) MarshalJSON() ([]byte, error) { + rrgcd.ResourceType = ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails + objectMap := make(map[string]interface{}) + if rrgcd.ResourceType != "" { + objectMap["resourceType"] = rrgcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryRecoveryResourceGroup is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) { + return nil, false +} + +// AsRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) { + return &rrgcd, true +} + +// AsBasicRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsBasicRecoveryResourceGroupCustomDetails() (BasicRecoveryResourceGroupCustomDetails, bool) { + return &rrgcd, true +} + +// RecoveryServicesProvider provider details. +type RecoveryServicesProvider struct { + autorest.Response `json:"-"` + // Properties - Provider properties. + Properties *RecoveryServicesProviderProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryServicesProvider. +func (rsp RecoveryServicesProvider) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rsp.Properties != nil { + objectMap["properties"] = rsp.Properties + } + if rsp.Location != nil { + objectMap["location"] = rsp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryServicesProviderCollection collection of providers. +type RecoveryServicesProviderCollection struct { + autorest.Response `json:"-"` + // Value - The Servers details. + Value *[]RecoveryServicesProvider `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryServicesProviderCollectionIterator provides access to a complete listing of +// RecoveryServicesProvider values. +type RecoveryServicesProviderCollectionIterator struct { + i int + page RecoveryServicesProviderCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryServicesProviderCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryServicesProviderCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryServicesProviderCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryServicesProviderCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryServicesProviderCollectionIterator) Response() RecoveryServicesProviderCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryServicesProviderCollectionIterator) Value() RecoveryServicesProvider { + if !iter.page.NotDone() { + return RecoveryServicesProvider{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryServicesProviderCollectionIterator type. +func NewRecoveryServicesProviderCollectionIterator(page RecoveryServicesProviderCollectionPage) RecoveryServicesProviderCollectionIterator { + return RecoveryServicesProviderCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rspc RecoveryServicesProviderCollection) IsEmpty() bool { + return rspc.Value == nil || len(*rspc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rspc RecoveryServicesProviderCollection) hasNextLink() bool { + return rspc.NextLink != nil && len(*rspc.NextLink) != 0 +} + +// recoveryServicesProviderCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rspc RecoveryServicesProviderCollection) recoveryServicesProviderCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rspc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rspc.NextLink))) +} + +// RecoveryServicesProviderCollectionPage contains a page of RecoveryServicesProvider values. +type RecoveryServicesProviderCollectionPage struct { + fn func(context.Context, RecoveryServicesProviderCollection) (RecoveryServicesProviderCollection, error) + rspc RecoveryServicesProviderCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryServicesProviderCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryServicesProviderCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rspc) + if err != nil { + return err + } + page.rspc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryServicesProviderCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryServicesProviderCollectionPage) NotDone() bool { + return !page.rspc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryServicesProviderCollectionPage) Response() RecoveryServicesProviderCollection { + return page.rspc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryServicesProviderCollectionPage) Values() []RecoveryServicesProvider { + if page.rspc.IsEmpty() { + return nil + } + return *page.rspc.Value +} + +// Creates a new instance of the RecoveryServicesProviderCollectionPage type. +func NewRecoveryServicesProviderCollectionPage(cur RecoveryServicesProviderCollection, getNextPage func(context.Context, RecoveryServicesProviderCollection) (RecoveryServicesProviderCollection, error)) RecoveryServicesProviderCollectionPage { + return RecoveryServicesProviderCollectionPage{ + fn: getNextPage, + rspc: cur, + } +} + +// RecoveryServicesProviderProperties recovery services provider properties. +type RecoveryServicesProviderProperties struct { + // FabricType - Type of the site. + FabricType *string `json:"fabricType,omitempty"` + // FriendlyName - Friendly name of the DRA. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProviderVersion - The provider version. + ProviderVersion *string `json:"providerVersion,omitempty"` + // ServerVersion - The fabric provider. + ServerVersion *string `json:"serverVersion,omitempty"` + // ProviderVersionState - DRA version status. + ProviderVersionState *string `json:"providerVersionState,omitempty"` + // ProviderVersionExpiryDate - Expiry date of the version. + ProviderVersionExpiryDate *date.Time `json:"providerVersionExpiryDate,omitempty"` + // FabricFriendlyName - The fabric friendly name. + FabricFriendlyName *string `json:"fabricFriendlyName,omitempty"` + // LastHeartBeat - Time when last heartbeat was sent by the DRA. + LastHeartBeat *date.Time `json:"lastHeartBeat,omitempty"` + // ConnectionStatus - A value indicating whether DRA is responsive. + ConnectionStatus *string `json:"connectionStatus,omitempty"` + // ProtectedItemCount - Number of protected VMs currently managed by the DRA. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // AllowedScenarios - The scenarios allowed on this provider. + AllowedScenarios *[]string `json:"allowedScenarios,omitempty"` + // HealthErrorDetails - The recovery services provider health error details. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // DraIdentifier - The DRA Id. + DraIdentifier *string `json:"draIdentifier,omitempty"` + // MachineID - The machine Id. + MachineID *string `json:"machineId,omitempty"` + // MachineName - The machine name. + MachineName *string `json:"machineName,omitempty"` + // BiosID - The Bios Id. + BiosID *string `json:"biosId,omitempty"` + // AuthenticationIdentityDetails - The authentication identity details. + AuthenticationIdentityDetails *IdentityProviderDetails `json:"authenticationIdentityDetails,omitempty"` + // ResourceAccessIdentityDetails - The resource access identity details. + ResourceAccessIdentityDetails *IdentityProviderDetails `json:"resourceAccessIdentityDetails,omitempty"` + // DataPlaneAuthenticationIdentityDetails - The data plane authentication identity details. + DataPlaneAuthenticationIdentityDetails *IdentityProviderDetails `json:"dataPlaneAuthenticationIdentityDetails,omitempty"` + // ProviderVersionDetails - The provider version details. + ProviderVersionDetails *VersionDetails `json:"providerVersionDetails,omitempty"` +} + +// BasicRecoveryVirtualNetworkCustomDetails recovery Virtual network custom input. +type BasicRecoveryVirtualNetworkCustomDetails interface { + AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) + AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) + AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) +} + +// RecoveryVirtualNetworkCustomDetails recovery Virtual network custom input. +type RecoveryVirtualNetworkCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryVirtualNetworkCustomDetails(body []byte) (BasicRecoveryVirtualNetworkCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting): + var ervn ExistingRecoveryVirtualNetwork + err := json.Unmarshal(body, &ervn) + return ervn, err + case string(ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew): + var nrvn NewRecoveryVirtualNetwork + err := json.Unmarshal(body, &nrvn) + return nrvn, err + default: + var rvncd RecoveryVirtualNetworkCustomDetails + err := json.Unmarshal(body, &rvncd) + return rvncd, err + } +} +func unmarshalBasicRecoveryVirtualNetworkCustomDetailsArray(body []byte) ([]BasicRecoveryVirtualNetworkCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rvncdArray := make([]BasicRecoveryVirtualNetworkCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rvncd, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rvncdArray[index] = rvncd + } + return rvncdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) MarshalJSON() ([]byte, error) { + rvncd.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails + objectMap := make(map[string]interface{}) + if rvncd.ResourceType != "" { + objectMap["resourceType"] = rvncd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return &rvncd, true +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &rvncd, true +} + +// RemoveDisksInput input for remove disk(s) operation. +type RemoveDisksInput struct { + // Properties - Remove disk input properties. + Properties *RemoveDisksInputProperties `json:"properties,omitempty"` +} + +// RemoveDisksInputProperties remove Disk input properties. +type RemoveDisksInputProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicRemoveDisksProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RemoveDisksInputProperties struct. +func (rdip *RemoveDisksInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRemoveDisksProviderSpecificInput(*v) + if err != nil { + return err + } + rdip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicRemoveDisksProviderSpecificInput remove Disk provider specific input. +type BasicRemoveDisksProviderSpecificInput interface { + AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) + AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) +} + +// RemoveDisksProviderSpecificInput remove Disk provider specific input. +type RemoveDisksProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput', 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRemoveDisksProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRemoveDisksProviderSpecificInput(body []byte) (BasicRemoveDisksProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A): + var ardi A2ARemoveDisksInput + err := json.Unmarshal(body, &ardi) + return ardi, err + default: + var rdpsi RemoveDisksProviderSpecificInput + err := json.Unmarshal(body, &rdpsi) + return rdpsi, err + } +} +func unmarshalBasicRemoveDisksProviderSpecificInputArray(body []byte) ([]BasicRemoveDisksProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rdpsiArray := make([]BasicRemoveDisksProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rdpsi, err := unmarshalBasicRemoveDisksProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rdpsiArray[index] = rdpsi + } + return rdpsiArray, nil +} + +// MarshalJSON is the custom marshaler for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) MarshalJSON() ([]byte, error) { + rdpsi.InstanceType = InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput + objectMap := make(map[string]interface{}) + if rdpsi.InstanceType != "" { + objectMap["instanceType"] = rdpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARemoveDisksInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) { + return nil, false +} + +// AsRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) { + return &rdpsi, true +} + +// AsBasicRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsBasicRemoveDisksProviderSpecificInput() (BasicRemoveDisksProviderSpecificInput, bool) { + return &rdpsi, true +} + +// RemoveProtectionContainerMappingInput container unpairing input. +type RemoveProtectionContainerMappingInput struct { + // Properties - Configure protection input properties. + Properties *RemoveProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// RemoveProtectionContainerMappingInputProperties unpairing input properties. +type RemoveProtectionContainerMappingInputProperties struct { + // ProviderSpecificInput - Provider specific input for unpairing. + ProviderSpecificInput *ReplicationProviderContainerUnmappingInput `json:"providerSpecificInput,omitempty"` +} + +// RenewCertificateInput certificate renewal input. +type RenewCertificateInput struct { + // Properties - Renew certificate input properties. + Properties *RenewCertificateInputProperties `json:"properties,omitempty"` +} + +// RenewCertificateInputProperties renew Certificate input properties. +type RenewCertificateInputProperties struct { + // RenewCertificateType - Renew certificate type. + RenewCertificateType *string `json:"renewCertificateType,omitempty"` +} + +// ReplicationAgentDetails replication agent details. +type ReplicationAgentDetails struct { + // ID - READ-ONLY; The replication agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The replication agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The replication agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The replication agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the replication agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the replication agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationAgentDetails. +func (rad ReplicationAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ReplicationEligibilityResults replication eligibility results response model. +type ReplicationEligibilityResults struct { + autorest.Response `json:"-"` + // Name - READ-ONLY; Gets the name of this object. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets the object type. + Type *string `json:"type,omitempty"` + // ID - READ-ONLY; Gets Unique ARM identifier for this object. + ID *string `json:"id,omitempty"` + // Properties - READ-ONLY; Gets properties model for replication eligibility results API. + Properties *ReplicationEligibilityResultsProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResults. +func (rer ReplicationEligibilityResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ReplicationEligibilityResultsCollection replication eligibility results collection response model. +type ReplicationEligibilityResultsCollection struct { + autorest.Response `json:"-"` + // Value - The replication eligibility results details. + Value *[]ReplicationEligibilityResults `json:"value,omitempty"` +} + +// ReplicationEligibilityResultsErrorInfo error model that can be exposed to the user. +type ReplicationEligibilityResultsErrorInfo struct { + // Code - The error code. + Code *string `json:"code,omitempty"` + // Message - The error message. + Message *string `json:"message,omitempty"` + // PossibleCauses - The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // Status - READ-ONLY; The error status. + Status *string `json:"status,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResultsErrorInfo. +func (rerei ReplicationEligibilityResultsErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rerei.Code != nil { + objectMap["code"] = rerei.Code + } + if rerei.Message != nil { + objectMap["message"] = rerei.Message + } + if rerei.PossibleCauses != nil { + objectMap["possibleCauses"] = rerei.PossibleCauses + } + if rerei.RecommendedAction != nil { + objectMap["recommendedAction"] = rerei.RecommendedAction + } + return json.Marshal(objectMap) +} + +// ReplicationEligibilityResultsProperties properties model for replication eligibility results API. +type ReplicationEligibilityResultsProperties struct { + // ClientRequestID - READ-ONLY; The client request Id. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // Errors - The error details. + Errors *[]ReplicationEligibilityResultsErrorInfo `json:"errors,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResultsProperties. +func (rerp ReplicationEligibilityResultsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rerp.Errors != nil { + objectMap["errors"] = rerp.Errors + } + return json.Marshal(objectMap) +} + +// ReplicationFabricsCheckConsistencyFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsCheckConsistencyFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsCheckConsistencyFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsCheckConsistencyFuture.Result. +func (future *ReplicationFabricsCheckConsistencyFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCheckConsistencyFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsCheckConsistencyFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.CheckConsistencyResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCheckConsistencyFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsCreateFuture.Result. +func (future *ReplicationFabricsCreateFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.CreateResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCreateFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsDeleteFuture.Result. +func (future *ReplicationFabricsDeleteFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsMigrateToAadFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsMigrateToAadFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsMigrateToAadFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsMigrateToAadFuture.Result. +func (future *ReplicationFabricsMigrateToAadFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsMigrateToAadFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsMigrateToAadFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsPurgeFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationFabricsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsPurgeFuture.Result. +func (future *ReplicationFabricsPurgeFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsReassociateGatewayFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsReassociateGatewayFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsReassociateGatewayFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsReassociateGatewayFuture.Result. +func (future *ReplicationFabricsReassociateGatewayFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsReassociateGatewayFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsReassociateGatewayFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.ReassociateGatewayResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsReassociateGatewayFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsRenewCertificateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsRenewCertificateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsRenewCertificateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsRenewCertificateFuture.Result. +func (future *ReplicationFabricsRenewCertificateFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsRenewCertificateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsRenewCertificateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.RenewCertificateResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsRenewCertificateFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationGroupDetails replication group details. This will be used in case of San. +type ReplicationGroupDetails struct { + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) MarshalJSON() ([]byte, error) { + rgd.InstanceType = InstanceTypeReplicationGroupDetails + objectMap := make(map[string]interface{}) + if rgd.InstanceType != "" { + objectMap["instanceType"] = rgd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return &rgd, true +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &rgd, true +} + +// ReplicationJobsCancelFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsCancelFuture.Result. +func (future *ReplicationJobsCancelFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.CancelResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsCancelFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsExportFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsExportFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsExportFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsExportFuture.Result. +func (future *ReplicationJobsExportFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsExportFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsExportFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.ExportResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsExportFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsRestartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsRestartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsRestartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsRestartFuture.Result. +func (future *ReplicationJobsRestartFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsRestartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsRestartFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.RestartResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsRestartFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsResumeFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsResumeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsResumeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsResumeFuture.Result. +func (future *ReplicationJobsResumeFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsResumeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsResumeFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.ResumeResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsResumeFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsCreateFuture.Result. +func (future *ReplicationMigrationItemsCreateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.CreateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsCreateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsDeleteFuture.Result. +func (future *ReplicationMigrationItemsDeleteFuture) result(client ReplicationMigrationItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationMigrationItemsMigrateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsMigrateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsMigrateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsMigrateFuture.Result. +func (future *ReplicationMigrationItemsMigrateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsMigrateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsMigrateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.MigrateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsMigrateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsResyncFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsResyncFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsResyncFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsResyncFuture.Result. +func (future *ReplicationMigrationItemsResyncFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsResyncFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsResyncFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.ResyncResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsResyncFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsTestMigrateCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationMigrationItemsTestMigrateCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsTestMigrateCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsTestMigrateCleanupFuture.Result. +func (future *ReplicationMigrationItemsTestMigrateCleanupFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.TestMigrateCleanupResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsTestMigrateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsTestMigrateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsTestMigrateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsTestMigrateFuture.Result. +func (future *ReplicationMigrationItemsTestMigrateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsTestMigrateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.TestMigrateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsUpdateFuture.Result. +func (future *ReplicationMigrationItemsUpdateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.UpdateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsUpdateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationNetworkMappingsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (NetworkMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsCreateFuture.Result. +func (future *ReplicationNetworkMappingsCreateFuture) result(client ReplicationNetworkMappingsClient) (nm NetworkMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + nm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nm.Response.Response, err = future.GetResult(sender); err == nil && nm.Response.Response.StatusCode != http.StatusNoContent { + nm, err = client.CreateResponder(nm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsCreateFuture", "Result", nm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationNetworkMappingsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsDeleteFuture.Result. +func (future *ReplicationNetworkMappingsDeleteFuture) result(client ReplicationNetworkMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationNetworkMappingsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (NetworkMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsUpdateFuture.Result. +func (future *ReplicationNetworkMappingsUpdateFuture) result(client ReplicationNetworkMappingsClient) (nm NetworkMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + nm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nm.Response.Response, err = future.GetResult(sender); err == nil && nm.Response.Response.StatusCode != http.StatusNoContent { + nm, err = client.UpdateResponder(nm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsUpdateFuture", "Result", nm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationPoliciesCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (Policy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesCreateFuture.Result. +func (future *ReplicationPoliciesCreateFuture) result(client ReplicationPoliciesClient) (p Policy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + p.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.CreateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesCreateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesDeleteFuture.Result. +func (future *ReplicationPoliciesDeleteFuture) result(client ReplicationPoliciesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationPoliciesUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (Policy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesUpdateFuture.Result. +func (future *ReplicationPoliciesUpdateFuture) result(client ReplicationPoliciesClient) (p Policy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + p.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.UpdateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesUpdateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItem replication protected item. +type ReplicationProtectedItem struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ReplicationProtectedItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectedItem. +func (rpi ReplicationProtectedItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpi.Properties != nil { + objectMap["properties"] = rpi.Properties + } + if rpi.Location != nil { + objectMap["location"] = rpi.Location + } + return json.Marshal(objectMap) +} + +// ReplicationProtectedItemCollection replication protected item collection. +type ReplicationProtectedItemCollection struct { + autorest.Response `json:"-"` + // Value - The Replication protected item details. + Value *[]ReplicationProtectedItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ReplicationProtectedItemCollectionIterator provides access to a complete listing of +// ReplicationProtectedItem values. +type ReplicationProtectedItemCollectionIterator struct { + i int + page ReplicationProtectedItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ReplicationProtectedItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ReplicationProtectedItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ReplicationProtectedItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ReplicationProtectedItemCollectionIterator) Response() ReplicationProtectedItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ReplicationProtectedItemCollectionIterator) Value() ReplicationProtectedItem { + if !iter.page.NotDone() { + return ReplicationProtectedItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ReplicationProtectedItemCollectionIterator type. +func NewReplicationProtectedItemCollectionIterator(page ReplicationProtectedItemCollectionPage) ReplicationProtectedItemCollectionIterator { + return ReplicationProtectedItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rpic ReplicationProtectedItemCollection) IsEmpty() bool { + return rpic.Value == nil || len(*rpic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rpic ReplicationProtectedItemCollection) hasNextLink() bool { + return rpic.NextLink != nil && len(*rpic.NextLink) != 0 +} + +// replicationProtectedItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rpic ReplicationProtectedItemCollection) replicationProtectedItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rpic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rpic.NextLink))) +} + +// ReplicationProtectedItemCollectionPage contains a page of ReplicationProtectedItem values. +type ReplicationProtectedItemCollectionPage struct { + fn func(context.Context, ReplicationProtectedItemCollection) (ReplicationProtectedItemCollection, error) + rpic ReplicationProtectedItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ReplicationProtectedItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rpic) + if err != nil { + return err + } + page.rpic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ReplicationProtectedItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ReplicationProtectedItemCollectionPage) NotDone() bool { + return !page.rpic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ReplicationProtectedItemCollectionPage) Response() ReplicationProtectedItemCollection { + return page.rpic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ReplicationProtectedItemCollectionPage) Values() []ReplicationProtectedItem { + if page.rpic.IsEmpty() { + return nil + } + return *page.rpic.Value +} + +// Creates a new instance of the ReplicationProtectedItemCollectionPage type. +func NewReplicationProtectedItemCollectionPage(cur ReplicationProtectedItemCollection, getNextPage func(context.Context, ReplicationProtectedItemCollection) (ReplicationProtectedItemCollection, error)) ReplicationProtectedItemCollectionPage { + return ReplicationProtectedItemCollectionPage{ + fn: getNextPage, + rpic: cur, + } +} + +// ReplicationProtectedItemProperties replication protected item custom data details. +type ReplicationProtectedItemProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectedItemType - The type of protected item type. + ProtectedItemType *string `json:"protectedItemType,omitempty"` + // ProtectableItemID - The protected item ARM Id. + ProtectableItemID *string `json:"protectableItemId,omitempty"` + // RecoveryServicesProviderID - The recovery provider ARM Id. + RecoveryServicesProviderID *string `json:"recoveryServicesProviderId,omitempty"` + // PrimaryFabricFriendlyName - The friendly name of the primary fabric. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // PrimaryFabricProvider - The fabric provider of the primary fabric. + PrimaryFabricProvider *string `json:"primaryFabricProvider,omitempty"` + // RecoveryFabricFriendlyName - The friendly name of recovery fabric. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // RecoveryFabricID - The Arm Id of recovery fabric. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // PrimaryProtectionContainerFriendlyName - The name of primary protection container friendly name. + PrimaryProtectionContainerFriendlyName *string `json:"primaryProtectionContainerFriendlyName,omitempty"` + // RecoveryProtectionContainerFriendlyName - The name of recovery container friendly name. + RecoveryProtectionContainerFriendlyName *string `json:"recoveryProtectionContainerFriendlyName,omitempty"` + // ProtectionState - The protection status. + ProtectionState *string `json:"protectionState,omitempty"` + // ProtectionStateDescription - The protection state description. + ProtectionStateDescription *string `json:"protectionStateDescription,omitempty"` + // ActiveLocation - The Current active location of the PE. + ActiveLocation *string `json:"activeLocation,omitempty"` + // TestFailoverState - The Test failover state. + TestFailoverState *string `json:"testFailoverState,omitempty"` + // TestFailoverStateDescription - The Test failover state description. + TestFailoverStateDescription *string `json:"testFailoverStateDescription,omitempty"` + // AllowedOperations - The allowed operations on the Replication protected item. + AllowedOperations *[]string `json:"allowedOperations,omitempty"` + // ReplicationHealth - 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 `json:"replicationHealth,omitempty"` + // FailoverHealth - The consolidated failover health for the VM. + FailoverHealth *string `json:"failoverHealth,omitempty"` + // HealthErrors - List of health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // PolicyID - The ID of Policy governing this PE. + PolicyID *string `json:"policyId,omitempty"` + // PolicyFriendlyName - The name of Policy governing this PE. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` + // LastSuccessfulFailoverTime - The Last successful failover time. + LastSuccessfulFailoverTime *date.Time `json:"lastSuccessfulFailoverTime,omitempty"` + // LastSuccessfulTestFailoverTime - The Last successful test failover time. + LastSuccessfulTestFailoverTime *date.Time `json:"lastSuccessfulTestFailoverTime,omitempty"` + // CurrentScenario - The current scenario. + CurrentScenario *CurrentScenarioDetails `json:"currentScenario,omitempty"` + // FailoverRecoveryPointID - The recovery point ARM Id to which the Vm was failed over. + FailoverRecoveryPointID *string `json:"failoverRecoveryPointId,omitempty"` + // ProviderSpecificDetails - The Replication provider custom settings. + ProviderSpecificDetails BasicReplicationProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // EventCorrelationID - The correlation Id for events associated with this protected item. + EventCorrelationID *string `json:"eventCorrelationId,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ReplicationProtectedItemProperties struct. +func (rpip *ReplicationProtectedItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpip.FriendlyName = &friendlyName + } + case "protectedItemType": + if v != nil { + var protectedItemType string + err = json.Unmarshal(*v, &protectedItemType) + if err != nil { + return err + } + rpip.ProtectedItemType = &protectedItemType + } + case "protectableItemId": + if v != nil { + var protectableItemID string + err = json.Unmarshal(*v, &protectableItemID) + if err != nil { + return err + } + rpip.ProtectableItemID = &protectableItemID + } + case "recoveryServicesProviderId": + if v != nil { + var recoveryServicesProviderID string + err = json.Unmarshal(*v, &recoveryServicesProviderID) + if err != nil { + return err + } + rpip.RecoveryServicesProviderID = &recoveryServicesProviderID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + rpip.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "primaryFabricProvider": + if v != nil { + var primaryFabricProvider string + err = json.Unmarshal(*v, &primaryFabricProvider) + if err != nil { + return err + } + rpip.PrimaryFabricProvider = &primaryFabricProvider + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + rpip.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + rpip.RecoveryFabricID = &recoveryFabricID + } + case "primaryProtectionContainerFriendlyName": + if v != nil { + var primaryProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &primaryProtectionContainerFriendlyName) + if err != nil { + return err + } + rpip.PrimaryProtectionContainerFriendlyName = &primaryProtectionContainerFriendlyName + } + case "recoveryProtectionContainerFriendlyName": + if v != nil { + var recoveryProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &recoveryProtectionContainerFriendlyName) + if err != nil { + return err + } + rpip.RecoveryProtectionContainerFriendlyName = &recoveryProtectionContainerFriendlyName + } + case "protectionState": + if v != nil { + var protectionState string + err = json.Unmarshal(*v, &protectionState) + if err != nil { + return err + } + rpip.ProtectionState = &protectionState + } + case "protectionStateDescription": + if v != nil { + var protectionStateDescription string + err = json.Unmarshal(*v, &protectionStateDescription) + if err != nil { + return err + } + rpip.ProtectionStateDescription = &protectionStateDescription + } + case "activeLocation": + if v != nil { + var activeLocation string + err = json.Unmarshal(*v, &activeLocation) + if err != nil { + return err + } + rpip.ActiveLocation = &activeLocation + } + case "testFailoverState": + if v != nil { + var testFailoverState string + err = json.Unmarshal(*v, &testFailoverState) + if err != nil { + return err + } + rpip.TestFailoverState = &testFailoverState + } + case "testFailoverStateDescription": + if v != nil { + var testFailoverStateDescription string + err = json.Unmarshal(*v, &testFailoverStateDescription) + if err != nil { + return err + } + rpip.TestFailoverStateDescription = &testFailoverStateDescription + } + case "allowedOperations": + if v != nil { + var allowedOperations []string + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + rpip.AllowedOperations = &allowedOperations + } + case "replicationHealth": + if v != nil { + var replicationHealth string + err = json.Unmarshal(*v, &replicationHealth) + if err != nil { + return err + } + rpip.ReplicationHealth = &replicationHealth + } + case "failoverHealth": + if v != nil { + var failoverHealth string + err = json.Unmarshal(*v, &failoverHealth) + if err != nil { + return err + } + rpip.FailoverHealth = &failoverHealth + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + rpip.HealthErrors = &healthErrors + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + rpip.PolicyID = &policyID + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + rpip.PolicyFriendlyName = &policyFriendlyName + } + case "lastSuccessfulFailoverTime": + if v != nil { + var lastSuccessfulFailoverTime date.Time + err = json.Unmarshal(*v, &lastSuccessfulFailoverTime) + if err != nil { + return err + } + rpip.LastSuccessfulFailoverTime = &lastSuccessfulFailoverTime + } + case "lastSuccessfulTestFailoverTime": + if v != nil { + var lastSuccessfulTestFailoverTime date.Time + err = json.Unmarshal(*v, &lastSuccessfulTestFailoverTime) + if err != nil { + return err + } + rpip.LastSuccessfulTestFailoverTime = &lastSuccessfulTestFailoverTime + } + case "currentScenario": + if v != nil { + var currentScenario CurrentScenarioDetails + err = json.Unmarshal(*v, ¤tScenario) + if err != nil { + return err + } + rpip.CurrentScenario = ¤tScenario + } + case "failoverRecoveryPointId": + if v != nil { + var failoverRecoveryPointID string + err = json.Unmarshal(*v, &failoverRecoveryPointID) + if err != nil { + return err + } + rpip.FailoverRecoveryPointID = &failoverRecoveryPointID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReplicationProviderSpecificSettings(*v) + if err != nil { + return err + } + rpip.ProviderSpecificDetails = providerSpecificDetails + } + case "recoveryContainerId": + if v != nil { + var recoveryContainerID string + err = json.Unmarshal(*v, &recoveryContainerID) + if err != nil { + return err + } + rpip.RecoveryContainerID = &recoveryContainerID + } + case "eventCorrelationId": + if v != nil { + var eventCorrelationID string + err = json.Unmarshal(*v, &eventCorrelationID) + if err != nil { + return err + } + rpip.EventCorrelationID = &eventCorrelationID + } + } + } + + return nil +} + +// ReplicationProtectedItemsAddDisksFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsAddDisksFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsAddDisksFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsAddDisksFuture.Result. +func (future *ReplicationProtectedItemsAddDisksFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsAddDisksFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsAddDisksFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.AddDisksResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsAddDisksFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsApplyRecoveryPointFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsApplyRecoveryPointFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsApplyRecoveryPointFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsApplyRecoveryPointFuture.Result. +func (future *ReplicationProtectedItemsApplyRecoveryPointFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ApplyRecoveryPointResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsCreateFuture.Result. +func (future *ReplicationProtectedItemsCreateFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.CreateResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsCreateFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsDeleteFuture.Result. +func (future *ReplicationProtectedItemsDeleteFuture) result(client ReplicationProtectedItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectedItemsFailoverCancelFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsFailoverCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsFailoverCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsFailoverCancelFuture.Result. +func (future *ReplicationProtectedItemsFailoverCancelFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsFailoverCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.FailoverCancelResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCancelFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsFailoverCommitFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsFailoverCommitFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsFailoverCommitFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsFailoverCommitFuture.Result. +func (future *ReplicationProtectedItemsFailoverCommitFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCommitFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsFailoverCommitFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.FailoverCommitResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCommitFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsPlannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsPlannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsPlannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsPlannedFailoverFuture.Result. +func (future *ReplicationProtectedItemsPlannedFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPlannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsPlannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.PlannedFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPlannedFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsPurgeFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsPurgeFuture.Result. +func (future *ReplicationProtectedItemsPurgeFuture) result(client ReplicationProtectedItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectedItemsRemoveDisksFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsRemoveDisksFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsRemoveDisksFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsRemoveDisksFuture.Result. +func (future *ReplicationProtectedItemsRemoveDisksFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRemoveDisksFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsRemoveDisksFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.RemoveDisksResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRemoveDisksFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsRepairReplicationFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsRepairReplicationFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsRepairReplicationFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsRepairReplicationFuture.Result. +func (future *ReplicationProtectedItemsRepairReplicationFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRepairReplicationFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsRepairReplicationFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.RepairReplicationResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRepairReplicationFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsReprotectFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsReprotectFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsReprotectFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsReprotectFuture.Result. +func (future *ReplicationProtectedItemsReprotectFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsReprotectFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsReprotectFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ReprotectResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsReprotectFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsResolveHealthErrorsFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsResolveHealthErrorsFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsResolveHealthErrorsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsResolveHealthErrorsFuture.Result. +func (future *ReplicationProtectedItemsResolveHealthErrorsFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ResolveHealthErrorsResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsTestFailoverCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsTestFailoverCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsTestFailoverCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsTestFailoverCleanupFuture.Result. +func (future *ReplicationProtectedItemsTestFailoverCleanupFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.TestFailoverCleanupResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsTestFailoverFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectedItemsTestFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsTestFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsTestFailoverFuture.Result. +func (future *ReplicationProtectedItemsTestFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsTestFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.TestFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUnplannedFailoverFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsUnplannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUnplannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUnplannedFailoverFuture.Result. +func (future *ReplicationProtectedItemsUnplannedFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UnplannedFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateApplianceFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsUpdateApplianceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateApplianceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateApplianceFuture.Result. +func (future *ReplicationProtectedItemsUpdateApplianceFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateApplianceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateApplianceFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateApplianceResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateApplianceFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateFuture.Result. +func (future *ReplicationProtectedItemsUpdateFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateMobilityServiceFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsUpdateMobilityServiceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateMobilityServiceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateMobilityServiceFuture.Result. +func (future *ReplicationProtectedItemsUpdateMobilityServiceFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateMobilityServiceResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainerMappingsCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (ProtectionContainerMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsCreateFuture.Result. +func (future *ReplicationProtectionContainerMappingsCreateFuture) result(client ReplicationProtectionContainerMappingsClient) (pcm ProtectionContainerMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pcm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pcm.Response.Response, err = future.GetResult(sender); err == nil && pcm.Response.Response.StatusCode != http.StatusNoContent { + pcm, err = client.CreateResponder(pcm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsCreateFuture", "Result", pcm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainerMappingsDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsDeleteFuture.Result. +func (future *ReplicationProtectionContainerMappingsDeleteFuture) result(client ReplicationProtectionContainerMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainerMappingsPurgeFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsPurgeFuture.Result. +func (future *ReplicationProtectionContainerMappingsPurgeFuture) result(client ReplicationProtectionContainerMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainerMappingsUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (ProtectionContainerMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsUpdateFuture.Result. +func (future *ReplicationProtectionContainerMappingsUpdateFuture) result(client ReplicationProtectionContainerMappingsClient) (pcm ProtectionContainerMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pcm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pcm.Response.Response, err = future.GetResult(sender); err == nil && pcm.Response.Response.StatusCode != http.StatusNoContent { + pcm, err = client.UpdateResponder(pcm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsUpdateFuture", "Result", pcm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersCreateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectionContainersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersCreateFuture.Result. +func (future *ReplicationProtectionContainersCreateFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.CreateResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersCreateFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersDeleteFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectionContainersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersDeleteFuture.Result. +func (future *ReplicationProtectionContainersDeleteFuture) result(client ReplicationProtectionContainersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainersDiscoverProtectableItemFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type ReplicationProtectionContainersDiscoverProtectableItemFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersDiscoverProtectableItemFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersDiscoverProtectableItemFuture.Result. +func (future *ReplicationProtectionContainersDiscoverProtectableItemFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.DiscoverProtectableItemResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersSwitchProtectionFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainersSwitchProtectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersSwitchProtectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersSwitchProtectionFuture.Result. +func (future *ReplicationProtectionContainersSwitchProtectionFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersSwitchProtectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersSwitchProtectionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.SwitchProtectionResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersSwitchProtectionFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionIntent replication protection intent. +type ReplicationProtectionIntent struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ReplicationProtectionIntentProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntent. +func (rpi ReplicationProtectionIntent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpi.Properties != nil { + objectMap["properties"] = rpi.Properties + } + if rpi.Location != nil { + objectMap["location"] = rpi.Location + } + return json.Marshal(objectMap) +} + +// ReplicationProtectionIntentCollection replication protection intent objects collection. +type ReplicationProtectionIntentCollection struct { + autorest.Response `json:"-"` + // Value - The Replication protection intent details. + Value *[]ReplicationProtectionIntent `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ReplicationProtectionIntentCollectionIterator provides access to a complete listing of +// ReplicationProtectionIntent values. +type ReplicationProtectionIntentCollectionIterator struct { + i int + page ReplicationProtectionIntentCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ReplicationProtectionIntentCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ReplicationProtectionIntentCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ReplicationProtectionIntentCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ReplicationProtectionIntentCollectionIterator) Response() ReplicationProtectionIntentCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ReplicationProtectionIntentCollectionIterator) Value() ReplicationProtectionIntent { + if !iter.page.NotDone() { + return ReplicationProtectionIntent{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ReplicationProtectionIntentCollectionIterator type. +func NewReplicationProtectionIntentCollectionIterator(page ReplicationProtectionIntentCollectionPage) ReplicationProtectionIntentCollectionIterator { + return ReplicationProtectionIntentCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rpic ReplicationProtectionIntentCollection) IsEmpty() bool { + return rpic.Value == nil || len(*rpic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rpic ReplicationProtectionIntentCollection) hasNextLink() bool { + return rpic.NextLink != nil && len(*rpic.NextLink) != 0 +} + +// replicationProtectionIntentCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rpic ReplicationProtectionIntentCollection) replicationProtectionIntentCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rpic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rpic.NextLink))) +} + +// ReplicationProtectionIntentCollectionPage contains a page of ReplicationProtectionIntent values. +type ReplicationProtectionIntentCollectionPage struct { + fn func(context.Context, ReplicationProtectionIntentCollection) (ReplicationProtectionIntentCollection, error) + rpic ReplicationProtectionIntentCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ReplicationProtectionIntentCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rpic) + if err != nil { + return err + } + page.rpic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ReplicationProtectionIntentCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ReplicationProtectionIntentCollectionPage) NotDone() bool { + return !page.rpic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ReplicationProtectionIntentCollectionPage) Response() ReplicationProtectionIntentCollection { + return page.rpic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ReplicationProtectionIntentCollectionPage) Values() []ReplicationProtectionIntent { + if page.rpic.IsEmpty() { + return nil + } + return *page.rpic.Value +} + +// Creates a new instance of the ReplicationProtectionIntentCollectionPage type. +func NewReplicationProtectionIntentCollectionPage(cur ReplicationProtectionIntentCollection, getNextPage func(context.Context, ReplicationProtectionIntentCollection) (ReplicationProtectionIntentCollection, error)) ReplicationProtectionIntentCollectionPage { + return ReplicationProtectionIntentCollectionPage{ + fn: getNextPage, + rpic: cur, + } +} + +// ReplicationProtectionIntentProperties replication protection intent custom data details. +type ReplicationProtectionIntentProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // JobID - READ-ONLY; The job Id. + JobID *string `json:"jobId,omitempty"` + // JobState - READ-ONLY; The job state. + JobState *string `json:"jobState,omitempty"` + // IsActive - READ-ONLY; A value indicating whether the intent object is active. + IsActive *bool `json:"isActive,omitempty"` + // CreationTimeUTC - READ-ONLY; The creation time in UTC. + CreationTimeUTC *string `json:"creationTimeUTC,omitempty"` + // ProviderSpecificDetails - The Replication provider custom settings. + ProviderSpecificDetails BasicReplicationProtectionIntentProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntentProperties. +func (rpip ReplicationProtectionIntentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpip.FriendlyName != nil { + objectMap["friendlyName"] = rpip.FriendlyName + } + objectMap["providerSpecificDetails"] = rpip.ProviderSpecificDetails + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ReplicationProtectionIntentProperties struct. +func (rpip *ReplicationProtectionIntentProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpip.FriendlyName = &friendlyName + } + case "jobId": + if v != nil { + var jobID string + err = json.Unmarshal(*v, &jobID) + if err != nil { + return err + } + rpip.JobID = &jobID + } + case "jobState": + if v != nil { + var jobState string + err = json.Unmarshal(*v, &jobState) + if err != nil { + return err + } + rpip.JobState = &jobState + } + case "isActive": + if v != nil { + var isActive bool + err = json.Unmarshal(*v, &isActive) + if err != nil { + return err + } + rpip.IsActive = &isActive + } + case "creationTimeUTC": + if v != nil { + var creationTimeUTC string + err = json.Unmarshal(*v, &creationTimeUTC) + if err != nil { + return err + } + rpip.CreationTimeUTC = &creationTimeUTC + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(*v) + if err != nil { + return err + } + rpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicReplicationProtectionIntentProviderSpecificSettings replication provider specific settings. +type BasicReplicationProtectionIntentProviderSpecificSettings interface { + AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) + AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) +} + +// ReplicationProtectionIntentProviderSpecificSettings replication provider specific settings. +type ReplicationProtectionIntentProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings', 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A' + InstanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(body []byte) (BasicReplicationProtectionIntentProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A): + var arid A2AReplicationIntentDetails + err := json.Unmarshal(body, &arid) + return arid, err + default: + var rpipss ReplicationProtectionIntentProviderSpecificSettings + err := json.Unmarshal(body, &rpipss) + return rpipss, err + } +} +func unmarshalBasicReplicationProtectionIntentProviderSpecificSettingsArray(body []byte) ([]BasicReplicationProtectionIntentProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpipssArray := make([]BasicReplicationProtectionIntentProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpipss, err := unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + rpipssArray[index] = rpipss + } + return rpipssArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) MarshalJSON() ([]byte, error) { + rpipss.InstanceType = InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings + objectMap := make(map[string]interface{}) + if rpipss.InstanceType != "" { + objectMap["instanceType"] = rpipss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReplicationIntentDetails is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) { + return nil, false +} + +// AsReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) { + return &rpipss, true +} + +// AsBasicReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsBasicReplicationProtectionIntentProviderSpecificSettings() (BasicReplicationProtectionIntentProviderSpecificSettings, bool) { + return &rpipss, true +} + +// ReplicationProviderContainerUnmappingInput provider specific input for unpairing operations. +type ReplicationProviderContainerUnmappingInput struct { + // InstanceType - The class type. + InstanceType *string `json:"instanceType,omitempty"` +} + +// BasicReplicationProviderSpecificContainerCreationInput provider specific input for container creation operation. +type BasicReplicationProviderSpecificContainerCreationInput interface { + AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) + AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) + AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) + AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) +} + +// ReplicationProviderSpecificContainerCreationInput provider specific input for container creation operation. +type ReplicationProviderSpecificContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificContainerCreationInput(body []byte) (BasicReplicationProviderSpecificContainerCreationInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A): + var acci A2AContainerCreationInput + err := json.Unmarshal(body, &acci) + return acci, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration): + var accmcci A2ACrossClusterMigrationContainerCreationInput + err := json.Unmarshal(body, &accmcci) + return accmcci, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt): + var vmccci VMwareCbtContainerCreationInput + err := json.Unmarshal(body, &vmccci) + return vmccci, err + default: + var rpscci ReplicationProviderSpecificContainerCreationInput + err := json.Unmarshal(body, &rpscci) + return rpscci, err + } +} +func unmarshalBasicReplicationProviderSpecificContainerCreationInputArray(body []byte) ([]BasicReplicationProviderSpecificContainerCreationInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpscciArray := make([]BasicReplicationProviderSpecificContainerCreationInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpscci, err := unmarshalBasicReplicationProviderSpecificContainerCreationInput(*rawMessage) + if err != nil { + return nil, err + } + rpscciArray[index] = rpscci + } + return rpscciArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) MarshalJSON() ([]byte, error) { + rpscci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput + objectMap := make(map[string]interface{}) + if rpscci.InstanceType != "" { + objectMap["instanceType"] = rpscci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return &rpscci, true +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &rpscci, true +} + +// BasicReplicationProviderSpecificContainerMappingInput provider specific input for pairing operations. +type BasicReplicationProviderSpecificContainerMappingInput interface { + AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) + AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) + AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) +} + +// ReplicationProviderSpecificContainerMappingInput provider specific input for pairing operations. +type ReplicationProviderSpecificContainerMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificContainerMappingInput(body []byte) (BasicReplicationProviderSpecificContainerMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A): + var acmi A2AContainerMappingInput + err := json.Unmarshal(body, &acmi) + return acmi, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt): + var vmccmi VMwareCbtContainerMappingInput + err := json.Unmarshal(body, &vmccmi) + return vmccmi, err + default: + var rpscmi ReplicationProviderSpecificContainerMappingInput + err := json.Unmarshal(body, &rpscmi) + return rpscmi, err + } +} +func unmarshalBasicReplicationProviderSpecificContainerMappingInputArray(body []byte) ([]BasicReplicationProviderSpecificContainerMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpscmiArray := make([]BasicReplicationProviderSpecificContainerMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpscmi, err := unmarshalBasicReplicationProviderSpecificContainerMappingInput(*rawMessage) + if err != nil { + return nil, err + } + rpscmiArray[index] = rpscmi + } + return rpscmiArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) MarshalJSON() ([]byte, error) { + rpscmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput + objectMap := make(map[string]interface{}) + if rpscmi.InstanceType != "" { + objectMap["instanceType"] = rpscmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return &rpscmi, true +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &rpscmi, true +} + +// BasicReplicationProviderSpecificSettings replication provider specific settings. +type BasicReplicationProviderSpecificSettings interface { + AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) + AsA2AReplicationDetails() (*A2AReplicationDetails, bool) + AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) + AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) + AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) + AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) + AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) + AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) + AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) + AsInMageReplicationDetails() (*InMageReplicationDetails, bool) + AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) +} + +// ReplicationProviderSpecificSettings replication provider specific settings. +type ReplicationProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificSettings(body []byte) (BasicReplicationProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration): + var accmrd A2ACrossClusterMigrationReplicationDetails + err := json.Unmarshal(body, &accmrd) + return accmrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A): + var ard A2AReplicationDetails + err := json.Unmarshal(body, &ard) + return ard, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure): + var hvrard HyperVReplicaAzureReplicationDetails + err := json.Unmarshal(body, &hvrard) + return hvrard, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails): + var hvrbrd HyperVReplicaBaseReplicationDetails + err := json.Unmarshal(body, &hvrbrd) + return hvrbrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2): + var hvrbrd HyperVReplicaBlueReplicationDetails + err := json.Unmarshal(body, &hvrbrd) + return hvrbrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012): + var hvrrd HyperVReplicaReplicationDetails + err := json.Unmarshal(body, &hvrrd) + return hvrrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2): + var imavrd InMageAzureV2ReplicationDetails + err := json.Unmarshal(body, &imavrd) + return imavrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback): + var imrfrd InMageRcmFailbackReplicationDetails + err := json.Unmarshal(body, &imrfrd) + return imrfrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm): + var imrrd InMageRcmReplicationDetails + err := json.Unmarshal(body, &imrrd) + return imrrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage): + var imrd InMageReplicationDetails + err := json.Unmarshal(body, &imrd) + return imrd, err + default: + var rpss ReplicationProviderSpecificSettings + err := json.Unmarshal(body, &rpss) + return rpss, err + } +} +func unmarshalBasicReplicationProviderSpecificSettingsArray(body []byte) ([]BasicReplicationProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpssArray := make([]BasicReplicationProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpss, err := unmarshalBasicReplicationProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + rpssArray[index] = rpss + } + return rpssArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) MarshalJSON() ([]byte, error) { + rpss.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings + objectMap := make(map[string]interface{}) + if rpss.InstanceType != "" { + objectMap["instanceType"] = rpss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return &rpss, true +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &rpss, true +} + +// BasicReplicationProviderSpecificUpdateContainerMappingInput provider specific input for update pairing operations. +type BasicReplicationProviderSpecificUpdateContainerMappingInput interface { + AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) + AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) + AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) +} + +// ReplicationProviderSpecificUpdateContainerMappingInput provider specific input for update pairing +// operations. +type ReplicationProviderSpecificUpdateContainerMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(body []byte) (BasicReplicationProviderSpecificUpdateContainerMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A): + var aucmi A2AUpdateContainerMappingInput + err := json.Unmarshal(body, &aucmi) + return aucmi, err + case string(InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm): + var imrucmi InMageRcmUpdateContainerMappingInput + err := json.Unmarshal(body, &imrucmi) + return imrucmi, err + default: + var rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput + err := json.Unmarshal(body, &rpsucmi) + return rpsucmi, err + } +} +func unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInputArray(body []byte) ([]BasicReplicationProviderSpecificUpdateContainerMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpsucmiArray := make([]BasicReplicationProviderSpecificUpdateContainerMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpsucmi, err := unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(*rawMessage) + if err != nil { + return nil, err + } + rpsucmiArray[index] = rpsucmi + } + return rpsucmiArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + rpsucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput + objectMap := make(map[string]interface{}) + if rpsucmi.InstanceType != "" { + objectMap["instanceType"] = rpsucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &rpsucmi, true +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &rpsucmi, true +} + +// ReplicationRecoveryPlansCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansCreateFuture.Result. +func (future *ReplicationRecoveryPlansCreateFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.CreateResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansCreateFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansDeleteFuture.Result. +func (future *ReplicationRecoveryPlansDeleteFuture) result(client ReplicationRecoveryPlansClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryPlansFailoverCancelFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationRecoveryPlansFailoverCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansFailoverCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansFailoverCancelFuture.Result. +func (future *ReplicationRecoveryPlansFailoverCancelFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansFailoverCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.FailoverCancelResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCancelFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansFailoverCommitFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationRecoveryPlansFailoverCommitFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansFailoverCommitFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansFailoverCommitFuture.Result. +func (future *ReplicationRecoveryPlansFailoverCommitFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCommitFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansFailoverCommitFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.FailoverCommitResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCommitFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansPlannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryPlansPlannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansPlannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansPlannedFailoverFuture.Result. +func (future *ReplicationRecoveryPlansPlannedFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.PlannedFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansReprotectFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansReprotectFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansReprotectFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansReprotectFuture.Result. +func (future *ReplicationRecoveryPlansReprotectFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansReprotectFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansReprotectFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.ReprotectResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansReprotectFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansTestFailoverCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryPlansTestFailoverCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansTestFailoverCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansTestFailoverCleanupFuture.Result. +func (future *ReplicationRecoveryPlansTestFailoverCleanupFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.TestFailoverCleanupResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansTestFailoverFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansTestFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansTestFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansTestFailoverFuture.Result. +func (future *ReplicationRecoveryPlansTestFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansTestFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.TestFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansUnplannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryPlansUnplannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansUnplannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansUnplannedFailoverFuture.Result. +func (future *ReplicationRecoveryPlansUnplannedFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.UnplannedFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansUpdateFuture.Result. +func (future *ReplicationRecoveryPlansUpdateFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.UpdateResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUpdateFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryServicesProvidersCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryServicesProvidersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (RecoveryServicesProvider, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersCreateFuture.Result. +func (future *ReplicationRecoveryServicesProvidersCreateFuture) result(client ReplicationRecoveryServicesProvidersClient) (rsp RecoveryServicesProvider, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rsp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rsp.Response.Response, err = future.GetResult(sender); err == nil && rsp.Response.Response.StatusCode != http.StatusNoContent { + rsp, err = client.CreateResponder(rsp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersCreateFuture", "Result", rsp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryServicesProvidersDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryServicesProvidersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersDeleteFuture.Result. +func (future *ReplicationRecoveryServicesProvidersDeleteFuture) result(client ReplicationRecoveryServicesProvidersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryServicesProvidersPurgeFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryServicesProvidersPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersPurgeFuture.Result. +func (future *ReplicationRecoveryServicesProvidersPurgeFuture) result(client ReplicationRecoveryServicesProvidersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryServicesProvidersRefreshProviderFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type ReplicationRecoveryServicesProvidersRefreshProviderFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (RecoveryServicesProvider, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersRefreshProviderFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersRefreshProviderFuture.Result. +func (future *ReplicationRecoveryServicesProvidersRefreshProviderFuture) result(client ReplicationRecoveryServicesProvidersClient) (rsp RecoveryServicesProvider, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rsp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rsp.Response.Response, err = future.GetResult(sender); err == nil && rsp.Response.Response.StatusCode != http.StatusNoContent { + rsp, err = client.RefreshProviderResponder(rsp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture", "Result", rsp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationStorageClassificationMappingsCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationStorageClassificationMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationStorageClassificationMappingsClient) (StorageClassificationMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationStorageClassificationMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationStorageClassificationMappingsCreateFuture.Result. +func (future *ReplicationStorageClassificationMappingsCreateFuture) result(client ReplicationStorageClassificationMappingsClient) (scm StorageClassificationMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + scm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationStorageClassificationMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if scm.Response.Response, err = future.GetResult(sender); err == nil && scm.Response.Response.StatusCode != http.StatusNoContent { + scm, err = client.CreateResponder(scm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsCreateFuture", "Result", scm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationStorageClassificationMappingsDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationStorageClassificationMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationStorageClassificationMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationStorageClassificationMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationStorageClassificationMappingsDeleteFuture.Result. +func (future *ReplicationStorageClassificationMappingsDeleteFuture) result(client ReplicationStorageClassificationMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationStorageClassificationMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationVaultHealthRefreshFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationVaultHealthRefreshFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationVaultHealthClient) (VaultHealthDetails, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationVaultHealthRefreshFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationVaultHealthRefreshFuture.Result. +func (future *ReplicationVaultHealthRefreshFuture) result(client ReplicationVaultHealthClient) (vhd VaultHealthDetails, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthRefreshFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vhd.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationVaultHealthRefreshFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vhd.Response.Response, err = future.GetResult(sender); err == nil && vhd.Response.Response.StatusCode != http.StatusNoContent { + vhd, err = client.RefreshResponder(vhd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthRefreshFuture", "Result", vhd.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationVaultSettingCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationVaultSettingCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationVaultSettingClient) (VaultSetting, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationVaultSettingCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationVaultSettingCreateFuture.Result. +func (future *ReplicationVaultSettingCreateFuture) result(client ReplicationVaultSettingClient) (vs VaultSetting, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vs.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationVaultSettingCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vs.Response.Response, err = future.GetResult(sender); err == nil && vs.Response.Response.StatusCode != http.StatusNoContent { + vs, err = client.CreateResponder(vs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingCreateFuture", "Result", vs.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationvCentersCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (VCenter, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersCreateFuture.Result. +func (future *ReplicationvCentersCreateFuture) result(client ReplicationvCentersClient) (vc VCenter, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent { + vc, err = client.CreateResponder(vc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersCreateFuture", "Result", vc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationvCentersDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersDeleteFuture.Result. +func (future *ReplicationvCentersDeleteFuture) result(client ReplicationvCentersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationvCentersUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (VCenter, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersUpdateFuture.Result. +func (future *ReplicationvCentersUpdateFuture) result(client ReplicationvCentersClient) (vc VCenter, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent { + vc, err = client.UpdateResponder(vc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersUpdateFuture", "Result", vc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReprotectAgentDetails reprotect agent details. +type ReprotectAgentDetails struct { + // ID - READ-ONLY; The reprotect agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The reprotect agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The reprotect agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The reprotect agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the reprotect agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the reprotect agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // ProtectedItemCount - READ-ONLY; The protected item count. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // AccessibleDatastores - READ-ONLY; The list of accessible datastores fetched from discovery. + AccessibleDatastores *[]string `json:"accessibleDatastores,omitempty"` + // VcenterID - READ-ONLY; The Vcenter Id. + VcenterID *string `json:"vcenterId,omitempty"` + // LastDiscoveryInUtc - READ-ONLY; The last time when SDS information discovered in SRS. + LastDiscoveryInUtc *date.Time `json:"lastDiscoveryInUtc,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReprotectAgentDetails. +func (rad ReprotectAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResolveHealthError resolve health errors input properties. +type ResolveHealthError struct { + // HealthErrorID - Health error id. + HealthErrorID *string `json:"healthErrorId,omitempty"` +} + +// ResolveHealthInput resolve health input. +type ResolveHealthInput struct { + // Properties - Disable resolve health input properties. + Properties *ResolveHealthInputProperties `json:"properties,omitempty"` +} + +// ResolveHealthInputProperties resolve health input properties. +type ResolveHealthInputProperties struct { + // HealthErrors - Health errors. + HealthErrors *[]ResolveHealthError `json:"healthErrors,omitempty"` +} + +// Resource azure resource. +type Resource struct { + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location + } + return json.Marshal(objectMap) +} + +// ResourceHealthSummary base class to define the health summary of the resources contained under an Arm +// resource. +type ResourceHealthSummary struct { + // ResourceCount - The count of total resources under the container. + ResourceCount *int32 `json:"resourceCount,omitempty"` + // Issues - The list of summary of health errors across the resources under the container. + Issues *[]HealthErrorSummary `json:"issues,omitempty"` + // CategorizedResourceCounts - The categorized resource counts. + CategorizedResourceCounts map[string]*int32 `json:"categorizedResourceCounts"` +} + +// MarshalJSON is the custom marshaler for ResourceHealthSummary. +func (RHS ResourceHealthSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if RHS.ResourceCount != nil { + objectMap["resourceCount"] = RHS.ResourceCount + } + if RHS.Issues != nil { + objectMap["issues"] = RHS.Issues + } + if RHS.CategorizedResourceCounts != nil { + objectMap["categorizedResourceCounts"] = RHS.CategorizedResourceCounts + } + return json.Marshal(objectMap) +} + +// ResumeJobParams resume job params. +type ResumeJobParams struct { + // Properties - Resume job properties. + Properties *ResumeJobParamsProperties `json:"properties,omitempty"` +} + +// ResumeJobParamsProperties resume job properties. +type ResumeJobParamsProperties struct { + // Comments - Resume job comments. + Comments *string `json:"comments,omitempty"` +} + +// ResyncInput resync input. +type ResyncInput struct { + // Properties - Resync input properties. + Properties *ResyncInputProperties `json:"properties,omitempty"` +} + +// ResyncInputProperties resync input properties. +type ResyncInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicResyncProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ResyncInputProperties struct. +func (rip *ResyncInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicResyncProviderSpecificInput(*v) + if err != nil { + return err + } + rip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicResyncProviderSpecificInput resync provider specific input. +type BasicResyncProviderSpecificInput interface { + AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) + AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) +} + +// ResyncProviderSpecificInput resync provider specific input. +type ResyncProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput', 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicResyncProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicResyncProviderSpecificInput(body []byte) (BasicResyncProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt): + var vmcri VMwareCbtResyncInput + err := json.Unmarshal(body, &vmcri) + return vmcri, err + default: + var rpsi ResyncProviderSpecificInput + err := json.Unmarshal(body, &rpsi) + return rpsi, err + } +} +func unmarshalBasicResyncProviderSpecificInputArray(body []byte) ([]BasicResyncProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpsiArray := make([]BasicResyncProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpsi, err := unmarshalBasicResyncProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rpsiArray[index] = rpsi + } + return rpsiArray, nil +} + +// MarshalJSON is the custom marshaler for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) MarshalJSON() ([]byte, error) { + rpsi.InstanceType = InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput + objectMap := make(map[string]interface{}) + if rpsi.InstanceType != "" { + objectMap["instanceType"] = rpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtResyncInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) { + return nil, false +} + +// AsResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) { + return &rpsi, true +} + +// AsBasicResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsBasicResyncProviderSpecificInput() (BasicResyncProviderSpecificInput, bool) { + return &rpsi, true +} + +// RetentionVolume the retention details of the MT. +type RetentionVolume struct { + // VolumeName - The volume name. + VolumeName *string `json:"volumeName,omitempty"` + // CapacityInBytes - The volume capacity. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // FreeSpaceInBytes - The free space available in this volume. + FreeSpaceInBytes *int64 `json:"freeSpaceInBytes,omitempty"` + // ThresholdPercentage - The threshold percentage. + ThresholdPercentage *int32 `json:"thresholdPercentage,omitempty"` +} + +// ReverseReplicationInput reverse replication input. +type ReverseReplicationInput struct { + // Properties - Reverse replication properties. + Properties *ReverseReplicationInputProperties `json:"properties,omitempty"` +} + +// ReverseReplicationInputProperties reverse replication input properties. +type ReverseReplicationInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - Provider specific reverse replication input. + ProviderSpecificDetails BasicReverseReplicationProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ReverseReplicationInputProperties struct. +func (rrip *ReverseReplicationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rrip.FailoverDirection = &failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReverseReplicationProviderSpecificInput(*v) + if err != nil { + return err + } + rrip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicReverseReplicationProviderSpecificInput provider specific reverse replication input. +type BasicReverseReplicationProviderSpecificInput interface { + AsA2AReprotectInput() (*A2AReprotectInput, bool) + AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) + AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) + AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) + AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) + AsInMageReprotectInput() (*InMageReprotectInput, bool) + AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) +} + +// ReverseReplicationProviderSpecificInput provider specific reverse replication input. +type ReverseReplicationProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReverseReplicationProviderSpecificInput(body []byte) (BasicReverseReplicationProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A): + var ari A2AReprotectInput + err := json.Unmarshal(body, &ari) + return ari, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvrari HyperVReplicaAzureReprotectInput + err := json.Unmarshal(body, &hvrari) + return hvrari, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2): + var imavri InMageAzureV2ReprotectInput + err := json.Unmarshal(body, &imavri) + return imavri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback): + var imrfri InMageRcmFailbackReprotectInput + err := json.Unmarshal(body, &imrfri) + return imrfri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm): + var imrri InMageRcmReprotectInput + err := json.Unmarshal(body, &imrri) + return imrri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage): + var imri InMageReprotectInput + err := json.Unmarshal(body, &imri) + return imri, err + default: + var rrpsi ReverseReplicationProviderSpecificInput + err := json.Unmarshal(body, &rrpsi) + return rrpsi, err + } +} +func unmarshalBasicReverseReplicationProviderSpecificInputArray(body []byte) ([]BasicReverseReplicationProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rrpsiArray := make([]BasicReverseReplicationProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rrpsi, err := unmarshalBasicReverseReplicationProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rrpsiArray[index] = rrpsi + } + return rrpsiArray, nil +} + +// MarshalJSON is the custom marshaler for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) MarshalJSON() ([]byte, error) { + rrpsi.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput + objectMap := make(map[string]interface{}) + if rrpsi.InstanceType != "" { + objectMap["instanceType"] = rrpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return &rrpsi, true +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &rrpsi, true +} + +// RoleAssignment azure role assignment details. +type RoleAssignment struct { + // ID - The ARM Id of the role assignment. + ID *string `json:"id,omitempty"` + // Name - The name of the role assignment. + Name *string `json:"name,omitempty"` + // Scope - Role assignment scope. + Scope *string `json:"scope,omitempty"` + // PrincipalID - Principal Id. + PrincipalID *string `json:"principalId,omitempty"` + // RoleDefinitionID - Role definition id. + RoleDefinitionID *string `json:"roleDefinitionId,omitempty"` +} + +// RunAsAccount CS Accounts Details. +type RunAsAccount struct { + // AccountID - The CS RunAs account Id. + AccountID *string `json:"accountId,omitempty"` + // AccountName - The CS RunAs account name. + AccountName *string `json:"accountName,omitempty"` +} + +// ScriptActionTaskDetails this class represents the script action task details. +type ScriptActionTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // Path - The path. + Path *string `json:"path,omitempty"` + // Output - The output. + Output *string `json:"output,omitempty"` + // IsPrimarySideScript - A value indicating whether it is a primary side script or not. + IsPrimarySideScript *bool `json:"isPrimarySideScript,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) MarshalJSON() ([]byte, error) { + satd.InstanceType = InstanceTypeScriptActionTaskDetails + objectMap := make(map[string]interface{}) + if satd.Name != nil { + objectMap["name"] = satd.Name + } + if satd.Path != nil { + objectMap["path"] = satd.Path + } + if satd.Output != nil { + objectMap["output"] = satd.Output + } + if satd.IsPrimarySideScript != nil { + objectMap["isPrimarySideScript"] = satd.IsPrimarySideScript + } + if satd.InstanceType != "" { + objectMap["instanceType"] = satd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return &satd, true +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &satd, true +} + +// ServiceError ASR error model. +type ServiceError struct { + // Code - Error code. + Code *string `json:"code,omitempty"` + // Message - Error message. + Message *string `json:"message,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ActivityID - Activity Id. + ActivityID *string `json:"activityId,omitempty"` +} + +// BasicStorageAccountCustomDetails storage account custom input. +type BasicStorageAccountCustomDetails interface { + AsExistingStorageAccount() (*ExistingStorageAccount, bool) + AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) +} + +// StorageAccountCustomDetails storage account custom input. +type StorageAccountCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails', 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicStorageAccountCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicStorageAccountCustomDetails(body []byte) (BasicStorageAccountCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting): + var esa ExistingStorageAccount + err := json.Unmarshal(body, &esa) + return esa, err + default: + var sacd StorageAccountCustomDetails + err := json.Unmarshal(body, &sacd) + return sacd, err + } +} +func unmarshalBasicStorageAccountCustomDetailsArray(body []byte) ([]BasicStorageAccountCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sacdArray := make([]BasicStorageAccountCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sacd, err := unmarshalBasicStorageAccountCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + sacdArray[index] = sacd + } + return sacdArray, nil +} + +// MarshalJSON is the custom marshaler for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) MarshalJSON() ([]byte, error) { + sacd.ResourceType = ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails + objectMap := make(map[string]interface{}) + if sacd.ResourceType != "" { + objectMap["resourceType"] = sacd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingStorageAccount is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsExistingStorageAccount() (*ExistingStorageAccount, bool) { + return nil, false +} + +// AsStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) { + return &sacd, true +} + +// AsBasicStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsBasicStorageAccountCustomDetails() (BasicStorageAccountCustomDetails, bool) { + return &sacd, true +} + +// StorageClassification storage object definition. +type StorageClassification struct { + autorest.Response `json:"-"` + // Properties - Properties of the storage object. + Properties *StorageClassificationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageClassification. +func (sc StorageClassification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sc.Properties != nil { + objectMap["properties"] = sc.Properties + } + if sc.Location != nil { + objectMap["location"] = sc.Location + } + return json.Marshal(objectMap) +} + +// StorageClassificationCollection collection of storage details. +type StorageClassificationCollection struct { + autorest.Response `json:"-"` + // Value - The storage details. + Value *[]StorageClassification `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// StorageClassificationCollectionIterator provides access to a complete listing of StorageClassification +// values. +type StorageClassificationCollectionIterator struct { + i int + page StorageClassificationCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StorageClassificationCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StorageClassificationCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StorageClassificationCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StorageClassificationCollectionIterator) Response() StorageClassificationCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StorageClassificationCollectionIterator) Value() StorageClassification { + if !iter.page.NotDone() { + return StorageClassification{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StorageClassificationCollectionIterator type. +func NewStorageClassificationCollectionIterator(page StorageClassificationCollectionPage) StorageClassificationCollectionIterator { + return StorageClassificationCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scc StorageClassificationCollection) IsEmpty() bool { + return scc.Value == nil || len(*scc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scc StorageClassificationCollection) hasNextLink() bool { + return scc.NextLink != nil && len(*scc.NextLink) != 0 +} + +// storageClassificationCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scc StorageClassificationCollection) storageClassificationCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !scc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scc.NextLink))) +} + +// StorageClassificationCollectionPage contains a page of StorageClassification values. +type StorageClassificationCollectionPage struct { + fn func(context.Context, StorageClassificationCollection) (StorageClassificationCollection, error) + scc StorageClassificationCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StorageClassificationCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.scc) + if err != nil { + return err + } + page.scc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StorageClassificationCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StorageClassificationCollectionPage) NotDone() bool { + return !page.scc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StorageClassificationCollectionPage) Response() StorageClassificationCollection { + return page.scc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StorageClassificationCollectionPage) Values() []StorageClassification { + if page.scc.IsEmpty() { + return nil + } + return *page.scc.Value +} + +// Creates a new instance of the StorageClassificationCollectionPage type. +func NewStorageClassificationCollectionPage(cur StorageClassificationCollection, getNextPage func(context.Context, StorageClassificationCollection) (StorageClassificationCollection, error)) StorageClassificationCollectionPage { + return StorageClassificationCollectionPage{ + fn: getNextPage, + scc: cur, + } +} + +// StorageClassificationMapping storage mapping object. +type StorageClassificationMapping struct { + autorest.Response `json:"-"` + // Properties - Properties of the storage mapping object. + Properties *StorageClassificationMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageClassificationMapping. +func (scm StorageClassificationMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scm.Properties != nil { + objectMap["properties"] = scm.Properties + } + if scm.Location != nil { + objectMap["location"] = scm.Location + } + return json.Marshal(objectMap) +} + +// StorageClassificationMappingCollection collection of storage mapping details. +type StorageClassificationMappingCollection struct { + autorest.Response `json:"-"` + // Value - The storage details. + Value *[]StorageClassificationMapping `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// StorageClassificationMappingCollectionIterator provides access to a complete listing of +// StorageClassificationMapping values. +type StorageClassificationMappingCollectionIterator struct { + i int + page StorageClassificationMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StorageClassificationMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StorageClassificationMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StorageClassificationMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StorageClassificationMappingCollectionIterator) Response() StorageClassificationMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StorageClassificationMappingCollectionIterator) Value() StorageClassificationMapping { + if !iter.page.NotDone() { + return StorageClassificationMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StorageClassificationMappingCollectionIterator type. +func NewStorageClassificationMappingCollectionIterator(page StorageClassificationMappingCollectionPage) StorageClassificationMappingCollectionIterator { + return StorageClassificationMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scmc StorageClassificationMappingCollection) IsEmpty() bool { + return scmc.Value == nil || len(*scmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scmc StorageClassificationMappingCollection) hasNextLink() bool { + return scmc.NextLink != nil && len(*scmc.NextLink) != 0 +} + +// storageClassificationMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scmc StorageClassificationMappingCollection) storageClassificationMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !scmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scmc.NextLink))) +} + +// StorageClassificationMappingCollectionPage contains a page of StorageClassificationMapping values. +type StorageClassificationMappingCollectionPage struct { + fn func(context.Context, StorageClassificationMappingCollection) (StorageClassificationMappingCollection, error) + scmc StorageClassificationMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StorageClassificationMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.scmc) + if err != nil { + return err + } + page.scmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StorageClassificationMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StorageClassificationMappingCollectionPage) NotDone() bool { + return !page.scmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StorageClassificationMappingCollectionPage) Response() StorageClassificationMappingCollection { + return page.scmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StorageClassificationMappingCollectionPage) Values() []StorageClassificationMapping { + if page.scmc.IsEmpty() { + return nil + } + return *page.scmc.Value +} + +// Creates a new instance of the StorageClassificationMappingCollectionPage type. +func NewStorageClassificationMappingCollectionPage(cur StorageClassificationMappingCollection, getNextPage func(context.Context, StorageClassificationMappingCollection) (StorageClassificationMappingCollection, error)) StorageClassificationMappingCollectionPage { + return StorageClassificationMappingCollectionPage{ + fn: getNextPage, + scmc: cur, + } +} + +// StorageClassificationMappingInput storage mapping input. +type StorageClassificationMappingInput struct { + // Properties - Storage mapping input properties. + Properties *StorageMappingInputProperties `json:"properties,omitempty"` +} + +// StorageClassificationMappingProperties storage mapping properties. +type StorageClassificationMappingProperties struct { + // TargetStorageClassificationID - Target storage object Id. + TargetStorageClassificationID *string `json:"targetStorageClassificationId,omitempty"` +} + +// StorageClassificationProperties storage object properties. +type StorageClassificationProperties struct { + // FriendlyName - Friendly name of the Storage classification. + FriendlyName *string `json:"friendlyName,omitempty"` +} + +// StorageMappingInputProperties storage mapping input properties. +type StorageMappingInputProperties struct { + // TargetStorageClassificationID - The ID of the storage object. + TargetStorageClassificationID *string `json:"targetStorageClassificationId,omitempty"` +} + +// Subnet subnets of the network. +type Subnet struct { + // Name - The subnet name. + Name *string `json:"name,omitempty"` + // FriendlyName - The subnet friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // AddressList - The list of addresses for the subnet. + AddressList *[]string `json:"addressList,omitempty"` +} + +// SupportedOperatingSystems supported operating systems. +type SupportedOperatingSystems struct { + autorest.Response `json:"-"` + // Properties - The supported operating systems properties. + Properties *SupportedOSProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for SupportedOperatingSystems. +func (sos SupportedOperatingSystems) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sos.Properties != nil { + objectMap["properties"] = sos.Properties + } + if sos.Location != nil { + objectMap["location"] = sos.Location + } + return json.Marshal(objectMap) +} + +// SupportedOSDetails supported operating system details. +type SupportedOSDetails struct { + // OsName - The name. + OsName *string `json:"osName,omitempty"` + // OsType - The type. + OsType *string `json:"osType,omitempty"` + // OsVersions - The list of version for operating system. + OsVersions *[]OSVersionWrapper `json:"osVersions,omitempty"` +} + +// SupportedOSProperties supported operating systems properties. +type SupportedOSProperties struct { + // SupportedOsList - The supported operating systems property list. + SupportedOsList *[]SupportedOSProperty `json:"supportedOsList,omitempty"` +} + +// SupportedOSProperty supported operating systems property. +type SupportedOSProperty struct { + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` + // SupportedOs - The list of supported operating systems. + SupportedOs *[]SupportedOSDetails `json:"supportedOs,omitempty"` +} + +// SwitchProtectionInput switch protection input. +type SwitchProtectionInput struct { + // Properties - Switch protection properties. + Properties *SwitchProtectionInputProperties `json:"properties,omitempty"` +} + +// SwitchProtectionInputProperties switch protection input properties. +type SwitchProtectionInputProperties struct { + // ReplicationProtectedItemName - The unique replication protected item name. + ReplicationProtectedItemName *string `json:"replicationProtectedItemName,omitempty"` + // ProviderSpecificDetails - Provider specific switch protection input. + ProviderSpecificDetails BasicSwitchProtectionProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SwitchProtectionInputProperties struct. +func (spip *SwitchProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "replicationProtectedItemName": + if v != nil { + var replicationProtectedItemName string + err = json.Unmarshal(*v, &replicationProtectedItemName) + if err != nil { + return err + } + spip.ReplicationProtectedItemName = &replicationProtectedItemName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicSwitchProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + spip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// SwitchProtectionJobDetails this class represents details for switch protection job. +type SwitchProtectionJobDetails struct { + // NewReplicationProtectedItemID - ARM Id of the new replication protected item. + NewReplicationProtectedItemID *string `json:"newReplicationProtectedItemId,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) MarshalJSON() ([]byte, error) { + spjd.InstanceType = InstanceTypeSwitchProtectionJobDetails + objectMap := make(map[string]interface{}) + if spjd.NewReplicationProtectedItemID != nil { + objectMap["newReplicationProtectedItemId"] = spjd.NewReplicationProtectedItemID + } + if spjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = spjd.AffectedObjectDetails + } + if spjd.InstanceType != "" { + objectMap["instanceType"] = spjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return &spjd, true +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &spjd, true +} + +// BasicSwitchProtectionProviderSpecificInput provider specific switch protection input. +type BasicSwitchProtectionProviderSpecificInput interface { + AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) + AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) +} + +// SwitchProtectionProviderSpecificInput provider specific switch protection input. +type SwitchProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput', 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicSwitchProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicSwitchProtectionProviderSpecificInput(body []byte) (BasicSwitchProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A): + var aspi A2ASwitchProtectionInput + err := json.Unmarshal(body, &aspi) + return aspi, err + default: + var sppsi SwitchProtectionProviderSpecificInput + err := json.Unmarshal(body, &sppsi) + return sppsi, err + } +} +func unmarshalBasicSwitchProtectionProviderSpecificInputArray(body []byte) ([]BasicSwitchProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sppsiArray := make([]BasicSwitchProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sppsi, err := unmarshalBasicSwitchProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + sppsiArray[index] = sppsi + } + return sppsiArray, nil +} + +// MarshalJSON is the custom marshaler for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + sppsi.InstanceType = InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if sppsi.InstanceType != "" { + objectMap["instanceType"] = sppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ASwitchProtectionInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) { + return nil, false +} + +// AsSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) { + return &sppsi, true +} + +// AsBasicSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsBasicSwitchProtectionProviderSpecificInput() (BasicSwitchProtectionProviderSpecificInput, bool) { + return &sppsi, true +} + +// TargetComputeSize represents applicable recovery vm sizes. +type TargetComputeSize struct { + // ID - The Id. + ID *string `json:"id,omitempty"` + // Name - The name. + Name *string `json:"name,omitempty"` + // Type - The Type of the object. + Type *string `json:"type,omitempty"` + // Properties - The custom data. + Properties *TargetComputeSizeProperties `json:"properties,omitempty"` +} + +// TargetComputeSizeCollection target compute size collection. +type TargetComputeSizeCollection struct { + autorest.Response `json:"-"` + // Value - The list of target compute sizes. + Value *[]TargetComputeSize `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// TargetComputeSizeCollectionIterator provides access to a complete listing of TargetComputeSize values. +type TargetComputeSizeCollectionIterator struct { + i int + page TargetComputeSizeCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *TargetComputeSizeCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizeCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *TargetComputeSizeCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TargetComputeSizeCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter TargetComputeSizeCollectionIterator) Response() TargetComputeSizeCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter TargetComputeSizeCollectionIterator) Value() TargetComputeSize { + if !iter.page.NotDone() { + return TargetComputeSize{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the TargetComputeSizeCollectionIterator type. +func NewTargetComputeSizeCollectionIterator(page TargetComputeSizeCollectionPage) TargetComputeSizeCollectionIterator { + return TargetComputeSizeCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (tcsc TargetComputeSizeCollection) IsEmpty() bool { + return tcsc.Value == nil || len(*tcsc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (tcsc TargetComputeSizeCollection) hasNextLink() bool { + return tcsc.NextLink != nil && len(*tcsc.NextLink) != 0 +} + +// targetComputeSizeCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tcsc TargetComputeSizeCollection) targetComputeSizeCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !tcsc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(tcsc.NextLink))) +} + +// TargetComputeSizeCollectionPage contains a page of TargetComputeSize values. +type TargetComputeSizeCollectionPage struct { + fn func(context.Context, TargetComputeSizeCollection) (TargetComputeSizeCollection, error) + tcsc TargetComputeSizeCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *TargetComputeSizeCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizeCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.tcsc) + if err != nil { + return err + } + page.tcsc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *TargetComputeSizeCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TargetComputeSizeCollectionPage) NotDone() bool { + return !page.tcsc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TargetComputeSizeCollectionPage) Response() TargetComputeSizeCollection { + return page.tcsc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TargetComputeSizeCollectionPage) Values() []TargetComputeSize { + if page.tcsc.IsEmpty() { + return nil + } + return *page.tcsc.Value +} + +// Creates a new instance of the TargetComputeSizeCollectionPage type. +func NewTargetComputeSizeCollectionPage(cur TargetComputeSizeCollection, getNextPage func(context.Context, TargetComputeSizeCollection) (TargetComputeSizeCollection, error)) TargetComputeSizeCollectionPage { + return TargetComputeSizeCollectionPage{ + fn: getNextPage, + tcsc: cur, + } +} + +// TargetComputeSizeProperties represents applicable recovery vm sizes properties. +type TargetComputeSizeProperties struct { + // Name - Target compute size name. + Name *string `json:"name,omitempty"` + // FriendlyName - Target compute size display name. + FriendlyName *string `json:"friendlyName,omitempty"` + // CPUCoresCount - The maximum cpu cores count supported by target compute size. + CPUCoresCount *int32 `json:"cpuCoresCount,omitempty"` + // VCPUsAvailable - READ-ONLY; The Available vCPUs supported by target compute size. + VCPUsAvailable *int32 `json:"vCPUsAvailable,omitempty"` + // MemoryInGB - The maximum memory in GB supported by target compute size. + MemoryInGB *float64 `json:"memoryInGB,omitempty"` + // MaxDataDiskCount - The maximum data disks count supported by target compute size. + MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` + // MaxNicsCount - The maximum Nics count supported by target compute size. + MaxNicsCount *int32 `json:"maxNicsCount,omitempty"` + // Errors - The reasons why the target compute size is not applicable for the protected item. + Errors *[]ComputeSizeErrorDetails `json:"errors,omitempty"` + // HighIopsSupported - The value indicating whether the target compute size supports high Iops. + HighIopsSupported *string `json:"highIopsSupported,omitempty"` + // HyperVGenerations - The supported HyperV Generations. + HyperVGenerations *[]string `json:"hyperVGenerations,omitempty"` +} + +// MarshalJSON is the custom marshaler for TargetComputeSizeProperties. +func (tcsp TargetComputeSizeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tcsp.Name != nil { + objectMap["name"] = tcsp.Name + } + if tcsp.FriendlyName != nil { + objectMap["friendlyName"] = tcsp.FriendlyName + } + if tcsp.CPUCoresCount != nil { + objectMap["cpuCoresCount"] = tcsp.CPUCoresCount + } + if tcsp.MemoryInGB != nil { + objectMap["memoryInGB"] = tcsp.MemoryInGB + } + if tcsp.MaxDataDiskCount != nil { + objectMap["maxDataDiskCount"] = tcsp.MaxDataDiskCount + } + if tcsp.MaxNicsCount != nil { + objectMap["maxNicsCount"] = tcsp.MaxNicsCount + } + if tcsp.Errors != nil { + objectMap["errors"] = tcsp.Errors + } + if tcsp.HighIopsSupported != nil { + objectMap["highIopsSupported"] = tcsp.HighIopsSupported + } + if tcsp.HyperVGenerations != nil { + objectMap["hyperVGenerations"] = tcsp.HyperVGenerations + } + return json.Marshal(objectMap) +} + +// BasicTaskTypeDetails task details based on specific task type. +type BasicTaskTypeDetails interface { + AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) + AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) + AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) + AsJobTaskDetails() (*JobTaskDetails, bool) + AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) + AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) + AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) + AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) + AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) + AsTaskTypeDetails() (*TaskTypeDetails, bool) +} + +// TaskTypeDetails task details based on specific task type. +type TaskTypeDetails struct { + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicTaskTypeDetails(body []byte) (BasicTaskTypeDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAutomationRunbookTaskDetails): + var artd AutomationRunbookTaskDetails + err := json.Unmarshal(body, &artd) + return artd, err + case string(InstanceTypeConsistencyCheckTaskDetails): + var cctd ConsistencyCheckTaskDetails + err := json.Unmarshal(body, &cctd) + return cctd, err + case string(InstanceTypeFabricReplicationGroupTaskDetails): + var frgtd FabricReplicationGroupTaskDetails + err := json.Unmarshal(body, &frgtd) + return frgtd, err + case string(InstanceTypeJobTaskDetails): + var jtd JobTaskDetails + err := json.Unmarshal(body, &jtd) + return jtd, err + case string(InstanceTypeManualActionTaskDetails): + var matd ManualActionTaskDetails + err := json.Unmarshal(body, &matd) + return matd, err + case string(InstanceTypeScriptActionTaskDetails): + var satd ScriptActionTaskDetails + err := json.Unmarshal(body, &satd) + return satd, err + case string(InstanceTypeVirtualMachineTaskDetails): + var vmtd VirtualMachineTaskDetails + err := json.Unmarshal(body, &vmtd) + return vmtd, err + case string(InstanceTypeVMNicUpdatesTaskDetails): + var vnutd VMNicUpdatesTaskDetails + err := json.Unmarshal(body, &vnutd) + return vnutd, err + default: + var ttd TaskTypeDetails + err := json.Unmarshal(body, &ttd) + return ttd, err + } +} +func unmarshalBasicTaskTypeDetailsArray(body []byte) ([]BasicTaskTypeDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ttdArray := make([]BasicTaskTypeDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ttd, err := unmarshalBasicTaskTypeDetails(*rawMessage) + if err != nil { + return nil, err + } + ttdArray[index] = ttd + } + return ttdArray, nil +} + +// MarshalJSON is the custom marshaler for TaskTypeDetails. +func (ttd TaskTypeDetails) MarshalJSON() ([]byte, error) { + ttd.InstanceType = InstanceTypeTaskTypeDetails + objectMap := make(map[string]interface{}) + if ttd.InstanceType != "" { + objectMap["instanceType"] = ttd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return &ttd, true +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &ttd, true +} + +// TestFailoverCleanupInput input definition for test failover cleanup. +type TestFailoverCleanupInput struct { + // Properties - Test failover cleanup input properties. + Properties *TestFailoverCleanupInputProperties `json:"properties,omitempty"` +} + +// TestFailoverCleanupInputProperties input definition for test failover cleanup input properties. +type TestFailoverCleanupInputProperties struct { + // Comments - Test failover cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// TestFailoverInput input definition for test failover. +type TestFailoverInput struct { + // Properties - Test failover input properties. + Properties *TestFailoverInputProperties `json:"properties,omitempty"` +} + +// TestFailoverInputProperties input definition for test failover input properties. +type TestFailoverInputProperties struct { + // FailoverDirection - Test failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // NetworkType - Network type to be used for test failover. + NetworkType *string `json:"networkType,omitempty"` + // NetworkID - The id of the network to be used for test failover. + NetworkID *string `json:"networkId,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicTestFailoverProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TestFailoverInputProperties struct. +func (tfip *TestFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + tfip.FailoverDirection = &failoverDirection + } + case "networkType": + if v != nil { + var networkType string + err = json.Unmarshal(*v, &networkType) + if err != nil { + return err + } + tfip.NetworkType = &networkType + } + case "networkId": + if v != nil { + var networkID string + err = json.Unmarshal(*v, &networkID) + if err != nil { + return err + } + tfip.NetworkID = &networkID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicTestFailoverProviderSpecificInput(*v) + if err != nil { + return err + } + tfip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// TestFailoverJobDetails this class represents the details for a test failover job. +type TestFailoverJobDetails struct { + // TestFailoverStatus - The test failover status. + TestFailoverStatus *string `json:"testFailoverStatus,omitempty"` + // Comments - The test failover comments. + Comments *string `json:"comments,omitempty"` + // NetworkName - The test network name. + NetworkName *string `json:"networkName,omitempty"` + // NetworkFriendlyName - The test network friendly name. + NetworkFriendlyName *string `json:"networkFriendlyName,omitempty"` + // NetworkType - The test network type (see TestFailoverInput enum for possible values). + NetworkType *string `json:"networkType,omitempty"` + // ProtectedItemDetails - The test VM details. + ProtectedItemDetails *[]FailoverReplicationProtectedItemDetails `json:"protectedItemDetails,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) MarshalJSON() ([]byte, error) { + tfjd.InstanceType = InstanceTypeTestFailoverJobDetails + objectMap := make(map[string]interface{}) + if tfjd.TestFailoverStatus != nil { + objectMap["testFailoverStatus"] = tfjd.TestFailoverStatus + } + if tfjd.Comments != nil { + objectMap["comments"] = tfjd.Comments + } + if tfjd.NetworkName != nil { + objectMap["networkName"] = tfjd.NetworkName + } + if tfjd.NetworkFriendlyName != nil { + objectMap["networkFriendlyName"] = tfjd.NetworkFriendlyName + } + if tfjd.NetworkType != nil { + objectMap["networkType"] = tfjd.NetworkType + } + if tfjd.ProtectedItemDetails != nil { + objectMap["protectedItemDetails"] = tfjd.ProtectedItemDetails + } + if tfjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = tfjd.AffectedObjectDetails + } + if tfjd.InstanceType != "" { + objectMap["instanceType"] = tfjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return &tfjd, true +} + +// AsJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &tfjd, true +} + +// BasicTestFailoverProviderSpecificInput provider specific test failover input. +type BasicTestFailoverProviderSpecificInput interface { + AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) + AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) + AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) + AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) + AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) + AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) +} + +// TestFailoverProviderSpecificInput provider specific test failover input. +type TestFailoverProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicTestFailoverProviderSpecificInput(body []byte) (BasicTestFailoverProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A): + var atfi A2ATestFailoverInput + err := json.Unmarshal(body, &atfi) + return atfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvratfi HyperVReplicaAzureTestFailoverInput + err := json.Unmarshal(body, &hvratfi) + return hvratfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2): + var imavtfi InMageAzureV2TestFailoverInput + err := json.Unmarshal(body, &imavtfi) + return imavtfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm): + var imrtfi InMageRcmTestFailoverInput + err := json.Unmarshal(body, &imrtfi) + return imrtfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage): + var imtfi InMageTestFailoverInput + err := json.Unmarshal(body, &imtfi) + return imtfi, err + default: + var tfpsi TestFailoverProviderSpecificInput + err := json.Unmarshal(body, &tfpsi) + return tfpsi, err + } +} +func unmarshalBasicTestFailoverProviderSpecificInputArray(body []byte) ([]BasicTestFailoverProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tfpsiArray := make([]BasicTestFailoverProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + tfpsi, err := unmarshalBasicTestFailoverProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + tfpsiArray[index] = tfpsi + } + return tfpsiArray, nil +} + +// MarshalJSON is the custom marshaler for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) MarshalJSON() ([]byte, error) { + tfpsi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput + objectMap := make(map[string]interface{}) + if tfpsi.InstanceType != "" { + objectMap["instanceType"] = tfpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return &tfpsi, true +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &tfpsi, true +} + +// TestMigrateCleanupInput input for test migrate cleanup. +type TestMigrateCleanupInput struct { + // Properties - Test migrate cleanup input properties. + Properties *TestMigrateCleanupInputProperties `json:"properties,omitempty"` +} + +// TestMigrateCleanupInputProperties test migrate cleanup input properties. +type TestMigrateCleanupInputProperties struct { + // Comments - Test migrate cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// TestMigrateInput input for test migrate. +type TestMigrateInput struct { + // Properties - Test migrate input properties. + Properties *TestMigrateInputProperties `json:"properties,omitempty"` +} + +// TestMigrateInputProperties test migrate input properties. +type TestMigrateInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicTestMigrateProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TestMigrateInputProperties struct. +func (tmip *TestMigrateInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicTestMigrateProviderSpecificInput(*v) + if err != nil { + return err + } + tmip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicTestMigrateProviderSpecificInput test migrate provider specific input. +type BasicTestMigrateProviderSpecificInput interface { + AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) + AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) +} + +// TestMigrateProviderSpecificInput test migrate provider specific input. +type TestMigrateProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput', 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicTestMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicTestMigrateProviderSpecificInput(body []byte) (BasicTestMigrateProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt): + var vmctmi VMwareCbtTestMigrateInput + err := json.Unmarshal(body, &vmctmi) + return vmctmi, err + default: + var tmpsi TestMigrateProviderSpecificInput + err := json.Unmarshal(body, &tmpsi) + return tmpsi, err + } +} +func unmarshalBasicTestMigrateProviderSpecificInputArray(body []byte) ([]BasicTestMigrateProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tmpsiArray := make([]BasicTestMigrateProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + tmpsi, err := unmarshalBasicTestMigrateProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + tmpsiArray[index] = tmpsi + } + return tmpsiArray, nil +} + +// MarshalJSON is the custom marshaler for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) MarshalJSON() ([]byte, error) { + tmpsi.InstanceType = InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput + objectMap := make(map[string]interface{}) + if tmpsi.InstanceType != "" { + objectMap["instanceType"] = tmpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtTestMigrateInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) { + return nil, false +} + +// AsTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) { + return &tmpsi, true +} + +// AsBasicTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsBasicTestMigrateProviderSpecificInput() (BasicTestMigrateProviderSpecificInput, bool) { + return &tmpsi, true +} + +// UnplannedFailoverInput input definition for unplanned failover. +type UnplannedFailoverInput struct { + // Properties - Unplanned failover input properties. + Properties *UnplannedFailoverInputProperties `json:"properties,omitempty"` +} + +// UnplannedFailoverInputProperties input definition for unplanned failover input properties. +type UnplannedFailoverInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // SourceSiteOperations - Source site operations status. + SourceSiteOperations *string `json:"sourceSiteOperations,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicUnplannedFailoverProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UnplannedFailoverInputProperties struct. +func (ufip *UnplannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + ufip.FailoverDirection = &failoverDirection + } + case "sourceSiteOperations": + if v != nil { + var sourceSiteOperations string + err = json.Unmarshal(*v, &sourceSiteOperations) + if err != nil { + return err + } + ufip.SourceSiteOperations = &sourceSiteOperations + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUnplannedFailoverProviderSpecificInput(*v) + if err != nil { + return err + } + ufip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUnplannedFailoverProviderSpecificInput provider specific unplanned failover input. +type BasicUnplannedFailoverProviderSpecificInput interface { + AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) + AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) + AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) + AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) + AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) + AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) +} + +// UnplannedFailoverProviderSpecificInput provider specific unplanned failover input. +type UnplannedFailoverProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUnplannedFailoverProviderSpecificInput(body []byte) (BasicUnplannedFailoverProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A): + var aufi A2AUnplannedFailoverInput + err := json.Unmarshal(body, &aufi) + return aufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraufi HyperVReplicaAzureUnplannedFailoverInput + err := json.Unmarshal(body, &hvraufi) + return hvraufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2): + var imavufi InMageAzureV2UnplannedFailoverInput + err := json.Unmarshal(body, &imavufi) + return imavufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm): + var imrufi InMageRcmUnplannedFailoverInput + err := json.Unmarshal(body, &imrufi) + return imrufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage): + var imufi InMageUnplannedFailoverInput + err := json.Unmarshal(body, &imufi) + return imufi, err + default: + var ufpsi UnplannedFailoverProviderSpecificInput + err := json.Unmarshal(body, &ufpsi) + return ufpsi, err + } +} +func unmarshalBasicUnplannedFailoverProviderSpecificInputArray(body []byte) ([]BasicUnplannedFailoverProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ufpsiArray := make([]BasicUnplannedFailoverProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ufpsi, err := unmarshalBasicUnplannedFailoverProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + ufpsiArray[index] = ufpsi + } + return ufpsiArray, nil +} + +// MarshalJSON is the custom marshaler for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) MarshalJSON() ([]byte, error) { + ufpsi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput + objectMap := make(map[string]interface{}) + if ufpsi.InstanceType != "" { + objectMap["instanceType"] = ufpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return &ufpsi, true +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &ufpsi, true +} + +// UpdateApplianceForReplicationProtectedItemInput update appliance for replication protected item input. +type UpdateApplianceForReplicationProtectedItemInput struct { + // Properties - Update appliance replication protected item properties. + Properties *UpdateApplianceForReplicationProtectedItemInputProperties `json:"properties,omitempty"` +} + +// UpdateApplianceForReplicationProtectedItemInputProperties update appliance for protected item input +// properties. +type UpdateApplianceForReplicationProtectedItemInputProperties struct { + // TargetApplianceID - The target appliance Id. + TargetApplianceID *string `json:"targetApplianceId,omitempty"` + // ProviderSpecificDetails - The provider specific input to update replication protected item. + ProviderSpecificDetails BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateApplianceForReplicationProtectedItemInputProperties struct. +func (uafrpiip *UpdateApplianceForReplicationProtectedItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetApplianceId": + if v != nil { + var targetApplianceID string + err = json.Unmarshal(*v, &targetApplianceID) + if err != nil { + return err + } + uafrpiip.TargetApplianceID = &targetApplianceID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput(*v) + if err != nil { + return err + } + uafrpiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput update replication protected item provider +// specific input. +type BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput interface { + AsInMageRcmUpdateApplianceForReplicationProtectedItemInput() (*InMageRcmUpdateApplianceForReplicationProtectedItemInput, bool) + AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (*UpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) +} + +// UpdateApplianceForReplicationProtectedItemProviderSpecificInput update replication protected item provider +// specific input. +type UpdateApplianceForReplicationProtectedItemProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput', 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput(body []byte) (BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm): + var imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput + err := json.Unmarshal(body, &imruafrpii) + return imruafrpii, err + default: + var uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput + err := json.Unmarshal(body, &uafrpipsi) + return uafrpipsi, err + } +} +func unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputArray(body []byte) ([]BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + uafrpipsiArray := make([]BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + uafrpipsi, err := unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + uafrpipsiArray[index] = uafrpipsi + } + return uafrpipsiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) MarshalJSON() ([]byte, error) { + uafrpipsi.InstanceType = InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput + objectMap := make(map[string]interface{}) + if uafrpipsi.InstanceType != "" { + objectMap["instanceType"] = uafrpipsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageRcmUpdateApplianceForReplicationProtectedItemInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) AsInMageRcmUpdateApplianceForReplicationProtectedItemInput() (*InMageRcmUpdateApplianceForReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (*UpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return &uafrpipsi, true +} + +// AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return &uafrpipsi, true +} + +// UpdateDiskInput disk input for update. +type UpdateDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // TargetDiskName - The target disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// UpdateMigrationItemInput update migration item input. +type UpdateMigrationItemInput struct { + // Properties - Update migration item input properties. + Properties *UpdateMigrationItemInputProperties `json:"properties,omitempty"` +} + +// UpdateMigrationItemInputProperties update migration item input properties. +type UpdateMigrationItemInputProperties struct { + // ProviderSpecificDetails - The provider specific input to update migration item. + ProviderSpecificDetails BasicUpdateMigrationItemProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateMigrationItemInputProperties struct. +func (umiip *UpdateMigrationItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateMigrationItemProviderSpecificInput(*v) + if err != nil { + return err + } + umiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateMigrationItemProviderSpecificInput update migration item provider specific input. +type BasicUpdateMigrationItemProviderSpecificInput interface { + AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) + AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) +} + +// UpdateMigrationItemProviderSpecificInput update migration item provider specific input. +type UpdateMigrationItemProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput', 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicUpdateMigrationItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateMigrationItemProviderSpecificInput(body []byte) (BasicUpdateMigrationItemProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt): + var vmcumii VMwareCbtUpdateMigrationItemInput + err := json.Unmarshal(body, &vmcumii) + return vmcumii, err + default: + var umipsi UpdateMigrationItemProviderSpecificInput + err := json.Unmarshal(body, &umipsi) + return umipsi, err + } +} +func unmarshalBasicUpdateMigrationItemProviderSpecificInputArray(body []byte) ([]BasicUpdateMigrationItemProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + umipsiArray := make([]BasicUpdateMigrationItemProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + umipsi, err := unmarshalBasicUpdateMigrationItemProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + umipsiArray[index] = umipsi + } + return umipsiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) MarshalJSON() ([]byte, error) { + umipsi.InstanceType = InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput + objectMap := make(map[string]interface{}) + if umipsi.InstanceType != "" { + objectMap["instanceType"] = umipsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtUpdateMigrationItemInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) { + return nil, false +} + +// AsUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) { + return &umipsi, true +} + +// AsBasicUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsBasicUpdateMigrationItemProviderSpecificInput() (BasicUpdateMigrationItemProviderSpecificInput, bool) { + return &umipsi, true +} + +// UpdateMobilityServiceRequest request to update the mobility service on a protected item. +type UpdateMobilityServiceRequest struct { + // Properties - The properties of the update mobility service request. + Properties *UpdateMobilityServiceRequestProperties `json:"properties,omitempty"` +} + +// UpdateMobilityServiceRequestProperties the properties of an update mobility service request. +type UpdateMobilityServiceRequestProperties struct { + // RunAsAccountID - The CS run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// UpdateNetworkMappingInput update network mapping input. +type UpdateNetworkMappingInput struct { + // Properties - The input properties needed to update network mapping. + Properties *UpdateNetworkMappingInputProperties `json:"properties,omitempty"` +} + +// UpdateNetworkMappingInputProperties common input details for network mapping operation. +type UpdateNetworkMappingInputProperties struct { + // RecoveryFabricName - Recovery fabric name. + RecoveryFabricName *string `json:"recoveryFabricName,omitempty"` + // RecoveryNetworkID - Recovery network Id. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // FabricSpecificDetails - Fabrics specific input network Id. + FabricSpecificDetails BasicFabricSpecificUpdateNetworkMappingInput `json:"fabricSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateNetworkMappingInputProperties struct. +func (unmip *UpdateNetworkMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryFabricName": + if v != nil { + var recoveryFabricName string + err = json.Unmarshal(*v, &recoveryFabricName) + if err != nil { + return err + } + unmip.RecoveryFabricName = &recoveryFabricName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + unmip.RecoveryNetworkID = &recoveryNetworkID + } + case "fabricSpecificDetails": + if v != nil { + fabricSpecificDetails, err := unmarshalBasicFabricSpecificUpdateNetworkMappingInput(*v) + if err != nil { + return err + } + unmip.FabricSpecificDetails = fabricSpecificDetails + } + } + } + + return nil +} + +// UpdatePolicyInput update policy input. +type UpdatePolicyInput struct { + // Properties - The ReplicationProviderSettings. + Properties *UpdatePolicyInputProperties `json:"properties,omitempty"` +} + +// UpdatePolicyInputProperties policy update properties. +type UpdatePolicyInputProperties struct { + // ReplicationProviderSettings - The ReplicationProviderSettings. + ReplicationProviderSettings BasicPolicyProviderSpecificInput `json:"replicationProviderSettings,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdatePolicyInputProperties struct. +func (upip *UpdatePolicyInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "replicationProviderSettings": + if v != nil { + replicationProviderSettings, err := unmarshalBasicPolicyProviderSpecificInput(*v) + if err != nil { + return err + } + upip.ReplicationProviderSettings = replicationProviderSettings + } + } + } + + return nil +} + +// UpdateProtectionContainerMappingInput container pairing update input. +type UpdateProtectionContainerMappingInput struct { + // Properties - Update protection container mapping input properties. + Properties *UpdateProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// UpdateProtectionContainerMappingInputProperties container pairing update input. +type UpdateProtectionContainerMappingInputProperties struct { + // ProviderSpecificInput - Provider specific input for updating protection container mapping. + ProviderSpecificInput BasicReplicationProviderSpecificUpdateContainerMappingInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateProtectionContainerMappingInputProperties struct. +func (upcmip *UpdateProtectionContainerMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(*v) + if err != nil { + return err + } + upcmip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// UpdateRecoveryPlanInput update recovery plan input class. +type UpdateRecoveryPlanInput struct { + // Properties - Recovery plan update properties. + Properties *UpdateRecoveryPlanInputProperties `json:"properties,omitempty"` +} + +// UpdateRecoveryPlanInputProperties recovery plan update properties. +type UpdateRecoveryPlanInputProperties struct { + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` +} + +// UpdateReplicationProtectedItemInput update replication protected item input. +type UpdateReplicationProtectedItemInput struct { + // Properties - Update replication protected item properties. + Properties *UpdateReplicationProtectedItemInputProperties `json:"properties,omitempty"` +} + +// UpdateReplicationProtectedItemInputProperties update protected item input properties. +type UpdateReplicationProtectedItemInputProperties struct { + // RecoveryAzureVMName - Target Azure VM name given by the user. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureVMSize - Target Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // SelectedRecoveryAzureNetworkID - Target Azure Network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The Azure Network Id for test failover. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // VMNics - The list of VM nic details. + VMNics *[]VMNicInputDetails `json:"vmNics,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // RecoveryAvailabilitySetID - The target availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // ProviderSpecificDetails - The provider specific input to update replication protected item. + ProviderSpecificDetails BasicUpdateReplicationProtectedItemProviderInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateReplicationProtectedItemInputProperties struct. +func (urpiip *UpdateReplicationProtectedItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryAzureVMName": + if v != nil { + var recoveryAzureVMName string + err = json.Unmarshal(*v, &recoveryAzureVMName) + if err != nil { + return err + } + urpiip.RecoveryAzureVMName = &recoveryAzureVMName + } + case "recoveryAzureVMSize": + if v != nil { + var recoveryAzureVMSize string + err = json.Unmarshal(*v, &recoveryAzureVMSize) + if err != nil { + return err + } + urpiip.RecoveryAzureVMSize = &recoveryAzureVMSize + } + case "selectedRecoveryAzureNetworkId": + if v != nil { + var selectedRecoveryAzureNetworkID string + err = json.Unmarshal(*v, &selectedRecoveryAzureNetworkID) + if err != nil { + return err + } + urpiip.SelectedRecoveryAzureNetworkID = &selectedRecoveryAzureNetworkID + } + case "selectedTfoAzureNetworkId": + if v != nil { + var selectedTfoAzureNetworkID string + err = json.Unmarshal(*v, &selectedTfoAzureNetworkID) + if err != nil { + return err + } + urpiip.SelectedTfoAzureNetworkID = &selectedTfoAzureNetworkID + } + case "selectedSourceNicId": + if v != nil { + var selectedSourceNicID string + err = json.Unmarshal(*v, &selectedSourceNicID) + if err != nil { + return err + } + urpiip.SelectedSourceNicID = &selectedSourceNicID + } + case "enableRdpOnTargetOption": + if v != nil { + var enableRdpOnTargetOption string + err = json.Unmarshal(*v, &enableRdpOnTargetOption) + if err != nil { + return err + } + urpiip.EnableRdpOnTargetOption = &enableRdpOnTargetOption + } + case "vmNics": + if v != nil { + var VMNics []VMNicInputDetails + err = json.Unmarshal(*v, &VMNics) + if err != nil { + return err + } + urpiip.VMNics = &VMNics + } + case "licenseType": + if v != nil { + var licenseType LicenseType + err = json.Unmarshal(*v, &licenseType) + if err != nil { + return err + } + urpiip.LicenseType = licenseType + } + case "recoveryAvailabilitySetId": + if v != nil { + var recoveryAvailabilitySetID string + err = json.Unmarshal(*v, &recoveryAvailabilitySetID) + if err != nil { + return err + } + urpiip.RecoveryAvailabilitySetID = &recoveryAvailabilitySetID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateReplicationProtectedItemProviderInput(*v) + if err != nil { + return err + } + urpiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateReplicationProtectedItemProviderInput update replication protected item provider specific input. +type BasicUpdateReplicationProtectedItemProviderInput interface { + AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) + AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) + AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) + AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) + AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) +} + +// UpdateReplicationProtectedItemProviderInput update replication protected item provider specific input. +type UpdateReplicationProtectedItemProviderInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateReplicationProtectedItemProviderInput(body []byte) (BasicUpdateReplicationProtectedItemProviderInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A): + var aurpii A2AUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &aurpii) + return aurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure): + var hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &hvraurpii) + return hvraurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2): + var imavurpii InMageAzureV2UpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &imavurpii) + return imavurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm): + var imrurpii InMageRcmUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &imrurpii) + return imrurpii, err + default: + var urpipi UpdateReplicationProtectedItemProviderInput + err := json.Unmarshal(body, &urpipi) + return urpipi, err + } +} +func unmarshalBasicUpdateReplicationProtectedItemProviderInputArray(body []byte) ([]BasicUpdateReplicationProtectedItemProviderInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + urpipiArray := make([]BasicUpdateReplicationProtectedItemProviderInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + urpipi, err := unmarshalBasicUpdateReplicationProtectedItemProviderInput(*rawMessage) + if err != nil { + return nil, err + } + urpipiArray[index] = urpipi + } + return urpipiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) MarshalJSON() ([]byte, error) { + urpipi.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput + objectMap := make(map[string]interface{}) + if urpipi.InstanceType != "" { + objectMap["instanceType"] = urpipi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return &urpipi, true +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &urpipi, true +} + +// UpdateVCenterRequest input required to update vCenter. +type UpdateVCenterRequest struct { + // Properties - The update VCenter Request Properties. + Properties *UpdateVCenterRequestProperties `json:"properties,omitempty"` +} + +// UpdateVCenterRequestProperties the properties of an update vCenter request. +type UpdateVCenterRequestProperties struct { + // FriendlyName - The friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the vCenter to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // ProcessServerID - The process server Id from where the update can be orchestrated. + ProcessServerID *string `json:"processServerId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The CS account Id which has privileges to update the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// VaultHealthDetails vault health details definition. +type VaultHealthDetails struct { + autorest.Response `json:"-"` + // Properties - The vault health related data. + Properties *VaultHealthProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VaultHealthDetails. +func (vhd VaultHealthDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vhd.Properties != nil { + objectMap["properties"] = vhd.Properties + } + if vhd.Location != nil { + objectMap["location"] = vhd.Location + } + return json.Marshal(objectMap) +} + +// VaultHealthProperties class to define the health summary of the Vault. +type VaultHealthProperties struct { + // VaultErrors - The list of errors on the vault. + VaultErrors *[]HealthError `json:"vaultErrors,omitempty"` + // ProtectedItemsHealth - The list of the health detail of the protected items in the vault. + ProtectedItemsHealth *ResourceHealthSummary `json:"protectedItemsHealth,omitempty"` + // FabricsHealth - The list of the health detail of the fabrics in the vault. + FabricsHealth *ResourceHealthSummary `json:"fabricsHealth,omitempty"` + // ContainersHealth - The list of the health detail of the containers in the vault. + ContainersHealth *ResourceHealthSummary `json:"containersHealth,omitempty"` +} + +// VaultSetting vault setting. +type VaultSetting struct { + autorest.Response `json:"-"` + // Properties - The vault setting properties. + Properties *VaultSettingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VaultSetting. +func (vs VaultSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vs.Properties != nil { + objectMap["properties"] = vs.Properties + } + if vs.Location != nil { + objectMap["location"] = vs.Location + } + return json.Marshal(objectMap) +} + +// VaultSettingCollection vault setting collection. +type VaultSettingCollection struct { + autorest.Response `json:"-"` + // Value - The list of vault setting. + Value *[]VaultSetting `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// VaultSettingCollectionIterator provides access to a complete listing of VaultSetting values. +type VaultSettingCollectionIterator struct { + i int + page VaultSettingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VaultSettingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VaultSettingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VaultSettingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VaultSettingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VaultSettingCollectionIterator) Response() VaultSettingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VaultSettingCollectionIterator) Value() VaultSetting { + if !iter.page.NotDone() { + return VaultSetting{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VaultSettingCollectionIterator type. +func NewVaultSettingCollectionIterator(page VaultSettingCollectionPage) VaultSettingCollectionIterator { + return VaultSettingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vsc VaultSettingCollection) IsEmpty() bool { + return vsc.Value == nil || len(*vsc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vsc VaultSettingCollection) hasNextLink() bool { + return vsc.NextLink != nil && len(*vsc.NextLink) != 0 +} + +// vaultSettingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vsc VaultSettingCollection) vaultSettingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !vsc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vsc.NextLink))) +} + +// VaultSettingCollectionPage contains a page of VaultSetting values. +type VaultSettingCollectionPage struct { + fn func(context.Context, VaultSettingCollection) (VaultSettingCollection, error) + vsc VaultSettingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VaultSettingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VaultSettingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vsc) + if err != nil { + return err + } + page.vsc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VaultSettingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VaultSettingCollectionPage) NotDone() bool { + return !page.vsc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VaultSettingCollectionPage) Response() VaultSettingCollection { + return page.vsc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VaultSettingCollectionPage) Values() []VaultSetting { + if page.vsc.IsEmpty() { + return nil + } + return *page.vsc.Value +} + +// Creates a new instance of the VaultSettingCollectionPage type. +func NewVaultSettingCollectionPage(cur VaultSettingCollection, getNextPage func(context.Context, VaultSettingCollection) (VaultSettingCollection, error)) VaultSettingCollectionPage { + return VaultSettingCollectionPage{ + fn: getNextPage, + vsc: cur, + } +} + +// VaultSettingCreationInput input to create vault setting. +type VaultSettingCreationInput struct { + // Properties - Vault setting creation input properties. + Properties *VaultSettingCreationInputProperties `json:"properties,omitempty"` +} + +// VaultSettingCreationInputProperties input to create vault setting. +type VaultSettingCreationInputProperties struct { + // MigrationSolutionID - The migration solution Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // VmwareToAzureProviderType - VMware to Azure provider type. + VmwareToAzureProviderType *string `json:"vmwareToAzureProviderType,omitempty"` +} + +// VaultSettingProperties vault setting properties. +type VaultSettingProperties struct { + // MigrationSolutionID - The migration solution ARM Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // VmwareToAzureProviderType - VMware to Azure provider type. + VmwareToAzureProviderType *string `json:"vmwareToAzureProviderType,omitempty"` +} + +// VCenter vCenter definition. +type VCenter struct { + autorest.Response `json:"-"` + // Properties - VCenter related data. + Properties *VCenterProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VCenter. +func (vc VCenter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vc.Properties != nil { + objectMap["properties"] = vc.Properties + } + if vc.Location != nil { + objectMap["location"] = vc.Location + } + return json.Marshal(objectMap) +} + +// VCenterCollection collection of vCenter details. +type VCenterCollection struct { + autorest.Response `json:"-"` + // Value - The vCenter details. + Value *[]VCenter `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// VCenterCollectionIterator provides access to a complete listing of VCenter values. +type VCenterCollectionIterator struct { + i int + page VCenterCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VCenterCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VCenterCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VCenterCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VCenterCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VCenterCollectionIterator) Response() VCenterCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VCenterCollectionIterator) Value() VCenter { + if !iter.page.NotDone() { + return VCenter{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VCenterCollectionIterator type. +func NewVCenterCollectionIterator(page VCenterCollectionPage) VCenterCollectionIterator { + return VCenterCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vcc VCenterCollection) IsEmpty() bool { + return vcc.Value == nil || len(*vcc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vcc VCenterCollection) hasNextLink() bool { + return vcc.NextLink != nil && len(*vcc.NextLink) != 0 +} + +// vCenterCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vcc VCenterCollection) vCenterCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !vcc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vcc.NextLink))) +} + +// VCenterCollectionPage contains a page of VCenter values. +type VCenterCollectionPage struct { + fn func(context.Context, VCenterCollection) (VCenterCollection, error) + vcc VCenterCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VCenterCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VCenterCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vcc) + if err != nil { + return err + } + page.vcc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VCenterCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VCenterCollectionPage) NotDone() bool { + return !page.vcc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VCenterCollectionPage) Response() VCenterCollection { + return page.vcc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VCenterCollectionPage) Values() []VCenter { + if page.vcc.IsEmpty() { + return nil + } + return *page.vcc.Value +} + +// Creates a new instance of the VCenterCollectionPage type. +func NewVCenterCollectionPage(cur VCenterCollection, getNextPage func(context.Context, VCenterCollection) (VCenterCollection, error)) VCenterCollectionPage { + return VCenterCollectionPage{ + fn: getNextPage, + vcc: cur, + } +} + +// VCenterProperties vCenter properties. +type VCenterProperties struct { + // FriendlyName - Friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // InternalID - VCenter internal ID. + InternalID *string `json:"internalId,omitempty"` + // LastHeartbeat - The time when the last heartbeat was received by vCenter. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // DiscoveryStatus - The VCenter discovery status. + DiscoveryStatus *string `json:"discoveryStatus,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // IPAddress - The IP address of the vCenter. + IPAddress *string `json:"ipAddress,omitempty"` + // InfrastructureID - The infrastructure Id of vCenter. + InfrastructureID *string `json:"infrastructureId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The account Id which has privileges to discover the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // FabricArmResourceName - The ARM resource name of the fabric containing this VCenter. + FabricArmResourceName *string `json:"fabricArmResourceName,omitempty"` + // HealthErrors - The health errors for this VCenter. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// VersionDetails version related details. +type VersionDetails struct { + // Version - The agent version. + Version *string `json:"version,omitempty"` + // ExpiryDate - Version expiry date. + ExpiryDate *date.Time `json:"expiryDate,omitempty"` + // Status - A value indicating whether security update required. Possible values include: 'Supported', 'NotSupported', 'Deprecated', 'UpdateRequired', 'SecurityUpdateRequired' + Status AgentVersionStatus `json:"status,omitempty"` +} + +// VirtualMachineTaskDetails this class represents the virtual machine task details. +type VirtualMachineTaskDetails struct { + // SkippedReason - The skipped reason. + SkippedReason *string `json:"skippedReason,omitempty"` + // SkippedReasonString - The skipped reason string. + SkippedReasonString *string `json:"skippedReasonString,omitempty"` + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) MarshalJSON() ([]byte, error) { + vmtd.InstanceType = InstanceTypeVirtualMachineTaskDetails + objectMap := make(map[string]interface{}) + if vmtd.SkippedReason != nil { + objectMap["skippedReason"] = vmtd.SkippedReason + } + if vmtd.SkippedReasonString != nil { + objectMap["skippedReasonString"] = vmtd.SkippedReasonString + } + if vmtd.JobTask != nil { + objectMap["jobTask"] = vmtd.JobTask + } + if vmtd.InstanceType != "" { + objectMap["instanceType"] = vmtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &vmtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return &vmtd, true +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &vmtd, true +} + +// VmmDetails VMM fabric specific details. +type VmmDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmDetails. +func (vd VmmDetails) MarshalJSON() ([]byte, error) { + vd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM + objectMap := make(map[string]interface{}) + if vd.InstanceType != "" { + objectMap["instanceType"] = vd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVmmDetails() (*VmmDetails, bool) { + return &vd, true +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vd, true +} + +// VmmToAzureCreateNetworkMappingInput create network mappings input properties/behavior specific to Vmm to +// Azure Network mapping. +type VmmToAzureCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtacnmi.InstanceType = InstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtacnmi.InstanceType != "" { + objectMap["instanceType"] = vtacnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return &vtacnmi, true +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &vtacnmi, true +} + +// VmmToAzureNetworkMappingSettings e2A Network Mapping fabric specific settings. +type VmmToAzureNetworkMappingSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) MarshalJSON() ([]byte, error) { + vtanms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtanms.InstanceType != "" { + objectMap["instanceType"] = vtanms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return &vtanms, true +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &vtanms, true +} + +// VmmToAzureUpdateNetworkMappingInput update network mappings input properties/behavior specific to vmm to +// azure. +type VmmToAzureUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtaunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtaunmi.InstanceType != "" { + objectMap["instanceType"] = vtaunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return &vtaunmi, true +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &vtaunmi, true +} + +// VmmToVmmCreateNetworkMappingInput create network mappings input properties/behavior specific to vmm to +// vmm Network mapping. +type VmmToVmmCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtvcnmi.InstanceType = InstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvcnmi.InstanceType != "" { + objectMap["instanceType"] = vtvcnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return &vtvcnmi, true +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &vtvcnmi, true +} + +// VmmToVmmNetworkMappingSettings e2E Network Mapping fabric specific settings. +type VmmToVmmNetworkMappingSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) MarshalJSON() ([]byte, error) { + vtvnms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvnms.InstanceType != "" { + objectMap["instanceType"] = vtvnms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return &vtvnms, true +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &vtvnms, true +} + +// VmmToVmmUpdateNetworkMappingInput update network mappings input properties/behavior specific to vmm to +// vmm. +type VmmToVmmUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtvunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvunmi.InstanceType != "" { + objectMap["instanceType"] = vtvunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return &vtvunmi, true +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &vtvunmi, true +} + +// VmmVirtualMachineDetails VMM fabric provider specific VM settings. +type VmmVirtualMachineDetails struct { + // SourceItemID - The source id of the object. + SourceItemID *string `json:"sourceItemId,omitempty"` + // Generation - The id of the object in fabric. + Generation *string `json:"generation,omitempty"` + // OsDetails - The Last replication time. + OsDetails *OSDetails `json:"osDetails,omitempty"` + // DiskDetails - The Last successful failover time. + DiskDetails *[]DiskDetails `json:"diskDetails,omitempty"` + // HasPhysicalDisk - A value indicating whether the VM has a physical disk attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasPhysicalDisk PresenceStatus `json:"hasPhysicalDisk,omitempty"` + // HasFibreChannelAdapter - A value indicating whether the VM has a fibre channel adapter attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasFibreChannelAdapter PresenceStatus `json:"hasFibreChannelAdapter,omitempty"` + // HasSharedVhd - A value indicating whether the VM has a shared VHD attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasSharedVhd PresenceStatus `json:"hasSharedVhd,omitempty"` + // HyperVHostID - The Id of the hyper-v host in fabric. + HyperVHostID *string `json:"hyperVHostId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) MarshalJSON() ([]byte, error) { + vvmd.InstanceType = InstanceTypeVmmVirtualMachine + objectMap := make(map[string]interface{}) + if vvmd.SourceItemID != nil { + objectMap["sourceItemId"] = vvmd.SourceItemID + } + if vvmd.Generation != nil { + objectMap["generation"] = vvmd.Generation + } + if vvmd.OsDetails != nil { + objectMap["osDetails"] = vvmd.OsDetails + } + if vvmd.DiskDetails != nil { + objectMap["diskDetails"] = vvmd.DiskDetails + } + if vvmd.HasPhysicalDisk != "" { + objectMap["hasPhysicalDisk"] = vvmd.HasPhysicalDisk + } + if vvmd.HasFibreChannelAdapter != "" { + objectMap["hasFibreChannelAdapter"] = vvmd.HasFibreChannelAdapter + } + if vvmd.HasSharedVhd != "" { + objectMap["hasSharedVhd"] = vvmd.HasSharedVhd + } + if vvmd.HyperVHostID != nil { + objectMap["hyperVHostId"] = vvmd.HyperVHostID + } + if vvmd.InstanceType != "" { + objectMap["instanceType"] = vvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return &vvmd, true +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return &vvmd, true +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &vvmd, true +} + +// VMNicDetails hyper V VM network details. +type VMNicDetails struct { + // NicID - The nic Id. + NicID *string `json:"nicId,omitempty"` + // ReplicaNicID - The replica nic Id. + ReplicaNicID *string `json:"replicaNicId,omitempty"` + // SourceNicArmID - The source nic ARM Id. + SourceNicArmID *string `json:"sourceNicArmId,omitempty"` + // VMNetworkName - VM network name. + VMNetworkName *string `json:"vMNetworkName,omitempty"` + // RecoveryVMNetworkID - Recovery VM network Id. + RecoveryVMNetworkID *string `json:"recoveryVMNetworkId,omitempty"` + // IPConfigs - The IP configurations of the NIC. + IPConfigs *[]IPConfigDetails `json:"ipConfigs,omitempty"` + // SelectionType - Selection type for failover. + SelectionType *string `json:"selectionType,omitempty"` + // RecoveryNetworkSecurityGroupID - The id of the NSG associated with the NIC. + RecoveryNetworkSecurityGroupID *string `json:"recoveryNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnRecovery - A value indicating whether the NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnRecovery *bool `json:"enableAcceleratedNetworkingOnRecovery,omitempty"` + // TfoVMNetworkID - The network to be used by NIC during test failover. + TfoVMNetworkID *string `json:"tfoVMNetworkId,omitempty"` + // TfoNetworkSecurityGroupID - The NSG to be used by NIC during test failover. + TfoNetworkSecurityGroupID *string `json:"tfoNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnTfo - Whether the TFO NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnTfo *bool `json:"enableAcceleratedNetworkingOnTfo,omitempty"` + // RecoveryNicName - The name of the NIC to be used when creating target NICs. + RecoveryNicName *string `json:"recoveryNicName,omitempty"` + // RecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs. + RecoveryNicResourceGroupName *string `json:"recoveryNicResourceGroupName,omitempty"` + // ReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during failover subject to availability. + ReuseExistingNic *bool `json:"reuseExistingNic,omitempty"` + // TfoRecoveryNicName - The name of the NIC to be used when creating target NICs in TFO. + TfoRecoveryNicName *string `json:"tfoRecoveryNicName,omitempty"` + // TfoRecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs in TFO. + TfoRecoveryNicResourceGroupName *string `json:"tfoRecoveryNicResourceGroupName,omitempty"` + // TfoReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during test failover subject to availability. + TfoReuseExistingNic *bool `json:"tfoReuseExistingNic,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` +} + +// VMNicInputDetails hyper V VM network input details. +type VMNicInputDetails struct { + // NicID - The nic Id. + NicID *string `json:"nicId,omitempty"` + // IPConfigs - The IP configurations to be used by NIC during test failover and failover. + IPConfigs *[]IPConfigInputDetails `json:"ipConfigs,omitempty"` + // SelectionType - Selection type for failover. + SelectionType *string `json:"selectionType,omitempty"` + // RecoveryNetworkSecurityGroupID - The id of the NSG associated with the NIC. + RecoveryNetworkSecurityGroupID *string `json:"recoveryNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnRecovery - Whether the NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnRecovery *bool `json:"enableAcceleratedNetworkingOnRecovery,omitempty"` + // TfoNetworkSecurityGroupID - The NSG to be used by NIC during test failover. + TfoNetworkSecurityGroupID *string `json:"tfoNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnTfo - Whether the test NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnTfo *bool `json:"enableAcceleratedNetworkingOnTfo,omitempty"` + // RecoveryNicName - The name of the NIC to be used when creating target NICs. + RecoveryNicName *string `json:"recoveryNicName,omitempty"` + // RecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs. + RecoveryNicResourceGroupName *string `json:"recoveryNicResourceGroupName,omitempty"` + // ReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during failover subject to availability. + ReuseExistingNic *bool `json:"reuseExistingNic,omitempty"` + // TfoNicName - The name of the NIC to be used when creating target NICs in TFO. + TfoNicName *string `json:"tfoNicName,omitempty"` + // TfoNicResourceGroupName - The resource group of the NIC to be used when creating target NICs in TFO. + TfoNicResourceGroupName *string `json:"tfoNicResourceGroupName,omitempty"` + // TfoReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during test failover subject to availability. + TfoReuseExistingNic *bool `json:"tfoReuseExistingNic,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` +} + +// VMNicUpdatesTaskDetails this class represents the vm NicUpdates task details. +type VMNicUpdatesTaskDetails struct { + // VMID - Virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // NicID - Nic Id. + NicID *string `json:"nicId,omitempty"` + // Name - Name of the Nic. + Name *string `json:"name,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) MarshalJSON() ([]byte, error) { + vnutd.InstanceType = InstanceTypeVMNicUpdatesTaskDetails + objectMap := make(map[string]interface{}) + if vnutd.VMID != nil { + objectMap["vmId"] = vnutd.VMID + } + if vnutd.NicID != nil { + objectMap["nicId"] = vnutd.NicID + } + if vnutd.Name != nil { + objectMap["name"] = vnutd.Name + } + if vnutd.InstanceType != "" { + objectMap["instanceType"] = vnutd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return &vnutd, true +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &vnutd, true +} + +// VMwareCbtContainerCreationInput vMwareCbt container creation input. +type VMwareCbtContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) MarshalJSON() ([]byte, error) { + vmccci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmccci.InstanceType != "" { + objectMap["instanceType"] = vmccci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return &vmccci, true +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &vmccci, true +} + +// VMwareCbtContainerMappingInput vMwareCbt container mapping input. +type VMwareCbtContainerMappingInput struct { + // KeyVaultID - The target key vault ARM Id. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyVaultURI - The target key vault URL. + KeyVaultURI *string `json:"keyVaultUri,omitempty"` + // StorageAccountID - The storage account ARM Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // StorageAccountSasSecretName - The secret name of the storage account. + StorageAccountSasSecretName *string `json:"storageAccountSasSecretName,omitempty"` + // ServiceBusConnectionStringSecretName - The secret name of the service bus connection string. + ServiceBusConnectionStringSecretName *string `json:"serviceBusConnectionStringSecretName,omitempty"` + // TargetLocation - The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) MarshalJSON() ([]byte, error) { + vmccmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmccmi.KeyVaultID != nil { + objectMap["keyVaultId"] = vmccmi.KeyVaultID + } + if vmccmi.KeyVaultURI != nil { + objectMap["keyVaultUri"] = vmccmi.KeyVaultURI + } + if vmccmi.StorageAccountID != nil { + objectMap["storageAccountId"] = vmccmi.StorageAccountID + } + if vmccmi.StorageAccountSasSecretName != nil { + objectMap["storageAccountSasSecretName"] = vmccmi.StorageAccountSasSecretName + } + if vmccmi.ServiceBusConnectionStringSecretName != nil { + objectMap["serviceBusConnectionStringSecretName"] = vmccmi.ServiceBusConnectionStringSecretName + } + if vmccmi.TargetLocation != nil { + objectMap["targetLocation"] = vmccmi.TargetLocation + } + if vmccmi.InstanceType != "" { + objectMap["instanceType"] = vmccmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return &vmccmi, true +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &vmccmi, true +} + +// VMwareCbtDiskInput vMwareCbt disk input. +type VMwareCbtDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // IsOSDisk - A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // LogStorageAccountSasSecretName - The key vault secret name of the log storage account. + LogStorageAccountSasSecretName *string `json:"logStorageAccountSasSecretName,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// VMwareCbtEnableMigrationInput vMwareCbt specific enable migration input. +type VMwareCbtEnableMigrationInput struct { + // VmwareMachineID - The ARM Id of the VM discovered in VMware. + VmwareMachineID *string `json:"vmwareMachineId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]VMwareCbtDiskInput `json:"disksToInclude,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // DataMoverRunAsAccountID - The data mover run as account Id. + DataMoverRunAsAccountID *string `json:"dataMoverRunAsAccountId,omitempty"` + // SnapshotRunAsAccountID - The snapshot run as account Id. + SnapshotRunAsAccountID *string `json:"snapshotRunAsAccountId,omitempty"` + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TargetSubnetName - The target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedDiskTags - The tags for the seed disks. + SeedDiskTags map[string]*string `json:"seedDiskTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeEnableMigrationProviderSpecificInput', 'InstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEnableMigrationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) MarshalJSON() ([]byte, error) { + vmcemi.InstanceType = InstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcemi.VmwareMachineID != nil { + objectMap["vmwareMachineId"] = vmcemi.VmwareMachineID + } + if vmcemi.DisksToInclude != nil { + objectMap["disksToInclude"] = vmcemi.DisksToInclude + } + if vmcemi.LicenseType != "" { + objectMap["licenseType"] = vmcemi.LicenseType + } + if vmcemi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = vmcemi.SQLServerLicenseType + } + if vmcemi.DataMoverRunAsAccountID != nil { + objectMap["dataMoverRunAsAccountId"] = vmcemi.DataMoverRunAsAccountID + } + if vmcemi.SnapshotRunAsAccountID != nil { + objectMap["snapshotRunAsAccountId"] = vmcemi.SnapshotRunAsAccountID + } + if vmcemi.TargetVMName != nil { + objectMap["targetVmName"] = vmcemi.TargetVMName + } + if vmcemi.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcemi.TargetVMSize + } + if vmcemi.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcemi.TargetResourceGroupID + } + if vmcemi.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcemi.TargetNetworkID + } + if vmcemi.TargetSubnetName != nil { + objectMap["targetSubnetName"] = vmcemi.TargetSubnetName + } + if vmcemi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcemi.TargetAvailabilitySetID + } + if vmcemi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcemi.TargetAvailabilityZone + } + if vmcemi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcemi.TargetProximityPlacementGroupID + } + if vmcemi.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcemi.TargetBootDiagnosticsStorageAccountID + } + if vmcemi.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcemi.PerformAutoResync + } + if vmcemi.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcemi.TargetVMTags + } + if vmcemi.SeedDiskTags != nil { + objectMap["seedDiskTags"] = vmcemi.SeedDiskTags + } + if vmcemi.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcemi.TargetDiskTags + } + if vmcemi.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcemi.TargetNicTags + } + if vmcemi.InstanceType != "" { + objectMap["instanceType"] = vmcemi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtEnableMigrationInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) { + return &vmcemi, true +} + +// AsEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsBasicEnableMigrationProviderSpecificInput() (BasicEnableMigrationProviderSpecificInput, bool) { + return &vmcemi, true +} + +// VMwareCbtEventDetails event details for VMwareCbt provider. +type VMwareCbtEventDetails struct { + // MigrationItemName - READ-ONLY; The migration item name. + MigrationItemName *string `json:"migrationItemName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) MarshalJSON() ([]byte, error) { + vmced.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmced.InstanceType != "" { + objectMap["instanceType"] = vmced.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return &vmced, true +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &vmced, true +} + +// VMwareCbtMigrateInput vMwareCbt specific migrate input. +type VMwareCbtMigrateInput struct { + // PerformShutdown - A value indicating whether VM is to be shutdown. + PerformShutdown *string `json:"performShutdown,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput', 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) MarshalJSON() ([]byte, error) { + vmcmi.InstanceType = InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcmi.PerformShutdown != nil { + objectMap["performShutdown"] = vmcmi.PerformShutdown + } + if vmcmi.InstanceType != "" { + objectMap["instanceType"] = vmcmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrateInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) { + return &vmcmi, true +} + +// AsMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsBasicMigrateProviderSpecificInput() (BasicMigrateProviderSpecificInput, bool) { + return &vmcmi, true +} + +// VMwareCbtMigrationDetails vMwareCbt provider specific settings. +type VMwareCbtMigrationDetails struct { + // VmwareMachineID - READ-ONLY; The ARM Id of the VM discovered in VMware. + VmwareMachineID *string `json:"vmwareMachineId,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // FirmwareType - READ-ONLY; The firmware type. + FirmwareType *string `json:"firmwareType,omitempty"` + // TargetGeneration - READ-ONLY; The target generation. + TargetGeneration *string `json:"targetGeneration,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // DataMoverRunAsAccountID - READ-ONLY; The data mover run as account Id. + DataMoverRunAsAccountID *string `json:"dataMoverRunAsAccountId,omitempty"` + // SnapshotRunAsAccountID - READ-ONLY; The snapshot run as account Id. + SnapshotRunAsAccountID *string `json:"snapshotRunAsAccountId,omitempty"` + // TargetVMName - Target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetLocation - READ-ONLY; The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // TargetResourceGroupID - The target resource group Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]VMwareCbtProtectedDiskDetails `json:"protectedDisks,omitempty"` + // TargetNetworkID - The target network Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // VMNics - The network details. + VMNics *[]VMwareCbtNicDetails `json:"vmNics,omitempty"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // MigrationRecoveryPointID - READ-ONLY; The recovery point Id to which the VM was migrated. + MigrationRecoveryPointID *string `json:"migrationRecoveryPointId,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // LastRecoveryPointID - READ-ONLY; The last recovery point Id. + LastRecoveryPointID *string `json:"lastRecoveryPointId,omitempty"` + // InitialSeedingProgressPercentage - READ-ONLY; The initial seeding progress percentage. + InitialSeedingProgressPercentage *int32 `json:"initialSeedingProgressPercentage,omitempty"` + // MigrationProgressPercentage - READ-ONLY; The migration progress percentage. + MigrationProgressPercentage *int32 `json:"migrationProgressPercentage,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // InitialSeedingRetryCount - READ-ONLY; The initial seeding retry count. + InitialSeedingRetryCount *int64 `json:"initialSeedingRetryCount,omitempty"` + // ResyncRetryCount - READ-ONLY; The resync retry count. + ResyncRetryCount *int64 `json:"resyncRetryCount,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // SeedDiskTags - The tags for the seed disks. + SeedDiskTags map[string]*string `json:"seedDiskTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings', 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) MarshalJSON() ([]byte, error) { + vmcmd.InstanceType = InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcmd.LicenseType != nil { + objectMap["licenseType"] = vmcmd.LicenseType + } + if vmcmd.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = vmcmd.SQLServerLicenseType + } + if vmcmd.TargetVMName != nil { + objectMap["targetVmName"] = vmcmd.TargetVMName + } + if vmcmd.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcmd.TargetVMSize + } + if vmcmd.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcmd.TargetResourceGroupID + } + if vmcmd.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcmd.TargetAvailabilitySetID + } + if vmcmd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcmd.TargetAvailabilityZone + } + if vmcmd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcmd.TargetProximityPlacementGroupID + } + if vmcmd.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcmd.TargetBootDiagnosticsStorageAccountID + } + if vmcmd.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcmd.TargetVMTags + } + if vmcmd.ProtectedDisks != nil { + objectMap["protectedDisks"] = vmcmd.ProtectedDisks + } + if vmcmd.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcmd.TargetNetworkID + } + if vmcmd.VMNics != nil { + objectMap["vmNics"] = vmcmd.VMNics + } + if vmcmd.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcmd.TargetNicTags + } + if vmcmd.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcmd.PerformAutoResync + } + if vmcmd.SeedDiskTags != nil { + objectMap["seedDiskTags"] = vmcmd.SeedDiskTags + } + if vmcmd.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcmd.TargetDiskTags + } + if vmcmd.InstanceType != "" { + objectMap["instanceType"] = vmcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrationDetails is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) { + return &vmcmd, true +} + +// AsMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsBasicMigrationProviderSpecificSettings() (BasicMigrationProviderSpecificSettings, bool) { + return &vmcmd, true +} + +// VMwareCbtNicDetails vMwareCbt NIC details. +type VMwareCbtNicDetails struct { + // NicID - READ-ONLY; The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // SourceIPAddress - READ-ONLY; The source IP address. + SourceIPAddress *string `json:"sourceIPAddress,omitempty"` + // SourceIPAddressType - READ-ONLY; The source IP address type. Possible values include: 'Dynamic', 'Static' + SourceIPAddressType EthernetAddressType `json:"sourceIPAddressType,omitempty"` + // SourceNetworkID - READ-ONLY; Source network Id. + SourceNetworkID *string `json:"sourceNetworkId,omitempty"` + // TargetIPAddress - The target IP address. + TargetIPAddress *string `json:"targetIPAddress,omitempty"` + // TargetIPAddressType - The target IP address type. Possible values include: 'Dynamic', 'Static' + TargetIPAddressType EthernetAddressType `json:"targetIPAddressType,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` + // IsSelectedForMigration - A value indicating whether this NIC is selected for migration. + IsSelectedForMigration *string `json:"isSelectedForMigration,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtNicDetails. +func (vmcnd VMwareCbtNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmcnd.IsPrimaryNic != nil { + objectMap["isPrimaryNic"] = vmcnd.IsPrimaryNic + } + if vmcnd.TargetIPAddress != nil { + objectMap["targetIPAddress"] = vmcnd.TargetIPAddress + } + if vmcnd.TargetIPAddressType != "" { + objectMap["targetIPAddressType"] = vmcnd.TargetIPAddressType + } + if vmcnd.TargetSubnetName != nil { + objectMap["targetSubnetName"] = vmcnd.TargetSubnetName + } + if vmcnd.TargetNicName != nil { + objectMap["targetNicName"] = vmcnd.TargetNicName + } + if vmcnd.IsSelectedForMigration != nil { + objectMap["isSelectedForMigration"] = vmcnd.IsSelectedForMigration + } + return json.Marshal(objectMap) +} + +// VMwareCbtNicInput vMwareCbt NIC input. +type VMwareCbtNicInput struct { + // NicID - The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetStaticIPAddress - The static IP address. + TargetStaticIPAddress *string `json:"targetStaticIPAddress,omitempty"` + // IsSelectedForMigration - A value indicating whether this NIC is selected for migration. + IsSelectedForMigration *string `json:"isSelectedForMigration,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` +} + +// VMwareCbtPolicyCreationInput vMware Cbt policy creation input. +type VMwareCbtPolicyCreationInput struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) MarshalJSON() ([]byte, error) { + vmcpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcpci.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = vmcpci.RecoveryPointHistoryInMinutes + } + if vmcpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = vmcpci.CrashConsistentFrequencyInMinutes + } + if vmcpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = vmcpci.AppConsistentFrequencyInMinutes + } + if vmcpci.InstanceType != "" { + objectMap["instanceType"] = vmcpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return &vmcpci, true +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &vmcpci, true +} + +// VmwareCbtPolicyDetails vMware Cbt specific policy details. +type VmwareCbtPolicyDetails struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) MarshalJSON() ([]byte, error) { + vcpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vcpd.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = vcpd.RecoveryPointHistoryInMinutes + } + if vcpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = vcpd.AppConsistentFrequencyInMinutes + } + if vcpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = vcpd.CrashConsistentFrequencyInMinutes + } + if vcpd.InstanceType != "" { + objectMap["instanceType"] = vcpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return &vcpd, true +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &vcpd, true +} + +// VMwareCbtProtectedDiskDetails vMwareCbt protected disk details. +type VMwareCbtProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskPath - READ-ONLY; The disk path. + DiskPath *string `json:"diskPath,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // LogStorageAccountSasSecretName - READ-ONLY; The key vault secret name of the log storage account. + LogStorageAccountSasSecretName *string `json:"logStorageAccountSasSecretName,omitempty"` + // DiskEncryptionSetID - READ-ONLY; The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // SeedManagedDiskID - READ-ONLY; The ARM Id of the seed managed disk. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // TargetManagedDiskID - READ-ONLY; The ARM Id of the target managed disk. + TargetManagedDiskID *string `json:"targetManagedDiskId,omitempty"` + // TargetDiskName - The name for the target managed disk. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtProtectedDiskDetails. +func (vmcpdd VMwareCbtProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmcpdd.DiskType != "" { + objectMap["diskType"] = vmcpdd.DiskType + } + if vmcpdd.TargetDiskName != nil { + objectMap["targetDiskName"] = vmcpdd.TargetDiskName + } + return json.Marshal(objectMap) +} + +// VMwareCbtProtectionContainerMappingDetails vMwareCbt provider specific container mapping details. +type VMwareCbtProtectionContainerMappingDetails struct { + // KeyVaultID - READ-ONLY; The target key vault ARM Id. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyVaultURI - READ-ONLY; The target key vault URI. + KeyVaultURI *string `json:"keyVaultUri,omitempty"` + // StorageAccountID - READ-ONLY; The storage account ARM Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // StorageAccountSasSecretName - READ-ONLY; The secret name of the storage account. + StorageAccountSasSecretName *string `json:"storageAccountSasSecretName,omitempty"` + // ServiceBusConnectionStringSecretName - READ-ONLY; The secret name of the service bus connection string. + ServiceBusConnectionStringSecretName *string `json:"serviceBusConnectionStringSecretName,omitempty"` + // TargetLocation - READ-ONLY; The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + vmcpcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcpcmd.InstanceType != "" { + objectMap["instanceType"] = vmcpcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return &vmcpcmd, true +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &vmcpcmd, true +} + +// VMwareCbtResyncInput vMwareCbt specific resync input. +type VMwareCbtResyncInput struct { + // SkipCbtReset - A value indicating whether CBT is to be reset. + SkipCbtReset *string `json:"skipCbtReset,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput', 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicResyncProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) MarshalJSON() ([]byte, error) { + vmcri.InstanceType = InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcri.SkipCbtReset != nil { + objectMap["skipCbtReset"] = vmcri.SkipCbtReset + } + if vmcri.InstanceType != "" { + objectMap["instanceType"] = vmcri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtResyncInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) { + return &vmcri, true +} + +// AsResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsBasicResyncProviderSpecificInput() (BasicResyncProviderSpecificInput, bool) { + return &vmcri, true +} + +// VMwareCbtTestMigrateInput vMwareCbt specific test migrate input. +type VMwareCbtTestMigrateInput struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // NetworkID - The test network Id. + NetworkID *string `json:"networkId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput', 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicTestMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) MarshalJSON() ([]byte, error) { + vmctmi.InstanceType = InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmctmi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = vmctmi.RecoveryPointID + } + if vmctmi.NetworkID != nil { + objectMap["networkId"] = vmctmi.NetworkID + } + if vmctmi.InstanceType != "" { + objectMap["instanceType"] = vmctmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtTestMigrateInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) { + return &vmctmi, true +} + +// AsTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsBasicTestMigrateProviderSpecificInput() (BasicTestMigrateProviderSpecificInput, bool) { + return &vmctmi, true +} + +// VMwareCbtUpdateDiskInput vMwareCbt disk input for update. +type VMwareCbtUpdateDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // TargetDiskName - The target disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// VMwareCbtUpdateMigrationItemInput vMwareCbt specific update migration item input. +type VMwareCbtUpdateMigrationItemInput struct { + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // VMNics - The list of NIC details. + VMNics *[]VMwareCbtNicInput `json:"vmNics,omitempty"` + // VMDisks - The list of disk update properties. + VMDisks *[]VMwareCbtUpdateDiskInput `json:"vmDisks,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput', 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicUpdateMigrationItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) MarshalJSON() ([]byte, error) { + vmcumii.InstanceType = InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcumii.TargetVMName != nil { + objectMap["targetVmName"] = vmcumii.TargetVMName + } + if vmcumii.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcumii.TargetVMSize + } + if vmcumii.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcumii.TargetResourceGroupID + } + if vmcumii.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcumii.TargetAvailabilitySetID + } + if vmcumii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcumii.TargetAvailabilityZone + } + if vmcumii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcumii.TargetProximityPlacementGroupID + } + if vmcumii.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcumii.TargetBootDiagnosticsStorageAccountID + } + if vmcumii.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcumii.TargetNetworkID + } + if vmcumii.VMNics != nil { + objectMap["vmNics"] = vmcumii.VMNics + } + if vmcumii.VMDisks != nil { + objectMap["vmDisks"] = vmcumii.VMDisks + } + if vmcumii.LicenseType != "" { + objectMap["licenseType"] = vmcumii.LicenseType + } + if vmcumii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = vmcumii.SQLServerLicenseType + } + if vmcumii.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcumii.PerformAutoResync + } + if vmcumii.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcumii.TargetVMTags + } + if vmcumii.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcumii.TargetDiskTags + } + if vmcumii.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcumii.TargetNicTags + } + if vmcumii.InstanceType != "" { + objectMap["instanceType"] = vmcumii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtUpdateMigrationItemInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) { + return &vmcumii, true +} + +// AsUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsBasicUpdateMigrationItemProviderSpecificInput() (BasicUpdateMigrationItemProviderSpecificInput, bool) { + return &vmcumii, true +} + +// VMwareDetails store the fabric details specific to the VMware fabric. +type VMwareDetails struct { + // ProcessServers - The list of Process Servers associated with the fabric. + ProcessServers *[]ProcessServer `json:"processServers,omitempty"` + // MasterTargetServers - The list of Master Target servers associated with the fabric. + MasterTargetServers *[]MasterTargetServer `json:"masterTargetServers,omitempty"` + // RunAsAccounts - The list of run as accounts created on the server. + RunAsAccounts *[]RunAsAccount `json:"runAsAccounts,omitempty"` + // ReplicationPairCount - The number of replication pairs configured in this CS. + ReplicationPairCount *string `json:"replicationPairCount,omitempty"` + // ProcessServerCount - The number of process servers. + ProcessServerCount *string `json:"processServerCount,omitempty"` + // AgentCount - The number of source and target servers configured to talk to this CS. + AgentCount *string `json:"agentCount,omitempty"` + // ProtectedServers - The number of protected servers. + ProtectedServers *string `json:"protectedServers,omitempty"` + // SystemLoad - The percentage of the system load. + SystemLoad *string `json:"systemLoad,omitempty"` + // SystemLoadStatus - The system load status. + SystemLoadStatus *string `json:"systemLoadStatus,omitempty"` + // CPULoad - The percentage of the CPU load. + CPULoad *string `json:"cpuLoad,omitempty"` + // CPULoadStatus - The CPU load status. + CPULoadStatus *string `json:"cpuLoadStatus,omitempty"` + // TotalMemoryInBytes - The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // MemoryUsageStatus - The memory usage status. + MemoryUsageStatus *string `json:"memoryUsageStatus,omitempty"` + // TotalSpaceInBytes - The total space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - The available space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // SpaceUsageStatus - The space usage status. + SpaceUsageStatus *string `json:"spaceUsageStatus,omitempty"` + // WebLoad - The web load. + WebLoad *string `json:"webLoad,omitempty"` + // WebLoadStatus - The web load status. + WebLoadStatus *string `json:"webLoadStatus,omitempty"` + // DatabaseServerLoad - The database server load. + DatabaseServerLoad *string `json:"databaseServerLoad,omitempty"` + // DatabaseServerLoadStatus - The database server load status. + DatabaseServerLoadStatus *string `json:"databaseServerLoadStatus,omitempty"` + // CsServiceStatus - The CS service status. + CsServiceStatus *string `json:"csServiceStatus,omitempty"` + // IPAddress - The IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // AgentVersion - The agent Version. + AgentVersion *string `json:"agentVersion,omitempty"` + // HostName - The host name. + HostName *string `json:"hostName,omitempty"` + // LastHeartbeat - The last heartbeat received from CS server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // SslCertExpiryDate - CS SSL cert expiry date. + SslCertExpiryDate *date.Time `json:"sslCertExpiryDate,omitempty"` + // SslCertExpiryRemainingDays - CS SSL cert expiry date. + SslCertExpiryRemainingDays *int32 `json:"sslCertExpiryRemainingDays,omitempty"` + // PsTemplateVersion - PS template version. + PsTemplateVersion *string `json:"psTemplateVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // AgentVersionDetails - The agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareDetails. +func (vmd VMwareDetails) MarshalJSON() ([]byte, error) { + vmd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware + objectMap := make(map[string]interface{}) + if vmd.ProcessServers != nil { + objectMap["processServers"] = vmd.ProcessServers + } + if vmd.MasterTargetServers != nil { + objectMap["masterTargetServers"] = vmd.MasterTargetServers + } + if vmd.RunAsAccounts != nil { + objectMap["runAsAccounts"] = vmd.RunAsAccounts + } + if vmd.ReplicationPairCount != nil { + objectMap["replicationPairCount"] = vmd.ReplicationPairCount + } + if vmd.ProcessServerCount != nil { + objectMap["processServerCount"] = vmd.ProcessServerCount + } + if vmd.AgentCount != nil { + objectMap["agentCount"] = vmd.AgentCount + } + if vmd.ProtectedServers != nil { + objectMap["protectedServers"] = vmd.ProtectedServers + } + if vmd.SystemLoad != nil { + objectMap["systemLoad"] = vmd.SystemLoad + } + if vmd.SystemLoadStatus != nil { + objectMap["systemLoadStatus"] = vmd.SystemLoadStatus + } + if vmd.CPULoad != nil { + objectMap["cpuLoad"] = vmd.CPULoad + } + if vmd.CPULoadStatus != nil { + objectMap["cpuLoadStatus"] = vmd.CPULoadStatus + } + if vmd.TotalMemoryInBytes != nil { + objectMap["totalMemoryInBytes"] = vmd.TotalMemoryInBytes + } + if vmd.AvailableMemoryInBytes != nil { + objectMap["availableMemoryInBytes"] = vmd.AvailableMemoryInBytes + } + if vmd.MemoryUsageStatus != nil { + objectMap["memoryUsageStatus"] = vmd.MemoryUsageStatus + } + if vmd.TotalSpaceInBytes != nil { + objectMap["totalSpaceInBytes"] = vmd.TotalSpaceInBytes + } + if vmd.AvailableSpaceInBytes != nil { + objectMap["availableSpaceInBytes"] = vmd.AvailableSpaceInBytes + } + if vmd.SpaceUsageStatus != nil { + objectMap["spaceUsageStatus"] = vmd.SpaceUsageStatus + } + if vmd.WebLoad != nil { + objectMap["webLoad"] = vmd.WebLoad + } + if vmd.WebLoadStatus != nil { + objectMap["webLoadStatus"] = vmd.WebLoadStatus + } + if vmd.DatabaseServerLoad != nil { + objectMap["databaseServerLoad"] = vmd.DatabaseServerLoad + } + if vmd.DatabaseServerLoadStatus != nil { + objectMap["databaseServerLoadStatus"] = vmd.DatabaseServerLoadStatus + } + if vmd.CsServiceStatus != nil { + objectMap["csServiceStatus"] = vmd.CsServiceStatus + } + if vmd.IPAddress != nil { + objectMap["ipAddress"] = vmd.IPAddress + } + if vmd.AgentVersion != nil { + objectMap["agentVersion"] = vmd.AgentVersion + } + if vmd.HostName != nil { + objectMap["hostName"] = vmd.HostName + } + if vmd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = vmd.LastHeartbeat + } + if vmd.VersionStatus != nil { + objectMap["versionStatus"] = vmd.VersionStatus + } + if vmd.SslCertExpiryDate != nil { + objectMap["sslCertExpiryDate"] = vmd.SslCertExpiryDate + } + if vmd.SslCertExpiryRemainingDays != nil { + objectMap["sslCertExpiryRemainingDays"] = vmd.SslCertExpiryRemainingDays + } + if vmd.PsTemplateVersion != nil { + objectMap["psTemplateVersion"] = vmd.PsTemplateVersion + } + if vmd.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = vmd.AgentExpiryDate + } + if vmd.AgentVersionDetails != nil { + objectMap["agentVersionDetails"] = vmd.AgentVersionDetails + } + if vmd.InstanceType != "" { + objectMap["instanceType"] = vmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return &vmd, true +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vmd, true +} + +// VMwareV2FabricCreationInput vMwareV2 fabric provider specific settings. +type VMwareV2FabricCreationInput struct { + // VmwareSiteID - The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // MigrationSolutionID - The ARM Id of the migration solution. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreationInput', 'InstanceTypeAzure', 'InstanceTypeInMageRcm', 'InstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) MarshalJSON() ([]byte, error) { + vmvfci.InstanceType = InstanceTypeVMwareV2 + objectMap := make(map[string]interface{}) + if vmvfci.VmwareSiteID != nil { + objectMap["vmwareSiteId"] = vmvfci.VmwareSiteID + } + if vmvfci.PhysicalSiteID != nil { + objectMap["physicalSiteId"] = vmvfci.PhysicalSiteID + } + if vmvfci.MigrationSolutionID != nil { + objectMap["migrationSolutionId"] = vmvfci.MigrationSolutionID + } + if vmvfci.InstanceType != "" { + objectMap["instanceType"] = vmvfci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return &vmvfci, true +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &vmvfci, true +} + +// VMwareV2FabricSpecificDetails vMwareV2 fabric specific details. +type VMwareV2FabricSpecificDetails struct { + // VmwareSiteID - READ-ONLY; The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - READ-ONLY; The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // MigrationSolutionID - READ-ONLY; The Migration solution ARM Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // ServiceEndpoint - READ-ONLY; The service endpoint. + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` + // ServiceResourceID - READ-ONLY; The service resource Id. + ServiceResourceID *string `json:"serviceResourceId,omitempty"` + // ServiceContainerID - READ-ONLY; The service container Id. + ServiceContainerID *string `json:"serviceContainerId,omitempty"` + // ProcessServers - READ-ONLY; The list of process servers. + ProcessServers *[]ProcessServerDetails `json:"processServers,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) MarshalJSON() ([]byte, error) { + vmvfsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 + objectMap := make(map[string]interface{}) + if vmvfsd.InstanceType != "" { + objectMap["instanceType"] = vmvfsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return &vmvfsd, true +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vmvfsd, true +} + +// VMwareVirtualMachineDetails vMware provider specific settings. +type VMwareVirtualMachineDetails struct { + // AgentGeneratedID - The ID generated by the InMage agent after it gets installed on guest. This is the ID to be used during InMage CreateProtection. + AgentGeneratedID *string `json:"agentGeneratedId,omitempty"` + // AgentInstalled - The value indicating if InMage scout agent is installed on guest. + AgentInstalled *string `json:"agentInstalled,omitempty"` + // OsType - The OsType installed on VM. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // IPAddress - The IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // PoweredOn - The value indicating whether VM is powered on. + PoweredOn *string `json:"poweredOn,omitempty"` + // VCenterInfrastructureID - The VCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. Value can be vCenter or physical. + DiscoveryType *string `json:"discoveryType,omitempty"` + // DiskDetails - The disk details. + DiskDetails *[]InMageDiskDetails `json:"diskDetails,omitempty"` + // ValidationErrors - The validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) MarshalJSON() ([]byte, error) { + vmvmd.InstanceType = InstanceTypeVMwareVirtualMachine + objectMap := make(map[string]interface{}) + if vmvmd.AgentGeneratedID != nil { + objectMap["agentGeneratedId"] = vmvmd.AgentGeneratedID + } + if vmvmd.AgentInstalled != nil { + objectMap["agentInstalled"] = vmvmd.AgentInstalled + } + if vmvmd.OsType != nil { + objectMap["osType"] = vmvmd.OsType + } + if vmvmd.AgentVersion != nil { + objectMap["agentVersion"] = vmvmd.AgentVersion + } + if vmvmd.IPAddress != nil { + objectMap["ipAddress"] = vmvmd.IPAddress + } + if vmvmd.PoweredOn != nil { + objectMap["poweredOn"] = vmvmd.PoweredOn + } + if vmvmd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = vmvmd.VCenterInfrastructureID + } + if vmvmd.DiscoveryType != nil { + objectMap["discoveryType"] = vmvmd.DiscoveryType + } + if vmvmd.DiskDetails != nil { + objectMap["diskDetails"] = vmvmd.DiskDetails + } + if vmvmd.ValidationErrors != nil { + objectMap["validationErrors"] = vmvmd.ValidationErrors + } + if vmvmd.InstanceType != "" { + objectMap["instanceType"] = vmvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return &vmvmd, true +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &vmvmd, true +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/operations.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/operations.go new file mode 100644 index 000000000000..72814c3d5ec6 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/operations.go @@ -0,0 +1,145 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the client for the Operations methods of the Siterecovery service. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string, resourceGroupName string, resourceName string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// List operation to return the list of available operations. +func (client OperationsClient) List(ctx context.Context) (result OperationsDiscoveryCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.odc.Response.Response != nil { + sc = result.odc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.odc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.odc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", resp, "Failure responding to request") + return + } + if result.odc.hasNextLink() && result.odc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/operations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationsDiscoveryCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationsDiscoveryCollection) (result OperationsDiscoveryCollection, err error) { + req, err := lastResults.operationsDiscoveryCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationsDiscoveryCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/recoverypoints.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/recoverypoints.go new file mode 100644 index 000000000000..bacba0b16f1b --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/recoverypoints.go @@ -0,0 +1,235 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RecoveryPointsClient is the client for the RecoveryPoints methods of the Siterecovery service. +type RecoveryPointsClient struct { + BaseClient +} + +// NewRecoveryPointsClient creates an instance of the RecoveryPointsClient client. +func NewRecoveryPointsClient(subscriptionID string, resourceGroupName string, resourceName string) RecoveryPointsClient { + return NewRecoveryPointsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewRecoveryPointsClientWithBaseURI creates an instance of the RecoveryPointsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewRecoveryPointsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) RecoveryPointsClient { + return RecoveryPointsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get get the details of specified recovery point. +// Parameters: +// fabricName - the fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replication protected item name. +// recoveryPointName - the recovery point name. +func (client RecoveryPointsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (result RecoveryPoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, recoveryPointName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client RecoveryPointsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "recoveryPointName": autorest.Encode("path", recoveryPointName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints/{recoveryPointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RecoveryPointsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RecoveryPointsClient) GetResponder(resp *http.Response) (result RecoveryPoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationProtectedItems lists the available recovery points for a replication protected item. +// Parameters: +// fabricName - the fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replication protected item name. +func (client RecoveryPointsClient) ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result RecoveryPointCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.RPCVar.Response.Response != nil { + sc = result.RPCVar.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectedItemsNextResults + req, err := client.ListByReplicationProtectedItemsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.RPCVar.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", resp, "Failure sending request") + return + } + + result.RPCVar, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", resp, "Failure responding to request") + return + } + if result.RPCVar.hasNextLink() && result.RPCVar.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectedItemsPreparer prepares the ListByReplicationProtectedItems request. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectedItemsSender sends the ListByReplicationProtectedItems request. The method will close the +// http.Response Body if it receives an error. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectedItemsResponder handles the response to the ListByReplicationProtectedItems request. The method always +// closes the http.Response Body. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsResponder(resp *http.Response) (result RecoveryPointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectedItemsNextResults retrieves the next set of results, if any. +func (client RecoveryPointsClient) listByReplicationProtectedItemsNextResults(ctx context.Context, lastResults RecoveryPointCollection) (result RecoveryPointCollection, err error) { + req, err := lastResults.recoveryPointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectedItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result RecoveryPointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectedItems(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationalertsettings.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationalertsettings.go new file mode 100644 index 000000000000..09ba060ccc04 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationalertsettings.go @@ -0,0 +1,302 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationAlertSettingsClient is the client for the ReplicationAlertSettings methods of the Siterecovery service. +type ReplicationAlertSettingsClient struct { + BaseClient +} + +// NewReplicationAlertSettingsClient creates an instance of the ReplicationAlertSettingsClient client. +func NewReplicationAlertSettingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationAlertSettingsClient { + return NewReplicationAlertSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationAlertSettingsClientWithBaseURI creates an instance of the ReplicationAlertSettingsClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationAlertSettingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationAlertSettingsClient { + return ReplicationAlertSettingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create create or update an email notification(alert) configuration. +// Parameters: +// alertSettingName - the name of the email notification(alert) configuration. +// request - the input to configure the email notification(alert). +func (client ReplicationAlertSettingsClient) Create(ctx context.Context, alertSettingName string, request ConfigureAlertRequest) (result Alert, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, alertSettingName, request) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationAlertSettingsClient) CreatePreparer(ctx context.Context, alertSettingName string, request ConfigureAlertRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertSettingName": autorest.Encode("path", alertSettingName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) CreateResponder(resp *http.Response) (result Alert, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of the specified email notification(alert) configuration. +// Parameters: +// alertSettingName - the name of the email notification configuration. +func (client ReplicationAlertSettingsClient) Get(ctx context.Context, alertSettingName string) (result Alert, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, alertSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationAlertSettingsClient) GetPreparer(ctx context.Context, alertSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertSettingName": autorest.Encode("path", alertSettingName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) GetResponder(resp *http.Response) (result Alert, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of email notification(alert) configurations for the vault. +func (client ReplicationAlertSettingsClient) List(ctx context.Context) (result AlertCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.List") + defer func() { + sc := -1 + if result.ac.Response.Response != nil { + sc = result.ac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", resp, "Failure sending request") + return + } + + result.ac, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", resp, "Failure responding to request") + return + } + if result.ac.hasNextLink() && result.ac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationAlertSettingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) ListResponder(resp *http.Response) (result AlertCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationAlertSettingsClient) listNextResults(ctx context.Context, lastResults AlertCollection) (result AlertCollection, err error) { + req, err := lastResults.alertCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationAlertSettingsClient) ListComplete(ctx context.Context) (result AlertCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationeligibilityresults.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationeligibilityresults.go new file mode 100644 index 000000000000..db09ca418da4 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationeligibilityresults.go @@ -0,0 +1,183 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationEligibilityResultsClient is the client for the ReplicationEligibilityResults methods of the Siterecovery +// service. +type ReplicationEligibilityResultsClient struct { + BaseClient +} + +// NewReplicationEligibilityResultsClient creates an instance of the ReplicationEligibilityResultsClient client. +func NewReplicationEligibilityResultsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationEligibilityResultsClient { + return NewReplicationEligibilityResultsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationEligibilityResultsClientWithBaseURI creates an instance of the ReplicationEligibilityResultsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationEligibilityResultsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationEligibilityResultsClient { + return ReplicationEligibilityResultsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get validates whether a given VM can be protected or not in which case returns list of errors. +// Parameters: +// virtualMachineName - virtual Machine name. +func (client ReplicationEligibilityResultsClient) Get(ctx context.Context, virtualMachineName string) (result ReplicationEligibilityResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEligibilityResultsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, virtualMachineName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationEligibilityResultsClient) GetPreparer(ctx context.Context, virtualMachineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineName": autorest.Encode("path", virtualMachineName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEligibilityResultsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationEligibilityResultsClient) GetResponder(resp *http.Response) (result ReplicationEligibilityResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List validates whether a given VM can be protected or not in which case returns list of errors. +// Parameters: +// virtualMachineName - virtual Machine name. +func (client ReplicationEligibilityResultsClient) List(ctx context.Context, virtualMachineName string) (result ReplicationEligibilityResultsCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEligibilityResultsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, virtualMachineName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationEligibilityResultsClient) ListPreparer(ctx context.Context, virtualMachineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineName": autorest.Encode("path", virtualMachineName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEligibilityResultsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationEligibilityResultsClient) ListResponder(resp *http.Response) (result ReplicationEligibilityResultsCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationevents.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationevents.go new file mode 100644 index 000000000000..03c3bfab6651 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationevents.go @@ -0,0 +1,228 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationEventsClient is the client for the ReplicationEvents methods of the Siterecovery service. +type ReplicationEventsClient struct { + BaseClient +} + +// NewReplicationEventsClient creates an instance of the ReplicationEventsClient client. +func NewReplicationEventsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationEventsClient { + return NewReplicationEventsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationEventsClientWithBaseURI creates an instance of the ReplicationEventsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationEventsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationEventsClient { + return ReplicationEventsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get the operation to get the details of an Azure Site recovery event. +// Parameters: +// eventName - the name of the Azure Site Recovery event. +func (client ReplicationEventsClient) Get(ctx context.Context, eventName string) (result Event, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, eventName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationEventsClient) GetPreparer(ctx context.Context, eventName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "eventName": autorest.Encode("path", eventName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents/{eventName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEventsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationEventsClient) GetResponder(resp *http.Response) (result Event, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of Azure Site Recovery events for the vault. +// Parameters: +// filter - oData filter options. +func (client ReplicationEventsClient) List(ctx context.Context, filter string) (result EventCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.List") + defer func() { + sc := -1 + if result.ec.Response.Response != nil { + sc = result.ec.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ec.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", resp, "Failure sending request") + return + } + + result.ec, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", resp, "Failure responding to request") + return + } + if result.ec.hasNextLink() && result.ec.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationEventsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEventsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationEventsClient) ListResponder(resp *http.Response) (result EventCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationEventsClient) listNextResults(ctx context.Context, lastResults EventCollection) (result EventCollection, err error) { + req, err := lastResults.eventCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationEventsClient) ListComplete(ctx context.Context, filter string) (result EventCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationfabrics.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationfabrics.go new file mode 100644 index 000000000000..84867ea6897d --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationfabrics.go @@ -0,0 +1,786 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationFabricsClient is the client for the ReplicationFabrics methods of the Siterecovery service. +type ReplicationFabricsClient struct { + BaseClient +} + +// NewReplicationFabricsClient creates an instance of the ReplicationFabricsClient client. +func NewReplicationFabricsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationFabricsClient { + return NewReplicationFabricsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationFabricsClientWithBaseURI creates an instance of the ReplicationFabricsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationFabricsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationFabricsClient { + return ReplicationFabricsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// CheckConsistency the operation to perform a consistency check on the fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationFabricsClient) CheckConsistency(ctx context.Context, fabricName string) (result ReplicationFabricsCheckConsistencyFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.CheckConsistency") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CheckConsistencyPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "CheckConsistency", nil, "Failure preparing request") + return + } + + result, err = client.CheckConsistencySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "CheckConsistency", result.Response(), "Failure sending request") + return + } + + return +} + +// CheckConsistencyPreparer prepares the CheckConsistency request. +func (client ReplicationFabricsClient) CheckConsistencyPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/checkConsistency", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckConsistencySender sends the CheckConsistency request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) CheckConsistencySender(req *http.Request) (future ReplicationFabricsCheckConsistencyFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CheckConsistencyResponder handles the response to the CheckConsistency request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) CheckConsistencyResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Create the operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). +// Parameters: +// fabricName - name of the ASR fabric. +// input - fabric creation input. +func (client ReplicationFabricsClient) Create(ctx context.Context, fabricName string, input FabricCreationInput) (result ReplicationFabricsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationFabricsClient) CreatePreparer(ctx context.Context, fabricName string, input FabricCreationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) CreateSender(req *http.Request) (future ReplicationFabricsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) CreateResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete or remove an Azure Site Recovery fabric. +// Parameters: +// fabricName - ASR fabric to delete. +func (client ReplicationFabricsClient) Delete(ctx context.Context, fabricName string) (result ReplicationFabricsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationFabricsClient) DeletePreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) DeleteSender(req *http.Request) (future ReplicationFabricsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of an Azure Site Recovery fabric. +// Parameters: +// fabricName - fabric name. +// filter - oData filter options. +func (client ReplicationFabricsClient) Get(ctx context.Context, fabricName string, filter string) (result Fabric, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationFabricsClient) GetPreparer(ctx context.Context, fabricName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) GetResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of the Azure Site Recovery fabrics in the vault. +func (client ReplicationFabricsClient) List(ctx context.Context) (result FabricCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.List") + defer func() { + sc := -1 + if result.fc.Response.Response != nil { + sc = result.fc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.fc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", resp, "Failure sending request") + return + } + + result.fc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", resp, "Failure responding to request") + return + } + if result.fc.hasNextLink() && result.fc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationFabricsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) ListResponder(resp *http.Response) (result FabricCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationFabricsClient) listNextResults(ctx context.Context, lastResults FabricCollection) (result FabricCollection, err error) { + req, err := lastResults.fabricCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationFabricsClient) ListComplete(ctx context.Context) (result FabricCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// MigrateToAad the operation to migrate an Azure Site Recovery fabric to AAD. +// Parameters: +// fabricName - ASR fabric to migrate. +func (client ReplicationFabricsClient) MigrateToAad(ctx context.Context, fabricName string) (result ReplicationFabricsMigrateToAadFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.MigrateToAad") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.MigrateToAadPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "MigrateToAad", nil, "Failure preparing request") + return + } + + result, err = client.MigrateToAadSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "MigrateToAad", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateToAadPreparer prepares the MigrateToAad request. +func (client ReplicationFabricsClient) MigrateToAadPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/migratetoaad", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateToAadSender sends the MigrateToAad request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) MigrateToAadSender(req *http.Request) (future ReplicationFabricsMigrateToAadFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateToAadResponder handles the response to the MigrateToAad request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) MigrateToAadResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Purge the operation to purge(force delete) an Azure Site Recovery fabric. +// Parameters: +// fabricName - ASR fabric to purge. +func (client ReplicationFabricsClient) Purge(ctx context.Context, fabricName string) (result ReplicationFabricsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationFabricsClient) PurgePreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) PurgeSender(req *http.Request) (future ReplicationFabricsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// ReassociateGateway the operation to move replications from a process server to another process server. +// Parameters: +// fabricName - the name of the fabric containing the process server. +// failoverProcessServerRequest - the input to the failover process server operation. +func (client ReplicationFabricsClient) ReassociateGateway(ctx context.Context, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest) (result ReplicationFabricsReassociateGatewayFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.ReassociateGateway") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReassociateGatewayPreparer(ctx, fabricName, failoverProcessServerRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "ReassociateGateway", nil, "Failure preparing request") + return + } + + result, err = client.ReassociateGatewaySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "ReassociateGateway", result.Response(), "Failure sending request") + return + } + + return +} + +// ReassociateGatewayPreparer prepares the ReassociateGateway request. +func (client ReplicationFabricsClient) ReassociateGatewayPreparer(ctx context.Context, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/reassociateGateway", pathParameters), + autorest.WithJSON(failoverProcessServerRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReassociateGatewaySender sends the ReassociateGateway request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) ReassociateGatewaySender(req *http.Request) (future ReplicationFabricsReassociateGatewayFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReassociateGatewayResponder handles the response to the ReassociateGateway request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) ReassociateGatewayResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RenewCertificate renews the connection certificate for the ASR replication fabric. +// Parameters: +// fabricName - fabric name to renew certs for. +// renewCertificate - renew certificate input. +func (client ReplicationFabricsClient) RenewCertificate(ctx context.Context, fabricName string, renewCertificate RenewCertificateInput) (result ReplicationFabricsRenewCertificateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.RenewCertificate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RenewCertificatePreparer(ctx, fabricName, renewCertificate) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "RenewCertificate", nil, "Failure preparing request") + return + } + + result, err = client.RenewCertificateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "RenewCertificate", result.Response(), "Failure sending request") + return + } + + return +} + +// RenewCertificatePreparer prepares the RenewCertificate request. +func (client ReplicationFabricsClient) RenewCertificatePreparer(ctx context.Context, fabricName string, renewCertificate RenewCertificateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/renewCertificate", pathParameters), + autorest.WithJSON(renewCertificate), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RenewCertificateSender sends the RenewCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) RenewCertificateSender(req *http.Request) (future ReplicationFabricsRenewCertificateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RenewCertificateResponder handles the response to the RenewCertificate request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) RenewCertificateResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationjobs.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationjobs.go new file mode 100644 index 000000000000..df7ec11c4852 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationjobs.go @@ -0,0 +1,547 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationJobsClient is the client for the ReplicationJobs methods of the Siterecovery service. +type ReplicationJobsClient struct { + BaseClient +} + +// NewReplicationJobsClient creates an instance of the ReplicationJobsClient client. +func NewReplicationJobsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationJobsClient { + return NewReplicationJobsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationJobsClientWithBaseURI creates an instance of the ReplicationJobsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationJobsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationJobsClient { + return ReplicationJobsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Cancel the operation to cancel an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Cancel(ctx context.Context, jobName string) (result ReplicationJobsCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Cancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CancelPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Cancel", nil, "Failure preparing request") + return + } + + result, err = client.CancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Cancel", result.Response(), "Failure sending request") + return + } + + return +} + +// CancelPreparer prepares the Cancel request. +func (client ReplicationJobsClient) CancelPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/cancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CancelSender sends the Cancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) CancelSender(req *http.Request) (future ReplicationJobsCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CancelResponder handles the response to the Cancel request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) CancelResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Export the operation to export the details of the Azure Site Recovery jobs of the vault. +// Parameters: +// jobQueryParameter - job query filter. +func (client ReplicationJobsClient) Export(ctx context.Context, jobQueryParameter JobQueryParameter) (result ReplicationJobsExportFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Export") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ExportPreparer(ctx, jobQueryParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Export", nil, "Failure preparing request") + return + } + + result, err = client.ExportSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Export", result.Response(), "Failure sending request") + return + } + + return +} + +// ExportPreparer prepares the Export request. +func (client ReplicationJobsClient) ExportPreparer(ctx context.Context, jobQueryParameter JobQueryParameter) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/export", pathParameters), + autorest.WithJSON(jobQueryParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExportSender sends the Export request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ExportSender(req *http.Request) (future ReplicationJobsExportFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ExportResponder handles the response to the Export request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ExportResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get the details of an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Get(ctx context.Context, jobName string) (result Job, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationJobsClient) GetPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) GetResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of Azure Site Recovery Jobs for the vault. +// Parameters: +// filter - oData filter options. +func (client ReplicationJobsClient) List(ctx context.Context, filter string) (result JobCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.List") + defer func() { + sc := -1 + if result.jc.Response.Response != nil { + sc = result.jc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.jc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", resp, "Failure sending request") + return + } + + result.jc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", resp, "Failure responding to request") + return + } + if result.jc.hasNextLink() && result.jc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationJobsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ListResponder(resp *http.Response) (result JobCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationJobsClient) listNextResults(ctx context.Context, lastResults JobCollection) (result JobCollection, err error) { + req, err := lastResults.jobCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationJobsClient) ListComplete(ctx context.Context, filter string) (result JobCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} + +// Restart the operation to restart an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Restart(ctx context.Context, jobName string) (result ReplicationJobsRestartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Restart") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RestartPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Restart", nil, "Failure preparing request") + return + } + + result, err = client.RestartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Restart", result.Response(), "Failure sending request") + return + } + + return +} + +// RestartPreparer prepares the Restart request. +func (client ReplicationJobsClient) RestartPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartSender sends the Restart request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) RestartSender(req *http.Request) (future ReplicationJobsRestartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestartResponder handles the response to the Restart request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) RestartResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Resume the operation to resume an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +// resumeJobParams - resume rob comments. +func (client ReplicationJobsClient) Resume(ctx context.Context, jobName string, resumeJobParams ResumeJobParams) (result ReplicationJobsResumeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Resume") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResumePreparer(ctx, jobName, resumeJobParams) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Resume", nil, "Failure preparing request") + return + } + + result, err = client.ResumeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Resume", result.Response(), "Failure sending request") + return + } + + return +} + +// ResumePreparer prepares the Resume request. +func (client ReplicationJobsClient) ResumePreparer(ctx context.Context, jobName string, resumeJobParams ResumeJobParams) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/resume", pathParameters), + autorest.WithJSON(resumeJobParams), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResumeSender sends the Resume request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ResumeSender(req *http.Request) (future ReplicationJobsResumeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResumeResponder handles the response to the Resume request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ResumeResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationlogicalnetworks.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationlogicalnetworks.go new file mode 100644 index 000000000000..30ea99215941 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationlogicalnetworks.go @@ -0,0 +1,229 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationLogicalNetworksClient is the client for the ReplicationLogicalNetworks methods of the Siterecovery +// service. +type ReplicationLogicalNetworksClient struct { + BaseClient +} + +// NewReplicationLogicalNetworksClient creates an instance of the ReplicationLogicalNetworksClient client. +func NewReplicationLogicalNetworksClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationLogicalNetworksClient { + return NewReplicationLogicalNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationLogicalNetworksClientWithBaseURI creates an instance of the ReplicationLogicalNetworksClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationLogicalNetworksClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationLogicalNetworksClient { + return ReplicationLogicalNetworksClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of a logical network. +// Parameters: +// fabricName - server Id. +// logicalNetworkName - logical network name. +func (client ReplicationLogicalNetworksClient) Get(ctx context.Context, fabricName string, logicalNetworkName string) (result LogicalNetwork, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, logicalNetworkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationLogicalNetworksClient) GetPreparer(ctx context.Context, fabricName string, logicalNetworkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "logicalNetworkName": autorest.Encode("path", logicalNetworkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks/{logicalNetworkName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationLogicalNetworksClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationLogicalNetworksClient) GetResponder(resp *http.Response) (result LogicalNetwork, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationFabrics lists all the logical networks of the Azure Site Recovery fabric. +// Parameters: +// fabricName - server Id. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result LogicalNetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.lnc.Response.Response != nil { + sc = result.lnc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.lnc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.lnc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.lnc.hasNextLink() && result.lnc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsResponder(resp *http.Response) (result LogicalNetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationLogicalNetworksClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults LogicalNetworkCollection) (result LogicalNetworkCollection, err error) { + req, err := lastResults.logicalNetworkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result LogicalNetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationmigrationitems.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationmigrationitems.go new file mode 100644 index 000000000000..0a66aa2f9d3e --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationmigrationitems.go @@ -0,0 +1,1009 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationMigrationItemsClient is the client for the ReplicationMigrationItems methods of the Siterecovery service. +type ReplicationMigrationItemsClient struct { + BaseClient +} + +// NewReplicationMigrationItemsClient creates an instance of the ReplicationMigrationItemsClient client. +func NewReplicationMigrationItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationMigrationItemsClient { + return NewReplicationMigrationItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationMigrationItemsClientWithBaseURI creates an instance of the ReplicationMigrationItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationMigrationItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationMigrationItemsClient { + return ReplicationMigrationItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR migration item (enable migration). +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - enable migration input. +func (client ReplicationMigrationItemsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input EnableMigrationInput) (result ReplicationMigrationItemsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.PolicyID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationMigrationItemsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input EnableMigrationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) CreateSender(req *http.Request) (future ReplicationMigrationItemsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) CreateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// deleteOption - the delete option. +func (client ReplicationMigrationItemsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (result ReplicationMigrationItemsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, migrationItemName, deleteOption) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationMigrationItemsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(deleteOption) > 0 { + queryParameters["deleteOption"] = autorest.Encode("query", deleteOption) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) DeleteSender(req *http.Request) (future ReplicationMigrationItemsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get sends the get request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +func (client ReplicationMigrationItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, migrationItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationMigrationItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) GetResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List sends the list request. +// Parameters: +// skipToken - the pagination token. +// takeToken - the page size. +// filter - oData filter options. +func (client ReplicationMigrationItemsClient) List(ctx context.Context, skipToken string, takeToken string, filter string) (result MigrationItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.List") + defer func() { + sc := -1 + if result.mic.Response.Response != nil { + sc = result.mic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, takeToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.mic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", resp, "Failure sending request") + return + } + + result.mic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", resp, "Failure responding to request") + return + } + if result.mic.hasNextLink() && result.mic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationMigrationItemsClient) ListPreparer(ctx context.Context, skipToken string, takeToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationMigrationItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ListResponder(resp *http.Response) (result MigrationItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationMigrationItemsClient) listNextResults(ctx context.Context, lastResults MigrationItemCollection) (result MigrationItemCollection, err error) { + req, err := lastResults.migrationItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationMigrationItemsClient) ListComplete(ctx context.Context, skipToken string, takeToken string, filter string) (result MigrationItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, takeToken, filter) + return +} + +// ListByReplicationProtectionContainers gets the list of ASR migration items in the protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// skipToken - the pagination token. +// takeToken - the page size. +// filter - oData filter options. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result MigrationItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.mic.Response.Response != nil { + sc = result.mic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName, skipToken, takeToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.mic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.mic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.mic.hasNextLink() && result.mic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result MigrationItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationMigrationItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults MigrationItemCollection) (result MigrationItemCollection, err error) { + req, err := lastResults.migrationItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result MigrationItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName, skipToken, takeToken, filter) + return +} + +// Migrate the operation to initiate migration of the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// migrateInput - migrate input. +func (client ReplicationMigrationItemsClient) Migrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput MigrateInput) (result ReplicationMigrationItemsMigrateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Migrate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: migrateInput, + Constraints: []validation.Constraint{{Target: "migrateInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Migrate", err.Error()) + } + + req, err := client.MigratePreparer(ctx, fabricName, protectionContainerName, migrationItemName, migrateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Migrate", nil, "Failure preparing request") + return + } + + result, err = client.MigrateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Migrate", result.Response(), "Failure sending request") + return + } + + return +} + +// MigratePreparer prepares the Migrate request. +func (client ReplicationMigrationItemsClient) MigratePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput MigrateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrate", pathParameters), + autorest.WithJSON(migrateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateSender sends the Migrate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) MigrateSender(req *http.Request) (future ReplicationMigrationItemsMigrateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateResponder handles the response to the Migrate request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) MigrateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Resync the operation to resynchronize replication of an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - resync input. +func (client ReplicationMigrationItemsClient) Resync(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input ResyncInput) (result ReplicationMigrationItemsResyncFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Resync") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Resync", err.Error()) + } + + req, err := client.ResyncPreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Resync", nil, "Failure preparing request") + return + } + + result, err = client.ResyncSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Resync", result.Response(), "Failure sending request") + return + } + + return +} + +// ResyncPreparer prepares the Resync request. +func (client ReplicationMigrationItemsClient) ResyncPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input ResyncInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/resync", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResyncSender sends the Resync request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ResyncSender(req *http.Request) (future ReplicationMigrationItemsResyncFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResyncResponder handles the response to the Resync request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ResyncResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestMigrate the operation to initiate test migration of the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// testMigrateInput - test migrate input. +func (client ReplicationMigrationItemsClient) TestMigrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput TestMigrateInput) (result ReplicationMigrationItemsTestMigrateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.TestMigrate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testMigrateInput, + Constraints: []validation.Constraint{{Target: "testMigrateInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "TestMigrate", err.Error()) + } + + req, err := client.TestMigratePreparer(ctx, fabricName, protectionContainerName, migrationItemName, testMigrateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrate", nil, "Failure preparing request") + return + } + + result, err = client.TestMigrateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrate", result.Response(), "Failure sending request") + return + } + + return +} + +// TestMigratePreparer prepares the TestMigrate request. +func (client ReplicationMigrationItemsClient) TestMigratePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput TestMigrateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrate", pathParameters), + autorest.WithJSON(testMigrateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestMigrateSender sends the TestMigrate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) TestMigrateSender(req *http.Request) (future ReplicationMigrationItemsTestMigrateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestMigrateResponder handles the response to the TestMigrate request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) TestMigrateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestMigrateCleanup the operation to initiate test migrate cleanup. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// testMigrateCleanupInput - test migrate cleanup input. +func (client ReplicationMigrationItemsClient) TestMigrateCleanup(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput TestMigrateCleanupInput) (result ReplicationMigrationItemsTestMigrateCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.TestMigrateCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testMigrateCleanupInput, + Constraints: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", err.Error()) + } + + req, err := client.TestMigrateCleanupPreparer(ctx, fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestMigrateCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestMigrateCleanupPreparer prepares the TestMigrateCleanup request. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput TestMigrateCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrateCleanup", pathParameters), + autorest.WithJSON(testMigrateCleanupInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestMigrateCleanupSender sends the TestMigrateCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupSender(req *http.Request) (future ReplicationMigrationItemsTestMigrateCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestMigrateCleanupResponder handles the response to the TestMigrateCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update the recovery settings of an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - update migration item input. +func (client ReplicationMigrationItemsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input UpdateMigrationItemInput) (result ReplicationMigrationItemsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationMigrationItemsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input UpdateMigrationItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) UpdateSender(req *http.Request) (future ReplicationMigrationItemsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) UpdateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationnetworkmappings.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationnetworkmappings.go new file mode 100644 index 000000000000..29818a6a7c13 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationnetworkmappings.go @@ -0,0 +1,610 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationNetworkMappingsClient is the client for the ReplicationNetworkMappings methods of the Siterecovery +// service. +type ReplicationNetworkMappingsClient struct { + BaseClient +} + +// NewReplicationNetworkMappingsClient creates an instance of the ReplicationNetworkMappingsClient client. +func NewReplicationNetworkMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworkMappingsClient { + return NewReplicationNetworkMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationNetworkMappingsClientWithBaseURI creates an instance of the ReplicationNetworkMappingsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationNetworkMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworkMappingsClient { + return ReplicationNetworkMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +// input - create network mapping input. +func (client ReplicationNetworkMappingsClient) Create(ctx context.Context, fabricName string, networkName string, networkMappingName string, input CreateNetworkMappingInput) (result ReplicationNetworkMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.RecoveryNetworkID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationNetworkMappingsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, networkName, networkMappingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationNetworkMappingsClient) CreatePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string, input CreateNetworkMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) CreateSender(req *http.Request) (future ReplicationNetworkMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) CreateResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - ARM Resource Name for network mapping. +func (client ReplicationNetworkMappingsClient) Delete(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result ReplicationNetworkMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, networkName, networkMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationNetworkMappingsClient) DeletePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) DeleteSender(req *http.Request) (future ReplicationNetworkMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +func (client ReplicationNetworkMappingsClient) Get(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result NetworkMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, networkName, networkMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationNetworkMappingsClient) GetPreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) GetResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all ASR network mappings in the vault. +func (client ReplicationNetworkMappingsClient) List(ctx context.Context) (result NetworkMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.List") + defer func() { + sc := -1 + if result.nmc.Response.Response != nil { + sc = result.nmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.nmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", resp, "Failure sending request") + return + } + + result.nmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.nmc.hasNextLink() && result.nmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationNetworkMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationNetworkMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) ListResponder(resp *http.Response) (result NetworkMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationNetworkMappingsClient) listNextResults(ctx context.Context, lastResults NetworkMappingCollection) (result NetworkMappingCollection, err error) { + req, err := lastResults.networkMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworkMappingsClient) ListComplete(ctx context.Context) (result NetworkMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationNetworks lists all ASR network mappings for the specified network. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworks(ctx context.Context, fabricName string, networkName string) (result NetworkMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.ListByReplicationNetworks") + defer func() { + sc := -1 + if result.nmc.Response.Response != nil { + sc = result.nmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationNetworksNextResults + req, err := client.ListByReplicationNetworksPreparer(ctx, fabricName, networkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationNetworksSender(req) + if err != nil { + result.nmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", resp, "Failure sending request") + return + } + + result.nmc, err = client.ListByReplicationNetworksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", resp, "Failure responding to request") + return + } + if result.nmc.hasNextLink() && result.nmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationNetworksPreparer prepares the ListByReplicationNetworks request. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksPreparer(ctx context.Context, fabricName string, networkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationNetworksSender sends the ListByReplicationNetworks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationNetworksResponder handles the response to the ListByReplicationNetworks request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksResponder(resp *http.Response) (result NetworkMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationNetworksNextResults retrieves the next set of results, if any. +func (client ReplicationNetworkMappingsClient) listByReplicationNetworksNextResults(ctx context.Context, lastResults NetworkMappingCollection) (result NetworkMappingCollection, err error) { + req, err := lastResults.networkMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationNetworksSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationNetworksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationNetworksComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksComplete(ctx context.Context, fabricName string, networkName string) (result NetworkMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.ListByReplicationNetworks") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationNetworks(ctx, fabricName, networkName) + return +} + +// Update the operation to update an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +// input - update network mapping input. +func (client ReplicationNetworkMappingsClient) Update(ctx context.Context, fabricName string, networkName string, networkMappingName string, input UpdateNetworkMappingInput) (result ReplicationNetworkMappingsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, networkName, networkMappingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationNetworkMappingsClient) UpdatePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string, input UpdateNetworkMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) UpdateSender(req *http.Request) (future ReplicationNetworkMappingsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) UpdateResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationnetworks.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationnetworks.go new file mode 100644 index 000000000000..d9831c17ed15 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationnetworks.go @@ -0,0 +1,343 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationNetworksClient is the client for the ReplicationNetworks methods of the Siterecovery service. +type ReplicationNetworksClient struct { + BaseClient +} + +// NewReplicationNetworksClient creates an instance of the ReplicationNetworksClient client. +func NewReplicationNetworksClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworksClient { + return NewReplicationNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationNetworksClientWithBaseURI creates an instance of the ReplicationNetworksClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationNetworksClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworksClient { + return ReplicationNetworksClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of a network. +// Parameters: +// fabricName - server Id. +// networkName - primary network name. +func (client ReplicationNetworksClient) Get(ctx context.Context, fabricName string, networkName string) (result Network, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, networkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationNetworksClient) GetPreparer(ctx context.Context, fabricName string, networkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) GetResponder(resp *http.Response) (result Network, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the networks available in a vault. +func (client ReplicationNetworksClient) List(ctx context.Context) (result NetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.List") + defer func() { + sc := -1 + if result.nc.Response.Response != nil { + sc = result.nc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.nc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", resp, "Failure sending request") + return + } + + result.nc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", resp, "Failure responding to request") + return + } + if result.nc.hasNextLink() && result.nc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationNetworksClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) ListResponder(resp *http.Response) (result NetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationNetworksClient) listNextResults(ctx context.Context, lastResults NetworkCollection) (result NetworkCollection, err error) { + req, err := lastResults.networkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworksClient) ListComplete(ctx context.Context) (result NetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the networks available for a fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationNetworksClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result NetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.nc.Response.Response != nil { + sc = result.nc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.nc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.nc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.nc.hasNextLink() && result.nc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationNetworksClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) ListByReplicationFabricsResponder(resp *http.Response) (result NetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationNetworksClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults NetworkCollection) (result NetworkCollection, err error) { + req, err := lastResults.networkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworksClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result NetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationpolicies.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationpolicies.go new file mode 100644 index 000000000000..f3e8d948b3d9 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationpolicies.go @@ -0,0 +1,465 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationPoliciesClient is the client for the ReplicationPolicies methods of the Siterecovery service. +type ReplicationPoliciesClient struct { + BaseClient +} + +// NewReplicationPoliciesClient creates an instance of the ReplicationPoliciesClient client. +func NewReplicationPoliciesClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationPoliciesClient { + return NewReplicationPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationPoliciesClientWithBaseURI creates an instance of the ReplicationPoliciesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationPoliciesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationPoliciesClient { + return ReplicationPoliciesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a replication policy. +// Parameters: +// policyName - replication policy name. +// input - create policy input. +func (client ReplicationPoliciesClient) Create(ctx context.Context, policyName string, input CreatePolicyInput) (result ReplicationPoliciesCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, policyName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationPoliciesClient) CreatePreparer(ctx context.Context, policyName string, input CreatePolicyInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) CreateSender(req *http.Request) (future ReplicationPoliciesCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) CreateResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a replication policy. +// Parameters: +// policyName - replication policy name. +func (client ReplicationPoliciesClient) Delete(ctx context.Context, policyName string) (result ReplicationPoliciesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationPoliciesClient) DeletePreparer(ctx context.Context, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) DeleteSender(req *http.Request) (future ReplicationPoliciesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a replication policy. +// Parameters: +// policyName - replication policy name. +func (client ReplicationPoliciesClient) Get(ctx context.Context, policyName string) (result Policy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationPoliciesClient) GetPreparer(ctx context.Context, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) GetResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the replication policies for a vault. +func (client ReplicationPoliciesClient) List(ctx context.Context) (result PolicyCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.List") + defer func() { + sc := -1 + if result.pc.Response.Response != nil { + sc = result.pc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", resp, "Failure sending request") + return + } + + result.pc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", resp, "Failure responding to request") + return + } + if result.pc.hasNextLink() && result.pc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationPoliciesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) ListResponder(resp *http.Response) (result PolicyCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationPoliciesClient) listNextResults(ctx context.Context, lastResults PolicyCollection) (result PolicyCollection, err error) { + req, err := lastResults.policyCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationPoliciesClient) ListComplete(ctx context.Context) (result PolicyCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// Update the operation to update a replication policy. +// Parameters: +// policyName - policy Id. +// input - update Policy Input. +func (client ReplicationPoliciesClient) Update(ctx context.Context, policyName string, input UpdatePolicyInput) (result ReplicationPoliciesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, policyName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationPoliciesClient) UpdatePreparer(ctx context.Context, policyName string, input UpdatePolicyInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) UpdateSender(req *http.Request) (future ReplicationPoliciesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) UpdateResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationprotectableitems.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationprotectableitems.go new file mode 100644 index 000000000000..d57ca7ffa528 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationprotectableitems.go @@ -0,0 +1,245 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectableItemsClient is the client for the ReplicationProtectableItems methods of the Siterecovery +// service. +type ReplicationProtectableItemsClient struct { + BaseClient +} + +// NewReplicationProtectableItemsClient creates an instance of the ReplicationProtectableItemsClient client. +func NewReplicationProtectableItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectableItemsClient { + return NewReplicationProtectableItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectableItemsClientWithBaseURI creates an instance of the ReplicationProtectableItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationProtectableItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectableItemsClient { + return ReplicationProtectableItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get the operation to get the details of a protectable item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// protectableItemName - protectable item name. +func (client ReplicationProtectableItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (result ProtectableItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, protectableItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectableItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectableItemName": autorest.Encode("path", protectableItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems/{protectableItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectableItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectableItemsClient) GetResponder(resp *http.Response) (result ProtectableItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationProtectionContainers lists the protectable items in a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// filter - oData filter options. +// take - take OData query parameter. +// skipToken - skipToken OData query parameter. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result ProtectableItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.pic.Response.Response != nil { + sc = result.pic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName, filter, take, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.pic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.pic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.pic.hasNextLink() && result.pic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(take) > 0 { + queryParameters["$take"] = autorest.Encode("query", take) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ProtectableItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectableItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ProtectableItemCollection) (result ProtectableItemCollection, err error) { + req, err := lastResults.protectableItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result ProtectableItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName, filter, take, skipToken) + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationprotecteditems.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationprotecteditems.go new file mode 100644 index 000000000000..b4f45ff63d58 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationprotecteditems.go @@ -0,0 +1,1935 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectedItemsClient is the client for the ReplicationProtectedItems methods of the Siterecovery service. +type ReplicationProtectedItemsClient struct { + BaseClient +} + +// NewReplicationProtectedItemsClient creates an instance of the ReplicationProtectedItemsClient client. +func NewReplicationProtectedItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectedItemsClient { + return NewReplicationProtectedItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectedItemsClientWithBaseURI creates an instance of the ReplicationProtectedItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationProtectedItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectedItemsClient { + return ReplicationProtectedItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// AddDisks operation to add disks(s) to the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// addDisksInput - add disks input. +func (client ReplicationProtectedItemsClient) AddDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput AddDisksInput) (result ReplicationProtectedItemsAddDisksFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.AddDisks") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddDisksPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, addDisksInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "AddDisks", nil, "Failure preparing request") + return + } + + result, err = client.AddDisksSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "AddDisks", result.Response(), "Failure sending request") + return + } + + return +} + +// AddDisksPreparer prepares the AddDisks request. +func (client ReplicationProtectedItemsClient) AddDisksPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput AddDisksInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/addDisks", pathParameters), + autorest.WithJSON(addDisksInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddDisksSender sends the AddDisks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) AddDisksSender(req *http.Request) (future ReplicationProtectedItemsAddDisksFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// AddDisksResponder handles the response to the AddDisks request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) AddDisksResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ApplyRecoveryPoint the operation to change the recovery point of a failed over replication protected item. +// Parameters: +// fabricName - the ARM fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replicated protected item name. +// applyRecoveryPointInput - the ApplyRecoveryPointInput. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPoint(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput ApplyRecoveryPointInput) (result ReplicationProtectedItemsApplyRecoveryPointFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ApplyRecoveryPoint") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: applyRecoveryPointInput, + Constraints: []validation.Constraint{{Target: "applyRecoveryPointInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", err.Error()) + } + + req, err := client.ApplyRecoveryPointPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, applyRecoveryPointInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", nil, "Failure preparing request") + return + } + + result, err = client.ApplyRecoveryPointSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", result.Response(), "Failure sending request") + return + } + + return +} + +// ApplyRecoveryPointPreparer prepares the ApplyRecoveryPoint request. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput ApplyRecoveryPointInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/applyRecoveryPoint", pathParameters), + autorest.WithJSON(applyRecoveryPointInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ApplyRecoveryPointSender sends the ApplyRecoveryPoint request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointSender(req *http.Request) (future ReplicationProtectedItemsApplyRecoveryPointFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ApplyRecoveryPointResponder handles the response to the ApplyRecoveryPoint request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Create the operation to create an ASR replication protected item (Enable replication). +// Parameters: +// fabricName - name of the fabric. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - a name for the replication protected item. +// input - enable Protection Input. +func (client ReplicationProtectedItemsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input EnableProtectionInput) (result ReplicationProtectedItemsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectedItemsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input EnableProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) CreateSender(req *http.Request) (future ReplicationProtectedItemsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) CreateResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to disable replication on a replication protected item. This will also remove the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// disableProtectionInput - disable protection input. +func (client ReplicationProtectedItemsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput DisableProtectionInput) (result ReplicationProtectedItemsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: disableProtectionInput, + Constraints: []validation.Constraint{{Target: "disableProtectionInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, disableProtectionInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectedItemsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput DisableProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/remove", pathParameters), + autorest.WithJSON(disableProtectionInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) DeleteSender(req *http.Request) (future ReplicationProtectedItemsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// FailoverCancel operation to cancel the failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) FailoverCancel(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsFailoverCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.FailoverCancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCancelPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCancel", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCancel", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCancelPreparer prepares the FailoverCancel request. +func (client ReplicationProtectedItemsClient) FailoverCancelPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCancelSender sends the FailoverCancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) FailoverCancelSender(req *http.Request) (future ReplicationProtectedItemsFailoverCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCancelResponder handles the response to the FailoverCancel request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) FailoverCancelResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// FailoverCommit operation to commit the failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) FailoverCommit(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsFailoverCommitFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.FailoverCommit") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCommitPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCommit", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCommitSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCommit", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCommitPreparer prepares the FailoverCommit request. +func (client ReplicationProtectedItemsClient) FailoverCommitPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCommit", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCommitSender sends the FailoverCommit request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) FailoverCommitSender(req *http.Request) (future ReplicationProtectedItemsFailoverCommitFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCommitResponder handles the response to the FailoverCommit request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) FailoverCommitResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of an ASR replication protected item. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectedItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) GetResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of ASR replication protected items in the vault. +// Parameters: +// skipToken - the pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. +// filter - oData filter options. +func (client ReplicationProtectedItemsClient) List(ctx context.Context, skipToken string, filter string) (result ReplicationProtectedItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.List") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectedItemsClient) ListPreparer(ctx context.Context, skipToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectedItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ListResponder(resp *http.Response) (result ReplicationProtectedItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectedItemsClient) listNextResults(ctx context.Context, lastResults ReplicationProtectedItemCollection) (result ReplicationProtectedItemCollection, err error) { + req, err := lastResults.replicationProtectedItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectedItemsClient) ListComplete(ctx context.Context, skipToken string, filter string) (result ReplicationProtectedItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, filter) + return +} + +// ListByReplicationProtectionContainers gets the list of ASR replication protected items in the protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectedItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ReplicationProtectedItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectedItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ReplicationProtectedItemCollection) (result ReplicationProtectedItemCollection, err error) { + req, err := lastResults.replicationProtectedItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectedItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName) + return +} + +// PlannedFailover operation to initiate a planned failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// failoverInput - planned failover input. +func (client ReplicationProtectedItemsClient) PlannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput PlannedFailoverInput) (result ReplicationProtectedItemsPlannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.PlannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PlannedFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "PlannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.PlannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "PlannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// PlannedFailoverPreparer prepares the PlannedFailover request. +func (client ReplicationProtectedItemsClient) PlannedFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput PlannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/plannedFailover", pathParameters), + autorest.WithJSON(failoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PlannedFailoverSender sends the PlannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) PlannedFailoverSender(req *http.Request) (future ReplicationProtectedItemsPlannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PlannedFailoverResponder handles the response to the PlannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) PlannedFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Purge the operation to delete or purge a replication protected item. This operation will force delete the +// replication protected item. Use the remove operation on replication protected item to perform a clean disable +// replication for the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) Purge(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationProtectedItemsClient) PurgePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) PurgeSender(req *http.Request) (future ReplicationProtectedItemsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RemoveDisks operation to remove disk(s) from the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// removeDisksInput - remove disks input. +func (client ReplicationProtectedItemsClient) RemoveDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput RemoveDisksInput) (result ReplicationProtectedItemsRemoveDisksFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.RemoveDisks") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RemoveDisksPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, removeDisksInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RemoveDisks", nil, "Failure preparing request") + return + } + + result, err = client.RemoveDisksSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RemoveDisks", result.Response(), "Failure sending request") + return + } + + return +} + +// RemoveDisksPreparer prepares the RemoveDisks request. +func (client ReplicationProtectedItemsClient) RemoveDisksPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput RemoveDisksInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/removeDisks", pathParameters), + autorest.WithJSON(removeDisksInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RemoveDisksSender sends the RemoveDisks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) RemoveDisksSender(req *http.Request) (future ReplicationProtectedItemsRemoveDisksFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RemoveDisksResponder handles the response to the RemoveDisks request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) RemoveDisksResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RepairReplication the operation to start resynchronize/repair replication for a replication protected item requiring +// resynchronization. +// Parameters: +// fabricName - the name of the fabric. +// protectionContainerName - the name of the container. +// replicatedProtectedItemName - the name of the replication protected item. +func (client ReplicationProtectedItemsClient) RepairReplication(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsRepairReplicationFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.RepairReplication") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RepairReplicationPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RepairReplication", nil, "Failure preparing request") + return + } + + result, err = client.RepairReplicationSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RepairReplication", result.Response(), "Failure sending request") + return + } + + return +} + +// RepairReplicationPreparer prepares the RepairReplication request. +func (client ReplicationProtectedItemsClient) RepairReplicationPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/repairReplication", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RepairReplicationSender sends the RepairReplication request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) RepairReplicationSender(req *http.Request) (future ReplicationProtectedItemsRepairReplicationFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RepairReplicationResponder handles the response to the RepairReplication request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) RepairReplicationResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Reprotect operation to reprotect or reverse replicate a failed over replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// reprotectInput - reverse replication input. +func (client ReplicationProtectedItemsClient) Reprotect(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput ReverseReplicationInput) (result ReplicationProtectedItemsReprotectFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Reprotect") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReprotectPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, reprotectInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Reprotect", nil, "Failure preparing request") + return + } + + result, err = client.ReprotectSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Reprotect", result.Response(), "Failure sending request") + return + } + + return +} + +// ReprotectPreparer prepares the Reprotect request. +func (client ReplicationProtectedItemsClient) ReprotectPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput ReverseReplicationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/reProtect", pathParameters), + autorest.WithJSON(reprotectInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReprotectSender sends the Reprotect request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ReprotectSender(req *http.Request) (future ReplicationProtectedItemsReprotectFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReprotectResponder handles the response to the Reprotect request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ReprotectResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ResolveHealthErrors operation to resolve health issues of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// resolveHealthInput - health issue input object. +func (client ReplicationProtectedItemsClient) ResolveHealthErrors(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput ResolveHealthInput) (result ReplicationProtectedItemsResolveHealthErrorsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ResolveHealthErrors") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResolveHealthErrorsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, resolveHealthInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ResolveHealthErrors", nil, "Failure preparing request") + return + } + + result, err = client.ResolveHealthErrorsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ResolveHealthErrors", result.Response(), "Failure sending request") + return + } + + return +} + +// ResolveHealthErrorsPreparer prepares the ResolveHealthErrors request. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput ResolveHealthInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/resolveHealthErrors", pathParameters), + autorest.WithJSON(resolveHealthInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResolveHealthErrorsSender sends the ResolveHealthErrors request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsSender(req *http.Request) (future ReplicationProtectedItemsResolveHealthErrorsFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResolveHealthErrorsResponder handles the response to the ResolveHealthErrors request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailover operation to perform a test failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// testfailoverInput - test failover input. +func (client ReplicationProtectedItemsClient) TestFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput TestFailoverInput) (result ReplicationProtectedItemsTestFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.TestFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testfailoverInput, + Constraints: []validation.Constraint{{Target: "testfailoverInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "TestFailover", err.Error()) + } + + req, err := client.TestFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, testfailoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailover", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverPreparer prepares the TestFailover request. +func (client ReplicationProtectedItemsClient) TestFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput TestFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailover", pathParameters), + autorest.WithJSON(testfailoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverSender sends the TestFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) TestFailoverSender(req *http.Request) (future ReplicationProtectedItemsTestFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverResponder handles the response to the TestFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) TestFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailoverCleanup operation to clean up the test failover of a replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// cleanupInput - test failover cleanup input. +func (client ReplicationProtectedItemsClient) TestFailoverCleanup(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput TestFailoverCleanupInput) (result ReplicationProtectedItemsTestFailoverCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.TestFailoverCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: cleanupInput, + Constraints: []validation.Constraint{{Target: "cleanupInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "cleanupInput.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "cleanupInput.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", err.Error()) + } + + req, err := client.TestFailoverCleanupPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, cleanupInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverCleanupPreparer prepares the TestFailoverCleanup request. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput TestFailoverCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailoverCleanup", pathParameters), + autorest.WithJSON(cleanupInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverCleanupSender sends the TestFailoverCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupSender(req *http.Request) (future ReplicationProtectedItemsTestFailoverCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverCleanupResponder handles the response to the TestFailoverCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UnplannedFailover operation to initiate a failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// failoverInput - failover input. +func (client ReplicationProtectedItemsClient) UnplannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput UnplannedFailoverInput) (result ReplicationProtectedItemsUnplannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UnplannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: failoverInput, + Constraints: []validation.Constraint{{Target: "failoverInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", err.Error()) + } + + req, err := client.UnplannedFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.UnplannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// UnplannedFailoverPreparer prepares the UnplannedFailover request. +func (client ReplicationProtectedItemsClient) UnplannedFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput UnplannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/unplannedFailover", pathParameters), + autorest.WithJSON(failoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UnplannedFailoverSender sends the UnplannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UnplannedFailoverSender(req *http.Request) (future ReplicationProtectedItemsUnplannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UnplannedFailoverResponder handles the response to the UnplannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UnplannedFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update the recovery settings of an ASR replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// updateProtectionInput - update protection input. +func (client ReplicationProtectedItemsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput UpdateReplicationProtectedItemInput) (result ReplicationProtectedItemsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, updateProtectionInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationProtectedItemsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput UpdateReplicationProtectedItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithJSON(updateProtectionInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateSender(req *http.Request) (future ReplicationProtectedItemsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateAppliance the operation to update appliance of an ASR replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// applianceUpdateInput - appliance update protection input. +func (client ReplicationProtectedItemsClient) UpdateAppliance(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput UpdateApplianceForReplicationProtectedItemInput) (result ReplicationProtectedItemsUpdateApplianceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UpdateAppliance") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: applianceUpdateInput, + Constraints: []validation.Constraint{{Target: "applianceUpdateInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "applianceUpdateInput.Properties.TargetApplianceID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "UpdateAppliance", err.Error()) + } + + req, err := client.UpdateAppliancePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, applianceUpdateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateAppliance", nil, "Failure preparing request") + return + } + + result, err = client.UpdateApplianceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateAppliance", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateAppliancePreparer prepares the UpdateAppliance request. +func (client ReplicationProtectedItemsClient) UpdateAppliancePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput UpdateApplianceForReplicationProtectedItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/updateAppliance", pathParameters), + autorest.WithJSON(applianceUpdateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateApplianceSender sends the UpdateAppliance request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateApplianceSender(req *http.Request) (future ReplicationProtectedItemsUpdateApplianceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateApplianceResponder handles the response to the UpdateAppliance request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateApplianceResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateMobilityService the operation to update(push update) the installed mobility service software on a replication +// protected item to the latest available version. +// Parameters: +// fabricName - the name of the fabric containing the protected item. +// protectionContainerName - the name of the container containing the protected item. +// replicationProtectedItemName - 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. +func (client ReplicationProtectedItemsClient) UpdateMobilityService(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest UpdateMobilityServiceRequest) (result ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UpdateMobilityService") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateMobilityServicePreparer(ctx, fabricName, protectionContainerName, replicationProtectedItemName, updateMobilityServiceRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateMobilityService", nil, "Failure preparing request") + return + } + + result, err = client.UpdateMobilityServiceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateMobilityService", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateMobilityServicePreparer prepares the UpdateMobilityService request. +func (client ReplicationProtectedItemsClient) UpdateMobilityServicePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest UpdateMobilityServiceRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicationProtectedItemName": autorest.Encode("path", replicationProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicationProtectedItemName}/updateMobilityService", pathParameters), + autorest.WithJSON(updateMobilityServiceRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateMobilityServiceSender sends the UpdateMobilityService request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateMobilityServiceSender(req *http.Request) (future ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateMobilityServiceResponder handles the response to the UpdateMobilityService request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateMobilityServiceResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationprotectioncontainermappings.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationprotectioncontainermappings.go new file mode 100644 index 000000000000..c36cd945de8d --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationprotectioncontainermappings.go @@ -0,0 +1,688 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionContainerMappingsClient is the client for the ReplicationProtectionContainerMappings methods of +// the Siterecovery service. +type ReplicationProtectionContainerMappingsClient struct { + BaseClient +} + +// NewReplicationProtectionContainerMappingsClient creates an instance of the +// ReplicationProtectionContainerMappingsClient client. +func NewReplicationProtectionContainerMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainerMappingsClient { + return NewReplicationProtectionContainerMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionContainerMappingsClientWithBaseURI creates an instance of the +// ReplicationProtectionContainerMappingsClient client using a custom endpoint. Use this when interacting with an +// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationProtectionContainerMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainerMappingsClient { + return ReplicationProtectionContainerMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// creationInput - mapping creation input. +func (client ReplicationProtectionContainerMappingsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput CreateProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, mappingName, creationInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionContainerMappingsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput CreateProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithJSON(creationInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) CreateSender(req *http.Request) (future ReplicationProtectionContainerMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) CreateResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete or remove a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// removalInput - removal input. +func (client ReplicationProtectionContainerMappingsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput RemoveProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, mappingName, removalInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectionContainerMappingsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput RemoveProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}/remove", pathParameters), + autorest.WithJSON(removalInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) DeleteSender(req *http.Request) (future ReplicationProtectionContainerMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection Container mapping name. +func (client ReplicationProtectionContainerMappingsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result ProtectionContainerMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, mappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionContainerMappingsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) GetResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the protection container mappings in the vault. +func (client ReplicationProtectionContainerMappingsClient) List(ctx context.Context) (result ProtectionContainerMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.List") + defer func() { + sc := -1 + if result.pcmc.Response.Response != nil { + sc = result.pcmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pcmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", resp, "Failure sending request") + return + } + + result.pcmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.pcmc.hasNextLink() && result.pcmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionContainerMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionContainerMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) ListResponder(resp *http.Response) (result ProtectionContainerMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainerMappingsClient) listNextResults(ctx context.Context, lastResults ProtectionContainerMappingCollection) (result ProtectionContainerMappingCollection, err error) { + req, err := lastResults.protectionContainerMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainerMappingsClient) ListComplete(ctx context.Context) (result ProtectionContainerMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationProtectionContainers lists the protection container mappings for a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainerMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.pcmc.Response.Response != nil { + sc = result.pcmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.pcmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.pcmc, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.pcmc.hasNextLink() && result.pcmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ProtectionContainerMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainerMappingsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ProtectionContainerMappingCollection) (result ProtectionContainerMappingCollection, err error) { + req, err := lastResults.protectionContainerMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainerMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName) + return +} + +// Purge the operation to purge(force delete) a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +func (client ReplicationProtectionContainerMappingsClient) Purge(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result ReplicationProtectionContainerMappingsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, protectionContainerName, mappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationProtectionContainerMappingsClient) PurgePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) PurgeSender(req *http.Request) (future ReplicationProtectionContainerMappingsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update the operation to update protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// updateInput - mapping update input. +func (client ReplicationProtectionContainerMappingsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput UpdateProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, mappingName, updateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationProtectionContainerMappingsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput UpdateProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithJSON(updateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) UpdateSender(req *http.Request) (future ReplicationProtectionContainerMappingsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) UpdateResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationprotectioncontainers.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationprotectioncontainers.go new file mode 100644 index 000000000000..b1f7caaf07a7 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationprotectioncontainers.go @@ -0,0 +1,677 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionContainersClient is the client for the ReplicationProtectionContainers methods of the +// Siterecovery service. +type ReplicationProtectionContainersClient struct { + BaseClient +} + +// NewReplicationProtectionContainersClient creates an instance of the ReplicationProtectionContainersClient client. +func NewReplicationProtectionContainersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainersClient { + return NewReplicationProtectionContainersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionContainersClientWithBaseURI creates an instance of the ReplicationProtectionContainersClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationProtectionContainersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainersClient { + return ReplicationProtectionContainersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create operation to create a protection container. +// Parameters: +// fabricName - unique fabric ARM name. +// protectionContainerName - unique protection container ARM name. +// creationInput - creation input. +func (client ReplicationProtectionContainersClient) Create(ctx context.Context, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput) (result ReplicationProtectionContainersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, creationInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionContainersClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}", pathParameters), + autorest.WithJSON(creationInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) CreateSender(req *http.Request) (future ReplicationProtectionContainersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) CreateResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete operation to remove a protection container. +// Parameters: +// fabricName - unique fabric ARM name. +// protectionContainerName - unique protection container ARM name. +func (client ReplicationProtectionContainersClient) Delete(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectionContainersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectionContainersClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) DeleteSender(req *http.Request) (future ReplicationProtectionContainersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DiscoverProtectableItem the operation to a add a protectable item to a protection container(Add physical server). +// Parameters: +// fabricName - the name of the fabric. +// protectionContainerName - the name of the protection container. +// discoverProtectableItemRequest - the request object to add a protectable item. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItem(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest) (result ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.DiscoverProtectableItem") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DiscoverProtectableItemPreparer(ctx, fabricName, protectionContainerName, discoverProtectableItemRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "DiscoverProtectableItem", nil, "Failure preparing request") + return + } + + result, err = client.DiscoverProtectableItemSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "DiscoverProtectableItem", result.Response(), "Failure sending request") + return + } + + return +} + +// DiscoverProtectableItemPreparer prepares the DiscoverProtectableItem request. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemPreparer(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/discoverProtectableItem", pathParameters), + autorest.WithJSON(discoverProtectableItemRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DiscoverProtectableItemSender sends the DiscoverProtectableItem request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemSender(req *http.Request) (future ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DiscoverProtectableItemResponder handles the response to the DiscoverProtectableItem request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectionContainersClient) Get(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainer, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionContainersClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) GetResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the protection containers in a vault. +func (client ReplicationProtectionContainersClient) List(ctx context.Context) (result ProtectionContainerCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.List") + defer func() { + sc := -1 + if result.pcc.Response.Response != nil { + sc = result.pcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", resp, "Failure sending request") + return + } + + result.pcc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", resp, "Failure responding to request") + return + } + if result.pcc.hasNextLink() && result.pcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionContainersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionContainers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) ListResponder(resp *http.Response) (result ProtectionContainerCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainersClient) listNextResults(ctx context.Context, lastResults ProtectionContainerCollection) (result ProtectionContainerCollection, err error) { + req, err := lastResults.protectionContainerCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainersClient) ListComplete(ctx context.Context) (result ProtectionContainerCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the protection containers in the specified fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationProtectionContainersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result ProtectionContainerCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.pcc.Response.Response != nil { + sc = result.pcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.pcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.pcc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.pcc.hasNextLink() && result.pcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsResponder(resp *http.Response) (result ProtectionContainerCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults ProtectionContainerCollection) (result ProtectionContainerCollection, err error) { + req, err := lastResults.protectionContainerCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result ProtectionContainerCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// SwitchProtection operation to switch protection from one container to another or one replication provider to +// another. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// switchInput - switch protection input. +func (client ReplicationProtectionContainersClient) SwitchProtection(ctx context.Context, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput) (result ReplicationProtectionContainersSwitchProtectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.SwitchProtection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.SwitchProtectionPreparer(ctx, fabricName, protectionContainerName, switchInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "SwitchProtection", nil, "Failure preparing request") + return + } + + result, err = client.SwitchProtectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "SwitchProtection", result.Response(), "Failure sending request") + return + } + + return +} + +// SwitchProtectionPreparer prepares the SwitchProtection request. +func (client ReplicationProtectionContainersClient) SwitchProtectionPreparer(ctx context.Context, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/switchprotection", pathParameters), + autorest.WithJSON(switchInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SwitchProtectionSender sends the SwitchProtection request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) SwitchProtectionSender(req *http.Request) (future ReplicationProtectionContainersSwitchProtectionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// SwitchProtectionResponder handles the response to the SwitchProtection request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) SwitchProtectionResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationprotectionintents.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationprotectionintents.go new file mode 100644 index 000000000000..b7b108af9734 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationprotectionintents.go @@ -0,0 +1,312 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionIntentsClient is the client for the ReplicationProtectionIntents methods of the Siterecovery +// service. +type ReplicationProtectionIntentsClient struct { + BaseClient +} + +// NewReplicationProtectionIntentsClient creates an instance of the ReplicationProtectionIntentsClient client. +func NewReplicationProtectionIntentsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionIntentsClient { + return NewReplicationProtectionIntentsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionIntentsClientWithBaseURI creates an instance of the ReplicationProtectionIntentsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationProtectionIntentsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionIntentsClient { + return ReplicationProtectionIntentsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR replication protection intent item. +// Parameters: +// intentObjectName - a name for the replication protection item. +// input - create Protection Intent Input. +func (client ReplicationProtectionIntentsClient) Create(ctx context.Context, intentObjectName string, input CreateProtectionIntentInput) (result ReplicationProtectionIntent, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, intentObjectName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionIntentsClient) CreatePreparer(ctx context.Context, intentObjectName string, input CreateProtectionIntentInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "intentObjectName": autorest.Encode("path", intentObjectName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) CreateResponder(resp *http.Response) (result ReplicationProtectionIntent, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of an ASR replication protection intent. +// Parameters: +// intentObjectName - replication protection intent name. +func (client ReplicationProtectionIntentsClient) Get(ctx context.Context, intentObjectName string) (result ReplicationProtectionIntent, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, intentObjectName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionIntentsClient) GetPreparer(ctx context.Context, intentObjectName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "intentObjectName": autorest.Encode("path", intentObjectName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) GetResponder(resp *http.Response) (result ReplicationProtectionIntent, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of ASR replication protection intent objects in the vault. +// Parameters: +// skipToken - the pagination token. +// takeToken - the page size. +func (client ReplicationProtectionIntentsClient) List(ctx context.Context, skipToken string, takeToken string) (result ReplicationProtectionIntentCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.List") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, takeToken) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionIntentsClient) ListPreparer(ctx context.Context, skipToken string, takeToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) ListResponder(resp *http.Response) (result ReplicationProtectionIntentCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionIntentsClient) listNextResults(ctx context.Context, lastResults ReplicationProtectionIntentCollection) (result ReplicationProtectionIntentCollection, err error) { + req, err := lastResults.replicationProtectionIntentCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionIntentsClient) ListComplete(ctx context.Context, skipToken string, takeToken string) (result ReplicationProtectionIntentCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, takeToken) + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationrecoveryplans.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationrecoveryplans.go new file mode 100644 index 000000000000..30f84021114f --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationrecoveryplans.go @@ -0,0 +1,1069 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationRecoveryPlansClient is the client for the ReplicationRecoveryPlans methods of the Siterecovery service. +type ReplicationRecoveryPlansClient struct { + BaseClient +} + +// NewReplicationRecoveryPlansClient creates an instance of the ReplicationRecoveryPlansClient client. +func NewReplicationRecoveryPlansClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryPlansClient { + return NewReplicationRecoveryPlansClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationRecoveryPlansClientWithBaseURI creates an instance of the ReplicationRecoveryPlansClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationRecoveryPlansClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryPlansClient { + return ReplicationRecoveryPlansClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery Plan creation input. +func (client ReplicationRecoveryPlansClient) Create(ctx context.Context, recoveryPlanName string, input CreateRecoveryPlanInput) (result ReplicationRecoveryPlansCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.PrimaryFabricID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "input.Properties.RecoveryFabricID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "input.Properties.Groups", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationRecoveryPlansClient) CreatePreparer(ctx context.Context, recoveryPlanName string, input CreateRecoveryPlanInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) CreateSender(req *http.Request) (future ReplicationRecoveryPlansCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) CreateResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) Delete(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationRecoveryPlansClient) DeletePreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) DeleteSender(req *http.Request) (future ReplicationRecoveryPlansDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// FailoverCancel the operation to cancel the failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) FailoverCancel(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansFailoverCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.FailoverCancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCancelPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCancel", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCancel", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCancelPreparer prepares the FailoverCancel request. +func (client ReplicationRecoveryPlansClient) FailoverCancelPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCancelSender sends the FailoverCancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) FailoverCancelSender(req *http.Request) (future ReplicationRecoveryPlansFailoverCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCancelResponder handles the response to the FailoverCancel request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) FailoverCancelResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// FailoverCommit the operation to commit the failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) FailoverCommit(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansFailoverCommitFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.FailoverCommit") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCommitPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCommit", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCommitSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCommit", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCommitPreparer prepares the FailoverCommit request. +func (client ReplicationRecoveryPlansClient) FailoverCommitPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCommit", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCommitSender sends the FailoverCommit request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) FailoverCommitSender(req *http.Request) (future ReplicationRecoveryPlansFailoverCommitFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCommitResponder handles the response to the FailoverCommit request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) FailoverCommitResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of the recovery plan. +// Parameters: +// recoveryPlanName - name of the recovery plan. +func (client ReplicationRecoveryPlansClient) Get(ctx context.Context, recoveryPlanName string) (result RecoveryPlan, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationRecoveryPlansClient) GetPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) GetResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the recovery plans in the vault. +func (client ReplicationRecoveryPlansClient) List(ctx context.Context) (result RecoveryPlanCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.List") + defer func() { + sc := -1 + if result.RPCVar.Response.Response != nil { + sc = result.RPCVar.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.RPCVar.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", resp, "Failure sending request") + return + } + + result.RPCVar, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", resp, "Failure responding to request") + return + } + if result.RPCVar.hasNextLink() && result.RPCVar.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationRecoveryPlansClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) ListResponder(resp *http.Response) (result RecoveryPlanCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryPlansClient) listNextResults(ctx context.Context, lastResults RecoveryPlanCollection) (result RecoveryPlanCollection, err error) { + req, err := lastResults.recoveryPlanCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryPlansClient) ListComplete(ctx context.Context) (result RecoveryPlanCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// PlannedFailover the operation to start the planned failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - failover input. +func (client ReplicationRecoveryPlansClient) PlannedFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput) (result ReplicationRecoveryPlansPlannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.PlannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", err.Error()) + } + + req, err := client.PlannedFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.PlannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// PlannedFailoverPreparer prepares the PlannedFailover request. +func (client ReplicationRecoveryPlansClient) PlannedFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/plannedFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PlannedFailoverSender sends the PlannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) PlannedFailoverSender(req *http.Request) (future ReplicationRecoveryPlansPlannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PlannedFailoverResponder handles the response to the PlannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) PlannedFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Reprotect the operation to reprotect(reverse replicate) a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) Reprotect(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansReprotectFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Reprotect") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReprotectPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Reprotect", nil, "Failure preparing request") + return + } + + result, err = client.ReprotectSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Reprotect", result.Response(), "Failure sending request") + return + } + + return +} + +// ReprotectPreparer prepares the Reprotect request. +func (client ReplicationRecoveryPlansClient) ReprotectPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/reProtect", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReprotectSender sends the Reprotect request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) ReprotectSender(req *http.Request) (future ReplicationRecoveryPlansReprotectFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReprotectResponder handles the response to the Reprotect request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) ReprotectResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailover the operation to start the test failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan test failover input. +func (client ReplicationRecoveryPlansClient) TestFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverInput) (result ReplicationRecoveryPlansTestFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.TestFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.NetworkType", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "TestFailover", err.Error()) + } + + req, err := client.TestFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailover", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverPreparer prepares the TestFailover request. +func (client ReplicationRecoveryPlansClient) TestFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverSender sends the TestFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) TestFailoverSender(req *http.Request) (future ReplicationRecoveryPlansTestFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverResponder handles the response to the TestFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) TestFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailoverCleanup the operation to cleanup test failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan test failover cleanup input. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanup(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput) (result ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.TestFailoverCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "input.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", err.Error()) + } + + req, err := client.TestFailoverCleanupPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverCleanupPreparer prepares the TestFailoverCleanup request. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailoverCleanup", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverCleanupSender sends the TestFailoverCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupSender(req *http.Request) (future ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverCleanupResponder handles the response to the TestFailoverCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UnplannedFailover the operation to start the unplanned failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan unplanned failover input. +func (client ReplicationRecoveryPlansClient) UnplannedFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput) (result ReplicationRecoveryPlansUnplannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.UnplannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", err.Error()) + } + + req, err := client.UnplannedFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.UnplannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// UnplannedFailoverPreparer prepares the UnplannedFailover request. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/unplannedFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UnplannedFailoverSender sends the UnplannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverSender(req *http.Request) (future ReplicationRecoveryPlansUnplannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UnplannedFailoverResponder handles the response to the UnplannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - update recovery plan input. +func (client ReplicationRecoveryPlansClient) Update(ctx context.Context, recoveryPlanName string, input UpdateRecoveryPlanInput) (result ReplicationRecoveryPlansUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationRecoveryPlansClient) UpdatePreparer(ctx context.Context, recoveryPlanName string, input UpdateRecoveryPlanInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) UpdateSender(req *http.Request) (future ReplicationRecoveryPlansUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) UpdateResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationrecoveryservicesproviders.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationrecoveryservicesproviders.go new file mode 100644 index 000000000000..8f4803e103e7 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationrecoveryservicesproviders.go @@ -0,0 +1,700 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationRecoveryServicesProvidersClient is the client for the ReplicationRecoveryServicesProviders methods of the +// Siterecovery service. +type ReplicationRecoveryServicesProvidersClient struct { + BaseClient +} + +// NewReplicationRecoveryServicesProvidersClient creates an instance of the ReplicationRecoveryServicesProvidersClient +// client. +func NewReplicationRecoveryServicesProvidersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryServicesProvidersClient { + return NewReplicationRecoveryServicesProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationRecoveryServicesProvidersClientWithBaseURI creates an instance of the +// ReplicationRecoveryServicesProvidersClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationRecoveryServicesProvidersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryServicesProvidersClient { + return ReplicationRecoveryServicesProvidersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to add a recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +// addProviderInput - add provider input. +func (client ReplicationRecoveryServicesProvidersClient) Create(ctx context.Context, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput) (result ReplicationRecoveryServicesProvidersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: addProviderInput, + Constraints: []validation.Constraint{{Target: "addProviderInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.MachineName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.AuthenticationIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.ResourceAccessIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, providerName, addProviderInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationRecoveryServicesProvidersClient) CreatePreparer(ctx context.Context, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithJSON(addProviderInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) CreateSender(req *http.Request) (future ReplicationRecoveryServicesProvidersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) CreateResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to removes/delete(unregister) a recovery services provider from the vault. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Delete(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationRecoveryServicesProvidersClient) DeletePreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) DeleteSender(req *http.Request) (future ReplicationRecoveryServicesProvidersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of registered recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Get(ctx context.Context, fabricName string, providerName string) (result RecoveryServicesProvider, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationRecoveryServicesProvidersClient) GetPreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) GetResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the registered recovery services providers in the vault. +func (client ReplicationRecoveryServicesProvidersClient) List(ctx context.Context) (result RecoveryServicesProviderCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.List") + defer func() { + sc := -1 + if result.rspc.Response.Response != nil { + sc = result.rspc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rspc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", resp, "Failure sending request") + return + } + + result.rspc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", resp, "Failure responding to request") + return + } + if result.rspc.hasNextLink() && result.rspc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationRecoveryServicesProvidersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryServicesProviders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) ListResponder(resp *http.Response) (result RecoveryServicesProviderCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryServicesProvidersClient) listNextResults(ctx context.Context, lastResults RecoveryServicesProviderCollection) (result RecoveryServicesProviderCollection, err error) { + req, err := lastResults.recoveryServicesProviderCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryServicesProvidersClient) ListComplete(ctx context.Context) (result RecoveryServicesProviderCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the registered recovery services providers for the specified fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result RecoveryServicesProviderCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.rspc.Response.Response != nil { + sc = result.rspc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.rspc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.rspc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.rspc.hasNextLink() && result.rspc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsResponder(resp *http.Response) (result RecoveryServicesProviderCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryServicesProvidersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults RecoveryServicesProviderCollection) (result RecoveryServicesProviderCollection, err error) { + req, err := lastResults.recoveryServicesProviderCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result RecoveryServicesProviderCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// Purge the operation to purge(force delete) a recovery services provider from the vault. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Purge(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationRecoveryServicesProvidersClient) PurgePreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) PurgeSender(req *http.Request) (future ReplicationRecoveryServicesProvidersPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RefreshProvider the operation to refresh the information from the recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProvider(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.RefreshProvider") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RefreshProviderPreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "RefreshProvider", nil, "Failure preparing request") + return + } + + result, err = client.RefreshProviderSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "RefreshProvider", result.Response(), "Failure sending request") + return + } + + return +} + +// RefreshProviderPreparer prepares the RefreshProvider request. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderPreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/refreshProvider", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RefreshProviderSender sends the RefreshProvider request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderSender(req *http.Request) (future ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RefreshProviderResponder handles the response to the RefreshProvider request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationstorageclassificationmappings.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationstorageclassificationmappings.go new file mode 100644 index 000000000000..63ca0112c8a3 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationstorageclassificationmappings.go @@ -0,0 +1,517 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationStorageClassificationMappingsClient is the client for the ReplicationStorageClassificationMappings +// methods of the Siterecovery service. +type ReplicationStorageClassificationMappingsClient struct { + BaseClient +} + +// NewReplicationStorageClassificationMappingsClient creates an instance of the +// ReplicationStorageClassificationMappingsClient client. +func NewReplicationStorageClassificationMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationMappingsClient { + return NewReplicationStorageClassificationMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationStorageClassificationMappingsClientWithBaseURI creates an instance of the +// ReplicationStorageClassificationMappingsClient client using a custom endpoint. Use this when interacting with an +// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationStorageClassificationMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationMappingsClient { + return ReplicationStorageClassificationMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +// pairingInput - pairing input. +func (client ReplicationStorageClassificationMappingsClient) Create(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput StorageClassificationMappingInput) (result ReplicationStorageClassificationMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName, pairingInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationStorageClassificationMappingsClient) CreatePreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput StorageClassificationMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithJSON(pairingInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) CreateSender(req *http.Request) (future ReplicationStorageClassificationMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) CreateResponder(resp *http.Response) (result StorageClassificationMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +func (client ReplicationStorageClassificationMappingsClient) Delete(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result ReplicationStorageClassificationMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationStorageClassificationMappingsClient) DeletePreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) DeleteSender(req *http.Request) (future ReplicationStorageClassificationMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the specified storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +func (client ReplicationStorageClassificationMappingsClient) Get(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result StorageClassificationMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationStorageClassificationMappingsClient) GetPreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) GetResponder(resp *http.Response) (result StorageClassificationMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the storage classification mappings in the vault. +func (client ReplicationStorageClassificationMappingsClient) List(ctx context.Context) (result StorageClassificationMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.List") + defer func() { + sc := -1 + if result.scmc.Response.Response != nil { + sc = result.scmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.scmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", resp, "Failure sending request") + return + } + + result.scmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.scmc.hasNextLink() && result.scmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationStorageClassificationMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationStorageClassificationMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) ListResponder(resp *http.Response) (result StorageClassificationMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationMappingsClient) listNextResults(ctx context.Context, lastResults StorageClassificationMappingCollection) (result StorageClassificationMappingCollection, err error) { + req, err := lastResults.storageClassificationMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationMappingsClient) ListComplete(ctx context.Context) (result StorageClassificationMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationStorageClassifications lists the storage classification mappings for the fabric. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassifications(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassificationMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.ListByReplicationStorageClassifications") + defer func() { + sc := -1 + if result.scmc.Response.Response != nil { + sc = result.scmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationStorageClassificationsNextResults + req, err := client.ListByReplicationStorageClassificationsPreparer(ctx, fabricName, storageClassificationName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationStorageClassificationsSender(req) + if err != nil { + result.scmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", resp, "Failure sending request") + return + } + + result.scmc, err = client.ListByReplicationStorageClassificationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", resp, "Failure responding to request") + return + } + if result.scmc.hasNextLink() && result.scmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationStorageClassificationsPreparer prepares the ListByReplicationStorageClassifications request. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsPreparer(ctx context.Context, fabricName string, storageClassificationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationStorageClassificationsSender sends the ListByReplicationStorageClassifications request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationStorageClassificationsResponder handles the response to the ListByReplicationStorageClassifications request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsResponder(resp *http.Response) (result StorageClassificationMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationStorageClassificationsNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationMappingsClient) listByReplicationStorageClassificationsNextResults(ctx context.Context, lastResults StorageClassificationMappingCollection) (result StorageClassificationMappingCollection, err error) { + req, err := lastResults.storageClassificationMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationStorageClassificationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationStorageClassificationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationStorageClassificationsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsComplete(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassificationMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.ListByReplicationStorageClassifications") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationStorageClassifications(ctx, fabricName, storageClassificationName) + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationstorageclassifications.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationstorageclassifications.go new file mode 100644 index 000000000000..d80286f7e8f3 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationstorageclassifications.go @@ -0,0 +1,345 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationStorageClassificationsClient is the client for the ReplicationStorageClassifications methods of the +// Siterecovery service. +type ReplicationStorageClassificationsClient struct { + BaseClient +} + +// NewReplicationStorageClassificationsClient creates an instance of the ReplicationStorageClassificationsClient +// client. +func NewReplicationStorageClassificationsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationsClient { + return NewReplicationStorageClassificationsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationStorageClassificationsClientWithBaseURI creates an instance of the +// ReplicationStorageClassificationsClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationStorageClassificationsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationsClient { + return ReplicationStorageClassificationsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of the specified storage classification. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +func (client ReplicationStorageClassificationsClient) Get(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassification, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, storageClassificationName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationStorageClassificationsClient) GetPreparer(ctx context.Context, fabricName string, storageClassificationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) GetResponder(resp *http.Response) (result StorageClassification, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the storage classifications in the vault. +func (client ReplicationStorageClassificationsClient) List(ctx context.Context) (result StorageClassificationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.List") + defer func() { + sc := -1 + if result.scc.Response.Response != nil { + sc = result.scc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.scc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", resp, "Failure sending request") + return + } + + result.scc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", resp, "Failure responding to request") + return + } + if result.scc.hasNextLink() && result.scc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationStorageClassificationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationStorageClassifications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) ListResponder(resp *http.Response) (result StorageClassificationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationsClient) listNextResults(ctx context.Context, lastResults StorageClassificationCollection) (result StorageClassificationCollection, err error) { + req, err := lastResults.storageClassificationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationsClient) ListComplete(ctx context.Context) (result StorageClassificationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the storage classifications available in the specified fabric. +// Parameters: +// fabricName - site name of interest. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result StorageClassificationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.scc.Response.Response != nil { + sc = result.scc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.scc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.scc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.scc.hasNextLink() && result.scc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsResponder(resp *http.Response) (result StorageClassificationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationsClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults StorageClassificationCollection) (result StorageClassificationCollection, err error) { + req, err := lastResults.storageClassificationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result StorageClassificationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationvaulthealth.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationvaulthealth.go new file mode 100644 index 000000000000..3a776ce149a2 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationvaulthealth.go @@ -0,0 +1,181 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationVaultHealthClient is the client for the ReplicationVaultHealth methods of the Siterecovery service. +type ReplicationVaultHealthClient struct { + BaseClient +} + +// NewReplicationVaultHealthClient creates an instance of the ReplicationVaultHealthClient client. +func NewReplicationVaultHealthClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultHealthClient { + return NewReplicationVaultHealthClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationVaultHealthClientWithBaseURI creates an instance of the ReplicationVaultHealthClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewReplicationVaultHealthClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultHealthClient { + return ReplicationVaultHealthClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the health details of the vault. +func (client ReplicationVaultHealthClient) Get(ctx context.Context) (result VaultHealthDetails, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultHealthClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationVaultHealthClient) GetPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultHealthClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationVaultHealthClient) GetResponder(resp *http.Response) (result VaultHealthDetails, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Refresh sends the refresh request. +func (client ReplicationVaultHealthClient) Refresh(ctx context.Context) (result ReplicationVaultHealthRefreshFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultHealthClient.Refresh") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RefreshPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Refresh", nil, "Failure preparing request") + return + } + + result, err = client.RefreshSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Refresh", result.Response(), "Failure sending request") + return + } + + return +} + +// RefreshPreparer prepares the Refresh request. +func (client ReplicationVaultHealthClient) RefreshPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth/default/refresh", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RefreshSender sends the Refresh request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultHealthClient) RefreshSender(req *http.Request) (future ReplicationVaultHealthRefreshFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RefreshResponder handles the response to the Refresh request. The method always +// closes the http.Response Body. +func (client ReplicationVaultHealthClient) RefreshResponder(resp *http.Response) (result VaultHealthDetails, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationvaultsetting.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationvaultsetting.go new file mode 100644 index 000000000000..c92afa8aac5b --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationvaultsetting.go @@ -0,0 +1,312 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationVaultSettingClient is the client for the ReplicationVaultSetting methods of the Siterecovery service. +type ReplicationVaultSettingClient struct { + BaseClient +} + +// NewReplicationVaultSettingClient creates an instance of the ReplicationVaultSettingClient client. +func NewReplicationVaultSettingClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultSettingClient { + return NewReplicationVaultSettingClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationVaultSettingClientWithBaseURI creates an instance of the ReplicationVaultSettingClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewReplicationVaultSettingClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultSettingClient { + return ReplicationVaultSettingClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to configure vault setting. +// Parameters: +// vaultSettingName - vault setting name. +// input - vault setting creation input. +func (client ReplicationVaultSettingClient) Create(ctx context.Context, vaultSettingName string, input VaultSettingCreationInput) (result ReplicationVaultSettingCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationVaultSettingClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, vaultSettingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationVaultSettingClient) CreatePreparer(ctx context.Context, vaultSettingName string, input VaultSettingCreationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultSettingName": autorest.Encode("path", vaultSettingName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) CreateSender(req *http.Request) (future ReplicationVaultSettingCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) CreateResponder(resp *http.Response) (result VaultSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the vault setting. This includes the Migration Hub connection settings. +// Parameters: +// vaultSettingName - vault setting name. +func (client ReplicationVaultSettingClient) Get(ctx context.Context, vaultSettingName string) (result VaultSetting, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, vaultSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationVaultSettingClient) GetPreparer(ctx context.Context, vaultSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultSettingName": autorest.Encode("path", vaultSettingName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) GetResponder(resp *http.Response) (result VaultSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of vault setting. This includes the Migration Hub connection settings. +func (client ReplicationVaultSettingClient) List(ctx context.Context) (result VaultSettingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.List") + defer func() { + sc := -1 + if result.vsc.Response.Response != nil { + sc = result.vsc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vsc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", resp, "Failure sending request") + return + } + + result.vsc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", resp, "Failure responding to request") + return + } + if result.vsc.hasNextLink() && result.vsc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationVaultSettingClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) ListResponder(resp *http.Response) (result VaultSettingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationVaultSettingClient) listNextResults(ctx context.Context, lastResults VaultSettingCollection) (result VaultSettingCollection, err error) { + req, err := lastResults.vaultSettingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationVaultSettingClient) ListComplete(ctx context.Context) (result VaultSettingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationvcenters.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationvcenters.go new file mode 100644 index 000000000000..67c165d21f06 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/replicationvcenters.go @@ -0,0 +1,591 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationvCentersClient is the client for the ReplicationvCenters methods of the Siterecovery service. +type ReplicationvCentersClient struct { + BaseClient +} + +// NewReplicationvCentersClient creates an instance of the ReplicationvCentersClient client. +func NewReplicationvCentersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationvCentersClient { + return NewReplicationvCentersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationvCentersClientWithBaseURI creates an instance of the ReplicationvCentersClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationvCentersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationvCentersClient { + return ReplicationvCentersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a vCenter object.. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +// addVCenterRequest - the input to the add vCenter operation. +func (client ReplicationvCentersClient) Create(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest) (result ReplicationvCentersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, vcenterName, addVCenterRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationvCentersClient) CreatePreparer(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithJSON(addVCenterRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) CreateSender(req *http.Request) (future ReplicationvCentersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) CreateResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to remove(unregister) a registered vCenter server from the vault. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +func (client ReplicationvCentersClient) Delete(ctx context.Context, fabricName string, vcenterName string) (result ReplicationvCentersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, vcenterName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationvCentersClient) DeletePreparer(ctx context.Context, fabricName string, vcenterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) DeleteSender(req *http.Request) (future ReplicationvCentersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a registered vCenter server(Add vCenter server). +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +func (client ReplicationvCentersClient) Get(ctx context.Context, fabricName string, vcenterName string) (result VCenter, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, vcenterName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationvCentersClient) GetPreparer(ctx context.Context, fabricName string, vcenterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) GetResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the vCenter servers registered in the vault. +func (client ReplicationvCentersClient) List(ctx context.Context) (result VCenterCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.List") + defer func() { + sc := -1 + if result.vcc.Response.Response != nil { + sc = result.vcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", resp, "Failure sending request") + return + } + + result.vcc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", resp, "Failure responding to request") + return + } + if result.vcc.hasNextLink() && result.vcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationvCentersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationvCenters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) ListResponder(resp *http.Response) (result VCenterCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationvCentersClient) listNextResults(ctx context.Context, lastResults VCenterCollection) (result VCenterCollection, err error) { + req, err := lastResults.vCenterCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationvCentersClient) ListComplete(ctx context.Context) (result VCenterCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the vCenter servers registered in a fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationvCentersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result VCenterCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.vcc.Response.Response != nil { + sc = result.vcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.vcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.vcc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.vcc.hasNextLink() && result.vcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationvCentersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) ListByReplicationFabricsResponder(resp *http.Response) (result VCenterCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationvCentersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults VCenterCollection) (result VCenterCollection, err error) { + req, err := lastResults.vCenterCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationvCentersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result VCenterCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// Update the operation to update a registered vCenter. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +// updateVCenterRequest - the input to the update vCenter operation. +func (client ReplicationvCentersClient) Update(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest) (result ReplicationvCentersUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, vcenterName, updateVCenterRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationvCentersClient) UpdatePreparer(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithJSON(updateVCenterRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) UpdateSender(req *http.Request) (future ReplicationvCentersUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) UpdateResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/siterecoveryapi/interfaces.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/siterecoveryapi/interfaces.go new file mode 100644 index 000000000000..7023017a7981 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/siterecoveryapi/interfaces.go @@ -0,0 +1,341 @@ +package siterecoveryapi + +// 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. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-10-01/siterecovery" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result siterecovery.OperationsDiscoveryCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.OperationsDiscoveryCollectionIterator, err error) +} + +var _ OperationsClientAPI = (*siterecovery.OperationsClient)(nil) + +// ReplicationAlertSettingsClientAPI contains the set of methods on the ReplicationAlertSettingsClient type. +type ReplicationAlertSettingsClientAPI interface { + Create(ctx context.Context, alertSettingName string, request siterecovery.ConfigureAlertRequest) (result siterecovery.Alert, err error) + Get(ctx context.Context, alertSettingName string) (result siterecovery.Alert, err error) + List(ctx context.Context) (result siterecovery.AlertCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.AlertCollectionIterator, err error) +} + +var _ ReplicationAlertSettingsClientAPI = (*siterecovery.ReplicationAlertSettingsClient)(nil) + +// ReplicationEligibilityResultsClientAPI contains the set of methods on the ReplicationEligibilityResultsClient type. +type ReplicationEligibilityResultsClientAPI interface { + Get(ctx context.Context, virtualMachineName string) (result siterecovery.ReplicationEligibilityResults, err error) + List(ctx context.Context, virtualMachineName string) (result siterecovery.ReplicationEligibilityResultsCollection, err error) +} + +var _ ReplicationEligibilityResultsClientAPI = (*siterecovery.ReplicationEligibilityResultsClient)(nil) + +// ReplicationEventsClientAPI contains the set of methods on the ReplicationEventsClient type. +type ReplicationEventsClientAPI interface { + Get(ctx context.Context, eventName string) (result siterecovery.Event, err error) + List(ctx context.Context, filter string) (result siterecovery.EventCollectionPage, err error) + ListComplete(ctx context.Context, filter string) (result siterecovery.EventCollectionIterator, err error) +} + +var _ ReplicationEventsClientAPI = (*siterecovery.ReplicationEventsClient)(nil) + +// ReplicationFabricsClientAPI contains the set of methods on the ReplicationFabricsClient type. +type ReplicationFabricsClientAPI interface { + CheckConsistency(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsCheckConsistencyFuture, err error) + Create(ctx context.Context, fabricName string, input siterecovery.FabricCreationInput) (result siterecovery.ReplicationFabricsCreateFuture, err error) + Delete(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, filter string) (result siterecovery.Fabric, err error) + List(ctx context.Context) (result siterecovery.FabricCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.FabricCollectionIterator, err error) + MigrateToAad(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsMigrateToAadFuture, err error) + Purge(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsPurgeFuture, err error) + ReassociateGateway(ctx context.Context, fabricName string, failoverProcessServerRequest siterecovery.FailoverProcessServerRequest) (result siterecovery.ReplicationFabricsReassociateGatewayFuture, err error) + RenewCertificate(ctx context.Context, fabricName string, renewCertificate siterecovery.RenewCertificateInput) (result siterecovery.ReplicationFabricsRenewCertificateFuture, err error) +} + +var _ ReplicationFabricsClientAPI = (*siterecovery.ReplicationFabricsClient)(nil) + +// ReplicationLogicalNetworksClientAPI contains the set of methods on the ReplicationLogicalNetworksClient type. +type ReplicationLogicalNetworksClientAPI interface { + Get(ctx context.Context, fabricName string, logicalNetworkName string) (result siterecovery.LogicalNetwork, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.LogicalNetworkCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.LogicalNetworkCollectionIterator, err error) +} + +var _ ReplicationLogicalNetworksClientAPI = (*siterecovery.ReplicationLogicalNetworksClient)(nil) + +// ReplicationNetworksClientAPI contains the set of methods on the ReplicationNetworksClient type. +type ReplicationNetworksClientAPI interface { + Get(ctx context.Context, fabricName string, networkName string) (result siterecovery.Network, err error) + List(ctx context.Context) (result siterecovery.NetworkCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.NetworkCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.NetworkCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.NetworkCollectionIterator, err error) +} + +var _ ReplicationNetworksClientAPI = (*siterecovery.ReplicationNetworksClient)(nil) + +// ReplicationNetworkMappingsClientAPI contains the set of methods on the ReplicationNetworkMappingsClient type. +type ReplicationNetworkMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, networkName string, networkMappingName string, input siterecovery.CreateNetworkMappingInput) (result siterecovery.ReplicationNetworkMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result siterecovery.ReplicationNetworkMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result siterecovery.NetworkMapping, err error) + List(ctx context.Context) (result siterecovery.NetworkMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.NetworkMappingCollectionIterator, err error) + ListByReplicationNetworks(ctx context.Context, fabricName string, networkName string) (result siterecovery.NetworkMappingCollectionPage, err error) + ListByReplicationNetworksComplete(ctx context.Context, fabricName string, networkName string) (result siterecovery.NetworkMappingCollectionIterator, err error) + Update(ctx context.Context, fabricName string, networkName string, networkMappingName string, input siterecovery.UpdateNetworkMappingInput) (result siterecovery.ReplicationNetworkMappingsUpdateFuture, err error) +} + +var _ ReplicationNetworkMappingsClientAPI = (*siterecovery.ReplicationNetworkMappingsClient)(nil) + +// ReplicationProtectionContainersClientAPI contains the set of methods on the ReplicationProtectionContainersClient type. +type ReplicationProtectionContainersClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, creationInput siterecovery.CreateProtectionContainerInput) (result siterecovery.ReplicationProtectionContainersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectionContainersDeleteFuture, err error) + DiscoverProtectableItem(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest siterecovery.DiscoverProtectableItemRequest) (result siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainer, err error) + List(ctx context.Context) (result siterecovery.ProtectionContainerCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.ProtectionContainerCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.ProtectionContainerCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.ProtectionContainerCollectionIterator, err error) + SwitchProtection(ctx context.Context, fabricName string, protectionContainerName string, switchInput siterecovery.SwitchProtectionInput) (result siterecovery.ReplicationProtectionContainersSwitchProtectionFuture, err error) +} + +var _ ReplicationProtectionContainersClientAPI = (*siterecovery.ReplicationProtectionContainersClient)(nil) + +// ReplicationMigrationItemsClientAPI contains the set of methods on the ReplicationMigrationItemsClient type. +type ReplicationMigrationItemsClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.EnableMigrationInput) (result siterecovery.ReplicationMigrationItemsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (result siterecovery.ReplicationMigrationItemsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationItem, err error) + List(ctx context.Context, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionIterator, err error) + Migrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput siterecovery.MigrateInput) (result siterecovery.ReplicationMigrationItemsMigrateFuture, err error) + Resync(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.ResyncInput) (result siterecovery.ReplicationMigrationItemsResyncFuture, err error) + TestMigrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput siterecovery.TestMigrateInput) (result siterecovery.ReplicationMigrationItemsTestMigrateFuture, err error) + TestMigrateCleanup(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput siterecovery.TestMigrateCleanupInput) (result siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.UpdateMigrationItemInput) (result siterecovery.ReplicationMigrationItemsUpdateFuture, err error) +} + +var _ ReplicationMigrationItemsClientAPI = (*siterecovery.ReplicationMigrationItemsClient)(nil) + +// MigrationRecoveryPointsClientAPI contains the set of methods on the MigrationRecoveryPointsClient type. +type MigrationRecoveryPointsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (result siterecovery.MigrationRecoveryPoint, err error) + ListByReplicationMigrationItems(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationRecoveryPointCollectionPage, err error) + ListByReplicationMigrationItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationRecoveryPointCollectionIterator, err error) +} + +var _ MigrationRecoveryPointsClientAPI = (*siterecovery.MigrationRecoveryPointsClient)(nil) + +// ReplicationProtectableItemsClientAPI contains the set of methods on the ReplicationProtectableItemsClient type. +type ReplicationProtectableItemsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (result siterecovery.ProtectableItem, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result siterecovery.ProtectableItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result siterecovery.ProtectableItemCollectionIterator, err error) +} + +var _ ReplicationProtectableItemsClientAPI = (*siterecovery.ReplicationProtectableItemsClient)(nil) + +// ReplicationProtectedItemsClientAPI contains the set of methods on the ReplicationProtectedItemsClient type. +type ReplicationProtectedItemsClientAPI interface { + AddDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput siterecovery.AddDisksInput) (result siterecovery.ReplicationProtectedItemsAddDisksFuture, err error) + ApplyRecoveryPoint(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput siterecovery.ApplyRecoveryPointInput) (result siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture, err error) + Create(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input siterecovery.EnableProtectionInput) (result siterecovery.ReplicationProtectedItemsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput siterecovery.DisableProtectionInput) (result siterecovery.ReplicationProtectedItemsDeleteFuture, err error) + FailoverCancel(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsFailoverCancelFuture, err error) + FailoverCommit(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsFailoverCommitFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItem, err error) + List(ctx context.Context, skipToken string, filter string) (result siterecovery.ReplicationProtectedItemCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, filter string) (result siterecovery.ReplicationProtectedItemCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectedItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectedItemCollectionIterator, err error) + PlannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput siterecovery.PlannedFailoverInput) (result siterecovery.ReplicationProtectedItemsPlannedFailoverFuture, err error) + Purge(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsPurgeFuture, err error) + RemoveDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput siterecovery.RemoveDisksInput) (result siterecovery.ReplicationProtectedItemsRemoveDisksFuture, err error) + RepairReplication(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsRepairReplicationFuture, err error) + Reprotect(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput siterecovery.ReverseReplicationInput) (result siterecovery.ReplicationProtectedItemsReprotectFuture, err error) + ResolveHealthErrors(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput siterecovery.ResolveHealthInput) (result siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture, err error) + TestFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput siterecovery.TestFailoverInput) (result siterecovery.ReplicationProtectedItemsTestFailoverFuture, err error) + TestFailoverCleanup(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput siterecovery.TestFailoverCleanupInput) (result siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture, err error) + UnplannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput siterecovery.UnplannedFailoverInput) (result siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput siterecovery.UpdateReplicationProtectedItemInput) (result siterecovery.ReplicationProtectedItemsUpdateFuture, err error) + UpdateAppliance(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput siterecovery.UpdateApplianceForReplicationProtectedItemInput) (result siterecovery.ReplicationProtectedItemsUpdateApplianceFuture, err error) + UpdateMobilityService(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest siterecovery.UpdateMobilityServiceRequest) (result siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) +} + +var _ ReplicationProtectedItemsClientAPI = (*siterecovery.ReplicationProtectedItemsClient)(nil) + +// RecoveryPointsClientAPI contains the set of methods on the RecoveryPointsClient type. +type RecoveryPointsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (result siterecovery.RecoveryPoint, err error) + ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.RecoveryPointCollectionPage, err error) + ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.RecoveryPointCollectionIterator, err error) +} + +var _ RecoveryPointsClientAPI = (*siterecovery.RecoveryPointsClient)(nil) + +// TargetComputeSizesClientAPI contains the set of methods on the TargetComputeSizesClient type. +type TargetComputeSizesClientAPI interface { + ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.TargetComputeSizeCollectionPage, err error) + ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.TargetComputeSizeCollectionIterator, err error) +} + +var _ TargetComputeSizesClientAPI = (*siterecovery.TargetComputeSizesClient)(nil) + +// ReplicationProtectionContainerMappingsClientAPI contains the set of methods on the ReplicationProtectionContainerMappingsClient type. +type ReplicationProtectionContainerMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput siterecovery.CreateProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput siterecovery.RemoveProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result siterecovery.ProtectionContainerMapping, err error) + List(ctx context.Context) (result siterecovery.ProtectionContainerMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.ProtectionContainerMappingCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainerMappingCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainerMappingCollectionIterator, err error) + Purge(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result siterecovery.ReplicationProtectionContainerMappingsPurgeFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput siterecovery.UpdateProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsUpdateFuture, err error) +} + +var _ ReplicationProtectionContainerMappingsClientAPI = (*siterecovery.ReplicationProtectionContainerMappingsClient)(nil) + +// ReplicationRecoveryServicesProvidersClientAPI contains the set of methods on the ReplicationRecoveryServicesProvidersClient type. +type ReplicationRecoveryServicesProvidersClientAPI interface { + Create(ctx context.Context, fabricName string, providerName string, addProviderInput siterecovery.AddRecoveryServicesProviderInput) (result siterecovery.ReplicationRecoveryServicesProvidersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture, err error) + Get(ctx context.Context, fabricName string, providerName string) (result siterecovery.RecoveryServicesProvider, err error) + List(ctx context.Context) (result siterecovery.RecoveryServicesProviderCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.RecoveryServicesProviderCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.RecoveryServicesProviderCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.RecoveryServicesProviderCollectionIterator, err error) + Purge(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture, err error) + RefreshProvider(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) +} + +var _ ReplicationRecoveryServicesProvidersClientAPI = (*siterecovery.ReplicationRecoveryServicesProvidersClient)(nil) + +// ReplicationStorageClassificationsClientAPI contains the set of methods on the ReplicationStorageClassificationsClient type. +type ReplicationStorageClassificationsClientAPI interface { + Get(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassification, err error) + List(ctx context.Context) (result siterecovery.StorageClassificationCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.StorageClassificationCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.StorageClassificationCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.StorageClassificationCollectionIterator, err error) +} + +var _ ReplicationStorageClassificationsClientAPI = (*siterecovery.ReplicationStorageClassificationsClient)(nil) + +// ReplicationStorageClassificationMappingsClientAPI contains the set of methods on the ReplicationStorageClassificationMappingsClient type. +type ReplicationStorageClassificationMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput siterecovery.StorageClassificationMappingInput) (result siterecovery.ReplicationStorageClassificationMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result siterecovery.ReplicationStorageClassificationMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result siterecovery.StorageClassificationMapping, err error) + List(ctx context.Context) (result siterecovery.StorageClassificationMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.StorageClassificationMappingCollectionIterator, err error) + ListByReplicationStorageClassifications(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassificationMappingCollectionPage, err error) + ListByReplicationStorageClassificationsComplete(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassificationMappingCollectionIterator, err error) +} + +var _ ReplicationStorageClassificationMappingsClientAPI = (*siterecovery.ReplicationStorageClassificationMappingsClient)(nil) + +// ReplicationvCentersClientAPI contains the set of methods on the ReplicationvCentersClient type. +type ReplicationvCentersClientAPI interface { + Create(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest siterecovery.AddVCenterRequest) (result siterecovery.ReplicationvCentersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, vcenterName string) (result siterecovery.ReplicationvCentersDeleteFuture, err error) + Get(ctx context.Context, fabricName string, vcenterName string) (result siterecovery.VCenter, err error) + List(ctx context.Context) (result siterecovery.VCenterCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.VCenterCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.VCenterCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.VCenterCollectionIterator, err error) + Update(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest siterecovery.UpdateVCenterRequest) (result siterecovery.ReplicationvCentersUpdateFuture, err error) +} + +var _ ReplicationvCentersClientAPI = (*siterecovery.ReplicationvCentersClient)(nil) + +// ReplicationJobsClientAPI contains the set of methods on the ReplicationJobsClient type. +type ReplicationJobsClientAPI interface { + Cancel(ctx context.Context, jobName string) (result siterecovery.ReplicationJobsCancelFuture, err error) + Export(ctx context.Context, jobQueryParameter siterecovery.JobQueryParameter) (result siterecovery.ReplicationJobsExportFuture, err error) + Get(ctx context.Context, jobName string) (result siterecovery.Job, err error) + List(ctx context.Context, filter string) (result siterecovery.JobCollectionPage, err error) + ListComplete(ctx context.Context, filter string) (result siterecovery.JobCollectionIterator, err error) + Restart(ctx context.Context, jobName string) (result siterecovery.ReplicationJobsRestartFuture, err error) + Resume(ctx context.Context, jobName string, resumeJobParams siterecovery.ResumeJobParams) (result siterecovery.ReplicationJobsResumeFuture, err error) +} + +var _ ReplicationJobsClientAPI = (*siterecovery.ReplicationJobsClient)(nil) + +// ReplicationPoliciesClientAPI contains the set of methods on the ReplicationPoliciesClient type. +type ReplicationPoliciesClientAPI interface { + Create(ctx context.Context, policyName string, input siterecovery.CreatePolicyInput) (result siterecovery.ReplicationPoliciesCreateFuture, err error) + Delete(ctx context.Context, policyName string) (result siterecovery.ReplicationPoliciesDeleteFuture, err error) + Get(ctx context.Context, policyName string) (result siterecovery.Policy, err error) + List(ctx context.Context) (result siterecovery.PolicyCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.PolicyCollectionIterator, err error) + Update(ctx context.Context, policyName string, input siterecovery.UpdatePolicyInput) (result siterecovery.ReplicationPoliciesUpdateFuture, err error) +} + +var _ ReplicationPoliciesClientAPI = (*siterecovery.ReplicationPoliciesClient)(nil) + +// ReplicationProtectionIntentsClientAPI contains the set of methods on the ReplicationProtectionIntentsClient type. +type ReplicationProtectionIntentsClientAPI interface { + Create(ctx context.Context, intentObjectName string, input siterecovery.CreateProtectionIntentInput) (result siterecovery.ReplicationProtectionIntent, err error) + Get(ctx context.Context, intentObjectName string) (result siterecovery.ReplicationProtectionIntent, err error) + List(ctx context.Context, skipToken string, takeToken string) (result siterecovery.ReplicationProtectionIntentCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, takeToken string) (result siterecovery.ReplicationProtectionIntentCollectionIterator, err error) +} + +var _ ReplicationProtectionIntentsClientAPI = (*siterecovery.ReplicationProtectionIntentsClient)(nil) + +// ReplicationRecoveryPlansClientAPI contains the set of methods on the ReplicationRecoveryPlansClient type. +type ReplicationRecoveryPlansClientAPI interface { + Create(ctx context.Context, recoveryPlanName string, input siterecovery.CreateRecoveryPlanInput) (result siterecovery.ReplicationRecoveryPlansCreateFuture, err error) + Delete(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansDeleteFuture, err error) + FailoverCancel(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansFailoverCancelFuture, err error) + FailoverCommit(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansFailoverCommitFuture, err error) + Get(ctx context.Context, recoveryPlanName string) (result siterecovery.RecoveryPlan, err error) + List(ctx context.Context) (result siterecovery.RecoveryPlanCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.RecoveryPlanCollectionIterator, err error) + PlannedFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanPlannedFailoverInput) (result siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture, err error) + Reprotect(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansReprotectFuture, err error) + TestFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanTestFailoverInput) (result siterecovery.ReplicationRecoveryPlansTestFailoverFuture, err error) + TestFailoverCleanup(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanTestFailoverCleanupInput) (result siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) + UnplannedFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanUnplannedFailoverInput) (result siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture, err error) + Update(ctx context.Context, recoveryPlanName string, input siterecovery.UpdateRecoveryPlanInput) (result siterecovery.ReplicationRecoveryPlansUpdateFuture, err error) +} + +var _ ReplicationRecoveryPlansClientAPI = (*siterecovery.ReplicationRecoveryPlansClient)(nil) + +// SupportedOperatingSystemsClientAPI contains the set of methods on the SupportedOperatingSystemsClient type. +type SupportedOperatingSystemsClientAPI interface { + Get(ctx context.Context, instanceType string) (result siterecovery.SupportedOperatingSystems, err error) +} + +var _ SupportedOperatingSystemsClientAPI = (*siterecovery.SupportedOperatingSystemsClient)(nil) + +// ReplicationVaultHealthClientAPI contains the set of methods on the ReplicationVaultHealthClient type. +type ReplicationVaultHealthClientAPI interface { + Get(ctx context.Context) (result siterecovery.VaultHealthDetails, err error) + Refresh(ctx context.Context) (result siterecovery.ReplicationVaultHealthRefreshFuture, err error) +} + +var _ ReplicationVaultHealthClientAPI = (*siterecovery.ReplicationVaultHealthClient)(nil) + +// ReplicationVaultSettingClientAPI contains the set of methods on the ReplicationVaultSettingClient type. +type ReplicationVaultSettingClientAPI interface { + Create(ctx context.Context, vaultSettingName string, input siterecovery.VaultSettingCreationInput) (result siterecovery.ReplicationVaultSettingCreateFuture, err error) + Get(ctx context.Context, vaultSettingName string) (result siterecovery.VaultSetting, err error) + List(ctx context.Context) (result siterecovery.VaultSettingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.VaultSettingCollectionIterator, err error) +} + +var _ ReplicationVaultSettingClientAPI = (*siterecovery.ReplicationVaultSettingClient)(nil) diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/supportedoperatingsystems.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/supportedoperatingsystems.go new file mode 100644 index 000000000000..e0d2ae9cd30d --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/supportedoperatingsystems.go @@ -0,0 +1,110 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SupportedOperatingSystemsClient is the client for the SupportedOperatingSystems methods of the Siterecovery service. +type SupportedOperatingSystemsClient struct { + BaseClient +} + +// NewSupportedOperatingSystemsClient creates an instance of the SupportedOperatingSystemsClient client. +func NewSupportedOperatingSystemsClient(subscriptionID string, resourceGroupName string, resourceName string) SupportedOperatingSystemsClient { + return NewSupportedOperatingSystemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewSupportedOperatingSystemsClientWithBaseURI creates an instance of the SupportedOperatingSystemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewSupportedOperatingSystemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) SupportedOperatingSystemsClient { + return SupportedOperatingSystemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get sends the get request. +// Parameters: +// instanceType - the instance type. +func (client SupportedOperatingSystemsClient) Get(ctx context.Context, instanceType string) (result SupportedOperatingSystems, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SupportedOperatingSystemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, instanceType) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SupportedOperatingSystemsClient) GetPreparer(ctx context.Context, instanceType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(instanceType) > 0 { + queryParameters["instanceType"] = autorest.Encode("query", instanceType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationSupportedOperatingSystems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SupportedOperatingSystemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SupportedOperatingSystemsClient) GetResponder(resp *http.Response) (result SupportedOperatingSystems, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/targetcomputesizes.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/targetcomputesizes.go new file mode 100644 index 000000000000..3d51b12a452f --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/targetcomputesizes.go @@ -0,0 +1,154 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// TargetComputeSizesClient is the client for the TargetComputeSizes methods of the Siterecovery service. +type TargetComputeSizesClient struct { + BaseClient +} + +// NewTargetComputeSizesClient creates an instance of the TargetComputeSizesClient client. +func NewTargetComputeSizesClient(subscriptionID string, resourceGroupName string, resourceName string) TargetComputeSizesClient { + return NewTargetComputeSizesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewTargetComputeSizesClientWithBaseURI creates an instance of the TargetComputeSizesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewTargetComputeSizesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) TargetComputeSizesClient { + return TargetComputeSizesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// ListByReplicationProtectedItems lists the available target compute sizes for a replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client TargetComputeSizesClient) ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result TargetComputeSizeCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizesClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.tcsc.Response.Response != nil { + sc = result.tcsc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectedItemsNextResults + req, err := client.ListByReplicationProtectedItemsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.tcsc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", resp, "Failure sending request") + return + } + + result.tcsc, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", resp, "Failure responding to request") + return + } + if result.tcsc.hasNextLink() && result.tcsc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectedItemsPreparer prepares the ListByReplicationProtectedItems request. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/targetComputeSizes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectedItemsSender sends the ListByReplicationProtectedItems request. The method will close the +// http.Response Body if it receives an error. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectedItemsResponder handles the response to the ListByReplicationProtectedItems request. The method always +// closes the http.Response Body. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsResponder(resp *http.Response) (result TargetComputeSizeCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectedItemsNextResults retrieves the next set of results, if any. +func (client TargetComputeSizesClient) listByReplicationProtectedItemsNextResults(ctx context.Context, lastResults TargetComputeSizeCollection) (result TargetComputeSizeCollection, err error) { + req, err := lastResults.targetComputeSizeCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectedItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result TargetComputeSizeCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizesClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectedItems(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + return +} diff --git a/services/recoveryservices/mgmt/2021-10-01/siterecovery/version.go b/services/recoveryservices/mgmt/2021-10-01/siterecovery/version.go new file mode 100644 index 000000000000..6a2d315cce47 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-10-01/siterecovery/version.go @@ -0,0 +1,19 @@ +package siterecovery + +import "github.com/Azure/azure-sdk-for-go/version" + +// 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. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " siterecovery/2021-10-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/CHANGELOG.md b/services/recoveryservices/mgmt/2021-11-01/siterecovery/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/_meta.json b/services/recoveryservices/mgmt/2021-11-01/siterecovery/_meta.json new file mode 100644 index 000000000000..e6ca32ce409b --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "16f5f98c30852b877949ea63418f609233470bf7", + "readme": "/_/azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.md", + "tag": "package-2021-11", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-11 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/client.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/client.go new file mode 100644 index 000000000000..bdf0befebf00 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/client.go @@ -0,0 +1,45 @@ +// Package siterecovery implements the Azure ARM Siterecovery service API version 2021-11-01. +// +// +package siterecovery + +// 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. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Siterecovery + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Siterecovery. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string + ResourceGroupName string + ResourceName string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string, resourceGroupName string, resourceName string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + ResourceGroupName: resourceGroupName, + ResourceName: resourceName, + } +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/enums.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/enums.go new file mode 100644 index 000000000000..80944d8b57f4 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/enums.go @@ -0,0 +1,1916 @@ +package siterecovery + +// 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. + +// A2ARecoveryAvailabilityType enumerates the values for a2a recovery availability type. +type A2ARecoveryAvailabilityType string + +const ( + // AvailabilitySet ... + AvailabilitySet A2ARecoveryAvailabilityType = "AvailabilitySet" + // AvailabilityZone ... + AvailabilityZone A2ARecoveryAvailabilityType = "AvailabilityZone" + // Single ... + Single A2ARecoveryAvailabilityType = "Single" +) + +// PossibleA2ARecoveryAvailabilityTypeValues returns an array of possible values for the A2ARecoveryAvailabilityType const type. +func PossibleA2ARecoveryAvailabilityTypeValues() []A2ARecoveryAvailabilityType { + return []A2ARecoveryAvailabilityType{AvailabilitySet, AvailabilityZone, Single} +} + +// A2ARpRecoveryPointType enumerates the values for a2a rp recovery point type. +type A2ARpRecoveryPointType string + +const ( + // Latest ... + Latest A2ARpRecoveryPointType = "Latest" + // LatestApplicationConsistent ... + LatestApplicationConsistent A2ARpRecoveryPointType = "LatestApplicationConsistent" + // LatestCrashConsistent ... + LatestCrashConsistent A2ARpRecoveryPointType = "LatestCrashConsistent" + // LatestProcessed ... + LatestProcessed A2ARpRecoveryPointType = "LatestProcessed" +) + +// PossibleA2ARpRecoveryPointTypeValues returns an array of possible values for the A2ARpRecoveryPointType const type. +func PossibleA2ARpRecoveryPointTypeValues() []A2ARpRecoveryPointType { + return []A2ARpRecoveryPointType{Latest, LatestApplicationConsistent, LatestCrashConsistent, LatestProcessed} +} + +// AgentAutoUpdateStatus enumerates the values for agent auto update status. +type AgentAutoUpdateStatus string + +const ( + // Disabled ... + Disabled AgentAutoUpdateStatus = "Disabled" + // Enabled ... + Enabled AgentAutoUpdateStatus = "Enabled" +) + +// PossibleAgentAutoUpdateStatusValues returns an array of possible values for the AgentAutoUpdateStatus const type. +func PossibleAgentAutoUpdateStatusValues() []AgentAutoUpdateStatus { + return []AgentAutoUpdateStatus{Disabled, Enabled} +} + +// AgentUpgradeBlockedReason enumerates the values for agent upgrade blocked reason. +type AgentUpgradeBlockedReason string + +const ( + // AgentNoHeartbeat ... + AgentNoHeartbeat AgentUpgradeBlockedReason = "AgentNoHeartbeat" + // AlreadyOnLatestVersion ... + AlreadyOnLatestVersion AgentUpgradeBlockedReason = "AlreadyOnLatestVersion" + // DistroIsNotReported ... + DistroIsNotReported AgentUpgradeBlockedReason = "DistroIsNotReported" + // DistroNotSupportedForUpgrade ... + DistroNotSupportedForUpgrade AgentUpgradeBlockedReason = "DistroNotSupportedForUpgrade" + // IncompatibleApplianceVersion ... + IncompatibleApplianceVersion AgentUpgradeBlockedReason = "IncompatibleApplianceVersion" + // InvalidAgentVersion ... + InvalidAgentVersion AgentUpgradeBlockedReason = "InvalidAgentVersion" + // InvalidDriverVersion ... + InvalidDriverVersion AgentUpgradeBlockedReason = "InvalidDriverVersion" + // MissingUpgradePath ... + MissingUpgradePath AgentUpgradeBlockedReason = "MissingUpgradePath" + // NotProtected ... + NotProtected AgentUpgradeBlockedReason = "NotProtected" + // ProcessServerNoHeartbeat ... + ProcessServerNoHeartbeat AgentUpgradeBlockedReason = "ProcessServerNoHeartbeat" + // RcmProxyNoHeartbeat ... + RcmProxyNoHeartbeat AgentUpgradeBlockedReason = "RcmProxyNoHeartbeat" + // RebootRequired ... + RebootRequired AgentUpgradeBlockedReason = "RebootRequired" + // Unknown ... + Unknown AgentUpgradeBlockedReason = "Unknown" + // UnsupportedProtectionScenario ... + UnsupportedProtectionScenario AgentUpgradeBlockedReason = "UnsupportedProtectionScenario" +) + +// PossibleAgentUpgradeBlockedReasonValues returns an array of possible values for the AgentUpgradeBlockedReason const type. +func PossibleAgentUpgradeBlockedReasonValues() []AgentUpgradeBlockedReason { + return []AgentUpgradeBlockedReason{AgentNoHeartbeat, AlreadyOnLatestVersion, DistroIsNotReported, DistroNotSupportedForUpgrade, IncompatibleApplianceVersion, InvalidAgentVersion, InvalidDriverVersion, MissingUpgradePath, NotProtected, ProcessServerNoHeartbeat, RcmProxyNoHeartbeat, RebootRequired, Unknown, UnsupportedProtectionScenario} +} + +// AgentVersionStatus enumerates the values for agent version status. +type AgentVersionStatus string + +const ( + // Deprecated ... + Deprecated AgentVersionStatus = "Deprecated" + // NotSupported ... + NotSupported AgentVersionStatus = "NotSupported" + // SecurityUpdateRequired ... + SecurityUpdateRequired AgentVersionStatus = "SecurityUpdateRequired" + // Supported ... + Supported AgentVersionStatus = "Supported" + // UpdateRequired ... + UpdateRequired AgentVersionStatus = "UpdateRequired" +) + +// PossibleAgentVersionStatusValues returns an array of possible values for the AgentVersionStatus const type. +func PossibleAgentVersionStatusValues() []AgentVersionStatus { + return []AgentVersionStatus{Deprecated, NotSupported, SecurityUpdateRequired, Supported, UpdateRequired} +} + +// AlternateLocationRecoveryOption enumerates the values for alternate location recovery option. +type AlternateLocationRecoveryOption string + +const ( + // CreateVMIfNotFound ... + CreateVMIfNotFound AlternateLocationRecoveryOption = "CreateVmIfNotFound" + // NoAction ... + NoAction AlternateLocationRecoveryOption = "NoAction" +) + +// PossibleAlternateLocationRecoveryOptionValues returns an array of possible values for the AlternateLocationRecoveryOption const type. +func PossibleAlternateLocationRecoveryOptionValues() []AlternateLocationRecoveryOption { + return []AlternateLocationRecoveryOption{CreateVMIfNotFound, NoAction} +} + +// AutomationAccountAuthenticationType enumerates the values for automation account authentication type. +type AutomationAccountAuthenticationType string + +const ( + // AutomationAccountAuthenticationTypeRunAsAccount ... + AutomationAccountAuthenticationTypeRunAsAccount AutomationAccountAuthenticationType = "RunAsAccount" + // AutomationAccountAuthenticationTypeSystemAssignedIdentity ... + AutomationAccountAuthenticationTypeSystemAssignedIdentity AutomationAccountAuthenticationType = "SystemAssignedIdentity" +) + +// PossibleAutomationAccountAuthenticationTypeValues returns an array of possible values for the AutomationAccountAuthenticationType const type. +func PossibleAutomationAccountAuthenticationTypeValues() []AutomationAccountAuthenticationType { + return []AutomationAccountAuthenticationType{AutomationAccountAuthenticationTypeRunAsAccount, AutomationAccountAuthenticationTypeSystemAssignedIdentity} +} + +// AutoProtectionOfDataDisk enumerates the values for auto protection of data disk. +type AutoProtectionOfDataDisk string + +const ( + // AutoProtectionOfDataDiskDisabled ... + AutoProtectionOfDataDiskDisabled AutoProtectionOfDataDisk = "Disabled" + // AutoProtectionOfDataDiskEnabled ... + AutoProtectionOfDataDiskEnabled AutoProtectionOfDataDisk = "Enabled" +) + +// PossibleAutoProtectionOfDataDiskValues returns an array of possible values for the AutoProtectionOfDataDisk const type. +func PossibleAutoProtectionOfDataDiskValues() []AutoProtectionOfDataDisk { + return []AutoProtectionOfDataDisk{AutoProtectionOfDataDiskDisabled, AutoProtectionOfDataDiskEnabled} +} + +// DataSyncStatus enumerates the values for data sync status. +type DataSyncStatus string + +const ( + // ForDownTime ... + ForDownTime DataSyncStatus = "ForDownTime" + // ForSynchronization ... + ForSynchronization DataSyncStatus = "ForSynchronization" +) + +// PossibleDataSyncStatusValues returns an array of possible values for the DataSyncStatus const type. +func PossibleDataSyncStatusValues() []DataSyncStatus { + return []DataSyncStatus{ForDownTime, ForSynchronization} +} + +// DisableProtectionReason enumerates the values for disable protection reason. +type DisableProtectionReason string + +const ( + // MigrationComplete ... + MigrationComplete DisableProtectionReason = "MigrationComplete" + // NotSpecified ... + NotSpecified DisableProtectionReason = "NotSpecified" +) + +// PossibleDisableProtectionReasonValues returns an array of possible values for the DisableProtectionReason const type. +func PossibleDisableProtectionReasonValues() []DisableProtectionReason { + return []DisableProtectionReason{MigrationComplete, NotSpecified} +} + +// DiskAccountType enumerates the values for disk account type. +type DiskAccountType string + +const ( + // PremiumLRS ... + PremiumLRS DiskAccountType = "Premium_LRS" + // StandardLRS ... + StandardLRS DiskAccountType = "Standard_LRS" + // StandardSSDLRS ... + StandardSSDLRS DiskAccountType = "StandardSSD_LRS" +) + +// PossibleDiskAccountTypeValues returns an array of possible values for the DiskAccountType const type. +func PossibleDiskAccountTypeValues() []DiskAccountType { + return []DiskAccountType{PremiumLRS, StandardLRS, StandardSSDLRS} +} + +// DiskReplicationProgressHealth enumerates the values for disk replication progress health. +type DiskReplicationProgressHealth string + +const ( + // InProgress ... + InProgress DiskReplicationProgressHealth = "InProgress" + // None ... + None DiskReplicationProgressHealth = "None" + // NoProgress ... + NoProgress DiskReplicationProgressHealth = "NoProgress" + // Queued ... + Queued DiskReplicationProgressHealth = "Queued" + // SlowProgress ... + SlowProgress DiskReplicationProgressHealth = "SlowProgress" +) + +// PossibleDiskReplicationProgressHealthValues returns an array of possible values for the DiskReplicationProgressHealth const type. +func PossibleDiskReplicationProgressHealthValues() []DiskReplicationProgressHealth { + return []DiskReplicationProgressHealth{InProgress, None, NoProgress, Queued, SlowProgress} +} + +// EthernetAddressType enumerates the values for ethernet address type. +type EthernetAddressType string + +const ( + // Dynamic ... + Dynamic EthernetAddressType = "Dynamic" + // Static ... + Static EthernetAddressType = "Static" +) + +// PossibleEthernetAddressTypeValues returns an array of possible values for the EthernetAddressType const type. +func PossibleEthernetAddressTypeValues() []EthernetAddressType { + return []EthernetAddressType{Dynamic, Static} +} + +// ExportJobOutputSerializationType enumerates the values for export job output serialization type. +type ExportJobOutputSerializationType string + +const ( + // Excel ... + Excel ExportJobOutputSerializationType = "Excel" + // JSON ... + JSON ExportJobOutputSerializationType = "Json" + // XML ... + XML ExportJobOutputSerializationType = "Xml" +) + +// PossibleExportJobOutputSerializationTypeValues returns an array of possible values for the ExportJobOutputSerializationType const type. +func PossibleExportJobOutputSerializationTypeValues() []ExportJobOutputSerializationType { + return []ExportJobOutputSerializationType{Excel, JSON, XML} +} + +// FailoverDeploymentModel enumerates the values for failover deployment model. +type FailoverDeploymentModel string + +const ( + // Classic ... + Classic FailoverDeploymentModel = "Classic" + // NotApplicable ... + NotApplicable FailoverDeploymentModel = "NotApplicable" + // ResourceManager ... + ResourceManager FailoverDeploymentModel = "ResourceManager" +) + +// PossibleFailoverDeploymentModelValues returns an array of possible values for the FailoverDeploymentModel const type. +func PossibleFailoverDeploymentModelValues() []FailoverDeploymentModel { + return []FailoverDeploymentModel{Classic, NotApplicable, ResourceManager} +} + +// HealthErrorCategory enumerates the values for health error category. +type HealthErrorCategory string + +const ( + // HealthErrorCategoryAgentAutoUpdateArtifactDeleted ... + HealthErrorCategoryAgentAutoUpdateArtifactDeleted HealthErrorCategory = "AgentAutoUpdateArtifactDeleted" + // HealthErrorCategoryAgentAutoUpdateInfra ... + HealthErrorCategoryAgentAutoUpdateInfra HealthErrorCategory = "AgentAutoUpdateInfra" + // HealthErrorCategoryAgentAutoUpdateRunAsAccount ... + HealthErrorCategoryAgentAutoUpdateRunAsAccount HealthErrorCategory = "AgentAutoUpdateRunAsAccount" + // HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired ... + HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired HealthErrorCategory = "AgentAutoUpdateRunAsAccountExpired" + // HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry ... + HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry HealthErrorCategory = "AgentAutoUpdateRunAsAccountExpiry" + // HealthErrorCategoryConfiguration ... + HealthErrorCategoryConfiguration HealthErrorCategory = "Configuration" + // HealthErrorCategoryFabricInfrastructure ... + HealthErrorCategoryFabricInfrastructure HealthErrorCategory = "FabricInfrastructure" + // HealthErrorCategoryNone ... + HealthErrorCategoryNone HealthErrorCategory = "None" + // HealthErrorCategoryReplication ... + HealthErrorCategoryReplication HealthErrorCategory = "Replication" + // HealthErrorCategoryTestFailover ... + HealthErrorCategoryTestFailover HealthErrorCategory = "TestFailover" + // HealthErrorCategoryVersionExpiry ... + HealthErrorCategoryVersionExpiry HealthErrorCategory = "VersionExpiry" +) + +// PossibleHealthErrorCategoryValues returns an array of possible values for the HealthErrorCategory const type. +func PossibleHealthErrorCategoryValues() []HealthErrorCategory { + return []HealthErrorCategory{HealthErrorCategoryAgentAutoUpdateArtifactDeleted, HealthErrorCategoryAgentAutoUpdateInfra, HealthErrorCategoryAgentAutoUpdateRunAsAccount, HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired, HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry, HealthErrorCategoryConfiguration, HealthErrorCategoryFabricInfrastructure, HealthErrorCategoryNone, HealthErrorCategoryReplication, HealthErrorCategoryTestFailover, HealthErrorCategoryVersionExpiry} +} + +// HealthErrorCustomerResolvability enumerates the values for health error customer resolvability. +type HealthErrorCustomerResolvability string + +const ( + // Allowed ... + Allowed HealthErrorCustomerResolvability = "Allowed" + // NotAllowed ... + NotAllowed HealthErrorCustomerResolvability = "NotAllowed" +) + +// PossibleHealthErrorCustomerResolvabilityValues returns an array of possible values for the HealthErrorCustomerResolvability const type. +func PossibleHealthErrorCustomerResolvabilityValues() []HealthErrorCustomerResolvability { + return []HealthErrorCustomerResolvability{Allowed, NotAllowed} +} + +// HyperVReplicaAzureRpRecoveryPointType enumerates the values for hyper v replica azure rp recovery point +// type. +type HyperVReplicaAzureRpRecoveryPointType string + +const ( + // HyperVReplicaAzureRpRecoveryPointTypeLatest ... + HyperVReplicaAzureRpRecoveryPointTypeLatest HyperVReplicaAzureRpRecoveryPointType = "Latest" + // HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent ... + HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent HyperVReplicaAzureRpRecoveryPointType = "LatestApplicationConsistent" + // HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed ... + HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed HyperVReplicaAzureRpRecoveryPointType = "LatestProcessed" +) + +// PossibleHyperVReplicaAzureRpRecoveryPointTypeValues returns an array of possible values for the HyperVReplicaAzureRpRecoveryPointType const type. +func PossibleHyperVReplicaAzureRpRecoveryPointTypeValues() []HyperVReplicaAzureRpRecoveryPointType { + return []HyperVReplicaAzureRpRecoveryPointType{HyperVReplicaAzureRpRecoveryPointTypeLatest, HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent, HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed} +} + +// InMageRcmFailbackRecoveryPointType enumerates the values for in mage rcm failback recovery point type. +type InMageRcmFailbackRecoveryPointType string + +const ( + // ApplicationConsistent ... + ApplicationConsistent InMageRcmFailbackRecoveryPointType = "ApplicationConsistent" + // CrashConsistent ... + CrashConsistent InMageRcmFailbackRecoveryPointType = "CrashConsistent" +) + +// PossibleInMageRcmFailbackRecoveryPointTypeValues returns an array of possible values for the InMageRcmFailbackRecoveryPointType const type. +func PossibleInMageRcmFailbackRecoveryPointTypeValues() []InMageRcmFailbackRecoveryPointType { + return []InMageRcmFailbackRecoveryPointType{ApplicationConsistent, CrashConsistent} +} + +// InMageV2RpRecoveryPointType enumerates the values for in mage v2 rp recovery point type. +type InMageV2RpRecoveryPointType string + +const ( + // InMageV2RpRecoveryPointTypeLatest ... + InMageV2RpRecoveryPointTypeLatest InMageV2RpRecoveryPointType = "Latest" + // InMageV2RpRecoveryPointTypeLatestApplicationConsistent ... + InMageV2RpRecoveryPointTypeLatestApplicationConsistent InMageV2RpRecoveryPointType = "LatestApplicationConsistent" + // InMageV2RpRecoveryPointTypeLatestCrashConsistent ... + InMageV2RpRecoveryPointTypeLatestCrashConsistent InMageV2RpRecoveryPointType = "LatestCrashConsistent" + // InMageV2RpRecoveryPointTypeLatestProcessed ... + InMageV2RpRecoveryPointTypeLatestProcessed InMageV2RpRecoveryPointType = "LatestProcessed" +) + +// PossibleInMageV2RpRecoveryPointTypeValues returns an array of possible values for the InMageV2RpRecoveryPointType const type. +func PossibleInMageV2RpRecoveryPointTypeValues() []InMageV2RpRecoveryPointType { + return []InMageV2RpRecoveryPointType{InMageV2RpRecoveryPointTypeLatest, InMageV2RpRecoveryPointTypeLatestApplicationConsistent, InMageV2RpRecoveryPointTypeLatestCrashConsistent, InMageV2RpRecoveryPointTypeLatestProcessed} +} + +// InstanceType enumerates the values for instance type. +type InstanceType string + +const ( + // InstanceTypeA2A ... + InstanceTypeA2A InstanceType = "A2A" + // InstanceTypeAddDisksProviderSpecificInput ... + InstanceTypeAddDisksProviderSpecificInput InstanceType = "AddDisksProviderSpecificInput" +) + +// PossibleInstanceTypeValues returns an array of possible values for the InstanceType const type. +func PossibleInstanceTypeValues() []InstanceType { + return []InstanceType{InstanceTypeA2A, InstanceTypeAddDisksProviderSpecificInput} +} + +// InstanceTypeBasicApplianceSpecificDetails enumerates the values for instance type basic appliance specific +// details. +type InstanceTypeBasicApplianceSpecificDetails string + +const ( + // InstanceTypeApplianceSpecificDetails ... + InstanceTypeApplianceSpecificDetails InstanceTypeBasicApplianceSpecificDetails = "ApplianceSpecificDetails" + // InstanceTypeInMageRcm ... + InstanceTypeInMageRcm InstanceTypeBasicApplianceSpecificDetails = "InMageRcm" +) + +// PossibleInstanceTypeBasicApplianceSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicApplianceSpecificDetails const type. +func PossibleInstanceTypeBasicApplianceSpecificDetailsValues() []InstanceTypeBasicApplianceSpecificDetails { + return []InstanceTypeBasicApplianceSpecificDetails{InstanceTypeApplianceSpecificDetails, InstanceTypeInMageRcm} +} + +// InstanceTypeBasicApplyRecoveryPointProviderSpecificInput enumerates the values for instance type basic apply +// recovery point provider specific input. +type InstanceTypeBasicApplyRecoveryPointProviderSpecificInput string + +const ( + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "A2A" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "ApplyRecoveryPointProviderSpecificInput" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "InMageRcm" +) + +// PossibleInstanceTypeBasicApplyRecoveryPointProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicApplyRecoveryPointProviderSpecificInput const type. +func PossibleInstanceTypeBasicApplyRecoveryPointProviderSpecificInputValues() []InstanceTypeBasicApplyRecoveryPointProviderSpecificInput { + return []InstanceTypeBasicApplyRecoveryPointProviderSpecificInput{InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm} +} + +// InstanceTypeBasicConfigurationSettings enumerates the values for instance type basic configuration settings. +type InstanceTypeBasicConfigurationSettings string + +const ( + // InstanceTypeConfigurationSettings ... + InstanceTypeConfigurationSettings InstanceTypeBasicConfigurationSettings = "ConfigurationSettings" + // InstanceTypeHyperVVirtualMachine ... + InstanceTypeHyperVVirtualMachine InstanceTypeBasicConfigurationSettings = "HyperVVirtualMachine" + // InstanceTypeReplicationGroupDetails ... + InstanceTypeReplicationGroupDetails InstanceTypeBasicConfigurationSettings = "ReplicationGroupDetails" + // InstanceTypeVmmVirtualMachine ... + InstanceTypeVmmVirtualMachine InstanceTypeBasicConfigurationSettings = "VmmVirtualMachine" + // InstanceTypeVMwareVirtualMachine ... + InstanceTypeVMwareVirtualMachine InstanceTypeBasicConfigurationSettings = "VMwareVirtualMachine" +) + +// PossibleInstanceTypeBasicConfigurationSettingsValues returns an array of possible values for the InstanceTypeBasicConfigurationSettings const type. +func PossibleInstanceTypeBasicConfigurationSettingsValues() []InstanceTypeBasicConfigurationSettings { + return []InstanceTypeBasicConfigurationSettings{InstanceTypeConfigurationSettings, InstanceTypeHyperVVirtualMachine, InstanceTypeReplicationGroupDetails, InstanceTypeVmmVirtualMachine, InstanceTypeVMwareVirtualMachine} +} + +// InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails enumerates the values for instance type basic +// create protection intent provider specific details. +type InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails string + +const ( + // InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails = "A2A" + // InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails ... + InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails = "CreateProtectionIntentProviderSpecificDetails" +) + +// PossibleInstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails const type. +func PossibleInstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsValues() []InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails { + return []InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails{InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails} +} + +// InstanceTypeBasicDisableProtectionProviderSpecificInput enumerates the values for instance type basic +// disable protection provider specific input. +type InstanceTypeBasicDisableProtectionProviderSpecificInput string + +const ( + // InstanceTypeDisableProtectionProviderSpecificInput ... + InstanceTypeDisableProtectionProviderSpecificInput InstanceTypeBasicDisableProtectionProviderSpecificInput = "DisableProtectionProviderSpecificInput" + // InstanceTypeInMage ... + InstanceTypeInMage InstanceTypeBasicDisableProtectionProviderSpecificInput = "InMage" +) + +// PossibleInstanceTypeBasicDisableProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicDisableProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicDisableProtectionProviderSpecificInputValues() []InstanceTypeBasicDisableProtectionProviderSpecificInput { + return []InstanceTypeBasicDisableProtectionProviderSpecificInput{InstanceTypeDisableProtectionProviderSpecificInput, InstanceTypeInMage} +} + +// InstanceTypeBasicEnableMigrationProviderSpecificInput enumerates the values for instance type basic enable +// migration provider specific input. +type InstanceTypeBasicEnableMigrationProviderSpecificInput string + +const ( + // InstanceTypeEnableMigrationProviderSpecificInput ... + InstanceTypeEnableMigrationProviderSpecificInput InstanceTypeBasicEnableMigrationProviderSpecificInput = "EnableMigrationProviderSpecificInput" + // InstanceTypeVMwareCbt ... + InstanceTypeVMwareCbt InstanceTypeBasicEnableMigrationProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicEnableMigrationProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicEnableMigrationProviderSpecificInput const type. +func PossibleInstanceTypeBasicEnableMigrationProviderSpecificInputValues() []InstanceTypeBasicEnableMigrationProviderSpecificInput { + return []InstanceTypeBasicEnableMigrationProviderSpecificInput{InstanceTypeEnableMigrationProviderSpecificInput, InstanceTypeVMwareCbt} +} + +// InstanceTypeBasicEnableProtectionProviderSpecificInput enumerates the values for instance type basic enable +// protection provider specific input. +type InstanceTypeBasicEnableProtectionProviderSpecificInput string + +const ( + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A InstanceTypeBasicEnableProtectionProviderSpecificInput = "A2A" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicEnableProtectionProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput InstanceTypeBasicEnableProtectionProviderSpecificInput = "EnableProtectionProviderSpecificInput" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicEnableProtectionProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMage" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMageRcm" +) + +// PossibleInstanceTypeBasicEnableProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicEnableProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicEnableProtectionProviderSpecificInputValues() []InstanceTypeBasicEnableProtectionProviderSpecificInput { + return []InstanceTypeBasicEnableProtectionProviderSpecificInput{InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm} +} + +// InstanceTypeBasicEventProviderSpecificDetails enumerates the values for instance type basic event provider +// specific details. +type InstanceTypeBasicEventProviderSpecificDetails string + +const ( + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicEventProviderSpecificDetails = "A2A" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails InstanceTypeBasicEventProviderSpecificDetails = "EventProviderSpecificDetails" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplica2012" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplica2012R2" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplicaAzure" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplicaBaseEventDetails" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicEventProviderSpecificDetails = "InMageAzureV2" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicEventProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback InstanceTypeBasicEventProviderSpecificDetails = "InMageRcmFailback" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicEventProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicEventProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicEventProviderSpecificDetails const type. +func PossibleInstanceTypeBasicEventProviderSpecificDetailsValues() []InstanceTypeBasicEventProviderSpecificDetails { + return []InstanceTypeBasicEventProviderSpecificDetails{InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicEventSpecificDetails enumerates the values for instance type basic event specific details. +type InstanceTypeBasicEventSpecificDetails string + +const ( + // InstanceTypeEventSpecificDetails ... + InstanceTypeEventSpecificDetails InstanceTypeBasicEventSpecificDetails = "EventSpecificDetails" + // InstanceTypeJobStatus ... + InstanceTypeJobStatus InstanceTypeBasicEventSpecificDetails = "JobStatus" +) + +// PossibleInstanceTypeBasicEventSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicEventSpecificDetails const type. +func PossibleInstanceTypeBasicEventSpecificDetailsValues() []InstanceTypeBasicEventSpecificDetails { + return []InstanceTypeBasicEventSpecificDetails{InstanceTypeEventSpecificDetails, InstanceTypeJobStatus} +} + +// InstanceTypeBasicFabricSpecificCreateNetworkMappingInput enumerates the values for instance type basic +// fabric specific create network mapping input. +type InstanceTypeBasicFabricSpecificCreateNetworkMappingInput string + +const ( + // InstanceTypeAzureToAzure ... + InstanceTypeAzureToAzure InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "AzureToAzure" + // InstanceTypeFabricSpecificCreateNetworkMappingInput ... + InstanceTypeFabricSpecificCreateNetworkMappingInput InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "FabricSpecificCreateNetworkMappingInput" + // InstanceTypeVmmToAzure ... + InstanceTypeVmmToAzure InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "VmmToAzure" + // InstanceTypeVmmToVmm ... + InstanceTypeVmmToVmm InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "VmmToVmm" +) + +// PossibleInstanceTypeBasicFabricSpecificCreateNetworkMappingInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificCreateNetworkMappingInput const type. +func PossibleInstanceTypeBasicFabricSpecificCreateNetworkMappingInputValues() []InstanceTypeBasicFabricSpecificCreateNetworkMappingInput { + return []InstanceTypeBasicFabricSpecificCreateNetworkMappingInput{InstanceTypeAzureToAzure, InstanceTypeFabricSpecificCreateNetworkMappingInput, InstanceTypeVmmToAzure, InstanceTypeVmmToVmm} +} + +// InstanceTypeBasicFabricSpecificCreationInput enumerates the values for instance type basic fabric specific +// creation input. +type InstanceTypeBasicFabricSpecificCreationInput string + +const ( + // InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure ... + InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure InstanceTypeBasicFabricSpecificCreationInput = "Azure" + // InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput ... + InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput InstanceTypeBasicFabricSpecificCreationInput = "FabricSpecificCreationInput" + // InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm ... + InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm InstanceTypeBasicFabricSpecificCreationInput = "InMageRcm" + // InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2 ... + InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2 InstanceTypeBasicFabricSpecificCreationInput = "VMwareV2" +) + +// PossibleInstanceTypeBasicFabricSpecificCreationInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificCreationInput const type. +func PossibleInstanceTypeBasicFabricSpecificCreationInputValues() []InstanceTypeBasicFabricSpecificCreationInput { + return []InstanceTypeBasicFabricSpecificCreationInput{InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure, InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput, InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm, InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2} +} + +// InstanceTypeBasicFabricSpecificDetails enumerates the values for instance type basic fabric specific +// details. +type InstanceTypeBasicFabricSpecificDetails string + +const ( + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure InstanceTypeBasicFabricSpecificDetails = "Azure" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails InstanceTypeBasicFabricSpecificDetails = "FabricSpecificDetails" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite InstanceTypeBasicFabricSpecificDetails = "HyperVSite" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicFabricSpecificDetails = "InMageRcm" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM InstanceTypeBasicFabricSpecificDetails = "VMM" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware InstanceTypeBasicFabricSpecificDetails = "VMware" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 InstanceTypeBasicFabricSpecificDetails = "VMwareV2" +) + +// PossibleInstanceTypeBasicFabricSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicFabricSpecificDetails const type. +func PossibleInstanceTypeBasicFabricSpecificDetailsValues() []InstanceTypeBasicFabricSpecificDetails { + return []InstanceTypeBasicFabricSpecificDetails{InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure, InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails, InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite, InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2} +} + +// InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput enumerates the values for instance type basic +// fabric specific update network mapping input. +type InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput string + +const ( + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "AzureToAzure" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "FabricSpecificUpdateNetworkMappingInput" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "VmmToAzure" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "VmmToVmm" +) + +// PossibleInstanceTypeBasicFabricSpecificUpdateNetworkMappingInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput const type. +func PossibleInstanceTypeBasicFabricSpecificUpdateNetworkMappingInputValues() []InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput { + return []InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput{InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm} +} + +// InstanceTypeBasicGroupTaskDetails enumerates the values for instance type basic group task details. +type InstanceTypeBasicGroupTaskDetails string + +const ( + // InstanceTypeGroupTaskDetails ... + InstanceTypeGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "GroupTaskDetails" + // InstanceTypeInlineWorkflowTaskDetails ... + InstanceTypeInlineWorkflowTaskDetails InstanceTypeBasicGroupTaskDetails = "InlineWorkflowTaskDetails" + // InstanceTypeRecoveryPlanGroupTaskDetails ... + InstanceTypeRecoveryPlanGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "RecoveryPlanGroupTaskDetails" + // InstanceTypeRecoveryPlanShutdownGroupTaskDetails ... + InstanceTypeRecoveryPlanShutdownGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "RecoveryPlanShutdownGroupTaskDetails" +) + +// PossibleInstanceTypeBasicGroupTaskDetailsValues returns an array of possible values for the InstanceTypeBasicGroupTaskDetails const type. +func PossibleInstanceTypeBasicGroupTaskDetailsValues() []InstanceTypeBasicGroupTaskDetails { + return []InstanceTypeBasicGroupTaskDetails{InstanceTypeGroupTaskDetails, InstanceTypeInlineWorkflowTaskDetails, InstanceTypeRecoveryPlanGroupTaskDetails, InstanceTypeRecoveryPlanShutdownGroupTaskDetails} +} + +// InstanceTypeBasicJobDetails enumerates the values for instance type basic job details. +type InstanceTypeBasicJobDetails string + +const ( + // InstanceTypeAsrJobDetails ... + InstanceTypeAsrJobDetails InstanceTypeBasicJobDetails = "AsrJobDetails" + // InstanceTypeExportJobDetails ... + InstanceTypeExportJobDetails InstanceTypeBasicJobDetails = "ExportJobDetails" + // InstanceTypeFailoverJobDetails ... + InstanceTypeFailoverJobDetails InstanceTypeBasicJobDetails = "FailoverJobDetails" + // InstanceTypeJobDetails ... + InstanceTypeJobDetails InstanceTypeBasicJobDetails = "JobDetails" + // InstanceTypeSwitchProtectionJobDetails ... + InstanceTypeSwitchProtectionJobDetails InstanceTypeBasicJobDetails = "SwitchProtectionJobDetails" + // InstanceTypeTestFailoverJobDetails ... + InstanceTypeTestFailoverJobDetails InstanceTypeBasicJobDetails = "TestFailoverJobDetails" +) + +// PossibleInstanceTypeBasicJobDetailsValues returns an array of possible values for the InstanceTypeBasicJobDetails const type. +func PossibleInstanceTypeBasicJobDetailsValues() []InstanceTypeBasicJobDetails { + return []InstanceTypeBasicJobDetails{InstanceTypeAsrJobDetails, InstanceTypeExportJobDetails, InstanceTypeFailoverJobDetails, InstanceTypeJobDetails, InstanceTypeSwitchProtectionJobDetails, InstanceTypeTestFailoverJobDetails} +} + +// InstanceTypeBasicMigrateProviderSpecificInput enumerates the values for instance type basic migrate provider +// specific input. +type InstanceTypeBasicMigrateProviderSpecificInput string + +const ( + // InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput ... + InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput InstanceTypeBasicMigrateProviderSpecificInput = "MigrateProviderSpecificInput" + // InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicMigrateProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicMigrateProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicMigrateProviderSpecificInput const type. +func PossibleInstanceTypeBasicMigrateProviderSpecificInputValues() []InstanceTypeBasicMigrateProviderSpecificInput { + return []InstanceTypeBasicMigrateProviderSpecificInput{InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput, InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicMigrationProviderSpecificSettings enumerates the values for instance type basic migration +// provider specific settings. +type InstanceTypeBasicMigrationProviderSpecificSettings string + +const ( + // InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings ... + InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings InstanceTypeBasicMigrationProviderSpecificSettings = "MigrationProviderSpecificSettings" + // InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt ... + InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt InstanceTypeBasicMigrationProviderSpecificSettings = "VMwareCbt" +) + +// PossibleInstanceTypeBasicMigrationProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicMigrationProviderSpecificSettings const type. +func PossibleInstanceTypeBasicMigrationProviderSpecificSettingsValues() []InstanceTypeBasicMigrationProviderSpecificSettings { + return []InstanceTypeBasicMigrationProviderSpecificSettings{InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings, InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicNetworkMappingFabricSpecificSettings enumerates the values for instance type basic network +// mapping fabric specific settings. +type InstanceTypeBasicNetworkMappingFabricSpecificSettings string + +const ( + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure InstanceTypeBasicNetworkMappingFabricSpecificSettings = "AzureToAzure" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings InstanceTypeBasicNetworkMappingFabricSpecificSettings = "NetworkMappingFabricSpecificSettings" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure InstanceTypeBasicNetworkMappingFabricSpecificSettings = "VmmToAzure" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm InstanceTypeBasicNetworkMappingFabricSpecificSettings = "VmmToVmm" +) + +// PossibleInstanceTypeBasicNetworkMappingFabricSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicNetworkMappingFabricSpecificSettings const type. +func PossibleInstanceTypeBasicNetworkMappingFabricSpecificSettingsValues() []InstanceTypeBasicNetworkMappingFabricSpecificSettings { + return []InstanceTypeBasicNetworkMappingFabricSpecificSettings{InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm} +} + +// InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput enumerates the values for instance type basic +// planned failover provider specific failover input. +type InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput string + +const ( + // InstanceTypeHyperVReplicaAzure ... + InstanceTypeHyperVReplicaAzure InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "HyperVReplicaAzure" + // InstanceTypeHyperVReplicaAzureFailback ... + InstanceTypeHyperVReplicaAzureFailback InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "HyperVReplicaAzureFailback" + // InstanceTypeInMageRcmFailback ... + InstanceTypeInMageRcmFailback InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "InMageRcmFailback" + // InstanceTypePlannedFailoverProviderSpecificFailoverInput ... + InstanceTypePlannedFailoverProviderSpecificFailoverInput InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "PlannedFailoverProviderSpecificFailoverInput" +) + +// PossibleInstanceTypeBasicPlannedFailoverProviderSpecificFailoverInputValues returns an array of possible values for the InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput const type. +func PossibleInstanceTypeBasicPlannedFailoverProviderSpecificFailoverInputValues() []InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput { + return []InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput{InstanceTypeHyperVReplicaAzure, InstanceTypeHyperVReplicaAzureFailback, InstanceTypeInMageRcmFailback, InstanceTypePlannedFailoverProviderSpecificFailoverInput} +} + +// InstanceTypeBasicPolicyProviderSpecificDetails enumerates the values for instance type basic policy provider +// specific details. +type InstanceTypeBasicPolicyProviderSpecificDetails string + +const ( + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicPolicyProviderSpecificDetails = "A2A" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplica2012" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplica2012R2" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplicaAzure" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplicaBasePolicyDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage InstanceTypeBasicPolicyProviderSpecificDetails = "InMage" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicPolicyProviderSpecificDetails = "InMageAzureV2" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails InstanceTypeBasicPolicyProviderSpecificDetails = "InMageBasePolicyDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicPolicyProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback InstanceTypeBasicPolicyProviderSpecificDetails = "InMageRcmFailback" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails InstanceTypeBasicPolicyProviderSpecificDetails = "PolicyProviderSpecificDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicPolicyProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicPolicyProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicPolicyProviderSpecificDetails const type. +func PossibleInstanceTypeBasicPolicyProviderSpecificDetailsValues() []InstanceTypeBasicPolicyProviderSpecificDetails { + return []InstanceTypeBasicPolicyProviderSpecificDetails{InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicPolicyProviderSpecificInput enumerates the values for instance type basic policy provider +// specific input. +type InstanceTypeBasicPolicyProviderSpecificInput string + +const ( + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A InstanceTypeBasicPolicyProviderSpecificInput = "A2A" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicPolicyProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplica2012" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplica2012R2" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage InstanceTypeBasicPolicyProviderSpecificInput = "InMage" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicPolicyProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicPolicyProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback InstanceTypeBasicPolicyProviderSpecificInput = "InMageRcmFailback" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput InstanceTypeBasicPolicyProviderSpecificInput = "PolicyProviderSpecificInput" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicPolicyProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicPolicyProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicPolicyProviderSpecificInput const type. +func PossibleInstanceTypeBasicPolicyProviderSpecificInputValues() []InstanceTypeBasicPolicyProviderSpecificInput { + return []InstanceTypeBasicPolicyProviderSpecificInput{InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails enumerates the values for instance type +// basic protection container mapping provider specific details. +type InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails string + +const ( + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "A2A" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "ProtectionContainerMappingProviderSpecificDetails" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails const type. +func PossibleInstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsValues() []InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails { + return []InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails{InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicProviderSpecificRecoveryPointDetails enumerates the values for instance type basic provider +// specific recovery point details. +type InstanceTypeBasicProviderSpecificRecoveryPointDetails string + +const ( + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A InstanceTypeBasicProviderSpecificRecoveryPointDetails = "A2A" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicProviderSpecificRecoveryPointDetails = "InMageAzureV2" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm InstanceTypeBasicProviderSpecificRecoveryPointDetails = "InMageRcm" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails InstanceTypeBasicProviderSpecificRecoveryPointDetails = "ProviderSpecificRecoveryPointDetails" +) + +// PossibleInstanceTypeBasicProviderSpecificRecoveryPointDetailsValues returns an array of possible values for the InstanceTypeBasicProviderSpecificRecoveryPointDetails const type. +func PossibleInstanceTypeBasicProviderSpecificRecoveryPointDetailsValues() []InstanceTypeBasicProviderSpecificRecoveryPointDetails { + return []InstanceTypeBasicProviderSpecificRecoveryPointDetails{InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails} +} + +// InstanceTypeBasicRecoveryPlanActionDetails enumerates the values for instance type basic recovery plan +// action details. +type InstanceTypeBasicRecoveryPlanActionDetails string + +const ( + // InstanceTypeAutomationRunbookActionDetails ... + InstanceTypeAutomationRunbookActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "AutomationRunbookActionDetails" + // InstanceTypeManualActionDetails ... + InstanceTypeManualActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "ManualActionDetails" + // InstanceTypeRecoveryPlanActionDetails ... + InstanceTypeRecoveryPlanActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "RecoveryPlanActionDetails" + // InstanceTypeScriptActionDetails ... + InstanceTypeScriptActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "ScriptActionDetails" +) + +// PossibleInstanceTypeBasicRecoveryPlanActionDetailsValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanActionDetails const type. +func PossibleInstanceTypeBasicRecoveryPlanActionDetailsValues() []InstanceTypeBasicRecoveryPlanActionDetails { + return []InstanceTypeBasicRecoveryPlanActionDetails{InstanceTypeAutomationRunbookActionDetails, InstanceTypeManualActionDetails, InstanceTypeRecoveryPlanActionDetails, InstanceTypeScriptActionDetails} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificDetails enumerates the values for instance type basic recovery +// plan provider specific details. +type InstanceTypeBasicRecoveryPlanProviderSpecificDetails string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificDetails = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails ... + InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails InstanceTypeBasicRecoveryPlanProviderSpecificDetails = "RecoveryPlanProviderSpecificDetails" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificDetails const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificDetailsValues() []InstanceTypeBasicRecoveryPlanProviderSpecificDetails { + return []InstanceTypeBasicRecoveryPlanProviderSpecificDetails{InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput enumerates the values for instance type basic +// recovery plan provider specific failover input. +type InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "HyperVReplicaAzure" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "HyperVReplicaAzureFailback" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMage" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageAzureV2" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageRcm" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageRcmFailback" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "RecoveryPlanProviderSpecificFailoverInput" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputValues() []InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput { + return []InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput{InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificInput enumerates the values for instance type basic recovery +// plan provider specific input. +type InstanceTypeBasicRecoveryPlanProviderSpecificInput string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificInput = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput ... + InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput InstanceTypeBasicRecoveryPlanProviderSpecificInput = "RecoveryPlanProviderSpecificInput" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificInput const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificInputValues() []InstanceTypeBasicRecoveryPlanProviderSpecificInput { + return []InstanceTypeBasicRecoveryPlanProviderSpecificInput{InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput} +} + +// InstanceTypeBasicRemoveDisksProviderSpecificInput enumerates the values for instance type basic remove disks +// provider specific input. +type InstanceTypeBasicRemoveDisksProviderSpecificInput string + +const ( + // InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A InstanceTypeBasicRemoveDisksProviderSpecificInput = "A2A" + // InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput ... + InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput InstanceTypeBasicRemoveDisksProviderSpecificInput = "RemoveDisksProviderSpecificInput" +) + +// PossibleInstanceTypeBasicRemoveDisksProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicRemoveDisksProviderSpecificInput const type. +func PossibleInstanceTypeBasicRemoveDisksProviderSpecificInputValues() []InstanceTypeBasicRemoveDisksProviderSpecificInput { + return []InstanceTypeBasicRemoveDisksProviderSpecificInput{InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput} +} + +// InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings enumerates the values for instance type +// basic replication protection intent provider specific settings. +type InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings string + +const ( + // InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A ... + InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings = "A2A" + // InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings ... + InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings = "ReplicationProtectionIntentProviderSpecificSettings" +) + +// PossibleInstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings const type. +func PossibleInstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsValues() []InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings { + return []InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings{InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A, InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings} +} + +// InstanceTypeBasicReplicationProviderSpecificContainerCreationInput enumerates the values for instance type +// basic replication provider specific container creation input. +type InstanceTypeBasicReplicationProviderSpecificContainerCreationInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "A2ACrossClusterMigration" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "ReplicationProviderSpecificContainerCreationInput" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificContainerCreationInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificContainerCreationInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificContainerCreationInputValues() []InstanceTypeBasicReplicationProviderSpecificContainerCreationInput { + return []InstanceTypeBasicReplicationProviderSpecificContainerCreationInput{InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReplicationProviderSpecificContainerMappingInput enumerates the values for instance type +// basic replication provider specific container mapping input. +type InstanceTypeBasicReplicationProviderSpecificContainerMappingInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "ReplicationProviderSpecificContainerMappingInput" + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificContainerMappingInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificContainerMappingInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificContainerMappingInputValues() []InstanceTypeBasicReplicationProviderSpecificContainerMappingInput { + return []InstanceTypeBasicReplicationProviderSpecificContainerMappingInput{InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput, InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReplicationProviderSpecificSettings enumerates the values for instance type basic +// replication provider specific settings. +type InstanceTypeBasicReplicationProviderSpecificSettings string + +const ( + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificSettings = "A2A" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration InstanceTypeBasicReplicationProviderSpecificSettings = "A2ACrossClusterMigration" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplica2012" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplica2012R2" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplicaAzure" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplicaBaseReplicationDetails" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage InstanceTypeBasicReplicationProviderSpecificSettings = "InMage" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 InstanceTypeBasicReplicationProviderSpecificSettings = "InMageAzureV2" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm InstanceTypeBasicReplicationProviderSpecificSettings = "InMageRcm" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback InstanceTypeBasicReplicationProviderSpecificSettings = "InMageRcmFailback" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings InstanceTypeBasicReplicationProviderSpecificSettings = "ReplicationProviderSpecificSettings" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificSettings const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificSettingsValues() []InstanceTypeBasicReplicationProviderSpecificSettings { + return []InstanceTypeBasicReplicationProviderSpecificSettings{InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings} +} + +// InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput enumerates the values for instance +// type basic replication provider specific update container mapping input. +type InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "InMageRcm" + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "ReplicationProviderSpecificUpdateContainerMappingInput" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputValues() []InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput { + return []InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput{InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm, InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput} +} + +// InstanceTypeBasicResyncProviderSpecificInput enumerates the values for instance type basic resync provider +// specific input. +type InstanceTypeBasicResyncProviderSpecificInput string + +const ( + // InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput ... + InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput InstanceTypeBasicResyncProviderSpecificInput = "ResyncProviderSpecificInput" + // InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicResyncProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicResyncProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicResyncProviderSpecificInput const type. +func PossibleInstanceTypeBasicResyncProviderSpecificInputValues() []InstanceTypeBasicResyncProviderSpecificInput { + return []InstanceTypeBasicResyncProviderSpecificInput{InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput, InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReverseReplicationProviderSpecificInput enumerates the values for instance type basic +// reverse replication provider specific input. +type InstanceTypeBasicReverseReplicationProviderSpecificInput string + +const ( + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A InstanceTypeBasicReverseReplicationProviderSpecificInput = "A2A" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicReverseReplicationProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMage" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageRcmFailback" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput InstanceTypeBasicReverseReplicationProviderSpecificInput = "ReverseReplicationProviderSpecificInput" +) + +// PossibleInstanceTypeBasicReverseReplicationProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicReverseReplicationProviderSpecificInput const type. +func PossibleInstanceTypeBasicReverseReplicationProviderSpecificInputValues() []InstanceTypeBasicReverseReplicationProviderSpecificInput { + return []InstanceTypeBasicReverseReplicationProviderSpecificInput{InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput} +} + +// InstanceTypeBasicSwitchProtectionProviderSpecificInput enumerates the values for instance type basic switch +// protection provider specific input. +type InstanceTypeBasicSwitchProtectionProviderSpecificInput string + +const ( + // InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A InstanceTypeBasicSwitchProtectionProviderSpecificInput = "A2A" + // InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput ... + InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput InstanceTypeBasicSwitchProtectionProviderSpecificInput = "SwitchProtectionProviderSpecificInput" +) + +// PossibleInstanceTypeBasicSwitchProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicSwitchProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicSwitchProtectionProviderSpecificInputValues() []InstanceTypeBasicSwitchProtectionProviderSpecificInput { + return []InstanceTypeBasicSwitchProtectionProviderSpecificInput{InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput} +} + +// InstanceTypeBasicSwitchProviderProviderSpecificInput enumerates the values for instance type basic switch +// provider provider specific input. +type InstanceTypeBasicSwitchProviderProviderSpecificInput string + +const ( + // InstanceTypeInMageAzureV2 ... + InstanceTypeInMageAzureV2 InstanceTypeBasicSwitchProviderProviderSpecificInput = "InMageAzureV2" + // InstanceTypeSwitchProviderProviderSpecificInput ... + InstanceTypeSwitchProviderProviderSpecificInput InstanceTypeBasicSwitchProviderProviderSpecificInput = "SwitchProviderProviderSpecificInput" +) + +// PossibleInstanceTypeBasicSwitchProviderProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicSwitchProviderProviderSpecificInput const type. +func PossibleInstanceTypeBasicSwitchProviderProviderSpecificInputValues() []InstanceTypeBasicSwitchProviderProviderSpecificInput { + return []InstanceTypeBasicSwitchProviderProviderSpecificInput{InstanceTypeInMageAzureV2, InstanceTypeSwitchProviderProviderSpecificInput} +} + +// InstanceTypeBasicTaskTypeDetails enumerates the values for instance type basic task type details. +type InstanceTypeBasicTaskTypeDetails string + +const ( + // InstanceTypeAutomationRunbookTaskDetails ... + InstanceTypeAutomationRunbookTaskDetails InstanceTypeBasicTaskTypeDetails = "AutomationRunbookTaskDetails" + // InstanceTypeConsistencyCheckTaskDetails ... + InstanceTypeConsistencyCheckTaskDetails InstanceTypeBasicTaskTypeDetails = "ConsistencyCheckTaskDetails" + // InstanceTypeFabricReplicationGroupTaskDetails ... + InstanceTypeFabricReplicationGroupTaskDetails InstanceTypeBasicTaskTypeDetails = "FabricReplicationGroupTaskDetails" + // InstanceTypeJobTaskDetails ... + InstanceTypeJobTaskDetails InstanceTypeBasicTaskTypeDetails = "JobTaskDetails" + // InstanceTypeManualActionTaskDetails ... + InstanceTypeManualActionTaskDetails InstanceTypeBasicTaskTypeDetails = "ManualActionTaskDetails" + // InstanceTypeScriptActionTaskDetails ... + InstanceTypeScriptActionTaskDetails InstanceTypeBasicTaskTypeDetails = "ScriptActionTaskDetails" + // InstanceTypeTaskTypeDetails ... + InstanceTypeTaskTypeDetails InstanceTypeBasicTaskTypeDetails = "TaskTypeDetails" + // InstanceTypeVirtualMachineTaskDetails ... + InstanceTypeVirtualMachineTaskDetails InstanceTypeBasicTaskTypeDetails = "VirtualMachineTaskDetails" + // InstanceTypeVMNicUpdatesTaskDetails ... + InstanceTypeVMNicUpdatesTaskDetails InstanceTypeBasicTaskTypeDetails = "VmNicUpdatesTaskDetails" +) + +// PossibleInstanceTypeBasicTaskTypeDetailsValues returns an array of possible values for the InstanceTypeBasicTaskTypeDetails const type. +func PossibleInstanceTypeBasicTaskTypeDetailsValues() []InstanceTypeBasicTaskTypeDetails { + return []InstanceTypeBasicTaskTypeDetails{InstanceTypeAutomationRunbookTaskDetails, InstanceTypeConsistencyCheckTaskDetails, InstanceTypeFabricReplicationGroupTaskDetails, InstanceTypeJobTaskDetails, InstanceTypeManualActionTaskDetails, InstanceTypeScriptActionTaskDetails, InstanceTypeTaskTypeDetails, InstanceTypeVirtualMachineTaskDetails, InstanceTypeVMNicUpdatesTaskDetails} +} + +// InstanceTypeBasicTestFailoverProviderSpecificInput enumerates the values for instance type basic test +// failover provider specific input. +type InstanceTypeBasicTestFailoverProviderSpecificInput string + +const ( + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A InstanceTypeBasicTestFailoverProviderSpecificInput = "A2A" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicTestFailoverProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage InstanceTypeBasicTestFailoverProviderSpecificInput = "InMage" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicTestFailoverProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicTestFailoverProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput InstanceTypeBasicTestFailoverProviderSpecificInput = "TestFailoverProviderSpecificInput" +) + +// PossibleInstanceTypeBasicTestFailoverProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicTestFailoverProviderSpecificInput const type. +func PossibleInstanceTypeBasicTestFailoverProviderSpecificInputValues() []InstanceTypeBasicTestFailoverProviderSpecificInput { + return []InstanceTypeBasicTestFailoverProviderSpecificInput{InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput} +} + +// InstanceTypeBasicTestMigrateProviderSpecificInput enumerates the values for instance type basic test migrate +// provider specific input. +type InstanceTypeBasicTestMigrateProviderSpecificInput string + +const ( + // InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput ... + InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput InstanceTypeBasicTestMigrateProviderSpecificInput = "TestMigrateProviderSpecificInput" + // InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicTestMigrateProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicTestMigrateProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicTestMigrateProviderSpecificInput const type. +func PossibleInstanceTypeBasicTestMigrateProviderSpecificInputValues() []InstanceTypeBasicTestMigrateProviderSpecificInput { + return []InstanceTypeBasicTestMigrateProviderSpecificInput{InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput, InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicUnplannedFailoverProviderSpecificInput enumerates the values for instance type basic +// unplanned failover provider specific input. +type InstanceTypeBasicUnplannedFailoverProviderSpecificInput string + +const ( + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "A2A" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMage" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "UnplannedFailoverProviderSpecificInput" +) + +// PossibleInstanceTypeBasicUnplannedFailoverProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUnplannedFailoverProviderSpecificInput const type. +func PossibleInstanceTypeBasicUnplannedFailoverProviderSpecificInputValues() []InstanceTypeBasicUnplannedFailoverProviderSpecificInput { + return []InstanceTypeBasicUnplannedFailoverProviderSpecificInput{InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput} +} + +// InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput enumerates the values for +// instance type basic update appliance for replication protected item provider specific input. +type InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput string + +const ( + // InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput ... + InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput = "UpdateApplianceForReplicationProtectedItemProviderSpecificInput" +) + +// PossibleInstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput const type. +func PossibleInstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputValues() []InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput { + return []InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput{InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput} +} + +// InstanceTypeBasicUpdateMigrationItemProviderSpecificInput enumerates the values for instance type basic +// update migration item provider specific input. +type InstanceTypeBasicUpdateMigrationItemProviderSpecificInput string + +const ( + // InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput ... + InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput InstanceTypeBasicUpdateMigrationItemProviderSpecificInput = "UpdateMigrationItemProviderSpecificInput" + // InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicUpdateMigrationItemProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicUpdateMigrationItemProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUpdateMigrationItemProviderSpecificInput const type. +func PossibleInstanceTypeBasicUpdateMigrationItemProviderSpecificInputValues() []InstanceTypeBasicUpdateMigrationItemProviderSpecificInput { + return []InstanceTypeBasicUpdateMigrationItemProviderSpecificInput{InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput, InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicUpdateReplicationProtectedItemProviderInput enumerates the values for instance type basic +// update replication protected item provider input. +type InstanceTypeBasicUpdateReplicationProtectedItemProviderInput string + +const ( + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "A2A" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "HyperVReplicaAzure" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "InMageAzureV2" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "InMageRcm" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "UpdateReplicationProtectedItemProviderInput" +) + +// PossibleInstanceTypeBasicUpdateReplicationProtectedItemProviderInputValues returns an array of possible values for the InstanceTypeBasicUpdateReplicationProtectedItemProviderInput const type. +func PossibleInstanceTypeBasicUpdateReplicationProtectedItemProviderInputValues() []InstanceTypeBasicUpdateReplicationProtectedItemProviderInput { + return []InstanceTypeBasicUpdateReplicationProtectedItemProviderInput{InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput} +} + +// LicenseType enumerates the values for license type. +type LicenseType string + +const ( + // LicenseTypeNoLicenseType ... + LicenseTypeNoLicenseType LicenseType = "NoLicenseType" + // LicenseTypeNotSpecified ... + LicenseTypeNotSpecified LicenseType = "NotSpecified" + // LicenseTypeWindowsServer ... + LicenseTypeWindowsServer LicenseType = "WindowsServer" +) + +// PossibleLicenseTypeValues returns an array of possible values for the LicenseType const type. +func PossibleLicenseTypeValues() []LicenseType { + return []LicenseType{LicenseTypeNoLicenseType, LicenseTypeNotSpecified, LicenseTypeWindowsServer} +} + +// MigrationItemOperation enumerates the values for migration item operation. +type MigrationItemOperation string + +const ( + // DisableMigration ... + DisableMigration MigrationItemOperation = "DisableMigration" + // Migrate ... + Migrate MigrationItemOperation = "Migrate" + // StartResync ... + StartResync MigrationItemOperation = "StartResync" + // TestMigrate ... + TestMigrate MigrationItemOperation = "TestMigrate" + // TestMigrateCleanup ... + TestMigrateCleanup MigrationItemOperation = "TestMigrateCleanup" +) + +// PossibleMigrationItemOperationValues returns an array of possible values for the MigrationItemOperation const type. +func PossibleMigrationItemOperationValues() []MigrationItemOperation { + return []MigrationItemOperation{DisableMigration, Migrate, StartResync, TestMigrate, TestMigrateCleanup} +} + +// MigrationRecoveryPointType enumerates the values for migration recovery point type. +type MigrationRecoveryPointType string + +const ( + // MigrationRecoveryPointTypeApplicationConsistent ... + MigrationRecoveryPointTypeApplicationConsistent MigrationRecoveryPointType = "ApplicationConsistent" + // MigrationRecoveryPointTypeCrashConsistent ... + MigrationRecoveryPointTypeCrashConsistent MigrationRecoveryPointType = "CrashConsistent" + // MigrationRecoveryPointTypeNotSpecified ... + MigrationRecoveryPointTypeNotSpecified MigrationRecoveryPointType = "NotSpecified" +) + +// PossibleMigrationRecoveryPointTypeValues returns an array of possible values for the MigrationRecoveryPointType const type. +func PossibleMigrationRecoveryPointTypeValues() []MigrationRecoveryPointType { + return []MigrationRecoveryPointType{MigrationRecoveryPointTypeApplicationConsistent, MigrationRecoveryPointTypeCrashConsistent, MigrationRecoveryPointTypeNotSpecified} +} + +// MigrationState enumerates the values for migration state. +type MigrationState string + +const ( + // MigrationStateDisableMigrationFailed ... + MigrationStateDisableMigrationFailed MigrationState = "DisableMigrationFailed" + // MigrationStateDisableMigrationInProgress ... + MigrationStateDisableMigrationInProgress MigrationState = "DisableMigrationInProgress" + // MigrationStateEnableMigrationFailed ... + MigrationStateEnableMigrationFailed MigrationState = "EnableMigrationFailed" + // MigrationStateEnableMigrationInProgress ... + MigrationStateEnableMigrationInProgress MigrationState = "EnableMigrationInProgress" + // MigrationStateInitialSeedingFailed ... + MigrationStateInitialSeedingFailed MigrationState = "InitialSeedingFailed" + // MigrationStateInitialSeedingInProgress ... + MigrationStateInitialSeedingInProgress MigrationState = "InitialSeedingInProgress" + // MigrationStateMigrationFailed ... + MigrationStateMigrationFailed MigrationState = "MigrationFailed" + // MigrationStateMigrationInProgress ... + MigrationStateMigrationInProgress MigrationState = "MigrationInProgress" + // MigrationStateMigrationSucceeded ... + MigrationStateMigrationSucceeded MigrationState = "MigrationSucceeded" + // MigrationStateNone ... + MigrationStateNone MigrationState = "None" + // MigrationStateReplicating ... + MigrationStateReplicating MigrationState = "Replicating" +) + +// PossibleMigrationStateValues returns an array of possible values for the MigrationState const type. +func PossibleMigrationStateValues() []MigrationState { + return []MigrationState{MigrationStateDisableMigrationFailed, MigrationStateDisableMigrationInProgress, MigrationStateEnableMigrationFailed, MigrationStateEnableMigrationInProgress, MigrationStateInitialSeedingFailed, MigrationStateInitialSeedingInProgress, MigrationStateMigrationFailed, MigrationStateMigrationInProgress, MigrationStateMigrationSucceeded, MigrationStateNone, MigrationStateReplicating} +} + +// MobilityAgentUpgradeState enumerates the values for mobility agent upgrade state. +type MobilityAgentUpgradeState string + +const ( + // MobilityAgentUpgradeStateCommit ... + MobilityAgentUpgradeStateCommit MobilityAgentUpgradeState = "Commit" + // MobilityAgentUpgradeStateCompleted ... + MobilityAgentUpgradeStateCompleted MobilityAgentUpgradeState = "Completed" + // MobilityAgentUpgradeStateNone ... + MobilityAgentUpgradeStateNone MobilityAgentUpgradeState = "None" + // MobilityAgentUpgradeStateStarted ... + MobilityAgentUpgradeStateStarted MobilityAgentUpgradeState = "Started" +) + +// PossibleMobilityAgentUpgradeStateValues returns an array of possible values for the MobilityAgentUpgradeState const type. +func PossibleMobilityAgentUpgradeStateValues() []MobilityAgentUpgradeState { + return []MobilityAgentUpgradeState{MobilityAgentUpgradeStateCommit, MobilityAgentUpgradeStateCompleted, MobilityAgentUpgradeStateNone, MobilityAgentUpgradeStateStarted} +} + +// MultiVMGroupCreateOption enumerates the values for multi vm group create option. +type MultiVMGroupCreateOption string + +const ( + // AutoCreated ... + AutoCreated MultiVMGroupCreateOption = "AutoCreated" + // UserSpecified ... + UserSpecified MultiVMGroupCreateOption = "UserSpecified" +) + +// PossibleMultiVMGroupCreateOptionValues returns an array of possible values for the MultiVMGroupCreateOption const type. +func PossibleMultiVMGroupCreateOptionValues() []MultiVMGroupCreateOption { + return []MultiVMGroupCreateOption{AutoCreated, UserSpecified} +} + +// MultiVMSyncPointOption enumerates the values for multi vm sync point option. +type MultiVMSyncPointOption string + +const ( + // UseMultiVMSyncRecoveryPoint ... + UseMultiVMSyncRecoveryPoint MultiVMSyncPointOption = "UseMultiVmSyncRecoveryPoint" + // UsePerVMRecoveryPoint ... + UsePerVMRecoveryPoint MultiVMSyncPointOption = "UsePerVmRecoveryPoint" +) + +// PossibleMultiVMSyncPointOptionValues returns an array of possible values for the MultiVMSyncPointOption const type. +func PossibleMultiVMSyncPointOptionValues() []MultiVMSyncPointOption { + return []MultiVMSyncPointOption{UseMultiVMSyncRecoveryPoint, UsePerVMRecoveryPoint} +} + +// PlannedFailoverStatus enumerates the values for planned failover status. +type PlannedFailoverStatus string + +const ( + // PlannedFailoverStatusCancelled ... + PlannedFailoverStatusCancelled PlannedFailoverStatus = "Cancelled" + // PlannedFailoverStatusFailed ... + PlannedFailoverStatusFailed PlannedFailoverStatus = "Failed" + // PlannedFailoverStatusSucceeded ... + PlannedFailoverStatusSucceeded PlannedFailoverStatus = "Succeeded" + // PlannedFailoverStatusUnknown ... + PlannedFailoverStatusUnknown PlannedFailoverStatus = "Unknown" +) + +// PossiblePlannedFailoverStatusValues returns an array of possible values for the PlannedFailoverStatus const type. +func PossiblePlannedFailoverStatusValues() []PlannedFailoverStatus { + return []PlannedFailoverStatus{PlannedFailoverStatusCancelled, PlannedFailoverStatusFailed, PlannedFailoverStatusSucceeded, PlannedFailoverStatusUnknown} +} + +// PossibleOperationsDirections enumerates the values for possible operations directions. +type PossibleOperationsDirections string + +const ( + // PrimaryToRecovery ... + PrimaryToRecovery PossibleOperationsDirections = "PrimaryToRecovery" + // RecoveryToPrimary ... + RecoveryToPrimary PossibleOperationsDirections = "RecoveryToPrimary" +) + +// PossiblePossibleOperationsDirectionsValues returns an array of possible values for the PossibleOperationsDirections const type. +func PossiblePossibleOperationsDirectionsValues() []PossibleOperationsDirections { + return []PossibleOperationsDirections{PrimaryToRecovery, RecoveryToPrimary} +} + +// PresenceStatus enumerates the values for presence status. +type PresenceStatus string + +const ( + // PresenceStatusNotPresent ... + PresenceStatusNotPresent PresenceStatus = "NotPresent" + // PresenceStatusPresent ... + PresenceStatusPresent PresenceStatus = "Present" + // PresenceStatusUnknown ... + PresenceStatusUnknown PresenceStatus = "Unknown" +) + +// PossiblePresenceStatusValues returns an array of possible values for the PresenceStatus const type. +func PossiblePresenceStatusValues() []PresenceStatus { + return []PresenceStatus{PresenceStatusNotPresent, PresenceStatusPresent, PresenceStatusUnknown} +} + +// ProtectionHealth enumerates the values for protection health. +type ProtectionHealth string + +const ( + // ProtectionHealthCritical ... + ProtectionHealthCritical ProtectionHealth = "Critical" + // ProtectionHealthNone ... + ProtectionHealthNone ProtectionHealth = "None" + // ProtectionHealthNormal ... + ProtectionHealthNormal ProtectionHealth = "Normal" + // ProtectionHealthWarning ... + ProtectionHealthWarning ProtectionHealth = "Warning" +) + +// PossibleProtectionHealthValues returns an array of possible values for the ProtectionHealth const type. +func PossibleProtectionHealthValues() []ProtectionHealth { + return []ProtectionHealth{ProtectionHealthCritical, ProtectionHealthNone, ProtectionHealthNormal, ProtectionHealthWarning} +} + +// RcmComponentStatus enumerates the values for rcm component status. +type RcmComponentStatus string + +const ( + // RcmComponentStatusCritical ... + RcmComponentStatusCritical RcmComponentStatus = "Critical" + // RcmComponentStatusHealthy ... + RcmComponentStatusHealthy RcmComponentStatus = "Healthy" + // RcmComponentStatusUnknown ... + RcmComponentStatusUnknown RcmComponentStatus = "Unknown" + // RcmComponentStatusWarning ... + RcmComponentStatusWarning RcmComponentStatus = "Warning" +) + +// PossibleRcmComponentStatusValues returns an array of possible values for the RcmComponentStatus const type. +func PossibleRcmComponentStatusValues() []RcmComponentStatus { + return []RcmComponentStatus{RcmComponentStatusCritical, RcmComponentStatusHealthy, RcmComponentStatusUnknown, RcmComponentStatusWarning} +} + +// RecoveryPlanActionLocation enumerates the values for recovery plan action location. +type RecoveryPlanActionLocation string + +const ( + // Primary ... + Primary RecoveryPlanActionLocation = "Primary" + // Recovery ... + Recovery RecoveryPlanActionLocation = "Recovery" +) + +// PossibleRecoveryPlanActionLocationValues returns an array of possible values for the RecoveryPlanActionLocation const type. +func PossibleRecoveryPlanActionLocationValues() []RecoveryPlanActionLocation { + return []RecoveryPlanActionLocation{Primary, Recovery} +} + +// RecoveryPlanGroupType enumerates the values for recovery plan group type. +type RecoveryPlanGroupType string + +const ( + // Boot ... + Boot RecoveryPlanGroupType = "Boot" + // Failover ... + Failover RecoveryPlanGroupType = "Failover" + // Shutdown ... + Shutdown RecoveryPlanGroupType = "Shutdown" +) + +// PossibleRecoveryPlanGroupTypeValues returns an array of possible values for the RecoveryPlanGroupType const type. +func PossibleRecoveryPlanGroupTypeValues() []RecoveryPlanGroupType { + return []RecoveryPlanGroupType{Boot, Failover, Shutdown} +} + +// RecoveryPlanPointType enumerates the values for recovery plan point type. +type RecoveryPlanPointType string + +const ( + // RecoveryPlanPointTypeLatest ... + RecoveryPlanPointTypeLatest RecoveryPlanPointType = "Latest" + // RecoveryPlanPointTypeLatestApplicationConsistent ... + RecoveryPlanPointTypeLatestApplicationConsistent RecoveryPlanPointType = "LatestApplicationConsistent" + // RecoveryPlanPointTypeLatestCrashConsistent ... + RecoveryPlanPointTypeLatestCrashConsistent RecoveryPlanPointType = "LatestCrashConsistent" + // RecoveryPlanPointTypeLatestProcessed ... + RecoveryPlanPointTypeLatestProcessed RecoveryPlanPointType = "LatestProcessed" +) + +// PossibleRecoveryPlanPointTypeValues returns an array of possible values for the RecoveryPlanPointType const type. +func PossibleRecoveryPlanPointTypeValues() []RecoveryPlanPointType { + return []RecoveryPlanPointType{RecoveryPlanPointTypeLatest, RecoveryPlanPointTypeLatestApplicationConsistent, RecoveryPlanPointTypeLatestCrashConsistent, RecoveryPlanPointTypeLatestProcessed} +} + +// RecoveryPointSyncType enumerates the values for recovery point sync type. +type RecoveryPointSyncType string + +const ( + // MultiVMSyncRecoveryPoint ... + MultiVMSyncRecoveryPoint RecoveryPointSyncType = "MultiVmSyncRecoveryPoint" + // PerVMRecoveryPoint ... + PerVMRecoveryPoint RecoveryPointSyncType = "PerVmRecoveryPoint" +) + +// PossibleRecoveryPointSyncTypeValues returns an array of possible values for the RecoveryPointSyncType const type. +func PossibleRecoveryPointSyncTypeValues() []RecoveryPointSyncType { + return []RecoveryPointSyncType{MultiVMSyncRecoveryPoint, PerVMRecoveryPoint} +} + +// RecoveryPointType enumerates the values for recovery point type. +type RecoveryPointType string + +const ( + // Custom ... + Custom RecoveryPointType = "Custom" + // LatestTag ... + LatestTag RecoveryPointType = "LatestTag" + // LatestTime ... + LatestTime RecoveryPointType = "LatestTime" +) + +// PossibleRecoveryPointTypeValues returns an array of possible values for the RecoveryPointType const type. +func PossibleRecoveryPointTypeValues() []RecoveryPointType { + return []RecoveryPointType{Custom, LatestTag, LatestTime} +} + +// ReplicationProtectedItemOperation enumerates the values for replication protected item operation. +type ReplicationProtectedItemOperation string + +const ( + // CancelFailover ... + CancelFailover ReplicationProtectedItemOperation = "CancelFailover" + // ChangePit ... + ChangePit ReplicationProtectedItemOperation = "ChangePit" + // Commit ... + Commit ReplicationProtectedItemOperation = "Commit" + // CompleteMigration ... + CompleteMigration ReplicationProtectedItemOperation = "CompleteMigration" + // DisableProtection ... + DisableProtection ReplicationProtectedItemOperation = "DisableProtection" + // Failback ... + Failback ReplicationProtectedItemOperation = "Failback" + // FinalizeFailback ... + FinalizeFailback ReplicationProtectedItemOperation = "FinalizeFailback" + // PlannedFailover ... + PlannedFailover ReplicationProtectedItemOperation = "PlannedFailover" + // RepairReplication ... + RepairReplication ReplicationProtectedItemOperation = "RepairReplication" + // ReverseReplicate ... + ReverseReplicate ReplicationProtectedItemOperation = "ReverseReplicate" + // SwitchProtection ... + SwitchProtection ReplicationProtectedItemOperation = "SwitchProtection" + // TestFailover ... + TestFailover ReplicationProtectedItemOperation = "TestFailover" + // TestFailoverCleanup ... + TestFailoverCleanup ReplicationProtectedItemOperation = "TestFailoverCleanup" + // UnplannedFailover ... + UnplannedFailover ReplicationProtectedItemOperation = "UnplannedFailover" +) + +// PossibleReplicationProtectedItemOperationValues returns an array of possible values for the ReplicationProtectedItemOperation const type. +func PossibleReplicationProtectedItemOperationValues() []ReplicationProtectedItemOperation { + return []ReplicationProtectedItemOperation{CancelFailover, ChangePit, Commit, CompleteMigration, DisableProtection, Failback, FinalizeFailback, PlannedFailover, RepairReplication, ReverseReplicate, SwitchProtection, TestFailover, TestFailoverCleanup, UnplannedFailover} +} + +// ResourceType enumerates the values for resource type. +type ResourceType string + +const ( + // ResourceTypeExisting ... + ResourceTypeExisting ResourceType = "Existing" + // ResourceTypeNew ... + ResourceTypeNew ResourceType = "New" + // ResourceTypeProtectionProfileCustomDetails ... + ResourceTypeProtectionProfileCustomDetails ResourceType = "ProtectionProfileCustomDetails" +) + +// PossibleResourceTypeValues returns an array of possible values for the ResourceType const type. +func PossibleResourceTypeValues() []ResourceType { + return []ResourceType{ResourceTypeExisting, ResourceTypeNew, ResourceTypeProtectionProfileCustomDetails} +} + +// ResourceTypeBasicRecoveryAvailabilitySetCustomDetails enumerates the values for resource type basic recovery +// availability set custom details. +type ResourceTypeBasicRecoveryAvailabilitySetCustomDetails string + +const ( + // ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryAvailabilitySetCustomDetails = "Existing" + // ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails ... + ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails ResourceTypeBasicRecoveryAvailabilitySetCustomDetails = "RecoveryAvailabilitySetCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryAvailabilitySetCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryAvailabilitySetCustomDetails const type. +func PossibleResourceTypeBasicRecoveryAvailabilitySetCustomDetailsValues() []ResourceTypeBasicRecoveryAvailabilitySetCustomDetails { + return []ResourceTypeBasicRecoveryAvailabilitySetCustomDetails{ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails} +} + +// ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails enumerates the values for resource type basic +// recovery proximity placement group custom details. +type ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails string + +const ( + // ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails = "Existing" + // ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails ... + ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails = "RecoveryProximityPlacementGroupCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails const type. +func PossibleResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsValues() []ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails { + return []ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails{ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails} +} + +// ResourceTypeBasicRecoveryResourceGroupCustomDetails enumerates the values for resource type basic recovery +// resource group custom details. +type ResourceTypeBasicRecoveryResourceGroupCustomDetails string + +const ( + // ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryResourceGroupCustomDetails = "Existing" + // ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails ... + ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails ResourceTypeBasicRecoveryResourceGroupCustomDetails = "RecoveryResourceGroupCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryResourceGroupCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryResourceGroupCustomDetails const type. +func PossibleResourceTypeBasicRecoveryResourceGroupCustomDetailsValues() []ResourceTypeBasicRecoveryResourceGroupCustomDetails { + return []ResourceTypeBasicRecoveryResourceGroupCustomDetails{ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails} +} + +// ResourceTypeBasicRecoveryVirtualNetworkCustomDetails enumerates the values for resource type basic recovery +// virtual network custom details. +type ResourceTypeBasicRecoveryVirtualNetworkCustomDetails string + +const ( + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "Existing" + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "New" + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "RecoveryVirtualNetworkCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryVirtualNetworkCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryVirtualNetworkCustomDetails const type. +func PossibleResourceTypeBasicRecoveryVirtualNetworkCustomDetailsValues() []ResourceTypeBasicRecoveryVirtualNetworkCustomDetails { + return []ResourceTypeBasicRecoveryVirtualNetworkCustomDetails{ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew, ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails} +} + +// ResourceTypeBasicStorageAccountCustomDetails enumerates the values for resource type basic storage account +// custom details. +type ResourceTypeBasicStorageAccountCustomDetails string + +const ( + // ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting ... + ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting ResourceTypeBasicStorageAccountCustomDetails = "Existing" + // ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails ... + ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails ResourceTypeBasicStorageAccountCustomDetails = "StorageAccountCustomDetails" +) + +// PossibleResourceTypeBasicStorageAccountCustomDetailsValues returns an array of possible values for the ResourceTypeBasicStorageAccountCustomDetails const type. +func PossibleResourceTypeBasicStorageAccountCustomDetailsValues() []ResourceTypeBasicStorageAccountCustomDetails { + return []ResourceTypeBasicStorageAccountCustomDetails{ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting, ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails} +} + +// ResyncState enumerates the values for resync state. +type ResyncState string + +const ( + // ResyncStateNone ... + ResyncStateNone ResyncState = "None" + // ResyncStatePreparedForResynchronization ... + ResyncStatePreparedForResynchronization ResyncState = "PreparedForResynchronization" + // ResyncStateStartedResynchronization ... + ResyncStateStartedResynchronization ResyncState = "StartedResynchronization" +) + +// PossibleResyncStateValues returns an array of possible values for the ResyncState const type. +func PossibleResyncStateValues() []ResyncState { + return []ResyncState{ResyncStateNone, ResyncStatePreparedForResynchronization, ResyncStateStartedResynchronization} +} + +// RpInMageRecoveryPointType enumerates the values for rp in mage recovery point type. +type RpInMageRecoveryPointType string + +const ( + // RpInMageRecoveryPointTypeCustom ... + RpInMageRecoveryPointTypeCustom RpInMageRecoveryPointType = "Custom" + // RpInMageRecoveryPointTypeLatestTag ... + RpInMageRecoveryPointTypeLatestTag RpInMageRecoveryPointType = "LatestTag" + // RpInMageRecoveryPointTypeLatestTime ... + RpInMageRecoveryPointTypeLatestTime RpInMageRecoveryPointType = "LatestTime" +) + +// PossibleRpInMageRecoveryPointTypeValues returns an array of possible values for the RpInMageRecoveryPointType const type. +func PossibleRpInMageRecoveryPointTypeValues() []RpInMageRecoveryPointType { + return []RpInMageRecoveryPointType{RpInMageRecoveryPointTypeCustom, RpInMageRecoveryPointTypeLatestTag, RpInMageRecoveryPointTypeLatestTime} +} + +// SetMultiVMSyncStatus enumerates the values for set multi vm sync status. +type SetMultiVMSyncStatus string + +const ( + // Disable ... + Disable SetMultiVMSyncStatus = "Disable" + // Enable ... + Enable SetMultiVMSyncStatus = "Enable" +) + +// PossibleSetMultiVMSyncStatusValues returns an array of possible values for the SetMultiVMSyncStatus const type. +func PossibleSetMultiVMSyncStatusValues() []SetMultiVMSyncStatus { + return []SetMultiVMSyncStatus{Disable, Enable} +} + +// Severity enumerates the values for severity. +type Severity string + +const ( + // Error ... + Error Severity = "Error" + // Info ... + Info Severity = "Info" + // NONE ... + NONE Severity = "NONE" + // Warning ... + Warning Severity = "Warning" +) + +// PossibleSeverityValues returns an array of possible values for the Severity const type. +func PossibleSeverityValues() []Severity { + return []Severity{Error, Info, NONE, Warning} +} + +// SourceSiteOperations enumerates the values for source site operations. +type SourceSiteOperations string + +const ( + // NotRequired ... + NotRequired SourceSiteOperations = "NotRequired" + // Required ... + Required SourceSiteOperations = "Required" +) + +// PossibleSourceSiteOperationsValues returns an array of possible values for the SourceSiteOperations const type. +func PossibleSourceSiteOperationsValues() []SourceSiteOperations { + return []SourceSiteOperations{NotRequired, Required} +} + +// SQLServerLicenseType enumerates the values for sql server license type. +type SQLServerLicenseType string + +const ( + // SQLServerLicenseTypeAHUB ... + SQLServerLicenseTypeAHUB SQLServerLicenseType = "AHUB" + // SQLServerLicenseTypeNoLicenseType ... + SQLServerLicenseTypeNoLicenseType SQLServerLicenseType = "NoLicenseType" + // SQLServerLicenseTypeNotSpecified ... + SQLServerLicenseTypeNotSpecified SQLServerLicenseType = "NotSpecified" + // SQLServerLicenseTypePAYG ... + SQLServerLicenseTypePAYG SQLServerLicenseType = "PAYG" +) + +// PossibleSQLServerLicenseTypeValues returns an array of possible values for the SQLServerLicenseType const type. +func PossibleSQLServerLicenseTypeValues() []SQLServerLicenseType { + return []SQLServerLicenseType{SQLServerLicenseTypeAHUB, SQLServerLicenseTypeNoLicenseType, SQLServerLicenseTypeNotSpecified, SQLServerLicenseTypePAYG} +} + +// TestMigrationState enumerates the values for test migration state. +type TestMigrationState string + +const ( + // TestMigrationStateNone ... + TestMigrationStateNone TestMigrationState = "None" + // TestMigrationStateTestMigrationCleanupInProgress ... + TestMigrationStateTestMigrationCleanupInProgress TestMigrationState = "TestMigrationCleanupInProgress" + // TestMigrationStateTestMigrationFailed ... + TestMigrationStateTestMigrationFailed TestMigrationState = "TestMigrationFailed" + // TestMigrationStateTestMigrationInProgress ... + TestMigrationStateTestMigrationInProgress TestMigrationState = "TestMigrationInProgress" + // TestMigrationStateTestMigrationSucceeded ... + TestMigrationStateTestMigrationSucceeded TestMigrationState = "TestMigrationSucceeded" +) + +// PossibleTestMigrationStateValues returns an array of possible values for the TestMigrationState const type. +func PossibleTestMigrationStateValues() []TestMigrationState { + return []TestMigrationState{TestMigrationStateNone, TestMigrationStateTestMigrationCleanupInProgress, TestMigrationStateTestMigrationFailed, TestMigrationStateTestMigrationInProgress, TestMigrationStateTestMigrationSucceeded} +} + +// VMEncryptionType enumerates the values for vm encryption type. +type VMEncryptionType string + +const ( + // NotEncrypted ... + NotEncrypted VMEncryptionType = "NotEncrypted" + // OnePassEncrypted ... + OnePassEncrypted VMEncryptionType = "OnePassEncrypted" + // TwoPassEncrypted ... + TwoPassEncrypted VMEncryptionType = "TwoPassEncrypted" +) + +// PossibleVMEncryptionTypeValues returns an array of possible values for the VMEncryptionType const type. +func PossibleVMEncryptionTypeValues() []VMEncryptionType { + return []VMEncryptionType{NotEncrypted, OnePassEncrypted, TwoPassEncrypted} +} + +// VMReplicationProgressHealth enumerates the values for vm replication progress health. +type VMReplicationProgressHealth string + +const ( + // VMReplicationProgressHealthInProgress ... + VMReplicationProgressHealthInProgress VMReplicationProgressHealth = "InProgress" + // VMReplicationProgressHealthNone ... + VMReplicationProgressHealthNone VMReplicationProgressHealth = "None" + // VMReplicationProgressHealthNoProgress ... + VMReplicationProgressHealthNoProgress VMReplicationProgressHealth = "NoProgress" + // VMReplicationProgressHealthSlowProgress ... + VMReplicationProgressHealthSlowProgress VMReplicationProgressHealth = "SlowProgress" +) + +// PossibleVMReplicationProgressHealthValues returns an array of possible values for the VMReplicationProgressHealth const type. +func PossibleVMReplicationProgressHealthValues() []VMReplicationProgressHealth { + return []VMReplicationProgressHealth{VMReplicationProgressHealthInProgress, VMReplicationProgressHealthNone, VMReplicationProgressHealthNoProgress, VMReplicationProgressHealthSlowProgress} +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/migrationrecoverypoints.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/migrationrecoverypoints.go new file mode 100644 index 000000000000..0237b68c52ca --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/migrationrecoverypoints.go @@ -0,0 +1,236 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// MigrationRecoveryPointsClient is the client for the MigrationRecoveryPoints methods of the Siterecovery service. +type MigrationRecoveryPointsClient struct { + BaseClient +} + +// NewMigrationRecoveryPointsClient creates an instance of the MigrationRecoveryPointsClient client. +func NewMigrationRecoveryPointsClient(subscriptionID string, resourceGroupName string, resourceName string) MigrationRecoveryPointsClient { + return NewMigrationRecoveryPointsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewMigrationRecoveryPointsClientWithBaseURI creates an instance of the MigrationRecoveryPointsClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewMigrationRecoveryPointsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) MigrationRecoveryPointsClient { + return MigrationRecoveryPointsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get sends the get request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// migrationRecoveryPointName - the migration recovery point name. +func (client MigrationRecoveryPointsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (result MigrationRecoveryPoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, migrationItemName, migrationRecoveryPointName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client MigrationRecoveryPointsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "migrationRecoveryPointName": autorest.Encode("path", migrationRecoveryPointName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints/{migrationRecoveryPointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client MigrationRecoveryPointsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client MigrationRecoveryPointsClient) GetResponder(resp *http.Response) (result MigrationRecoveryPoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationMigrationItems sends the list by replication migration items request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItems(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationRecoveryPointCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.ListByReplicationMigrationItems") + defer func() { + sc := -1 + if result.mrpc.Response.Response != nil { + sc = result.mrpc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationMigrationItemsNextResults + req, err := client.ListByReplicationMigrationItemsPreparer(ctx, fabricName, protectionContainerName, migrationItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationMigrationItemsSender(req) + if err != nil { + result.mrpc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", resp, "Failure sending request") + return + } + + result.mrpc, err = client.ListByReplicationMigrationItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", resp, "Failure responding to request") + return + } + if result.mrpc.hasNextLink() && result.mrpc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationMigrationItemsPreparer prepares the ListByReplicationMigrationItems request. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationMigrationItemsSender sends the ListByReplicationMigrationItems request. The method will close the +// http.Response Body if it receives an error. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationMigrationItemsResponder handles the response to the ListByReplicationMigrationItems request. The method always +// closes the http.Response Body. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsResponder(resp *http.Response) (result MigrationRecoveryPointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationMigrationItemsNextResults retrieves the next set of results, if any. +func (client MigrationRecoveryPointsClient) listByReplicationMigrationItemsNextResults(ctx context.Context, lastResults MigrationRecoveryPointCollection) (result MigrationRecoveryPointCollection, err error) { + req, err := lastResults.migrationRecoveryPointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationMigrationItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationMigrationItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationMigrationItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationRecoveryPointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.ListByReplicationMigrationItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationMigrationItems(ctx, fabricName, protectionContainerName, migrationItemName) + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/models.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/models.go new file mode 100644 index 000000000000..d7112b06f849 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/models.go @@ -0,0 +1,33181 @@ +package siterecovery + +// 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. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-11-01/siterecovery" + +// A2AAddDisksInput a2A add disk(s) input. +type A2AAddDisksInput struct { + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeAddDisksProviderSpecificInput', 'InstanceTypeA2A' + InstanceType InstanceType `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AAddDisksInput. +func (aadi A2AAddDisksInput) MarshalJSON() ([]byte, error) { + aadi.InstanceType = InstanceTypeA2A + objectMap := make(map[string]interface{}) + if aadi.VMDisks != nil { + objectMap["vmDisks"] = aadi.VMDisks + } + if aadi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aadi.VMManagedDisks + } + if aadi.InstanceType != "" { + objectMap["instanceType"] = aadi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AAddDisksInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsA2AAddDisksInput() (*A2AAddDisksInput, bool) { + return &aadi, true +} + +// AsAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsBasicAddDisksProviderSpecificInput() (BasicAddDisksProviderSpecificInput, bool) { + return &aadi, true +} + +// A2AApplyRecoveryPointInput applyRecoveryPoint input specific to A2A provider. +type A2AApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + aarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aarpi.InstanceType != "" { + objectMap["instanceType"] = aarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return &aarpi, true +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &aarpi, true +} + +// A2AContainerCreationInput a2A cloud creation input. +type A2AContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) MarshalJSON() ([]byte, error) { + acci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acci.InstanceType != "" { + objectMap["instanceType"] = acci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return &acci, true +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &acci, true +} + +// A2AContainerMappingInput a2A container mapping input. +type A2AContainerMappingInput struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) MarshalJSON() ([]byte, error) { + acmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acmi.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = acmi.AgentAutoUpdateStatus + } + if acmi.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = acmi.AutomationAccountArmID + } + if acmi.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = acmi.AutomationAccountAuthenticationType + } + if acmi.InstanceType != "" { + objectMap["instanceType"] = acmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return &acmi, true +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &acmi, true +} + +// A2ACreateProtectionIntentInput a2A create protection intent input. +type A2ACreateProtectionIntentInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryLocation - The primary location for the virtual machine. + PrimaryLocation *string `json:"primaryLocation,omitempty"` + // RecoveryLocation - The recovery location for the virtual machine. + RecoveryLocation *string `json:"recoveryLocation,omitempty"` + // RecoverySubscriptionID - The recovery subscription Id of the virtual machine. + RecoverySubscriptionID *string `json:"recoverySubscriptionId,omitempty"` + // RecoveryAvailabilityType - The recovery availability type of the virtual machine. Possible values include: 'Single', 'AvailabilitySet', 'AvailabilityZone' + RecoveryAvailabilityType A2ARecoveryAvailabilityType `json:"recoveryAvailabilityType,omitempty"` + // ProtectionProfileCustomInput - The protection profile custom inputs. + ProtectionProfileCustomInput BasicProtectionProfileCustomDetails `json:"protectionProfileCustomInput,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` + // RecoveryAvailabilitySetCustomInput - The recovery availability set input. + RecoveryAvailabilitySetCustomInput BasicRecoveryAvailabilitySetCustomDetails `json:"recoveryAvailabilitySetCustomInput,omitempty"` + // RecoveryVirtualNetworkCustomInput - The recovery virtual network input. + RecoveryVirtualNetworkCustomInput BasicRecoveryVirtualNetworkCustomDetails `json:"recoveryVirtualNetworkCustomInput,omitempty"` + // RecoveryProximityPlacementGroupCustomInput - The recovery proximity placement group custom input. + RecoveryProximityPlacementGroupCustomInput BasicRecoveryProximityPlacementGroupCustomDetails `json:"recoveryProximityPlacementGroupCustomInput,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // VMDisks - The list of vm disk inputs. + VMDisks *[]A2AProtectionIntentDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk inputs. + VMManagedDisks *[]A2AProtectionIntentManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccount - The boot diagnostic storage account. + RecoveryBootDiagStorageAccount BasicStorageAccountCustomDetails `json:"recoveryBootDiagStorageAccount,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the authentication type for automation account. The default value is "RunAsAccount". Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails', 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) MarshalJSON() ([]byte, error) { + acpii.InstanceType = InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acpii.FabricObjectID != nil { + objectMap["fabricObjectId"] = acpii.FabricObjectID + } + if acpii.PrimaryLocation != nil { + objectMap["primaryLocation"] = acpii.PrimaryLocation + } + if acpii.RecoveryLocation != nil { + objectMap["recoveryLocation"] = acpii.RecoveryLocation + } + if acpii.RecoverySubscriptionID != nil { + objectMap["recoverySubscriptionId"] = acpii.RecoverySubscriptionID + } + if acpii.RecoveryAvailabilityType != "" { + objectMap["recoveryAvailabilityType"] = acpii.RecoveryAvailabilityType + } + objectMap["protectionProfileCustomInput"] = acpii.ProtectionProfileCustomInput + if acpii.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = acpii.RecoveryResourceGroupID + } + objectMap["primaryStagingStorageAccountCustomInput"] = acpii.PrimaryStagingStorageAccountCustomInput + objectMap["recoveryAvailabilitySetCustomInput"] = acpii.RecoveryAvailabilitySetCustomInput + objectMap["recoveryVirtualNetworkCustomInput"] = acpii.RecoveryVirtualNetworkCustomInput + objectMap["recoveryProximityPlacementGroupCustomInput"] = acpii.RecoveryProximityPlacementGroupCustomInput + if acpii.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = acpii.AutoProtectionOfDataDisk + } + if acpii.VMDisks != nil { + objectMap["vmDisks"] = acpii.VMDisks + } + if acpii.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = acpii.VMManagedDisks + } + if acpii.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = acpii.MultiVMGroupName + } + if acpii.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = acpii.MultiVMGroupID + } + objectMap["recoveryBootDiagStorageAccount"] = acpii.RecoveryBootDiagStorageAccount + if acpii.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = acpii.DiskEncryptionInfo + } + if acpii.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = acpii.RecoveryAvailabilityZone + } + if acpii.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = acpii.AgentAutoUpdateStatus + } + if acpii.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = acpii.AutomationAccountAuthenticationType + } + if acpii.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = acpii.AutomationAccountArmID + } + if acpii.InstanceType != "" { + objectMap["instanceType"] = acpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACreateProtectionIntentInput is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) { + return &acpii, true +} + +// AsCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsBasicCreateProtectionIntentProviderSpecificDetails() (BasicCreateProtectionIntentProviderSpecificDetails, bool) { + return &acpii, true +} + +// UnmarshalJSON is the custom unmarshaler for A2ACreateProtectionIntentInput struct. +func (acpii *A2ACreateProtectionIntentInput) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "fabricObjectId": + if v != nil { + var fabricObjectID string + err = json.Unmarshal(*v, &fabricObjectID) + if err != nil { + return err + } + acpii.FabricObjectID = &fabricObjectID + } + case "primaryLocation": + if v != nil { + var primaryLocation string + err = json.Unmarshal(*v, &primaryLocation) + if err != nil { + return err + } + acpii.PrimaryLocation = &primaryLocation + } + case "recoveryLocation": + if v != nil { + var recoveryLocation string + err = json.Unmarshal(*v, &recoveryLocation) + if err != nil { + return err + } + acpii.RecoveryLocation = &recoveryLocation + } + case "recoverySubscriptionId": + if v != nil { + var recoverySubscriptionID string + err = json.Unmarshal(*v, &recoverySubscriptionID) + if err != nil { + return err + } + acpii.RecoverySubscriptionID = &recoverySubscriptionID + } + case "recoveryAvailabilityType": + if v != nil { + var recoveryAvailabilityType A2ARecoveryAvailabilityType + err = json.Unmarshal(*v, &recoveryAvailabilityType) + if err != nil { + return err + } + acpii.RecoveryAvailabilityType = recoveryAvailabilityType + } + case "protectionProfileCustomInput": + if v != nil { + protectionProfileCustomInput, err := unmarshalBasicProtectionProfileCustomDetails(*v) + if err != nil { + return err + } + acpii.ProtectionProfileCustomInput = protectionProfileCustomInput + } + case "recoveryResourceGroupId": + if v != nil { + var recoveryResourceGroupID string + err = json.Unmarshal(*v, &recoveryResourceGroupID) + if err != nil { + return err + } + acpii.RecoveryResourceGroupID = &recoveryResourceGroupID + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + acpii.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + case "recoveryAvailabilitySetCustomInput": + if v != nil { + recoveryAvailabilitySetCustomInput, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryAvailabilitySetCustomInput = recoveryAvailabilitySetCustomInput + } + case "recoveryVirtualNetworkCustomInput": + if v != nil { + recoveryVirtualNetworkCustomInput, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryVirtualNetworkCustomInput = recoveryVirtualNetworkCustomInput + } + case "recoveryProximityPlacementGroupCustomInput": + if v != nil { + recoveryProximityPlacementGroupCustomInput, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryProximityPlacementGroupCustomInput = recoveryProximityPlacementGroupCustomInput + } + case "autoProtectionOfDataDisk": + if v != nil { + var autoProtectionOfDataDisk AutoProtectionOfDataDisk + err = json.Unmarshal(*v, &autoProtectionOfDataDisk) + if err != nil { + return err + } + acpii.AutoProtectionOfDataDisk = autoProtectionOfDataDisk + } + case "vmDisks": + if v != nil { + var VMDisks []A2AProtectionIntentDiskInputDetails + err = json.Unmarshal(*v, &VMDisks) + if err != nil { + return err + } + acpii.VMDisks = &VMDisks + } + case "vmManagedDisks": + if v != nil { + var VMManagedDisks []A2AProtectionIntentManagedDiskInputDetails + err = json.Unmarshal(*v, &VMManagedDisks) + if err != nil { + return err + } + acpii.VMManagedDisks = &VMManagedDisks + } + case "multiVmGroupName": + if v != nil { + var multiVMGroupName string + err = json.Unmarshal(*v, &multiVMGroupName) + if err != nil { + return err + } + acpii.MultiVMGroupName = &multiVMGroupName + } + case "multiVmGroupId": + if v != nil { + var multiVMGroupID string + err = json.Unmarshal(*v, &multiVMGroupID) + if err != nil { + return err + } + acpii.MultiVMGroupID = &multiVMGroupID + } + case "recoveryBootDiagStorageAccount": + if v != nil { + recoveryBootDiagStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryBootDiagStorageAccount = recoveryBootDiagStorageAccount + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + acpii.DiskEncryptionInfo = &diskEncryptionInfo + } + case "recoveryAvailabilityZone": + if v != nil { + var recoveryAvailabilityZone string + err = json.Unmarshal(*v, &recoveryAvailabilityZone) + if err != nil { + return err + } + acpii.RecoveryAvailabilityZone = &recoveryAvailabilityZone + } + case "agentAutoUpdateStatus": + if v != nil { + var agentAutoUpdateStatus AgentAutoUpdateStatus + err = json.Unmarshal(*v, &agentAutoUpdateStatus) + if err != nil { + return err + } + acpii.AgentAutoUpdateStatus = agentAutoUpdateStatus + } + case "automationAccountAuthenticationType": + if v != nil { + var automationAccountAuthenticationType AutomationAccountAuthenticationType + err = json.Unmarshal(*v, &automationAccountAuthenticationType) + if err != nil { + return err + } + acpii.AutomationAccountAuthenticationType = automationAccountAuthenticationType + } + case "automationAccountArmId": + if v != nil { + var automationAccountArmID string + err = json.Unmarshal(*v, &automationAccountArmID) + if err != nil { + return err + } + acpii.AutomationAccountArmID = &automationAccountArmID + } + case "instanceType": + if v != nil { + var instanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails + err = json.Unmarshal(*v, &instanceType) + if err != nil { + return err + } + acpii.InstanceType = instanceType + } + } + } + + return nil +} + +// A2ACrossClusterMigrationApplyRecoveryPointInput applyRecoveryPoint input specific to +// A2ACrossClusterMigration provider. +type A2ACrossClusterMigrationApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + accmarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmarpi.InstanceType != "" { + objectMap["instanceType"] = accmarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return &accmarpi, true +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &accmarpi, true +} + +// A2ACrossClusterMigrationContainerCreationInput a2ACrossClusterMigration cloud creation input. +type A2ACrossClusterMigrationContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) MarshalJSON() ([]byte, error) { + accmcci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmcci.InstanceType != "" { + objectMap["instanceType"] = accmcci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return &accmcci, true +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &accmcci, true +} + +// A2ACrossClusterMigrationEnableProtectionInput a2A Cross-Cluster Migration enable protection input. +type A2ACrossClusterMigrationEnableProtectionInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) MarshalJSON() ([]byte, error) { + accmepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmepi.FabricObjectID != nil { + objectMap["fabricObjectId"] = accmepi.FabricObjectID + } + if accmepi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = accmepi.RecoveryContainerID + } + if accmepi.InstanceType != "" { + objectMap["instanceType"] = accmepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return &accmepi, true +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &accmepi, true +} + +// A2ACrossClusterMigrationPolicyCreationInput a2A Cross-Cluster Migration Policy creation input. +type A2ACrossClusterMigrationPolicyCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) MarshalJSON() ([]byte, error) { + accmpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmpci.InstanceType != "" { + objectMap["instanceType"] = accmpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return &accmpci, true +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &accmpci, true +} + +// A2ACrossClusterMigrationReplicationDetails a2A provider specific settings. +type A2ACrossClusterMigrationReplicationDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryFabricLocation - Primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // OsType - The type of operating system. + OsType *string `json:"osType,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // LifecycleID - An id associated with the PE 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 item even though other internal Ids/ARM Id might be changing. + LifecycleID *string `json:"lifecycleId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) MarshalJSON() ([]byte, error) { + accmrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmrd.FabricObjectID != nil { + objectMap["fabricObjectId"] = accmrd.FabricObjectID + } + if accmrd.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = accmrd.PrimaryFabricLocation + } + if accmrd.OsType != nil { + objectMap["osType"] = accmrd.OsType + } + if accmrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = accmrd.VMProtectionState + } + if accmrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = accmrd.VMProtectionStateDescription + } + if accmrd.LifecycleID != nil { + objectMap["lifecycleId"] = accmrd.LifecycleID + } + if accmrd.InstanceType != "" { + objectMap["instanceType"] = accmrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return &accmrd, true +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &accmrd, true +} + +// A2AEnableProtectionInput a2A enable protection input. +type A2AEnableProtectionInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryExtendedLocation - The recovery extended location. + RecoveryExtendedLocation *ExtendedLocation `json:"recoveryExtendedLocation,omitempty"` + // RecoveryAzureNetworkID - The recovery Azure virtual network ARM id. + RecoveryAzureNetworkID *string `json:"recoveryAzureNetworkId,omitempty"` + // RecoverySubnetName - The recovery subnet name. + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + // RecoveryVirtualMachineScaleSetID - The virtual machine scale set Id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) MarshalJSON() ([]byte, error) { + aepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aepi.FabricObjectID != nil { + objectMap["fabricObjectId"] = aepi.FabricObjectID + } + if aepi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = aepi.RecoveryContainerID + } + if aepi.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aepi.RecoveryResourceGroupID + } + if aepi.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aepi.RecoveryCloudServiceID + } + if aepi.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = aepi.RecoveryAvailabilitySetID + } + if aepi.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aepi.RecoveryProximityPlacementGroupID + } + if aepi.VMDisks != nil { + objectMap["vmDisks"] = aepi.VMDisks + } + if aepi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aepi.VMManagedDisks + } + if aepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = aepi.MultiVMGroupName + } + if aepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = aepi.MultiVMGroupID + } + if aepi.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aepi.RecoveryBootDiagStorageAccountID + } + if aepi.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aepi.DiskEncryptionInfo + } + if aepi.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = aepi.RecoveryAvailabilityZone + } + if aepi.RecoveryExtendedLocation != nil { + objectMap["recoveryExtendedLocation"] = aepi.RecoveryExtendedLocation + } + if aepi.RecoveryAzureNetworkID != nil { + objectMap["recoveryAzureNetworkId"] = aepi.RecoveryAzureNetworkID + } + if aepi.RecoverySubnetName != nil { + objectMap["recoverySubnetName"] = aepi.RecoverySubnetName + } + if aepi.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aepi.RecoveryVirtualMachineScaleSetID + } + if aepi.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = aepi.RecoveryCapacityReservationGroupID + } + if aepi.InstanceType != "" { + objectMap["instanceType"] = aepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return &aepi, true +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &aepi, true +} + +// A2AEventDetails model class for event details of a A2A event. +type A2AEventDetails struct { + // ProtectedItemName - The protected item arm name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // FabricObjectID - The azure vm arm id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // FabricName - Fabric arm name. + FabricName *string `json:"fabricName,omitempty"` + // FabricLocation - The fabric location. + FabricLocation *string `json:"fabricLocation,omitempty"` + // RemoteFabricName - Remote fabric arm name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // RemoteFabricLocation - Remote fabric location. + RemoteFabricLocation *string `json:"remoteFabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AEventDetails. +func (aed A2AEventDetails) MarshalJSON() ([]byte, error) { + aed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aed.ProtectedItemName != nil { + objectMap["protectedItemName"] = aed.ProtectedItemName + } + if aed.FabricObjectID != nil { + objectMap["fabricObjectId"] = aed.FabricObjectID + } + if aed.FabricName != nil { + objectMap["fabricName"] = aed.FabricName + } + if aed.FabricLocation != nil { + objectMap["fabricLocation"] = aed.FabricLocation + } + if aed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = aed.RemoteFabricName + } + if aed.RemoteFabricLocation != nil { + objectMap["remoteFabricLocation"] = aed.RemoteFabricLocation + } + if aed.InstanceType != "" { + objectMap["instanceType"] = aed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return &aed, true +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &aed, true +} + +// A2APolicyCreationInput a2A Policy creation input. +type A2APolicyCreationInput struct { + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) MarshalJSON() ([]byte, error) { + apci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apci.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = apci.RecoveryPointHistory + } + if apci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = apci.CrashConsistentFrequencyInMinutes + } + if apci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = apci.AppConsistentFrequencyInMinutes + } + if apci.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = apci.MultiVMSyncStatus + } + if apci.InstanceType != "" { + objectMap["instanceType"] = apci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return &apci, true +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &apci, true +} + +// A2APolicyDetails a2A specific policy details. +type A2APolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2APolicyDetails. +func (apd A2APolicyDetails) MarshalJSON() ([]byte, error) { + apd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = apd.RecoveryPointThresholdInMinutes + } + if apd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = apd.RecoveryPointHistory + } + if apd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = apd.AppConsistentFrequencyInMinutes + } + if apd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = apd.MultiVMSyncStatus + } + if apd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = apd.CrashConsistentFrequencyInMinutes + } + if apd.InstanceType != "" { + objectMap["instanceType"] = apd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return &apd, true +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &apd, true +} + +// A2AProtectedDiskDetails a2A protected disk details. +type A2AProtectedDiskDetails struct { + // DiskURI - The disk uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountID - The recovery disk storage account. + RecoveryAzureStorageAccountID *string `json:"recoveryAzureStorageAccountId,omitempty"` + // PrimaryDiskAzureStorageAccountID - The primary disk storage account. + PrimaryDiskAzureStorageAccountID *string `json:"primaryDiskAzureStorageAccountId,omitempty"` + // RecoveryDiskURI - Recovery disk uri. + RecoveryDiskURI *string `json:"recoveryDiskUri,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // DiskType - The type of disk. + DiskType *string `json:"diskType,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *bool `json:"resyncRequired,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // DataPendingInStagingStorageAccountInMB - The data pending for replication in MB at staging account. + DataPendingInStagingStorageAccountInMB *float64 `json:"dataPendingInStagingStorageAccountInMB,omitempty"` + // DataPendingAtSourceAgentInMB - The data pending at source virtual machine in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // DiskState - The disk state. + DiskState *string `json:"diskState,omitempty"` + // AllowedDiskLevelOperation - The disk level operations list. + AllowedDiskLevelOperation *[]string `json:"allowedDiskLevelOperation,omitempty"` + // IsDiskEncrypted - A value indicating whether vm has encrypted os disk or not. + IsDiskEncrypted *bool `json:"isDiskEncrypted,omitempty"` + // SecretIdentifier - The secret URL / identifier (BEK). + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // DekKeyVaultArmID - The KeyVault resource id for secret (BEK). + DekKeyVaultArmID *string `json:"dekKeyVaultArmId,omitempty"` + // IsDiskKeyEncrypted - A value indicating whether disk key got encrypted or not. + IsDiskKeyEncrypted *bool `json:"isDiskKeyEncrypted,omitempty"` + // KeyIdentifier - The key URL / identifier (KEK). + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KekKeyVaultArmID - The KeyVault resource id for key (KEK). + KekKeyVaultArmID *string `json:"kekKeyVaultArmId,omitempty"` + // FailoverDiskName - The failover name for the managed disk. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The test failover name for the managed disk. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AProtectedManagedDiskDetails a2A protected managed disk details. +type A2AProtectedManagedDiskDetails struct { + // DiskID - The managed disk Arm id. + DiskID *string `json:"diskId,omitempty"` + // RecoveryResourceGroupID - The recovery disk resource group Arm Id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryTargetDiskID - Recovery target disk Arm Id. + RecoveryTargetDiskID *string `json:"recoveryTargetDiskId,omitempty"` + // RecoveryReplicaDiskID - Recovery replica disk Arm Id. + RecoveryReplicaDiskID *string `json:"recoveryReplicaDiskId,omitempty"` + // RecoveryOrignalTargetDiskID - Recovery original target disk Arm Id. + RecoveryOrignalTargetDiskID *string `json:"recoveryOrignalTargetDiskId,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // PrimaryDiskEncryptionSetID - The primary disk encryption set Id. + PrimaryDiskEncryptionSetID *string `json:"primaryDiskEncryptionSetId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // DiskType - The type of disk. + DiskType *string `json:"diskType,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *bool `json:"resyncRequired,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // DataPendingInStagingStorageAccountInMB - The data pending for replication in MB at staging account. + DataPendingInStagingStorageAccountInMB *float64 `json:"dataPendingInStagingStorageAccountInMB,omitempty"` + // DataPendingAtSourceAgentInMB - The data pending at source virtual machine in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // DiskState - The disk state. + DiskState *string `json:"diskState,omitempty"` + // AllowedDiskLevelOperation - The disk level operations list. + AllowedDiskLevelOperation *[]string `json:"allowedDiskLevelOperation,omitempty"` + // IsDiskEncrypted - A value indicating whether vm has encrypted os disk or not. + IsDiskEncrypted *bool `json:"isDiskEncrypted,omitempty"` + // SecretIdentifier - The secret URL / identifier (BEK). + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // DekKeyVaultArmID - The KeyVault resource id for secret (BEK). + DekKeyVaultArmID *string `json:"dekKeyVaultArmId,omitempty"` + // IsDiskKeyEncrypted - A value indicating whether disk key got encrypted or not. + IsDiskKeyEncrypted *bool `json:"isDiskKeyEncrypted,omitempty"` + // KeyIdentifier - The key URL / identifier (KEK). + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KekKeyVaultArmID - The KeyVault resource id for key (KEK). + KekKeyVaultArmID *string `json:"kekKeyVaultArmId,omitempty"` + // FailoverDiskName - The failover name for the managed disk. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The test failover name for the managed disk. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AProtectionContainerMappingDetails a2A provider specific settings. +type A2AProtectionContainerMappingDetails struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // ScheduleName - The schedule arm name. + ScheduleName *string `json:"scheduleName,omitempty"` + // JobScheduleName - The job schedule arm name. + JobScheduleName *string `json:"jobScheduleName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + apcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apcmd.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = apcmd.AgentAutoUpdateStatus + } + if apcmd.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = apcmd.AutomationAccountArmID + } + if apcmd.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = apcmd.AutomationAccountAuthenticationType + } + if apcmd.ScheduleName != nil { + objectMap["scheduleName"] = apcmd.ScheduleName + } + if apcmd.JobScheduleName != nil { + objectMap["jobScheduleName"] = apcmd.JobScheduleName + } + if apcmd.InstanceType != "" { + objectMap["instanceType"] = apcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return &apcmd, true +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &apcmd, true +} + +// A2AProtectionIntentDiskInputDetails azure VM unmanaged disk input details. +type A2AProtectionIntentDiskInputDetails struct { + // DiskURI - The disk Uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountCustomInput - The recovery VHD storage account input. + RecoveryAzureStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"recoveryAzureStorageAccountCustomInput,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for A2AProtectionIntentDiskInputDetails struct. +func (apidid *A2AProtectionIntentDiskInputDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "diskUri": + if v != nil { + var diskURI string + err = json.Unmarshal(*v, &diskURI) + if err != nil { + return err + } + apidid.DiskURI = &diskURI + } + case "recoveryAzureStorageAccountCustomInput": + if v != nil { + recoveryAzureStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apidid.RecoveryAzureStorageAccountCustomInput = recoveryAzureStorageAccountCustomInput + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apidid.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + } + } + + return nil +} + +// A2AProtectionIntentManagedDiskInputDetails azure VM managed disk input details. +type A2AProtectionIntentManagedDiskInputDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` + // RecoveryResourceGroupCustomInput - The recovery resource group input. + RecoveryResourceGroupCustomInput BasicRecoveryResourceGroupCustomDetails `json:"recoveryResourceGroupCustomInput,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for one / single pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for A2AProtectionIntentManagedDiskInputDetails struct. +func (apimdid *A2AProtectionIntentManagedDiskInputDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "diskId": + if v != nil { + var diskID string + err = json.Unmarshal(*v, &diskID) + if err != nil { + return err + } + apimdid.DiskID = &diskID + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apimdid.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + case "recoveryResourceGroupCustomInput": + if v != nil { + recoveryResourceGroupCustomInput, err := unmarshalBasicRecoveryResourceGroupCustomDetails(*v) + if err != nil { + return err + } + apimdid.RecoveryResourceGroupCustomInput = recoveryResourceGroupCustomInput + } + case "recoveryReplicaDiskAccountType": + if v != nil { + var recoveryReplicaDiskAccountType string + err = json.Unmarshal(*v, &recoveryReplicaDiskAccountType) + if err != nil { + return err + } + apimdid.RecoveryReplicaDiskAccountType = &recoveryReplicaDiskAccountType + } + case "recoveryTargetDiskAccountType": + if v != nil { + var recoveryTargetDiskAccountType string + err = json.Unmarshal(*v, &recoveryTargetDiskAccountType) + if err != nil { + return err + } + apimdid.RecoveryTargetDiskAccountType = &recoveryTargetDiskAccountType + } + case "recoveryDiskEncryptionSetId": + if v != nil { + var recoveryDiskEncryptionSetID string + err = json.Unmarshal(*v, &recoveryDiskEncryptionSetID) + if err != nil { + return err + } + apimdid.RecoveryDiskEncryptionSetID = &recoveryDiskEncryptionSetID + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + apimdid.DiskEncryptionInfo = &diskEncryptionInfo + } + } + } + + return nil +} + +// A2ARecoveryPointDetails a2A provider specific recovery point details. +type A2ARecoveryPointDetails struct { + // RecoveryPointSyncType - A value indicating whether the recovery point is multi VM consistent. Possible values include: 'MultiVMSyncRecoveryPoint', 'PerVMRecoveryPoint' + RecoveryPointSyncType RecoveryPointSyncType `json:"recoveryPointSyncType,omitempty"` + // Disks - List of disk ids representing a recovery point. + Disks *[]string `json:"disks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) MarshalJSON() ([]byte, error) { + arpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if arpd.RecoveryPointSyncType != "" { + objectMap["recoveryPointSyncType"] = arpd.RecoveryPointSyncType + } + if arpd.Disks != nil { + objectMap["disks"] = arpd.Disks + } + if arpd.InstanceType != "" { + objectMap["instanceType"] = arpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return &arpd, true +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &arpd, true +} + +// A2ARemoveDisksInput a2A remove disk(s) input. +type A2ARemoveDisksInput struct { + // VMDisksUris - The list of vm disk vhd URIs. + VMDisksUris *[]string `json:"vmDisksUris,omitempty"` + // VMManagedDisksIds - The list of vm managed disk Ids. + VMManagedDisksIds *[]string `json:"vmManagedDisksIds,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput', 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRemoveDisksProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) MarshalJSON() ([]byte, error) { + ardi.InstanceType = InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ardi.VMDisksUris != nil { + objectMap["vmDisksUris"] = ardi.VMDisksUris + } + if ardi.VMManagedDisksIds != nil { + objectMap["vmManagedDisksIds"] = ardi.VMManagedDisksIds + } + if ardi.InstanceType != "" { + objectMap["instanceType"] = ardi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARemoveDisksInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) { + return &ardi, true +} + +// AsRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsBasicRemoveDisksProviderSpecificInput() (BasicRemoveDisksProviderSpecificInput, bool) { + return &ardi, true +} + +// A2AReplicationDetails a2A provider specific settings. +type A2AReplicationDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // InitialPrimaryZone - READ-ONLY; The initial primary availability zone. + InitialPrimaryZone *string `json:"initialPrimaryZone,omitempty"` + // InitialPrimaryFabricLocation - READ-ONLY; The initial primary fabric location. + InitialPrimaryFabricLocation *string `json:"initialPrimaryFabricLocation,omitempty"` + // InitialRecoveryZone - READ-ONLY; The initial recovery availability zone. + InitialRecoveryZone *string `json:"initialRecoveryZone,omitempty"` + // InitialPrimaryExtendedLocation - The initial primary extended location. + InitialPrimaryExtendedLocation *ExtendedLocation `json:"initialPrimaryExtendedLocation,omitempty"` + // InitialRecoveryExtendedLocation - The initial recovery extended location. + InitialRecoveryExtendedLocation *ExtendedLocation `json:"initialRecoveryExtendedLocation,omitempty"` + // InitialRecoveryFabricLocation - READ-ONLY; The initial recovery fabric location. + InitialRecoveryFabricLocation *string `json:"initialRecoveryFabricLocation,omitempty"` + // MultiVMGroupID - The multi vm group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupCreateOption - Whether Multi VM group is auto created or specified by user. Possible values include: 'AutoCreated', 'UserSpecified' + MultiVMGroupCreateOption MultiVMGroupCreateOption `json:"multiVmGroupCreateOption,omitempty"` + // ManagementID - The management Id. + ManagementID *string `json:"managementId,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]A2AProtectedDiskDetails `json:"protectedDisks,omitempty"` + // UnprotectedDisks - The list of unprotected disks. + UnprotectedDisks *[]A2AUnprotectedDiskDetails `json:"unprotectedDisks,omitempty"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]A2AProtectedManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // RecoveryBootDiagStorageAccountID - The recovery boot diagnostic storage account Arm Id. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // PrimaryFabricLocation - Primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // RecoveryFabricLocation - The recovery fabric location. + RecoveryFabricLocation *string `json:"recoveryFabricLocation,omitempty"` + // OsType - The type of operating system. + OsType *string `json:"osType,omitempty"` + // RecoveryAzureVMSize - The size of recovery virtual machine. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureVMName - The name of recovery virtual machine. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureResourceGroupID - The recovery resource group. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryCloudService - The recovery cloud service. + RecoveryCloudService *string `json:"recoveryCloudService,omitempty"` + // RecoveryAvailabilitySet - The recovery availability set. + RecoveryAvailabilitySet *string `json:"recoveryAvailabilitySet,omitempty"` + // SelectedRecoveryAzureNetworkID - The recovery virtual network. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The test failover virtual network. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // VMNics - The virtual machine nic details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMSyncedConfigDetails - The synced configuration details. + VMSyncedConfigDetails *AzureToAzureVMSyncedConfigDetails `json:"vmSyncedConfigDetails,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // IsReplicationAgentUpdateRequired - A value indicating whether replication agent update is required. + IsReplicationAgentUpdateRequired *bool `json:"isReplicationAgentUpdateRequired,omitempty"` + // AgentCertificateExpiryDate - READ-ONLY; Agent certificate expiry date. + AgentCertificateExpiryDate *date.Time `json:"agentCertificateExpiryDate,omitempty"` + // IsReplicationAgentCertificateUpdateRequired - A value indicating whether agent certificate update is required. + IsReplicationAgentCertificateUpdateRequired *bool `json:"isReplicationAgentCertificateUpdateRequired,omitempty"` + // RecoveryFabricObjectID - The recovery fabric object Id. + RecoveryFabricObjectID *string `json:"recoveryFabricObjectId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // LifecycleID - An id associated with the PE 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 item even though other internal Ids/ARM Id might be changing. + LifecycleID *string `json:"lifecycleId,omitempty"` + // TestFailoverRecoveryFabricObjectID - The test failover fabric object Id. + TestFailoverRecoveryFabricObjectID *string `json:"testFailoverRecoveryFabricObjectId,omitempty"` + // RpoInSeconds - The last RPO value in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // LastRpoCalculatedTime - The time (in UTC) when the last RPO value was calculated by Protection Service. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // PrimaryAvailabilityZone - The primary availability zone. + PrimaryAvailabilityZone *string `json:"primaryAvailabilityZone,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // PrimaryExtendedLocation - The primary Extended Location. + PrimaryExtendedLocation *ExtendedLocation `json:"primaryExtendedLocation,omitempty"` + // RecoveryExtendedLocation - The recovery Extended Location. + RecoveryExtendedLocation *ExtendedLocation `json:"recoveryExtendedLocation,omitempty"` + // VMEncryptionType - READ-ONLY; The encryption type of the VM. Possible values include: 'NotEncrypted', 'OnePassEncrypted', 'TwoPassEncrypted' + VMEncryptionType VMEncryptionType `json:"vmEncryptionType,omitempty"` + // TfoAzureVMName - The test failover vm name. + TfoAzureVMName *string `json:"tfoAzureVMName,omitempty"` + // RecoveryAzureGeneration - READ-ONLY; The recovery azure generation. + RecoveryAzureGeneration *string `json:"recoveryAzureGeneration,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // RecoveryVirtualMachineScaleSetID - The recovery virtual machine scale set id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReplicationDetails. +func (ard A2AReplicationDetails) MarshalJSON() ([]byte, error) { + ard.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ard.FabricObjectID != nil { + objectMap["fabricObjectId"] = ard.FabricObjectID + } + if ard.InitialPrimaryExtendedLocation != nil { + objectMap["initialPrimaryExtendedLocation"] = ard.InitialPrimaryExtendedLocation + } + if ard.InitialRecoveryExtendedLocation != nil { + objectMap["initialRecoveryExtendedLocation"] = ard.InitialRecoveryExtendedLocation + } + if ard.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = ard.MultiVMGroupID + } + if ard.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = ard.MultiVMGroupName + } + if ard.MultiVMGroupCreateOption != "" { + objectMap["multiVmGroupCreateOption"] = ard.MultiVMGroupCreateOption + } + if ard.ManagementID != nil { + objectMap["managementId"] = ard.ManagementID + } + if ard.ProtectedDisks != nil { + objectMap["protectedDisks"] = ard.ProtectedDisks + } + if ard.UnprotectedDisks != nil { + objectMap["unprotectedDisks"] = ard.UnprotectedDisks + } + if ard.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = ard.ProtectedManagedDisks + } + if ard.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = ard.RecoveryBootDiagStorageAccountID + } + if ard.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = ard.PrimaryFabricLocation + } + if ard.RecoveryFabricLocation != nil { + objectMap["recoveryFabricLocation"] = ard.RecoveryFabricLocation + } + if ard.OsType != nil { + objectMap["osType"] = ard.OsType + } + if ard.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = ard.RecoveryAzureVMSize + } + if ard.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVMName"] = ard.RecoveryAzureVMName + } + if ard.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = ard.RecoveryAzureResourceGroupID + } + if ard.RecoveryCloudService != nil { + objectMap["recoveryCloudService"] = ard.RecoveryCloudService + } + if ard.RecoveryAvailabilitySet != nil { + objectMap["recoveryAvailabilitySet"] = ard.RecoveryAvailabilitySet + } + if ard.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = ard.SelectedRecoveryAzureNetworkID + } + if ard.SelectedTfoAzureNetworkID != nil { + objectMap["selectedTfoAzureNetworkId"] = ard.SelectedTfoAzureNetworkID + } + if ard.VMNics != nil { + objectMap["vmNics"] = ard.VMNics + } + if ard.VMSyncedConfigDetails != nil { + objectMap["vmSyncedConfigDetails"] = ard.VMSyncedConfigDetails + } + if ard.MonitoringPercentageCompletion != nil { + objectMap["monitoringPercentageCompletion"] = ard.MonitoringPercentageCompletion + } + if ard.MonitoringJobType != nil { + objectMap["monitoringJobType"] = ard.MonitoringJobType + } + if ard.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = ard.LastHeartbeat + } + if ard.AgentVersion != nil { + objectMap["agentVersion"] = ard.AgentVersion + } + if ard.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = ard.AgentExpiryDate + } + if ard.IsReplicationAgentUpdateRequired != nil { + objectMap["isReplicationAgentUpdateRequired"] = ard.IsReplicationAgentUpdateRequired + } + if ard.IsReplicationAgentCertificateUpdateRequired != nil { + objectMap["isReplicationAgentCertificateUpdateRequired"] = ard.IsReplicationAgentCertificateUpdateRequired + } + if ard.RecoveryFabricObjectID != nil { + objectMap["recoveryFabricObjectId"] = ard.RecoveryFabricObjectID + } + if ard.VMProtectionState != nil { + objectMap["vmProtectionState"] = ard.VMProtectionState + } + if ard.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = ard.VMProtectionStateDescription + } + if ard.LifecycleID != nil { + objectMap["lifecycleId"] = ard.LifecycleID + } + if ard.TestFailoverRecoveryFabricObjectID != nil { + objectMap["testFailoverRecoveryFabricObjectId"] = ard.TestFailoverRecoveryFabricObjectID + } + if ard.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = ard.RpoInSeconds + } + if ard.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = ard.LastRpoCalculatedTime + } + if ard.PrimaryAvailabilityZone != nil { + objectMap["primaryAvailabilityZone"] = ard.PrimaryAvailabilityZone + } + if ard.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = ard.RecoveryAvailabilityZone + } + if ard.PrimaryExtendedLocation != nil { + objectMap["primaryExtendedLocation"] = ard.PrimaryExtendedLocation + } + if ard.RecoveryExtendedLocation != nil { + objectMap["recoveryExtendedLocation"] = ard.RecoveryExtendedLocation + } + if ard.TfoAzureVMName != nil { + objectMap["tfoAzureVMName"] = ard.TfoAzureVMName + } + if ard.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = ard.RecoveryProximityPlacementGroupID + } + if ard.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = ard.AutoProtectionOfDataDisk + } + if ard.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = ard.RecoveryVirtualMachineScaleSetID + } + if ard.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = ard.RecoveryCapacityReservationGroupID + } + if ard.InstanceType != "" { + objectMap["instanceType"] = ard.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return &ard, true +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &ard, true +} + +// A2AReplicationIntentDetails a2A provider specific settings. +type A2AReplicationIntentDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryLocation - The primary location for the virtual machine. + PrimaryLocation *string `json:"primaryLocation,omitempty"` + // RecoveryLocation - The recovery location for the virtual machine. + RecoveryLocation *string `json:"recoveryLocation,omitempty"` + // RecoverySubscriptionID - The recovery subscription Id of the virtual machine. + RecoverySubscriptionID *string `json:"recoverySubscriptionId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AProtectionIntentDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AProtectionIntentManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ProtectionProfile - The protection profile custom details. + ProtectionProfile BasicProtectionProfileCustomDetails `json:"protectionProfile,omitempty"` + // PrimaryStagingStorageAccount - The primary staging storage account details. + PrimaryStagingStorageAccount BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccount,omitempty"` + // RecoveryAvailabilitySet - The recovery availability set details. + RecoveryAvailabilitySet BasicRecoveryAvailabilitySetCustomDetails `json:"recoveryAvailabilitySet,omitempty"` + // RecoveryVirtualNetwork - The recovery virtual network details. + RecoveryVirtualNetwork BasicRecoveryVirtualNetworkCustomDetails `json:"recoveryVirtualNetwork,omitempty"` + // RecoveryProximityPlacementGroup - The recovery proximity placement group custom details. + RecoveryProximityPlacementGroup BasicRecoveryProximityPlacementGroupCustomDetails `json:"recoveryProximityPlacementGroup,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccount - The boot diagnostic storage account. + RecoveryBootDiagStorageAccount BasicStorageAccountCustomDetails `json:"recoveryBootDiagStorageAccount,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryAvailabilityType - The recovery availability type of the virtual machine. + RecoveryAvailabilityType *string `json:"recoveryAvailabilityType,omitempty"` + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings', 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A' + InstanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) MarshalJSON() ([]byte, error) { + arid.InstanceType = InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if arid.FabricObjectID != nil { + objectMap["fabricObjectId"] = arid.FabricObjectID + } + if arid.PrimaryLocation != nil { + objectMap["primaryLocation"] = arid.PrimaryLocation + } + if arid.RecoveryLocation != nil { + objectMap["recoveryLocation"] = arid.RecoveryLocation + } + if arid.RecoverySubscriptionID != nil { + objectMap["recoverySubscriptionId"] = arid.RecoverySubscriptionID + } + if arid.VMDisks != nil { + objectMap["vmDisks"] = arid.VMDisks + } + if arid.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = arid.VMManagedDisks + } + if arid.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = arid.RecoveryResourceGroupID + } + objectMap["protectionProfile"] = arid.ProtectionProfile + objectMap["primaryStagingStorageAccount"] = arid.PrimaryStagingStorageAccount + objectMap["recoveryAvailabilitySet"] = arid.RecoveryAvailabilitySet + objectMap["recoveryVirtualNetwork"] = arid.RecoveryVirtualNetwork + objectMap["recoveryProximityPlacementGroup"] = arid.RecoveryProximityPlacementGroup + if arid.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = arid.AutoProtectionOfDataDisk + } + if arid.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = arid.MultiVMGroupName + } + if arid.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = arid.MultiVMGroupID + } + objectMap["recoveryBootDiagStorageAccount"] = arid.RecoveryBootDiagStorageAccount + if arid.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = arid.DiskEncryptionInfo + } + if arid.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = arid.RecoveryAvailabilityZone + } + if arid.RecoveryAvailabilityType != nil { + objectMap["recoveryAvailabilityType"] = arid.RecoveryAvailabilityType + } + if arid.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = arid.AgentAutoUpdateStatus + } + if arid.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = arid.AutomationAccountArmID + } + if arid.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = arid.AutomationAccountAuthenticationType + } + if arid.InstanceType != "" { + objectMap["instanceType"] = arid.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReplicationIntentDetails is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) { + return &arid, true +} + +// AsReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsBasicReplicationProtectionIntentProviderSpecificSettings() (BasicReplicationProtectionIntentProviderSpecificSettings, bool) { + return &arid, true +} + +// UnmarshalJSON is the custom unmarshaler for A2AReplicationIntentDetails struct. +func (arid *A2AReplicationIntentDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "fabricObjectId": + if v != nil { + var fabricObjectID string + err = json.Unmarshal(*v, &fabricObjectID) + if err != nil { + return err + } + arid.FabricObjectID = &fabricObjectID + } + case "primaryLocation": + if v != nil { + var primaryLocation string + err = json.Unmarshal(*v, &primaryLocation) + if err != nil { + return err + } + arid.PrimaryLocation = &primaryLocation + } + case "recoveryLocation": + if v != nil { + var recoveryLocation string + err = json.Unmarshal(*v, &recoveryLocation) + if err != nil { + return err + } + arid.RecoveryLocation = &recoveryLocation + } + case "recoverySubscriptionId": + if v != nil { + var recoverySubscriptionID string + err = json.Unmarshal(*v, &recoverySubscriptionID) + if err != nil { + return err + } + arid.RecoverySubscriptionID = &recoverySubscriptionID + } + case "vmDisks": + if v != nil { + var VMDisks []A2AProtectionIntentDiskInputDetails + err = json.Unmarshal(*v, &VMDisks) + if err != nil { + return err + } + arid.VMDisks = &VMDisks + } + case "vmManagedDisks": + if v != nil { + var VMManagedDisks []A2AProtectionIntentManagedDiskInputDetails + err = json.Unmarshal(*v, &VMManagedDisks) + if err != nil { + return err + } + arid.VMManagedDisks = &VMManagedDisks + } + case "recoveryResourceGroupId": + if v != nil { + var recoveryResourceGroupID string + err = json.Unmarshal(*v, &recoveryResourceGroupID) + if err != nil { + return err + } + arid.RecoveryResourceGroupID = &recoveryResourceGroupID + } + case "protectionProfile": + if v != nil { + protectionProfile, err := unmarshalBasicProtectionProfileCustomDetails(*v) + if err != nil { + return err + } + arid.ProtectionProfile = protectionProfile + } + case "primaryStagingStorageAccount": + if v != nil { + primaryStagingStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + arid.PrimaryStagingStorageAccount = primaryStagingStorageAccount + } + case "recoveryAvailabilitySet": + if v != nil { + recoveryAvailabilitySet, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryAvailabilitySet = recoveryAvailabilitySet + } + case "recoveryVirtualNetwork": + if v != nil { + recoveryVirtualNetwork, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryVirtualNetwork = recoveryVirtualNetwork + } + case "recoveryProximityPlacementGroup": + if v != nil { + recoveryProximityPlacementGroup, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryProximityPlacementGroup = recoveryProximityPlacementGroup + } + case "autoProtectionOfDataDisk": + if v != nil { + var autoProtectionOfDataDisk AutoProtectionOfDataDisk + err = json.Unmarshal(*v, &autoProtectionOfDataDisk) + if err != nil { + return err + } + arid.AutoProtectionOfDataDisk = autoProtectionOfDataDisk + } + case "multiVmGroupName": + if v != nil { + var multiVMGroupName string + err = json.Unmarshal(*v, &multiVMGroupName) + if err != nil { + return err + } + arid.MultiVMGroupName = &multiVMGroupName + } + case "multiVmGroupId": + if v != nil { + var multiVMGroupID string + err = json.Unmarshal(*v, &multiVMGroupID) + if err != nil { + return err + } + arid.MultiVMGroupID = &multiVMGroupID + } + case "recoveryBootDiagStorageAccount": + if v != nil { + recoveryBootDiagStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryBootDiagStorageAccount = recoveryBootDiagStorageAccount + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + arid.DiskEncryptionInfo = &diskEncryptionInfo + } + case "recoveryAvailabilityZone": + if v != nil { + var recoveryAvailabilityZone string + err = json.Unmarshal(*v, &recoveryAvailabilityZone) + if err != nil { + return err + } + arid.RecoveryAvailabilityZone = &recoveryAvailabilityZone + } + case "recoveryAvailabilityType": + if v != nil { + var recoveryAvailabilityType string + err = json.Unmarshal(*v, &recoveryAvailabilityType) + if err != nil { + return err + } + arid.RecoveryAvailabilityType = &recoveryAvailabilityType + } + case "agentAutoUpdateStatus": + if v != nil { + var agentAutoUpdateStatus AgentAutoUpdateStatus + err = json.Unmarshal(*v, &agentAutoUpdateStatus) + if err != nil { + return err + } + arid.AgentAutoUpdateStatus = agentAutoUpdateStatus + } + case "automationAccountArmId": + if v != nil { + var automationAccountArmID string + err = json.Unmarshal(*v, &automationAccountArmID) + if err != nil { + return err + } + arid.AutomationAccountArmID = &automationAccountArmID + } + case "automationAccountAuthenticationType": + if v != nil { + var automationAccountAuthenticationType AutomationAccountAuthenticationType + err = json.Unmarshal(*v, &automationAccountAuthenticationType) + if err != nil { + return err + } + arid.AutomationAccountAuthenticationType = automationAccountAuthenticationType + } + case "instanceType": + if v != nil { + var instanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings + err = json.Unmarshal(*v, &instanceType) + if err != nil { + return err + } + arid.InstanceType = instanceType + } + } + } + + return nil +} + +// A2AReprotectInput azure specific reprotect input. +type A2AReprotectInput struct { + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReprotectInput. +func (ari A2AReprotectInput) MarshalJSON() ([]byte, error) { + ari.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ari.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = ari.RecoveryContainerID + } + if ari.VMDisks != nil { + objectMap["vmDisks"] = ari.VMDisks + } + if ari.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = ari.RecoveryResourceGroupID + } + if ari.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = ari.RecoveryCloudServiceID + } + if ari.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = ari.RecoveryAvailabilitySetID + } + if ari.PolicyID != nil { + objectMap["policyId"] = ari.PolicyID + } + if ari.InstanceType != "" { + objectMap["instanceType"] = ari.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return &ari, true +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &ari, true +} + +// A2ASwitchProtectionInput a2A specific switch protection input. +type A2ASwitchProtectionInput struct { + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // RecoveryVirtualMachineScaleSetID - The virtual machine scale set id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput', 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicSwitchProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) MarshalJSON() ([]byte, error) { + aspi.InstanceType = InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aspi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = aspi.RecoveryContainerID + } + if aspi.VMDisks != nil { + objectMap["vmDisks"] = aspi.VMDisks + } + if aspi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aspi.VMManagedDisks + } + if aspi.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aspi.RecoveryResourceGroupID + } + if aspi.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aspi.RecoveryCloudServiceID + } + if aspi.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = aspi.RecoveryAvailabilitySetID + } + if aspi.PolicyID != nil { + objectMap["policyId"] = aspi.PolicyID + } + if aspi.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aspi.RecoveryBootDiagStorageAccountID + } + if aspi.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = aspi.RecoveryAvailabilityZone + } + if aspi.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aspi.RecoveryProximityPlacementGroupID + } + if aspi.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aspi.RecoveryVirtualMachineScaleSetID + } + if aspi.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = aspi.RecoveryCapacityReservationGroupID + } + if aspi.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aspi.DiskEncryptionInfo + } + if aspi.InstanceType != "" { + objectMap["instanceType"] = aspi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ASwitchProtectionInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) { + return &aspi, true +} + +// AsSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsBasicSwitchProtectionProviderSpecificInput() (BasicSwitchProtectionProviderSpecificInput, bool) { + return &aspi, true +} + +// A2ATestFailoverInput a2A provider specific input for test failover. +type A2ATestFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for TFO or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) MarshalJSON() ([]byte, error) { + atfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if atfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = atfi.RecoveryPointID + } + if atfi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = atfi.CloudServiceCreationOption + } + if atfi.InstanceType != "" { + objectMap["instanceType"] = atfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return &atfi, true +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &atfi, true +} + +// A2AUnplannedFailoverInput a2A provider specific input for unplanned failover. +type A2AUnplannedFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for failover or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + aufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = aufi.RecoveryPointID + } + if aufi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = aufi.CloudServiceCreationOption + } + if aufi.InstanceType != "" { + objectMap["instanceType"] = aufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return &aufi, true +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &aufi, true +} + +// A2AUnprotectedDiskDetails a2A unprotected disk details. +type A2AUnprotectedDiskDetails struct { + // DiskLunID - The source lun Id for the data disk. + DiskLunID *int32 `json:"diskLunId,omitempty"` + // DiskAutoProtectionStatus - A value indicating whether the disk auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + DiskAutoProtectionStatus AutoProtectionOfDataDisk `json:"diskAutoProtectionStatus,omitempty"` +} + +// A2AUpdateContainerMappingInput a2A update protection container mapping. +type A2AUpdateContainerMappingInput struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + aucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aucmi.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = aucmi.AgentAutoUpdateStatus + } + if aucmi.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = aucmi.AutomationAccountArmID + } + if aucmi.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = aucmi.AutomationAccountAuthenticationType + } + if aucmi.InstanceType != "" { + objectMap["instanceType"] = aucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return &aucmi, true +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &aucmi, true +} + +// A2AUpdateReplicationProtectedItemInput inMage Azure V2 input to update replication protected item. +type A2AUpdateReplicationProtectedItemInput struct { + // RecoveryCloudServiceID - The target cloud service ARM Id (for V1). + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryResourceGroupID - The target resource group ARM Id (for V2). + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ManagedDiskUpdateDetails - Managed disk update details. + ManagedDiskUpdateDetails *[]A2AVMManagedDiskUpdateDetails `json:"managedDiskUpdateDetails,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // DiskEncryptionInfo - The recovery os disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // TfoAzureVMName - The user given name for Test Failover VM. + TfoAzureVMName *string `json:"tfoAzureVMName,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // RecoveryVirtualMachineScaleSetID - The recovery virtual machine scale set Id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + aurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aurpii.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aurpii.RecoveryCloudServiceID + } + if aurpii.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aurpii.RecoveryResourceGroupID + } + if aurpii.ManagedDiskUpdateDetails != nil { + objectMap["managedDiskUpdateDetails"] = aurpii.ManagedDiskUpdateDetails + } + if aurpii.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aurpii.RecoveryBootDiagStorageAccountID + } + if aurpii.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aurpii.DiskEncryptionInfo + } + if aurpii.TfoAzureVMName != nil { + objectMap["tfoAzureVMName"] = aurpii.TfoAzureVMName + } + if aurpii.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aurpii.RecoveryProximityPlacementGroupID + } + if aurpii.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aurpii.RecoveryVirtualMachineScaleSetID + } + if aurpii.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = aurpii.RecoveryCapacityReservationGroupID + } + if aurpii.InstanceType != "" { + objectMap["instanceType"] = aurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return &aurpii, true +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &aurpii, true +} + +// A2AVMDiskInputDetails a2A disk input details. +type A2AVMDiskInputDetails struct { + // DiskURI - The disk Uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountID - The recovery VHD storage account Id. + RecoveryAzureStorageAccountID *string `json:"recoveryAzureStorageAccountId,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account Id. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` +} + +// A2AVMManagedDiskInputDetails a2A managed disk input details. +type A2AVMManagedDiskInputDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account Arm Id. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // RecoveryResourceGroupID - The target resource group Arm Id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for one / single pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` +} + +// A2AVMManagedDiskUpdateDetails a2A Vm managed disk update details. +type A2AVMManagedDiskUpdateDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type before failover. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type before failover. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // DiskEncryptionInfo - The recovery os disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // FailoverDiskName - The target disk name for unplanned failover operation. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The target disk name for test failover operation. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AZoneDetails zone details data. +type A2AZoneDetails struct { + // Source - Source zone info. + Source *string `json:"source,omitempty"` + // Target - The target zone info. + Target *string `json:"target,omitempty"` +} + +// AddDisksInput input for add disk(s) operation. +type AddDisksInput struct { + // Properties - Add disks input properties. + Properties *AddDisksInputProperties `json:"properties,omitempty"` +} + +// AddDisksInputProperties add Disks input properties. +type AddDisksInputProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicAddDisksProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AddDisksInputProperties struct. +func (adip *AddDisksInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicAddDisksProviderSpecificInput(*v) + if err != nil { + return err + } + adip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicAddDisksProviderSpecificInput add Disks provider specific input. +type BasicAddDisksProviderSpecificInput interface { + AsA2AAddDisksInput() (*A2AAddDisksInput, bool) + AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) +} + +// AddDisksProviderSpecificInput add Disks provider specific input. +type AddDisksProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeAddDisksProviderSpecificInput', 'InstanceTypeA2A' + InstanceType InstanceType `json:"instanceType,omitempty"` +} + +func unmarshalBasicAddDisksProviderSpecificInput(body []byte) (BasicAddDisksProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeA2A): + var aadi A2AAddDisksInput + err := json.Unmarshal(body, &aadi) + return aadi, err + default: + var adpsi AddDisksProviderSpecificInput + err := json.Unmarshal(body, &adpsi) + return adpsi, err + } +} +func unmarshalBasicAddDisksProviderSpecificInputArray(body []byte) ([]BasicAddDisksProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + adpsiArray := make([]BasicAddDisksProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + adpsi, err := unmarshalBasicAddDisksProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + adpsiArray[index] = adpsi + } + return adpsiArray, nil +} + +// MarshalJSON is the custom marshaler for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) MarshalJSON() ([]byte, error) { + adpsi.InstanceType = InstanceTypeAddDisksProviderSpecificInput + objectMap := make(map[string]interface{}) + if adpsi.InstanceType != "" { + objectMap["instanceType"] = adpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AAddDisksInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsA2AAddDisksInput() (*A2AAddDisksInput, bool) { + return nil, false +} + +// AsAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) { + return &adpsi, true +} + +// AsBasicAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsBasicAddDisksProviderSpecificInput() (BasicAddDisksProviderSpecificInput, bool) { + return &adpsi, true +} + +// AddRecoveryServicesProviderInput input required to add a provider. +type AddRecoveryServicesProviderInput struct { + // Properties - The properties of an add provider request. + Properties *AddRecoveryServicesProviderInputProperties `json:"properties,omitempty"` +} + +// AddRecoveryServicesProviderInputProperties the properties of an add provider request. +type AddRecoveryServicesProviderInputProperties struct { + // MachineName - The name of the machine where the provider is getting added. + MachineName *string `json:"machineName,omitempty"` + // MachineID - The Id of the machine where the provider is getting added. + MachineID *string `json:"machineId,omitempty"` + // BiosID - The Bios Id of the machine. + BiosID *string `json:"biosId,omitempty"` + // AuthenticationIdentityInput - The identity provider input for DRA authentication. + AuthenticationIdentityInput *IdentityProviderInput `json:"authenticationIdentityInput,omitempty"` + // ResourceAccessIdentityInput - The identity provider input for resource access. + ResourceAccessIdentityInput *IdentityProviderInput `json:"resourceAccessIdentityInput,omitempty"` + // DataPlaneAuthenticationIdentityInput - The identity provider input for data plane authentication. + DataPlaneAuthenticationIdentityInput *IdentityProviderInput `json:"dataPlaneAuthenticationIdentityInput,omitempty"` +} + +// AddVCenterRequest input required to add vCenter. +type AddVCenterRequest struct { + // Properties - The properties of an add vCenter request. + Properties *AddVCenterRequestProperties `json:"properties,omitempty"` +} + +// AddVCenterRequestProperties the properties of an add vCenter request. +type AddVCenterRequestProperties struct { + // FriendlyName - The friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the vCenter to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // ProcessServerID - The process server Id from where the discovery is orchestrated. + ProcessServerID *string `json:"processServerId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The account Id which has privileges to discover the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// AgentDetails agent details. +type AgentDetails struct { + // AgentID - READ-ONLY; The Id of the agent running on the server. + AgentID *string `json:"agentId,omitempty"` + // MachineID - READ-ONLY; The Id of the machine to which the agent is registered. + MachineID *string `json:"machineId,omitempty"` + // BiosID - READ-ONLY; The machine BIOS Id. + BiosID *string `json:"biosId,omitempty"` + // Fqdn - READ-ONLY; The machine FQDN. + Fqdn *string `json:"fqdn,omitempty"` + // Disks - READ-ONLY; The disks. + Disks *[]AgentDiskDetails `json:"disks,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentDetails. +func (ad AgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AgentDiskDetails agent disk details. +type AgentDiskDetails struct { + // DiskID - READ-ONLY; The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LunID - READ-ONLY; The lun of disk. + LunID *int32 `json:"lunId,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentDiskDetails. +func (add AgentDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Alert implements the Alert class. +type Alert struct { + autorest.Response `json:"-"` + // Properties - Alert related data. + Properties *AlertProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Alert. +func (a Alert) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.Properties != nil { + objectMap["properties"] = a.Properties + } + if a.Location != nil { + objectMap["location"] = a.Location + } + return json.Marshal(objectMap) +} + +// AlertCollection collection of alerts. +type AlertCollection struct { + autorest.Response `json:"-"` + // Value - The list of alerts. + Value *[]Alert `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// AlertCollectionIterator provides access to a complete listing of Alert values. +type AlertCollectionIterator struct { + i int + page AlertCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AlertCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AlertCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AlertCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AlertCollectionIterator) Response() AlertCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AlertCollectionIterator) Value() Alert { + if !iter.page.NotDone() { + return Alert{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AlertCollectionIterator type. +func NewAlertCollectionIterator(page AlertCollectionPage) AlertCollectionIterator { + return AlertCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ac AlertCollection) IsEmpty() bool { + return ac.Value == nil || len(*ac.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ac AlertCollection) hasNextLink() bool { + return ac.NextLink != nil && len(*ac.NextLink) != 0 +} + +// alertCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ac AlertCollection) alertCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ac.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ac.NextLink))) +} + +// AlertCollectionPage contains a page of Alert values. +type AlertCollectionPage struct { + fn func(context.Context, AlertCollection) (AlertCollection, error) + ac AlertCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AlertCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ac) + if err != nil { + return err + } + page.ac = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AlertCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AlertCollectionPage) NotDone() bool { + return !page.ac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AlertCollectionPage) Response() AlertCollection { + return page.ac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AlertCollectionPage) Values() []Alert { + if page.ac.IsEmpty() { + return nil + } + return *page.ac.Value +} + +// Creates a new instance of the AlertCollectionPage type. +func NewAlertCollectionPage(cur AlertCollection, getNextPage func(context.Context, AlertCollection) (AlertCollection, error)) AlertCollectionPage { + return AlertCollectionPage{ + fn: getNextPage, + ac: cur, + } +} + +// AlertProperties the properties of an alert. +type AlertProperties struct { + // SendToOwners - A value indicating whether to send email to subscription administrator. + SendToOwners *string `json:"sendToOwners,omitempty"` + // CustomEmailAddresses - The custom email address for sending emails. + CustomEmailAddresses *[]string `json:"customEmailAddresses,omitempty"` + // Locale - The locale for the email notification. + Locale *string `json:"locale,omitempty"` +} + +// ApplianceCollection collection of appliance details. +type ApplianceCollection struct { + autorest.Response `json:"-"` + // Value - The appliance details. + Value *[]ReplicationAppliance `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ApplianceCollectionIterator provides access to a complete listing of ReplicationAppliance values. +type ApplianceCollectionIterator struct { + i int + page ApplianceCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ApplianceCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplianceCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ApplianceCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ApplianceCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ApplianceCollectionIterator) Response() ApplianceCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ApplianceCollectionIterator) Value() ReplicationAppliance { + if !iter.page.NotDone() { + return ReplicationAppliance{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ApplianceCollectionIterator type. +func NewApplianceCollectionIterator(page ApplianceCollectionPage) ApplianceCollectionIterator { + return ApplianceCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ac ApplianceCollection) IsEmpty() bool { + return ac.Value == nil || len(*ac.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ac ApplianceCollection) hasNextLink() bool { + return ac.NextLink != nil && len(*ac.NextLink) != 0 +} + +// applianceCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ac ApplianceCollection) applianceCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ac.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ac.NextLink))) +} + +// ApplianceCollectionPage contains a page of ReplicationAppliance values. +type ApplianceCollectionPage struct { + fn func(context.Context, ApplianceCollection) (ApplianceCollection, error) + ac ApplianceCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ApplianceCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplianceCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ac) + if err != nil { + return err + } + page.ac = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ApplianceCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ApplianceCollectionPage) NotDone() bool { + return !page.ac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ApplianceCollectionPage) Response() ApplianceCollection { + return page.ac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ApplianceCollectionPage) Values() []ReplicationAppliance { + if page.ac.IsEmpty() { + return nil + } + return *page.ac.Value +} + +// Creates a new instance of the ApplianceCollectionPage type. +func NewApplianceCollectionPage(cur ApplianceCollection, getNextPage func(context.Context, ApplianceCollection) (ApplianceCollection, error)) ApplianceCollectionPage { + return ApplianceCollectionPage{ + fn: getNextPage, + ac: cur, + } +} + +// ApplianceQueryParameter query parameter to get appliance. +type ApplianceQueryParameter struct { + // ProviderType - The providerType to be used for fetching appliance details. + ProviderType *string `json:"providerType,omitempty"` +} + +// BasicApplianceSpecificDetails appliance specific details. +type BasicApplianceSpecificDetails interface { + AsInMageRcmApplianceSpecificDetails() (*InMageRcmApplianceSpecificDetails, bool) + AsApplianceSpecificDetails() (*ApplianceSpecificDetails, bool) +} + +// ApplianceSpecificDetails appliance specific details. +type ApplianceSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeApplianceSpecificDetails', 'InstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplianceSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicApplianceSpecificDetails(body []byte) (BasicApplianceSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInMageRcm): + var imrasd InMageRcmApplianceSpecificDetails + err := json.Unmarshal(body, &imrasd) + return imrasd, err + default: + var asd ApplianceSpecificDetails + err := json.Unmarshal(body, &asd) + return asd, err + } +} +func unmarshalBasicApplianceSpecificDetailsArray(body []byte) ([]BasicApplianceSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + asdArray := make([]BasicApplianceSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + asd, err := unmarshalBasicApplianceSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + asdArray[index] = asd + } + return asdArray, nil +} + +// MarshalJSON is the custom marshaler for ApplianceSpecificDetails. +func (asd ApplianceSpecificDetails) MarshalJSON() ([]byte, error) { + asd.InstanceType = InstanceTypeApplianceSpecificDetails + objectMap := make(map[string]interface{}) + if asd.InstanceType != "" { + objectMap["instanceType"] = asd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageRcmApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for ApplianceSpecificDetails. +func (asd ApplianceSpecificDetails) AsInMageRcmApplianceSpecificDetails() (*InMageRcmApplianceSpecificDetails, bool) { + return nil, false +} + +// AsApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for ApplianceSpecificDetails. +func (asd ApplianceSpecificDetails) AsApplianceSpecificDetails() (*ApplianceSpecificDetails, bool) { + return &asd, true +} + +// AsBasicApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for ApplianceSpecificDetails. +func (asd ApplianceSpecificDetails) AsBasicApplianceSpecificDetails() (BasicApplianceSpecificDetails, bool) { + return &asd, true +} + +// ApplyRecoveryPointInput input to apply recovery point. +type ApplyRecoveryPointInput struct { + // Properties - The input properties to apply recovery point. + Properties *ApplyRecoveryPointInputProperties `json:"properties,omitempty"` +} + +// ApplyRecoveryPointInputProperties input properties to apply recovery point. +type ApplyRecoveryPointInputProperties struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // ProviderSpecificDetails - Provider specific input for applying recovery point. + ProviderSpecificDetails BasicApplyRecoveryPointProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ApplyRecoveryPointInputProperties struct. +func (arpip *ApplyRecoveryPointInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryPointId": + if v != nil { + var recoveryPointID string + err = json.Unmarshal(*v, &recoveryPointID) + if err != nil { + return err + } + arpip.RecoveryPointID = &recoveryPointID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicApplyRecoveryPointProviderSpecificInput(*v) + if err != nil { + return err + } + arpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicApplyRecoveryPointProviderSpecificInput provider specific input for apply recovery point. +type BasicApplyRecoveryPointProviderSpecificInput interface { + AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) + AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) + AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) + AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) + AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) + AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) +} + +// ApplyRecoveryPointProviderSpecificInput provider specific input for apply recovery point. +type ApplyRecoveryPointProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicApplyRecoveryPointProviderSpecificInput(body []byte) (BasicApplyRecoveryPointProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A): + var aarpi A2AApplyRecoveryPointInput + err := json.Unmarshal(body, &aarpi) + return aarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput + err := json.Unmarshal(body, &accmarpi) + return accmarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraarpi HyperVReplicaAzureApplyRecoveryPointInput + err := json.Unmarshal(body, &hvraarpi) + return hvraarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2): + var imavarpi InMageAzureV2ApplyRecoveryPointInput + err := json.Unmarshal(body, &imavarpi) + return imavarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm): + var imrarpi InMageRcmApplyRecoveryPointInput + err := json.Unmarshal(body, &imrarpi) + return imrarpi, err + default: + var arppsi ApplyRecoveryPointProviderSpecificInput + err := json.Unmarshal(body, &arppsi) + return arppsi, err + } +} +func unmarshalBasicApplyRecoveryPointProviderSpecificInputArray(body []byte) ([]BasicApplyRecoveryPointProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + arppsiArray := make([]BasicApplyRecoveryPointProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + arppsi, err := unmarshalBasicApplyRecoveryPointProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + arppsiArray[index] = arppsi + } + return arppsiArray, nil +} + +// MarshalJSON is the custom marshaler for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) MarshalJSON() ([]byte, error) { + arppsi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput + objectMap := make(map[string]interface{}) + if arppsi.InstanceType != "" { + objectMap["instanceType"] = arppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return &arppsi, true +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &arppsi, true +} + +// AsrJobDetails this class represents job details based on specific job type. +type AsrJobDetails struct { + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AsrJobDetails. +func (ajd AsrJobDetails) MarshalJSON() ([]byte, error) { + ajd.InstanceType = InstanceTypeAsrJobDetails + objectMap := make(map[string]interface{}) + if ajd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = ajd.AffectedObjectDetails + } + if ajd.InstanceType != "" { + objectMap["instanceType"] = ajd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return &ajd, true +} + +// AsExportJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &ajd, true +} + +// ASRTask task of the Job. +type ASRTask struct { + // TaskID - The Id. + TaskID *string `json:"taskId,omitempty"` + // Name - The unique Task name. + Name *string `json:"name,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // AllowedActions - The state/actions applicable on this task. + AllowedActions *[]string `json:"allowedActions,omitempty"` + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // State - The State. It is one of these values - NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or Other. + State *string `json:"state,omitempty"` + // StateDescription - The description of the task state. For example - For Succeeded state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. + StateDescription *string `json:"stateDescription,omitempty"` + // TaskType - The type of task. Details in CustomDetails property depend on this type. + TaskType *string `json:"taskType,omitempty"` + // CustomDetails - The custom task details based on the task type. + CustomDetails BasicTaskTypeDetails `json:"customDetails,omitempty"` + // GroupTaskCustomDetails - The custom task details based on the task type, if the task type is GroupTaskDetails or one of the types derived from it. + GroupTaskCustomDetails BasicGroupTaskDetails `json:"groupTaskCustomDetails,omitempty"` + // Errors - The task error details. + Errors *[]JobErrorDetails `json:"errors,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ASRTask struct. +func (at *ASRTask) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "taskId": + if v != nil { + var taskID string + err = json.Unmarshal(*v, &taskID) + if err != nil { + return err + } + at.TaskID = &taskID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + at.Name = &name + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + at.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + at.EndTime = &endTime + } + case "allowedActions": + if v != nil { + var allowedActions []string + err = json.Unmarshal(*v, &allowedActions) + if err != nil { + return err + } + at.AllowedActions = &allowedActions + } + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + at.FriendlyName = &friendlyName + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + at.State = &state + } + case "stateDescription": + if v != nil { + var stateDescription string + err = json.Unmarshal(*v, &stateDescription) + if err != nil { + return err + } + at.StateDescription = &stateDescription + } + case "taskType": + if v != nil { + var taskType string + err = json.Unmarshal(*v, &taskType) + if err != nil { + return err + } + at.TaskType = &taskType + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicTaskTypeDetails(*v) + if err != nil { + return err + } + at.CustomDetails = customDetails + } + case "groupTaskCustomDetails": + if v != nil { + groupTaskCustomDetails, err := unmarshalBasicGroupTaskDetails(*v) + if err != nil { + return err + } + at.GroupTaskCustomDetails = groupTaskCustomDetails + } + case "errors": + if v != nil { + var errorsVar []JobErrorDetails + err = json.Unmarshal(*v, &errorsVar) + if err != nil { + return err + } + at.Errors = &errorsVar + } + } + } + + return nil +} + +// AutomationRunbookTaskDetails this class represents the task details for an automation runbook. +type AutomationRunbookTaskDetails struct { + // Name - The recovery plan task name. + Name *string `json:"name,omitempty"` + // CloudServiceName - The cloud service of the automation runbook account. + CloudServiceName *string `json:"cloudServiceName,omitempty"` + // SubscriptionID - The subscription Id of the automation runbook account. + SubscriptionID *string `json:"subscriptionId,omitempty"` + // AccountName - The automation account name of the runbook. + AccountName *string `json:"accountName,omitempty"` + // RunbookID - The runbook Id. + RunbookID *string `json:"runbookId,omitempty"` + // RunbookName - The runbook name. + RunbookName *string `json:"runbookName,omitempty"` + // JobID - The job Id of the runbook execution. + JobID *string `json:"jobId,omitempty"` + // JobOutput - The execution output of the runbook. + JobOutput *string `json:"jobOutput,omitempty"` + // IsPrimarySideScript - A value indicating whether it is a primary side script or not. + IsPrimarySideScript *bool `json:"isPrimarySideScript,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) MarshalJSON() ([]byte, error) { + artd.InstanceType = InstanceTypeAutomationRunbookTaskDetails + objectMap := make(map[string]interface{}) + if artd.Name != nil { + objectMap["name"] = artd.Name + } + if artd.CloudServiceName != nil { + objectMap["cloudServiceName"] = artd.CloudServiceName + } + if artd.SubscriptionID != nil { + objectMap["subscriptionId"] = artd.SubscriptionID + } + if artd.AccountName != nil { + objectMap["accountName"] = artd.AccountName + } + if artd.RunbookID != nil { + objectMap["runbookId"] = artd.RunbookID + } + if artd.RunbookName != nil { + objectMap["runbookName"] = artd.RunbookName + } + if artd.JobID != nil { + objectMap["jobId"] = artd.JobID + } + if artd.JobOutput != nil { + objectMap["jobOutput"] = artd.JobOutput + } + if artd.IsPrimarySideScript != nil { + objectMap["isPrimarySideScript"] = artd.IsPrimarySideScript + } + if artd.InstanceType != "" { + objectMap["instanceType"] = artd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return &artd, true +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &artd, true +} + +// AzureFabricCreationInput fabric provider specific settings. +type AzureFabricCreationInput struct { + // Location - The Location. + Location *string `json:"location,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) MarshalJSON() ([]byte, error) { + afci.InstanceType = InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure + objectMap := make(map[string]interface{}) + if afci.Location != nil { + objectMap["location"] = afci.Location + } + if afci.InstanceType != "" { + objectMap["instanceType"] = afci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return &afci, true +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &afci, true +} + +// AzureFabricSpecificDetails azure Fabric Specific Details. +type AzureFabricSpecificDetails struct { + // Location - The Location for the Azure fabric. + Location *string `json:"location,omitempty"` + // ContainerIds - The container Ids for the Azure fabric. + ContainerIds *[]string `json:"containerIds,omitempty"` + // Zones - The zones. + Zones *[]A2AZoneDetails `json:"zones,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) MarshalJSON() ([]byte, error) { + afsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure + objectMap := make(map[string]interface{}) + if afsd.Location != nil { + objectMap["location"] = afsd.Location + } + if afsd.ContainerIds != nil { + objectMap["containerIds"] = afsd.ContainerIds + } + if afsd.Zones != nil { + objectMap["zones"] = afsd.Zones + } + if afsd.InstanceType != "" { + objectMap["instanceType"] = afsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return &afsd, true +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &afsd, true +} + +// AzureToAzureCreateNetworkMappingInput create network mappings input properties/behavior specific to +// Azure to Azure Network mapping. +type AzureToAzureCreateNetworkMappingInput struct { + // PrimaryNetworkID - The primary azure vnet Id. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + atacnmi.InstanceType = InstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if atacnmi.PrimaryNetworkID != nil { + objectMap["primaryNetworkId"] = atacnmi.PrimaryNetworkID + } + if atacnmi.InstanceType != "" { + objectMap["instanceType"] = atacnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return &atacnmi, true +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &atacnmi, true +} + +// AzureToAzureNetworkMappingSettings a2A Network Mapping fabric specific settings. +type AzureToAzureNetworkMappingSettings struct { + // PrimaryFabricLocation - The primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // RecoveryFabricLocation - The recovery fabric location. + RecoveryFabricLocation *string `json:"recoveryFabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) MarshalJSON() ([]byte, error) { + atanms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if atanms.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = atanms.PrimaryFabricLocation + } + if atanms.RecoveryFabricLocation != nil { + objectMap["recoveryFabricLocation"] = atanms.RecoveryFabricLocation + } + if atanms.InstanceType != "" { + objectMap["instanceType"] = atanms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return &atanms, true +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &atanms, true +} + +// AzureToAzureUpdateNetworkMappingInput updates network mappings input. +type AzureToAzureUpdateNetworkMappingInput struct { + // PrimaryNetworkID - The primary azure vnet Id. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + ataunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if ataunmi.PrimaryNetworkID != nil { + objectMap["primaryNetworkId"] = ataunmi.PrimaryNetworkID + } + if ataunmi.InstanceType != "" { + objectMap["instanceType"] = ataunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return &ataunmi, true +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &ataunmi, true +} + +// AzureToAzureVMSyncedConfigDetails azure to Azure VM synced configuration details. +type AzureToAzureVMSyncedConfigDetails struct { + // Tags - The Azure VM tags. + Tags map[string]*string `json:"tags"` + // InputEndpoints - The Azure VM input endpoints. + InputEndpoints *[]InputEndpoint `json:"inputEndpoints,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureVMSyncedConfigDetails. +func (atavscd AzureToAzureVMSyncedConfigDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if atavscd.Tags != nil { + objectMap["tags"] = atavscd.Tags + } + if atavscd.InputEndpoints != nil { + objectMap["inputEndpoints"] = atavscd.InputEndpoints + } + return json.Marshal(objectMap) +} + +// AzureVMDiskDetails disk details for E2A provider. +type AzureVMDiskDetails struct { + // VhdType - VHD type. + VhdType *string `json:"vhdType,omitempty"` + // VhdID - The VHD id. + VhdID *string `json:"vhdId,omitempty"` + // DiskID - The disk resource id. + DiskID *string `json:"diskId,omitempty"` + // VhdName - VHD name. + VhdName *string `json:"vhdName,omitempty"` + // MaxSizeMB - Max side in MB. + MaxSizeMB *string `json:"maxSizeMB,omitempty"` + // TargetDiskLocation - Blob uri of the Azure disk. + TargetDiskLocation *string `json:"targetDiskLocation,omitempty"` + // TargetDiskName - The target Azure disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` + // LunID - Ordinal\LunId of the disk for the Azure VM. + LunID *string `json:"lunId,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // CustomTargetDiskName - The custom target Azure disk name. + CustomTargetDiskName *string `json:"customTargetDiskName,omitempty"` +} + +// ComputeSizeErrorDetails represents the error used to indicate why the target compute size is not +// applicable. +type ComputeSizeErrorDetails struct { + // Message - The error message. + Message *string `json:"message,omitempty"` + // Severity - The severity of the error. + Severity *string `json:"severity,omitempty"` +} + +// BasicConfigurationSettings replication provider specific settings. +type BasicConfigurationSettings interface { + AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) + AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) + AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) + AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) + AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) + AsConfigurationSettings() (*ConfigurationSettings, bool) +} + +// ConfigurationSettings replication provider specific settings. +type ConfigurationSettings struct { + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicConfigurationSettings(body []byte) (BasicConfigurationSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeHyperVVirtualMachine): + var hvvmd HyperVVirtualMachineDetails + err := json.Unmarshal(body, &hvvmd) + return hvvmd, err + case string(InstanceTypeReplicationGroupDetails): + var rgd ReplicationGroupDetails + err := json.Unmarshal(body, &rgd) + return rgd, err + case string(InstanceTypeVmmVirtualMachine): + var vvmd VmmVirtualMachineDetails + err := json.Unmarshal(body, &vvmd) + return vvmd, err + case string(InstanceTypeVMwareVirtualMachine): + var vmvmd VMwareVirtualMachineDetails + err := json.Unmarshal(body, &vmvmd) + return vmvmd, err + default: + var cs ConfigurationSettings + err := json.Unmarshal(body, &cs) + return cs, err + } +} +func unmarshalBasicConfigurationSettingsArray(body []byte) ([]BasicConfigurationSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + csArray := make([]BasicConfigurationSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cs, err := unmarshalBasicConfigurationSettings(*rawMessage) + if err != nil { + return nil, err + } + csArray[index] = cs + } + return csArray, nil +} + +// MarshalJSON is the custom marshaler for ConfigurationSettings. +func (cs ConfigurationSettings) MarshalJSON() ([]byte, error) { + cs.InstanceType = InstanceTypeConfigurationSettings + objectMap := make(map[string]interface{}) + if cs.InstanceType != "" { + objectMap["instanceType"] = cs.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return &cs, true +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &cs, true +} + +// ConfigureAlertRequest request to configure alerts for the system. +type ConfigureAlertRequest struct { + // Properties - The properties of a configure alert request. + Properties *ConfigureAlertRequestProperties `json:"properties,omitempty"` +} + +// ConfigureAlertRequestProperties properties of a configure alert request. +type ConfigureAlertRequestProperties struct { + // SendToOwners - A value indicating whether to send email to subscription administrator. + SendToOwners *string `json:"sendToOwners,omitempty"` + // CustomEmailAddresses - The custom email address for sending emails. + CustomEmailAddresses *[]string `json:"customEmailAddresses,omitempty"` + // Locale - The locale for the email notification. + Locale *string `json:"locale,omitempty"` +} + +// ConsistencyCheckTaskDetails this class contains monitoring details of all the inconsistent Protected +// Entities in Vmm. +type ConsistencyCheckTaskDetails struct { + // VMDetails - The list of inconsistent Vm details. + VMDetails *[]InconsistentVMDetails `json:"vmDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) MarshalJSON() ([]byte, error) { + cctd.InstanceType = InstanceTypeConsistencyCheckTaskDetails + objectMap := make(map[string]interface{}) + if cctd.VMDetails != nil { + objectMap["vmDetails"] = cctd.VMDetails + } + if cctd.InstanceType != "" { + objectMap["instanceType"] = cctd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return &cctd, true +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &cctd, true +} + +// CreateNetworkMappingInput create network mappings input. +type CreateNetworkMappingInput struct { + // Properties - Input properties for creating network mapping. + Properties *CreateNetworkMappingInputProperties `json:"properties,omitempty"` +} + +// CreateNetworkMappingInputProperties common input details for network mapping operation. +type CreateNetworkMappingInputProperties struct { + // RecoveryFabricName - Recovery fabric Name. + RecoveryFabricName *string `json:"recoveryFabricName,omitempty"` + // RecoveryNetworkID - Recovery network Id. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // FabricSpecificDetails - Fabric specific input properties. + FabricSpecificDetails BasicFabricSpecificCreateNetworkMappingInput `json:"fabricSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateNetworkMappingInputProperties struct. +func (cnmip *CreateNetworkMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryFabricName": + if v != nil { + var recoveryFabricName string + err = json.Unmarshal(*v, &recoveryFabricName) + if err != nil { + return err + } + cnmip.RecoveryFabricName = &recoveryFabricName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + cnmip.RecoveryNetworkID = &recoveryNetworkID + } + case "fabricSpecificDetails": + if v != nil { + fabricSpecificDetails, err := unmarshalBasicFabricSpecificCreateNetworkMappingInput(*v) + if err != nil { + return err + } + cnmip.FabricSpecificDetails = fabricSpecificDetails + } + } + } + + return nil +} + +// CreatePolicyInput protection Policy input. +type CreatePolicyInput struct { + // Properties - Policy creation properties. + Properties *CreatePolicyInputProperties `json:"properties,omitempty"` +} + +// CreatePolicyInputProperties policy creation properties. +type CreatePolicyInputProperties struct { + // ProviderSpecificInput - The ReplicationProviderSettings. + ProviderSpecificInput BasicPolicyProviderSpecificInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreatePolicyInputProperties struct. +func (cpip *CreatePolicyInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicPolicyProviderSpecificInput(*v) + if err != nil { + return err + } + cpip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionContainerInput create protection container input. +type CreateProtectionContainerInput struct { + // Properties - Create protection container input properties. + Properties *CreateProtectionContainerInputProperties `json:"properties,omitempty"` +} + +// CreateProtectionContainerInputProperties create protection container input properties. +type CreateProtectionContainerInputProperties struct { + // ProviderSpecificInput - Provider specific inputs for container creation. + ProviderSpecificInput *[]BasicReplicationProviderSpecificContainerCreationInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionContainerInputProperties struct. +func (cpcip *CreateProtectionContainerInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificContainerCreationInputArray(*v) + if err != nil { + return err + } + cpcip.ProviderSpecificInput = &providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionContainerMappingInput configure pairing input. +type CreateProtectionContainerMappingInput struct { + // Properties - Configure protection input properties. + Properties *CreateProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// CreateProtectionContainerMappingInputProperties configure pairing input properties. +type CreateProtectionContainerMappingInputProperties struct { + // TargetProtectionContainerID - The target unique protection container name. + TargetProtectionContainerID *string `json:"targetProtectionContainerId,omitempty"` + // PolicyID - Applicable policy. + PolicyID *string `json:"policyId,omitempty"` + // ProviderSpecificInput - Provider specific input for pairing. + ProviderSpecificInput BasicReplicationProviderSpecificContainerMappingInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionContainerMappingInputProperties struct. +func (cpcmip *CreateProtectionContainerMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetProtectionContainerId": + if v != nil { + var targetProtectionContainerID string + err = json.Unmarshal(*v, &targetProtectionContainerID) + if err != nil { + return err + } + cpcmip.TargetProtectionContainerID = &targetProtectionContainerID + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + cpcmip.PolicyID = &policyID + } + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificContainerMappingInput(*v) + if err != nil { + return err + } + cpcmip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionIntentInput create protection intent input. +type CreateProtectionIntentInput struct { + // Properties - Create protection intent input properties. + Properties *CreateProtectionIntentProperties `json:"properties,omitempty"` +} + +// CreateProtectionIntentProperties create protection intent input properties. +type CreateProtectionIntentProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For A2A provider, it will be A2ACreateProtectionIntentInput object. + ProviderSpecificDetails BasicCreateProtectionIntentProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionIntentProperties struct. +func (cpip *CreateProtectionIntentProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicCreateProtectionIntentProviderSpecificDetails(*v) + if err != nil { + return err + } + cpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicCreateProtectionIntentProviderSpecificDetails create protection intent provider specific input. +type BasicCreateProtectionIntentProviderSpecificDetails interface { + AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) + AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) +} + +// CreateProtectionIntentProviderSpecificDetails create protection intent provider specific input. +type CreateProtectionIntentProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails', 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicCreateProtectionIntentProviderSpecificDetails(body []byte) (BasicCreateProtectionIntentProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A): + var acpii A2ACreateProtectionIntentInput + err := json.Unmarshal(body, &acpii) + return acpii, err + default: + var cpipsd CreateProtectionIntentProviderSpecificDetails + err := json.Unmarshal(body, &cpipsd) + return cpipsd, err + } +} +func unmarshalBasicCreateProtectionIntentProviderSpecificDetailsArray(body []byte) ([]BasicCreateProtectionIntentProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + cpipsdArray := make([]BasicCreateProtectionIntentProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cpipsd, err := unmarshalBasicCreateProtectionIntentProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + cpipsdArray[index] = cpipsd + } + return cpipsdArray, nil +} + +// MarshalJSON is the custom marshaler for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) MarshalJSON() ([]byte, error) { + cpipsd.InstanceType = InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails + objectMap := make(map[string]interface{}) + if cpipsd.InstanceType != "" { + objectMap["instanceType"] = cpipsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACreateProtectionIntentInput is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) { + return nil, false +} + +// AsCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) { + return &cpipsd, true +} + +// AsBasicCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsBasicCreateProtectionIntentProviderSpecificDetails() (BasicCreateProtectionIntentProviderSpecificDetails, bool) { + return &cpipsd, true +} + +// CreateRecoveryPlanInput create recovery plan input class. +type CreateRecoveryPlanInput struct { + // Properties - Recovery plan creation properties. + Properties *CreateRecoveryPlanInputProperties `json:"properties,omitempty"` +} + +// CreateRecoveryPlanInputProperties recovery plan creation properties. +type CreateRecoveryPlanInputProperties struct { + // PrimaryFabricID - The primary fabric Id. + PrimaryFabricID *string `json:"primaryFabricId,omitempty"` + // RecoveryFabricID - The recovery fabric Id. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // FailoverDeploymentModel - The failover deployment model. Possible values include: 'NotApplicable', 'Classic', 'ResourceManager' + FailoverDeploymentModel FailoverDeploymentModel `json:"failoverDeploymentModel,omitempty"` + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` + // ProviderSpecificInput - The provider specific input. + ProviderSpecificInput *[]BasicRecoveryPlanProviderSpecificInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateRecoveryPlanInputProperties struct. +func (crpip *CreateRecoveryPlanInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "primaryFabricId": + if v != nil { + var primaryFabricID string + err = json.Unmarshal(*v, &primaryFabricID) + if err != nil { + return err + } + crpip.PrimaryFabricID = &primaryFabricID + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + crpip.RecoveryFabricID = &recoveryFabricID + } + case "failoverDeploymentModel": + if v != nil { + var failoverDeploymentModel FailoverDeploymentModel + err = json.Unmarshal(*v, &failoverDeploymentModel) + if err != nil { + return err + } + crpip.FailoverDeploymentModel = failoverDeploymentModel + } + case "groups": + if v != nil { + var groups []RecoveryPlanGroup + err = json.Unmarshal(*v, &groups) + if err != nil { + return err + } + crpip.Groups = &groups + } + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicRecoveryPlanProviderSpecificInputArray(*v) + if err != nil { + return err + } + crpip.ProviderSpecificInput = &providerSpecificInput + } + } + } + + return nil +} + +// CurrentJobDetails current job details of the migration item. +type CurrentJobDetails struct { + // JobName - READ-ONLY; The job name. + JobName *string `json:"jobName,omitempty"` + // JobID - READ-ONLY; The ARM Id of the job being executed. + JobID *string `json:"jobId,omitempty"` + // StartTime - READ-ONLY; The start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for CurrentJobDetails. +func (cjd CurrentJobDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CurrentScenarioDetails current scenario details of the protected entity. +type CurrentScenarioDetails struct { + // ScenarioName - Scenario name. + ScenarioName *string `json:"scenarioName,omitempty"` + // JobID - ARM Id of the job being executed. + JobID *string `json:"jobId,omitempty"` + // StartTime - Start time of the workflow. + StartTime *date.Time `json:"startTime,omitempty"` +} + +// DataStore the datastore details of the MT. +type DataStore struct { + // SymbolicName - The symbolic name of data store. + SymbolicName *string `json:"symbolicName,omitempty"` + // UUID - The uuid of data store. + UUID *string `json:"uuid,omitempty"` + // Capacity - The capacity of data store in GBs. + Capacity *string `json:"capacity,omitempty"` + // FreeSpace - The free space of data store in GBs. + FreeSpace *string `json:"freeSpace,omitempty"` + // Type - The type of data store. + Type *string `json:"type,omitempty"` +} + +// DisableProtectionInput disable protection input. +type DisableProtectionInput struct { + // Properties - Disable protection input properties. + Properties *DisableProtectionInputProperties `json:"properties,omitempty"` +} + +// DisableProtectionInputProperties disable protection input properties. +type DisableProtectionInputProperties struct { + // DisableProtectionReason - Disable protection reason. It can have values NotSpecified/MigrationComplete. Possible values include: 'NotSpecified', 'MigrationComplete' + DisableProtectionReason DisableProtectionReason `json:"disableProtectionReason,omitempty"` + // ReplicationProviderInput - Replication provider specific input. + ReplicationProviderInput BasicDisableProtectionProviderSpecificInput `json:"replicationProviderInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DisableProtectionInputProperties struct. +func (dpip *DisableProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "disableProtectionReason": + if v != nil { + var disableProtectionReason DisableProtectionReason + err = json.Unmarshal(*v, &disableProtectionReason) + if err != nil { + return err + } + dpip.DisableProtectionReason = disableProtectionReason + } + case "replicationProviderInput": + if v != nil { + replicationProviderInput, err := unmarshalBasicDisableProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + dpip.ReplicationProviderInput = replicationProviderInput + } + } + } + + return nil +} + +// BasicDisableProtectionProviderSpecificInput disable protection provider specific input. +type BasicDisableProtectionProviderSpecificInput interface { + AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) + AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) +} + +// DisableProtectionProviderSpecificInput disable protection provider specific input. +type DisableProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeDisableProtectionProviderSpecificInput', 'InstanceTypeInMage' + InstanceType InstanceTypeBasicDisableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicDisableProtectionProviderSpecificInput(body []byte) (BasicDisableProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInMage): + var imdppsi InMageDisableProtectionProviderSpecificInput + err := json.Unmarshal(body, &imdppsi) + return imdppsi, err + default: + var dppsi DisableProtectionProviderSpecificInput + err := json.Unmarshal(body, &dppsi) + return dppsi, err + } +} +func unmarshalBasicDisableProtectionProviderSpecificInputArray(body []byte) ([]BasicDisableProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dppsiArray := make([]BasicDisableProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + dppsi, err := unmarshalBasicDisableProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + dppsiArray[index] = dppsi + } + return dppsiArray, nil +} + +// MarshalJSON is the custom marshaler for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + dppsi.InstanceType = InstanceTypeDisableProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if dppsi.InstanceType != "" { + objectMap["instanceType"] = dppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) { + return &dppsi, true +} + +// AsBasicDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsBasicDisableProtectionProviderSpecificInput() (BasicDisableProtectionProviderSpecificInput, bool) { + return &dppsi, true +} + +// DiscoverProtectableItemRequest request to add a physical machine as a protectable item in a container. +type DiscoverProtectableItemRequest struct { + // Properties - The properties of a discover protectable item request. + Properties *DiscoverProtectableItemRequestProperties `json:"properties,omitempty"` +} + +// DiscoverProtectableItemRequestProperties discover protectable item properties. +type DiscoverProtectableItemRequestProperties struct { + // FriendlyName - The friendly name of the physical machine. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the physical machine to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // OsType - The OS type on the physical machine. + OsType *string `json:"osType,omitempty"` +} + +// DiskDetails onprem disk details data. +type DiskDetails struct { + // MaxSizeMB - The hard disk max size in MB. + MaxSizeMB *int64 `json:"maxSizeMB,omitempty"` + // VhdType - The type of the volume. + VhdType *string `json:"vhdType,omitempty"` + // VhdID - The VHD Id. + VhdID *string `json:"vhdId,omitempty"` + // VhdName - The VHD name. + VhdName *string `json:"vhdName,omitempty"` +} + +// DiskEncryptionInfo recovery disk encryption info (BEK and KEK). +type DiskEncryptionInfo struct { + // DiskEncryptionKeyInfo - The recovery KeyVault reference for secret. + DiskEncryptionKeyInfo *DiskEncryptionKeyInfo `json:"diskEncryptionKeyInfo,omitempty"` + // KeyEncryptionKeyInfo - The recovery KeyVault reference for key. + KeyEncryptionKeyInfo *KeyEncryptionKeyInfo `json:"keyEncryptionKeyInfo,omitempty"` +} + +// DiskEncryptionKeyInfo disk Encryption Key Information (BitLocker Encryption Key (BEK) on Windows). +type DiskEncryptionKeyInfo struct { + // SecretIdentifier - The secret url / identifier. + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // KeyVaultResourceArmID - The KeyVault resource ARM id for secret. + KeyVaultResourceArmID *string `json:"keyVaultResourceArmId,omitempty"` +} + +// DiskVolumeDetails volume details. +type DiskVolumeDetails struct { + // Label - The volume label. + Label *string `json:"label,omitempty"` + // Name - The volume name. + Name *string `json:"name,omitempty"` +} + +// Display contains the localized display information for this particular operation / action. These value +// will be used by several clients for (1) custom role definitions for RBAC; (2) complex query filters for +// the event service; and (3) audit history / records for management operations. +type Display struct { + // Provider - The provider. The localized friendly form of the resource provider name - it is expected to also include the publisher/company responsible. It should use Title Casing and begin with "Microsoft" for 1st party services. e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". + Provider *string `json:"provider,omitempty"` + // Resource - The resource. The localized friendly form of the resource related to this action/operation - it should match the public documentation for the resource provider. It should use Title Casing. This value should be unique for a particular URL type (e.g. nested types should *not* reuse their parent's display.resource field). e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual Machine VM Sizes" or "Scheduler Jobs". + Resource *string `json:"resource,omitempty"` + // Operation - The operation. The localized friendly name for the operation, as it should be shown to the user. It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use Title Casing. Prescriptive guidance: Read Create or Update Delete 'ActionName'. + Operation *string `json:"operation,omitempty"` + // Description - The description. The localized friendly description for the operation, as it should be shown to the user. It should be thorough, yet concise - it will be used in tool tips and detailed views. Prescriptive guidance for namespaces: Read any 'display.provider' resource Create or Update any 'display.provider' resource Delete any 'display.provider' resource Perform any other action on any 'display.provider' resource Prescriptive guidance for namespaces: Read any 'display.resource' Create or Update any 'display.resource' Delete any 'display.resource' 'ActionName' any 'display.resources'. + Description *string `json:"description,omitempty"` +} + +// DraDetails DRA details. +type DraDetails struct { + // ID - READ-ONLY; The DRA Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The DRA name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The DRA Bios Id. + BiosID *string `json:"biosId,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the DRA. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // ForwardProtectedItemCount - READ-ONLY; The count of protected items which are protected in forward direction. + ForwardProtectedItemCount *int32 `json:"forwardProtectedItemCount,omitempty"` + // ReverseProtectedItemCount - READ-ONLY; The count of protected items which are protected in reverse direction. + ReverseProtectedItemCount *int32 `json:"reverseProtectedItemCount,omitempty"` +} + +// MarshalJSON is the custom marshaler for DraDetails. +func (dd DraDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// EnableMigrationInput enable migration input. +type EnableMigrationInput struct { + // Properties - Enable migration input properties. + Properties *EnableMigrationInputProperties `json:"properties,omitempty"` +} + +// EnableMigrationInputProperties enable migration input properties. +type EnableMigrationInputProperties struct { + // PolicyID - The policy Id. + PolicyID *string `json:"policyId,omitempty"` + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicEnableMigrationProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EnableMigrationInputProperties struct. +func (emip *EnableMigrationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + emip.PolicyID = &policyID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEnableMigrationProviderSpecificInput(*v) + if err != nil { + return err + } + emip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicEnableMigrationProviderSpecificInput enable migration provider specific input. +type BasicEnableMigrationProviderSpecificInput interface { + AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) + AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) +} + +// EnableMigrationProviderSpecificInput enable migration provider specific input. +type EnableMigrationProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeEnableMigrationProviderSpecificInput', 'InstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEnableMigrationProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicEnableMigrationProviderSpecificInput(body []byte) (BasicEnableMigrationProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeVMwareCbt): + var vmcemi VMwareCbtEnableMigrationInput + err := json.Unmarshal(body, &vmcemi) + return vmcemi, err + default: + var empsi EnableMigrationProviderSpecificInput + err := json.Unmarshal(body, &empsi) + return empsi, err + } +} +func unmarshalBasicEnableMigrationProviderSpecificInputArray(body []byte) ([]BasicEnableMigrationProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + empsiArray := make([]BasicEnableMigrationProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + empsi, err := unmarshalBasicEnableMigrationProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + empsiArray[index] = empsi + } + return empsiArray, nil +} + +// MarshalJSON is the custom marshaler for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) MarshalJSON() ([]byte, error) { + empsi.InstanceType = InstanceTypeEnableMigrationProviderSpecificInput + objectMap := make(map[string]interface{}) + if empsi.InstanceType != "" { + objectMap["instanceType"] = empsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtEnableMigrationInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) { + return nil, false +} + +// AsEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) { + return &empsi, true +} + +// AsBasicEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsBasicEnableMigrationProviderSpecificInput() (BasicEnableMigrationProviderSpecificInput, bool) { + return &empsi, true +} + +// EnableProtectionInput enable protection input. +type EnableProtectionInput struct { + // Properties - Enable protection input properties. + Properties *EnableProtectionInputProperties `json:"properties,omitempty"` +} + +// EnableProtectionInputProperties enable protection input properties. +type EnableProtectionInputProperties struct { + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // ProtectableItemID - The protectable item Id. + ProtectableItemID *string `json:"protectableItemId,omitempty"` + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicEnableProtectionProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EnableProtectionInputProperties struct. +func (epip *EnableProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + epip.PolicyID = &policyID + } + case "protectableItemId": + if v != nil { + var protectableItemID string + err = json.Unmarshal(*v, &protectableItemID) + if err != nil { + return err + } + epip.ProtectableItemID = &protectableItemID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEnableProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + epip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicEnableProtectionProviderSpecificInput enable protection provider specific input. +type BasicEnableProtectionProviderSpecificInput interface { + AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) + AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) + AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) + AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) + AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) + AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) + AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) +} + +// EnableProtectionProviderSpecificInput enable protection provider specific input. +type EnableProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicEnableProtectionProviderSpecificInput(body []byte) (BasicEnableProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmepi A2ACrossClusterMigrationEnableProtectionInput + err := json.Unmarshal(body, &accmepi) + return accmepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A): + var aepi A2AEnableProtectionInput + err := json.Unmarshal(body, &aepi) + return aepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraepi HyperVReplicaAzureEnableProtectionInput + err := json.Unmarshal(body, &hvraepi) + return hvraepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2): + var imavepi InMageAzureV2EnableProtectionInput + err := json.Unmarshal(body, &imavepi) + return imavepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage): + var imepi InMageEnableProtectionInput + err := json.Unmarshal(body, &imepi) + return imepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm): + var imrepi InMageRcmEnableProtectionInput + err := json.Unmarshal(body, &imrepi) + return imrepi, err + default: + var eppsi EnableProtectionProviderSpecificInput + err := json.Unmarshal(body, &eppsi) + return eppsi, err + } +} +func unmarshalBasicEnableProtectionProviderSpecificInputArray(body []byte) ([]BasicEnableProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + eppsiArray := make([]BasicEnableProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + eppsi, err := unmarshalBasicEnableProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + eppsiArray[index] = eppsi + } + return eppsiArray, nil +} + +// MarshalJSON is the custom marshaler for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + eppsi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if eppsi.InstanceType != "" { + objectMap["instanceType"] = eppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return &eppsi, true +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &eppsi, true +} + +// EncryptionDetails encryption details for the fabric. +type EncryptionDetails struct { + // KekState - The key encryption key state for the Vmm. + KekState *string `json:"kekState,omitempty"` + // KekCertThumbprint - The key encryption key certificate thumbprint. + KekCertThumbprint *string `json:"kekCertThumbprint,omitempty"` + // KekCertExpiryDate - The key encryption key certificate expiry date. + KekCertExpiryDate *date.Time `json:"kekCertExpiryDate,omitempty"` +} + +// Event implements the Event class. +type Event struct { + autorest.Response `json:"-"` + // Properties - Event related data. + Properties *EventProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Event. +func (e Event) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if e.Properties != nil { + objectMap["properties"] = e.Properties + } + if e.Location != nil { + objectMap["location"] = e.Location + } + return json.Marshal(objectMap) +} + +// EventCollection collection of fabric details. +type EventCollection struct { + autorest.Response `json:"-"` + // Value - The list of events. + Value *[]Event `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// EventCollectionIterator provides access to a complete listing of Event values. +type EventCollectionIterator struct { + i int + page EventCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *EventCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EventCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *EventCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EventCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter EventCollectionIterator) Response() EventCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter EventCollectionIterator) Value() Event { + if !iter.page.NotDone() { + return Event{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the EventCollectionIterator type. +func NewEventCollectionIterator(page EventCollectionPage) EventCollectionIterator { + return EventCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ec EventCollection) IsEmpty() bool { + return ec.Value == nil || len(*ec.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ec EventCollection) hasNextLink() bool { + return ec.NextLink != nil && len(*ec.NextLink) != 0 +} + +// eventCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ec EventCollection) eventCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ec.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ec.NextLink))) +} + +// EventCollectionPage contains a page of Event values. +type EventCollectionPage struct { + fn func(context.Context, EventCollection) (EventCollection, error) + ec EventCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *EventCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EventCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ec) + if err != nil { + return err + } + page.ec = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *EventCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EventCollectionPage) NotDone() bool { + return !page.ec.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EventCollectionPage) Response() EventCollection { + return page.ec +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EventCollectionPage) Values() []Event { + if page.ec.IsEmpty() { + return nil + } + return *page.ec.Value +} + +// Creates a new instance of the EventCollectionPage type. +func NewEventCollectionPage(cur EventCollection, getNextPage func(context.Context, EventCollection) (EventCollection, error)) EventCollectionPage { + return EventCollectionPage{ + fn: getNextPage, + ec: cur, + } +} + +// EventProperties the properties of a monitoring event. +type EventProperties struct { + // EventCode - The Id of the monitoring event. + EventCode *string `json:"eventCode,omitempty"` + // Description - The event name. + Description *string `json:"description,omitempty"` + // EventType - The type of the event. for example: VM Health, Server Health, Job Failure etc. + EventType *string `json:"eventType,omitempty"` + // AffectedObjectFriendlyName - The friendly name of the source of the event on which it is raised (for example, VM, VMM etc). + AffectedObjectFriendlyName *string `json:"affectedObjectFriendlyName,omitempty"` + // AffectedObjectCorrelationID - The affected object correlationId for the event. + AffectedObjectCorrelationID *string `json:"affectedObjectCorrelationId,omitempty"` + // Severity - The severity of the event. + Severity *string `json:"severity,omitempty"` + // TimeOfOccurrence - The time of occurrence of the event. + TimeOfOccurrence *date.Time `json:"timeOfOccurrence,omitempty"` + // FabricID - The ARM ID of the fabric. + FabricID *string `json:"fabricId,omitempty"` + // ProviderSpecificDetails - The provider specific settings. + ProviderSpecificDetails BasicEventProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` + // EventSpecificDetails - The event specific settings. + EventSpecificDetails BasicEventSpecificDetails `json:"eventSpecificDetails,omitempty"` + // HealthErrors - The list of errors / warnings capturing details associated with the issue(s). + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EventProperties struct. +func (ep *EventProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "eventCode": + if v != nil { + var eventCode string + err = json.Unmarshal(*v, &eventCode) + if err != nil { + return err + } + ep.EventCode = &eventCode + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ep.Description = &description + } + case "eventType": + if v != nil { + var eventType string + err = json.Unmarshal(*v, &eventType) + if err != nil { + return err + } + ep.EventType = &eventType + } + case "affectedObjectFriendlyName": + if v != nil { + var affectedObjectFriendlyName string + err = json.Unmarshal(*v, &affectedObjectFriendlyName) + if err != nil { + return err + } + ep.AffectedObjectFriendlyName = &affectedObjectFriendlyName + } + case "affectedObjectCorrelationId": + if v != nil { + var affectedObjectCorrelationID string + err = json.Unmarshal(*v, &affectedObjectCorrelationID) + if err != nil { + return err + } + ep.AffectedObjectCorrelationID = &affectedObjectCorrelationID + } + case "severity": + if v != nil { + var severity string + err = json.Unmarshal(*v, &severity) + if err != nil { + return err + } + ep.Severity = &severity + } + case "timeOfOccurrence": + if v != nil { + var timeOfOccurrence date.Time + err = json.Unmarshal(*v, &timeOfOccurrence) + if err != nil { + return err + } + ep.TimeOfOccurrence = &timeOfOccurrence + } + case "fabricId": + if v != nil { + var fabricID string + err = json.Unmarshal(*v, &fabricID) + if err != nil { + return err + } + ep.FabricID = &fabricID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEventProviderSpecificDetails(*v) + if err != nil { + return err + } + ep.ProviderSpecificDetails = providerSpecificDetails + } + case "eventSpecificDetails": + if v != nil { + eventSpecificDetails, err := unmarshalBasicEventSpecificDetails(*v) + if err != nil { + return err + } + ep.EventSpecificDetails = eventSpecificDetails + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + ep.HealthErrors = &healthErrors + } + } + } + + return nil +} + +// BasicEventProviderSpecificDetails model class for provider specific details for an event. +type BasicEventProviderSpecificDetails interface { + AsA2AEventDetails() (*A2AEventDetails, bool) + AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) + AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) + AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) + AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) + AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) + AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) + AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) + AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) + AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) +} + +// EventProviderSpecificDetails model class for provider specific details for an event. +type EventProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicEventProviderSpecificDetails(body []byte) (BasicEventProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A): + var aed A2AEventDetails + err := json.Unmarshal(body, &aed) + return aed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012): + var hvr2ed HyperVReplica2012EventDetails + err := json.Unmarshal(body, &hvr2ed) + return hvr2ed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2): + var hvr2ed HyperVReplica2012R2EventDetails + err := json.Unmarshal(body, &hvr2ed) + return hvr2ed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure): + var hvraed HyperVReplicaAzureEventDetails + err := json.Unmarshal(body, &hvraed) + return hvraed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails): + var hvrbed HyperVReplicaBaseEventDetails + err := json.Unmarshal(body, &hvrbed) + return hvrbed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2): + var imaved InMageAzureV2EventDetails + err := json.Unmarshal(body, &imaved) + return imaved, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm): + var imred InMageRcmEventDetails + err := json.Unmarshal(body, &imred) + return imred, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback): + var imrfed InMageRcmFailbackEventDetails + err := json.Unmarshal(body, &imrfed) + return imrfed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt): + var vmced VMwareCbtEventDetails + err := json.Unmarshal(body, &vmced) + return vmced, err + default: + var epsd EventProviderSpecificDetails + err := json.Unmarshal(body, &epsd) + return epsd, err + } +} +func unmarshalBasicEventProviderSpecificDetailsArray(body []byte) ([]BasicEventProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + epsdArray := make([]BasicEventProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + epsd, err := unmarshalBasicEventProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + epsdArray[index] = epsd + } + return epsdArray, nil +} + +// MarshalJSON is the custom marshaler for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) MarshalJSON() ([]byte, error) { + epsd.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails + objectMap := make(map[string]interface{}) + if epsd.InstanceType != "" { + objectMap["instanceType"] = epsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return &epsd, true +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &epsd, true +} + +// EventQueryParameter implements the event query parameter. +type EventQueryParameter struct { + // EventCode - The source id of the events to be queried. + EventCode *string `json:"eventCode,omitempty"` + // Severity - The severity of the events to be queried. + Severity *string `json:"severity,omitempty"` + // EventType - The type of the events to be queried. + EventType *string `json:"eventType,omitempty"` + // FabricName - The affected object server id of the events to be queried. + FabricName *string `json:"fabricName,omitempty"` + // AffectedObjectFriendlyName - The affected object name of the events to be queried. + AffectedObjectFriendlyName *string `json:"affectedObjectFriendlyName,omitempty"` + // AffectedObjectCorrelationID - The affected object correlationId for the events to be queried. + AffectedObjectCorrelationID *string `json:"affectedObjectCorrelationId,omitempty"` + // StartTime - The start time of the time range within which the events are to be queried. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time of the time range within which the events are to be queried. + EndTime *date.Time `json:"endTime,omitempty"` +} + +// BasicEventSpecificDetails model class for event specific details for an event. +type BasicEventSpecificDetails interface { + AsJobStatusEventDetails() (*JobStatusEventDetails, bool) + AsEventSpecificDetails() (*EventSpecificDetails, bool) +} + +// EventSpecificDetails model class for event specific details for an event. +type EventSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeEventSpecificDetails', 'InstanceTypeJobStatus' + InstanceType InstanceTypeBasicEventSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicEventSpecificDetails(body []byte) (BasicEventSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeJobStatus): + var jsed JobStatusEventDetails + err := json.Unmarshal(body, &jsed) + return jsed, err + default: + var esd EventSpecificDetails + err := json.Unmarshal(body, &esd) + return esd, err + } +} +func unmarshalBasicEventSpecificDetailsArray(body []byte) ([]BasicEventSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + esdArray := make([]BasicEventSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + esd, err := unmarshalBasicEventSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + esdArray[index] = esd + } + return esdArray, nil +} + +// MarshalJSON is the custom marshaler for EventSpecificDetails. +func (esd EventSpecificDetails) MarshalJSON() ([]byte, error) { + esd.InstanceType = InstanceTypeEventSpecificDetails + objectMap := make(map[string]interface{}) + if esd.InstanceType != "" { + objectMap["instanceType"] = esd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsJobStatusEventDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsJobStatusEventDetails() (*JobStatusEventDetails, bool) { + return nil, false +} + +// AsEventSpecificDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsEventSpecificDetails() (*EventSpecificDetails, bool) { + return &esd, true +} + +// AsBasicEventSpecificDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsBasicEventSpecificDetails() (BasicEventSpecificDetails, bool) { + return &esd, true +} + +// ExistingProtectionProfile existing storage account input. +type ExistingProtectionProfile struct { + // ProtectionProfileID - The protection profile Arm Id. Throw error, if resource does not exists. + ProtectionProfileID *string `json:"protectionProfileId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) MarshalJSON() ([]byte, error) { + epp.ResourceType = ResourceTypeExisting + objectMap := make(map[string]interface{}) + if epp.ProtectionProfileID != nil { + objectMap["protectionProfileId"] = epp.ProtectionProfileID + } + if epp.ResourceType != "" { + objectMap["resourceType"] = epp.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return &epp, true +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return nil, false +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return nil, false +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &epp, true +} + +// ExistingRecoveryAvailabilitySet existing recovery availability set input. +type ExistingRecoveryAvailabilitySet struct { + // RecoveryAvailabilitySetID - The recovery availability set Id. Will throw error, if resource does not exist. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails', 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryAvailabilitySetCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) MarshalJSON() ([]byte, error) { + eras.ResourceType = ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if eras.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = eras.RecoveryAvailabilitySetID + } + if eras.ResourceType != "" { + objectMap["resourceType"] = eras.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryAvailabilitySet is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) { + return &eras, true +} + +// AsRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsBasicRecoveryAvailabilitySetCustomDetails() (BasicRecoveryAvailabilitySetCustomDetails, bool) { + return &eras, true +} + +// ExistingRecoveryProximityPlacementGroup existing recovery proximity placement group input. +type ExistingRecoveryProximityPlacementGroup struct { + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. Will throw error, if resource does not exist. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails', 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) MarshalJSON() ([]byte, error) { + erppg.ResourceType = ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if erppg.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = erppg.RecoveryProximityPlacementGroupID + } + if erppg.ResourceType != "" { + objectMap["resourceType"] = erppg.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryProximityPlacementGroup is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) { + return &erppg, true +} + +// AsRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsBasicRecoveryProximityPlacementGroupCustomDetails() (BasicRecoveryProximityPlacementGroupCustomDetails, bool) { + return &erppg, true +} + +// ExistingRecoveryRecoveryResourceGroup existing recovery resource group input. +type ExistingRecoveryRecoveryResourceGroup struct { + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails', 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryResourceGroupCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) MarshalJSON() ([]byte, error) { + errrg.ResourceType = ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if errrg.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = errrg.RecoveryResourceGroupID + } + if errrg.ResourceType != "" { + objectMap["resourceType"] = errrg.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryRecoveryResourceGroup is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) { + return &errrg, true +} + +// AsRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsBasicRecoveryResourceGroupCustomDetails() (BasicRecoveryResourceGroupCustomDetails, bool) { + return &errrg, true +} + +// ExistingRecoveryVirtualNetwork existing recovery virtual network input. +type ExistingRecoveryVirtualNetwork struct { + // RecoveryVirtualNetworkID - The recovery virtual network Id. Will throw error, if resource does not exist. + RecoveryVirtualNetworkID *string `json:"recoveryVirtualNetworkId,omitempty"` + // RecoverySubnetName - The recovery subnet name. + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) MarshalJSON() ([]byte, error) { + ervn.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if ervn.RecoveryVirtualNetworkID != nil { + objectMap["recoveryVirtualNetworkId"] = ervn.RecoveryVirtualNetworkID + } + if ervn.RecoverySubnetName != nil { + objectMap["recoverySubnetName"] = ervn.RecoverySubnetName + } + if ervn.ResourceType != "" { + objectMap["resourceType"] = ervn.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return &ervn, true +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &ervn, true +} + +// ExistingStorageAccount existing storage account input. +type ExistingStorageAccount struct { + // AzureStorageAccountID - The storage account Arm Id. Throw error, if resource does not exists. + AzureStorageAccountID *string `json:"azureStorageAccountId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails', 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicStorageAccountCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingStorageAccount. +func (esa ExistingStorageAccount) MarshalJSON() ([]byte, error) { + esa.ResourceType = ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if esa.AzureStorageAccountID != nil { + objectMap["azureStorageAccountId"] = esa.AzureStorageAccountID + } + if esa.ResourceType != "" { + objectMap["resourceType"] = esa.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingStorageAccount is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsExistingStorageAccount() (*ExistingStorageAccount, bool) { + return &esa, true +} + +// AsStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) { + return nil, false +} + +// AsBasicStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsBasicStorageAccountCustomDetails() (BasicStorageAccountCustomDetails, bool) { + return &esa, true +} + +// ExportJobDetails this class represents details for export jobs workflow. +type ExportJobDetails struct { + // BlobURI - BlobUri of the exported jobs. + BlobURI *string `json:"blobUri,omitempty"` + // SasToken - The sas token to access blob. + SasToken *string `json:"sasToken,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExportJobDetails. +func (ejd ExportJobDetails) MarshalJSON() ([]byte, error) { + ejd.InstanceType = InstanceTypeExportJobDetails + objectMap := make(map[string]interface{}) + if ejd.BlobURI != nil { + objectMap["blobUri"] = ejd.BlobURI + } + if ejd.SasToken != nil { + objectMap["sasToken"] = ejd.SasToken + } + if ejd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = ejd.AffectedObjectDetails + } + if ejd.InstanceType != "" { + objectMap["instanceType"] = ejd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return &ejd, true +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &ejd, true +} + +// ExtendedLocation extended location of the resource. +type ExtendedLocation struct { + // Name - The name of the extended location. + Name *string `json:"name,omitempty"` + // Type - The extended location type. + Type *string `json:"type,omitempty"` +} + +// Fabric fabric definition. +type Fabric struct { + autorest.Response `json:"-"` + // Properties - Fabric related data. + Properties *FabricProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Fabric. +func (f Fabric) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if f.Properties != nil { + objectMap["properties"] = f.Properties + } + if f.Location != nil { + objectMap["location"] = f.Location + } + return json.Marshal(objectMap) +} + +// FabricCollection collection of fabric details. +type FabricCollection struct { + autorest.Response `json:"-"` + // Value - The fabric details. + Value *[]Fabric `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// FabricCollectionIterator provides access to a complete listing of Fabric values. +type FabricCollectionIterator struct { + i int + page FabricCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *FabricCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FabricCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *FabricCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter FabricCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter FabricCollectionIterator) Response() FabricCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter FabricCollectionIterator) Value() Fabric { + if !iter.page.NotDone() { + return Fabric{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the FabricCollectionIterator type. +func NewFabricCollectionIterator(page FabricCollectionPage) FabricCollectionIterator { + return FabricCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (fc FabricCollection) IsEmpty() bool { + return fc.Value == nil || len(*fc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (fc FabricCollection) hasNextLink() bool { + return fc.NextLink != nil && len(*fc.NextLink) != 0 +} + +// fabricCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (fc FabricCollection) fabricCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !fc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(fc.NextLink))) +} + +// FabricCollectionPage contains a page of Fabric values. +type FabricCollectionPage struct { + fn func(context.Context, FabricCollection) (FabricCollection, error) + fc FabricCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *FabricCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FabricCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.fc) + if err != nil { + return err + } + page.fc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *FabricCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page FabricCollectionPage) NotDone() bool { + return !page.fc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page FabricCollectionPage) Response() FabricCollection { + return page.fc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page FabricCollectionPage) Values() []Fabric { + if page.fc.IsEmpty() { + return nil + } + return *page.fc.Value +} + +// Creates a new instance of the FabricCollectionPage type. +func NewFabricCollectionPage(cur FabricCollection, getNextPage func(context.Context, FabricCollection) (FabricCollection, error)) FabricCollectionPage { + return FabricCollectionPage{ + fn: getNextPage, + fc: cur, + } +} + +// FabricCreationInput site details provided during the time of site creation. +type FabricCreationInput struct { + // Properties - Fabric creation input. + Properties *FabricCreationInputProperties `json:"properties,omitempty"` +} + +// FabricCreationInputProperties properties of site details provided during the time of site creation. +type FabricCreationInputProperties struct { + // CustomDetails - Fabric provider specific creation input. + CustomDetails BasicFabricSpecificCreationInput `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for FabricCreationInputProperties struct. +func (fcip *FabricCreationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicFabricSpecificCreationInput(*v) + if err != nil { + return err + } + fcip.CustomDetails = customDetails + } + } + } + + return nil +} + +// FabricProperties fabric properties. +type FabricProperties struct { + // FriendlyName - Friendly name of the fabric. + FriendlyName *string `json:"friendlyName,omitempty"` + // EncryptionDetails - Encryption details for the fabric. + EncryptionDetails *EncryptionDetails `json:"encryptionDetails,omitempty"` + // RolloverEncryptionDetails - Rollover encryption details for the fabric. + RolloverEncryptionDetails *EncryptionDetails `json:"rolloverEncryptionDetails,omitempty"` + // InternalIdentifier - Dra Registration Id. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // BcdrState - BCDR state of the fabric. + BcdrState *string `json:"bcdrState,omitempty"` + // CustomDetails - Fabric specific settings. + CustomDetails BasicFabricSpecificDetails `json:"customDetails,omitempty"` + // HealthErrorDetails - Fabric health error details. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // Health - Health of fabric. + Health *string `json:"health,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for FabricProperties struct. +func (fp *FabricProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + fp.FriendlyName = &friendlyName + } + case "encryptionDetails": + if v != nil { + var encryptionDetails EncryptionDetails + err = json.Unmarshal(*v, &encryptionDetails) + if err != nil { + return err + } + fp.EncryptionDetails = &encryptionDetails + } + case "rolloverEncryptionDetails": + if v != nil { + var rolloverEncryptionDetails EncryptionDetails + err = json.Unmarshal(*v, &rolloverEncryptionDetails) + if err != nil { + return err + } + fp.RolloverEncryptionDetails = &rolloverEncryptionDetails + } + case "internalIdentifier": + if v != nil { + var internalIdentifier string + err = json.Unmarshal(*v, &internalIdentifier) + if err != nil { + return err + } + fp.InternalIdentifier = &internalIdentifier + } + case "bcdrState": + if v != nil { + var bcdrState string + err = json.Unmarshal(*v, &bcdrState) + if err != nil { + return err + } + fp.BcdrState = &bcdrState + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicFabricSpecificDetails(*v) + if err != nil { + return err + } + fp.CustomDetails = customDetails + } + case "healthErrorDetails": + if v != nil { + var healthErrorDetails []HealthError + err = json.Unmarshal(*v, &healthErrorDetails) + if err != nil { + return err + } + fp.HealthErrorDetails = &healthErrorDetails + } + case "health": + if v != nil { + var health string + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + fp.Health = &health + } + } + } + + return nil +} + +// FabricQueryParameter query parameter to get fabric. +type FabricQueryParameter struct { + // ZoneToZoneMappings - A value indicating whether the zone to zone mappings are to be returned. + ZoneToZoneMappings *string `json:"zoneToZoneMappings,omitempty"` + // FetchAgentDetails - A value indicating whether the agent details are to be fetched. + FetchAgentDetails *string `json:"fetchAgentDetails,omitempty"` + // BiosID - The BIOS Id to be used for fetching agent details. + BiosID *string `json:"biosId,omitempty"` + // Fqdn - The FQDN to be used for fetching agent details. + Fqdn *string `json:"fqdn,omitempty"` + // DiscoveryType - The type of the discovered machine to be used for fetching agent details. + DiscoveryType *string `json:"discoveryType,omitempty"` + // OsType - The OS type to be used for fetching agent details. + OsType *string `json:"osType,omitempty"` +} + +// FabricReplicationGroupTaskDetails this class represents the fabric replication group task details. +type FabricReplicationGroupTaskDetails struct { + // SkippedReason - The skipped reason. + SkippedReason *string `json:"skippedReason,omitempty"` + // SkippedReasonString - The skipped reason string. + SkippedReasonString *string `json:"skippedReasonString,omitempty"` + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) MarshalJSON() ([]byte, error) { + frgtd.InstanceType = InstanceTypeFabricReplicationGroupTaskDetails + objectMap := make(map[string]interface{}) + if frgtd.SkippedReason != nil { + objectMap["skippedReason"] = frgtd.SkippedReason + } + if frgtd.SkippedReasonString != nil { + objectMap["skippedReasonString"] = frgtd.SkippedReasonString + } + if frgtd.JobTask != nil { + objectMap["jobTask"] = frgtd.JobTask + } + if frgtd.InstanceType != "" { + objectMap["instanceType"] = frgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return &frgtd, true +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &frgtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &frgtd, true +} + +// BasicFabricSpecificCreateNetworkMappingInput input details specific to fabrics during Network Mapping. +type BasicFabricSpecificCreateNetworkMappingInput interface { + AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) + AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) + AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) + AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) +} + +// FabricSpecificCreateNetworkMappingInput input details specific to fabrics during Network Mapping. +type FabricSpecificCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificCreateNetworkMappingInput(body []byte) (BasicFabricSpecificCreateNetworkMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAzureToAzure): + var atacnmi AzureToAzureCreateNetworkMappingInput + err := json.Unmarshal(body, &atacnmi) + return atacnmi, err + case string(InstanceTypeVmmToAzure): + var vtacnmi VmmToAzureCreateNetworkMappingInput + err := json.Unmarshal(body, &vtacnmi) + return vtacnmi, err + case string(InstanceTypeVmmToVmm): + var vtvcnmi VmmToVmmCreateNetworkMappingInput + err := json.Unmarshal(body, &vtvcnmi) + return vtvcnmi, err + default: + var fscnmi FabricSpecificCreateNetworkMappingInput + err := json.Unmarshal(body, &fscnmi) + return fscnmi, err + } +} +func unmarshalBasicFabricSpecificCreateNetworkMappingInputArray(body []byte) ([]BasicFabricSpecificCreateNetworkMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fscnmiArray := make([]BasicFabricSpecificCreateNetworkMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fscnmi, err := unmarshalBasicFabricSpecificCreateNetworkMappingInput(*rawMessage) + if err != nil { + return nil, err + } + fscnmiArray[index] = fscnmi + } + return fscnmiArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + fscnmi.InstanceType = InstanceTypeFabricSpecificCreateNetworkMappingInput + objectMap := make(map[string]interface{}) + if fscnmi.InstanceType != "" { + objectMap["instanceType"] = fscnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return &fscnmi, true +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &fscnmi, true +} + +// BasicFabricSpecificCreationInput fabric provider specific settings. +type BasicFabricSpecificCreationInput interface { + AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) + AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) + AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) + AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) +} + +// FabricSpecificCreationInput fabric provider specific settings. +type FabricSpecificCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificCreationInput(body []byte) (BasicFabricSpecificCreationInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure): + var afci AzureFabricCreationInput + err := json.Unmarshal(body, &afci) + return afci, err + case string(InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm): + var imrfci InMageRcmFabricCreationInput + err := json.Unmarshal(body, &imrfci) + return imrfci, err + case string(InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2): + var vmvfci VMwareV2FabricCreationInput + err := json.Unmarshal(body, &vmvfci) + return vmvfci, err + default: + var fsci FabricSpecificCreationInput + err := json.Unmarshal(body, &fsci) + return fsci, err + } +} +func unmarshalBasicFabricSpecificCreationInputArray(body []byte) ([]BasicFabricSpecificCreationInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsciArray := make([]BasicFabricSpecificCreationInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsci, err := unmarshalBasicFabricSpecificCreationInput(*rawMessage) + if err != nil { + return nil, err + } + fsciArray[index] = fsci + } + return fsciArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) MarshalJSON() ([]byte, error) { + fsci.InstanceType = InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput + objectMap := make(map[string]interface{}) + if fsci.InstanceType != "" { + objectMap["instanceType"] = fsci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return &fsci, true +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &fsci, true +} + +// BasicFabricSpecificDetails fabric specific details. +type BasicFabricSpecificDetails interface { + AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) + AsHyperVSiteDetails() (*HyperVSiteDetails, bool) + AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) + AsVmmDetails() (*VmmDetails, bool) + AsVMwareDetails() (*VMwareDetails, bool) + AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) + AsFabricSpecificDetails() (*FabricSpecificDetails, bool) +} + +// FabricSpecificDetails fabric specific details. +type FabricSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificDetails(body []byte) (BasicFabricSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure): + var afsd AzureFabricSpecificDetails + err := json.Unmarshal(body, &afsd) + return afsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite): + var hvsd HyperVSiteDetails + err := json.Unmarshal(body, &hvsd) + return hvsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm): + var imrfsd InMageRcmFabricSpecificDetails + err := json.Unmarshal(body, &imrfsd) + return imrfsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM): + var vd VmmDetails + err := json.Unmarshal(body, &vd) + return vd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware): + var vmd VMwareDetails + err := json.Unmarshal(body, &vmd) + return vmd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2): + var vmvfsd VMwareV2FabricSpecificDetails + err := json.Unmarshal(body, &vmvfsd) + return vmvfsd, err + default: + var fsd FabricSpecificDetails + err := json.Unmarshal(body, &fsd) + return fsd, err + } +} +func unmarshalBasicFabricSpecificDetailsArray(body []byte) ([]BasicFabricSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsdArray := make([]BasicFabricSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsd, err := unmarshalBasicFabricSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + fsdArray[index] = fsd + } + return fsdArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificDetails. +func (fsd FabricSpecificDetails) MarshalJSON() ([]byte, error) { + fsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails + objectMap := make(map[string]interface{}) + if fsd.InstanceType != "" { + objectMap["instanceType"] = fsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return &fsd, true +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &fsd, true +} + +// BasicFabricSpecificUpdateNetworkMappingInput input details specific to fabrics during Network Mapping. +type BasicFabricSpecificUpdateNetworkMappingInput interface { + AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) + AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) + AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) + AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) +} + +// FabricSpecificUpdateNetworkMappingInput input details specific to fabrics during Network Mapping. +type FabricSpecificUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificUpdateNetworkMappingInput(body []byte) (BasicFabricSpecificUpdateNetworkMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure): + var ataunmi AzureToAzureUpdateNetworkMappingInput + err := json.Unmarshal(body, &ataunmi) + return ataunmi, err + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure): + var vtaunmi VmmToAzureUpdateNetworkMappingInput + err := json.Unmarshal(body, &vtaunmi) + return vtaunmi, err + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm): + var vtvunmi VmmToVmmUpdateNetworkMappingInput + err := json.Unmarshal(body, &vtvunmi) + return vtvunmi, err + default: + var fsunmi FabricSpecificUpdateNetworkMappingInput + err := json.Unmarshal(body, &fsunmi) + return fsunmi, err + } +} +func unmarshalBasicFabricSpecificUpdateNetworkMappingInputArray(body []byte) ([]BasicFabricSpecificUpdateNetworkMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsunmiArray := make([]BasicFabricSpecificUpdateNetworkMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsunmi, err := unmarshalBasicFabricSpecificUpdateNetworkMappingInput(*rawMessage) + if err != nil { + return nil, err + } + fsunmiArray[index] = fsunmi + } + return fsunmiArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + fsunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput + objectMap := make(map[string]interface{}) + if fsunmi.InstanceType != "" { + objectMap["instanceType"] = fsunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return &fsunmi, true +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &fsunmi, true +} + +// FailoverJobDetails this class represents the details for a failover job. +type FailoverJobDetails struct { + // ProtectedItemDetails - The test VM details. + ProtectedItemDetails *[]FailoverReplicationProtectedItemDetails `json:"protectedItemDetails,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for FailoverJobDetails. +func (fjd FailoverJobDetails) MarshalJSON() ([]byte, error) { + fjd.InstanceType = InstanceTypeFailoverJobDetails + objectMap := make(map[string]interface{}) + if fjd.ProtectedItemDetails != nil { + objectMap["protectedItemDetails"] = fjd.ProtectedItemDetails + } + if fjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = fjd.AffectedObjectDetails + } + if fjd.InstanceType != "" { + objectMap["instanceType"] = fjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return &fjd, true +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &fjd, true +} + +// FailoverProcessServerRequest request to failover a process server. +type FailoverProcessServerRequest struct { + // Properties - The properties of the PS Failover request. + Properties *FailoverProcessServerRequestProperties `json:"properties,omitempty"` +} + +// FailoverProcessServerRequestProperties the properties of the Failover Process Server request. +type FailoverProcessServerRequestProperties struct { + // ContainerName - The container identifier. + ContainerName *string `json:"containerName,omitempty"` + // SourceProcessServerID - The source process server. + SourceProcessServerID *string `json:"sourceProcessServerId,omitempty"` + // TargetProcessServerID - The new process server. + TargetProcessServerID *string `json:"targetProcessServerId,omitempty"` + // VmsToMigrate - The VMS to migrate. + VmsToMigrate *[]string `json:"vmsToMigrate,omitempty"` + // UpdateType - A value for failover type. It can be systemlevel/serverlevel. + UpdateType *string `json:"updateType,omitempty"` +} + +// FailoverReplicationProtectedItemDetails failover details for a replication protected item. +type FailoverReplicationProtectedItemDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // FriendlyName - The friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // TestVMName - The test Vm name. + TestVMName *string `json:"testVmName,omitempty"` + // TestVMFriendlyName - The test Vm friendly name. + TestVMFriendlyName *string `json:"testVmFriendlyName,omitempty"` + // NetworkConnectionStatus - The network connection status. + NetworkConnectionStatus *string `json:"networkConnectionStatus,omitempty"` + // NetworkFriendlyName - The network friendly name. + NetworkFriendlyName *string `json:"networkFriendlyName,omitempty"` + // Subnet - The network subnet. + Subnet *string `json:"subnet,omitempty"` + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // RecoveryPointTime - The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` +} + +// BasicGroupTaskDetails this class represents the group task details when parent child relationship exists in the +// drill down. +type BasicGroupTaskDetails interface { + AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) + AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) + AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) + AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) + AsGroupTaskDetails() (*GroupTaskDetails, bool) +} + +// GroupTaskDetails this class represents the group task details when parent child relationship exists in the +// drill down. +type GroupTaskDetails struct { + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicGroupTaskDetails(body []byte) (BasicGroupTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInlineWorkflowTaskDetails): + var iwtd InlineWorkflowTaskDetails + err := json.Unmarshal(body, &iwtd) + return iwtd, err + case string(InstanceTypeRecoveryPlanGroupTaskDetails): + var rpgtd RecoveryPlanGroupTaskDetails + err := json.Unmarshal(body, &rpgtd) + return rpgtd, err + case string(InstanceTypeRecoveryPlanShutdownGroupTaskDetails): + var rpsgtd RecoveryPlanShutdownGroupTaskDetails + err := json.Unmarshal(body, &rpsgtd) + return rpsgtd, err + default: + var gtd GroupTaskDetails + err := json.Unmarshal(body, >d) + return gtd, err + } +} +func unmarshalBasicGroupTaskDetailsArray(body []byte) ([]BasicGroupTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + gtdArray := make([]BasicGroupTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + gtd, err := unmarshalBasicGroupTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + gtdArray[index] = gtd + } + return gtdArray, nil +} + +// MarshalJSON is the custom marshaler for GroupTaskDetails. +func (gtd GroupTaskDetails) MarshalJSON() ([]byte, error) { + gtd.InstanceType = InstanceTypeGroupTaskDetails + objectMap := make(map[string]interface{}) + if gtd.ChildTasks != nil { + objectMap["childTasks"] = gtd.ChildTasks + } + if gtd.InstanceType != "" { + objectMap["instanceType"] = gtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return >d, true +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return >d, true +} + +// HealthError health Error. +type HealthError struct { + // InnerHealthErrors - The inner health errors. HealthError having a list of HealthError as child errors is problematic. InnerHealthError is used because this will prevent an infinite loop of structures when Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health errors and all API consumers can utilize this in the same fashion as Exception -> InnerException. + InnerHealthErrors *[]InnerHealthError `json:"innerHealthErrors,omitempty"` + // ErrorSource - Source of error. + ErrorSource *string `json:"errorSource,omitempty"` + // ErrorType - Type of error. + ErrorType *string `json:"errorType,omitempty"` + // ErrorLevel - Level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // ErrorCategory - Category of error. + ErrorCategory *string `json:"errorCategory,omitempty"` + // ErrorCode - Error code. + ErrorCode *string `json:"errorCode,omitempty"` + // SummaryMessage - Summary message of the entity. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // ErrorMessage - Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // CreationTimeUtc - Error creation time (UTC). + CreationTimeUtc *date.Time `json:"creationTimeUtc,omitempty"` + // RecoveryProviderErrorMessage - DRA error message. + RecoveryProviderErrorMessage *string `json:"recoveryProviderErrorMessage,omitempty"` + // EntityID - ID of the entity. + EntityID *string `json:"entityId,omitempty"` + // ErrorID - The health error unique id. + ErrorID *string `json:"errorId,omitempty"` + // CustomerResolvability - Value indicating whether the health error is customer resolvable. Possible values include: 'Allowed', 'NotAllowed' + CustomerResolvability HealthErrorCustomerResolvability `json:"customerResolvability,omitempty"` +} + +// HealthErrorSummary class to define the summary of the health error details. +type HealthErrorSummary struct { + // SummaryCode - The code of the health error. + SummaryCode *string `json:"summaryCode,omitempty"` + // Category - The category of the health error. Possible values include: 'HealthErrorCategoryNone', 'HealthErrorCategoryReplication', 'HealthErrorCategoryTestFailover', 'HealthErrorCategoryConfiguration', 'HealthErrorCategoryFabricInfrastructure', 'HealthErrorCategoryVersionExpiry', 'HealthErrorCategoryAgentAutoUpdateInfra', 'HealthErrorCategoryAgentAutoUpdateArtifactDeleted', 'HealthErrorCategoryAgentAutoUpdateRunAsAccount', 'HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry', 'HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired' + Category HealthErrorCategory `json:"category,omitempty"` + // Severity - Severity of error. Possible values include: 'NONE', 'Warning', 'Error', 'Info' + Severity Severity `json:"severity,omitempty"` + // SummaryMessage - The summary message of the health error. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // AffectedResourceType - The type of affected ARM resource. + AffectedResourceType *string `json:"affectedResourceType,omitempty"` + // AffectedResourceSubtype - The sub type of any subcomponent within the ARM resource that this might be applicable. Value remains null if not applicable. + AffectedResourceSubtype *string `json:"affectedResourceSubtype,omitempty"` + // AffectedResourceCorrelationIds - The list of affected resource correlation Ids. This can be used to uniquely identify the count of items affected by a specific category and severity as well as count of item affected by an specific issue. + AffectedResourceCorrelationIds *[]string `json:"affectedResourceCorrelationIds,omitempty"` +} + +// HyperVHostDetails hyper-V host details. +type HyperVHostDetails struct { + // ID - READ-ONLY; The Hyper-V host Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The Hyper-V host name. + Name *string `json:"name,omitempty"` + // MarsAgentVersion - READ-ONLY; The Mars agent version. + MarsAgentVersion *string `json:"marsAgentVersion,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVHostDetails. +func (hvhd HyperVHostDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// HyperVReplica2012EventDetails model class for event details of a HyperVReplica E2E event. +type HyperVReplica2012EventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) MarshalJSON() ([]byte, error) { + hvr2ed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvr2ed.ContainerName != nil { + objectMap["containerName"] = hvr2ed.ContainerName + } + if hvr2ed.FabricName != nil { + objectMap["fabricName"] = hvr2ed.FabricName + } + if hvr2ed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvr2ed.RemoteContainerName + } + if hvr2ed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvr2ed.RemoteFabricName + } + if hvr2ed.InstanceType != "" { + objectMap["instanceType"] = hvr2ed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return &hvr2ed, true +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvr2ed, true +} + +// HyperVReplica2012R2EventDetails model class for event details of a HyperVReplica blue E2E event. +type HyperVReplica2012R2EventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) MarshalJSON() ([]byte, error) { + hvr2ed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvr2ed.ContainerName != nil { + objectMap["containerName"] = hvr2ed.ContainerName + } + if hvr2ed.FabricName != nil { + objectMap["fabricName"] = hvr2ed.FabricName + } + if hvr2ed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvr2ed.RemoteContainerName + } + if hvr2ed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvr2ed.RemoteFabricName + } + if hvr2ed.InstanceType != "" { + objectMap["instanceType"] = hvr2ed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return &hvr2ed, true +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvr2ed, true +} + +// HyperVReplicaAzureApplyRecoveryPointInput applyRecoveryPoint input specific to HyperVReplicaAzure +// provider. +type HyperVReplicaAzureApplyRecoveryPointInput struct { + // PrimaryKekCertificatePfx - The primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - The secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + hvraarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraarpi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvraarpi.PrimaryKekCertificatePfx + } + if hvraarpi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvraarpi.SecondaryKekCertificatePfx + } + if hvraarpi.InstanceType != "" { + objectMap["instanceType"] = hvraarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return &hvraarpi, true +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &hvraarpi, true +} + +// HyperVReplicaAzureDiskInputDetails disk input details. +type HyperVReplicaAzureDiskInputDetails struct { + // DiskID - The DiskId. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The LogStorageAccountId. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// HyperVReplicaAzureEnableProtectionInput hyperVReplicaAzure specific enable protection input. +type HyperVReplicaAzureEnableProtectionInput struct { + // HvHostVMID - The Hyper-V host VM Id. + HvHostVMID *string `json:"hvHostVmId,omitempty"` + // VMName - The VM Name. + VMName *string `json:"vmName,omitempty"` + // OsType - The OS type associated with VM. + OsType *string `json:"osType,omitempty"` + // VhdID - The OS disk VHD id associated with VM. + VhdID *string `json:"vhdId,omitempty"` + // TargetStorageAccountID - The storage account Id. + TargetStorageAccountID *string `json:"targetStorageAccountId,omitempty"` + // TargetAzureNetworkID - The selected target Azure network Id. + TargetAzureNetworkID *string `json:"targetAzureNetworkId,omitempty"` + // TargetAzureSubnetID - The selected target Azure subnet Id. + TargetAzureSubnetID *string `json:"targetAzureSubnetId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // TargetAzureVMName - The target azure VM Name. + TargetAzureVMName *string `json:"targetAzureVmName,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DisksToInclude - The list of VHD Ids of disks to be protected. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // TargetAzureV1ResourceGroupID - The Id of the target resource group (for classic deployment) in which the failover VM is to be created. + TargetAzureV1ResourceGroupID *string `json:"targetAzureV1ResourceGroupId,omitempty"` + // TargetAzureV2ResourceGroupID - The Id of the target resource group (for resource manager deployment) in which the failover VM is to be created. + TargetAzureV2ResourceGroupID *string `json:"targetAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id for resource manager deployment. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetProximityPlacementGroupID - The proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisksForReplication - A value indicating whether managed disks should be used during replication. + UseManagedDisksForReplication *string `json:"useManagedDisksForReplication,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DisksToIncludeForManagedDisks - The disks to include list for managed disks. + DisksToIncludeForManagedDisks *[]HyperVReplicaAzureDiskInputDetails `json:"disksToIncludeForManagedDisks,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) MarshalJSON() ([]byte, error) { + hvraepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraepi.HvHostVMID != nil { + objectMap["hvHostVmId"] = hvraepi.HvHostVMID + } + if hvraepi.VMName != nil { + objectMap["vmName"] = hvraepi.VMName + } + if hvraepi.OsType != nil { + objectMap["osType"] = hvraepi.OsType + } + if hvraepi.VhdID != nil { + objectMap["vhdId"] = hvraepi.VhdID + } + if hvraepi.TargetStorageAccountID != nil { + objectMap["targetStorageAccountId"] = hvraepi.TargetStorageAccountID + } + if hvraepi.TargetAzureNetworkID != nil { + objectMap["targetAzureNetworkId"] = hvraepi.TargetAzureNetworkID + } + if hvraepi.TargetAzureSubnetID != nil { + objectMap["targetAzureSubnetId"] = hvraepi.TargetAzureSubnetID + } + if hvraepi.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = hvraepi.EnableRdpOnTargetOption + } + if hvraepi.TargetAzureVMName != nil { + objectMap["targetAzureVmName"] = hvraepi.TargetAzureVMName + } + if hvraepi.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = hvraepi.LogStorageAccountID + } + if hvraepi.DisksToInclude != nil { + objectMap["disksToInclude"] = hvraepi.DisksToInclude + } + if hvraepi.TargetAzureV1ResourceGroupID != nil { + objectMap["targetAzureV1ResourceGroupId"] = hvraepi.TargetAzureV1ResourceGroupID + } + if hvraepi.TargetAzureV2ResourceGroupID != nil { + objectMap["targetAzureV2ResourceGroupId"] = hvraepi.TargetAzureV2ResourceGroupID + } + if hvraepi.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvraepi.UseManagedDisks + } + if hvraepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = hvraepi.TargetAvailabilitySetID + } + if hvraepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvraepi.TargetAvailabilityZone + } + if hvraepi.LicenseType != "" { + objectMap["licenseType"] = hvraepi.LicenseType + } + if hvraepi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = hvraepi.SQLServerLicenseType + } + if hvraepi.TargetVMSize != nil { + objectMap["targetVmSize"] = hvraepi.TargetVMSize + } + if hvraepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvraepi.TargetProximityPlacementGroupID + } + if hvraepi.UseManagedDisksForReplication != nil { + objectMap["useManagedDisksForReplication"] = hvraepi.UseManagedDisksForReplication + } + if hvraepi.DiskType != "" { + objectMap["diskType"] = hvraepi.DiskType + } + if hvraepi.DisksToIncludeForManagedDisks != nil { + objectMap["disksToIncludeForManagedDisks"] = hvraepi.DisksToIncludeForManagedDisks + } + if hvraepi.DiskEncryptionSetID != nil { + objectMap["diskEncryptionSetId"] = hvraepi.DiskEncryptionSetID + } + if hvraepi.TargetVMTags != nil { + objectMap["targetVmTags"] = hvraepi.TargetVMTags + } + if hvraepi.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = hvraepi.SeedManagedDiskTags + } + if hvraepi.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvraepi.TargetManagedDiskTags + } + if hvraepi.TargetNicTags != nil { + objectMap["targetNicTags"] = hvraepi.TargetNicTags + } + if hvraepi.InstanceType != "" { + objectMap["instanceType"] = hvraepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return &hvraepi, true +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &hvraepi, true +} + +// HyperVReplicaAzureEventDetails model class for event details of a HyperVReplica E2A event. +type HyperVReplicaAzureEventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) MarshalJSON() ([]byte, error) { + hvraed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraed.ContainerName != nil { + objectMap["containerName"] = hvraed.ContainerName + } + if hvraed.FabricName != nil { + objectMap["fabricName"] = hvraed.FabricName + } + if hvraed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvraed.RemoteContainerName + } + if hvraed.InstanceType != "" { + objectMap["instanceType"] = hvraed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return &hvraed, true +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvraed, true +} + +// HyperVReplicaAzureFailbackProviderInput hyperVReplicaAzureFailback specific planned failover input. +type HyperVReplicaAzureFailbackProviderInput struct { + // DataSyncOption - Data sync option. + DataSyncOption *string `json:"dataSyncOption,omitempty"` + // RecoveryVMCreationOption - ALR options to create alternate recovery. + RecoveryVMCreationOption *string `json:"recoveryVmCreationOption,omitempty"` + // ProviderIDForAlternateRecovery - Provider Id for alternate location. + ProviderIDForAlternateRecovery *string `json:"providerIdForAlternateRecovery,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) MarshalJSON() ([]byte, error) { + hvrafpi.InstanceType = InstanceTypeHyperVReplicaAzureFailback + objectMap := make(map[string]interface{}) + if hvrafpi.DataSyncOption != nil { + objectMap["dataSyncOption"] = hvrafpi.DataSyncOption + } + if hvrafpi.RecoveryVMCreationOption != nil { + objectMap["recoveryVmCreationOption"] = hvrafpi.RecoveryVMCreationOption + } + if hvrafpi.ProviderIDForAlternateRecovery != nil { + objectMap["providerIdForAlternateRecovery"] = hvrafpi.ProviderIDForAlternateRecovery + } + if hvrafpi.InstanceType != "" { + objectMap["instanceType"] = hvrafpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return &hvrafpi, true +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &hvrafpi, true +} + +// HyperVReplicaAzureManagedDiskDetails hyper-V Managed disk details. +type HyperVReplicaAzureManagedDiskDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // SeedManagedDiskID - Seed managed disk Id. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // ReplicaDiskType - The replica disk type. + ReplicaDiskType *string `json:"replicaDiskType,omitempty"` + // DiskEncryptionSetID - The disk encryption set ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// HyperVReplicaAzurePlannedFailoverProviderInput hyperVReplicaAzure specific planned failover input. +type HyperVReplicaAzurePlannedFailoverProviderInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) MarshalJSON() ([]byte, error) { + hvrapfpi.InstanceType = InstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapfpi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvrapfpi.PrimaryKekCertificatePfx + } + if hvrapfpi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvrapfpi.SecondaryKekCertificatePfx + } + if hvrapfpi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvrapfpi.RecoveryPointID + } + if hvrapfpi.InstanceType != "" { + objectMap["instanceType"] = hvrapfpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return &hvrapfpi, true +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &hvrapfpi, true +} + +// HyperVReplicaAzurePolicyDetails hyper-V Replica Azure specific protection profile details. +type HyperVReplicaAzurePolicyDetails struct { + // RecoveryPointHistoryDurationInHours - The duration (in hours) to which point the recovery history needs to be maintained. + RecoveryPointHistoryDurationInHours *int32 `json:"recoveryPointHistoryDurationInHours,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - The interval (in hours) at which Hyper-V Replica should create an application consistent snapshot within the VM. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // ReplicationInterval - The replication interval. + ReplicationInterval *int32 `json:"replicationInterval,omitempty"` + // OnlineReplicationStartTime - The scheduled start time for the initial replication. If this parameter is Null, the initial replication starts immediately. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // Encryption - A value indicating whether encryption is enabled for virtual machines in this cloud. + Encryption *string `json:"encryption,omitempty"` + // ActiveStorageAccountID - The active storage account Id. + ActiveStorageAccountID *string `json:"activeStorageAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) MarshalJSON() ([]byte, error) { + hvrapd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapd.RecoveryPointHistoryDurationInHours != nil { + objectMap["recoveryPointHistoryDurationInHours"] = hvrapd.RecoveryPointHistoryDurationInHours + } + if hvrapd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrapd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrapd.ReplicationInterval != nil { + objectMap["replicationInterval"] = hvrapd.ReplicationInterval + } + if hvrapd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrapd.OnlineReplicationStartTime + } + if hvrapd.Encryption != nil { + objectMap["encryption"] = hvrapd.Encryption + } + if hvrapd.ActiveStorageAccountID != nil { + objectMap["activeStorageAccountId"] = hvrapd.ActiveStorageAccountID + } + if hvrapd.InstanceType != "" { + objectMap["instanceType"] = hvrapd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return &hvrapd, true +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrapd, true +} + +// HyperVReplicaAzurePolicyInput hyper-V Replica Azure specific input for creating a protection profile. +type HyperVReplicaAzurePolicyInput struct { + // RecoveryPointHistoryDuration - The duration (in hours) to which point the recovery history needs to be maintained. + RecoveryPointHistoryDuration *int32 `json:"recoveryPointHistoryDuration,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - The interval (in hours) at which Hyper-V Replica should create an application consistent snapshot within the VM. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // ReplicationInterval - The replication interval. + ReplicationInterval *int32 `json:"replicationInterval,omitempty"` + // OnlineReplicationStartTime - The scheduled start time for the initial replication. If this parameter is Null, the initial replication starts immediately. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // StorageAccounts - The list of storage accounts to which the VMs in the primary cloud can replicate to. + StorageAccounts *[]string `json:"storageAccounts,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) MarshalJSON() ([]byte, error) { + hvrapi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapi.RecoveryPointHistoryDuration != nil { + objectMap["recoveryPointHistoryDuration"] = hvrapi.RecoveryPointHistoryDuration + } + if hvrapi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrapi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrapi.ReplicationInterval != nil { + objectMap["replicationInterval"] = hvrapi.ReplicationInterval + } + if hvrapi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrapi.OnlineReplicationStartTime + } + if hvrapi.StorageAccounts != nil { + objectMap["storageAccounts"] = hvrapi.StorageAccounts + } + if hvrapi.InstanceType != "" { + objectMap["instanceType"] = hvrapi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return &hvrapi, true +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrapi, true +} + +// HyperVReplicaAzureReplicationDetails hyper V Replica Azure provider specific settings. +type HyperVReplicaAzureReplicationDetails struct { + // AzureVMDiskDetails - Azure VM Disk details. + AzureVMDiskDetails *[]AzureVMDiskDetails `json:"azureVmDiskDetails,omitempty"` + // RecoveryAzureVMName - Recovery Azure given name. + RecoveryAzureVMName *string `json:"recoveryAzureVmName,omitempty"` + // RecoveryAzureVMSize - The Recovery Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureStorageAccount - The recovery Azure storage account. + RecoveryAzureStorageAccount *string `json:"recoveryAzureStorageAccount,omitempty"` + // RecoveryAzureLogStorageAccountID - The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. + RecoveryAzureLogStorageAccountID *string `json:"recoveryAzureLogStorageAccountId,omitempty"` + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // RpoInSeconds - Last RPO value. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // SelectedRecoveryAzureNetworkID - The selected recovery azure network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // Encryption - The encryption info. + Encryption *string `json:"encryption,omitempty"` + // OSDetails - The operating system info. + OSDetails *OSDetails `json:"oSDetails,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // RecoveryAzureResourceGroupID - The target resource group Id. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]HyperVReplicaAzureManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) MarshalJSON() ([]byte, error) { + hvrard.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrard.AzureVMDiskDetails != nil { + objectMap["azureVmDiskDetails"] = hvrard.AzureVMDiskDetails + } + if hvrard.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVmName"] = hvrard.RecoveryAzureVMName + } + if hvrard.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = hvrard.RecoveryAzureVMSize + } + if hvrard.RecoveryAzureStorageAccount != nil { + objectMap["recoveryAzureStorageAccount"] = hvrard.RecoveryAzureStorageAccount + } + if hvrard.RecoveryAzureLogStorageAccountID != nil { + objectMap["recoveryAzureLogStorageAccountId"] = hvrard.RecoveryAzureLogStorageAccountID + } + if hvrard.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrard.LastReplicatedTime + } + if hvrard.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = hvrard.RpoInSeconds + } + if hvrard.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = hvrard.LastRpoCalculatedTime + } + if hvrard.VMID != nil { + objectMap["vmId"] = hvrard.VMID + } + if hvrard.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrard.VMProtectionState + } + if hvrard.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrard.VMProtectionStateDescription + } + if hvrard.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrard.InitialReplicationDetails + } + if hvrard.VMNics != nil { + objectMap["vmNics"] = hvrard.VMNics + } + if hvrard.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = hvrard.SelectedRecoveryAzureNetworkID + } + if hvrard.SelectedSourceNicID != nil { + objectMap["selectedSourceNicId"] = hvrard.SelectedSourceNicID + } + if hvrard.Encryption != nil { + objectMap["encryption"] = hvrard.Encryption + } + if hvrard.OSDetails != nil { + objectMap["oSDetails"] = hvrard.OSDetails + } + if hvrard.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = hvrard.SourceVMRAMSizeInMB + } + if hvrard.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = hvrard.SourceVMCPUCount + } + if hvrard.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = hvrard.EnableRdpOnTargetOption + } + if hvrard.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = hvrard.RecoveryAzureResourceGroupID + } + if hvrard.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = hvrard.RecoveryAvailabilitySetID + } + if hvrard.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvrard.TargetAvailabilityZone + } + if hvrard.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvrard.TargetProximityPlacementGroupID + } + if hvrard.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvrard.UseManagedDisks + } + if hvrard.LicenseType != nil { + objectMap["licenseType"] = hvrard.LicenseType + } + if hvrard.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = hvrard.SQLServerLicenseType + } + if hvrard.TargetVMTags != nil { + objectMap["targetVmTags"] = hvrard.TargetVMTags + } + if hvrard.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = hvrard.SeedManagedDiskTags + } + if hvrard.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvrard.TargetManagedDiskTags + } + if hvrard.TargetNicTags != nil { + objectMap["targetNicTags"] = hvrard.TargetNicTags + } + if hvrard.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = hvrard.ProtectedManagedDisks + } + if hvrard.InstanceType != "" { + objectMap["instanceType"] = hvrard.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return &hvrard, true +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrard, true +} + +// HyperVReplicaAzureReprotectInput azure specific reprotect input. +type HyperVReplicaAzureReprotectInput struct { + // HvHostVMID - The Hyper-V host Vm Id. + HvHostVMID *string `json:"hvHostVmId,omitempty"` + // VMName - The Vm Name. + VMName *string `json:"vmName,omitempty"` + // OsType - The OS type associated with vm. + OsType *string `json:"osType,omitempty"` + // VHDID - The OS disk VHD id associated with vm. + VHDID *string `json:"vHDId,omitempty"` + // StorageAccountID - The storage account name. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) MarshalJSON() ([]byte, error) { + hvrari.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrari.HvHostVMID != nil { + objectMap["hvHostVmId"] = hvrari.HvHostVMID + } + if hvrari.VMName != nil { + objectMap["vmName"] = hvrari.VMName + } + if hvrari.OsType != nil { + objectMap["osType"] = hvrari.OsType + } + if hvrari.VHDID != nil { + objectMap["vHDId"] = hvrari.VHDID + } + if hvrari.StorageAccountID != nil { + objectMap["storageAccountId"] = hvrari.StorageAccountID + } + if hvrari.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = hvrari.LogStorageAccountID + } + if hvrari.InstanceType != "" { + objectMap["instanceType"] = hvrari.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return &hvrari, true +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &hvrari, true +} + +// HyperVReplicaAzureTestFailoverInput hvrA provider specific input for test failover. +type HyperVReplicaAzureTestFailoverInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) MarshalJSON() ([]byte, error) { + hvratfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvratfi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvratfi.PrimaryKekCertificatePfx + } + if hvratfi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvratfi.SecondaryKekCertificatePfx + } + if hvratfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvratfi.RecoveryPointID + } + if hvratfi.InstanceType != "" { + objectMap["instanceType"] = hvratfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return &hvratfi, true +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &hvratfi, true +} + +// HyperVReplicaAzureUnplannedFailoverInput hvrA provider specific input for unplanned failover. +type HyperVReplicaAzureUnplannedFailoverInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + hvraufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraufi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvraufi.PrimaryKekCertificatePfx + } + if hvraufi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvraufi.SecondaryKekCertificatePfx + } + if hvraufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvraufi.RecoveryPointID + } + if hvraufi.InstanceType != "" { + objectMap["instanceType"] = hvraufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return &hvraufi, true +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &hvraufi, true +} + +// HyperVReplicaAzureUpdateReplicationProtectedItemInput hyperV replica Azure input to update replication +// protected item. +type HyperVReplicaAzureUpdateReplicationProtectedItemInput struct { + // RecoveryAzureV1ResourceGroupID - The recovery Azure resource group Id for classic deployment. + RecoveryAzureV1ResourceGroupID *string `json:"recoveryAzureV1ResourceGroupId,omitempty"` + // RecoveryAzureV2ResourceGroupID - The recovery Azure resource group Id for resource manager deployment. + RecoveryAzureV2ResourceGroupID *string `json:"recoveryAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // DiskIDToDiskEncryptionMap - The dictionary of disk resource Id to disk encryption set ARM Id. + DiskIDToDiskEncryptionMap map[string]*string `json:"diskIdToDiskEncryptionMap"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // VMDisks - The list of disk update properties. + VMDisks *[]UpdateDiskInput `json:"vmDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + hvraurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraurpii.RecoveryAzureV1ResourceGroupID != nil { + objectMap["recoveryAzureV1ResourceGroupId"] = hvraurpii.RecoveryAzureV1ResourceGroupID + } + if hvraurpii.RecoveryAzureV2ResourceGroupID != nil { + objectMap["recoveryAzureV2ResourceGroupId"] = hvraurpii.RecoveryAzureV2ResourceGroupID + } + if hvraurpii.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvraurpii.UseManagedDisks + } + if hvraurpii.DiskIDToDiskEncryptionMap != nil { + objectMap["diskIdToDiskEncryptionMap"] = hvraurpii.DiskIDToDiskEncryptionMap + } + if hvraurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvraurpii.TargetProximityPlacementGroupID + } + if hvraurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvraurpii.TargetAvailabilityZone + } + if hvraurpii.TargetVMTags != nil { + objectMap["targetVmTags"] = hvraurpii.TargetVMTags + } + if hvraurpii.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvraurpii.TargetManagedDiskTags + } + if hvraurpii.TargetNicTags != nil { + objectMap["targetNicTags"] = hvraurpii.TargetNicTags + } + if hvraurpii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = hvraurpii.SQLServerLicenseType + } + if hvraurpii.VMDisks != nil { + objectMap["vmDisks"] = hvraurpii.VMDisks + } + if hvraurpii.InstanceType != "" { + objectMap["instanceType"] = hvraurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return &hvraurpii, true +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &hvraurpii, true +} + +// HyperVReplicaBaseEventDetails abstract model class for event details of a HyperVReplica E2E event. +type HyperVReplicaBaseEventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) MarshalJSON() ([]byte, error) { + hvrbed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails + objectMap := make(map[string]interface{}) + if hvrbed.ContainerName != nil { + objectMap["containerName"] = hvrbed.ContainerName + } + if hvrbed.FabricName != nil { + objectMap["fabricName"] = hvrbed.FabricName + } + if hvrbed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvrbed.RemoteContainerName + } + if hvrbed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvrbed.RemoteFabricName + } + if hvrbed.InstanceType != "" { + objectMap["instanceType"] = hvrbed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return &hvrbed, true +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvrbed, true +} + +// HyperVReplicaBasePolicyDetails base class for HyperVReplica policy details. +type HyperVReplicaBasePolicyDetails struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud. + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) MarshalJSON() ([]byte, error) { + hvrbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails + objectMap := make(map[string]interface{}) + if hvrbpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpd.RecoveryPoints + } + if hvrbpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpd.Compression != nil { + objectMap["compression"] = hvrbpd.Compression + } + if hvrbpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpd.InitialReplicationMethod + } + if hvrbpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpd.OnlineReplicationStartTime + } + if hvrbpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpd.OfflineReplicationImportPath + } + if hvrbpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpd.OfflineReplicationExportPath + } + if hvrbpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpd.ReplicationPort + } + if hvrbpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpd.AllowedAuthenticationType + } + if hvrbpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrbpd.ReplicaDeletionOption + } + if hvrbpd.InstanceType != "" { + objectMap["instanceType"] = hvrbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return &hvrbpd, true +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrbpd, true +} + +// HyperVReplicaBaseReplicationDetails hyper V replica provider specific settings base class. +type HyperVReplicaBaseReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) MarshalJSON() ([]byte, error) { + hvrbrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails + objectMap := make(map[string]interface{}) + if hvrbrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrbrd.LastReplicatedTime + } + if hvrbrd.VMNics != nil { + objectMap["vmNics"] = hvrbrd.VMNics + } + if hvrbrd.VMID != nil { + objectMap["vmId"] = hvrbrd.VMID + } + if hvrbrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrbrd.VMProtectionState + } + if hvrbrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrbrd.VMProtectionStateDescription + } + if hvrbrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrbrd.InitialReplicationDetails + } + if hvrbrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrbrd.VMDiskDetails + } + if hvrbrd.InstanceType != "" { + objectMap["instanceType"] = hvrbrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return &hvrbrd, true +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrbrd, true +} + +// HyperVReplicaBluePolicyDetails hyper-V Replica Blue specific protection profile details. +type HyperVReplicaBluePolicyDetails struct { + // ReplicationFrequencyInSeconds - A value indicating the replication interval. + ReplicationFrequencyInSeconds *int32 `json:"replicationFrequencyInSeconds,omitempty"` + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) MarshalJSON() ([]byte, error) { + hvrbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbpd.ReplicationFrequencyInSeconds != nil { + objectMap["replicationFrequencyInSeconds"] = hvrbpd.ReplicationFrequencyInSeconds + } + if hvrbpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpd.RecoveryPoints + } + if hvrbpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpd.Compression != nil { + objectMap["compression"] = hvrbpd.Compression + } + if hvrbpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpd.InitialReplicationMethod + } + if hvrbpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpd.OnlineReplicationStartTime + } + if hvrbpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpd.OfflineReplicationImportPath + } + if hvrbpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpd.OfflineReplicationExportPath + } + if hvrbpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpd.ReplicationPort + } + if hvrbpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpd.AllowedAuthenticationType + } + if hvrbpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrbpd.ReplicaDeletionOption + } + if hvrbpd.InstanceType != "" { + objectMap["instanceType"] = hvrbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return &hvrbpd, true +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrbpd, true +} + +// HyperVReplicaBluePolicyInput hyperV Replica Blue policy input. +type HyperVReplicaBluePolicyInput struct { + // ReplicationFrequencyInSeconds - A value indicating the replication interval. + ReplicationFrequencyInSeconds *int32 `json:"replicationFrequencyInSeconds,omitempty"` + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletion - A value indicating whether the VM has to be auto deleted. + ReplicaDeletion *string `json:"replicaDeletion,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) MarshalJSON() ([]byte, error) { + hvrbpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbpi.ReplicationFrequencyInSeconds != nil { + objectMap["replicationFrequencyInSeconds"] = hvrbpi.ReplicationFrequencyInSeconds + } + if hvrbpi.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpi.RecoveryPoints + } + if hvrbpi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpi.Compression != nil { + objectMap["compression"] = hvrbpi.Compression + } + if hvrbpi.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpi.InitialReplicationMethod + } + if hvrbpi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpi.OnlineReplicationStartTime + } + if hvrbpi.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpi.OfflineReplicationImportPath + } + if hvrbpi.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpi.OfflineReplicationExportPath + } + if hvrbpi.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpi.ReplicationPort + } + if hvrbpi.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpi.AllowedAuthenticationType + } + if hvrbpi.ReplicaDeletion != nil { + objectMap["replicaDeletion"] = hvrbpi.ReplicaDeletion + } + if hvrbpi.InstanceType != "" { + objectMap["instanceType"] = hvrbpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return &hvrbpi, true +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return &hvrbpi, true +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrbpi, true +} + +// HyperVReplicaBlueReplicationDetails hyperV replica 2012 R2 (Blue) replication details. +type HyperVReplicaBlueReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) MarshalJSON() ([]byte, error) { + hvrbrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrbrd.LastReplicatedTime + } + if hvrbrd.VMNics != nil { + objectMap["vmNics"] = hvrbrd.VMNics + } + if hvrbrd.VMID != nil { + objectMap["vmId"] = hvrbrd.VMID + } + if hvrbrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrbrd.VMProtectionState + } + if hvrbrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrbrd.VMProtectionStateDescription + } + if hvrbrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrbrd.InitialReplicationDetails + } + if hvrbrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrbrd.VMDiskDetails + } + if hvrbrd.InstanceType != "" { + objectMap["instanceType"] = hvrbrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return &hvrbrd, true +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrbrd, true +} + +// HyperVReplicaPolicyDetails hyper-V Replica Blue specific protection profile details. +type HyperVReplicaPolicyDetails struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) MarshalJSON() ([]byte, error) { + hvrpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrpd.RecoveryPoints + } + if hvrpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrpd.Compression != nil { + objectMap["compression"] = hvrpd.Compression + } + if hvrpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrpd.InitialReplicationMethod + } + if hvrpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrpd.OnlineReplicationStartTime + } + if hvrpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrpd.OfflineReplicationImportPath + } + if hvrpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrpd.OfflineReplicationExportPath + } + if hvrpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrpd.ReplicationPort + } + if hvrpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrpd.AllowedAuthenticationType + } + if hvrpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrpd.ReplicaDeletionOption + } + if hvrpd.InstanceType != "" { + objectMap["instanceType"] = hvrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return &hvrpd, true +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrpd, true +} + +// BasicHyperVReplicaPolicyInput hyper-V Replica specific policy Input. +type BasicHyperVReplicaPolicyInput interface { + AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) + AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) +} + +// HyperVReplicaPolicyInput hyper-V Replica specific policy Input. +type HyperVReplicaPolicyInput struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletion - A value indicating whether the VM has to be auto deleted. + ReplicaDeletion *string `json:"replicaDeletion,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicHyperVReplicaPolicyInput(body []byte) (BasicHyperVReplicaPolicyInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2): + var hvrbpi HyperVReplicaBluePolicyInput + err := json.Unmarshal(body, &hvrbpi) + return hvrbpi, err + default: + var hvrpi HyperVReplicaPolicyInput + err := json.Unmarshal(body, &hvrpi) + return hvrpi, err + } +} +func unmarshalBasicHyperVReplicaPolicyInputArray(body []byte) ([]BasicHyperVReplicaPolicyInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + hvrpiArray := make([]BasicHyperVReplicaPolicyInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + hvrpi, err := unmarshalBasicHyperVReplicaPolicyInput(*rawMessage) + if err != nil { + return nil, err + } + hvrpiArray[index] = hvrpi + } + return hvrpiArray, nil +} + +// MarshalJSON is the custom marshaler for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) MarshalJSON() ([]byte, error) { + hvrpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrpi.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrpi.RecoveryPoints + } + if hvrpi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrpi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrpi.Compression != nil { + objectMap["compression"] = hvrpi.Compression + } + if hvrpi.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrpi.InitialReplicationMethod + } + if hvrpi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrpi.OnlineReplicationStartTime + } + if hvrpi.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrpi.OfflineReplicationImportPath + } + if hvrpi.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrpi.OfflineReplicationExportPath + } + if hvrpi.ReplicationPort != nil { + objectMap["replicationPort"] = hvrpi.ReplicationPort + } + if hvrpi.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrpi.AllowedAuthenticationType + } + if hvrpi.ReplicaDeletion != nil { + objectMap["replicaDeletion"] = hvrpi.ReplicaDeletion + } + if hvrpi.InstanceType != "" { + objectMap["instanceType"] = hvrpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return &hvrpi, true +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return &hvrpi, true +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrpi, true +} + +// HyperVReplicaReplicationDetails hyperV replica 2012 replication details. +type HyperVReplicaReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) MarshalJSON() ([]byte, error) { + hvrrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrrd.LastReplicatedTime + } + if hvrrd.VMNics != nil { + objectMap["vmNics"] = hvrrd.VMNics + } + if hvrrd.VMID != nil { + objectMap["vmId"] = hvrrd.VMID + } + if hvrrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrrd.VMProtectionState + } + if hvrrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrrd.VMProtectionStateDescription + } + if hvrrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrrd.InitialReplicationDetails + } + if hvrrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrrd.VMDiskDetails + } + if hvrrd.InstanceType != "" { + objectMap["instanceType"] = hvrrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return &hvrrd, true +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrrd, true +} + +// HyperVSiteDetails hyperVSite fabric specific details. +type HyperVSiteDetails struct { + // HyperVHosts - The list of Hyper-V hosts associated with the fabric. + HyperVHosts *[]HyperVHostDetails `json:"hyperVHosts,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) MarshalJSON() ([]byte, error) { + hvsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite + objectMap := make(map[string]interface{}) + if hvsd.HyperVHosts != nil { + objectMap["hyperVHosts"] = hvsd.HyperVHosts + } + if hvsd.InstanceType != "" { + objectMap["instanceType"] = hvsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return &hvsd, true +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &hvsd, true +} + +// BasicHyperVVirtualMachineDetails single Host fabric provider specific VM settings. +type BasicHyperVVirtualMachineDetails interface { + AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) + AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) +} + +// HyperVVirtualMachineDetails single Host fabric provider specific VM settings. +type HyperVVirtualMachineDetails struct { + // SourceItemID - The source id of the object. + SourceItemID *string `json:"sourceItemId,omitempty"` + // Generation - The id of the object in fabric. + Generation *string `json:"generation,omitempty"` + // OsDetails - The Last replication time. + OsDetails *OSDetails `json:"osDetails,omitempty"` + // DiskDetails - The Last successful failover time. + DiskDetails *[]DiskDetails `json:"diskDetails,omitempty"` + // HasPhysicalDisk - A value indicating whether the VM has a physical disk attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasPhysicalDisk PresenceStatus `json:"hasPhysicalDisk,omitempty"` + // HasFibreChannelAdapter - A value indicating whether the VM has a fibre channel adapter attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasFibreChannelAdapter PresenceStatus `json:"hasFibreChannelAdapter,omitempty"` + // HasSharedVhd - A value indicating whether the VM has a shared VHD attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasSharedVhd PresenceStatus `json:"hasSharedVhd,omitempty"` + // HyperVHostID - The Id of the hyper-v host in fabric. + HyperVHostID *string `json:"hyperVHostId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicHyperVVirtualMachineDetails(body []byte) (BasicHyperVVirtualMachineDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeVmmVirtualMachine): + var vvmd VmmVirtualMachineDetails + err := json.Unmarshal(body, &vvmd) + return vvmd, err + default: + var hvvmd HyperVVirtualMachineDetails + err := json.Unmarshal(body, &hvvmd) + return hvvmd, err + } +} +func unmarshalBasicHyperVVirtualMachineDetailsArray(body []byte) ([]BasicHyperVVirtualMachineDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + hvvmdArray := make([]BasicHyperVVirtualMachineDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + hvvmd, err := unmarshalBasicHyperVVirtualMachineDetails(*rawMessage) + if err != nil { + return nil, err + } + hvvmdArray[index] = hvvmd + } + return hvvmdArray, nil +} + +// MarshalJSON is the custom marshaler for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) MarshalJSON() ([]byte, error) { + hvvmd.InstanceType = InstanceTypeHyperVVirtualMachine + objectMap := make(map[string]interface{}) + if hvvmd.SourceItemID != nil { + objectMap["sourceItemId"] = hvvmd.SourceItemID + } + if hvvmd.Generation != nil { + objectMap["generation"] = hvvmd.Generation + } + if hvvmd.OsDetails != nil { + objectMap["osDetails"] = hvvmd.OsDetails + } + if hvvmd.DiskDetails != nil { + objectMap["diskDetails"] = hvvmd.DiskDetails + } + if hvvmd.HasPhysicalDisk != "" { + objectMap["hasPhysicalDisk"] = hvvmd.HasPhysicalDisk + } + if hvvmd.HasFibreChannelAdapter != "" { + objectMap["hasFibreChannelAdapter"] = hvvmd.HasFibreChannelAdapter + } + if hvvmd.HasSharedVhd != "" { + objectMap["hasSharedVhd"] = hvvmd.HasSharedVhd + } + if hvvmd.HyperVHostID != nil { + objectMap["hyperVHostId"] = hvvmd.HyperVHostID + } + if hvvmd.InstanceType != "" { + objectMap["instanceType"] = hvvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return &hvvmd, true +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return &hvvmd, true +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &hvvmd, true +} + +// IdentityProviderDetails identity provider details. +type IdentityProviderDetails struct { + // TenantID - The tenant Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + TenantID *string `json:"tenantId,omitempty"` + // ApplicationID - The application/client Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ApplicationID *string `json:"applicationId,omitempty"` + // ObjectID - The object Id of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ObjectID *string `json:"objectId,omitempty"` + // Audience - The intended Audience of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + Audience *string `json:"audience,omitempty"` + // AadAuthority - The base authority for Azure Active Directory authentication. + AadAuthority *string `json:"aadAuthority,omitempty"` +} + +// IdentityProviderInput identity provider input. +type IdentityProviderInput struct { + // TenantID - The tenant Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + TenantID *string `json:"tenantId,omitempty"` + // ApplicationID - The application/client Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ApplicationID *string `json:"applicationId,omitempty"` + // ObjectID - The object Id of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ObjectID *string `json:"objectId,omitempty"` + // Audience - The intended Audience of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + Audience *string `json:"audience,omitempty"` + // AadAuthority - The base authority for Azure Active Directory authentication. + AadAuthority *string `json:"aadAuthority,omitempty"` +} + +// InconsistentVMDetails this class stores the monitoring details for consistency check of inconsistent +// Protected Entity. +type InconsistentVMDetails struct { + // VMName - The Vm name. + VMName *string `json:"vmName,omitempty"` + // CloudName - The Cloud name. + CloudName *string `json:"cloudName,omitempty"` + // Details - The list of details regarding state of the Protected Entity in SRS and On prem. + Details *[]string `json:"details,omitempty"` + // ErrorIds - The list of error ids. + ErrorIds *[]string `json:"errorIds,omitempty"` +} + +// InitialReplicationDetails initial replication details. +type InitialReplicationDetails struct { + // InitialReplicationType - Initial replication type. + InitialReplicationType *string `json:"initialReplicationType,omitempty"` + // InitialReplicationProgressPercentage - The initial replication progress percentage. + InitialReplicationProgressPercentage *string `json:"initialReplicationProgressPercentage,omitempty"` +} + +// InlineWorkflowTaskDetails this class represents the inline workflow task details. +type InlineWorkflowTaskDetails struct { + // WorkflowIds - The list of child workflow ids. + WorkflowIds *[]string `json:"workflowIds,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) MarshalJSON() ([]byte, error) { + iwtd.InstanceType = InstanceTypeInlineWorkflowTaskDetails + objectMap := make(map[string]interface{}) + if iwtd.WorkflowIds != nil { + objectMap["workflowIds"] = iwtd.WorkflowIds + } + if iwtd.ChildTasks != nil { + objectMap["childTasks"] = iwtd.ChildTasks + } + if iwtd.InstanceType != "" { + objectMap["instanceType"] = iwtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return &iwtd, true +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &iwtd, true +} + +// InMageAgentDetails the details of the InMage agent. +type InMageAgentDetails struct { + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentUpdateStatus - A value indicating whether installed agent needs to be updated. + AgentUpdateStatus *string `json:"agentUpdateStatus,omitempty"` + // PostUpdateRebootStatus - A value indicating whether reboot is required after update is applied. + PostUpdateRebootStatus *string `json:"postUpdateRebootStatus,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` +} + +// InMageAzureV2ApplyRecoveryPointInput applyRecoveryPoint input specific to InMageAzureV2 provider. +type InMageAzureV2ApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + imavarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavarpi.InstanceType != "" { + objectMap["instanceType"] = imavarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return &imavarpi, true +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &imavarpi, true +} + +// InMageAzureV2DiskInputDetails disk input details. +type InMageAzureV2DiskInputDetails struct { + // DiskID - The DiskId. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The LogStorageAccountId. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageAzureV2EnableProtectionInput vMware Azure specific enable protection input. +type InMageAzureV2EnableProtectionInput struct { + // MasterTargetID - The Master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // StorageAccountID - The storage account Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // MultiVMGroupID - The multi VM group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]InMageAzureV2DiskInputDetails `json:"disksToInclude,omitempty"` + // TargetAzureNetworkID - The selected target Azure network Id. + TargetAzureNetworkID *string `json:"targetAzureNetworkId,omitempty"` + // TargetAzureSubnetID - The selected target Azure subnet Id. + TargetAzureSubnetID *string `json:"targetAzureSubnetId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target VM after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // TargetAzureVMName - The target azure VM Name. + TargetAzureVMName *string `json:"targetAzureVmName,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // TargetAzureV1ResourceGroupID - The Id of the target resource group (for classic deployment) in which the failover VM is to be created. + TargetAzureV1ResourceGroupID *string `json:"targetAzureV1ResourceGroupId,omitempty"` + // TargetAzureV2ResourceGroupID - The Id of the target resource group (for resource manager deployment) in which the failover VM is to be created. + TargetAzureV2ResourceGroupID *string `json:"targetAzureV2ResourceGroupId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id for resource manager deployment. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) MarshalJSON() ([]byte, error) { + imavepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavepi.MasterTargetID != nil { + objectMap["masterTargetId"] = imavepi.MasterTargetID + } + if imavepi.ProcessServerID != nil { + objectMap["processServerId"] = imavepi.ProcessServerID + } + if imavepi.StorageAccountID != nil { + objectMap["storageAccountId"] = imavepi.StorageAccountID + } + if imavepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imavepi.RunAsAccountID + } + if imavepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imavepi.MultiVMGroupID + } + if imavepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imavepi.MultiVMGroupName + } + if imavepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imavepi.DisksToInclude + } + if imavepi.TargetAzureNetworkID != nil { + objectMap["targetAzureNetworkId"] = imavepi.TargetAzureNetworkID + } + if imavepi.TargetAzureSubnetID != nil { + objectMap["targetAzureSubnetId"] = imavepi.TargetAzureSubnetID + } + if imavepi.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = imavepi.EnableRdpOnTargetOption + } + if imavepi.TargetAzureVMName != nil { + objectMap["targetAzureVmName"] = imavepi.TargetAzureVMName + } + if imavepi.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imavepi.LogStorageAccountID + } + if imavepi.TargetAzureV1ResourceGroupID != nil { + objectMap["targetAzureV1ResourceGroupId"] = imavepi.TargetAzureV1ResourceGroupID + } + if imavepi.TargetAzureV2ResourceGroupID != nil { + objectMap["targetAzureV2ResourceGroupId"] = imavepi.TargetAzureV2ResourceGroupID + } + if imavepi.DiskType != "" { + objectMap["diskType"] = imavepi.DiskType + } + if imavepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imavepi.TargetAvailabilitySetID + } + if imavepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavepi.TargetAvailabilityZone + } + if imavepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavepi.TargetProximityPlacementGroupID + } + if imavepi.LicenseType != "" { + objectMap["licenseType"] = imavepi.LicenseType + } + if imavepi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = imavepi.SQLServerLicenseType + } + if imavepi.TargetVMSize != nil { + objectMap["targetVmSize"] = imavepi.TargetVMSize + } + if imavepi.DiskEncryptionSetID != nil { + objectMap["diskEncryptionSetId"] = imavepi.DiskEncryptionSetID + } + if imavepi.TargetVMTags != nil { + objectMap["targetVmTags"] = imavepi.TargetVMTags + } + if imavepi.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = imavepi.SeedManagedDiskTags + } + if imavepi.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavepi.TargetManagedDiskTags + } + if imavepi.TargetNicTags != nil { + objectMap["targetNicTags"] = imavepi.TargetNicTags + } + if imavepi.InstanceType != "" { + objectMap["instanceType"] = imavepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return &imavepi, true +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imavepi, true +} + +// InMageAzureV2EventDetails model class for event details of a VMwareAzureV2 event. +type InMageAzureV2EventDetails struct { + // EventType - InMage Event type. Takes one of the values of InMageDataContract.InMageMonitoringEventType. + EventType *string `json:"eventType,omitempty"` + // Category - InMage Event Category. + Category *string `json:"category,omitempty"` + // Component - InMage Event Component. + Component *string `json:"component,omitempty"` + // CorrectiveAction - Corrective Action string for the event. + CorrectiveAction *string `json:"correctiveAction,omitempty"` + // Details - InMage Event Details. + Details *string `json:"details,omitempty"` + // Summary - InMage Event Summary. + Summary *string `json:"summary,omitempty"` + // SiteName - VMware Site name. + SiteName *string `json:"siteName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) MarshalJSON() ([]byte, error) { + imaved.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imaved.EventType != nil { + objectMap["eventType"] = imaved.EventType + } + if imaved.Category != nil { + objectMap["category"] = imaved.Category + } + if imaved.Component != nil { + objectMap["component"] = imaved.Component + } + if imaved.CorrectiveAction != nil { + objectMap["correctiveAction"] = imaved.CorrectiveAction + } + if imaved.Details != nil { + objectMap["details"] = imaved.Details + } + if imaved.Summary != nil { + objectMap["summary"] = imaved.Summary + } + if imaved.SiteName != nil { + objectMap["siteName"] = imaved.SiteName + } + if imaved.InstanceType != "" { + objectMap["instanceType"] = imaved.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return &imaved, true +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imaved, true +} + +// InMageAzureV2ManagedDiskDetails inMageAzureV2 Managed disk details. +type InMageAzureV2ManagedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // SeedManagedDiskID - Seed managed disk Id. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // ReplicaDiskType - The replica disk type. + ReplicaDiskType *string `json:"replicaDiskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetDiskName - The target disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// InMageAzureV2PolicyDetails inMage Azure v2 specific protection profile details. +type InMageAzureV2PolicyDetails struct { + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) MarshalJSON() ([]byte, error) { + imavpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imavpd.CrashConsistentFrequencyInMinutes + } + if imavpd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imavpd.RecoveryPointThresholdInMinutes + } + if imavpd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imavpd.RecoveryPointHistory + } + if imavpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imavpd.AppConsistentFrequencyInMinutes + } + if imavpd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imavpd.MultiVMSyncStatus + } + if imavpd.InstanceType != "" { + objectMap["instanceType"] = imavpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return &imavpd, true +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imavpd, true +} + +// InMageAzureV2PolicyInput vMWare Azure specific policy Input. +type InMageAzureV2PolicyInput struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) MarshalJSON() ([]byte, error) { + imavpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavpi.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imavpi.RecoveryPointThresholdInMinutes + } + if imavpi.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imavpi.RecoveryPointHistory + } + if imavpi.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imavpi.CrashConsistentFrequencyInMinutes + } + if imavpi.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imavpi.AppConsistentFrequencyInMinutes + } + if imavpi.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = imavpi.MultiVMSyncStatus + } + if imavpi.InstanceType != "" { + objectMap["instanceType"] = imavpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return &imavpi, true +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imavpi, true +} + +// InMageAzureV2ProtectedDiskDetails inMageAzureV2 protected disk details. +type InMageAzureV2ProtectedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // HealthErrorCode - The health error code for the disk. + HealthErrorCode *string `json:"healthErrorCode,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncDurationInSeconds - The resync duration in seconds. + ResyncDurationInSeconds *int64 `json:"resyncDurationInSeconds,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // FileSystemCapacityInBytes - The disk file system capacity in bytes. + FileSystemCapacityInBytes *int64 `json:"fileSystemCapacityInBytes,omitempty"` + // SourceDataInMegaBytes - The source data transit in MB. + SourceDataInMegaBytes *float64 `json:"sourceDataInMegaBytes,omitempty"` + // PsDataInMegaBytes - The PS data transit in MB. + PsDataInMegaBytes *float64 `json:"psDataInMegaBytes,omitempty"` + // TargetDataInMegaBytes - The target data transit in MB. + TargetDataInMegaBytes *float64 `json:"targetDataInMegaBytes,omitempty"` + // DiskResized - A value indicating whether disk is resized. + DiskResized *string `json:"diskResized,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // ResyncProcessedBytes - The resync processed bytes. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTotalTransferredBytes - The resync total transferred bytes. + ResyncTotalTransferredBytes *int64 `json:"resyncTotalTransferredBytes,omitempty"` + // ResyncLast15MinutesTransferredBytes - The resync last 15 minutes transferred bytes. + ResyncLast15MinutesTransferredBytes *int64 `json:"resyncLast15MinutesTransferredBytes,omitempty"` + // ResyncLastDataTransferTimeUTC - The last data transfer time in UTC. + ResyncLastDataTransferTimeUTC *date.Time `json:"resyncLastDataTransferTimeUTC,omitempty"` + // ResyncStartTime - The resync start time. + ResyncStartTime *date.Time `json:"resyncStartTime,omitempty"` + // ProgressHealth - The Progress Health. + ProgressHealth *string `json:"progressHealth,omitempty"` + // ProgressStatus - The Progress Status. + ProgressStatus *string `json:"progressStatus,omitempty"` + // SecondsToTakeSwitchProvider - The seconds to take for switch provider. + SecondsToTakeSwitchProvider *int64 `json:"secondsToTakeSwitchProvider,omitempty"` +} + +// InMageAzureV2RecoveryPointDetails inMage Azure V2 provider specific recovery point details. +type InMageAzureV2RecoveryPointDetails struct { + // IsMultiVMSyncPoint - A value indicating whether the recovery point is multi VM consistent. + IsMultiVMSyncPoint *string `json:"isMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) MarshalJSON() ([]byte, error) { + imavrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavrpd.IsMultiVMSyncPoint != nil { + objectMap["isMultiVmSyncPoint"] = imavrpd.IsMultiVMSyncPoint + } + if imavrpd.InstanceType != "" { + objectMap["instanceType"] = imavrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return &imavrpd, true +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &imavrpd, true +} + +// InMageAzureV2ReplicationDetails inMageAzureV2 provider specific settings. +type InMageAzureV2ReplicationDetails struct { + // InfrastructureVMID - The infrastructure VM Id. + InfrastructureVMID *string `json:"infrastructureVmId,omitempty"` + // VCenterInfrastructureID - The vCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // CompressedDataRateInMB - The compressed data change rate in MB. + CompressedDataRateInMB *float64 `json:"compressedDataRateInMB,omitempty"` + // UncompressedDataRateInMB - The uncompressed data change rate in MB. + UncompressedDataRateInMB *float64 `json:"uncompressedDataRateInMB,omitempty"` + // IPAddress - The source IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // IsAgentUpdateRequired - A value indicating whether installed agent needs to be updated. + IsAgentUpdateRequired *string `json:"isAgentUpdateRequired,omitempty"` + // IsRebootAfterUpdateRequired - A value indicating whether the source server requires a restart after update. + IsRebootAfterUpdateRequired *string `json:"isRebootAfterUpdateRequired,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // ProcessServerName - The process server name. + ProcessServerName *string `json:"processServerName,omitempty"` + // MultiVMGroupID - The multi vm group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi vm sync is enabled or disabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageAzureV2ProtectedDiskDetails `json:"protectedDisks,omitempty"` + // DiskResized - A value indicating whether any disk is resized for this VM. + DiskResized *string `json:"diskResized,omitempty"` + // MasterTargetID - The master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // OsType - The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // VhdName - The OS disk VHD name. + VhdName *string `json:"vhdName,omitempty"` + // OsDiskID - The id of the disk containing the OS. + OsDiskID *string `json:"osDiskId,omitempty"` + // AzureVMDiskDetails - Azure VM Disk details. + AzureVMDiskDetails *[]AzureVMDiskDetails `json:"azureVMDiskDetails,omitempty"` + // RecoveryAzureVMName - Recovery Azure given name. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureVMSize - The Recovery Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureStorageAccount - The recovery Azure storage account. + RecoveryAzureStorageAccount *string `json:"recoveryAzureStorageAccount,omitempty"` + // RecoveryAzureLogStorageAccountID - The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. + RecoveryAzureLogStorageAccountID *string `json:"recoveryAzureLogStorageAccountId,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // SelectedRecoveryAzureNetworkID - The selected recovery azure network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The test failover virtual network. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. Value can be vCenter or physical. + DiscoveryType *string `json:"discoveryType,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // Datastores - The datastores of the on-premise machine. Value can be list of strings that contain datastore names. + Datastores *[]string `json:"datastores,omitempty"` + // TargetVMID - The ARM Id of the target Azure VM. This value will be null until the VM is failed over. Only after failure it will be populated with the ARM Id of the Azure VM. + TargetVMID *string `json:"targetVmId,omitempty"` + // RecoveryAzureResourceGroupID - The target resource group Id. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // ValidationErrors - The validation errors of the on-premise machine Value can be list of validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastUpdateReceivedTime - The last update time received from on-prem components. + LastUpdateReceivedTime *date.Time `json:"lastUpdateReceivedTime,omitempty"` + // ReplicaID - The replica id of the protected item. + ReplicaID *string `json:"replicaId,omitempty"` + // OsVersion - The OS Version of the protected item. + OsVersion *string `json:"osVersion,omitempty"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]InMageAzureV2ManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // FirmwareType - The firmware type of this protected item. + FirmwareType *string `json:"firmwareType,omitempty"` + // AzureVMGeneration - The target generation for this protected item. + AzureVMGeneration *string `json:"azureVmGeneration,omitempty"` + // IsAdditionalStatsAvailable - A value indicating whether additional IR stats are available or not. + IsAdditionalStatsAvailable *bool `json:"isAdditionalStatsAvailable,omitempty"` + // TotalDataTransferred - The total transferred data in bytes. + TotalDataTransferred *int64 `json:"totalDataTransferred,omitempty"` + // TotalProgressHealth - The progress health. + TotalProgressHealth *string `json:"totalProgressHealth,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // SwitchProviderBlockingErrorDetails - The switch provider blocking error information. + SwitchProviderBlockingErrorDetails *[]InMageAzureV2SwitchProviderBlockingErrorDetails `json:"switchProviderBlockingErrorDetails,omitempty"` + // SwitchProviderDetails - The switch provider blocking error information. + SwitchProviderDetails *InMageAzureV2SwitchProviderDetails `json:"switchProviderDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) MarshalJSON() ([]byte, error) { + imavrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavrd.InfrastructureVMID != nil { + objectMap["infrastructureVmId"] = imavrd.InfrastructureVMID + } + if imavrd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = imavrd.VCenterInfrastructureID + } + if imavrd.ProtectionStage != nil { + objectMap["protectionStage"] = imavrd.ProtectionStage + } + if imavrd.VMID != nil { + objectMap["vmId"] = imavrd.VMID + } + if imavrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = imavrd.VMProtectionState + } + if imavrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = imavrd.VMProtectionStateDescription + } + if imavrd.ResyncProgressPercentage != nil { + objectMap["resyncProgressPercentage"] = imavrd.ResyncProgressPercentage + } + if imavrd.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = imavrd.RpoInSeconds + } + if imavrd.CompressedDataRateInMB != nil { + objectMap["compressedDataRateInMB"] = imavrd.CompressedDataRateInMB + } + if imavrd.UncompressedDataRateInMB != nil { + objectMap["uncompressedDataRateInMB"] = imavrd.UncompressedDataRateInMB + } + if imavrd.IPAddress != nil { + objectMap["ipAddress"] = imavrd.IPAddress + } + if imavrd.AgentVersion != nil { + objectMap["agentVersion"] = imavrd.AgentVersion + } + if imavrd.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = imavrd.AgentExpiryDate + } + if imavrd.IsAgentUpdateRequired != nil { + objectMap["isAgentUpdateRequired"] = imavrd.IsAgentUpdateRequired + } + if imavrd.IsRebootAfterUpdateRequired != nil { + objectMap["isRebootAfterUpdateRequired"] = imavrd.IsRebootAfterUpdateRequired + } + if imavrd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = imavrd.LastHeartbeat + } + if imavrd.ProcessServerID != nil { + objectMap["processServerId"] = imavrd.ProcessServerID + } + if imavrd.ProcessServerName != nil { + objectMap["processServerName"] = imavrd.ProcessServerName + } + if imavrd.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imavrd.MultiVMGroupID + } + if imavrd.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imavrd.MultiVMGroupName + } + if imavrd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imavrd.MultiVMSyncStatus + } + if imavrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imavrd.ProtectedDisks + } + if imavrd.DiskResized != nil { + objectMap["diskResized"] = imavrd.DiskResized + } + if imavrd.MasterTargetID != nil { + objectMap["masterTargetId"] = imavrd.MasterTargetID + } + if imavrd.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = imavrd.SourceVMCPUCount + } + if imavrd.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = imavrd.SourceVMRAMSizeInMB + } + if imavrd.OsType != nil { + objectMap["osType"] = imavrd.OsType + } + if imavrd.VhdName != nil { + objectMap["vhdName"] = imavrd.VhdName + } + if imavrd.OsDiskID != nil { + objectMap["osDiskId"] = imavrd.OsDiskID + } + if imavrd.AzureVMDiskDetails != nil { + objectMap["azureVMDiskDetails"] = imavrd.AzureVMDiskDetails + } + if imavrd.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVMName"] = imavrd.RecoveryAzureVMName + } + if imavrd.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = imavrd.RecoveryAzureVMSize + } + if imavrd.RecoveryAzureStorageAccount != nil { + objectMap["recoveryAzureStorageAccount"] = imavrd.RecoveryAzureStorageAccount + } + if imavrd.RecoveryAzureLogStorageAccountID != nil { + objectMap["recoveryAzureLogStorageAccountId"] = imavrd.RecoveryAzureLogStorageAccountID + } + if imavrd.VMNics != nil { + objectMap["vmNics"] = imavrd.VMNics + } + if imavrd.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = imavrd.SelectedRecoveryAzureNetworkID + } + if imavrd.SelectedTfoAzureNetworkID != nil { + objectMap["selectedTfoAzureNetworkId"] = imavrd.SelectedTfoAzureNetworkID + } + if imavrd.SelectedSourceNicID != nil { + objectMap["selectedSourceNicId"] = imavrd.SelectedSourceNicID + } + if imavrd.DiscoveryType != nil { + objectMap["discoveryType"] = imavrd.DiscoveryType + } + if imavrd.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = imavrd.EnableRdpOnTargetOption + } + if imavrd.Datastores != nil { + objectMap["datastores"] = imavrd.Datastores + } + if imavrd.TargetVMID != nil { + objectMap["targetVmId"] = imavrd.TargetVMID + } + if imavrd.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = imavrd.RecoveryAzureResourceGroupID + } + if imavrd.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = imavrd.RecoveryAvailabilitySetID + } + if imavrd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavrd.TargetAvailabilityZone + } + if imavrd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavrd.TargetProximityPlacementGroupID + } + if imavrd.UseManagedDisks != nil { + objectMap["useManagedDisks"] = imavrd.UseManagedDisks + } + if imavrd.LicenseType != nil { + objectMap["licenseType"] = imavrd.LicenseType + } + if imavrd.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = imavrd.SQLServerLicenseType + } + if imavrd.ValidationErrors != nil { + objectMap["validationErrors"] = imavrd.ValidationErrors + } + if imavrd.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = imavrd.LastRpoCalculatedTime + } + if imavrd.LastUpdateReceivedTime != nil { + objectMap["lastUpdateReceivedTime"] = imavrd.LastUpdateReceivedTime + } + if imavrd.ReplicaID != nil { + objectMap["replicaId"] = imavrd.ReplicaID + } + if imavrd.OsVersion != nil { + objectMap["osVersion"] = imavrd.OsVersion + } + if imavrd.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = imavrd.ProtectedManagedDisks + } + if imavrd.FirmwareType != nil { + objectMap["firmwareType"] = imavrd.FirmwareType + } + if imavrd.AzureVMGeneration != nil { + objectMap["azureVmGeneration"] = imavrd.AzureVMGeneration + } + if imavrd.IsAdditionalStatsAvailable != nil { + objectMap["isAdditionalStatsAvailable"] = imavrd.IsAdditionalStatsAvailable + } + if imavrd.TotalDataTransferred != nil { + objectMap["totalDataTransferred"] = imavrd.TotalDataTransferred + } + if imavrd.TotalProgressHealth != nil { + objectMap["totalProgressHealth"] = imavrd.TotalProgressHealth + } + if imavrd.TargetVMTags != nil { + objectMap["targetVmTags"] = imavrd.TargetVMTags + } + if imavrd.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = imavrd.SeedManagedDiskTags + } + if imavrd.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavrd.TargetManagedDiskTags + } + if imavrd.TargetNicTags != nil { + objectMap["targetNicTags"] = imavrd.TargetNicTags + } + if imavrd.SwitchProviderBlockingErrorDetails != nil { + objectMap["switchProviderBlockingErrorDetails"] = imavrd.SwitchProviderBlockingErrorDetails + } + if imavrd.SwitchProviderDetails != nil { + objectMap["switchProviderDetails"] = imavrd.SwitchProviderDetails + } + if imavrd.InstanceType != "" { + objectMap["instanceType"] = imavrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return &imavrd, true +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imavrd, true +} + +// InMageAzureV2ReprotectInput inMageAzureV2 specific provider input. +type InMageAzureV2ReprotectInput struct { + // MasterTargetID - The Master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // StorageAccountID - The storage account id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) MarshalJSON() ([]byte, error) { + imavri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavri.MasterTargetID != nil { + objectMap["masterTargetId"] = imavri.MasterTargetID + } + if imavri.ProcessServerID != nil { + objectMap["processServerId"] = imavri.ProcessServerID + } + if imavri.StorageAccountID != nil { + objectMap["storageAccountId"] = imavri.StorageAccountID + } + if imavri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imavri.RunAsAccountID + } + if imavri.PolicyID != nil { + objectMap["policyId"] = imavri.PolicyID + } + if imavri.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imavri.LogStorageAccountID + } + if imavri.DisksToInclude != nil { + objectMap["disksToInclude"] = imavri.DisksToInclude + } + if imavri.InstanceType != "" { + objectMap["instanceType"] = imavri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return &imavri, true +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imavri, true +} + +// InMageAzureV2SwitchProviderBlockingErrorDetails inMageAzureV2 switch provider blocking error details. +type InMageAzureV2SwitchProviderBlockingErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2SwitchProviderBlockingErrorDetails. +func (imavspbed InMageAzureV2SwitchProviderBlockingErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageAzureV2SwitchProviderDetails inMageAzureV2 switch provider details. +type InMageAzureV2SwitchProviderDetails struct { + // TargetVaultID - READ-ONLY; The target vault Id. + TargetVaultID *string `json:"targetVaultId,omitempty"` + // TargetResourceID - READ-ONLY; The target resource Id. + TargetResourceID *string `json:"targetResourceId,omitempty"` + // TargetFabricID - READ-ONLY; The target fabric Id. + TargetFabricID *string `json:"targetFabricId,omitempty"` + // TargetApplianceID - READ-ONLY; The target appliance Id. + TargetApplianceID *string `json:"targetApplianceId,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2SwitchProviderDetails. +func (imavspd InMageAzureV2SwitchProviderDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageAzureV2SwitchProviderProviderInput provider specific input for InMageAzureV2 switch provider. +type InMageAzureV2SwitchProviderProviderInput struct { + // TargetVaultID - The target vault Id. + TargetVaultID *string `json:"targetVaultID,omitempty"` + // TargetFabricID - The target fabric Id. + TargetFabricID *string `json:"targetFabricID,omitempty"` + // TargetApplianceID - The target appliance Id. + TargetApplianceID *string `json:"targetApplianceID,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeSwitchProviderProviderSpecificInput', 'InstanceTypeInMageAzureV2' + InstanceType InstanceTypeBasicSwitchProviderProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2SwitchProviderProviderInput. +func (imavsppi InMageAzureV2SwitchProviderProviderInput) MarshalJSON() ([]byte, error) { + imavsppi.InstanceType = InstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavsppi.TargetVaultID != nil { + objectMap["targetVaultID"] = imavsppi.TargetVaultID + } + if imavsppi.TargetFabricID != nil { + objectMap["targetFabricID"] = imavsppi.TargetFabricID + } + if imavsppi.TargetApplianceID != nil { + objectMap["targetApplianceID"] = imavsppi.TargetApplianceID + } + if imavsppi.InstanceType != "" { + objectMap["instanceType"] = imavsppi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageAzureV2SwitchProviderProviderInput is the BasicSwitchProviderProviderSpecificInput implementation for InMageAzureV2SwitchProviderProviderInput. +func (imavsppi InMageAzureV2SwitchProviderProviderInput) AsInMageAzureV2SwitchProviderProviderInput() (*InMageAzureV2SwitchProviderProviderInput, bool) { + return &imavsppi, true +} + +// AsSwitchProviderProviderSpecificInput is the BasicSwitchProviderProviderSpecificInput implementation for InMageAzureV2SwitchProviderProviderInput. +func (imavsppi InMageAzureV2SwitchProviderProviderInput) AsSwitchProviderProviderSpecificInput() (*SwitchProviderProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicSwitchProviderProviderSpecificInput is the BasicSwitchProviderProviderSpecificInput implementation for InMageAzureV2SwitchProviderProviderInput. +func (imavsppi InMageAzureV2SwitchProviderProviderInput) AsBasicSwitchProviderProviderSpecificInput() (BasicSwitchProviderProviderSpecificInput, bool) { + return &imavsppi, true +} + +// InMageAzureV2TestFailoverInput inMageAzureV2 provider specific input for test failover. +type InMageAzureV2TestFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) MarshalJSON() ([]byte, error) { + imavtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imavtfi.RecoveryPointID + } + if imavtfi.InstanceType != "" { + objectMap["instanceType"] = imavtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return &imavtfi, true +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imavtfi, true +} + +// InMageAzureV2UnplannedFailoverInput inMageAzureV2 provider specific input for unplanned failover. +type InMageAzureV2UnplannedFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imavufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imavufi.RecoveryPointID + } + if imavufi.InstanceType != "" { + objectMap["instanceType"] = imavufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return &imavufi, true +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imavufi, true +} + +// InMageAzureV2UpdateReplicationProtectedItemInput inMage Azure V2 input to update replication protected +// item. +type InMageAzureV2UpdateReplicationProtectedItemInput struct { + // RecoveryAzureV1ResourceGroupID - The recovery Azure resource group Id for classic deployment. + RecoveryAzureV1ResourceGroupID *string `json:"recoveryAzureV1ResourceGroupId,omitempty"` + // RecoveryAzureV2ResourceGroupID - The recovery Azure resource group Id for resource manager deployment. + RecoveryAzureV2ResourceGroupID *string `json:"recoveryAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // VMDisks - The list of disk update properties. + VMDisks *[]UpdateDiskInput `json:"vmDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imavurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavurpii.RecoveryAzureV1ResourceGroupID != nil { + objectMap["recoveryAzureV1ResourceGroupId"] = imavurpii.RecoveryAzureV1ResourceGroupID + } + if imavurpii.RecoveryAzureV2ResourceGroupID != nil { + objectMap["recoveryAzureV2ResourceGroupId"] = imavurpii.RecoveryAzureV2ResourceGroupID + } + if imavurpii.UseManagedDisks != nil { + objectMap["useManagedDisks"] = imavurpii.UseManagedDisks + } + if imavurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavurpii.TargetProximityPlacementGroupID + } + if imavurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavurpii.TargetAvailabilityZone + } + if imavurpii.TargetVMTags != nil { + objectMap["targetVmTags"] = imavurpii.TargetVMTags + } + if imavurpii.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavurpii.TargetManagedDiskTags + } + if imavurpii.TargetNicTags != nil { + objectMap["targetNicTags"] = imavurpii.TargetNicTags + } + if imavurpii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = imavurpii.SQLServerLicenseType + } + if imavurpii.VMDisks != nil { + objectMap["vmDisks"] = imavurpii.VMDisks + } + if imavurpii.InstanceType != "" { + objectMap["instanceType"] = imavurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return &imavurpii, true +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &imavurpii, true +} + +// InMageBasePolicyDetails base class for the policies of providers using InMage replication. +type InMageBasePolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) MarshalJSON() ([]byte, error) { + imbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails + objectMap := make(map[string]interface{}) + if imbpd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imbpd.RecoveryPointThresholdInMinutes + } + if imbpd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imbpd.RecoveryPointHistory + } + if imbpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imbpd.AppConsistentFrequencyInMinutes + } + if imbpd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imbpd.MultiVMSyncStatus + } + if imbpd.InstanceType != "" { + objectMap["instanceType"] = imbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return &imbpd, true +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imbpd, true +} + +// InMageDisableProtectionProviderSpecificInput inMage disable protection provider specific input. +type InMageDisableProtectionProviderSpecificInput struct { + // ReplicaVMDeletionStatus - A value indicating whether the replica VM should be destroyed or retained. Values from Delete and Retain. + ReplicaVMDeletionStatus *string `json:"replicaVmDeletionStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeDisableProtectionProviderSpecificInput', 'InstanceTypeInMage' + InstanceType InstanceTypeBasicDisableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + imdppsi.InstanceType = InstanceTypeInMage + objectMap := make(map[string]interface{}) + if imdppsi.ReplicaVMDeletionStatus != nil { + objectMap["replicaVmDeletionStatus"] = imdppsi.ReplicaVMDeletionStatus + } + if imdppsi.InstanceType != "" { + objectMap["instanceType"] = imdppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) { + return &imdppsi, true +} + +// AsDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsBasicDisableProtectionProviderSpecificInput() (BasicDisableProtectionProviderSpecificInput, bool) { + return &imdppsi, true +} + +// InMageDiskDetails vMware/Physical specific Disk Details. +type InMageDiskDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskSizeInMB - The disk size in MB. + DiskSizeInMB *string `json:"diskSizeInMB,omitempty"` + // DiskType - Whether disk is system disk or data disk. + DiskType *string `json:"diskType,omitempty"` + // DiskConfiguration - Whether disk is dynamic disk or basic disk. + DiskConfiguration *string `json:"diskConfiguration,omitempty"` + // VolumeList - Volumes of the disk. + VolumeList *[]DiskVolumeDetails `json:"volumeList,omitempty"` +} + +// InMageDiskExclusionInput diskExclusionInput when doing enable protection of virtual machine in InMage +// provider. +type InMageDiskExclusionInput struct { + // VolumeOptions - The volume label based option for disk exclusion. + VolumeOptions *[]InMageVolumeExclusionOptions `json:"volumeOptions,omitempty"` + // DiskSignatureOptions - The guest disk signature based option for disk exclusion. + DiskSignatureOptions *[]InMageDiskSignatureExclusionOptions `json:"diskSignatureOptions,omitempty"` +} + +// InMageDiskSignatureExclusionOptions guest disk signature based disk exclusion option when doing enable +// protection of virtual machine in InMage provider. +type InMageDiskSignatureExclusionOptions struct { + // DiskSignature - The guest signature of disk to be excluded from replication. + DiskSignature *string `json:"diskSignature,omitempty"` +} + +// InMageEnableProtectionInput vMware Azure specific enable protection input. +type InMageEnableProtectionInput struct { + // VMFriendlyName - The VM Name. + VMFriendlyName *string `json:"vmFriendlyName,omitempty"` + // MasterTargetID - The Master Target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RetentionDrive - The retention drive to use on the MT. + RetentionDrive *string `json:"retentionDrive,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // MultiVMGroupID - The multi VM group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // DiskExclusionInput - The enable disk exclusion input. + DiskExclusionInput *InMageDiskExclusionInput `json:"diskExclusionInput,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) MarshalJSON() ([]byte, error) { + imepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imepi.VMFriendlyName != nil { + objectMap["vmFriendlyName"] = imepi.VMFriendlyName + } + if imepi.MasterTargetID != nil { + objectMap["masterTargetId"] = imepi.MasterTargetID + } + if imepi.ProcessServerID != nil { + objectMap["processServerId"] = imepi.ProcessServerID + } + if imepi.RetentionDrive != nil { + objectMap["retentionDrive"] = imepi.RetentionDrive + } + if imepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imepi.RunAsAccountID + } + if imepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imepi.MultiVMGroupID + } + if imepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imepi.MultiVMGroupName + } + if imepi.DatastoreName != nil { + objectMap["datastoreName"] = imepi.DatastoreName + } + if imepi.DiskExclusionInput != nil { + objectMap["diskExclusionInput"] = imepi.DiskExclusionInput + } + if imepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imepi.DisksToInclude + } + if imepi.InstanceType != "" { + objectMap["instanceType"] = imepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return &imepi, true +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imepi, true +} + +// InMageFabricSwitchProviderBlockingErrorDetails inMageFabric switch provider blocking error details. +type InMageFabricSwitchProviderBlockingErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageFabricSwitchProviderBlockingErrorDetails. +func (imfspbed InMageFabricSwitchProviderBlockingErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMagePolicyDetails inMage specific protection profile details. +type InMagePolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMagePolicyDetails. +func (impd InMagePolicyDetails) MarshalJSON() ([]byte, error) { + impd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage + objectMap := make(map[string]interface{}) + if impd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = impd.RecoveryPointThresholdInMinutes + } + if impd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = impd.RecoveryPointHistory + } + if impd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = impd.AppConsistentFrequencyInMinutes + } + if impd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = impd.MultiVMSyncStatus + } + if impd.InstanceType != "" { + objectMap["instanceType"] = impd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return &impd, true +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &impd, true +} + +// InMagePolicyInput vMWare Azure specific protection profile Input. +type InMagePolicyInput struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMagePolicyInput. +func (impi InMagePolicyInput) MarshalJSON() ([]byte, error) { + impi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if impi.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = impi.RecoveryPointThresholdInMinutes + } + if impi.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = impi.RecoveryPointHistory + } + if impi.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = impi.AppConsistentFrequencyInMinutes + } + if impi.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = impi.MultiVMSyncStatus + } + if impi.InstanceType != "" { + objectMap["instanceType"] = impi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return &impi, true +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &impi, true +} + +// InMageProtectedDiskDetails inMage protected disk details. +type InMageProtectedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // HealthErrorCode - The health error code for the disk. + HealthErrorCode *string `json:"healthErrorCode,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncDurationInSeconds - The resync duration in seconds. + ResyncDurationInSeconds *int64 `json:"resyncDurationInSeconds,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // FileSystemCapacityInBytes - The file system capacity in bytes. + FileSystemCapacityInBytes *int64 `json:"fileSystemCapacityInBytes,omitempty"` + // SourceDataInMB - The source data transit in MB. + SourceDataInMB *float64 `json:"sourceDataInMB,omitempty"` + // PsDataInMB - The PS data transit in MB. + PsDataInMB *float64 `json:"psDataInMB,omitempty"` + // TargetDataInMB - The target data transit in MB. + TargetDataInMB *float64 `json:"targetDataInMB,omitempty"` + // DiskResized - A value indicating whether disk is resized. + DiskResized *string `json:"diskResized,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // ResyncProcessedBytes - The resync processed bytes. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTotalTransferredBytes - The resync total transferred bytes. + ResyncTotalTransferredBytes *int64 `json:"resyncTotalTransferredBytes,omitempty"` + // ResyncLast15MinutesTransferredBytes - The resync last 15 minutes transferred bytes. + ResyncLast15MinutesTransferredBytes *int64 `json:"resyncLast15MinutesTransferredBytes,omitempty"` + // ResyncLastDataTransferTimeUTC - The last data transfer time in UTC. + ResyncLastDataTransferTimeUTC *date.Time `json:"resyncLastDataTransferTimeUTC,omitempty"` + // ResyncStartTime - The resync start time. + ResyncStartTime *date.Time `json:"resyncStartTime,omitempty"` + // ProgressHealth - The Progress Health. + ProgressHealth *string `json:"progressHealth,omitempty"` + // ProgressStatus - The Progress Status. + ProgressStatus *string `json:"progressStatus,omitempty"` +} + +// InMageRcmAgentUpgradeBlockingErrorDetails inMageRcm source agent upgrade blocking error details. +type InMageRcmAgentUpgradeBlockingErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageRcmAgentUpgradeBlockingErrorDetails. +func (imraubed InMageRcmAgentUpgradeBlockingErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmApplianceDetails inMageRcm appliance details. +type InMageRcmApplianceDetails struct { + // ID - READ-ONLY; The appliance Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The appliance name. + Name *string `json:"name,omitempty"` + // FabricArmID - READ-ONLY; The fabric ARM Id. + FabricArmID *string `json:"fabricArmId,omitempty"` + // ProcessServer - READ-ONLY; The process server. + ProcessServer *ProcessServerDetails `json:"processServer,omitempty"` + // RcmProxy - READ-ONLY; The of RCM proxy. + RcmProxy *RcmProxyDetails `json:"rcmProxy,omitempty"` + // PushInstaller - READ-ONLY; The push installer. + PushInstaller *PushInstallerDetails `json:"pushInstaller,omitempty"` + // ReplicationAgent - READ-ONLY; The replication agent. + ReplicationAgent *ReplicationAgentDetails `json:"replicationAgent,omitempty"` + // ReprotectAgent - READ-ONLY; The reprotect agent. + ReprotectAgent *ReprotectAgentDetails `json:"reprotectAgent,omitempty"` + // MarsAgent - READ-ONLY; The Mars agent. + MarsAgent *MarsAgentDetails `json:"marsAgent,omitempty"` + // Dra - READ-ONLY; The DRA. + Dra *DraDetails `json:"dra,omitempty"` + // SwitchProviderBlockingErrorDetails - READ-ONLY; The switch provider blocking error information. + SwitchProviderBlockingErrorDetails *[]InMageRcmFabricSwitchProviderBlockingErrorDetails `json:"switchProviderBlockingErrorDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmApplianceDetails. +func (imrad InMageRcmApplianceDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmApplianceSpecificDetails inMageRcm appliance specific details. +type InMageRcmApplianceSpecificDetails struct { + // Appliances - READ-ONLY; The list of appliances. + Appliances *[]InMageRcmApplianceDetails `json:"appliances,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeApplianceSpecificDetails', 'InstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplianceSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmApplianceSpecificDetails. +func (imrasd InMageRcmApplianceSpecificDetails) MarshalJSON() ([]byte, error) { + imrasd.InstanceType = InstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrasd.InstanceType != "" { + objectMap["instanceType"] = imrasd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageRcmApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for InMageRcmApplianceSpecificDetails. +func (imrasd InMageRcmApplianceSpecificDetails) AsInMageRcmApplianceSpecificDetails() (*InMageRcmApplianceSpecificDetails, bool) { + return &imrasd, true +} + +// AsApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for InMageRcmApplianceSpecificDetails. +func (imrasd InMageRcmApplianceSpecificDetails) AsApplianceSpecificDetails() (*ApplianceSpecificDetails, bool) { + return nil, false +} + +// AsBasicApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for InMageRcmApplianceSpecificDetails. +func (imrasd InMageRcmApplianceSpecificDetails) AsBasicApplianceSpecificDetails() (BasicApplianceSpecificDetails, bool) { + return &imrasd, true +} + +// InMageRcmApplyRecoveryPointInput applyRecoveryPoint input specific to InMageRcm provider. +type InMageRcmApplyRecoveryPointInput struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + imrarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrarpi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrarpi.RecoveryPointID + } + if imrarpi.InstanceType != "" { + objectMap["instanceType"] = imrarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return &imrarpi, true +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &imrarpi, true +} + +// InMageRcmDiscoveredProtectedVMDetails inMageRcm discovered protected VM details. +type InMageRcmDiscoveredProtectedVMDetails struct { + // VCenterID - READ-ONLY; The VCenter Id. + VCenterID *string `json:"vCenterId,omitempty"` + // VCenterFqdn - READ-ONLY; The VCenter fqdn. + VCenterFqdn *string `json:"vCenterFqdn,omitempty"` + // Datastores - READ-ONLY; The list of datastores. + Datastores *[]string `json:"datastores,omitempty"` + // IPAddresses - READ-ONLY; The list of IP addresses. + IPAddresses *[]string `json:"ipAddresses,omitempty"` + // VmwareToolsStatus - READ-ONLY; The VMware tools status. + VmwareToolsStatus *string `json:"vmwareToolsStatus,omitempty"` + // PowerStatus - READ-ONLY; The VM power status. + PowerStatus *string `json:"powerStatus,omitempty"` + // VMFqdn - READ-ONLY; The VM fqdn. + VMFqdn *string `json:"vmFqdn,omitempty"` + // OsName - READ-ONLY; The VM's OS name. + OsName *string `json:"osName,omitempty"` + // CreatedTimestamp - READ-ONLY; The SDS created timestamp. + CreatedTimestamp *date.Time `json:"createdTimestamp,omitempty"` + // UpdatedTimestamp - READ-ONLY; The SDS updated timestamp. + UpdatedTimestamp *date.Time `json:"updatedTimestamp,omitempty"` + // IsDeleted - READ-ONLY; A value indicating whether the VM is deleted. + IsDeleted *bool `json:"isDeleted,omitempty"` + // LastDiscoveryTimeInUtc - READ-ONLY; The last time when SDS information discovered in SRS. + LastDiscoveryTimeInUtc *date.Time `json:"lastDiscoveryTimeInUtc,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmDiscoveredProtectedVMDetails. +func (imrdpvd InMageRcmDiscoveredProtectedVMDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmDiskInput inMageRcm disk input. +type InMageRcmDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageRcmDisksDefaultInput inMageRcm disk input. +type InMageRcmDisksDefaultInput struct { + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageRcmEnableProtectionInput inMageRcm specific enable protection input. +type InMageRcmEnableProtectionInput struct { + // FabricDiscoveryMachineID - The ARM Id of discovered machine. + FabricDiscoveryMachineID *string `json:"fabricDiscoveryMachineId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]InMageRcmDiskInput `json:"disksToInclude,omitempty"` + // DisksDefault - The default disk input. + DisksDefault *InMageRcmDisksDefaultInput `json:"disksDefault,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetNetworkID - The selected target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The selected test network ARM Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // TargetSubnetName - The selected target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TestSubnetName - The selected test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // RunAsAccountID - The run-as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) MarshalJSON() ([]byte, error) { + imrepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrepi.FabricDiscoveryMachineID != nil { + objectMap["fabricDiscoveryMachineId"] = imrepi.FabricDiscoveryMachineID + } + if imrepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imrepi.DisksToInclude + } + if imrepi.DisksDefault != nil { + objectMap["disksDefault"] = imrepi.DisksDefault + } + if imrepi.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrepi.TargetResourceGroupID + } + if imrepi.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrepi.TargetNetworkID + } + if imrepi.TestNetworkID != nil { + objectMap["testNetworkId"] = imrepi.TestNetworkID + } + if imrepi.TargetSubnetName != nil { + objectMap["targetSubnetName"] = imrepi.TargetSubnetName + } + if imrepi.TestSubnetName != nil { + objectMap["testSubnetName"] = imrepi.TestSubnetName + } + if imrepi.TargetVMName != nil { + objectMap["targetVmName"] = imrepi.TargetVMName + } + if imrepi.TargetVMSize != nil { + objectMap["targetVmSize"] = imrepi.TargetVMSize + } + if imrepi.LicenseType != "" { + objectMap["licenseType"] = imrepi.LicenseType + } + if imrepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrepi.TargetAvailabilitySetID + } + if imrepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrepi.TargetAvailabilityZone + } + if imrepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrepi.TargetProximityPlacementGroupID + } + if imrepi.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrepi.TargetBootDiagnosticsStorageAccountID + } + if imrepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imrepi.RunAsAccountID + } + if imrepi.ProcessServerID != nil { + objectMap["processServerId"] = imrepi.ProcessServerID + } + if imrepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imrepi.MultiVMGroupName + } + if imrepi.InstanceType != "" { + objectMap["instanceType"] = imrepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return &imrepi, true +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imrepi, true +} + +// InMageRcmEventDetails event details for InMageRcm provider. +type InMageRcmEventDetails struct { + // ProtectedItemName - READ-ONLY; The protected item name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // VMName - READ-ONLY; The protected item name. + VMName *string `json:"vmName,omitempty"` + // LatestAgentVersion - READ-ONLY; The latest agent version. + LatestAgentVersion *string `json:"latestAgentVersion,omitempty"` + // JobID - READ-ONLY; The job Id. + JobID *string `json:"jobId,omitempty"` + // FabricName - READ-ONLY; The fabric name. + FabricName *string `json:"fabricName,omitempty"` + // ApplianceName - READ-ONLY; The appliance name. + ApplianceName *string `json:"applianceName,omitempty"` + // ServerType - READ-ONLY; The server type. + ServerType *string `json:"serverType,omitempty"` + // ComponentDisplayName - READ-ONLY; The component display name. + ComponentDisplayName *string `json:"componentDisplayName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) MarshalJSON() ([]byte, error) { + imred.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imred.InstanceType != "" { + objectMap["instanceType"] = imred.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return &imred, true +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imred, true +} + +// InMageRcmFabricCreationInput inMageRcm fabric provider specific settings. +type InMageRcmFabricCreationInput struct { + // VmwareSiteID - The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // SourceAgentIdentity - The identity provider input for source agent authentication. + SourceAgentIdentity *IdentityProviderInput `json:"sourceAgentIdentity,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) MarshalJSON() ([]byte, error) { + imrfci.InstanceType = InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrfci.VmwareSiteID != nil { + objectMap["vmwareSiteId"] = imrfci.VmwareSiteID + } + if imrfci.PhysicalSiteID != nil { + objectMap["physicalSiteId"] = imrfci.PhysicalSiteID + } + if imrfci.SourceAgentIdentity != nil { + objectMap["sourceAgentIdentity"] = imrfci.SourceAgentIdentity + } + if imrfci.InstanceType != "" { + objectMap["instanceType"] = imrfci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return &imrfci, true +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &imrfci, true +} + +// InMageRcmFabricSpecificDetails inMageRcm fabric specific details. +type InMageRcmFabricSpecificDetails struct { + // VmwareSiteID - READ-ONLY; The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - READ-ONLY; The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // ServiceEndpoint - READ-ONLY; The service endpoint. + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` + // ServiceResourceID - READ-ONLY; The service resource Id. + ServiceResourceID *string `json:"serviceResourceId,omitempty"` + // ServiceContainerID - READ-ONLY; The service container Id. + ServiceContainerID *string `json:"serviceContainerId,omitempty"` + // DataPlaneURI - READ-ONLY; The data plane Uri. + DataPlaneURI *string `json:"dataPlaneUri,omitempty"` + // ControlPlaneURI - READ-ONLY; The control plane Uri. + ControlPlaneURI *string `json:"controlPlaneUri,omitempty"` + // SourceAgentIdentityDetails - The source agent identity details. + SourceAgentIdentityDetails *IdentityProviderDetails `json:"sourceAgentIdentityDetails,omitempty"` + // ProcessServers - READ-ONLY; The list of process servers. + ProcessServers *[]ProcessServerDetails `json:"processServers,omitempty"` + // RcmProxies - READ-ONLY; The list of RCM proxies. + RcmProxies *[]RcmProxyDetails `json:"rcmProxies,omitempty"` + // PushInstallers - READ-ONLY; The list of push installers. + PushInstallers *[]PushInstallerDetails `json:"pushInstallers,omitempty"` + // ReplicationAgents - READ-ONLY; The list of replication agents. + ReplicationAgents *[]ReplicationAgentDetails `json:"replicationAgents,omitempty"` + // ReprotectAgents - READ-ONLY; The list of reprotect agents. + ReprotectAgents *[]ReprotectAgentDetails `json:"reprotectAgents,omitempty"` + // MarsAgents - READ-ONLY; The list of Mars agents. + MarsAgents *[]MarsAgentDetails `json:"marsAgents,omitempty"` + // Dras - READ-ONLY; The list of DRAs. + Dras *[]DraDetails `json:"dras,omitempty"` + // AgentDetails - READ-ONLY; The list of agent details. + AgentDetails *[]AgentDetails `json:"agentDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) MarshalJSON() ([]byte, error) { + imrfsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrfsd.SourceAgentIdentityDetails != nil { + objectMap["sourceAgentIdentityDetails"] = imrfsd.SourceAgentIdentityDetails + } + if imrfsd.InstanceType != "" { + objectMap["instanceType"] = imrfsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return &imrfsd, true +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &imrfsd, true +} + +// InMageRcmFabricSwitchProviderBlockingErrorDetails inMageRcmFabric switch provider blocking error +// details. +type InMageRcmFabricSwitchProviderBlockingErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFabricSwitchProviderBlockingErrorDetails. +func (imrfspbed InMageRcmFabricSwitchProviderBlockingErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackDiscoveredProtectedVMDetails inMageRcmFailback discovered VM details. +type InMageRcmFailbackDiscoveredProtectedVMDetails struct { + // VCenterID - READ-ONLY; The VCenter Id. + VCenterID *string `json:"vCenterId,omitempty"` + // VCenterFqdn - READ-ONLY; The VCenter fqdn. + VCenterFqdn *string `json:"vCenterFqdn,omitempty"` + // Datastores - READ-ONLY; The list of datastores. + Datastores *[]string `json:"datastores,omitempty"` + // IPAddresses - READ-ONLY; The list of IP addresses. + IPAddresses *[]string `json:"ipAddresses,omitempty"` + // VmwareToolsStatus - READ-ONLY; The VMware tools status. + VmwareToolsStatus *string `json:"vmwareToolsStatus,omitempty"` + // PowerStatus - READ-ONLY; The VM power status. + PowerStatus *string `json:"powerStatus,omitempty"` + // VMFqdn - READ-ONLY; The VM fqdn. + VMFqdn *string `json:"vmFqdn,omitempty"` + // OsName - READ-ONLY; The VM's OS name. + OsName *string `json:"osName,omitempty"` + // CreatedTimestamp - READ-ONLY; The SDS created timestamp. + CreatedTimestamp *date.Time `json:"createdTimestamp,omitempty"` + // UpdatedTimestamp - READ-ONLY; The SDS updated timestamp. + UpdatedTimestamp *date.Time `json:"updatedTimestamp,omitempty"` + // IsDeleted - READ-ONLY; A value indicating whether the VM is deleted. + IsDeleted *bool `json:"isDeleted,omitempty"` + // LastDiscoveryTimeInUtc - READ-ONLY; The last time when SDS information discovered in SRS. + LastDiscoveryTimeInUtc *date.Time `json:"lastDiscoveryTimeInUtc,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackDiscoveredProtectedVMDetails. +func (imrfdpvd InMageRcmFailbackDiscoveredProtectedVMDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackEventDetails event details for InMageRcmFailback provider. +type InMageRcmFailbackEventDetails struct { + // ProtectedItemName - READ-ONLY; The protected item name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // VMName - READ-ONLY; The protected item name. + VMName *string `json:"vmName,omitempty"` + // ApplianceName - READ-ONLY; The appliance name. + ApplianceName *string `json:"applianceName,omitempty"` + // ServerType - READ-ONLY; The server type. + ServerType *string `json:"serverType,omitempty"` + // ComponentDisplayName - READ-ONLY; The component display name. + ComponentDisplayName *string `json:"componentDisplayName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) MarshalJSON() ([]byte, error) { + imrfed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfed.InstanceType != "" { + objectMap["instanceType"] = imrfed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return &imrfed, true +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imrfed, true +} + +// InMageRcmFailbackMobilityAgentDetails inMageRcmFailback mobility agent details. +type InMageRcmFailbackMobilityAgentDetails struct { + // Version - READ-ONLY; The agent version. + Version *string `json:"version,omitempty"` + // LatestVersion - READ-ONLY; The latest agent version available. + LatestVersion *string `json:"latestVersion,omitempty"` + // DriverVersion - READ-ONLY; The driver version. + DriverVersion *string `json:"driverVersion,omitempty"` + // LatestUpgradableVersionWithoutReboot - READ-ONLY; The latest upgradeable version available without reboot. + LatestUpgradableVersionWithoutReboot *string `json:"latestUpgradableVersionWithoutReboot,omitempty"` + // AgentVersionExpiryDate - READ-ONLY; The agent version expiry date. + AgentVersionExpiryDate *date.Time `json:"agentVersionExpiryDate,omitempty"` + // DriverVersionExpiryDate - READ-ONLY; The driver version expiry date. + DriverVersionExpiryDate *date.Time `json:"driverVersionExpiryDate,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The time of the last heartbeat received from the agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // ReasonsBlockingUpgrade - READ-ONLY; The whether update is possible or not. + ReasonsBlockingUpgrade *[]AgentUpgradeBlockedReason `json:"reasonsBlockingUpgrade,omitempty"` + // IsUpgradeable - READ-ONLY; A value indicating whether agent is upgradeable or not. + IsUpgradeable *string `json:"isUpgradeable,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackMobilityAgentDetails. +func (imrfmad InMageRcmFailbackMobilityAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackNicDetails inMageRcmFailback NIC details. +type InMageRcmFailbackNicDetails struct { + // MacAddress - READ-ONLY; The mac address. + MacAddress *string `json:"macAddress,omitempty"` + // NetworkName - READ-ONLY; The network name. + NetworkName *string `json:"networkName,omitempty"` + // AdapterType - READ-ONLY; The adapter type. + AdapterType *string `json:"adapterType,omitempty"` + // SourceIPAddress - READ-ONLY; The IP address. + SourceIPAddress *string `json:"sourceIpAddress,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackNicDetails. +func (imrfnd InMageRcmFailbackNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackPlannedFailoverProviderInput provider specific input for InMageRcmFailback failover. +type InMageRcmFailbackPlannedFailoverProviderInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'ApplicationConsistent', 'CrashConsistent' + RecoveryPointType InMageRcmFailbackRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) MarshalJSON() ([]byte, error) { + imrfpfpi.InstanceType = InstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpfpi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imrfpfpi.RecoveryPointType + } + if imrfpfpi.InstanceType != "" { + objectMap["instanceType"] = imrfpfpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return &imrfpfpi, true +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &imrfpfpi, true +} + +// InMageRcmFailbackPolicyCreationInput inMageRcmFailback policy creation input. +type InMageRcmFailbackPolicyCreationInput struct { + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) MarshalJSON() ([]byte, error) { + imrfpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrfpci.CrashConsistentFrequencyInMinutes + } + if imrfpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrfpci.AppConsistentFrequencyInMinutes + } + if imrfpci.InstanceType != "" { + objectMap["instanceType"] = imrfpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return &imrfpci, true +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imrfpci, true +} + +// InMageRcmFailbackPolicyDetails inMageRcm failback specific policy details. +type InMageRcmFailbackPolicyDetails struct { + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) MarshalJSON() ([]byte, error) { + imrfpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrfpd.AppConsistentFrequencyInMinutes + } + if imrfpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrfpd.CrashConsistentFrequencyInMinutes + } + if imrfpd.InstanceType != "" { + objectMap["instanceType"] = imrfpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return &imrfpd, true +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imrfpd, true +} + +// InMageRcmFailbackProtectedDiskDetails inMageRcmFailback protected disk details. +type InMageRcmFailbackProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk Id (reported by source agent). + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // DiskUUID - READ-ONLY; The disk Uuid (reported by vCenter). + DiskUUID *string `json:"diskUuid,omitempty"` + // DataPendingInLogDataStoreInMB - READ-ONLY; The data pending in log data store in MB. + DataPendingInLogDataStoreInMB *float64 `json:"dataPendingInLogDataStoreInMB,omitempty"` + // DataPendingAtSourceAgentInMB - READ-ONLY; The data pending at source agent in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // IsInitialReplicationComplete - READ-ONLY; A value indicating whether initial replication is complete or not. + IsInitialReplicationComplete *string `json:"isInitialReplicationComplete,omitempty"` + // IrDetails - The initial replication details. + IrDetails *InMageRcmFailbackSyncDetails `json:"irDetails,omitempty"` + // ResyncDetails - The resync details. + ResyncDetails *InMageRcmFailbackSyncDetails `json:"resyncDetails,omitempty"` + // LastSyncTime - READ-ONLY; The last sync time. + LastSyncTime *date.Time `json:"lastSyncTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackProtectedDiskDetails. +func (imrfpdd InMageRcmFailbackProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrfpdd.IrDetails != nil { + objectMap["irDetails"] = imrfpdd.IrDetails + } + if imrfpdd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrfpdd.ResyncDetails + } + return json.Marshal(objectMap) +} + +// InMageRcmFailbackReplicationDetails inMageRcmFailback provider specific details. +type InMageRcmFailbackReplicationDetails struct { + // InternalIdentifier - READ-ONLY; The virtual machine internal identifier. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // AzureVirtualMachineID - READ-ONLY; The ARM Id of the azure VM. + AzureVirtualMachineID *string `json:"azureVirtualMachineId,omitempty"` + // MultiVMGroupName - READ-ONLY; The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // ReprotectAgentID - READ-ONLY; The reprotect agent Id. + ReprotectAgentID *string `json:"reprotectAgentId,omitempty"` + // ReprotectAgentName - READ-ONLY; The reprotect agent name. + ReprotectAgentName *string `json:"reprotectAgentName,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // TargetvCenterID - READ-ONLY; The target vCenter Id. + TargetvCenterID *string `json:"targetvCenterId,omitempty"` + // TargetDataStoreName - READ-ONLY; The target datastore name. + TargetDataStoreName *string `json:"targetDataStoreName,omitempty"` + // TargetVMName - READ-ONLY; The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // InitialReplicationProgressPercentage - READ-ONLY; The initial replication progress percentage. + InitialReplicationProgressPercentage *int32 `json:"initialReplicationProgressPercentage,omitempty"` + // InitialReplicationProcessedBytes - READ-ONLY; The initial replication processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + InitialReplicationProcessedBytes *int64 `json:"initialReplicationProcessedBytes,omitempty"` + // InitialReplicationTransferredBytes - READ-ONLY; The initial replication transferred bytes from source VM to target for all selected disks on source VM. + InitialReplicationTransferredBytes *int64 `json:"initialReplicationTransferredBytes,omitempty"` + // InitialReplicationProgressHealth - READ-ONLY; The initial replication progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + InitialReplicationProgressHealth VMReplicationProgressHealth `json:"initialReplicationProgressHealth,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncProcessedBytes - READ-ONLY; The resync processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTransferredBytes - READ-ONLY; The resync transferred bytes from source VM to target for all selected disks on source VM. + ResyncTransferredBytes *int64 `json:"resyncTransferredBytes,omitempty"` + // ResyncProgressHealth - READ-ONLY; The resync progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + ResyncProgressHealth VMReplicationProgressHealth `json:"resyncProgressHealth,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageRcmFailbackProtectedDiskDetails `json:"protectedDisks,omitempty"` + // MobilityAgentDetails - The mobility agent information. + MobilityAgentDetails *InMageRcmFailbackMobilityAgentDetails `json:"mobilityAgentDetails,omitempty"` + // VMNics - The network details. + VMNics *[]InMageRcmFailbackNicDetails `json:"vmNics,omitempty"` + // LastPlannedFailoverStartTime - READ-ONLY; The last planned failover start time. + LastPlannedFailoverStartTime *date.Time `json:"lastPlannedFailoverStartTime,omitempty"` + // LastPlannedFailoverStatus - READ-ONLY; The last planned failover status. Possible values include: 'PlannedFailoverStatusSucceeded', 'PlannedFailoverStatusFailed', 'PlannedFailoverStatusCancelled', 'PlannedFailoverStatusUnknown' + LastPlannedFailoverStatus PlannedFailoverStatus `json:"lastPlannedFailoverStatus,omitempty"` + // DiscoveredVMDetails - The discovered VM information. + DiscoveredVMDetails *InMageRcmFailbackDiscoveredProtectedVMDetails `json:"discoveredVmDetails,omitempty"` + // LastUsedPolicyID - READ-ONLY; The policy Id used by the forward replication. + LastUsedPolicyID *string `json:"lastUsedPolicyId,omitempty"` + // LastUsedPolicyFriendlyName - READ-ONLY; The policy friendly name used by the forward replication. + LastUsedPolicyFriendlyName *string `json:"lastUsedPolicyFriendlyName,omitempty"` + // IsAgentRegistrationSuccessfulAfterFailover - READ-ONLY; A value indicating whether agent registration was successful after failover. + IsAgentRegistrationSuccessfulAfterFailover *bool `json:"isAgentRegistrationSuccessfulAfterFailover,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) MarshalJSON() ([]byte, error) { + imrfrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrfrd.ProtectedDisks + } + if imrfrd.MobilityAgentDetails != nil { + objectMap["mobilityAgentDetails"] = imrfrd.MobilityAgentDetails + } + if imrfrd.VMNics != nil { + objectMap["vmNics"] = imrfrd.VMNics + } + if imrfrd.DiscoveredVMDetails != nil { + objectMap["discoveredVmDetails"] = imrfrd.DiscoveredVMDetails + } + if imrfrd.InstanceType != "" { + objectMap["instanceType"] = imrfrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return &imrfrd, true +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrfrd, true +} + +// InMageRcmFailbackReprotectInput inMageRcmFailback specific provider input. +type InMageRcmFailbackReprotectInput struct { + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RunAsAccountID - The run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) MarshalJSON() ([]byte, error) { + imrfri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfri.ProcessServerID != nil { + objectMap["processServerId"] = imrfri.ProcessServerID + } + if imrfri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imrfri.RunAsAccountID + } + if imrfri.PolicyID != nil { + objectMap["policyId"] = imrfri.PolicyID + } + if imrfri.InstanceType != "" { + objectMap["instanceType"] = imrfri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return &imrfri, true +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imrfri, true +} + +// InMageRcmFailbackSyncDetails inMageRcmFailback disk level sync details. +type InMageRcmFailbackSyncDetails struct { + // ProgressHealth - READ-ONLY; The progress health. Possible values include: 'None', 'InProgress', 'SlowProgress', 'NoProgress', 'Queued' + ProgressHealth DiskReplicationProgressHealth `json:"progressHealth,omitempty"` + // TransferredBytes - READ-ONLY; The transferred bytes from source VM to azure for the disk. + TransferredBytes *int64 `json:"transferredBytes,omitempty"` + // Last15MinutesTransferredBytes - READ-ONLY; The bytes transferred in last 15 minutes from source VM to target. + Last15MinutesTransferredBytes *int64 `json:"last15MinutesTransferredBytes,omitempty"` + // LastDataTransferTimeUtc - READ-ONLY; The time of the last data transfer from source VM to target. + LastDataTransferTimeUtc *string `json:"lastDataTransferTimeUtc,omitempty"` + // ProcessedBytes - READ-ONLY; The total processed bytes. This includes bytes that are transferred from source VM to target and matched bytes. + ProcessedBytes *int64 `json:"processedBytes,omitempty"` + // StartTime - READ-ONLY; The start time. + StartTime *string `json:"startTime,omitempty"` + // LastRefreshTime - READ-ONLY; The last refresh time. + LastRefreshTime *string `json:"lastRefreshTime,omitempty"` + // ProgressPercentage - READ-ONLY; Progress in percentage. Progress percentage is calculated based on processed bytes. + ProgressPercentage *int32 `json:"progressPercentage,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackSyncDetails. +func (imrfsd InMageRcmFailbackSyncDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmLastAgentUpgradeErrorDetails inMageRcm last source agent upgrade error details. +type InMageRcmLastAgentUpgradeErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageRcmLastAgentUpgradeErrorDetails. +func (imrlaued InMageRcmLastAgentUpgradeErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmMobilityAgentDetails inMageRcm mobility agent details. +type InMageRcmMobilityAgentDetails struct { + // Version - READ-ONLY; The agent version. + Version *string `json:"version,omitempty"` + // LatestVersion - READ-ONLY; The latest agent version available. + LatestVersion *string `json:"latestVersion,omitempty"` + // LatestAgentReleaseDate - READ-ONLY; The latest agent version release date. + LatestAgentReleaseDate *string `json:"latestAgentReleaseDate,omitempty"` + // DriverVersion - READ-ONLY; The driver version. + DriverVersion *string `json:"driverVersion,omitempty"` + // LatestUpgradableVersionWithoutReboot - READ-ONLY; The latest upgradeable version available without reboot. + LatestUpgradableVersionWithoutReboot *string `json:"latestUpgradableVersionWithoutReboot,omitempty"` + // AgentVersionExpiryDate - READ-ONLY; The agent version expiry date. + AgentVersionExpiryDate *date.Time `json:"agentVersionExpiryDate,omitempty"` + // DriverVersionExpiryDate - READ-ONLY; The driver version expiry date. + DriverVersionExpiryDate *date.Time `json:"driverVersionExpiryDate,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The time of the last heartbeat received from the agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // ReasonsBlockingUpgrade - READ-ONLY; The whether update is possible or not. + ReasonsBlockingUpgrade *[]AgentUpgradeBlockedReason `json:"reasonsBlockingUpgrade,omitempty"` + // IsUpgradeable - READ-ONLY; A value indicating whether agent is upgradeable or not. + IsUpgradeable *string `json:"isUpgradeable,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmMobilityAgentDetails. +func (imrmad InMageRcmMobilityAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmNicDetails inMageRcm NIC details. +type InMageRcmNicDetails struct { + // NicID - READ-ONLY; The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // IsSelectedForFailover - A value indicating whether this NIC is selected for failover. + IsSelectedForFailover *string `json:"isSelectedForFailover,omitempty"` + // SourceIPAddress - READ-ONLY; The source IP address. + SourceIPAddress *string `json:"sourceIPAddress,omitempty"` + // SourceIPAddressType - READ-ONLY; The source IP address type. Possible values include: 'Dynamic', 'Static' + SourceIPAddressType EthernetAddressType `json:"sourceIPAddressType,omitempty"` + // SourceNetworkID - READ-ONLY; Source network Id. + SourceNetworkID *string `json:"sourceNetworkId,omitempty"` + // SourceSubnetName - READ-ONLY; Source subnet name. + SourceSubnetName *string `json:"sourceSubnetName,omitempty"` + // TargetIPAddress - The target IP address. + TargetIPAddress *string `json:"targetIPAddress,omitempty"` + // TargetIPAddressType - The target IP address type. Possible values include: 'Dynamic', 'Static' + TargetIPAddressType EthernetAddressType `json:"targetIPAddressType,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TestSubnetName - Test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TestIPAddress - The test IP address. + TestIPAddress *string `json:"testIPAddress,omitempty"` + // TestIPAddressType - The test IP address type. Possible values include: 'Dynamic', 'Static' + TestIPAddressType EthernetAddressType `json:"testIPAddressType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmNicDetails. +func (imrnd InMageRcmNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrnd.IsPrimaryNic != nil { + objectMap["isPrimaryNic"] = imrnd.IsPrimaryNic + } + if imrnd.IsSelectedForFailover != nil { + objectMap["isSelectedForFailover"] = imrnd.IsSelectedForFailover + } + if imrnd.TargetIPAddress != nil { + objectMap["targetIPAddress"] = imrnd.TargetIPAddress + } + if imrnd.TargetIPAddressType != "" { + objectMap["targetIPAddressType"] = imrnd.TargetIPAddressType + } + if imrnd.TargetSubnetName != nil { + objectMap["targetSubnetName"] = imrnd.TargetSubnetName + } + if imrnd.TestSubnetName != nil { + objectMap["testSubnetName"] = imrnd.TestSubnetName + } + if imrnd.TestIPAddress != nil { + objectMap["testIPAddress"] = imrnd.TestIPAddress + } + if imrnd.TestIPAddressType != "" { + objectMap["testIPAddressType"] = imrnd.TestIPAddressType + } + return json.Marshal(objectMap) +} + +// InMageRcmNicInput inMageRcm NIC input. +type InMageRcmNicInput struct { + // NicID - The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // IsSelectedForFailover - A value indicating whether this NIC is selected for failover. + IsSelectedForFailover *string `json:"isSelectedForFailover,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetStaticIPAddress - The target static IP address. + TargetStaticIPAddress *string `json:"targetStaticIPAddress,omitempty"` + // TestSubnetName - The test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TestStaticIPAddress - The test static IP address. + TestStaticIPAddress *string `json:"testStaticIPAddress,omitempty"` +} + +// InMageRcmPolicyCreationInput inMageRcm policy creation input. +type InMageRcmPolicyCreationInput struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // EnableMultiVMSync - A value indicating whether multi-VM sync has to be enabled. + EnableMultiVMSync *string `json:"enableMultiVmSync,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) MarshalJSON() ([]byte, error) { + imrpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpci.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = imrpci.RecoveryPointHistoryInMinutes + } + if imrpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrpci.CrashConsistentFrequencyInMinutes + } + if imrpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrpci.AppConsistentFrequencyInMinutes + } + if imrpci.EnableMultiVMSync != nil { + objectMap["enableMultiVmSync"] = imrpci.EnableMultiVMSync + } + if imrpci.InstanceType != "" { + objectMap["instanceType"] = imrpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return &imrpci, true +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imrpci, true +} + +// InMageRcmPolicyDetails inMageRcm specific policy details. +type InMageRcmPolicyDetails struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // EnableMultiVMSync - A value indicating whether multi-VM sync has to be enabled. + EnableMultiVMSync *string `json:"enableMultiVmSync,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) MarshalJSON() ([]byte, error) { + imrpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpd.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = imrpd.RecoveryPointHistoryInMinutes + } + if imrpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrpd.AppConsistentFrequencyInMinutes + } + if imrpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrpd.CrashConsistentFrequencyInMinutes + } + if imrpd.EnableMultiVMSync != nil { + objectMap["enableMultiVmSync"] = imrpd.EnableMultiVMSync + } + if imrpd.InstanceType != "" { + objectMap["instanceType"] = imrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return &imrpd, true +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imrpd, true +} + +// InMageRcmProtectedDiskDetails inMageRcm protected disk details. +type InMageRcmProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskEncryptionSetID - READ-ONLY; The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // SeedManagedDiskID - READ-ONLY; The ARM Id of the seed managed disk. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // TargetManagedDiskID - READ-ONLY; The ARM Id of the target managed disk. + TargetManagedDiskID *string `json:"targetManagedDiskId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DataPendingInLogDataStoreInMB - READ-ONLY; The data pending in log data store in MB. + DataPendingInLogDataStoreInMB *float64 `json:"dataPendingInLogDataStoreInMB,omitempty"` + // DataPendingAtSourceAgentInMB - READ-ONLY; The data pending at source agent in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // IsInitialReplicationComplete - READ-ONLY; A value indicating whether initial replication is complete or not. + IsInitialReplicationComplete *string `json:"isInitialReplicationComplete,omitempty"` + // IrDetails - The initial replication details. + IrDetails *InMageRcmSyncDetails `json:"irDetails,omitempty"` + // ResyncDetails - The resync details. + ResyncDetails *InMageRcmSyncDetails `json:"resyncDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmProtectedDiskDetails. +func (imrpdd InMageRcmProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrpdd.DiskType != "" { + objectMap["diskType"] = imrpdd.DiskType + } + if imrpdd.IrDetails != nil { + objectMap["irDetails"] = imrpdd.IrDetails + } + if imrpdd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrpdd.ResyncDetails + } + return json.Marshal(objectMap) +} + +// InMageRcmProtectionContainerMappingDetails inMageRcm provider specific container mapping details. +type InMageRcmProtectionContainerMappingDetails struct { + // EnableAgentAutoUpgrade - READ-ONLY; A value indicating whether the flag for enable agent auto upgrade. + EnableAgentAutoUpgrade *string `json:"enableAgentAutoUpgrade,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + imrpcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpcmd.InstanceType != "" { + objectMap["instanceType"] = imrpcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return &imrpcmd, true +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &imrpcmd, true +} + +// InMageRcmRecoveryPointDetails inMageRcm provider specific recovery point details. +type InMageRcmRecoveryPointDetails struct { + // IsMultiVMSyncPoint - READ-ONLY; A value indicating whether the recovery point is multi VM consistent. + IsMultiVMSyncPoint *string `json:"isMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) MarshalJSON() ([]byte, error) { + imrrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrrpd.InstanceType != "" { + objectMap["instanceType"] = imrrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return &imrrpd, true +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &imrrpd, true +} + +// InMageRcmReplicationDetails inMageRcm provider specific details. +type InMageRcmReplicationDetails struct { + // InternalIdentifier - READ-ONLY; The virtual machine internal identifier. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // FabricDiscoveryMachineID - READ-ONLY; The ARM Id of the discovered VM. + FabricDiscoveryMachineID *string `json:"fabricDiscoveryMachineId,omitempty"` + // MultiVMGroupName - READ-ONLY; The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DiscoveryType - READ-ONLY; The type of the discovered VM. + DiscoveryType *string `json:"discoveryType,omitempty"` + // ProcessServerID - READ-ONLY; The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // ProcessorCoreCount - READ-ONLY; The processor core count. + ProcessorCoreCount *int32 `json:"processorCoreCount,omitempty"` + // AllocatedMemoryInMB - READ-ONLY; The allocated memory in MB. + AllocatedMemoryInMB *float64 `json:"allocatedMemoryInMB,omitempty"` + // ProcessServerName - READ-ONLY; The process server name. + ProcessServerName *string `json:"processServerName,omitempty"` + // RunAsAccountID - READ-ONLY; The run-as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // FirmwareType - READ-ONLY; The firmware type. + FirmwareType *string `json:"firmwareType,omitempty"` + // PrimaryNicIPAddress - READ-ONLY; The IP address of the primary network interface. + PrimaryNicIPAddress *string `json:"primaryNicIpAddress,omitempty"` + // TargetGeneration - READ-ONLY; The target generation. + TargetGeneration *string `json:"targetGeneration,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // TargetVMName - Target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetLocation - The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // TargetAvailabilitySetID - The target availability set Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The test network Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // FailoverRecoveryPointID - READ-ONLY; The recovery point Id to which the VM was failed over. + FailoverRecoveryPointID *string `json:"failoverRecoveryPointId,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // LastRpoInSeconds - READ-ONLY; The last recovery point objective value. + LastRpoInSeconds *int64 `json:"lastRpoInSeconds,omitempty"` + // LastRpoCalculatedTime - READ-ONLY; The last recovery point objective calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastRecoveryPointID - READ-ONLY; The last recovery point Id. + LastRecoveryPointID *string `json:"lastRecoveryPointId,omitempty"` + // InitialReplicationProgressPercentage - READ-ONLY; The initial replication progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + InitialReplicationProgressPercentage *int32 `json:"initialReplicationProgressPercentage,omitempty"` + // InitialReplicationProcessedBytes - READ-ONLY; The initial replication processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + InitialReplicationProcessedBytes *int64 `json:"initialReplicationProcessedBytes,omitempty"` + // InitialReplicationTransferredBytes - READ-ONLY; The initial replication transferred bytes from source VM to azure for all selected disks on source VM. + InitialReplicationTransferredBytes *int64 `json:"initialReplicationTransferredBytes,omitempty"` + // InitialReplicationProgressHealth - READ-ONLY; The initial replication progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + InitialReplicationProgressHealth VMReplicationProgressHealth `json:"initialReplicationProgressHealth,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncProcessedBytes - READ-ONLY; The resync processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTransferredBytes - READ-ONLY; The resync transferred bytes from source VM to azure for all selected disks on source VM. + ResyncTransferredBytes *int64 `json:"resyncTransferredBytes,omitempty"` + // ResyncProgressHealth - READ-ONLY; The resync progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + ResyncProgressHealth VMReplicationProgressHealth `json:"resyncProgressHealth,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // AgentUpgradeState - READ-ONLY; The agent auto upgrade state. Possible values include: 'MobilityAgentUpgradeStateNone', 'MobilityAgentUpgradeStateStarted', 'MobilityAgentUpgradeStateCompleted', 'MobilityAgentUpgradeStateCommit' + AgentUpgradeState MobilityAgentUpgradeState `json:"agentUpgradeState,omitempty"` + // LastAgentUpgradeType - READ-ONLY; The last agent upgrade type. + LastAgentUpgradeType *string `json:"lastAgentUpgradeType,omitempty"` + // AgentUpgradeJobID - READ-ONLY; The agent upgrade job Id. + AgentUpgradeJobID *string `json:"agentUpgradeJobId,omitempty"` + // AgentUpgradeAttemptToVersion - READ-ONLY; The agent version to which last agent upgrade was attempted. + AgentUpgradeAttemptToVersion *string `json:"agentUpgradeAttemptToVersion,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageRcmProtectedDiskDetails `json:"protectedDisks,omitempty"` + // IsLastUpgradeSuccessful - READ-ONLY; A value indicating whether last agent upgrade was successful or not. + IsLastUpgradeSuccessful *string `json:"isLastUpgradeSuccessful,omitempty"` + // IsAgentRegistrationSuccessfulAfterFailover - READ-ONLY; A value indicating whether agent registration was successful after failover. + IsAgentRegistrationSuccessfulAfterFailover *bool `json:"isAgentRegistrationSuccessfulAfterFailover,omitempty"` + // MobilityAgentDetails - The mobility agent information. + MobilityAgentDetails *InMageRcmMobilityAgentDetails `json:"mobilityAgentDetails,omitempty"` + // LastAgentUpgradeErrorDetails - The last agent upgrade error information. + LastAgentUpgradeErrorDetails *[]InMageRcmLastAgentUpgradeErrorDetails `json:"lastAgentUpgradeErrorDetails,omitempty"` + // AgentUpgradeBlockingErrorDetails - The agent upgrade blocking error information. + AgentUpgradeBlockingErrorDetails *[]InMageRcmAgentUpgradeBlockingErrorDetails `json:"agentUpgradeBlockingErrorDetails,omitempty"` + // VMNics - The network details. + VMNics *[]InMageRcmNicDetails `json:"vmNics,omitempty"` + // DiscoveredVMDetails - The discovered VM details. + DiscoveredVMDetails *InMageRcmDiscoveredProtectedVMDetails `json:"discoveredVmDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) MarshalJSON() ([]byte, error) { + imrrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrrd.LicenseType != nil { + objectMap["licenseType"] = imrrd.LicenseType + } + if imrrd.TargetVMName != nil { + objectMap["targetVmName"] = imrrd.TargetVMName + } + if imrrd.TargetVMSize != nil { + objectMap["targetVmSize"] = imrrd.TargetVMSize + } + if imrrd.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrrd.TargetResourceGroupID + } + if imrrd.TargetLocation != nil { + objectMap["targetLocation"] = imrrd.TargetLocation + } + if imrrd.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrrd.TargetAvailabilitySetID + } + if imrrd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrrd.TargetAvailabilityZone + } + if imrrd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrrd.TargetProximityPlacementGroupID + } + if imrrd.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrrd.TargetBootDiagnosticsStorageAccountID + } + if imrrd.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrrd.TargetNetworkID + } + if imrrd.TestNetworkID != nil { + objectMap["testNetworkId"] = imrrd.TestNetworkID + } + if imrrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrrd.ProtectedDisks + } + if imrrd.MobilityAgentDetails != nil { + objectMap["mobilityAgentDetails"] = imrrd.MobilityAgentDetails + } + if imrrd.LastAgentUpgradeErrorDetails != nil { + objectMap["lastAgentUpgradeErrorDetails"] = imrrd.LastAgentUpgradeErrorDetails + } + if imrrd.AgentUpgradeBlockingErrorDetails != nil { + objectMap["agentUpgradeBlockingErrorDetails"] = imrrd.AgentUpgradeBlockingErrorDetails + } + if imrrd.VMNics != nil { + objectMap["vmNics"] = imrrd.VMNics + } + if imrrd.DiscoveredVMDetails != nil { + objectMap["discoveredVmDetails"] = imrrd.DiscoveredVMDetails + } + if imrrd.InstanceType != "" { + objectMap["instanceType"] = imrrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return &imrrd, true +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrrd, true +} + +// InMageRcmReprotectInput inMageRcm specific provider input. +type InMageRcmReprotectInput struct { + // ReprotectAgentID - The reprotect agent Id. + ReprotectAgentID *string `json:"reprotectAgentId,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) MarshalJSON() ([]byte, error) { + imrri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrri.ReprotectAgentID != nil { + objectMap["reprotectAgentId"] = imrri.ReprotectAgentID + } + if imrri.DatastoreName != nil { + objectMap["datastoreName"] = imrri.DatastoreName + } + if imrri.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imrri.LogStorageAccountID + } + if imrri.PolicyID != nil { + objectMap["policyId"] = imrri.PolicyID + } + if imrri.InstanceType != "" { + objectMap["instanceType"] = imrri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return &imrri, true +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imrri, true +} + +// InMageRcmSyncDetails inMageRcm disk level sync details. +type InMageRcmSyncDetails struct { + // ProgressHealth - READ-ONLY; The progress health. Possible values include: 'None', 'InProgress', 'SlowProgress', 'NoProgress', 'Queued' + ProgressHealth DiskReplicationProgressHealth `json:"progressHealth,omitempty"` + // TransferredBytes - READ-ONLY; The transferred bytes from source VM to azure for the disk. + TransferredBytes *int64 `json:"transferredBytes,omitempty"` + // Last15MinutesTransferredBytes - READ-ONLY; The bytes transferred in last 15 minutes from source VM to azure. + Last15MinutesTransferredBytes *int64 `json:"last15MinutesTransferredBytes,omitempty"` + // LastDataTransferTimeUtc - READ-ONLY; The time of the last data transfer from source VM to azure. + LastDataTransferTimeUtc *string `json:"lastDataTransferTimeUtc,omitempty"` + // ProcessedBytes - READ-ONLY; The total processed bytes. This includes bytes that are transferred from source VM to azure and matched bytes. + ProcessedBytes *int64 `json:"processedBytes,omitempty"` + // StartTime - READ-ONLY; The start time. + StartTime *string `json:"startTime,omitempty"` + // LastRefreshTime - READ-ONLY; The last refresh time. + LastRefreshTime *string `json:"lastRefreshTime,omitempty"` + // ProgressPercentage - READ-ONLY; Progress in percentage. Progress percentage is calculated based on processed bytes. + ProgressPercentage *int32 `json:"progressPercentage,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmSyncDetails. +func (imrsd InMageRcmSyncDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmTestFailoverInput inMageRcm provider specific input for test failover. +type InMageRcmTestFailoverInput struct { + // NetworkID - The test network Id. + NetworkID *string `json:"networkId,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) MarshalJSON() ([]byte, error) { + imrtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrtfi.NetworkID != nil { + objectMap["networkId"] = imrtfi.NetworkID + } + if imrtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrtfi.RecoveryPointID + } + if imrtfi.InstanceType != "" { + objectMap["instanceType"] = imrtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return &imrtfi, true +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imrtfi, true +} + +// InMageRcmUnplannedFailoverInput inMageRcm provider specific input for unplanned failover. +type InMageRcmUnplannedFailoverInput struct { + // PerformShutdown - A value indicating whether VM is to be shutdown. + PerformShutdown *string `json:"performShutdown,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imrufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrufi.PerformShutdown != nil { + objectMap["performShutdown"] = imrufi.PerformShutdown + } + if imrufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrufi.RecoveryPointID + } + if imrufi.InstanceType != "" { + objectMap["instanceType"] = imrufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return &imrufi, true +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imrufi, true +} + +// InMageRcmUpdateApplianceForReplicationProtectedItemInput inMageRcm provider specific input to update +// appliance for replication protected item. +type InMageRcmUpdateApplianceForReplicationProtectedItemInput struct { + // RunAsAccountID - The run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput', 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imruafrpii.InstanceType = InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imruafrpii.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imruafrpii.RunAsAccountID + } + if imruafrpii.InstanceType != "" { + objectMap["instanceType"] = imruafrpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageRcmUpdateApplianceForReplicationProtectedItemInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) AsInMageRcmUpdateApplianceForReplicationProtectedItemInput() (*InMageRcmUpdateApplianceForReplicationProtectedItemInput, bool) { + return &imruafrpii, true +} + +// AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (*UpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return &imruafrpii, true +} + +// InMageRcmUpdateContainerMappingInput inMageRcm update protection container mapping. +type InMageRcmUpdateContainerMappingInput struct { + // EnableAgentAutoUpgrade - A value indicating whether agent auto upgrade has to be enabled. + EnableAgentAutoUpgrade *string `json:"enableAgentAutoUpgrade,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + imrucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrucmi.EnableAgentAutoUpgrade != nil { + objectMap["enableAgentAutoUpgrade"] = imrucmi.EnableAgentAutoUpgrade + } + if imrucmi.InstanceType != "" { + objectMap["instanceType"] = imrucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return &imrucmi, true +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &imrucmi, true +} + +// InMageRcmUpdateReplicationProtectedItemInput inMageRcm provider specific input to update replication +// protected item. +type InMageRcmUpdateReplicationProtectedItemInput struct { + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The test network ARM Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // VMNics - The list of NIC details. + VMNics *[]InMageRcmNicInput `json:"vmNics,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imrurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrurpii.TargetVMName != nil { + objectMap["targetVmName"] = imrurpii.TargetVMName + } + if imrurpii.TargetVMSize != nil { + objectMap["targetVmSize"] = imrurpii.TargetVMSize + } + if imrurpii.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrurpii.TargetResourceGroupID + } + if imrurpii.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrurpii.TargetAvailabilitySetID + } + if imrurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrurpii.TargetAvailabilityZone + } + if imrurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrurpii.TargetProximityPlacementGroupID + } + if imrurpii.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrurpii.TargetBootDiagnosticsStorageAccountID + } + if imrurpii.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrurpii.TargetNetworkID + } + if imrurpii.TestNetworkID != nil { + objectMap["testNetworkId"] = imrurpii.TestNetworkID + } + if imrurpii.VMNics != nil { + objectMap["vmNics"] = imrurpii.VMNics + } + if imrurpii.LicenseType != "" { + objectMap["licenseType"] = imrurpii.LicenseType + } + if imrurpii.InstanceType != "" { + objectMap["instanceType"] = imrurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return &imrurpii, true +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &imrurpii, true +} + +// InMageReplicationDetails inMage provider specific settings. +type InMageReplicationDetails struct { + // ActiveSiteType - The active location of the VM. If the VM is being protected from Azure, this field will take values from { Azure, OnPrem }. If the VM is being protected between two data-centers, this field will be OnPrem always. + ActiveSiteType *string `json:"activeSiteType,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // OsDetails - The OS details. + OsDetails *OSDiskDetails `json:"osDetails,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // ResyncDetails - The resync details of the machine. + ResyncDetails *InitialReplicationDetails `json:"resyncDetails,omitempty"` + // RetentionWindowStart - The retention window start time. + RetentionWindowStart *date.Time `json:"retentionWindowStart,omitempty"` + // RetentionWindowEnd - The retention window end time. + RetentionWindowEnd *date.Time `json:"retentionWindowEnd,omitempty"` + // CompressedDataRateInMB - The compressed data change rate in MB. + CompressedDataRateInMB *float64 `json:"compressedDataRateInMB,omitempty"` + // UncompressedDataRateInMB - The uncompressed data change rate in MB. + UncompressedDataRateInMB *float64 `json:"uncompressedDataRateInMB,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageProtectedDiskDetails `json:"protectedDisks,omitempty"` + // IPAddress - The source IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // MasterTargetID - The master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ConsistencyPoints - The collection of Consistency points. + ConsistencyPoints map[string]*date.Time `json:"consistencyPoints"` + // DiskResized - A value indicating whether any disk is resized for this VM. + DiskResized *string `json:"diskResized,omitempty"` + // RebootAfterUpdateStatus - A value indicating whether the source server requires a restart after update. + RebootAfterUpdateStatus *string `json:"rebootAfterUpdateStatus,omitempty"` + // MultiVMGroupID - The multi vm group Id, if any. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name, if any. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMSyncStatus - A value indicating whether the multi vm sync is enabled or disabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // AgentDetails - The agent details. + AgentDetails *InMageAgentDetails `json:"agentDetails,omitempty"` + // VCenterInfrastructureID - The vCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // InfrastructureVMID - The infrastructure VM Id. + InfrastructureVMID *string `json:"infrastructureVmId,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. + DiscoveryType *string `json:"discoveryType,omitempty"` + // AzureStorageAccountID - A value indicating the underlying Azure storage account. If the VM is not running in Azure, this value shall be set to null. + AzureStorageAccountID *string `json:"azureStorageAccountId,omitempty"` + // Datastores - The datastores of the on-premise machine Value can be list of strings that contain datastore names. + Datastores *[]string `json:"datastores,omitempty"` + // ValidationErrors - The validation errors of the on-premise machine Value can be list of validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastUpdateReceivedTime - The last update time received from on-prem components. + LastUpdateReceivedTime *date.Time `json:"lastUpdateReceivedTime,omitempty"` + // ReplicaID - The replica id of the protected item. + ReplicaID *string `json:"replicaId,omitempty"` + // OsVersion - The OS Version of the protected item. + OsVersion *string `json:"osVersion,omitempty"` + // IsAdditionalStatsAvailable - A value indicating whether additional IR stats are available or not. + IsAdditionalStatsAvailable *bool `json:"isAdditionalStatsAvailable,omitempty"` + // TotalDataTransferred - The total transferred data in bytes. + TotalDataTransferred *int64 `json:"totalDataTransferred,omitempty"` + // TotalProgressHealth - The progress health. + TotalProgressHealth *string `json:"totalProgressHealth,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageReplicationDetails. +func (imrd InMageReplicationDetails) MarshalJSON() ([]byte, error) { + imrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imrd.ActiveSiteType != nil { + objectMap["activeSiteType"] = imrd.ActiveSiteType + } + if imrd.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = imrd.SourceVMCPUCount + } + if imrd.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = imrd.SourceVMRAMSizeInMB + } + if imrd.OsDetails != nil { + objectMap["osDetails"] = imrd.OsDetails + } + if imrd.ProtectionStage != nil { + objectMap["protectionStage"] = imrd.ProtectionStage + } + if imrd.VMID != nil { + objectMap["vmId"] = imrd.VMID + } + if imrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = imrd.VMProtectionState + } + if imrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = imrd.VMProtectionStateDescription + } + if imrd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrd.ResyncDetails + } + if imrd.RetentionWindowStart != nil { + objectMap["retentionWindowStart"] = imrd.RetentionWindowStart + } + if imrd.RetentionWindowEnd != nil { + objectMap["retentionWindowEnd"] = imrd.RetentionWindowEnd + } + if imrd.CompressedDataRateInMB != nil { + objectMap["compressedDataRateInMB"] = imrd.CompressedDataRateInMB + } + if imrd.UncompressedDataRateInMB != nil { + objectMap["uncompressedDataRateInMB"] = imrd.UncompressedDataRateInMB + } + if imrd.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = imrd.RpoInSeconds + } + if imrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrd.ProtectedDisks + } + if imrd.IPAddress != nil { + objectMap["ipAddress"] = imrd.IPAddress + } + if imrd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = imrd.LastHeartbeat + } + if imrd.ProcessServerID != nil { + objectMap["processServerId"] = imrd.ProcessServerID + } + if imrd.MasterTargetID != nil { + objectMap["masterTargetId"] = imrd.MasterTargetID + } + if imrd.ConsistencyPoints != nil { + objectMap["consistencyPoints"] = imrd.ConsistencyPoints + } + if imrd.DiskResized != nil { + objectMap["diskResized"] = imrd.DiskResized + } + if imrd.RebootAfterUpdateStatus != nil { + objectMap["rebootAfterUpdateStatus"] = imrd.RebootAfterUpdateStatus + } + if imrd.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imrd.MultiVMGroupID + } + if imrd.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imrd.MultiVMGroupName + } + if imrd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imrd.MultiVMSyncStatus + } + if imrd.AgentDetails != nil { + objectMap["agentDetails"] = imrd.AgentDetails + } + if imrd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = imrd.VCenterInfrastructureID + } + if imrd.InfrastructureVMID != nil { + objectMap["infrastructureVmId"] = imrd.InfrastructureVMID + } + if imrd.VMNics != nil { + objectMap["vmNics"] = imrd.VMNics + } + if imrd.DiscoveryType != nil { + objectMap["discoveryType"] = imrd.DiscoveryType + } + if imrd.AzureStorageAccountID != nil { + objectMap["azureStorageAccountId"] = imrd.AzureStorageAccountID + } + if imrd.Datastores != nil { + objectMap["datastores"] = imrd.Datastores + } + if imrd.ValidationErrors != nil { + objectMap["validationErrors"] = imrd.ValidationErrors + } + if imrd.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = imrd.LastRpoCalculatedTime + } + if imrd.LastUpdateReceivedTime != nil { + objectMap["lastUpdateReceivedTime"] = imrd.LastUpdateReceivedTime + } + if imrd.ReplicaID != nil { + objectMap["replicaId"] = imrd.ReplicaID + } + if imrd.OsVersion != nil { + objectMap["osVersion"] = imrd.OsVersion + } + if imrd.IsAdditionalStatsAvailable != nil { + objectMap["isAdditionalStatsAvailable"] = imrd.IsAdditionalStatsAvailable + } + if imrd.TotalDataTransferred != nil { + objectMap["totalDataTransferred"] = imrd.TotalDataTransferred + } + if imrd.TotalProgressHealth != nil { + objectMap["totalProgressHealth"] = imrd.TotalProgressHealth + } + if imrd.InstanceType != "" { + objectMap["instanceType"] = imrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return &imrd, true +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrd, true +} + +// InMageReprotectInput inMageAzureV2 specific provider input. +type InMageReprotectInput struct { + // MasterTargetID - The Master Target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RetentionDrive - The retention drive to use on the MT. + RetentionDrive *string `json:"retentionDrive,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // DiskExclusionInput - The enable disk exclusion input. + DiskExclusionInput *InMageDiskExclusionInput `json:"diskExclusionInput,omitempty"` + // ProfileID - The Policy Id. + ProfileID *string `json:"profileId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageReprotectInput. +func (imri InMageReprotectInput) MarshalJSON() ([]byte, error) { + imri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imri.MasterTargetID != nil { + objectMap["masterTargetId"] = imri.MasterTargetID + } + if imri.ProcessServerID != nil { + objectMap["processServerId"] = imri.ProcessServerID + } + if imri.RetentionDrive != nil { + objectMap["retentionDrive"] = imri.RetentionDrive + } + if imri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imri.RunAsAccountID + } + if imri.DatastoreName != nil { + objectMap["datastoreName"] = imri.DatastoreName + } + if imri.DiskExclusionInput != nil { + objectMap["diskExclusionInput"] = imri.DiskExclusionInput + } + if imri.ProfileID != nil { + objectMap["profileId"] = imri.ProfileID + } + if imri.DisksToInclude != nil { + objectMap["disksToInclude"] = imri.DisksToInclude + } + if imri.InstanceType != "" { + objectMap["instanceType"] = imri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return &imri, true +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imri, true +} + +// InMageTestFailoverInput provider specific input for InMage test failover. +type InMageTestFailoverInput struct { + // RecoveryPointType - The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. Possible values include: 'LatestTime', 'LatestTag', 'Custom' + RecoveryPointType RecoveryPointType `json:"recoveryPointType,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) MarshalJSON() ([]byte, error) { + imtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imtfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imtfi.RecoveryPointType + } + if imtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imtfi.RecoveryPointID + } + if imtfi.InstanceType != "" { + objectMap["instanceType"] = imtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return &imtfi, true +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imtfi, true +} + +// InMageUnplannedFailoverInput provider specific input for InMage unplanned failover. +type InMageUnplannedFailoverInput struct { + // RecoveryPointType - The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. Possible values include: 'LatestTime', 'LatestTag', 'Custom' + RecoveryPointType RecoveryPointType `json:"recoveryPointType,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imufi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imufi.RecoveryPointType + } + if imufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imufi.RecoveryPointID + } + if imufi.InstanceType != "" { + objectMap["instanceType"] = imufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return &imufi, true +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imufi, true +} + +// InMageVolumeExclusionOptions guest disk signature based disk exclusion option when doing enable +// protection of virtual machine in InMage provider. +type InMageVolumeExclusionOptions struct { + // VolumeLabel - The volume label. The disk having any volume with this label will be excluded from replication. + VolumeLabel *string `json:"volumeLabel,omitempty"` + // OnlyExcludeIfSingleVolume - The value indicating whether to exclude multi volume disk or not. If a disk has multiple volumes and one of the volume has label matching with VolumeLabel this disk will be excluded from replication if OnlyExcludeIfSingleVolume is false. + OnlyExcludeIfSingleVolume *string `json:"onlyExcludeIfSingleVolume,omitempty"` +} + +// InnerHealthError implements InnerHealthError class. HealthError object has a list of InnerHealthErrors +// as child errors. InnerHealthError is used because this will prevent an infinite loop of structures when +// Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health +// errors and all API consumers can utilize this in the same fashion as Exception -> InnerException. +type InnerHealthError struct { + // ErrorSource - Source of error. + ErrorSource *string `json:"errorSource,omitempty"` + // ErrorType - Type of error. + ErrorType *string `json:"errorType,omitempty"` + // ErrorLevel - Level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // ErrorCategory - Category of error. + ErrorCategory *string `json:"errorCategory,omitempty"` + // ErrorCode - Error code. + ErrorCode *string `json:"errorCode,omitempty"` + // SummaryMessage - Summary message of the entity. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // ErrorMessage - Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // CreationTimeUtc - Error creation time (UTC). + CreationTimeUtc *date.Time `json:"creationTimeUtc,omitempty"` + // RecoveryProviderErrorMessage - DRA error message. + RecoveryProviderErrorMessage *string `json:"recoveryProviderErrorMessage,omitempty"` + // EntityID - ID of the entity. + EntityID *string `json:"entityId,omitempty"` + // ErrorID - The health error unique id. + ErrorID *string `json:"errorId,omitempty"` + // CustomerResolvability - Value indicating whether the health error is customer resolvable. Possible values include: 'Allowed', 'NotAllowed' + CustomerResolvability HealthErrorCustomerResolvability `json:"customerResolvability,omitempty"` +} + +// InputEndpoint ... +type InputEndpoint struct { + EndpointName *string `json:"endpointName,omitempty"` + PrivatePort *int32 `json:"privatePort,omitempty"` + PublicPort *int32 `json:"publicPort,omitempty"` + Protocol *string `json:"protocol,omitempty"` +} + +// IPConfigDetails ... +type IPConfigDetails struct { + Name *string `json:"name,omitempty"` + IsPrimary *bool `json:"isPrimary,omitempty"` + SubnetName *string `json:"subnetName,omitempty"` + StaticIPAddress *string `json:"staticIPAddress,omitempty"` + IPAddressType *string `json:"ipAddressType,omitempty"` + IsSeletedForFailover *bool `json:"isSeletedForFailover,omitempty"` + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + RecoveryStaticIPAddress *string `json:"recoveryStaticIPAddress,omitempty"` + RecoveryIPAddressType *string `json:"recoveryIPAddressType,omitempty"` + RecoveryPublicIPAddressID *string `json:"recoveryPublicIPAddressId,omitempty"` + RecoveryLBBackendAddressPoolIds *[]string `json:"recoveryLBBackendAddressPoolIds,omitempty"` + TfoSubnetName *string `json:"tfoSubnetName,omitempty"` + TfoStaticIPAddress *string `json:"tfoStaticIPAddress,omitempty"` + TfoPublicIPAddressID *string `json:"tfoPublicIPAddressId,omitempty"` + TfoLBBackendAddressPoolIds *[]string `json:"tfoLBBackendAddressPoolIds,omitempty"` +} + +// IPConfigInputDetails ... +type IPConfigInputDetails struct { + IPConfigName *string `json:"ipConfigName,omitempty"` + IsPrimary *bool `json:"isPrimary,omitempty"` + IsSeletedForFailover *bool `json:"isSeletedForFailover,omitempty"` + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + RecoveryStaticIPAddress *string `json:"recoveryStaticIPAddress,omitempty"` + RecoveryPublicIPAddressID *string `json:"recoveryPublicIPAddressId,omitempty"` + RecoveryLBBackendAddressPoolIds *[]string `json:"recoveryLBBackendAddressPoolIds,omitempty"` + TfoSubnetName *string `json:"tfoSubnetName,omitempty"` + TfoStaticIPAddress *string `json:"tfoStaticIPAddress,omitempty"` + TfoPublicIPAddressID *string `json:"tfoPublicIPAddressId,omitempty"` + TfoLBBackendAddressPoolIds *[]string `json:"tfoLBBackendAddressPoolIds,omitempty"` +} + +// Job job details. +type Job struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *JobProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if j.Properties != nil { + objectMap["properties"] = j.Properties + } + if j.Location != nil { + objectMap["location"] = j.Location + } + return json.Marshal(objectMap) +} + +// JobCollection collection of jobs. +type JobCollection struct { + autorest.Response `json:"-"` + // Value - The list of jobs. + Value *[]Job `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// JobCollectionIterator provides access to a complete listing of Job values. +type JobCollectionIterator struct { + i int + page JobCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *JobCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *JobCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter JobCollectionIterator) Response() JobCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter JobCollectionIterator) Value() Job { + if !iter.page.NotDone() { + return Job{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the JobCollectionIterator type. +func NewJobCollectionIterator(page JobCollectionPage) JobCollectionIterator { + return JobCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (jc JobCollection) IsEmpty() bool { + return jc.Value == nil || len(*jc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (jc JobCollection) hasNextLink() bool { + return jc.NextLink != nil && len(*jc.NextLink) != 0 +} + +// jobCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jc JobCollection) jobCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !jc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jc.NextLink))) +} + +// JobCollectionPage contains a page of Job values. +type JobCollectionPage struct { + fn func(context.Context, JobCollection) (JobCollection, error) + jc JobCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *JobCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.jc) + if err != nil { + return err + } + page.jc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *JobCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobCollectionPage) NotDone() bool { + return !page.jc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobCollectionPage) Response() JobCollection { + return page.jc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobCollectionPage) Values() []Job { + if page.jc.IsEmpty() { + return nil + } + return *page.jc.Value +} + +// Creates a new instance of the JobCollectionPage type. +func NewJobCollectionPage(cur JobCollection, getNextPage func(context.Context, JobCollection) (JobCollection, error)) JobCollectionPage { + return JobCollectionPage{ + fn: getNextPage, + jc: cur, + } +} + +// BasicJobDetails job details based on specific job type. +type BasicJobDetails interface { + AsAsrJobDetails() (*AsrJobDetails, bool) + AsExportJobDetails() (*ExportJobDetails, bool) + AsFailoverJobDetails() (*FailoverJobDetails, bool) + AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) + AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) + AsJobDetails() (*JobDetails, bool) +} + +// JobDetails job details based on specific job type. +type JobDetails struct { + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicJobDetails(body []byte) (BasicJobDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAsrJobDetails): + var ajd AsrJobDetails + err := json.Unmarshal(body, &ajd) + return ajd, err + case string(InstanceTypeExportJobDetails): + var ejd ExportJobDetails + err := json.Unmarshal(body, &ejd) + return ejd, err + case string(InstanceTypeFailoverJobDetails): + var fjd FailoverJobDetails + err := json.Unmarshal(body, &fjd) + return fjd, err + case string(InstanceTypeSwitchProtectionJobDetails): + var spjd SwitchProtectionJobDetails + err := json.Unmarshal(body, &spjd) + return spjd, err + case string(InstanceTypeTestFailoverJobDetails): + var tfjd TestFailoverJobDetails + err := json.Unmarshal(body, &tfjd) + return tfjd, err + default: + var jd JobDetails + err := json.Unmarshal(body, &jd) + return jd, err + } +} +func unmarshalBasicJobDetailsArray(body []byte) ([]BasicJobDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jdArray := make([]BasicJobDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + jd, err := unmarshalBasicJobDetails(*rawMessage) + if err != nil { + return nil, err + } + jdArray[index] = jd + } + return jdArray, nil +} + +// MarshalJSON is the custom marshaler for JobDetails. +func (jd JobDetails) MarshalJSON() ([]byte, error) { + jd.InstanceType = InstanceTypeJobDetails + objectMap := make(map[string]interface{}) + if jd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = jd.AffectedObjectDetails + } + if jd.InstanceType != "" { + objectMap["instanceType"] = jd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsJobDetails() (*JobDetails, bool) { + return &jd, true +} + +// AsBasicJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &jd, true +} + +// JobEntity this class contains the minimal job details required to navigate to the desired drill down. +type JobEntity struct { + // JobID - The job id. + JobID *string `json:"jobId,omitempty"` + // JobFriendlyName - The job display name. + JobFriendlyName *string `json:"jobFriendlyName,omitempty"` + // TargetObjectID - The object id. + TargetObjectID *string `json:"targetObjectId,omitempty"` + // TargetObjectName - The object name. + TargetObjectName *string `json:"targetObjectName,omitempty"` + // TargetInstanceType - The workflow affected object type. + TargetInstanceType *string `json:"targetInstanceType,omitempty"` + // JobScenarioName - The job name. Enum type ScenarioName. + JobScenarioName *string `json:"jobScenarioName,omitempty"` +} + +// JobErrorDetails this class contains the error details per object. +type JobErrorDetails struct { + // ServiceErrorDetails - The Service error details. + ServiceErrorDetails *ServiceError `json:"serviceErrorDetails,omitempty"` + // ProviderErrorDetails - The Provider error details. + ProviderErrorDetails *ProviderError `json:"providerErrorDetails,omitempty"` + // ErrorLevel - Error level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // CreationTime - The creation time of job error. + CreationTime *date.Time `json:"creationTime,omitempty"` + // TaskID - The Id of the task. + TaskID *string `json:"taskId,omitempty"` +} + +// JobProperties job custom data details. +type JobProperties struct { + // ActivityID - The activity id. + ActivityID *string `json:"activityId,omitempty"` + // ScenarioName - The ScenarioName. + ScenarioName *string `json:"scenarioName,omitempty"` + // FriendlyName - The DisplayName. + FriendlyName *string `json:"friendlyName,omitempty"` + // State - The status of the Job. It is one of these values - NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or Other. + State *string `json:"state,omitempty"` + // StateDescription - The description of the state of the Job. For e.g. - For Succeeded state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. + StateDescription *string `json:"stateDescription,omitempty"` + // Tasks - The tasks. + Tasks *[]ASRTask `json:"tasks,omitempty"` + // Errors - The errors. + Errors *[]JobErrorDetails `json:"errors,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // AllowedActions - The Allowed action the job. + AllowedActions *[]string `json:"allowedActions,omitempty"` + // TargetObjectID - The affected Object Id. + TargetObjectID *string `json:"targetObjectId,omitempty"` + // TargetObjectName - The name of the affected object. + TargetObjectName *string `json:"targetObjectName,omitempty"` + // TargetInstanceType - The type of the affected object which is of Microsoft.Azure.SiteRecovery.V2015_11_10.AffectedObjectType class. + TargetInstanceType *string `json:"targetInstanceType,omitempty"` + // CustomDetails - The custom job details like test failover job details. + CustomDetails BasicJobDetails `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for JobProperties struct. +func (jp *JobProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "activityId": + if v != nil { + var activityID string + err = json.Unmarshal(*v, &activityID) + if err != nil { + return err + } + jp.ActivityID = &activityID + } + case "scenarioName": + if v != nil { + var scenarioName string + err = json.Unmarshal(*v, &scenarioName) + if err != nil { + return err + } + jp.ScenarioName = &scenarioName + } + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + jp.FriendlyName = &friendlyName + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + jp.State = &state + } + case "stateDescription": + if v != nil { + var stateDescription string + err = json.Unmarshal(*v, &stateDescription) + if err != nil { + return err + } + jp.StateDescription = &stateDescription + } + case "tasks": + if v != nil { + var tasks []ASRTask + err = json.Unmarshal(*v, &tasks) + if err != nil { + return err + } + jp.Tasks = &tasks + } + case "errors": + if v != nil { + var errorsVar []JobErrorDetails + err = json.Unmarshal(*v, &errorsVar) + if err != nil { + return err + } + jp.Errors = &errorsVar + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + jp.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + jp.EndTime = &endTime + } + case "allowedActions": + if v != nil { + var allowedActions []string + err = json.Unmarshal(*v, &allowedActions) + if err != nil { + return err + } + jp.AllowedActions = &allowedActions + } + case "targetObjectId": + if v != nil { + var targetObjectID string + err = json.Unmarshal(*v, &targetObjectID) + if err != nil { + return err + } + jp.TargetObjectID = &targetObjectID + } + case "targetObjectName": + if v != nil { + var targetObjectName string + err = json.Unmarshal(*v, &targetObjectName) + if err != nil { + return err + } + jp.TargetObjectName = &targetObjectName + } + case "targetInstanceType": + if v != nil { + var targetInstanceType string + err = json.Unmarshal(*v, &targetInstanceType) + if err != nil { + return err + } + jp.TargetInstanceType = &targetInstanceType + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicJobDetails(*v) + if err != nil { + return err + } + jp.CustomDetails = customDetails + } + } + } + + return nil +} + +// JobQueryParameter query parameter to enumerate jobs. +type JobQueryParameter struct { + // StartTime - Date time to get jobs from. + StartTime *string `json:"startTime,omitempty"` + // EndTime - Date time to get jobs upto. + EndTime *string `json:"endTime,omitempty"` + // FabricID - The Id of the fabric to search jobs under. + FabricID *string `json:"fabricId,omitempty"` + // AffectedObjectTypes - The type of objects. + AffectedObjectTypes *string `json:"affectedObjectTypes,omitempty"` + // JobStatus - The states of the job to be filtered can be in. + JobStatus *string `json:"jobStatus,omitempty"` + // JobOutputType - The output type of the jobs. Possible values include: 'JSON', 'XML', 'Excel' + JobOutputType ExportJobOutputSerializationType `json:"jobOutputType,omitempty"` + // JobName - The job Name. + JobName *string `json:"jobName,omitempty"` + // TimezoneOffset - The timezone offset for the location of the request (in minutes). + TimezoneOffset *float64 `json:"timezoneOffset,omitempty"` +} + +// JobStatusEventDetails model class for event details of a job status event. +type JobStatusEventDetails struct { + // JobID - Job arm id for the event. + JobID *string `json:"jobId,omitempty"` + // JobFriendlyName - JobName for the Event. + JobFriendlyName *string `json:"jobFriendlyName,omitempty"` + // JobStatus - JobStatus for the Event. + JobStatus *string `json:"jobStatus,omitempty"` + // AffectedObjectType - AffectedObjectType for the event. + AffectedObjectType *string `json:"affectedObjectType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeEventSpecificDetails', 'InstanceTypeJobStatus' + InstanceType InstanceTypeBasicEventSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobStatusEventDetails. +func (jsed JobStatusEventDetails) MarshalJSON() ([]byte, error) { + jsed.InstanceType = InstanceTypeJobStatus + objectMap := make(map[string]interface{}) + if jsed.JobID != nil { + objectMap["jobId"] = jsed.JobID + } + if jsed.JobFriendlyName != nil { + objectMap["jobFriendlyName"] = jsed.JobFriendlyName + } + if jsed.JobStatus != nil { + objectMap["jobStatus"] = jsed.JobStatus + } + if jsed.AffectedObjectType != nil { + objectMap["affectedObjectType"] = jsed.AffectedObjectType + } + if jsed.InstanceType != "" { + objectMap["instanceType"] = jsed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsJobStatusEventDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsJobStatusEventDetails() (*JobStatusEventDetails, bool) { + return &jsed, true +} + +// AsEventSpecificDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsEventSpecificDetails() (*EventSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventSpecificDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsBasicEventSpecificDetails() (BasicEventSpecificDetails, bool) { + return &jsed, true +} + +// BasicJobTaskDetails this class represents a task which is actually a workflow so that one can navigate to its +// individual drill down. +type BasicJobTaskDetails interface { + AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) + AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) + AsJobTaskDetails() (*JobTaskDetails, bool) +} + +// JobTaskDetails this class represents a task which is actually a workflow so that one can navigate to its +// individual drill down. +type JobTaskDetails struct { + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicJobTaskDetails(body []byte) (BasicJobTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeFabricReplicationGroupTaskDetails): + var frgtd FabricReplicationGroupTaskDetails + err := json.Unmarshal(body, &frgtd) + return frgtd, err + case string(InstanceTypeVirtualMachineTaskDetails): + var vmtd VirtualMachineTaskDetails + err := json.Unmarshal(body, &vmtd) + return vmtd, err + default: + var jtd JobTaskDetails + err := json.Unmarshal(body, &jtd) + return jtd, err + } +} +func unmarshalBasicJobTaskDetailsArray(body []byte) ([]BasicJobTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jtdArray := make([]BasicJobTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + jtd, err := unmarshalBasicJobTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + jtdArray[index] = jtd + } + return jtdArray, nil +} + +// MarshalJSON is the custom marshaler for JobTaskDetails. +func (jtd JobTaskDetails) MarshalJSON() ([]byte, error) { + jtd.InstanceType = InstanceTypeJobTaskDetails + objectMap := make(map[string]interface{}) + if jtd.JobTask != nil { + objectMap["jobTask"] = jtd.JobTask + } + if jtd.InstanceType != "" { + objectMap["instanceType"] = jtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return &jtd, true +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &jtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &jtd, true +} + +// KeyEncryptionKeyInfo key Encryption Key (KEK) information. +type KeyEncryptionKeyInfo struct { + // KeyIdentifier - The key URL / identifier. + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KeyVaultResourceArmID - The KeyVault resource ARM Id for key. + KeyVaultResourceArmID *string `json:"keyVaultResourceArmId,omitempty"` +} + +// LogicalNetwork logical network data model. +type LogicalNetwork struct { + autorest.Response `json:"-"` + // Properties - The Logical Network Properties. + Properties *LogicalNetworkProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for LogicalNetwork. +func (ln LogicalNetwork) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ln.Properties != nil { + objectMap["properties"] = ln.Properties + } + if ln.Location != nil { + objectMap["location"] = ln.Location + } + return json.Marshal(objectMap) +} + +// LogicalNetworkCollection list of logical networks. +type LogicalNetworkCollection struct { + autorest.Response `json:"-"` + // Value - The Logical Networks list details. + Value *[]LogicalNetwork `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// LogicalNetworkCollectionIterator provides access to a complete listing of LogicalNetwork values. +type LogicalNetworkCollectionIterator struct { + i int + page LogicalNetworkCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *LogicalNetworkCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LogicalNetworkCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *LogicalNetworkCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter LogicalNetworkCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter LogicalNetworkCollectionIterator) Response() LogicalNetworkCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter LogicalNetworkCollectionIterator) Value() LogicalNetwork { + if !iter.page.NotDone() { + return LogicalNetwork{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the LogicalNetworkCollectionIterator type. +func NewLogicalNetworkCollectionIterator(page LogicalNetworkCollectionPage) LogicalNetworkCollectionIterator { + return LogicalNetworkCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lnc LogicalNetworkCollection) IsEmpty() bool { + return lnc.Value == nil || len(*lnc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (lnc LogicalNetworkCollection) hasNextLink() bool { + return lnc.NextLink != nil && len(*lnc.NextLink) != 0 +} + +// logicalNetworkCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lnc LogicalNetworkCollection) logicalNetworkCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !lnc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lnc.NextLink))) +} + +// LogicalNetworkCollectionPage contains a page of LogicalNetwork values. +type LogicalNetworkCollectionPage struct { + fn func(context.Context, LogicalNetworkCollection) (LogicalNetworkCollection, error) + lnc LogicalNetworkCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *LogicalNetworkCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LogicalNetworkCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.lnc) + if err != nil { + return err + } + page.lnc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *LogicalNetworkCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page LogicalNetworkCollectionPage) NotDone() bool { + return !page.lnc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page LogicalNetworkCollectionPage) Response() LogicalNetworkCollection { + return page.lnc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page LogicalNetworkCollectionPage) Values() []LogicalNetwork { + if page.lnc.IsEmpty() { + return nil + } + return *page.lnc.Value +} + +// Creates a new instance of the LogicalNetworkCollectionPage type. +func NewLogicalNetworkCollectionPage(cur LogicalNetworkCollection, getNextPage func(context.Context, LogicalNetworkCollection) (LogicalNetworkCollection, error)) LogicalNetworkCollectionPage { + return LogicalNetworkCollectionPage{ + fn: getNextPage, + lnc: cur, + } +} + +// LogicalNetworkProperties logical Network Properties. +type LogicalNetworkProperties struct { + // FriendlyName - The Friendly Name. + FriendlyName *string `json:"friendlyName,omitempty"` + // NetworkVirtualizationStatus - A value indicating whether Network Virtualization is enabled for the logical network. + NetworkVirtualizationStatus *string `json:"networkVirtualizationStatus,omitempty"` + // LogicalNetworkUsage - A value indicating whether logical network is used as private test network by test failover. + LogicalNetworkUsage *string `json:"logicalNetworkUsage,omitempty"` + // LogicalNetworkDefinitionsStatus - A value indicating whether logical network definitions are isolated. + LogicalNetworkDefinitionsStatus *string `json:"logicalNetworkDefinitionsStatus,omitempty"` +} + +// ManualActionTaskDetails this class represents the manual action task details. +type ManualActionTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // Instructions - The instructions. + Instructions *string `json:"instructions,omitempty"` + // Observation - The observation. + Observation *string `json:"observation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) MarshalJSON() ([]byte, error) { + matd.InstanceType = InstanceTypeManualActionTaskDetails + objectMap := make(map[string]interface{}) + if matd.Name != nil { + objectMap["name"] = matd.Name + } + if matd.Instructions != nil { + objectMap["instructions"] = matd.Instructions + } + if matd.Observation != nil { + objectMap["observation"] = matd.Observation + } + if matd.InstanceType != "" { + objectMap["instanceType"] = matd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return &matd, true +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &matd, true +} + +// MarsAgentDetails mars agent details. +type MarsAgentDetails struct { + // ID - READ-ONLY; The Mars agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The Mars agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The Mars agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The Mars agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the Mars agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the Mars agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for MarsAgentDetails. +func (mad MarsAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MasterTargetServer details of a Master Target Server. +type MasterTargetServer struct { + // ID - The server Id. + ID *string `json:"id,omitempty"` + // IPAddress - The IP address of the server. + IPAddress *string `json:"ipAddress,omitempty"` + // Name - The server name. + Name *string `json:"name,omitempty"` + // OsType - The OS type of the server. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The version of the scout component on the server. + AgentVersion *string `json:"agentVersion,omitempty"` + // LastHeartbeat - The last heartbeat received from the server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // RetentionVolumes - The retention volumes of Master target Server. + RetentionVolumes *[]RetentionVolume `json:"retentionVolumes,omitempty"` + // DataStores - The list of data stores in the fabric. + DataStores *[]DataStore `json:"dataStores,omitempty"` + // ValidationErrors - Validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // HealthErrors - Health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // DiskCount - Disk count of the master target. + DiskCount *int32 `json:"diskCount,omitempty"` + // OsVersion - OS Version of the master target. + OsVersion *string `json:"osVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // MarsAgentVersion - MARS agent version. + MarsAgentVersion *string `json:"marsAgentVersion,omitempty"` + // MarsAgentExpiryDate - MARS agent expiry date. + MarsAgentExpiryDate *date.Time `json:"marsAgentExpiryDate,omitempty"` + // AgentVersionDetails - Agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // MarsAgentVersionDetails - Mars agent version details. + MarsAgentVersionDetails *VersionDetails `json:"marsAgentVersionDetails,omitempty"` +} + +// MigrateInput input for migrate. +type MigrateInput struct { + // Properties - Migrate input properties. + Properties *MigrateInputProperties `json:"properties,omitempty"` +} + +// MigrateInputProperties migrate input properties. +type MigrateInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicMigrateProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for MigrateInputProperties struct. +func (mip *MigrateInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicMigrateProviderSpecificInput(*v) + if err != nil { + return err + } + mip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicMigrateProviderSpecificInput migrate provider specific input. +type BasicMigrateProviderSpecificInput interface { + AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) + AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) +} + +// MigrateProviderSpecificInput migrate provider specific input. +type MigrateProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput', 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicMigrateProviderSpecificInput(body []byte) (BasicMigrateProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt): + var vmcmi VMwareCbtMigrateInput + err := json.Unmarshal(body, &vmcmi) + return vmcmi, err + default: + var mpsi MigrateProviderSpecificInput + err := json.Unmarshal(body, &mpsi) + return mpsi, err + } +} +func unmarshalBasicMigrateProviderSpecificInputArray(body []byte) ([]BasicMigrateProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + mpsiArray := make([]BasicMigrateProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + mpsi, err := unmarshalBasicMigrateProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + mpsiArray[index] = mpsi + } + return mpsiArray, nil +} + +// MarshalJSON is the custom marshaler for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) MarshalJSON() ([]byte, error) { + mpsi.InstanceType = InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput + objectMap := make(map[string]interface{}) + if mpsi.InstanceType != "" { + objectMap["instanceType"] = mpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrateInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) { + return nil, false +} + +// AsMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) { + return &mpsi, true +} + +// AsBasicMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsBasicMigrateProviderSpecificInput() (BasicMigrateProviderSpecificInput, bool) { + return &mpsi, true +} + +// MigrationItem migration item. +type MigrationItem struct { + autorest.Response `json:"-"` + // Properties - The migration item properties. + Properties *MigrationItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationItem. +func (mi MigrationItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mi.Properties != nil { + objectMap["properties"] = mi.Properties + } + if mi.Location != nil { + objectMap["location"] = mi.Location + } + return json.Marshal(objectMap) +} + +// MigrationItemCollection migration item collection. +type MigrationItemCollection struct { + autorest.Response `json:"-"` + // Value - The list of migration items. + Value *[]MigrationItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MigrationItemCollectionIterator provides access to a complete listing of MigrationItem values. +type MigrationItemCollectionIterator struct { + i int + page MigrationItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *MigrationItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *MigrationItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MigrationItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter MigrationItemCollectionIterator) Response() MigrationItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter MigrationItemCollectionIterator) Value() MigrationItem { + if !iter.page.NotDone() { + return MigrationItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the MigrationItemCollectionIterator type. +func NewMigrationItemCollectionIterator(page MigrationItemCollectionPage) MigrationItemCollectionIterator { + return MigrationItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mic MigrationItemCollection) IsEmpty() bool { + return mic.Value == nil || len(*mic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mic MigrationItemCollection) hasNextLink() bool { + return mic.NextLink != nil && len(*mic.NextLink) != 0 +} + +// migrationItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mic MigrationItemCollection) migrationItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !mic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mic.NextLink))) +} + +// MigrationItemCollectionPage contains a page of MigrationItem values. +type MigrationItemCollectionPage struct { + fn func(context.Context, MigrationItemCollection) (MigrationItemCollection, error) + mic MigrationItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *MigrationItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.mic) + if err != nil { + return err + } + page.mic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *MigrationItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MigrationItemCollectionPage) NotDone() bool { + return !page.mic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MigrationItemCollectionPage) Response() MigrationItemCollection { + return page.mic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MigrationItemCollectionPage) Values() []MigrationItem { + if page.mic.IsEmpty() { + return nil + } + return *page.mic.Value +} + +// Creates a new instance of the MigrationItemCollectionPage type. +func NewMigrationItemCollectionPage(cur MigrationItemCollection, getNextPage func(context.Context, MigrationItemCollection) (MigrationItemCollection, error)) MigrationItemCollectionPage { + return MigrationItemCollectionPage{ + fn: getNextPage, + mic: cur, + } +} + +// MigrationItemProperties migration item properties. +type MigrationItemProperties struct { + // MachineName - READ-ONLY; The on-premise virtual machine name. + MachineName *string `json:"machineName,omitempty"` + // PolicyID - READ-ONLY; The ARM Id of policy governing this item. + PolicyID *string `json:"policyId,omitempty"` + // PolicyFriendlyName - READ-ONLY; The name of policy governing this item. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` + // MigrationState - READ-ONLY; The migration status. Possible values include: 'MigrationStateNone', 'MigrationStateEnableMigrationInProgress', 'MigrationStateEnableMigrationFailed', 'MigrationStateDisableMigrationInProgress', 'MigrationStateDisableMigrationFailed', 'MigrationStateInitialSeedingInProgress', 'MigrationStateInitialSeedingFailed', 'MigrationStateReplicating', 'MigrationStateMigrationInProgress', 'MigrationStateMigrationSucceeded', 'MigrationStateMigrationFailed' + MigrationState MigrationState `json:"migrationState,omitempty"` + // MigrationStateDescription - READ-ONLY; The migration state description. + MigrationStateDescription *string `json:"migrationStateDescription,omitempty"` + // LastTestMigrationTime - READ-ONLY; The last test migration time. + LastTestMigrationTime *date.Time `json:"lastTestMigrationTime,omitempty"` + // LastTestMigrationStatus - READ-ONLY; The status of the last test migration. + LastTestMigrationStatus *string `json:"lastTestMigrationStatus,omitempty"` + // TestMigrateState - READ-ONLY; The test migrate state. Possible values include: 'TestMigrationStateNone', 'TestMigrationStateTestMigrationInProgress', 'TestMigrationStateTestMigrationSucceeded', 'TestMigrationStateTestMigrationFailed', 'TestMigrationStateTestMigrationCleanupInProgress' + TestMigrateState TestMigrationState `json:"testMigrateState,omitempty"` + // TestMigrateStateDescription - READ-ONLY; The test migrate state description. + TestMigrateStateDescription *string `json:"testMigrateStateDescription,omitempty"` + // Health - READ-ONLY; The consolidated health. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The list of health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // AllowedOperations - READ-ONLY; The allowed operations on the migration item based on the current migration state of the item. + AllowedOperations *[]MigrationItemOperation `json:"allowedOperations,omitempty"` + // CurrentJob - READ-ONLY; The current job details. + CurrentJob *CurrentJobDetails `json:"currentJob,omitempty"` + // EventCorrelationID - READ-ONLY; The correlation Id for events associated with this migration item. + EventCorrelationID *string `json:"eventCorrelationId,omitempty"` + // ProviderSpecificDetails - The migration provider custom settings. + ProviderSpecificDetails BasicMigrationProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationItemProperties. +func (mip MigrationItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["providerSpecificDetails"] = mip.ProviderSpecificDetails + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MigrationItemProperties struct. +func (mip *MigrationItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "machineName": + if v != nil { + var machineName string + err = json.Unmarshal(*v, &machineName) + if err != nil { + return err + } + mip.MachineName = &machineName + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + mip.PolicyID = &policyID + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + mip.PolicyFriendlyName = &policyFriendlyName + } + case "migrationState": + if v != nil { + var migrationState MigrationState + err = json.Unmarshal(*v, &migrationState) + if err != nil { + return err + } + mip.MigrationState = migrationState + } + case "migrationStateDescription": + if v != nil { + var migrationStateDescription string + err = json.Unmarshal(*v, &migrationStateDescription) + if err != nil { + return err + } + mip.MigrationStateDescription = &migrationStateDescription + } + case "lastTestMigrationTime": + if v != nil { + var lastTestMigrationTime date.Time + err = json.Unmarshal(*v, &lastTestMigrationTime) + if err != nil { + return err + } + mip.LastTestMigrationTime = &lastTestMigrationTime + } + case "lastTestMigrationStatus": + if v != nil { + var lastTestMigrationStatus string + err = json.Unmarshal(*v, &lastTestMigrationStatus) + if err != nil { + return err + } + mip.LastTestMigrationStatus = &lastTestMigrationStatus + } + case "testMigrateState": + if v != nil { + var testMigrateState TestMigrationState + err = json.Unmarshal(*v, &testMigrateState) + if err != nil { + return err + } + mip.TestMigrateState = testMigrateState + } + case "testMigrateStateDescription": + if v != nil { + var testMigrateStateDescription string + err = json.Unmarshal(*v, &testMigrateStateDescription) + if err != nil { + return err + } + mip.TestMigrateStateDescription = &testMigrateStateDescription + } + case "health": + if v != nil { + var health ProtectionHealth + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + mip.Health = health + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + mip.HealthErrors = &healthErrors + } + case "allowedOperations": + if v != nil { + var allowedOperations []MigrationItemOperation + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + mip.AllowedOperations = &allowedOperations + } + case "currentJob": + if v != nil { + var currentJob CurrentJobDetails + err = json.Unmarshal(*v, ¤tJob) + if err != nil { + return err + } + mip.CurrentJob = ¤tJob + } + case "eventCorrelationId": + if v != nil { + var eventCorrelationID string + err = json.Unmarshal(*v, &eventCorrelationID) + if err != nil { + return err + } + mip.EventCorrelationID = &eventCorrelationID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicMigrationProviderSpecificSettings(*v) + if err != nil { + return err + } + mip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// MigrationItemsQueryParameter query parameter to enumerate migration items. +type MigrationItemsQueryParameter struct { + // SourceFabricName - The source fabric name filter. + SourceFabricName *string `json:"sourceFabricName,omitempty"` + // SourceContainerName - The source container name filter. + SourceContainerName *string `json:"sourceContainerName,omitempty"` + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` +} + +// BasicMigrationProviderSpecificSettings migration provider specific settings. +type BasicMigrationProviderSpecificSettings interface { + AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) + AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) +} + +// MigrationProviderSpecificSettings migration provider specific settings. +type MigrationProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings', 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicMigrationProviderSpecificSettings(body []byte) (BasicMigrationProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt): + var vmcmd VMwareCbtMigrationDetails + err := json.Unmarshal(body, &vmcmd) + return vmcmd, err + default: + var mpss MigrationProviderSpecificSettings + err := json.Unmarshal(body, &mpss) + return mpss, err + } +} +func unmarshalBasicMigrationProviderSpecificSettingsArray(body []byte) ([]BasicMigrationProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + mpssArray := make([]BasicMigrationProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + mpss, err := unmarshalBasicMigrationProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + mpssArray[index] = mpss + } + return mpssArray, nil +} + +// MarshalJSON is the custom marshaler for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) MarshalJSON() ([]byte, error) { + mpss.InstanceType = InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings + objectMap := make(map[string]interface{}) + if mpss.InstanceType != "" { + objectMap["instanceType"] = mpss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrationDetails is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) { + return nil, false +} + +// AsMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) { + return &mpss, true +} + +// AsBasicMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsBasicMigrationProviderSpecificSettings() (BasicMigrationProviderSpecificSettings, bool) { + return &mpss, true +} + +// MigrationRecoveryPoint recovery point for a migration item. +type MigrationRecoveryPoint struct { + autorest.Response `json:"-"` + // Properties - Recovery point properties. + Properties *MigrationRecoveryPointProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationRecoveryPoint. +func (mrp MigrationRecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mrp.Properties != nil { + objectMap["properties"] = mrp.Properties + } + if mrp.Location != nil { + objectMap["location"] = mrp.Location + } + return json.Marshal(objectMap) +} + +// MigrationRecoveryPointCollection collection of migration recovery points. +type MigrationRecoveryPointCollection struct { + autorest.Response `json:"-"` + // Value - The migration recovery point details. + Value *[]MigrationRecoveryPoint `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MigrationRecoveryPointCollectionIterator provides access to a complete listing of MigrationRecoveryPoint +// values. +type MigrationRecoveryPointCollectionIterator struct { + i int + page MigrationRecoveryPointCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *MigrationRecoveryPointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *MigrationRecoveryPointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MigrationRecoveryPointCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter MigrationRecoveryPointCollectionIterator) Response() MigrationRecoveryPointCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter MigrationRecoveryPointCollectionIterator) Value() MigrationRecoveryPoint { + if !iter.page.NotDone() { + return MigrationRecoveryPoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the MigrationRecoveryPointCollectionIterator type. +func NewMigrationRecoveryPointCollectionIterator(page MigrationRecoveryPointCollectionPage) MigrationRecoveryPointCollectionIterator { + return MigrationRecoveryPointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mrpc MigrationRecoveryPointCollection) IsEmpty() bool { + return mrpc.Value == nil || len(*mrpc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mrpc MigrationRecoveryPointCollection) hasNextLink() bool { + return mrpc.NextLink != nil && len(*mrpc.NextLink) != 0 +} + +// migrationRecoveryPointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mrpc MigrationRecoveryPointCollection) migrationRecoveryPointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !mrpc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mrpc.NextLink))) +} + +// MigrationRecoveryPointCollectionPage contains a page of MigrationRecoveryPoint values. +type MigrationRecoveryPointCollectionPage struct { + fn func(context.Context, MigrationRecoveryPointCollection) (MigrationRecoveryPointCollection, error) + mrpc MigrationRecoveryPointCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *MigrationRecoveryPointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.mrpc) + if err != nil { + return err + } + page.mrpc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *MigrationRecoveryPointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MigrationRecoveryPointCollectionPage) NotDone() bool { + return !page.mrpc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MigrationRecoveryPointCollectionPage) Response() MigrationRecoveryPointCollection { + return page.mrpc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MigrationRecoveryPointCollectionPage) Values() []MigrationRecoveryPoint { + if page.mrpc.IsEmpty() { + return nil + } + return *page.mrpc.Value +} + +// Creates a new instance of the MigrationRecoveryPointCollectionPage type. +func NewMigrationRecoveryPointCollectionPage(cur MigrationRecoveryPointCollection, getNextPage func(context.Context, MigrationRecoveryPointCollection) (MigrationRecoveryPointCollection, error)) MigrationRecoveryPointCollectionPage { + return MigrationRecoveryPointCollectionPage{ + fn: getNextPage, + mrpc: cur, + } +} + +// MigrationRecoveryPointProperties migration item recovery point properties. +type MigrationRecoveryPointProperties struct { + // RecoveryPointTime - READ-ONLY; The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointType - READ-ONLY; The recovery point type. Possible values include: 'MigrationRecoveryPointTypeNotSpecified', 'MigrationRecoveryPointTypeApplicationConsistent', 'MigrationRecoveryPointTypeCrashConsistent' + RecoveryPointType MigrationRecoveryPointType `json:"recoveryPointType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationRecoveryPointProperties. +func (mrpp MigrationRecoveryPointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MobilityServiceUpdate the Mobility Service update details. +type MobilityServiceUpdate struct { + // Version - The version of the latest update. + Version *string `json:"version,omitempty"` + // RebootStatus - The reboot status of the update - whether it is required or not. + RebootStatus *string `json:"rebootStatus,omitempty"` + // OsType - The OS type. + OsType *string `json:"osType,omitempty"` +} + +// Network network model. +type Network struct { + autorest.Response `json:"-"` + // Properties - The Network Properties. + Properties *NetworkProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Network. +func (n Network) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if n.Properties != nil { + objectMap["properties"] = n.Properties + } + if n.Location != nil { + objectMap["location"] = n.Location + } + return json.Marshal(objectMap) +} + +// NetworkCollection list of networks. +type NetworkCollection struct { + autorest.Response `json:"-"` + // Value - The Networks list details. + Value *[]Network `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// NetworkCollectionIterator provides access to a complete listing of Network values. +type NetworkCollectionIterator struct { + i int + page NetworkCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *NetworkCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *NetworkCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter NetworkCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter NetworkCollectionIterator) Response() NetworkCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter NetworkCollectionIterator) Value() Network { + if !iter.page.NotDone() { + return Network{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the NetworkCollectionIterator type. +func NewNetworkCollectionIterator(page NetworkCollectionPage) NetworkCollectionIterator { + return NetworkCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (nc NetworkCollection) IsEmpty() bool { + return nc.Value == nil || len(*nc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (nc NetworkCollection) hasNextLink() bool { + return nc.NextLink != nil && len(*nc.NextLink) != 0 +} + +// networkCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (nc NetworkCollection) networkCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !nc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(nc.NextLink))) +} + +// NetworkCollectionPage contains a page of Network values. +type NetworkCollectionPage struct { + fn func(context.Context, NetworkCollection) (NetworkCollection, error) + nc NetworkCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *NetworkCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.nc) + if err != nil { + return err + } + page.nc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *NetworkCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page NetworkCollectionPage) NotDone() bool { + return !page.nc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page NetworkCollectionPage) Response() NetworkCollection { + return page.nc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page NetworkCollectionPage) Values() []Network { + if page.nc.IsEmpty() { + return nil + } + return *page.nc.Value +} + +// Creates a new instance of the NetworkCollectionPage type. +func NewNetworkCollectionPage(cur NetworkCollection, getNextPage func(context.Context, NetworkCollection) (NetworkCollection, error)) NetworkCollectionPage { + return NetworkCollectionPage{ + fn: getNextPage, + nc: cur, + } +} + +// NetworkMapping network Mapping model. Ideally it should have been possible to inherit this class from +// prev version in InheritedModels as long as there is no difference in structure or method signature. +// Since there were no base Models for certain fields and methods viz NetworkMappingProperties and Load +// with required return type, the class has been introduced in its entirety with references to base models +// to facilitate extensions in subsequent versions. +type NetworkMapping struct { + autorest.Response `json:"-"` + // Properties - The Network Mapping Properties. + Properties *NetworkMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for NetworkMapping. +func (nm NetworkMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if nm.Properties != nil { + objectMap["properties"] = nm.Properties + } + if nm.Location != nil { + objectMap["location"] = nm.Location + } + return json.Marshal(objectMap) +} + +// NetworkMappingCollection list of network mappings. As with NetworkMapping, it should be possible to +// reuse a prev version of this class. It doesn't seem likely this class could be anything more than a +// slightly bespoke collection of NetworkMapping. Hence it makes sense to override Load with +// Base.NetworkMapping instead of existing CurrentVersion.NetworkMapping. +type NetworkMappingCollection struct { + autorest.Response `json:"-"` + // Value - The Network Mappings list. + Value *[]NetworkMapping `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// NetworkMappingCollectionIterator provides access to a complete listing of NetworkMapping values. +type NetworkMappingCollectionIterator struct { + i int + page NetworkMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *NetworkMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *NetworkMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter NetworkMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter NetworkMappingCollectionIterator) Response() NetworkMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter NetworkMappingCollectionIterator) Value() NetworkMapping { + if !iter.page.NotDone() { + return NetworkMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the NetworkMappingCollectionIterator type. +func NewNetworkMappingCollectionIterator(page NetworkMappingCollectionPage) NetworkMappingCollectionIterator { + return NetworkMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (nmc NetworkMappingCollection) IsEmpty() bool { + return nmc.Value == nil || len(*nmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (nmc NetworkMappingCollection) hasNextLink() bool { + return nmc.NextLink != nil && len(*nmc.NextLink) != 0 +} + +// networkMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (nmc NetworkMappingCollection) networkMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !nmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(nmc.NextLink))) +} + +// NetworkMappingCollectionPage contains a page of NetworkMapping values. +type NetworkMappingCollectionPage struct { + fn func(context.Context, NetworkMappingCollection) (NetworkMappingCollection, error) + nmc NetworkMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *NetworkMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.nmc) + if err != nil { + return err + } + page.nmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *NetworkMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page NetworkMappingCollectionPage) NotDone() bool { + return !page.nmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page NetworkMappingCollectionPage) Response() NetworkMappingCollection { + return page.nmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page NetworkMappingCollectionPage) Values() []NetworkMapping { + if page.nmc.IsEmpty() { + return nil + } + return *page.nmc.Value +} + +// Creates a new instance of the NetworkMappingCollectionPage type. +func NewNetworkMappingCollectionPage(cur NetworkMappingCollection, getNextPage func(context.Context, NetworkMappingCollection) (NetworkMappingCollection, error)) NetworkMappingCollectionPage { + return NetworkMappingCollectionPage{ + fn: getNextPage, + nmc: cur, + } +} + +// BasicNetworkMappingFabricSpecificSettings network Mapping fabric specific settings. +type BasicNetworkMappingFabricSpecificSettings interface { + AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) + AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) + AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) + AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) +} + +// NetworkMappingFabricSpecificSettings network Mapping fabric specific settings. +type NetworkMappingFabricSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicNetworkMappingFabricSpecificSettings(body []byte) (BasicNetworkMappingFabricSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure): + var atanms AzureToAzureNetworkMappingSettings + err := json.Unmarshal(body, &atanms) + return atanms, err + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure): + var vtanms VmmToAzureNetworkMappingSettings + err := json.Unmarshal(body, &vtanms) + return vtanms, err + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm): + var vtvnms VmmToVmmNetworkMappingSettings + err := json.Unmarshal(body, &vtvnms) + return vtvnms, err + default: + var nmfss NetworkMappingFabricSpecificSettings + err := json.Unmarshal(body, &nmfss) + return nmfss, err + } +} +func unmarshalBasicNetworkMappingFabricSpecificSettingsArray(body []byte) ([]BasicNetworkMappingFabricSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + nmfssArray := make([]BasicNetworkMappingFabricSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + nmfss, err := unmarshalBasicNetworkMappingFabricSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + nmfssArray[index] = nmfss + } + return nmfssArray, nil +} + +// MarshalJSON is the custom marshaler for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) MarshalJSON() ([]byte, error) { + nmfss.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings + objectMap := make(map[string]interface{}) + if nmfss.InstanceType != "" { + objectMap["instanceType"] = nmfss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return &nmfss, true +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &nmfss, true +} + +// NetworkMappingProperties network Mapping Properties. +type NetworkMappingProperties struct { + // State - The pairing state for network mapping. + State *string `json:"state,omitempty"` + // PrimaryNetworkFriendlyName - The primary network friendly name. + PrimaryNetworkFriendlyName *string `json:"primaryNetworkFriendlyName,omitempty"` + // PrimaryNetworkID - The primary network id for network mapping. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // PrimaryFabricFriendlyName - The primary fabric friendly name. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // RecoveryNetworkFriendlyName - The recovery network friendly name. + RecoveryNetworkFriendlyName *string `json:"recoveryNetworkFriendlyName,omitempty"` + // RecoveryNetworkID - The recovery network id for network mapping. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // RecoveryFabricArmID - The recovery fabric ARM id. + RecoveryFabricArmID *string `json:"recoveryFabricArmId,omitempty"` + // RecoveryFabricFriendlyName - The recovery fabric friendly name. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // FabricSpecificSettings - The fabric specific settings. + FabricSpecificSettings BasicNetworkMappingFabricSpecificSettings `json:"fabricSpecificSettings,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for NetworkMappingProperties struct. +func (nmp *NetworkMappingProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + nmp.State = &state + } + case "primaryNetworkFriendlyName": + if v != nil { + var primaryNetworkFriendlyName string + err = json.Unmarshal(*v, &primaryNetworkFriendlyName) + if err != nil { + return err + } + nmp.PrimaryNetworkFriendlyName = &primaryNetworkFriendlyName + } + case "primaryNetworkId": + if v != nil { + var primaryNetworkID string + err = json.Unmarshal(*v, &primaryNetworkID) + if err != nil { + return err + } + nmp.PrimaryNetworkID = &primaryNetworkID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + nmp.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "recoveryNetworkFriendlyName": + if v != nil { + var recoveryNetworkFriendlyName string + err = json.Unmarshal(*v, &recoveryNetworkFriendlyName) + if err != nil { + return err + } + nmp.RecoveryNetworkFriendlyName = &recoveryNetworkFriendlyName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + nmp.RecoveryNetworkID = &recoveryNetworkID + } + case "recoveryFabricArmId": + if v != nil { + var recoveryFabricArmID string + err = json.Unmarshal(*v, &recoveryFabricArmID) + if err != nil { + return err + } + nmp.RecoveryFabricArmID = &recoveryFabricArmID + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + nmp.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "fabricSpecificSettings": + if v != nil { + fabricSpecificSettings, err := unmarshalBasicNetworkMappingFabricSpecificSettings(*v) + if err != nil { + return err + } + nmp.FabricSpecificSettings = fabricSpecificSettings + } + } + } + + return nil +} + +// NetworkProperties network Properties. +type NetworkProperties struct { + // FabricType - The Fabric Type. + FabricType *string `json:"fabricType,omitempty"` + // Subnets - The List of subnets. + Subnets *[]Subnet `json:"subnets,omitempty"` + // FriendlyName - The Friendly Name. + FriendlyName *string `json:"friendlyName,omitempty"` + // NetworkType - The Network Type. + NetworkType *string `json:"networkType,omitempty"` +} + +// NewProtectionProfile new Protection profile input. +type NewProtectionProfile struct { + // PolicyName - The protection profile input. + PolicyName *string `json:"policyName,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for NewProtectionProfile. +func (npp NewProtectionProfile) MarshalJSON() ([]byte, error) { + npp.ResourceType = ResourceTypeNew + objectMap := make(map[string]interface{}) + if npp.PolicyName != nil { + objectMap["policyName"] = npp.PolicyName + } + if npp.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = npp.RecoveryPointHistory + } + if npp.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = npp.CrashConsistentFrequencyInMinutes + } + if npp.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = npp.AppConsistentFrequencyInMinutes + } + if npp.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = npp.MultiVMSyncStatus + } + if npp.ResourceType != "" { + objectMap["resourceType"] = npp.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return nil, false +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return &npp, true +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return nil, false +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &npp, true +} + +// NewRecoveryVirtualNetwork recovery virtual network input to create new virtual network from given source +// network. +type NewRecoveryVirtualNetwork struct { + // RecoveryVirtualNetworkResourceGroupName - The name of the resource group to be used to create the recovery virtual network. If absent, target network would be created in the same resource group as target VM. + RecoveryVirtualNetworkResourceGroupName *string `json:"recoveryVirtualNetworkResourceGroupName,omitempty"` + // RecoveryVirtualNetworkName - The recovery virtual network name. + RecoveryVirtualNetworkName *string `json:"recoveryVirtualNetworkName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) MarshalJSON() ([]byte, error) { + nrvn.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew + objectMap := make(map[string]interface{}) + if nrvn.RecoveryVirtualNetworkResourceGroupName != nil { + objectMap["recoveryVirtualNetworkResourceGroupName"] = nrvn.RecoveryVirtualNetworkResourceGroupName + } + if nrvn.RecoveryVirtualNetworkName != nil { + objectMap["recoveryVirtualNetworkName"] = nrvn.RecoveryVirtualNetworkName + } + if nrvn.ResourceType != "" { + objectMap["resourceType"] = nrvn.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return &nrvn, true +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &nrvn, true +} + +// OperationsDiscovery operations discovery class. +type OperationsDiscovery struct { + // Name - Name of the API. The name of the operation being performed on this particular object. It should match the action name that appears in RBAC / the event service. Examples of operations include: * Microsoft.Compute/virtualMachine/capture/action * Microsoft.Compute/virtualMachine/restart/action * Microsoft.Compute/virtualMachine/write * Microsoft.Compute/virtualMachine/read * Microsoft.Compute/virtualMachine/delete Each action should include, in order: (1) Resource Provider Namespace (2) Type hierarchy for which the action applies (e.g. server/databases for a SQL Azure database) (3) Read, Write, Action or Delete indicating which type applies. If it is a PUT/PATCH on a collection or named value, Write should be used. If it is a GET, Read should be used. If it is a DELETE, Delete should be used. If it is a POST, Action should be used. As a note: all resource providers would need to include the "{Resource Provider Namespace}/register/action" operation in their response. This API is used to register for their service, and should include details about the operation (e.g. a localized name for the resource provider + any special considerations like PII release). + Name *string `json:"name,omitempty"` + // Display - Object type. + Display *Display `json:"display,omitempty"` + // Origin - Origin. The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. Default value is "user,system". + Origin *string `json:"origin,omitempty"` + // Properties - Properties. Reserved for future use. + Properties interface{} `json:"properties,omitempty"` +} + +// OperationsDiscoveryCollection collection of ClientDiscovery details. +type OperationsDiscoveryCollection struct { + autorest.Response `json:"-"` + // Value - The ClientDiscovery details. + Value *[]OperationsDiscovery `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationsDiscoveryCollectionIterator provides access to a complete listing of OperationsDiscovery +// values. +type OperationsDiscoveryCollectionIterator struct { + i int + page OperationsDiscoveryCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationsDiscoveryCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsDiscoveryCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationsDiscoveryCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationsDiscoveryCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationsDiscoveryCollectionIterator) Response() OperationsDiscoveryCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationsDiscoveryCollectionIterator) Value() OperationsDiscovery { + if !iter.page.NotDone() { + return OperationsDiscovery{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationsDiscoveryCollectionIterator type. +func NewOperationsDiscoveryCollectionIterator(page OperationsDiscoveryCollectionPage) OperationsDiscoveryCollectionIterator { + return OperationsDiscoveryCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (odc OperationsDiscoveryCollection) IsEmpty() bool { + return odc.Value == nil || len(*odc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (odc OperationsDiscoveryCollection) hasNextLink() bool { + return odc.NextLink != nil && len(*odc.NextLink) != 0 +} + +// operationsDiscoveryCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (odc OperationsDiscoveryCollection) operationsDiscoveryCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !odc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(odc.NextLink))) +} + +// OperationsDiscoveryCollectionPage contains a page of OperationsDiscovery values. +type OperationsDiscoveryCollectionPage struct { + fn func(context.Context, OperationsDiscoveryCollection) (OperationsDiscoveryCollection, error) + odc OperationsDiscoveryCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationsDiscoveryCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsDiscoveryCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.odc) + if err != nil { + return err + } + page.odc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationsDiscoveryCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationsDiscoveryCollectionPage) NotDone() bool { + return !page.odc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationsDiscoveryCollectionPage) Response() OperationsDiscoveryCollection { + return page.odc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationsDiscoveryCollectionPage) Values() []OperationsDiscovery { + if page.odc.IsEmpty() { + return nil + } + return *page.odc.Value +} + +// Creates a new instance of the OperationsDiscoveryCollectionPage type. +func NewOperationsDiscoveryCollectionPage(cur OperationsDiscoveryCollection, getNextPage func(context.Context, OperationsDiscoveryCollection) (OperationsDiscoveryCollection, error)) OperationsDiscoveryCollectionPage { + return OperationsDiscoveryCollectionPage{ + fn: getNextPage, + odc: cur, + } +} + +// OSDetails disk Details. +type OSDetails struct { + // OsType - VM Disk details. + OsType *string `json:"osType,omitempty"` + // ProductType - Product type. + ProductType *string `json:"productType,omitempty"` + // OsEdition - The OSEdition. + OsEdition *string `json:"osEdition,omitempty"` + // OSVersion - The OS Version. + OSVersion *string `json:"oSVersion,omitempty"` + // OSMajorVersion - The OS Major Version. + OSMajorVersion *string `json:"oSMajorVersion,omitempty"` + // OSMinorVersion - The OS Minor Version. + OSMinorVersion *string `json:"oSMinorVersion,omitempty"` +} + +// OSDiskDetails details of the OS Disk. +type OSDiskDetails struct { + // OsVhdID - The id of the disk containing the OS. + OsVhdID *string `json:"osVhdId,omitempty"` + // OsType - The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // VhdName - The OS disk VHD name. + VhdName *string `json:"vhdName,omitempty"` +} + +// OSVersionWrapper wrapper model for OSVersion to include version and service pack info. +type OSVersionWrapper struct { + // Version - The version. + Version *string `json:"version,omitempty"` + // ServicePack - The service pack. + ServicePack *string `json:"servicePack,omitempty"` +} + +// PlannedFailoverInput input definition for planned failover. +type PlannedFailoverInput struct { + // Properties - Planned failover input properties. + Properties *PlannedFailoverInputProperties `json:"properties,omitempty"` +} + +// PlannedFailoverInputProperties input definition for planned failover input properties. +type PlannedFailoverInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicPlannedFailoverProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for PlannedFailoverInputProperties struct. +func (pfip *PlannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + pfip.FailoverDirection = &failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(*v) + if err != nil { + return err + } + pfip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicPlannedFailoverProviderSpecificFailoverInput provider specific failover input. +type BasicPlannedFailoverProviderSpecificFailoverInput interface { + AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) + AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) + AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) + AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) +} + +// PlannedFailoverProviderSpecificFailoverInput provider specific failover input. +type PlannedFailoverProviderSpecificFailoverInput struct { + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(body []byte) (BasicPlannedFailoverProviderSpecificFailoverInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeHyperVReplicaAzureFailback): + var hvrafpi HyperVReplicaAzureFailbackProviderInput + err := json.Unmarshal(body, &hvrafpi) + return hvrafpi, err + case string(InstanceTypeHyperVReplicaAzure): + var hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput + err := json.Unmarshal(body, &hvrapfpi) + return hvrapfpi, err + case string(InstanceTypeInMageRcmFailback): + var imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput + err := json.Unmarshal(body, &imrfpfpi) + return imrfpfpi, err + default: + var pfpsfi PlannedFailoverProviderSpecificFailoverInput + err := json.Unmarshal(body, &pfpsfi) + return pfpsfi, err + } +} +func unmarshalBasicPlannedFailoverProviderSpecificFailoverInputArray(body []byte) ([]BasicPlannedFailoverProviderSpecificFailoverInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pfpsfiArray := make([]BasicPlannedFailoverProviderSpecificFailoverInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pfpsfi, err := unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(*rawMessage) + if err != nil { + return nil, err + } + pfpsfiArray[index] = pfpsfi + } + return pfpsfiArray, nil +} + +// MarshalJSON is the custom marshaler for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) MarshalJSON() ([]byte, error) { + pfpsfi.InstanceType = InstanceTypePlannedFailoverProviderSpecificFailoverInput + objectMap := make(map[string]interface{}) + if pfpsfi.InstanceType != "" { + objectMap["instanceType"] = pfpsfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return &pfpsfi, true +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &pfpsfi, true +} + +// Policy protection profile details. +type Policy struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *PolicyProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Policy. +func (p Policy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.Properties != nil { + objectMap["properties"] = p.Properties + } + if p.Location != nil { + objectMap["location"] = p.Location + } + return json.Marshal(objectMap) +} + +// PolicyCollection protection Profile Collection details. +type PolicyCollection struct { + autorest.Response `json:"-"` + // Value - The policy details. + Value *[]Policy `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// PolicyCollectionIterator provides access to a complete listing of Policy values. +type PolicyCollectionIterator struct { + i int + page PolicyCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PolicyCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PolicyCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PolicyCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PolicyCollectionIterator) Response() PolicyCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PolicyCollectionIterator) Value() Policy { + if !iter.page.NotDone() { + return Policy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PolicyCollectionIterator type. +func NewPolicyCollectionIterator(page PolicyCollectionPage) PolicyCollectionIterator { + return PolicyCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pc PolicyCollection) IsEmpty() bool { + return pc.Value == nil || len(*pc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pc PolicyCollection) hasNextLink() bool { + return pc.NextLink != nil && len(*pc.NextLink) != 0 +} + +// policyCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pc PolicyCollection) policyCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pc.NextLink))) +} + +// PolicyCollectionPage contains a page of Policy values. +type PolicyCollectionPage struct { + fn func(context.Context, PolicyCollection) (PolicyCollection, error) + pc PolicyCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PolicyCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pc) + if err != nil { + return err + } + page.pc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PolicyCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PolicyCollectionPage) NotDone() bool { + return !page.pc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PolicyCollectionPage) Response() PolicyCollection { + return page.pc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PolicyCollectionPage) Values() []Policy { + if page.pc.IsEmpty() { + return nil + } + return *page.pc.Value +} + +// Creates a new instance of the PolicyCollectionPage type. +func NewPolicyCollectionPage(cur PolicyCollection, getNextPage func(context.Context, PolicyCollection) (PolicyCollection, error)) PolicyCollectionPage { + return PolicyCollectionPage{ + fn: getNextPage, + pc: cur, + } +} + +// PolicyProperties protection profile custom data details. +type PolicyProperties struct { + // FriendlyName - The FriendlyName. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProviderSpecificDetails - The ReplicationChannelSetting. + ProviderSpecificDetails BasicPolicyProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for PolicyProperties struct. +func (pp *PolicyProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + pp.FriendlyName = &friendlyName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicPolicyProviderSpecificDetails(*v) + if err != nil { + return err + } + pp.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicPolicyProviderSpecificDetails base class for Provider specific details for policies. +type BasicPolicyProviderSpecificDetails interface { + AsA2APolicyDetails() (*A2APolicyDetails, bool) + AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) + AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) + AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) + AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) + AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) + AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) + AsInMagePolicyDetails() (*InMagePolicyDetails, bool) + AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) + AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) + AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) + AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) +} + +// PolicyProviderSpecificDetails base class for Provider specific details for policies. +type PolicyProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicPolicyProviderSpecificDetails(body []byte) (BasicPolicyProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A): + var apd A2APolicyDetails + err := json.Unmarshal(body, &apd) + return apd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure): + var hvrapd HyperVReplicaAzurePolicyDetails + err := json.Unmarshal(body, &hvrapd) + return hvrapd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails): + var hvrbpd HyperVReplicaBasePolicyDetails + err := json.Unmarshal(body, &hvrbpd) + return hvrbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2): + var hvrbpd HyperVReplicaBluePolicyDetails + err := json.Unmarshal(body, &hvrbpd) + return hvrbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012): + var hvrpd HyperVReplicaPolicyDetails + err := json.Unmarshal(body, &hvrpd) + return hvrpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2): + var imavpd InMageAzureV2PolicyDetails + err := json.Unmarshal(body, &imavpd) + return imavpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails): + var imbpd InMageBasePolicyDetails + err := json.Unmarshal(body, &imbpd) + return imbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage): + var impd InMagePolicyDetails + err := json.Unmarshal(body, &impd) + return impd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback): + var imrfpd InMageRcmFailbackPolicyDetails + err := json.Unmarshal(body, &imrfpd) + return imrfpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm): + var imrpd InMageRcmPolicyDetails + err := json.Unmarshal(body, &imrpd) + return imrpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt): + var vcpd VmwareCbtPolicyDetails + err := json.Unmarshal(body, &vcpd) + return vcpd, err + default: + var ppsd PolicyProviderSpecificDetails + err := json.Unmarshal(body, &ppsd) + return ppsd, err + } +} +func unmarshalBasicPolicyProviderSpecificDetailsArray(body []byte) ([]BasicPolicyProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppsdArray := make([]BasicPolicyProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppsd, err := unmarshalBasicPolicyProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + ppsdArray[index] = ppsd + } + return ppsdArray, nil +} + +// MarshalJSON is the custom marshaler for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) MarshalJSON() ([]byte, error) { + ppsd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails + objectMap := make(map[string]interface{}) + if ppsd.InstanceType != "" { + objectMap["instanceType"] = ppsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return &ppsd, true +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &ppsd, true +} + +// BasicPolicyProviderSpecificInput base class for provider specific input. +type BasicPolicyProviderSpecificInput interface { + AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) + AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) + AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) + AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) + AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) + AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) + AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) + AsInMagePolicyInput() (*InMagePolicyInput, bool) + AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) + AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) + AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) + AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) +} + +// PolicyProviderSpecificInput base class for provider specific input. +type PolicyProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicPolicyProviderSpecificInput(body []byte) (BasicPolicyProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmpci A2ACrossClusterMigrationPolicyCreationInput + err := json.Unmarshal(body, &accmpci) + return accmpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A): + var apci A2APolicyCreationInput + err := json.Unmarshal(body, &apci) + return apci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvrapi HyperVReplicaAzurePolicyInput + err := json.Unmarshal(body, &hvrapi) + return hvrapi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2): + var hvrbpi HyperVReplicaBluePolicyInput + err := json.Unmarshal(body, &hvrbpi) + return hvrbpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012): + var hvrpi HyperVReplicaPolicyInput + err := json.Unmarshal(body, &hvrpi) + return hvrpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2): + var imavpi InMageAzureV2PolicyInput + err := json.Unmarshal(body, &imavpi) + return imavpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage): + var impi InMagePolicyInput + err := json.Unmarshal(body, &impi) + return impi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback): + var imrfpci InMageRcmFailbackPolicyCreationInput + err := json.Unmarshal(body, &imrfpci) + return imrfpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm): + var imrpci InMageRcmPolicyCreationInput + err := json.Unmarshal(body, &imrpci) + return imrpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt): + var vmcpci VMwareCbtPolicyCreationInput + err := json.Unmarshal(body, &vmcpci) + return vmcpci, err + default: + var ppsi PolicyProviderSpecificInput + err := json.Unmarshal(body, &ppsi) + return ppsi, err + } +} +func unmarshalBasicPolicyProviderSpecificInputArray(body []byte) ([]BasicPolicyProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppsiArray := make([]BasicPolicyProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppsi, err := unmarshalBasicPolicyProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + ppsiArray[index] = ppsi + } + return ppsiArray, nil +} + +// MarshalJSON is the custom marshaler for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) MarshalJSON() ([]byte, error) { + ppsi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput + objectMap := make(map[string]interface{}) + if ppsi.InstanceType != "" { + objectMap["instanceType"] = ppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return &ppsi, true +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &ppsi, true +} + +// ProcessServer details of the Process Server. +type ProcessServer struct { + // FriendlyName - The Process Server's friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ID - The Process Server Id. + ID *string `json:"id,omitempty"` + // IPAddress - The IP address of the server. + IPAddress *string `json:"ipAddress,omitempty"` + // OsType - The OS type of the server. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The version of the scout component on the server. + AgentVersion *string `json:"agentVersion,omitempty"` + // LastHeartbeat - The last heartbeat received from the server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // MobilityServiceUpdates - The list of the mobility service updates available on the Process Server. + MobilityServiceUpdates *[]MobilityServiceUpdate `json:"mobilityServiceUpdates,omitempty"` + // HostID - The agent generated Id. + HostID *string `json:"hostId,omitempty"` + // MachineCount - The servers configured with this PS. + MachineCount *string `json:"machineCount,omitempty"` + // ReplicationPairCount - The number of replication pairs configured in this PS. + ReplicationPairCount *string `json:"replicationPairCount,omitempty"` + // SystemLoad - The percentage of the system load. + SystemLoad *string `json:"systemLoad,omitempty"` + // SystemLoadStatus - The system load status. + SystemLoadStatus *string `json:"systemLoadStatus,omitempty"` + // CPULoad - The percentage of the CPU load. + CPULoad *string `json:"cpuLoad,omitempty"` + // CPULoadStatus - The CPU load status. + CPULoadStatus *string `json:"cpuLoadStatus,omitempty"` + // TotalMemoryInBytes - The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // MemoryUsageStatus - The memory usage status. + MemoryUsageStatus *string `json:"memoryUsageStatus,omitempty"` + // TotalSpaceInBytes - The total space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - The available space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // SpaceUsageStatus - The space usage status. + SpaceUsageStatus *string `json:"spaceUsageStatus,omitempty"` + // PsServiceStatus - The PS service status. + PsServiceStatus *string `json:"psServiceStatus,omitempty"` + // SslCertExpiryDate - The PS SSL cert expiry date. + SslCertExpiryDate *date.Time `json:"sslCertExpiryDate,omitempty"` + // SslCertExpiryRemainingDays - CS SSL cert expiry date. + SslCertExpiryRemainingDays *int32 `json:"sslCertExpiryRemainingDays,omitempty"` + // OsVersion - OS Version of the process server. Note: This will get populated if user has CS version greater than 9.12.0.0. + OsVersion *string `json:"osVersion,omitempty"` + // HealthErrors - Health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // AgentVersionDetails - The agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // Health - READ-ONLY; The health of Process Server. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // PsStatsRefreshTime - READ-ONLY; The process server stats refresh time. + PsStatsRefreshTime *date.Time `json:"psStatsRefreshTime,omitempty"` + // ThroughputUploadPendingDataInBytes - READ-ONLY; The uploading pending data in bytes. + ThroughputUploadPendingDataInBytes *int64 `json:"throughputUploadPendingDataInBytes,omitempty"` + // ThroughputInMBps - READ-ONLY; The throughput in MBps. + ThroughputInMBps *int64 `json:"throughputInMBps,omitempty"` + // ThroughputInBytes - READ-ONLY; The throughput in bytes. + ThroughputInBytes *int64 `json:"throughputInBytes,omitempty"` + // ThroughputStatus - READ-ONLY; The throughput status. + ThroughputStatus *string `json:"throughputStatus,omitempty"` + // MarsCommunicationStatus - READ-ONLY; The MARS communication status. + MarsCommunicationStatus *string `json:"marsCommunicationStatus,omitempty"` + // MarsRegistrationStatus - READ-ONLY; The MARS registration status. + MarsRegistrationStatus *string `json:"marsRegistrationStatus,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessServer. +func (ps ProcessServer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ps.FriendlyName != nil { + objectMap["friendlyName"] = ps.FriendlyName + } + if ps.ID != nil { + objectMap["id"] = ps.ID + } + if ps.IPAddress != nil { + objectMap["ipAddress"] = ps.IPAddress + } + if ps.OsType != nil { + objectMap["osType"] = ps.OsType + } + if ps.AgentVersion != nil { + objectMap["agentVersion"] = ps.AgentVersion + } + if ps.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = ps.LastHeartbeat + } + if ps.VersionStatus != nil { + objectMap["versionStatus"] = ps.VersionStatus + } + if ps.MobilityServiceUpdates != nil { + objectMap["mobilityServiceUpdates"] = ps.MobilityServiceUpdates + } + if ps.HostID != nil { + objectMap["hostId"] = ps.HostID + } + if ps.MachineCount != nil { + objectMap["machineCount"] = ps.MachineCount + } + if ps.ReplicationPairCount != nil { + objectMap["replicationPairCount"] = ps.ReplicationPairCount + } + if ps.SystemLoad != nil { + objectMap["systemLoad"] = ps.SystemLoad + } + if ps.SystemLoadStatus != nil { + objectMap["systemLoadStatus"] = ps.SystemLoadStatus + } + if ps.CPULoad != nil { + objectMap["cpuLoad"] = ps.CPULoad + } + if ps.CPULoadStatus != nil { + objectMap["cpuLoadStatus"] = ps.CPULoadStatus + } + if ps.TotalMemoryInBytes != nil { + objectMap["totalMemoryInBytes"] = ps.TotalMemoryInBytes + } + if ps.AvailableMemoryInBytes != nil { + objectMap["availableMemoryInBytes"] = ps.AvailableMemoryInBytes + } + if ps.MemoryUsageStatus != nil { + objectMap["memoryUsageStatus"] = ps.MemoryUsageStatus + } + if ps.TotalSpaceInBytes != nil { + objectMap["totalSpaceInBytes"] = ps.TotalSpaceInBytes + } + if ps.AvailableSpaceInBytes != nil { + objectMap["availableSpaceInBytes"] = ps.AvailableSpaceInBytes + } + if ps.SpaceUsageStatus != nil { + objectMap["spaceUsageStatus"] = ps.SpaceUsageStatus + } + if ps.PsServiceStatus != nil { + objectMap["psServiceStatus"] = ps.PsServiceStatus + } + if ps.SslCertExpiryDate != nil { + objectMap["sslCertExpiryDate"] = ps.SslCertExpiryDate + } + if ps.SslCertExpiryRemainingDays != nil { + objectMap["sslCertExpiryRemainingDays"] = ps.SslCertExpiryRemainingDays + } + if ps.OsVersion != nil { + objectMap["osVersion"] = ps.OsVersion + } + if ps.HealthErrors != nil { + objectMap["healthErrors"] = ps.HealthErrors + } + if ps.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = ps.AgentExpiryDate + } + if ps.AgentVersionDetails != nil { + objectMap["agentVersionDetails"] = ps.AgentVersionDetails + } + return json.Marshal(objectMap) +} + +// ProcessServerDetails process server details. +type ProcessServerDetails struct { + // ID - READ-ONLY; The process server Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The process server name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The process server Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The process server Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // IPAddresses - READ-ONLY; The list of IP addresses for communicating with the RCM component. + IPAddresses *[]string `json:"ipAddresses,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the process server. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // TotalMemoryInBytes - READ-ONLY; The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - READ-ONLY; The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // UsedMemoryInBytes - READ-ONLY; The used memory. + UsedMemoryInBytes *int64 `json:"usedMemoryInBytes,omitempty"` + // MemoryUsagePercentage - READ-ONLY; The memory usage percentage. + MemoryUsagePercentage *float64 `json:"memoryUsagePercentage,omitempty"` + // TotalSpaceInBytes - READ-ONLY; The total disk space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - READ-ONLY; The available disk space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // UsedSpaceInBytes - READ-ONLY; The used disk space. + UsedSpaceInBytes *int64 `json:"usedSpaceInBytes,omitempty"` + // FreeSpacePercentage - READ-ONLY; The free disk space percentage. + FreeSpacePercentage *float64 `json:"freeSpacePercentage,omitempty"` + // ThroughputUploadPendingDataInBytes - READ-ONLY; The uploading pending data in bytes. + ThroughputUploadPendingDataInBytes *int64 `json:"throughputUploadPendingDataInBytes,omitempty"` + // ThroughputInBytes - READ-ONLY; The throughput in bytes. + ThroughputInBytes *int64 `json:"throughputInBytes,omitempty"` + // ProcessorUsagePercentage - READ-ONLY; The processor usage percentage. + ProcessorUsagePercentage *float64 `json:"processorUsagePercentage,omitempty"` + // ThroughputStatus - READ-ONLY; The throughput status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + ThroughputStatus RcmComponentStatus `json:"throughputStatus,omitempty"` + // SystemLoad - READ-ONLY; The system load. + SystemLoad *int64 `json:"systemLoad,omitempty"` + // SystemLoadStatus - READ-ONLY; The system load status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + SystemLoadStatus RcmComponentStatus `json:"systemLoadStatus,omitempty"` + // DiskUsageStatus - READ-ONLY; The disk usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + DiskUsageStatus RcmComponentStatus `json:"diskUsageStatus,omitempty"` + // MemoryUsageStatus - READ-ONLY; The memory usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + MemoryUsageStatus RcmComponentStatus `json:"memoryUsageStatus,omitempty"` + // ProcessorUsageStatus - READ-ONLY; The processor usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + ProcessorUsageStatus RcmComponentStatus `json:"processorUsageStatus,omitempty"` + // Health - READ-ONLY; The health of the process server. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // ProtectedItemCount - READ-ONLY; The protected item count. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // HistoricHealth - READ-ONLY; The historic health of the process server based on the health in last 24 hours. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + HistoricHealth ProtectionHealth `json:"historicHealth,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessServerDetails. +func (psd ProcessServerDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ProtectableItem replication protected item. +type ProtectableItem struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectableItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectableItem. +func (pi ProtectableItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pi.Properties != nil { + objectMap["properties"] = pi.Properties + } + if pi.Location != nil { + objectMap["location"] = pi.Location + } + return json.Marshal(objectMap) +} + +// ProtectableItemCollection protectable item collection. +type ProtectableItemCollection struct { + autorest.Response `json:"-"` + // Value - The Protectable item details. + Value *[]ProtectableItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectableItemCollectionIterator provides access to a complete listing of ProtectableItem values. +type ProtectableItemCollectionIterator struct { + i int + page ProtectableItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectableItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectableItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectableItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectableItemCollectionIterator) Response() ProtectableItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectableItemCollectionIterator) Value() ProtectableItem { + if !iter.page.NotDone() { + return ProtectableItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectableItemCollectionIterator type. +func NewProtectableItemCollectionIterator(page ProtectableItemCollectionPage) ProtectableItemCollectionIterator { + return ProtectableItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pic ProtectableItemCollection) IsEmpty() bool { + return pic.Value == nil || len(*pic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pic ProtectableItemCollection) hasNextLink() bool { + return pic.NextLink != nil && len(*pic.NextLink) != 0 +} + +// protectableItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pic ProtectableItemCollection) protectableItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pic.NextLink))) +} + +// ProtectableItemCollectionPage contains a page of ProtectableItem values. +type ProtectableItemCollectionPage struct { + fn func(context.Context, ProtectableItemCollection) (ProtectableItemCollection, error) + pic ProtectableItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectableItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pic) + if err != nil { + return err + } + page.pic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectableItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectableItemCollectionPage) NotDone() bool { + return !page.pic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectableItemCollectionPage) Response() ProtectableItemCollection { + return page.pic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectableItemCollectionPage) Values() []ProtectableItem { + if page.pic.IsEmpty() { + return nil + } + return *page.pic.Value +} + +// Creates a new instance of the ProtectableItemCollectionPage type. +func NewProtectableItemCollectionPage(cur ProtectableItemCollection, getNextPage func(context.Context, ProtectableItemCollection) (ProtectableItemCollection, error)) ProtectableItemCollectionPage { + return ProtectableItemCollectionPage{ + fn: getNextPage, + pic: cur, + } +} + +// ProtectableItemProperties replication protected item custom data details. +type ProtectableItemProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionStatus - The protection status. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ReplicationProtectedItemID - The ARM resource of protected items. + ReplicationProtectedItemID *string `json:"replicationProtectedItemId,omitempty"` + // RecoveryServicesProviderID - The recovery provider ARM Id. + RecoveryServicesProviderID *string `json:"recoveryServicesProviderId,omitempty"` + // ProtectionReadinessErrors - The Current protection readiness errors. + ProtectionReadinessErrors *[]string `json:"protectionReadinessErrors,omitempty"` + // SupportedReplicationProviders - The list of replication providers supported for the protectable item. + SupportedReplicationProviders *[]string `json:"supportedReplicationProviders,omitempty"` + // CustomDetails - The Replication provider custom settings. + CustomDetails BasicConfigurationSettings `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ProtectableItemProperties struct. +func (pip *ProtectableItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + pip.FriendlyName = &friendlyName + } + case "protectionStatus": + if v != nil { + var protectionStatus string + err = json.Unmarshal(*v, &protectionStatus) + if err != nil { + return err + } + pip.ProtectionStatus = &protectionStatus + } + case "replicationProtectedItemId": + if v != nil { + var replicationProtectedItemID string + err = json.Unmarshal(*v, &replicationProtectedItemID) + if err != nil { + return err + } + pip.ReplicationProtectedItemID = &replicationProtectedItemID + } + case "recoveryServicesProviderId": + if v != nil { + var recoveryServicesProviderID string + err = json.Unmarshal(*v, &recoveryServicesProviderID) + if err != nil { + return err + } + pip.RecoveryServicesProviderID = &recoveryServicesProviderID + } + case "protectionReadinessErrors": + if v != nil { + var protectionReadinessErrors []string + err = json.Unmarshal(*v, &protectionReadinessErrors) + if err != nil { + return err + } + pip.ProtectionReadinessErrors = &protectionReadinessErrors + } + case "supportedReplicationProviders": + if v != nil { + var supportedReplicationProviders []string + err = json.Unmarshal(*v, &supportedReplicationProviders) + if err != nil { + return err + } + pip.SupportedReplicationProviders = &supportedReplicationProviders + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicConfigurationSettings(*v) + if err != nil { + return err + } + pip.CustomDetails = customDetails + } + } + } + + return nil +} + +// ProtectableItemQueryParameter query parameter to enumerate Protectable items. +type ProtectableItemQueryParameter struct { + // State - State of the Protectable item query filter. + State *string `json:"state,omitempty"` +} + +// ProtectedItemsQueryParameter query parameter to enumerate protected items. +type ProtectedItemsQueryParameter struct { + // SourceFabricName - The source fabric name filter. + SourceFabricName *string `json:"sourceFabricName,omitempty"` + // RecoveryPlanName - The recovery plan filter. + RecoveryPlanName *string `json:"recoveryPlanName,omitempty"` + // SourceFabricLocation - The source fabric location filter. + SourceFabricLocation *string `json:"sourceFabricLocation,omitempty"` + // FabricObjectID - The fabric object Id filter. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // VCenterName - The vCenter name filter. + VCenterName *string `json:"vCenterName,omitempty"` + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` + // MultiVMGroupCreateOption - Whether Multi VM group is auto created or specified by user. Possible values include: 'AutoCreated', 'UserSpecified' + MultiVMGroupCreateOption MultiVMGroupCreateOption `json:"multiVmGroupCreateOption,omitempty"` + // ProcessServerID - The process server Id filter. + ProcessServerID *string `json:"processServerId,omitempty"` +} + +// ProtectionContainer protection container details. +type ProtectionContainer struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectionContainerProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainer. +func (pc ProtectionContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pc.Properties != nil { + objectMap["properties"] = pc.Properties + } + if pc.Location != nil { + objectMap["location"] = pc.Location + } + return json.Marshal(objectMap) +} + +// ProtectionContainerCollection protection Container collection. +type ProtectionContainerCollection struct { + autorest.Response `json:"-"` + // Value - The Protection Container details. + Value *[]ProtectionContainer `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectionContainerCollectionIterator provides access to a complete listing of ProtectionContainer +// values. +type ProtectionContainerCollectionIterator struct { + i int + page ProtectionContainerCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectionContainerCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionContainerCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionContainerCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectionContainerCollectionIterator) Response() ProtectionContainerCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectionContainerCollectionIterator) Value() ProtectionContainer { + if !iter.page.NotDone() { + return ProtectionContainer{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectionContainerCollectionIterator type. +func NewProtectionContainerCollectionIterator(page ProtectionContainerCollectionPage) ProtectionContainerCollectionIterator { + return ProtectionContainerCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcc ProtectionContainerCollection) IsEmpty() bool { + return pcc.Value == nil || len(*pcc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pcc ProtectionContainerCollection) hasNextLink() bool { + return pcc.NextLink != nil && len(*pcc.NextLink) != 0 +} + +// protectionContainerCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcc ProtectionContainerCollection) protectionContainerCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pcc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcc.NextLink))) +} + +// ProtectionContainerCollectionPage contains a page of ProtectionContainer values. +type ProtectionContainerCollectionPage struct { + fn func(context.Context, ProtectionContainerCollection) (ProtectionContainerCollection, error) + pcc ProtectionContainerCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectionContainerCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pcc) + if err != nil { + return err + } + page.pcc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionContainerCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionContainerCollectionPage) NotDone() bool { + return !page.pcc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionContainerCollectionPage) Response() ProtectionContainerCollection { + return page.pcc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionContainerCollectionPage) Values() []ProtectionContainer { + if page.pcc.IsEmpty() { + return nil + } + return *page.pcc.Value +} + +// Creates a new instance of the ProtectionContainerCollectionPage type. +func NewProtectionContainerCollectionPage(cur ProtectionContainerCollection, getNextPage func(context.Context, ProtectionContainerCollection) (ProtectionContainerCollection, error)) ProtectionContainerCollectionPage { + return ProtectionContainerCollectionPage{ + fn: getNextPage, + pcc: cur, + } +} + +// ProtectionContainerFabricSpecificDetails base class for fabric specific details of container. +type ProtectionContainerFabricSpecificDetails struct { + // InstanceType - READ-ONLY; Gets the class type. Overridden in derived classes. + InstanceType *string `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainerFabricSpecificDetails. +func (pcfsd ProtectionContainerFabricSpecificDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ProtectionContainerMapping protection container mapping object. +type ProtectionContainerMapping struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectionContainerMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainerMapping. +func (pcm ProtectionContainerMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pcm.Properties != nil { + objectMap["properties"] = pcm.Properties + } + if pcm.Location != nil { + objectMap["location"] = pcm.Location + } + return json.Marshal(objectMap) +} + +// ProtectionContainerMappingCollection protection container mapping collection class. +type ProtectionContainerMappingCollection struct { + autorest.Response `json:"-"` + // Value - List of container mappings. + Value *[]ProtectionContainerMapping `json:"value,omitempty"` + // NextLink - Link to fetch rest of the data. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectionContainerMappingCollectionIterator provides access to a complete listing of +// ProtectionContainerMapping values. +type ProtectionContainerMappingCollectionIterator struct { + i int + page ProtectionContainerMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectionContainerMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionContainerMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionContainerMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectionContainerMappingCollectionIterator) Response() ProtectionContainerMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectionContainerMappingCollectionIterator) Value() ProtectionContainerMapping { + if !iter.page.NotDone() { + return ProtectionContainerMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectionContainerMappingCollectionIterator type. +func NewProtectionContainerMappingCollectionIterator(page ProtectionContainerMappingCollectionPage) ProtectionContainerMappingCollectionIterator { + return ProtectionContainerMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcmc ProtectionContainerMappingCollection) IsEmpty() bool { + return pcmc.Value == nil || len(*pcmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pcmc ProtectionContainerMappingCollection) hasNextLink() bool { + return pcmc.NextLink != nil && len(*pcmc.NextLink) != 0 +} + +// protectionContainerMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcmc ProtectionContainerMappingCollection) protectionContainerMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pcmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcmc.NextLink))) +} + +// ProtectionContainerMappingCollectionPage contains a page of ProtectionContainerMapping values. +type ProtectionContainerMappingCollectionPage struct { + fn func(context.Context, ProtectionContainerMappingCollection) (ProtectionContainerMappingCollection, error) + pcmc ProtectionContainerMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectionContainerMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pcmc) + if err != nil { + return err + } + page.pcmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionContainerMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionContainerMappingCollectionPage) NotDone() bool { + return !page.pcmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionContainerMappingCollectionPage) Response() ProtectionContainerMappingCollection { + return page.pcmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionContainerMappingCollectionPage) Values() []ProtectionContainerMapping { + if page.pcmc.IsEmpty() { + return nil + } + return *page.pcmc.Value +} + +// Creates a new instance of the ProtectionContainerMappingCollectionPage type. +func NewProtectionContainerMappingCollectionPage(cur ProtectionContainerMappingCollection, getNextPage func(context.Context, ProtectionContainerMappingCollection) (ProtectionContainerMappingCollection, error)) ProtectionContainerMappingCollectionPage { + return ProtectionContainerMappingCollectionPage{ + fn: getNextPage, + pcmc: cur, + } +} + +// ProtectionContainerMappingProperties protection container mapping properties. +type ProtectionContainerMappingProperties struct { + // TargetProtectionContainerID - Paired protection container ARM ID. + TargetProtectionContainerID *string `json:"targetProtectionContainerId,omitempty"` + // TargetProtectionContainerFriendlyName - Friendly name of paired container. + TargetProtectionContainerFriendlyName *string `json:"targetProtectionContainerFriendlyName,omitempty"` + // ProviderSpecificDetails - Provider specific provider details. + ProviderSpecificDetails BasicProtectionContainerMappingProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` + // Health - Health of pairing. + Health *string `json:"health,omitempty"` + // HealthErrorDetails - Health error. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // PolicyID - Policy ARM Id. + PolicyID *string `json:"policyId,omitempty"` + // State - Association Status. + State *string `json:"state,omitempty"` + // SourceProtectionContainerFriendlyName - Friendly name of source protection container. + SourceProtectionContainerFriendlyName *string `json:"sourceProtectionContainerFriendlyName,omitempty"` + // SourceFabricFriendlyName - Friendly name of source fabric. + SourceFabricFriendlyName *string `json:"sourceFabricFriendlyName,omitempty"` + // TargetFabricFriendlyName - Friendly name of target fabric. + TargetFabricFriendlyName *string `json:"targetFabricFriendlyName,omitempty"` + // PolicyFriendlyName - Friendly name of replication policy. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ProtectionContainerMappingProperties struct. +func (pcmp *ProtectionContainerMappingProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetProtectionContainerId": + if v != nil { + var targetProtectionContainerID string + err = json.Unmarshal(*v, &targetProtectionContainerID) + if err != nil { + return err + } + pcmp.TargetProtectionContainerID = &targetProtectionContainerID + } + case "targetProtectionContainerFriendlyName": + if v != nil { + var targetProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &targetProtectionContainerFriendlyName) + if err != nil { + return err + } + pcmp.TargetProtectionContainerFriendlyName = &targetProtectionContainerFriendlyName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicProtectionContainerMappingProviderSpecificDetails(*v) + if err != nil { + return err + } + pcmp.ProviderSpecificDetails = providerSpecificDetails + } + case "health": + if v != nil { + var health string + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + pcmp.Health = &health + } + case "healthErrorDetails": + if v != nil { + var healthErrorDetails []HealthError + err = json.Unmarshal(*v, &healthErrorDetails) + if err != nil { + return err + } + pcmp.HealthErrorDetails = &healthErrorDetails + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + pcmp.PolicyID = &policyID + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + pcmp.State = &state + } + case "sourceProtectionContainerFriendlyName": + if v != nil { + var sourceProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &sourceProtectionContainerFriendlyName) + if err != nil { + return err + } + pcmp.SourceProtectionContainerFriendlyName = &sourceProtectionContainerFriendlyName + } + case "sourceFabricFriendlyName": + if v != nil { + var sourceFabricFriendlyName string + err = json.Unmarshal(*v, &sourceFabricFriendlyName) + if err != nil { + return err + } + pcmp.SourceFabricFriendlyName = &sourceFabricFriendlyName + } + case "targetFabricFriendlyName": + if v != nil { + var targetFabricFriendlyName string + err = json.Unmarshal(*v, &targetFabricFriendlyName) + if err != nil { + return err + } + pcmp.TargetFabricFriendlyName = &targetFabricFriendlyName + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + pcmp.PolicyFriendlyName = &policyFriendlyName + } + } + } + + return nil +} + +// BasicProtectionContainerMappingProviderSpecificDetails container mapping provider specific details. +type BasicProtectionContainerMappingProviderSpecificDetails interface { + AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) + AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) + AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) + AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) +} + +// ProtectionContainerMappingProviderSpecificDetails container mapping provider specific details. +type ProtectionContainerMappingProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicProtectionContainerMappingProviderSpecificDetails(body []byte) (BasicProtectionContainerMappingProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A): + var apcmd A2AProtectionContainerMappingDetails + err := json.Unmarshal(body, &apcmd) + return apcmd, err + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm): + var imrpcmd InMageRcmProtectionContainerMappingDetails + err := json.Unmarshal(body, &imrpcmd) + return imrpcmd, err + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt): + var vmcpcmd VMwareCbtProtectionContainerMappingDetails + err := json.Unmarshal(body, &vmcpcmd) + return vmcpcmd, err + default: + var pcmpsd ProtectionContainerMappingProviderSpecificDetails + err := json.Unmarshal(body, &pcmpsd) + return pcmpsd, err + } +} +func unmarshalBasicProtectionContainerMappingProviderSpecificDetailsArray(body []byte) ([]BasicProtectionContainerMappingProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pcmpsdArray := make([]BasicProtectionContainerMappingProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pcmpsd, err := unmarshalBasicProtectionContainerMappingProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + pcmpsdArray[index] = pcmpsd + } + return pcmpsdArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) MarshalJSON() ([]byte, error) { + pcmpsd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails + objectMap := make(map[string]interface{}) + if pcmpsd.InstanceType != "" { + objectMap["instanceType"] = pcmpsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return &pcmpsd, true +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &pcmpsd, true +} + +// ProtectionContainerProperties protection profile custom data details. +type ProtectionContainerProperties struct { + // FabricFriendlyName - Fabric friendly name. + FabricFriendlyName *string `json:"fabricFriendlyName,omitempty"` + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // FabricType - The fabric type. + FabricType *string `json:"fabricType,omitempty"` + // ProtectedItemCount - Number of protected PEs. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // PairingStatus - The pairing status of this cloud. + PairingStatus *string `json:"pairingStatus,omitempty"` + // Role - The role of this cloud. + Role *string `json:"role,omitempty"` + // FabricSpecificDetails - Fabric specific details. + FabricSpecificDetails *ProtectionContainerFabricSpecificDetails `json:"fabricSpecificDetails,omitempty"` +} + +// BasicProtectionProfileCustomDetails protection Profile custom input. +type BasicProtectionProfileCustomDetails interface { + AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) + AsNewProtectionProfile() (*NewProtectionProfile, bool) + AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) +} + +// ProtectionProfileCustomDetails protection Profile custom input. +type ProtectionProfileCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +func unmarshalBasicProtectionProfileCustomDetails(body []byte) (BasicProtectionProfileCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeExisting): + var epp ExistingProtectionProfile + err := json.Unmarshal(body, &epp) + return epp, err + case string(ResourceTypeNew): + var npp NewProtectionProfile + err := json.Unmarshal(body, &npp) + return npp, err + default: + var ppcd ProtectionProfileCustomDetails + err := json.Unmarshal(body, &ppcd) + return ppcd, err + } +} +func unmarshalBasicProtectionProfileCustomDetailsArray(body []byte) ([]BasicProtectionProfileCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppcdArray := make([]BasicProtectionProfileCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppcd, err := unmarshalBasicProtectionProfileCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + ppcdArray[index] = ppcd + } + return ppcdArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) MarshalJSON() ([]byte, error) { + ppcd.ResourceType = ResourceTypeProtectionProfileCustomDetails + objectMap := make(map[string]interface{}) + if ppcd.ResourceType != "" { + objectMap["resourceType"] = ppcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return nil, false +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return nil, false +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return &ppcd, true +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &ppcd, true +} + +// ProviderError this class contains the error details per object. +type ProviderError struct { + // ErrorCode - The Error code. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorMessage - The Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // ErrorID - The Provider error Id. + ErrorID *string `json:"errorId,omitempty"` + // PossibleCauses - The possible causes for the error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - The recommended action to resolve the error. + RecommendedAction *string `json:"recommendedAction,omitempty"` +} + +// BasicProviderSpecificRecoveryPointDetails replication provider specific recovery point details. +type BasicProviderSpecificRecoveryPointDetails interface { + AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) + AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) + AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) + AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) +} + +// ProviderSpecificRecoveryPointDetails replication provider specific recovery point details. +type ProviderSpecificRecoveryPointDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicProviderSpecificRecoveryPointDetails(body []byte) (BasicProviderSpecificRecoveryPointDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A): + var arpd A2ARecoveryPointDetails + err := json.Unmarshal(body, &arpd) + return arpd, err + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2): + var imavrpd InMageAzureV2RecoveryPointDetails + err := json.Unmarshal(body, &imavrpd) + return imavrpd, err + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm): + var imrrpd InMageRcmRecoveryPointDetails + err := json.Unmarshal(body, &imrrpd) + return imrrpd, err + default: + var psrpd ProviderSpecificRecoveryPointDetails + err := json.Unmarshal(body, &psrpd) + return psrpd, err + } +} +func unmarshalBasicProviderSpecificRecoveryPointDetailsArray(body []byte) ([]BasicProviderSpecificRecoveryPointDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + psrpdArray := make([]BasicProviderSpecificRecoveryPointDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + psrpd, err := unmarshalBasicProviderSpecificRecoveryPointDetails(*rawMessage) + if err != nil { + return nil, err + } + psrpdArray[index] = psrpd + } + return psrpdArray, nil +} + +// MarshalJSON is the custom marshaler for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) MarshalJSON() ([]byte, error) { + psrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails + objectMap := make(map[string]interface{}) + if psrpd.InstanceType != "" { + objectMap["instanceType"] = psrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return &psrpd, true +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &psrpd, true +} + +// PushInstallerDetails push installer details. +type PushInstallerDetails struct { + // ID - READ-ONLY; The push installer Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The push installer name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The push installer Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The push installer Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the push installer. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the push installer. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for PushInstallerDetails. +func (pid PushInstallerDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RcmProxyDetails RCM proxy details. +type RcmProxyDetails struct { + // ID - READ-ONLY; The RCM proxy Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The RCM proxy name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The RCM proxy Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The RCM proxy Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // ClientAuthenticationType - READ-ONLY; The client authentication type. + ClientAuthenticationType *string `json:"clientAuthenticationType,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the RCM proxy. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the RCM proxy. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for RcmProxyDetails. +func (rpd RcmProxyDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// BasicRecoveryAvailabilitySetCustomDetails recovery Availability Set custom input. +type BasicRecoveryAvailabilitySetCustomDetails interface { + AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) + AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) +} + +// RecoveryAvailabilitySetCustomDetails recovery Availability Set custom input. +type RecoveryAvailabilitySetCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails', 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryAvailabilitySetCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryAvailabilitySetCustomDetails(body []byte) (BasicRecoveryAvailabilitySetCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting): + var eras ExistingRecoveryAvailabilitySet + err := json.Unmarshal(body, &eras) + return eras, err + default: + var rascd RecoveryAvailabilitySetCustomDetails + err := json.Unmarshal(body, &rascd) + return rascd, err + } +} +func unmarshalBasicRecoveryAvailabilitySetCustomDetailsArray(body []byte) ([]BasicRecoveryAvailabilitySetCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rascdArray := make([]BasicRecoveryAvailabilitySetCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rascd, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rascdArray[index] = rascd + } + return rascdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) MarshalJSON() ([]byte, error) { + rascd.ResourceType = ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails + objectMap := make(map[string]interface{}) + if rascd.ResourceType != "" { + objectMap["resourceType"] = rascd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryAvailabilitySet is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) { + return nil, false +} + +// AsRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) { + return &rascd, true +} + +// AsBasicRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsBasicRecoveryAvailabilitySetCustomDetails() (BasicRecoveryAvailabilitySetCustomDetails, bool) { + return &rascd, true +} + +// RecoveryPlan recovery plan details. +type RecoveryPlan struct { + autorest.Response `json:"-"` + // Properties - The custom details. + Properties *RecoveryPlanProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlan. +func (rp RecoveryPlan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.Properties != nil { + objectMap["properties"] = rp.Properties + } + if rp.Location != nil { + objectMap["location"] = rp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryPlanA2ADetails recovery plan A2A specific details. +type RecoveryPlanA2ADetails struct { + // PrimaryZone - The primary zone. + PrimaryZone *string `json:"primaryZone,omitempty"` + // RecoveryZone - The recovery zone. + RecoveryZone *string `json:"recoveryZone,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails', 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) MarshalJSON() ([]byte, error) { + rpad.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpad.PrimaryZone != nil { + objectMap["primaryZone"] = rpad.PrimaryZone + } + if rpad.RecoveryZone != nil { + objectMap["recoveryZone"] = rpad.RecoveryZone + } + if rpad.InstanceType != "" { + objectMap["instanceType"] = rpad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2ADetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) { + return &rpad, true +} + +// AsRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsBasicRecoveryPlanProviderSpecificDetails() (BasicRecoveryPlanProviderSpecificDetails, bool) { + return &rpad, true +} + +// RecoveryPlanA2AFailoverInput recovery plan A2A failover input. +type RecoveryPlanA2AFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'Latest', 'LatestApplicationConsistent', 'LatestCrashConsistent', 'LatestProcessed' + RecoveryPointType A2ARpRecoveryPointType `json:"recoveryPointType,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for TFO or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // MultiVMSyncPointOption - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. Possible values include: 'UseMultiVMSyncRecoveryPoint', 'UsePerVMRecoveryPoint' + MultiVMSyncPointOption MultiVMSyncPointOption `json:"multiVmSyncPointOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) MarshalJSON() ([]byte, error) { + rpafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpafi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpafi.RecoveryPointType + } + if rpafi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = rpafi.CloudServiceCreationOption + } + if rpafi.MultiVMSyncPointOption != "" { + objectMap["multiVmSyncPointOption"] = rpafi.MultiVMSyncPointOption + } + if rpafi.InstanceType != "" { + objectMap["instanceType"] = rpafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return &rpafi, true +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpafi, true +} + +// RecoveryPlanA2AInput recovery plan A2A input. +type RecoveryPlanA2AInput struct { + // PrimaryZone - The primary zone. + PrimaryZone *string `json:"primaryZone,omitempty"` + // RecoveryZone - The recovery zone. + RecoveryZone *string `json:"recoveryZone,omitempty"` + // PrimaryExtendedLocation - The primary extended location. + PrimaryExtendedLocation *ExtendedLocation `json:"primaryExtendedLocation,omitempty"` + // RecoveryExtendedLocation - The recovery extended location. + RecoveryExtendedLocation *ExtendedLocation `json:"recoveryExtendedLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) MarshalJSON() ([]byte, error) { + rpai.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpai.PrimaryZone != nil { + objectMap["primaryZone"] = rpai.PrimaryZone + } + if rpai.RecoveryZone != nil { + objectMap["recoveryZone"] = rpai.RecoveryZone + } + if rpai.PrimaryExtendedLocation != nil { + objectMap["primaryExtendedLocation"] = rpai.PrimaryExtendedLocation + } + if rpai.RecoveryExtendedLocation != nil { + objectMap["recoveryExtendedLocation"] = rpai.RecoveryExtendedLocation + } + if rpai.InstanceType != "" { + objectMap["instanceType"] = rpai.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) { + return &rpai, true +} + +// AsRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsBasicRecoveryPlanProviderSpecificInput() (BasicRecoveryPlanProviderSpecificInput, bool) { + return &rpai, true +} + +// RecoveryPlanAction recovery plan action details. +type RecoveryPlanAction struct { + // ActionName - The action name. + ActionName *string `json:"actionName,omitempty"` + // FailoverTypes - The list of failover types. + FailoverTypes *[]ReplicationProtectedItemOperation `json:"failoverTypes,omitempty"` + // FailoverDirections - The list of failover directions. + FailoverDirections *[]PossibleOperationsDirections `json:"failoverDirections,omitempty"` + // CustomDetails - The custom details. + CustomDetails BasicRecoveryPlanActionDetails `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanAction struct. +func (rpa *RecoveryPlanAction) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "actionName": + if v != nil { + var actionName string + err = json.Unmarshal(*v, &actionName) + if err != nil { + return err + } + rpa.ActionName = &actionName + } + case "failoverTypes": + if v != nil { + var failoverTypes []ReplicationProtectedItemOperation + err = json.Unmarshal(*v, &failoverTypes) + if err != nil { + return err + } + rpa.FailoverTypes = &failoverTypes + } + case "failoverDirections": + if v != nil { + var failoverDirections []PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirections) + if err != nil { + return err + } + rpa.FailoverDirections = &failoverDirections + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicRecoveryPlanActionDetails(*v) + if err != nil { + return err + } + rpa.CustomDetails = customDetails + } + } + } + + return nil +} + +// BasicRecoveryPlanActionDetails recovery plan action custom details. +type BasicRecoveryPlanActionDetails interface { + AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) + AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) + AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) + AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) +} + +// RecoveryPlanActionDetails recovery plan action custom details. +type RecoveryPlanActionDetails struct { + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanActionDetails(body []byte) (BasicRecoveryPlanActionDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAutomationRunbookActionDetails): + var rparad RecoveryPlanAutomationRunbookActionDetails + err := json.Unmarshal(body, &rparad) + return rparad, err + case string(InstanceTypeManualActionDetails): + var rpmad RecoveryPlanManualActionDetails + err := json.Unmarshal(body, &rpmad) + return rpmad, err + case string(InstanceTypeScriptActionDetails): + var rpsad RecoveryPlanScriptActionDetails + err := json.Unmarshal(body, &rpsad) + return rpsad, err + default: + var rpad RecoveryPlanActionDetails + err := json.Unmarshal(body, &rpad) + return rpad, err + } +} +func unmarshalBasicRecoveryPlanActionDetailsArray(body []byte) ([]BasicRecoveryPlanActionDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpadArray := make([]BasicRecoveryPlanActionDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpad, err := unmarshalBasicRecoveryPlanActionDetails(*rawMessage) + if err != nil { + return nil, err + } + rpadArray[index] = rpad + } + return rpadArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) MarshalJSON() ([]byte, error) { + rpad.InstanceType = InstanceTypeRecoveryPlanActionDetails + objectMap := make(map[string]interface{}) + if rpad.InstanceType != "" { + objectMap["instanceType"] = rpad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return &rpad, true +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpad, true +} + +// RecoveryPlanAutomationRunbookActionDetails recovery plan Automation runbook action details. +type RecoveryPlanAutomationRunbookActionDetails struct { + // RunbookID - The runbook ARM Id. + RunbookID *string `json:"runbookId,omitempty"` + // Timeout - The runbook timeout. + Timeout *string `json:"timeout,omitempty"` + // FabricLocation - The fabric location. Possible values include: 'Primary', 'Recovery' + FabricLocation RecoveryPlanActionLocation `json:"fabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) MarshalJSON() ([]byte, error) { + rparad.InstanceType = InstanceTypeAutomationRunbookActionDetails + objectMap := make(map[string]interface{}) + if rparad.RunbookID != nil { + objectMap["runbookId"] = rparad.RunbookID + } + if rparad.Timeout != nil { + objectMap["timeout"] = rparad.Timeout + } + if rparad.FabricLocation != "" { + objectMap["fabricLocation"] = rparad.FabricLocation + } + if rparad.InstanceType != "" { + objectMap["instanceType"] = rparad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return &rparad, true +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rparad, true +} + +// RecoveryPlanCollection recovery plan collection details. +type RecoveryPlanCollection struct { + autorest.Response `json:"-"` + // Value - The list of recovery plans. + Value *[]RecoveryPlan `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryPlanCollectionIterator provides access to a complete listing of RecoveryPlan values. +type RecoveryPlanCollectionIterator struct { + i int + page RecoveryPlanCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryPlanCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPlanCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryPlanCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryPlanCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryPlanCollectionIterator) Response() RecoveryPlanCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryPlanCollectionIterator) Value() RecoveryPlan { + if !iter.page.NotDone() { + return RecoveryPlan{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryPlanCollectionIterator type. +func NewRecoveryPlanCollectionIterator(page RecoveryPlanCollectionPage) RecoveryPlanCollectionIterator { + return RecoveryPlanCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (RPCVar RecoveryPlanCollection) IsEmpty() bool { + return RPCVar.Value == nil || len(*RPCVar.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (RPCVar RecoveryPlanCollection) hasNextLink() bool { + return RPCVar.NextLink != nil && len(*RPCVar.NextLink) != 0 +} + +// recoveryPlanCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (RPCVar RecoveryPlanCollection) recoveryPlanCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !RPCVar.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(RPCVar.NextLink))) +} + +// RecoveryPlanCollectionPage contains a page of RecoveryPlan values. +type RecoveryPlanCollectionPage struct { + fn func(context.Context, RecoveryPlanCollection) (RecoveryPlanCollection, error) + RPCVar RecoveryPlanCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryPlanCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPlanCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.RPCVar) + if err != nil { + return err + } + page.RPCVar = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryPlanCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryPlanCollectionPage) NotDone() bool { + return !page.RPCVar.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryPlanCollectionPage) Response() RecoveryPlanCollection { + return page.RPCVar +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryPlanCollectionPage) Values() []RecoveryPlan { + if page.RPCVar.IsEmpty() { + return nil + } + return *page.RPCVar.Value +} + +// Creates a new instance of the RecoveryPlanCollectionPage type. +func NewRecoveryPlanCollectionPage(cur RecoveryPlanCollection, getNextPage func(context.Context, RecoveryPlanCollection) (RecoveryPlanCollection, error)) RecoveryPlanCollectionPage { + return RecoveryPlanCollectionPage{ + fn: getNextPage, + RPCVar: cur, + } +} + +// RecoveryPlanGroup recovery plan group details. +type RecoveryPlanGroup struct { + // GroupType - The group type. Possible values include: 'Shutdown', 'Boot', 'Failover' + GroupType RecoveryPlanGroupType `json:"groupType,omitempty"` + // ReplicationProtectedItems - The list of protected items. + ReplicationProtectedItems *[]RecoveryPlanProtectedItem `json:"replicationProtectedItems,omitempty"` + // StartGroupActions - The start group actions. + StartGroupActions *[]RecoveryPlanAction `json:"startGroupActions,omitempty"` + // EndGroupActions - The end group actions. + EndGroupActions *[]RecoveryPlanAction `json:"endGroupActions,omitempty"` +} + +// BasicRecoveryPlanGroupTaskDetails this class represents the recovery plan group task. +type BasicRecoveryPlanGroupTaskDetails interface { + AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) + AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) +} + +// RecoveryPlanGroupTaskDetails this class represents the recovery plan group task. +type RecoveryPlanGroupTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // GroupID - The group identifier. + GroupID *string `json:"groupId,omitempty"` + // RpGroupType - The group type. + RpGroupType *string `json:"rpGroupType,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanGroupTaskDetails(body []byte) (BasicRecoveryPlanGroupTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeRecoveryPlanShutdownGroupTaskDetails): + var rpsgtd RecoveryPlanShutdownGroupTaskDetails + err := json.Unmarshal(body, &rpsgtd) + return rpsgtd, err + default: + var rpgtd RecoveryPlanGroupTaskDetails + err := json.Unmarshal(body, &rpgtd) + return rpgtd, err + } +} +func unmarshalBasicRecoveryPlanGroupTaskDetailsArray(body []byte) ([]BasicRecoveryPlanGroupTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpgtdArray := make([]BasicRecoveryPlanGroupTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpgtd, err := unmarshalBasicRecoveryPlanGroupTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + rpgtdArray[index] = rpgtd + } + return rpgtdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) MarshalJSON() ([]byte, error) { + rpgtd.InstanceType = InstanceTypeRecoveryPlanGroupTaskDetails + objectMap := make(map[string]interface{}) + if rpgtd.Name != nil { + objectMap["name"] = rpgtd.Name + } + if rpgtd.GroupID != nil { + objectMap["groupId"] = rpgtd.GroupID + } + if rpgtd.RpGroupType != nil { + objectMap["rpGroupType"] = rpgtd.RpGroupType + } + if rpgtd.ChildTasks != nil { + objectMap["childTasks"] = rpgtd.ChildTasks + } + if rpgtd.InstanceType != "" { + objectMap["instanceType"] = rpgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return &rpgtd, true +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return &rpgtd, true +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &rpgtd, true +} + +// RecoveryPlanHyperVReplicaAzureFailbackInput recovery plan HVR Azure failback input. +type RecoveryPlanHyperVReplicaAzureFailbackInput struct { + // DataSyncOption - The data sync option. Possible values include: 'ForDownTime', 'ForSynchronization' + DataSyncOption DataSyncStatus `json:"dataSyncOption,omitempty"` + // RecoveryVMCreationOption - The ALR option. Possible values include: 'CreateVMIfNotFound', 'NoAction' + RecoveryVMCreationOption AlternateLocationRecoveryOption `json:"recoveryVmCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) MarshalJSON() ([]byte, error) { + rphvrafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback + objectMap := make(map[string]interface{}) + if rphvrafi.DataSyncOption != "" { + objectMap["dataSyncOption"] = rphvrafi.DataSyncOption + } + if rphvrafi.RecoveryVMCreationOption != "" { + objectMap["recoveryVmCreationOption"] = rphvrafi.RecoveryVMCreationOption + } + if rphvrafi.InstanceType != "" { + objectMap["instanceType"] = rphvrafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return &rphvrafi, true +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rphvrafi, true +} + +// RecoveryPlanHyperVReplicaAzureFailoverInput recovery plan HVR Azure failover input. +type RecoveryPlanHyperVReplicaAzureFailoverInput struct { + // PrimaryKekCertificatePfx - The primary KEK certificate PFX. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - The secondary KEK certificate PFX. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointType - The recovery point type. Possible values include: 'HyperVReplicaAzureRpRecoveryPointTypeLatest', 'HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent', 'HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed' + RecoveryPointType HyperVReplicaAzureRpRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) MarshalJSON() ([]byte, error) { + rphvrafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if rphvrafi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = rphvrafi.PrimaryKekCertificatePfx + } + if rphvrafi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = rphvrafi.SecondaryKekCertificatePfx + } + if rphvrafi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rphvrafi.RecoveryPointType + } + if rphvrafi.InstanceType != "" { + objectMap["instanceType"] = rphvrafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return &rphvrafi, true +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rphvrafi, true +} + +// RecoveryPlanInMageAzureV2FailoverInput recovery plan InMageAzureV2 failover input. +type RecoveryPlanInMageAzureV2FailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'InMageV2RpRecoveryPointTypeLatest', 'InMageV2RpRecoveryPointTypeLatestApplicationConsistent', 'InMageV2RpRecoveryPointTypeLatestCrashConsistent', 'InMageV2RpRecoveryPointTypeLatestProcessed' + RecoveryPointType InMageV2RpRecoveryPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) MarshalJSON() ([]byte, error) { + rpimavfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if rpimavfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimavfi.RecoveryPointType + } + if rpimavfi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimavfi.UseMultiVMSyncPoint + } + if rpimavfi.InstanceType != "" { + objectMap["instanceType"] = rpimavfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return &rpimavfi, true +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimavfi, true +} + +// RecoveryPlanInMageFailoverInput recovery plan InMage failover input. +type RecoveryPlanInMageFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'RpInMageRecoveryPointTypeLatestTime', 'RpInMageRecoveryPointTypeLatestTag', 'RpInMageRecoveryPointTypeCustom' + RecoveryPointType RpInMageRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) MarshalJSON() ([]byte, error) { + rpimfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if rpimfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimfi.RecoveryPointType + } + if rpimfi.InstanceType != "" { + objectMap["instanceType"] = rpimfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return &rpimfi, true +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimfi, true +} + +// RecoveryPlanInMageRcmFailbackFailoverInput recovery plan InMageRcmFailback failover input. +type RecoveryPlanInMageRcmFailbackFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'ApplicationConsistent', 'CrashConsistent' + RecoveryPointType InMageRcmFailbackRecoveryPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) MarshalJSON() ([]byte, error) { + rpimrffi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if rpimrffi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimrffi.RecoveryPointType + } + if rpimrffi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimrffi.UseMultiVMSyncPoint + } + if rpimrffi.InstanceType != "" { + objectMap["instanceType"] = rpimrffi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return &rpimrffi, true +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimrffi, true +} + +// RecoveryPlanInMageRcmFailoverInput recovery plan InMageRcm failover input. +type RecoveryPlanInMageRcmFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'RecoveryPlanPointTypeLatest', 'RecoveryPlanPointTypeLatestApplicationConsistent', 'RecoveryPlanPointTypeLatestCrashConsistent', 'RecoveryPlanPointTypeLatestProcessed' + RecoveryPointType RecoveryPlanPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) MarshalJSON() ([]byte, error) { + rpimrfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if rpimrfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimrfi.RecoveryPointType + } + if rpimrfi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimrfi.UseMultiVMSyncPoint + } + if rpimrfi.InstanceType != "" { + objectMap["instanceType"] = rpimrfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return &rpimrfi, true +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimrfi, true +} + +// RecoveryPlanManualActionDetails recovery plan manual action details. +type RecoveryPlanManualActionDetails struct { + // Description - The manual action description. + Description *string `json:"description,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) MarshalJSON() ([]byte, error) { + rpmad.InstanceType = InstanceTypeManualActionDetails + objectMap := make(map[string]interface{}) + if rpmad.Description != nil { + objectMap["description"] = rpmad.Description + } + if rpmad.InstanceType != "" { + objectMap["instanceType"] = rpmad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return &rpmad, true +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpmad, true +} + +// RecoveryPlanPlannedFailoverInput recovery plan planned failover input. +type RecoveryPlanPlannedFailoverInput struct { + // Properties - The recovery plan planned failover input properties. + Properties *RecoveryPlanPlannedFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanPlannedFailoverInputProperties recovery plan planned failover input properties. +type RecoveryPlanPlannedFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanPlannedFailoverInputProperties struct. +func (rppfip *RecoveryPlanPlannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rppfip.FailoverDirection = failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rppfip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanProperties recovery plan properties. +type RecoveryPlanProperties struct { + // FriendlyName - The friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // PrimaryFabricID - The primary fabric Id. + PrimaryFabricID *string `json:"primaryFabricId,omitempty"` + // PrimaryFabricFriendlyName - The primary fabric friendly name. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // RecoveryFabricID - The recovery fabric Id. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // RecoveryFabricFriendlyName - The recovery fabric friendly name. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // FailoverDeploymentModel - The failover deployment model. + FailoverDeploymentModel *string `json:"failoverDeploymentModel,omitempty"` + // ReplicationProviders - The list of replication providers. + ReplicationProviders *[]string `json:"replicationProviders,omitempty"` + // AllowedOperations - The list of allowed operations. + AllowedOperations *[]string `json:"allowedOperations,omitempty"` + // LastPlannedFailoverTime - The start time of the last planned failover. + LastPlannedFailoverTime *date.Time `json:"lastPlannedFailoverTime,omitempty"` + // LastUnplannedFailoverTime - The start time of the last unplanned failover. + LastUnplannedFailoverTime *date.Time `json:"lastUnplannedFailoverTime,omitempty"` + // LastTestFailoverTime - The start time of the last test failover. + LastTestFailoverTime *date.Time `json:"lastTestFailoverTime,omitempty"` + // CurrentScenario - The current scenario details. + CurrentScenario *CurrentScenarioDetails `json:"currentScenario,omitempty"` + // CurrentScenarioStatus - The recovery plan status. + CurrentScenarioStatus *string `json:"currentScenarioStatus,omitempty"` + // CurrentScenarioStatusDescription - The recovery plan status description. + CurrentScenarioStatusDescription *string `json:"currentScenarioStatusDescription,omitempty"` + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` + // ProviderSpecificDetails - The provider id and provider specific details. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanProperties struct. +func (rpp *RecoveryPlanProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpp.FriendlyName = &friendlyName + } + case "primaryFabricId": + if v != nil { + var primaryFabricID string + err = json.Unmarshal(*v, &primaryFabricID) + if err != nil { + return err + } + rpp.PrimaryFabricID = &primaryFabricID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + rpp.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + rpp.RecoveryFabricID = &recoveryFabricID + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + rpp.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "failoverDeploymentModel": + if v != nil { + var failoverDeploymentModel string + err = json.Unmarshal(*v, &failoverDeploymentModel) + if err != nil { + return err + } + rpp.FailoverDeploymentModel = &failoverDeploymentModel + } + case "replicationProviders": + if v != nil { + var replicationProviders []string + err = json.Unmarshal(*v, &replicationProviders) + if err != nil { + return err + } + rpp.ReplicationProviders = &replicationProviders + } + case "allowedOperations": + if v != nil { + var allowedOperations []string + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + rpp.AllowedOperations = &allowedOperations + } + case "lastPlannedFailoverTime": + if v != nil { + var lastPlannedFailoverTime date.Time + err = json.Unmarshal(*v, &lastPlannedFailoverTime) + if err != nil { + return err + } + rpp.LastPlannedFailoverTime = &lastPlannedFailoverTime + } + case "lastUnplannedFailoverTime": + if v != nil { + var lastUnplannedFailoverTime date.Time + err = json.Unmarshal(*v, &lastUnplannedFailoverTime) + if err != nil { + return err + } + rpp.LastUnplannedFailoverTime = &lastUnplannedFailoverTime + } + case "lastTestFailoverTime": + if v != nil { + var lastTestFailoverTime date.Time + err = json.Unmarshal(*v, &lastTestFailoverTime) + if err != nil { + return err + } + rpp.LastTestFailoverTime = &lastTestFailoverTime + } + case "currentScenario": + if v != nil { + var currentScenario CurrentScenarioDetails + err = json.Unmarshal(*v, ¤tScenario) + if err != nil { + return err + } + rpp.CurrentScenario = ¤tScenario + } + case "currentScenarioStatus": + if v != nil { + var currentScenarioStatus string + err = json.Unmarshal(*v, ¤tScenarioStatus) + if err != nil { + return err + } + rpp.CurrentScenarioStatus = ¤tScenarioStatus + } + case "currentScenarioStatusDescription": + if v != nil { + var currentScenarioStatusDescription string + err = json.Unmarshal(*v, ¤tScenarioStatusDescription) + if err != nil { + return err + } + rpp.CurrentScenarioStatusDescription = ¤tScenarioStatusDescription + } + case "groups": + if v != nil { + var groups []RecoveryPlanGroup + err = json.Unmarshal(*v, &groups) + if err != nil { + return err + } + rpp.Groups = &groups + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificDetailsArray(*v) + if err != nil { + return err + } + rpp.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanProtectedItem recovery plan protected item. +type RecoveryPlanProtectedItem struct { + // ID - The ARM Id of the recovery plan protected item. + ID *string `json:"id,omitempty"` + // VirtualMachineID - The virtual machine Id. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` +} + +// BasicRecoveryPlanProviderSpecificDetails recovery plan provider specific details. +type BasicRecoveryPlanProviderSpecificDetails interface { + AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) + AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) +} + +// RecoveryPlanProviderSpecificDetails recovery plan provider specific details. +type RecoveryPlanProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails', 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificDetails(body []byte) (BasicRecoveryPlanProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A): + var rpad RecoveryPlanA2ADetails + err := json.Unmarshal(body, &rpad) + return rpad, err + default: + var rppsd RecoveryPlanProviderSpecificDetails + err := json.Unmarshal(body, &rppsd) + return rppsd, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificDetailsArray(body []byte) ([]BasicRecoveryPlanProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsdArray := make([]BasicRecoveryPlanProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsd, err := unmarshalBasicRecoveryPlanProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + rppsdArray[index] = rppsd + } + return rppsdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) MarshalJSON() ([]byte, error) { + rppsd.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails + objectMap := make(map[string]interface{}) + if rppsd.InstanceType != "" { + objectMap["instanceType"] = rppsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2ADetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) { + return &rppsd, true +} + +// AsBasicRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsBasicRecoveryPlanProviderSpecificDetails() (BasicRecoveryPlanProviderSpecificDetails, bool) { + return &rppsd, true +} + +// BasicRecoveryPlanProviderSpecificFailoverInput recovery plan provider specific failover input. +type BasicRecoveryPlanProviderSpecificFailoverInput interface { + AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) + AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) + AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) + AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) + AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) + AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) + AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) + AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) +} + +// RecoveryPlanProviderSpecificFailoverInput recovery plan provider specific failover input. +type RecoveryPlanProviderSpecificFailoverInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificFailoverInput(body []byte) (BasicRecoveryPlanProviderSpecificFailoverInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A): + var rpafi RecoveryPlanA2AFailoverInput + err := json.Unmarshal(body, &rpafi) + return rpafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback): + var rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput + err := json.Unmarshal(body, &rphvrafi) + return rphvrafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure): + var rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput + err := json.Unmarshal(body, &rphvrafi) + return rphvrafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2): + var rpimavfi RecoveryPlanInMageAzureV2FailoverInput + err := json.Unmarshal(body, &rpimavfi) + return rpimavfi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage): + var rpimfi RecoveryPlanInMageFailoverInput + err := json.Unmarshal(body, &rpimfi) + return rpimfi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback): + var rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput + err := json.Unmarshal(body, &rpimrffi) + return rpimrffi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm): + var rpimrfi RecoveryPlanInMageRcmFailoverInput + err := json.Unmarshal(body, &rpimrfi) + return rpimrfi, err + default: + var rppsfi RecoveryPlanProviderSpecificFailoverInput + err := json.Unmarshal(body, &rppsfi) + return rppsfi, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(body []byte) ([]BasicRecoveryPlanProviderSpecificFailoverInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsfiArray := make([]BasicRecoveryPlanProviderSpecificFailoverInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsfi, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInput(*rawMessage) + if err != nil { + return nil, err + } + rppsfiArray[index] = rppsfi + } + return rppsfiArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) MarshalJSON() ([]byte, error) { + rppsfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput + objectMap := make(map[string]interface{}) + if rppsfi.InstanceType != "" { + objectMap["instanceType"] = rppsfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return &rppsfi, true +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rppsfi, true +} + +// BasicRecoveryPlanProviderSpecificInput recovery plan provider specific input base class. +type BasicRecoveryPlanProviderSpecificInput interface { + AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) + AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) +} + +// RecoveryPlanProviderSpecificInput recovery plan provider specific input base class. +type RecoveryPlanProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificInput(body []byte) (BasicRecoveryPlanProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A): + var rpai RecoveryPlanA2AInput + err := json.Unmarshal(body, &rpai) + return rpai, err + default: + var rppsi RecoveryPlanProviderSpecificInput + err := json.Unmarshal(body, &rppsi) + return rppsi, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificInputArray(body []byte) ([]BasicRecoveryPlanProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsiArray := make([]BasicRecoveryPlanProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsi, err := unmarshalBasicRecoveryPlanProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rppsiArray[index] = rppsi + } + return rppsiArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) MarshalJSON() ([]byte, error) { + rppsi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput + objectMap := make(map[string]interface{}) + if rppsi.InstanceType != "" { + objectMap["instanceType"] = rppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) { + return &rppsi, true +} + +// AsBasicRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsBasicRecoveryPlanProviderSpecificInput() (BasicRecoveryPlanProviderSpecificInput, bool) { + return &rppsi, true +} + +// RecoveryPlanScriptActionDetails recovery plan script action details. +type RecoveryPlanScriptActionDetails struct { + // Path - The script path. + Path *string `json:"path,omitempty"` + // Timeout - The script timeout. + Timeout *string `json:"timeout,omitempty"` + // FabricLocation - The fabric location. Possible values include: 'Primary', 'Recovery' + FabricLocation RecoveryPlanActionLocation `json:"fabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) MarshalJSON() ([]byte, error) { + rpsad.InstanceType = InstanceTypeScriptActionDetails + objectMap := make(map[string]interface{}) + if rpsad.Path != nil { + objectMap["path"] = rpsad.Path + } + if rpsad.Timeout != nil { + objectMap["timeout"] = rpsad.Timeout + } + if rpsad.FabricLocation != "" { + objectMap["fabricLocation"] = rpsad.FabricLocation + } + if rpsad.InstanceType != "" { + objectMap["instanceType"] = rpsad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return &rpsad, true +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpsad, true +} + +// RecoveryPlanShutdownGroupTaskDetails this class represents the recovery plan shutdown group task +// details. +type RecoveryPlanShutdownGroupTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // GroupID - The group identifier. + GroupID *string `json:"groupId,omitempty"` + // RpGroupType - The group type. + RpGroupType *string `json:"rpGroupType,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) MarshalJSON() ([]byte, error) { + rpsgtd.InstanceType = InstanceTypeRecoveryPlanShutdownGroupTaskDetails + objectMap := make(map[string]interface{}) + if rpsgtd.Name != nil { + objectMap["name"] = rpsgtd.Name + } + if rpsgtd.GroupID != nil { + objectMap["groupId"] = rpsgtd.GroupID + } + if rpsgtd.RpGroupType != nil { + objectMap["rpGroupType"] = rpsgtd.RpGroupType + } + if rpsgtd.ChildTasks != nil { + objectMap["childTasks"] = rpsgtd.ChildTasks + } + if rpsgtd.InstanceType != "" { + objectMap["instanceType"] = rpsgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// RecoveryPlanTestFailoverCleanupInput recovery plan test failover cleanup input. +type RecoveryPlanTestFailoverCleanupInput struct { + // Properties - The recovery plan test failover cleanup input properties. + Properties *RecoveryPlanTestFailoverCleanupInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanTestFailoverCleanupInputProperties recovery plan test failover cleanup input properties. +type RecoveryPlanTestFailoverCleanupInputProperties struct { + // Comments - The test failover cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// RecoveryPlanTestFailoverInput recovery plan test failover input. +type RecoveryPlanTestFailoverInput struct { + // Properties - The recovery plan test failover input properties. + Properties *RecoveryPlanTestFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanTestFailoverInputProperties recovery plan test failover input properties. +type RecoveryPlanTestFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // NetworkType - The network type to be used for test failover. + NetworkType *string `json:"networkType,omitempty"` + // NetworkID - The Id of the network to be used for test failover. + NetworkID *string `json:"networkId,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanTestFailoverInputProperties struct. +func (rptfip *RecoveryPlanTestFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rptfip.FailoverDirection = failoverDirection + } + case "networkType": + if v != nil { + var networkType string + err = json.Unmarshal(*v, &networkType) + if err != nil { + return err + } + rptfip.NetworkType = &networkType + } + case "networkId": + if v != nil { + var networkID string + err = json.Unmarshal(*v, &networkID) + if err != nil { + return err + } + rptfip.NetworkID = &networkID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rptfip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanUnplannedFailoverInput recovery plan unplanned failover input. +type RecoveryPlanUnplannedFailoverInput struct { + // Properties - The recovery plan unplanned failover input properties. + Properties *RecoveryPlanUnplannedFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanUnplannedFailoverInputProperties recovery plan unplanned failover input properties. +type RecoveryPlanUnplannedFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // SourceSiteOperations - A value indicating whether source site operations are required. Possible values include: 'Required', 'NotRequired' + SourceSiteOperations SourceSiteOperations `json:"sourceSiteOperations,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanUnplannedFailoverInputProperties struct. +func (rpufip *RecoveryPlanUnplannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rpufip.FailoverDirection = failoverDirection + } + case "sourceSiteOperations": + if v != nil { + var sourceSiteOperations SourceSiteOperations + err = json.Unmarshal(*v, &sourceSiteOperations) + if err != nil { + return err + } + rpufip.SourceSiteOperations = sourceSiteOperations + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rpufip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPoint recovery point. +type RecoveryPoint struct { + autorest.Response `json:"-"` + // Properties - The recovery point properties. + Properties *RecoveryPointProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPoint. +func (rp RecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.Properties != nil { + objectMap["properties"] = rp.Properties + } + if rp.Location != nil { + objectMap["location"] = rp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryPointCollection collection of recovery point details. +type RecoveryPointCollection struct { + autorest.Response `json:"-"` + // Value - The recovery point details. + Value *[]RecoveryPoint `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryPointCollectionIterator provides access to a complete listing of RecoveryPoint values. +type RecoveryPointCollectionIterator struct { + i int + page RecoveryPointCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryPointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryPointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryPointCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryPointCollectionIterator) Response() RecoveryPointCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryPointCollectionIterator) Value() RecoveryPoint { + if !iter.page.NotDone() { + return RecoveryPoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryPointCollectionIterator type. +func NewRecoveryPointCollectionIterator(page RecoveryPointCollectionPage) RecoveryPointCollectionIterator { + return RecoveryPointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (RPCVar RecoveryPointCollection) IsEmpty() bool { + return RPCVar.Value == nil || len(*RPCVar.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (RPCVar RecoveryPointCollection) hasNextLink() bool { + return RPCVar.NextLink != nil && len(*RPCVar.NextLink) != 0 +} + +// recoveryPointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (RPCVar RecoveryPointCollection) recoveryPointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !RPCVar.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(RPCVar.NextLink))) +} + +// RecoveryPointCollectionPage contains a page of RecoveryPoint values. +type RecoveryPointCollectionPage struct { + fn func(context.Context, RecoveryPointCollection) (RecoveryPointCollection, error) + RPCVar RecoveryPointCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryPointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.RPCVar) + if err != nil { + return err + } + page.RPCVar = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryPointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryPointCollectionPage) NotDone() bool { + return !page.RPCVar.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryPointCollectionPage) Response() RecoveryPointCollection { + return page.RPCVar +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryPointCollectionPage) Values() []RecoveryPoint { + if page.RPCVar.IsEmpty() { + return nil + } + return *page.RPCVar.Value +} + +// Creates a new instance of the RecoveryPointCollectionPage type. +func NewRecoveryPointCollectionPage(cur RecoveryPointCollection, getNextPage func(context.Context, RecoveryPointCollection) (RecoveryPointCollection, error)) RecoveryPointCollectionPage { + return RecoveryPointCollectionPage{ + fn: getNextPage, + RPCVar: cur, + } +} + +// RecoveryPointProperties recovery point properties. +type RecoveryPointProperties struct { + // RecoveryPointTime - The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointType - The recovery point type: ApplicationConsistent, CrashConsistent. + RecoveryPointType *string `json:"recoveryPointType,omitempty"` + // ProviderSpecificDetails - The provider specific details for the recovery point. + ProviderSpecificDetails BasicProviderSpecificRecoveryPointDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPointProperties struct. +func (rpp *RecoveryPointProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryPointTime": + if v != nil { + var recoveryPointTime date.Time + err = json.Unmarshal(*v, &recoveryPointTime) + if err != nil { + return err + } + rpp.RecoveryPointTime = &recoveryPointTime + } + case "recoveryPointType": + if v != nil { + var recoveryPointType string + err = json.Unmarshal(*v, &recoveryPointType) + if err != nil { + return err + } + rpp.RecoveryPointType = &recoveryPointType + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicProviderSpecificRecoveryPointDetails(*v) + if err != nil { + return err + } + rpp.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicRecoveryProximityPlacementGroupCustomDetails recovery Proximity placement group custom input. +type BasicRecoveryProximityPlacementGroupCustomDetails interface { + AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) + AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) +} + +// RecoveryProximityPlacementGroupCustomDetails recovery Proximity placement group custom input. +type RecoveryProximityPlacementGroupCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails', 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(body []byte) (BasicRecoveryProximityPlacementGroupCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting): + var erppg ExistingRecoveryProximityPlacementGroup + err := json.Unmarshal(body, &erppg) + return erppg, err + default: + var rppgcd RecoveryProximityPlacementGroupCustomDetails + err := json.Unmarshal(body, &rppgcd) + return rppgcd, err + } +} +func unmarshalBasicRecoveryProximityPlacementGroupCustomDetailsArray(body []byte) ([]BasicRecoveryProximityPlacementGroupCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppgcdArray := make([]BasicRecoveryProximityPlacementGroupCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppgcd, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rppgcdArray[index] = rppgcd + } + return rppgcdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) MarshalJSON() ([]byte, error) { + rppgcd.ResourceType = ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails + objectMap := make(map[string]interface{}) + if rppgcd.ResourceType != "" { + objectMap["resourceType"] = rppgcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryProximityPlacementGroup is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) { + return nil, false +} + +// AsRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) { + return &rppgcd, true +} + +// AsBasicRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsBasicRecoveryProximityPlacementGroupCustomDetails() (BasicRecoveryProximityPlacementGroupCustomDetails, bool) { + return &rppgcd, true +} + +// BasicRecoveryResourceGroupCustomDetails recovery Resource Group custom input. +type BasicRecoveryResourceGroupCustomDetails interface { + AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) + AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) +} + +// RecoveryResourceGroupCustomDetails recovery Resource Group custom input. +type RecoveryResourceGroupCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails', 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryResourceGroupCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryResourceGroupCustomDetails(body []byte) (BasicRecoveryResourceGroupCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting): + var errrg ExistingRecoveryRecoveryResourceGroup + err := json.Unmarshal(body, &errrg) + return errrg, err + default: + var rrgcd RecoveryResourceGroupCustomDetails + err := json.Unmarshal(body, &rrgcd) + return rrgcd, err + } +} +func unmarshalBasicRecoveryResourceGroupCustomDetailsArray(body []byte) ([]BasicRecoveryResourceGroupCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rrgcdArray := make([]BasicRecoveryResourceGroupCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rrgcd, err := unmarshalBasicRecoveryResourceGroupCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rrgcdArray[index] = rrgcd + } + return rrgcdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) MarshalJSON() ([]byte, error) { + rrgcd.ResourceType = ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails + objectMap := make(map[string]interface{}) + if rrgcd.ResourceType != "" { + objectMap["resourceType"] = rrgcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryRecoveryResourceGroup is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) { + return nil, false +} + +// AsRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) { + return &rrgcd, true +} + +// AsBasicRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsBasicRecoveryResourceGroupCustomDetails() (BasicRecoveryResourceGroupCustomDetails, bool) { + return &rrgcd, true +} + +// RecoveryServicesProvider provider details. +type RecoveryServicesProvider struct { + autorest.Response `json:"-"` + // Properties - Provider properties. + Properties *RecoveryServicesProviderProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryServicesProvider. +func (rsp RecoveryServicesProvider) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rsp.Properties != nil { + objectMap["properties"] = rsp.Properties + } + if rsp.Location != nil { + objectMap["location"] = rsp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryServicesProviderCollection collection of providers. +type RecoveryServicesProviderCollection struct { + autorest.Response `json:"-"` + // Value - The Servers details. + Value *[]RecoveryServicesProvider `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryServicesProviderCollectionIterator provides access to a complete listing of +// RecoveryServicesProvider values. +type RecoveryServicesProviderCollectionIterator struct { + i int + page RecoveryServicesProviderCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryServicesProviderCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryServicesProviderCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryServicesProviderCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryServicesProviderCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryServicesProviderCollectionIterator) Response() RecoveryServicesProviderCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryServicesProviderCollectionIterator) Value() RecoveryServicesProvider { + if !iter.page.NotDone() { + return RecoveryServicesProvider{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryServicesProviderCollectionIterator type. +func NewRecoveryServicesProviderCollectionIterator(page RecoveryServicesProviderCollectionPage) RecoveryServicesProviderCollectionIterator { + return RecoveryServicesProviderCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rspc RecoveryServicesProviderCollection) IsEmpty() bool { + return rspc.Value == nil || len(*rspc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rspc RecoveryServicesProviderCollection) hasNextLink() bool { + return rspc.NextLink != nil && len(*rspc.NextLink) != 0 +} + +// recoveryServicesProviderCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rspc RecoveryServicesProviderCollection) recoveryServicesProviderCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rspc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rspc.NextLink))) +} + +// RecoveryServicesProviderCollectionPage contains a page of RecoveryServicesProvider values. +type RecoveryServicesProviderCollectionPage struct { + fn func(context.Context, RecoveryServicesProviderCollection) (RecoveryServicesProviderCollection, error) + rspc RecoveryServicesProviderCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryServicesProviderCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryServicesProviderCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rspc) + if err != nil { + return err + } + page.rspc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryServicesProviderCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryServicesProviderCollectionPage) NotDone() bool { + return !page.rspc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryServicesProviderCollectionPage) Response() RecoveryServicesProviderCollection { + return page.rspc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryServicesProviderCollectionPage) Values() []RecoveryServicesProvider { + if page.rspc.IsEmpty() { + return nil + } + return *page.rspc.Value +} + +// Creates a new instance of the RecoveryServicesProviderCollectionPage type. +func NewRecoveryServicesProviderCollectionPage(cur RecoveryServicesProviderCollection, getNextPage func(context.Context, RecoveryServicesProviderCollection) (RecoveryServicesProviderCollection, error)) RecoveryServicesProviderCollectionPage { + return RecoveryServicesProviderCollectionPage{ + fn: getNextPage, + rspc: cur, + } +} + +// RecoveryServicesProviderProperties recovery services provider properties. +type RecoveryServicesProviderProperties struct { + // FabricType - Type of the site. + FabricType *string `json:"fabricType,omitempty"` + // FriendlyName - Friendly name of the DRA. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProviderVersion - The provider version. + ProviderVersion *string `json:"providerVersion,omitempty"` + // ServerVersion - The fabric provider. + ServerVersion *string `json:"serverVersion,omitempty"` + // ProviderVersionState - DRA version status. + ProviderVersionState *string `json:"providerVersionState,omitempty"` + // ProviderVersionExpiryDate - Expiry date of the version. + ProviderVersionExpiryDate *date.Time `json:"providerVersionExpiryDate,omitempty"` + // FabricFriendlyName - The fabric friendly name. + FabricFriendlyName *string `json:"fabricFriendlyName,omitempty"` + // LastHeartBeat - Time when last heartbeat was sent by the DRA. + LastHeartBeat *date.Time `json:"lastHeartBeat,omitempty"` + // ConnectionStatus - A value indicating whether DRA is responsive. + ConnectionStatus *string `json:"connectionStatus,omitempty"` + // ProtectedItemCount - Number of protected VMs currently managed by the DRA. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // AllowedScenarios - The scenarios allowed on this provider. + AllowedScenarios *[]string `json:"allowedScenarios,omitempty"` + // HealthErrorDetails - The recovery services provider health error details. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // DraIdentifier - The DRA Id. + DraIdentifier *string `json:"draIdentifier,omitempty"` + // MachineID - The machine Id. + MachineID *string `json:"machineId,omitempty"` + // MachineName - The machine name. + MachineName *string `json:"machineName,omitempty"` + // BiosID - The Bios Id. + BiosID *string `json:"biosId,omitempty"` + // AuthenticationIdentityDetails - The authentication identity details. + AuthenticationIdentityDetails *IdentityProviderDetails `json:"authenticationIdentityDetails,omitempty"` + // ResourceAccessIdentityDetails - The resource access identity details. + ResourceAccessIdentityDetails *IdentityProviderDetails `json:"resourceAccessIdentityDetails,omitempty"` + // DataPlaneAuthenticationIdentityDetails - The data plane authentication identity details. + DataPlaneAuthenticationIdentityDetails *IdentityProviderDetails `json:"dataPlaneAuthenticationIdentityDetails,omitempty"` + // ProviderVersionDetails - The provider version details. + ProviderVersionDetails *VersionDetails `json:"providerVersionDetails,omitempty"` +} + +// BasicRecoveryVirtualNetworkCustomDetails recovery Virtual network custom input. +type BasicRecoveryVirtualNetworkCustomDetails interface { + AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) + AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) + AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) +} + +// RecoveryVirtualNetworkCustomDetails recovery Virtual network custom input. +type RecoveryVirtualNetworkCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryVirtualNetworkCustomDetails(body []byte) (BasicRecoveryVirtualNetworkCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting): + var ervn ExistingRecoveryVirtualNetwork + err := json.Unmarshal(body, &ervn) + return ervn, err + case string(ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew): + var nrvn NewRecoveryVirtualNetwork + err := json.Unmarshal(body, &nrvn) + return nrvn, err + default: + var rvncd RecoveryVirtualNetworkCustomDetails + err := json.Unmarshal(body, &rvncd) + return rvncd, err + } +} +func unmarshalBasicRecoveryVirtualNetworkCustomDetailsArray(body []byte) ([]BasicRecoveryVirtualNetworkCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rvncdArray := make([]BasicRecoveryVirtualNetworkCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rvncd, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rvncdArray[index] = rvncd + } + return rvncdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) MarshalJSON() ([]byte, error) { + rvncd.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails + objectMap := make(map[string]interface{}) + if rvncd.ResourceType != "" { + objectMap["resourceType"] = rvncd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return &rvncd, true +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &rvncd, true +} + +// RemoveDisksInput input for remove disk(s) operation. +type RemoveDisksInput struct { + // Properties - Remove disk input properties. + Properties *RemoveDisksInputProperties `json:"properties,omitempty"` +} + +// RemoveDisksInputProperties remove Disk input properties. +type RemoveDisksInputProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicRemoveDisksProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RemoveDisksInputProperties struct. +func (rdip *RemoveDisksInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRemoveDisksProviderSpecificInput(*v) + if err != nil { + return err + } + rdip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicRemoveDisksProviderSpecificInput remove Disk provider specific input. +type BasicRemoveDisksProviderSpecificInput interface { + AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) + AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) +} + +// RemoveDisksProviderSpecificInput remove Disk provider specific input. +type RemoveDisksProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput', 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRemoveDisksProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRemoveDisksProviderSpecificInput(body []byte) (BasicRemoveDisksProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A): + var ardi A2ARemoveDisksInput + err := json.Unmarshal(body, &ardi) + return ardi, err + default: + var rdpsi RemoveDisksProviderSpecificInput + err := json.Unmarshal(body, &rdpsi) + return rdpsi, err + } +} +func unmarshalBasicRemoveDisksProviderSpecificInputArray(body []byte) ([]BasicRemoveDisksProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rdpsiArray := make([]BasicRemoveDisksProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rdpsi, err := unmarshalBasicRemoveDisksProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rdpsiArray[index] = rdpsi + } + return rdpsiArray, nil +} + +// MarshalJSON is the custom marshaler for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) MarshalJSON() ([]byte, error) { + rdpsi.InstanceType = InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput + objectMap := make(map[string]interface{}) + if rdpsi.InstanceType != "" { + objectMap["instanceType"] = rdpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARemoveDisksInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) { + return nil, false +} + +// AsRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) { + return &rdpsi, true +} + +// AsBasicRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsBasicRemoveDisksProviderSpecificInput() (BasicRemoveDisksProviderSpecificInput, bool) { + return &rdpsi, true +} + +// RemoveProtectionContainerMappingInput container unpairing input. +type RemoveProtectionContainerMappingInput struct { + // Properties - Configure protection input properties. + Properties *RemoveProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// RemoveProtectionContainerMappingInputProperties unpairing input properties. +type RemoveProtectionContainerMappingInputProperties struct { + // ProviderSpecificInput - Provider specific input for unpairing. + ProviderSpecificInput *ReplicationProviderContainerUnmappingInput `json:"providerSpecificInput,omitempty"` +} + +// RenewCertificateInput certificate renewal input. +type RenewCertificateInput struct { + // Properties - Renew certificate input properties. + Properties *RenewCertificateInputProperties `json:"properties,omitempty"` +} + +// RenewCertificateInputProperties renew Certificate input properties. +type RenewCertificateInputProperties struct { + // RenewCertificateType - Renew certificate type. + RenewCertificateType *string `json:"renewCertificateType,omitempty"` +} + +// ReplicationAgentDetails replication agent details. +type ReplicationAgentDetails struct { + // ID - READ-ONLY; The replication agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The replication agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The replication agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The replication agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the replication agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the replication agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationAgentDetails. +func (rad ReplicationAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ReplicationAppliance replication appliance definition. +type ReplicationAppliance struct { + // Properties - Appliance related data. + Properties *ReplicationApplianceProperties `json:"properties,omitempty"` +} + +// ReplicationApplianceProperties replication appliance properties. +type ReplicationApplianceProperties struct { + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicApplianceSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ReplicationApplianceProperties struct. +func (rap *ReplicationApplianceProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicApplianceSpecificDetails(*v) + if err != nil { + return err + } + rap.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// ReplicationEligibilityResults replication eligibility results response model. +type ReplicationEligibilityResults struct { + autorest.Response `json:"-"` + // Name - READ-ONLY; Gets the name of this object. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets the object type. + Type *string `json:"type,omitempty"` + // ID - READ-ONLY; Gets Unique ARM identifier for this object. + ID *string `json:"id,omitempty"` + // Properties - READ-ONLY; Gets properties model for replication eligibility results API. + Properties *ReplicationEligibilityResultsProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResults. +func (rer ReplicationEligibilityResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ReplicationEligibilityResultsCollection replication eligibility results collection response model. +type ReplicationEligibilityResultsCollection struct { + autorest.Response `json:"-"` + // Value - The replication eligibility results details. + Value *[]ReplicationEligibilityResults `json:"value,omitempty"` +} + +// ReplicationEligibilityResultsErrorInfo error model that can be exposed to the user. +type ReplicationEligibilityResultsErrorInfo struct { + // Code - The error code. + Code *string `json:"code,omitempty"` + // Message - The error message. + Message *string `json:"message,omitempty"` + // PossibleCauses - The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // Status - READ-ONLY; The error status. + Status *string `json:"status,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResultsErrorInfo. +func (rerei ReplicationEligibilityResultsErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rerei.Code != nil { + objectMap["code"] = rerei.Code + } + if rerei.Message != nil { + objectMap["message"] = rerei.Message + } + if rerei.PossibleCauses != nil { + objectMap["possibleCauses"] = rerei.PossibleCauses + } + if rerei.RecommendedAction != nil { + objectMap["recommendedAction"] = rerei.RecommendedAction + } + return json.Marshal(objectMap) +} + +// ReplicationEligibilityResultsProperties properties model for replication eligibility results API. +type ReplicationEligibilityResultsProperties struct { + // ClientRequestID - READ-ONLY; The client request Id. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // Errors - The error details. + Errors *[]ReplicationEligibilityResultsErrorInfo `json:"errors,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResultsProperties. +func (rerp ReplicationEligibilityResultsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rerp.Errors != nil { + objectMap["errors"] = rerp.Errors + } + return json.Marshal(objectMap) +} + +// ReplicationFabricsCheckConsistencyFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsCheckConsistencyFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsCheckConsistencyFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsCheckConsistencyFuture.Result. +func (future *ReplicationFabricsCheckConsistencyFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCheckConsistencyFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsCheckConsistencyFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.CheckConsistencyResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCheckConsistencyFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsCreateFuture.Result. +func (future *ReplicationFabricsCreateFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.CreateResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCreateFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsDeleteFuture.Result. +func (future *ReplicationFabricsDeleteFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsMigrateToAadFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsMigrateToAadFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsMigrateToAadFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsMigrateToAadFuture.Result. +func (future *ReplicationFabricsMigrateToAadFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsMigrateToAadFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsMigrateToAadFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsPurgeFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationFabricsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsPurgeFuture.Result. +func (future *ReplicationFabricsPurgeFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsReassociateGatewayFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsReassociateGatewayFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsReassociateGatewayFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsReassociateGatewayFuture.Result. +func (future *ReplicationFabricsReassociateGatewayFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsReassociateGatewayFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsReassociateGatewayFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.ReassociateGatewayResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsReassociateGatewayFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsRenewCertificateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsRenewCertificateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsRenewCertificateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsRenewCertificateFuture.Result. +func (future *ReplicationFabricsRenewCertificateFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsRenewCertificateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsRenewCertificateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.RenewCertificateResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsRenewCertificateFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationGroupDetails replication group details. This will be used in case of San. +type ReplicationGroupDetails struct { + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) MarshalJSON() ([]byte, error) { + rgd.InstanceType = InstanceTypeReplicationGroupDetails + objectMap := make(map[string]interface{}) + if rgd.InstanceType != "" { + objectMap["instanceType"] = rgd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return &rgd, true +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &rgd, true +} + +// ReplicationJobsCancelFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsCancelFuture.Result. +func (future *ReplicationJobsCancelFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.CancelResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsCancelFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsExportFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsExportFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsExportFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsExportFuture.Result. +func (future *ReplicationJobsExportFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsExportFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsExportFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.ExportResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsExportFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsRestartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsRestartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsRestartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsRestartFuture.Result. +func (future *ReplicationJobsRestartFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsRestartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsRestartFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.RestartResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsRestartFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsResumeFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsResumeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsResumeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsResumeFuture.Result. +func (future *ReplicationJobsResumeFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsResumeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsResumeFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.ResumeResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsResumeFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsCreateFuture.Result. +func (future *ReplicationMigrationItemsCreateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.CreateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsCreateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsDeleteFuture.Result. +func (future *ReplicationMigrationItemsDeleteFuture) result(client ReplicationMigrationItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationMigrationItemsMigrateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsMigrateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsMigrateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsMigrateFuture.Result. +func (future *ReplicationMigrationItemsMigrateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsMigrateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsMigrateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.MigrateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsMigrateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsResyncFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsResyncFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsResyncFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsResyncFuture.Result. +func (future *ReplicationMigrationItemsResyncFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsResyncFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsResyncFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.ResyncResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsResyncFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsTestMigrateCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationMigrationItemsTestMigrateCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsTestMigrateCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsTestMigrateCleanupFuture.Result. +func (future *ReplicationMigrationItemsTestMigrateCleanupFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.TestMigrateCleanupResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsTestMigrateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsTestMigrateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsTestMigrateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsTestMigrateFuture.Result. +func (future *ReplicationMigrationItemsTestMigrateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsTestMigrateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.TestMigrateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsUpdateFuture.Result. +func (future *ReplicationMigrationItemsUpdateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.UpdateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsUpdateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationNetworkMappingsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (NetworkMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsCreateFuture.Result. +func (future *ReplicationNetworkMappingsCreateFuture) result(client ReplicationNetworkMappingsClient) (nm NetworkMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + nm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nm.Response.Response, err = future.GetResult(sender); err == nil && nm.Response.Response.StatusCode != http.StatusNoContent { + nm, err = client.CreateResponder(nm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsCreateFuture", "Result", nm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationNetworkMappingsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsDeleteFuture.Result. +func (future *ReplicationNetworkMappingsDeleteFuture) result(client ReplicationNetworkMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationNetworkMappingsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (NetworkMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsUpdateFuture.Result. +func (future *ReplicationNetworkMappingsUpdateFuture) result(client ReplicationNetworkMappingsClient) (nm NetworkMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + nm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nm.Response.Response, err = future.GetResult(sender); err == nil && nm.Response.Response.StatusCode != http.StatusNoContent { + nm, err = client.UpdateResponder(nm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsUpdateFuture", "Result", nm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationPoliciesCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (Policy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesCreateFuture.Result. +func (future *ReplicationPoliciesCreateFuture) result(client ReplicationPoliciesClient) (p Policy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + p.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.CreateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesCreateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesDeleteFuture.Result. +func (future *ReplicationPoliciesDeleteFuture) result(client ReplicationPoliciesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationPoliciesUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (Policy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesUpdateFuture.Result. +func (future *ReplicationPoliciesUpdateFuture) result(client ReplicationPoliciesClient) (p Policy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + p.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.UpdateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesUpdateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItem replication protected item. +type ReplicationProtectedItem struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ReplicationProtectedItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectedItem. +func (rpi ReplicationProtectedItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpi.Properties != nil { + objectMap["properties"] = rpi.Properties + } + if rpi.Location != nil { + objectMap["location"] = rpi.Location + } + return json.Marshal(objectMap) +} + +// ReplicationProtectedItemCollection replication protected item collection. +type ReplicationProtectedItemCollection struct { + autorest.Response `json:"-"` + // Value - The Replication protected item details. + Value *[]ReplicationProtectedItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ReplicationProtectedItemCollectionIterator provides access to a complete listing of +// ReplicationProtectedItem values. +type ReplicationProtectedItemCollectionIterator struct { + i int + page ReplicationProtectedItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ReplicationProtectedItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ReplicationProtectedItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ReplicationProtectedItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ReplicationProtectedItemCollectionIterator) Response() ReplicationProtectedItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ReplicationProtectedItemCollectionIterator) Value() ReplicationProtectedItem { + if !iter.page.NotDone() { + return ReplicationProtectedItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ReplicationProtectedItemCollectionIterator type. +func NewReplicationProtectedItemCollectionIterator(page ReplicationProtectedItemCollectionPage) ReplicationProtectedItemCollectionIterator { + return ReplicationProtectedItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rpic ReplicationProtectedItemCollection) IsEmpty() bool { + return rpic.Value == nil || len(*rpic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rpic ReplicationProtectedItemCollection) hasNextLink() bool { + return rpic.NextLink != nil && len(*rpic.NextLink) != 0 +} + +// replicationProtectedItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rpic ReplicationProtectedItemCollection) replicationProtectedItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rpic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rpic.NextLink))) +} + +// ReplicationProtectedItemCollectionPage contains a page of ReplicationProtectedItem values. +type ReplicationProtectedItemCollectionPage struct { + fn func(context.Context, ReplicationProtectedItemCollection) (ReplicationProtectedItemCollection, error) + rpic ReplicationProtectedItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ReplicationProtectedItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rpic) + if err != nil { + return err + } + page.rpic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ReplicationProtectedItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ReplicationProtectedItemCollectionPage) NotDone() bool { + return !page.rpic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ReplicationProtectedItemCollectionPage) Response() ReplicationProtectedItemCollection { + return page.rpic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ReplicationProtectedItemCollectionPage) Values() []ReplicationProtectedItem { + if page.rpic.IsEmpty() { + return nil + } + return *page.rpic.Value +} + +// Creates a new instance of the ReplicationProtectedItemCollectionPage type. +func NewReplicationProtectedItemCollectionPage(cur ReplicationProtectedItemCollection, getNextPage func(context.Context, ReplicationProtectedItemCollection) (ReplicationProtectedItemCollection, error)) ReplicationProtectedItemCollectionPage { + return ReplicationProtectedItemCollectionPage{ + fn: getNextPage, + rpic: cur, + } +} + +// ReplicationProtectedItemProperties replication protected item custom data details. +type ReplicationProtectedItemProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectedItemType - The type of protected item type. + ProtectedItemType *string `json:"protectedItemType,omitempty"` + // ProtectableItemID - The protected item ARM Id. + ProtectableItemID *string `json:"protectableItemId,omitempty"` + // RecoveryServicesProviderID - The recovery provider ARM Id. + RecoveryServicesProviderID *string `json:"recoveryServicesProviderId,omitempty"` + // PrimaryFabricFriendlyName - The friendly name of the primary fabric. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // PrimaryFabricProvider - The fabric provider of the primary fabric. + PrimaryFabricProvider *string `json:"primaryFabricProvider,omitempty"` + // RecoveryFabricFriendlyName - The friendly name of recovery fabric. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // RecoveryFabricID - The Arm Id of recovery fabric. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // PrimaryProtectionContainerFriendlyName - The name of primary protection container friendly name. + PrimaryProtectionContainerFriendlyName *string `json:"primaryProtectionContainerFriendlyName,omitempty"` + // RecoveryProtectionContainerFriendlyName - The name of recovery container friendly name. + RecoveryProtectionContainerFriendlyName *string `json:"recoveryProtectionContainerFriendlyName,omitempty"` + // ProtectionState - The protection status. + ProtectionState *string `json:"protectionState,omitempty"` + // ProtectionStateDescription - The protection state description. + ProtectionStateDescription *string `json:"protectionStateDescription,omitempty"` + // ActiveLocation - The Current active location of the PE. + ActiveLocation *string `json:"activeLocation,omitempty"` + // TestFailoverState - The Test failover state. + TestFailoverState *string `json:"testFailoverState,omitempty"` + // TestFailoverStateDescription - The Test failover state description. + TestFailoverStateDescription *string `json:"testFailoverStateDescription,omitempty"` + // SwitchProviderState - The switch provider state. + SwitchProviderState *string `json:"switchProviderState,omitempty"` + // SwitchProviderStateDescription - The switch provider state description. + SwitchProviderStateDescription *string `json:"switchProviderStateDescription,omitempty"` + // AllowedOperations - The allowed operations on the Replication protected item. + AllowedOperations *[]string `json:"allowedOperations,omitempty"` + // ReplicationHealth - 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 `json:"replicationHealth,omitempty"` + // FailoverHealth - The consolidated failover health for the VM. + FailoverHealth *string `json:"failoverHealth,omitempty"` + // HealthErrors - List of health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // PolicyID - The ID of Policy governing this PE. + PolicyID *string `json:"policyId,omitempty"` + // PolicyFriendlyName - The name of Policy governing this PE. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` + // LastSuccessfulFailoverTime - The Last successful failover time. + LastSuccessfulFailoverTime *date.Time `json:"lastSuccessfulFailoverTime,omitempty"` + // LastSuccessfulTestFailoverTime - The Last successful test failover time. + LastSuccessfulTestFailoverTime *date.Time `json:"lastSuccessfulTestFailoverTime,omitempty"` + // CurrentScenario - The current scenario. + CurrentScenario *CurrentScenarioDetails `json:"currentScenario,omitempty"` + // FailoverRecoveryPointID - The recovery point ARM Id to which the Vm was failed over. + FailoverRecoveryPointID *string `json:"failoverRecoveryPointId,omitempty"` + // ProviderSpecificDetails - The Replication provider custom settings. + ProviderSpecificDetails BasicReplicationProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // EventCorrelationID - The correlation Id for events associated with this protected item. + EventCorrelationID *string `json:"eventCorrelationId,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ReplicationProtectedItemProperties struct. +func (rpip *ReplicationProtectedItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpip.FriendlyName = &friendlyName + } + case "protectedItemType": + if v != nil { + var protectedItemType string + err = json.Unmarshal(*v, &protectedItemType) + if err != nil { + return err + } + rpip.ProtectedItemType = &protectedItemType + } + case "protectableItemId": + if v != nil { + var protectableItemID string + err = json.Unmarshal(*v, &protectableItemID) + if err != nil { + return err + } + rpip.ProtectableItemID = &protectableItemID + } + case "recoveryServicesProviderId": + if v != nil { + var recoveryServicesProviderID string + err = json.Unmarshal(*v, &recoveryServicesProviderID) + if err != nil { + return err + } + rpip.RecoveryServicesProviderID = &recoveryServicesProviderID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + rpip.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "primaryFabricProvider": + if v != nil { + var primaryFabricProvider string + err = json.Unmarshal(*v, &primaryFabricProvider) + if err != nil { + return err + } + rpip.PrimaryFabricProvider = &primaryFabricProvider + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + rpip.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + rpip.RecoveryFabricID = &recoveryFabricID + } + case "primaryProtectionContainerFriendlyName": + if v != nil { + var primaryProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &primaryProtectionContainerFriendlyName) + if err != nil { + return err + } + rpip.PrimaryProtectionContainerFriendlyName = &primaryProtectionContainerFriendlyName + } + case "recoveryProtectionContainerFriendlyName": + if v != nil { + var recoveryProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &recoveryProtectionContainerFriendlyName) + if err != nil { + return err + } + rpip.RecoveryProtectionContainerFriendlyName = &recoveryProtectionContainerFriendlyName + } + case "protectionState": + if v != nil { + var protectionState string + err = json.Unmarshal(*v, &protectionState) + if err != nil { + return err + } + rpip.ProtectionState = &protectionState + } + case "protectionStateDescription": + if v != nil { + var protectionStateDescription string + err = json.Unmarshal(*v, &protectionStateDescription) + if err != nil { + return err + } + rpip.ProtectionStateDescription = &protectionStateDescription + } + case "activeLocation": + if v != nil { + var activeLocation string + err = json.Unmarshal(*v, &activeLocation) + if err != nil { + return err + } + rpip.ActiveLocation = &activeLocation + } + case "testFailoverState": + if v != nil { + var testFailoverState string + err = json.Unmarshal(*v, &testFailoverState) + if err != nil { + return err + } + rpip.TestFailoverState = &testFailoverState + } + case "testFailoverStateDescription": + if v != nil { + var testFailoverStateDescription string + err = json.Unmarshal(*v, &testFailoverStateDescription) + if err != nil { + return err + } + rpip.TestFailoverStateDescription = &testFailoverStateDescription + } + case "switchProviderState": + if v != nil { + var switchProviderState string + err = json.Unmarshal(*v, &switchProviderState) + if err != nil { + return err + } + rpip.SwitchProviderState = &switchProviderState + } + case "switchProviderStateDescription": + if v != nil { + var switchProviderStateDescription string + err = json.Unmarshal(*v, &switchProviderStateDescription) + if err != nil { + return err + } + rpip.SwitchProviderStateDescription = &switchProviderStateDescription + } + case "allowedOperations": + if v != nil { + var allowedOperations []string + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + rpip.AllowedOperations = &allowedOperations + } + case "replicationHealth": + if v != nil { + var replicationHealth string + err = json.Unmarshal(*v, &replicationHealth) + if err != nil { + return err + } + rpip.ReplicationHealth = &replicationHealth + } + case "failoverHealth": + if v != nil { + var failoverHealth string + err = json.Unmarshal(*v, &failoverHealth) + if err != nil { + return err + } + rpip.FailoverHealth = &failoverHealth + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + rpip.HealthErrors = &healthErrors + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + rpip.PolicyID = &policyID + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + rpip.PolicyFriendlyName = &policyFriendlyName + } + case "lastSuccessfulFailoverTime": + if v != nil { + var lastSuccessfulFailoverTime date.Time + err = json.Unmarshal(*v, &lastSuccessfulFailoverTime) + if err != nil { + return err + } + rpip.LastSuccessfulFailoverTime = &lastSuccessfulFailoverTime + } + case "lastSuccessfulTestFailoverTime": + if v != nil { + var lastSuccessfulTestFailoverTime date.Time + err = json.Unmarshal(*v, &lastSuccessfulTestFailoverTime) + if err != nil { + return err + } + rpip.LastSuccessfulTestFailoverTime = &lastSuccessfulTestFailoverTime + } + case "currentScenario": + if v != nil { + var currentScenario CurrentScenarioDetails + err = json.Unmarshal(*v, ¤tScenario) + if err != nil { + return err + } + rpip.CurrentScenario = ¤tScenario + } + case "failoverRecoveryPointId": + if v != nil { + var failoverRecoveryPointID string + err = json.Unmarshal(*v, &failoverRecoveryPointID) + if err != nil { + return err + } + rpip.FailoverRecoveryPointID = &failoverRecoveryPointID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReplicationProviderSpecificSettings(*v) + if err != nil { + return err + } + rpip.ProviderSpecificDetails = providerSpecificDetails + } + case "recoveryContainerId": + if v != nil { + var recoveryContainerID string + err = json.Unmarshal(*v, &recoveryContainerID) + if err != nil { + return err + } + rpip.RecoveryContainerID = &recoveryContainerID + } + case "eventCorrelationId": + if v != nil { + var eventCorrelationID string + err = json.Unmarshal(*v, &eventCorrelationID) + if err != nil { + return err + } + rpip.EventCorrelationID = &eventCorrelationID + } + } + } + + return nil +} + +// ReplicationProtectedItemsAddDisksFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsAddDisksFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsAddDisksFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsAddDisksFuture.Result. +func (future *ReplicationProtectedItemsAddDisksFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsAddDisksFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsAddDisksFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.AddDisksResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsAddDisksFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsApplyRecoveryPointFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsApplyRecoveryPointFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsApplyRecoveryPointFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsApplyRecoveryPointFuture.Result. +func (future *ReplicationProtectedItemsApplyRecoveryPointFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ApplyRecoveryPointResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsCreateFuture.Result. +func (future *ReplicationProtectedItemsCreateFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.CreateResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsCreateFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsDeleteFuture.Result. +func (future *ReplicationProtectedItemsDeleteFuture) result(client ReplicationProtectedItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectedItemsFailoverCancelFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsFailoverCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsFailoverCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsFailoverCancelFuture.Result. +func (future *ReplicationProtectedItemsFailoverCancelFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsFailoverCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.FailoverCancelResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCancelFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsFailoverCommitFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsFailoverCommitFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsFailoverCommitFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsFailoverCommitFuture.Result. +func (future *ReplicationProtectedItemsFailoverCommitFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCommitFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsFailoverCommitFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.FailoverCommitResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCommitFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsPlannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsPlannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsPlannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsPlannedFailoverFuture.Result. +func (future *ReplicationProtectedItemsPlannedFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPlannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsPlannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.PlannedFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPlannedFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsPurgeFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsPurgeFuture.Result. +func (future *ReplicationProtectedItemsPurgeFuture) result(client ReplicationProtectedItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectedItemsRemoveDisksFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsRemoveDisksFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsRemoveDisksFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsRemoveDisksFuture.Result. +func (future *ReplicationProtectedItemsRemoveDisksFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRemoveDisksFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsRemoveDisksFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.RemoveDisksResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRemoveDisksFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsRepairReplicationFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsRepairReplicationFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsRepairReplicationFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsRepairReplicationFuture.Result. +func (future *ReplicationProtectedItemsRepairReplicationFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRepairReplicationFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsRepairReplicationFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.RepairReplicationResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRepairReplicationFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsReprotectFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsReprotectFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsReprotectFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsReprotectFuture.Result. +func (future *ReplicationProtectedItemsReprotectFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsReprotectFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsReprotectFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ReprotectResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsReprotectFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsResolveHealthErrorsFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsResolveHealthErrorsFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsResolveHealthErrorsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsResolveHealthErrorsFuture.Result. +func (future *ReplicationProtectedItemsResolveHealthErrorsFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ResolveHealthErrorsResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsSwitchProviderFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsSwitchProviderFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsSwitchProviderFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsSwitchProviderFuture.Result. +func (future *ReplicationProtectedItemsSwitchProviderFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsSwitchProviderFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsSwitchProviderFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.SwitchProviderResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsSwitchProviderFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsTestFailoverCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsTestFailoverCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsTestFailoverCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsTestFailoverCleanupFuture.Result. +func (future *ReplicationProtectedItemsTestFailoverCleanupFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.TestFailoverCleanupResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsTestFailoverFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectedItemsTestFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsTestFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsTestFailoverFuture.Result. +func (future *ReplicationProtectedItemsTestFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsTestFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.TestFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUnplannedFailoverFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsUnplannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUnplannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUnplannedFailoverFuture.Result. +func (future *ReplicationProtectedItemsUnplannedFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UnplannedFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateApplianceFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsUpdateApplianceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateApplianceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateApplianceFuture.Result. +func (future *ReplicationProtectedItemsUpdateApplianceFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateApplianceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateApplianceFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateApplianceResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateApplianceFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateFuture.Result. +func (future *ReplicationProtectedItemsUpdateFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateMobilityServiceFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsUpdateMobilityServiceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateMobilityServiceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateMobilityServiceFuture.Result. +func (future *ReplicationProtectedItemsUpdateMobilityServiceFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateMobilityServiceResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainerMappingsCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (ProtectionContainerMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsCreateFuture.Result. +func (future *ReplicationProtectionContainerMappingsCreateFuture) result(client ReplicationProtectionContainerMappingsClient) (pcm ProtectionContainerMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pcm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pcm.Response.Response, err = future.GetResult(sender); err == nil && pcm.Response.Response.StatusCode != http.StatusNoContent { + pcm, err = client.CreateResponder(pcm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsCreateFuture", "Result", pcm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainerMappingsDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsDeleteFuture.Result. +func (future *ReplicationProtectionContainerMappingsDeleteFuture) result(client ReplicationProtectionContainerMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainerMappingsPurgeFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsPurgeFuture.Result. +func (future *ReplicationProtectionContainerMappingsPurgeFuture) result(client ReplicationProtectionContainerMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainerMappingsUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (ProtectionContainerMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsUpdateFuture.Result. +func (future *ReplicationProtectionContainerMappingsUpdateFuture) result(client ReplicationProtectionContainerMappingsClient) (pcm ProtectionContainerMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pcm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pcm.Response.Response, err = future.GetResult(sender); err == nil && pcm.Response.Response.StatusCode != http.StatusNoContent { + pcm, err = client.UpdateResponder(pcm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsUpdateFuture", "Result", pcm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersCreateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectionContainersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersCreateFuture.Result. +func (future *ReplicationProtectionContainersCreateFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.CreateResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersCreateFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersDeleteFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectionContainersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersDeleteFuture.Result. +func (future *ReplicationProtectionContainersDeleteFuture) result(client ReplicationProtectionContainersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainersDiscoverProtectableItemFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type ReplicationProtectionContainersDiscoverProtectableItemFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersDiscoverProtectableItemFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersDiscoverProtectableItemFuture.Result. +func (future *ReplicationProtectionContainersDiscoverProtectableItemFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.DiscoverProtectableItemResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersSwitchProtectionFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainersSwitchProtectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersSwitchProtectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersSwitchProtectionFuture.Result. +func (future *ReplicationProtectionContainersSwitchProtectionFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersSwitchProtectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersSwitchProtectionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.SwitchProtectionResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersSwitchProtectionFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionIntent replication protection intent. +type ReplicationProtectionIntent struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ReplicationProtectionIntentProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntent. +func (rpi ReplicationProtectionIntent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpi.Properties != nil { + objectMap["properties"] = rpi.Properties + } + if rpi.Location != nil { + objectMap["location"] = rpi.Location + } + return json.Marshal(objectMap) +} + +// ReplicationProtectionIntentCollection replication protection intent objects collection. +type ReplicationProtectionIntentCollection struct { + autorest.Response `json:"-"` + // Value - The Replication protection intent details. + Value *[]ReplicationProtectionIntent `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ReplicationProtectionIntentCollectionIterator provides access to a complete listing of +// ReplicationProtectionIntent values. +type ReplicationProtectionIntentCollectionIterator struct { + i int + page ReplicationProtectionIntentCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ReplicationProtectionIntentCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ReplicationProtectionIntentCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ReplicationProtectionIntentCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ReplicationProtectionIntentCollectionIterator) Response() ReplicationProtectionIntentCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ReplicationProtectionIntentCollectionIterator) Value() ReplicationProtectionIntent { + if !iter.page.NotDone() { + return ReplicationProtectionIntent{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ReplicationProtectionIntentCollectionIterator type. +func NewReplicationProtectionIntentCollectionIterator(page ReplicationProtectionIntentCollectionPage) ReplicationProtectionIntentCollectionIterator { + return ReplicationProtectionIntentCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rpic ReplicationProtectionIntentCollection) IsEmpty() bool { + return rpic.Value == nil || len(*rpic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rpic ReplicationProtectionIntentCollection) hasNextLink() bool { + return rpic.NextLink != nil && len(*rpic.NextLink) != 0 +} + +// replicationProtectionIntentCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rpic ReplicationProtectionIntentCollection) replicationProtectionIntentCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rpic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rpic.NextLink))) +} + +// ReplicationProtectionIntentCollectionPage contains a page of ReplicationProtectionIntent values. +type ReplicationProtectionIntentCollectionPage struct { + fn func(context.Context, ReplicationProtectionIntentCollection) (ReplicationProtectionIntentCollection, error) + rpic ReplicationProtectionIntentCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ReplicationProtectionIntentCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rpic) + if err != nil { + return err + } + page.rpic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ReplicationProtectionIntentCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ReplicationProtectionIntentCollectionPage) NotDone() bool { + return !page.rpic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ReplicationProtectionIntentCollectionPage) Response() ReplicationProtectionIntentCollection { + return page.rpic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ReplicationProtectionIntentCollectionPage) Values() []ReplicationProtectionIntent { + if page.rpic.IsEmpty() { + return nil + } + return *page.rpic.Value +} + +// Creates a new instance of the ReplicationProtectionIntentCollectionPage type. +func NewReplicationProtectionIntentCollectionPage(cur ReplicationProtectionIntentCollection, getNextPage func(context.Context, ReplicationProtectionIntentCollection) (ReplicationProtectionIntentCollection, error)) ReplicationProtectionIntentCollectionPage { + return ReplicationProtectionIntentCollectionPage{ + fn: getNextPage, + rpic: cur, + } +} + +// ReplicationProtectionIntentProperties replication protection intent custom data details. +type ReplicationProtectionIntentProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // JobID - READ-ONLY; The job Id. + JobID *string `json:"jobId,omitempty"` + // JobState - READ-ONLY; The job state. + JobState *string `json:"jobState,omitempty"` + // IsActive - READ-ONLY; A value indicating whether the intent object is active. + IsActive *bool `json:"isActive,omitempty"` + // CreationTimeUTC - READ-ONLY; The creation time in UTC. + CreationTimeUTC *string `json:"creationTimeUTC,omitempty"` + // ProviderSpecificDetails - The Replication provider custom settings. + ProviderSpecificDetails BasicReplicationProtectionIntentProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntentProperties. +func (rpip ReplicationProtectionIntentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpip.FriendlyName != nil { + objectMap["friendlyName"] = rpip.FriendlyName + } + objectMap["providerSpecificDetails"] = rpip.ProviderSpecificDetails + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ReplicationProtectionIntentProperties struct. +func (rpip *ReplicationProtectionIntentProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpip.FriendlyName = &friendlyName + } + case "jobId": + if v != nil { + var jobID string + err = json.Unmarshal(*v, &jobID) + if err != nil { + return err + } + rpip.JobID = &jobID + } + case "jobState": + if v != nil { + var jobState string + err = json.Unmarshal(*v, &jobState) + if err != nil { + return err + } + rpip.JobState = &jobState + } + case "isActive": + if v != nil { + var isActive bool + err = json.Unmarshal(*v, &isActive) + if err != nil { + return err + } + rpip.IsActive = &isActive + } + case "creationTimeUTC": + if v != nil { + var creationTimeUTC string + err = json.Unmarshal(*v, &creationTimeUTC) + if err != nil { + return err + } + rpip.CreationTimeUTC = &creationTimeUTC + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(*v) + if err != nil { + return err + } + rpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicReplicationProtectionIntentProviderSpecificSettings replication provider specific settings. +type BasicReplicationProtectionIntentProviderSpecificSettings interface { + AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) + AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) +} + +// ReplicationProtectionIntentProviderSpecificSettings replication provider specific settings. +type ReplicationProtectionIntentProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings', 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A' + InstanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(body []byte) (BasicReplicationProtectionIntentProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A): + var arid A2AReplicationIntentDetails + err := json.Unmarshal(body, &arid) + return arid, err + default: + var rpipss ReplicationProtectionIntentProviderSpecificSettings + err := json.Unmarshal(body, &rpipss) + return rpipss, err + } +} +func unmarshalBasicReplicationProtectionIntentProviderSpecificSettingsArray(body []byte) ([]BasicReplicationProtectionIntentProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpipssArray := make([]BasicReplicationProtectionIntentProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpipss, err := unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + rpipssArray[index] = rpipss + } + return rpipssArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) MarshalJSON() ([]byte, error) { + rpipss.InstanceType = InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings + objectMap := make(map[string]interface{}) + if rpipss.InstanceType != "" { + objectMap["instanceType"] = rpipss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReplicationIntentDetails is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) { + return nil, false +} + +// AsReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) { + return &rpipss, true +} + +// AsBasicReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsBasicReplicationProtectionIntentProviderSpecificSettings() (BasicReplicationProtectionIntentProviderSpecificSettings, bool) { + return &rpipss, true +} + +// ReplicationProviderContainerUnmappingInput provider specific input for unpairing operations. +type ReplicationProviderContainerUnmappingInput struct { + // InstanceType - The class type. + InstanceType *string `json:"instanceType,omitempty"` +} + +// BasicReplicationProviderSpecificContainerCreationInput provider specific input for container creation operation. +type BasicReplicationProviderSpecificContainerCreationInput interface { + AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) + AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) + AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) + AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) +} + +// ReplicationProviderSpecificContainerCreationInput provider specific input for container creation operation. +type ReplicationProviderSpecificContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificContainerCreationInput(body []byte) (BasicReplicationProviderSpecificContainerCreationInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A): + var acci A2AContainerCreationInput + err := json.Unmarshal(body, &acci) + return acci, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration): + var accmcci A2ACrossClusterMigrationContainerCreationInput + err := json.Unmarshal(body, &accmcci) + return accmcci, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt): + var vmccci VMwareCbtContainerCreationInput + err := json.Unmarshal(body, &vmccci) + return vmccci, err + default: + var rpscci ReplicationProviderSpecificContainerCreationInput + err := json.Unmarshal(body, &rpscci) + return rpscci, err + } +} +func unmarshalBasicReplicationProviderSpecificContainerCreationInputArray(body []byte) ([]BasicReplicationProviderSpecificContainerCreationInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpscciArray := make([]BasicReplicationProviderSpecificContainerCreationInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpscci, err := unmarshalBasicReplicationProviderSpecificContainerCreationInput(*rawMessage) + if err != nil { + return nil, err + } + rpscciArray[index] = rpscci + } + return rpscciArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) MarshalJSON() ([]byte, error) { + rpscci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput + objectMap := make(map[string]interface{}) + if rpscci.InstanceType != "" { + objectMap["instanceType"] = rpscci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return &rpscci, true +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &rpscci, true +} + +// BasicReplicationProviderSpecificContainerMappingInput provider specific input for pairing operations. +type BasicReplicationProviderSpecificContainerMappingInput interface { + AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) + AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) + AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) +} + +// ReplicationProviderSpecificContainerMappingInput provider specific input for pairing operations. +type ReplicationProviderSpecificContainerMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificContainerMappingInput(body []byte) (BasicReplicationProviderSpecificContainerMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A): + var acmi A2AContainerMappingInput + err := json.Unmarshal(body, &acmi) + return acmi, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt): + var vmccmi VMwareCbtContainerMappingInput + err := json.Unmarshal(body, &vmccmi) + return vmccmi, err + default: + var rpscmi ReplicationProviderSpecificContainerMappingInput + err := json.Unmarshal(body, &rpscmi) + return rpscmi, err + } +} +func unmarshalBasicReplicationProviderSpecificContainerMappingInputArray(body []byte) ([]BasicReplicationProviderSpecificContainerMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpscmiArray := make([]BasicReplicationProviderSpecificContainerMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpscmi, err := unmarshalBasicReplicationProviderSpecificContainerMappingInput(*rawMessage) + if err != nil { + return nil, err + } + rpscmiArray[index] = rpscmi + } + return rpscmiArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) MarshalJSON() ([]byte, error) { + rpscmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput + objectMap := make(map[string]interface{}) + if rpscmi.InstanceType != "" { + objectMap["instanceType"] = rpscmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return &rpscmi, true +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &rpscmi, true +} + +// BasicReplicationProviderSpecificSettings replication provider specific settings. +type BasicReplicationProviderSpecificSettings interface { + AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) + AsA2AReplicationDetails() (*A2AReplicationDetails, bool) + AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) + AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) + AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) + AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) + AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) + AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) + AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) + AsInMageReplicationDetails() (*InMageReplicationDetails, bool) + AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) +} + +// ReplicationProviderSpecificSettings replication provider specific settings. +type ReplicationProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificSettings(body []byte) (BasicReplicationProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration): + var accmrd A2ACrossClusterMigrationReplicationDetails + err := json.Unmarshal(body, &accmrd) + return accmrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A): + var ard A2AReplicationDetails + err := json.Unmarshal(body, &ard) + return ard, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure): + var hvrard HyperVReplicaAzureReplicationDetails + err := json.Unmarshal(body, &hvrard) + return hvrard, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails): + var hvrbrd HyperVReplicaBaseReplicationDetails + err := json.Unmarshal(body, &hvrbrd) + return hvrbrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2): + var hvrbrd HyperVReplicaBlueReplicationDetails + err := json.Unmarshal(body, &hvrbrd) + return hvrbrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012): + var hvrrd HyperVReplicaReplicationDetails + err := json.Unmarshal(body, &hvrrd) + return hvrrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2): + var imavrd InMageAzureV2ReplicationDetails + err := json.Unmarshal(body, &imavrd) + return imavrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback): + var imrfrd InMageRcmFailbackReplicationDetails + err := json.Unmarshal(body, &imrfrd) + return imrfrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm): + var imrrd InMageRcmReplicationDetails + err := json.Unmarshal(body, &imrrd) + return imrrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage): + var imrd InMageReplicationDetails + err := json.Unmarshal(body, &imrd) + return imrd, err + default: + var rpss ReplicationProviderSpecificSettings + err := json.Unmarshal(body, &rpss) + return rpss, err + } +} +func unmarshalBasicReplicationProviderSpecificSettingsArray(body []byte) ([]BasicReplicationProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpssArray := make([]BasicReplicationProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpss, err := unmarshalBasicReplicationProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + rpssArray[index] = rpss + } + return rpssArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) MarshalJSON() ([]byte, error) { + rpss.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings + objectMap := make(map[string]interface{}) + if rpss.InstanceType != "" { + objectMap["instanceType"] = rpss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return &rpss, true +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &rpss, true +} + +// BasicReplicationProviderSpecificUpdateContainerMappingInput provider specific input for update pairing operations. +type BasicReplicationProviderSpecificUpdateContainerMappingInput interface { + AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) + AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) + AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) +} + +// ReplicationProviderSpecificUpdateContainerMappingInput provider specific input for update pairing +// operations. +type ReplicationProviderSpecificUpdateContainerMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(body []byte) (BasicReplicationProviderSpecificUpdateContainerMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A): + var aucmi A2AUpdateContainerMappingInput + err := json.Unmarshal(body, &aucmi) + return aucmi, err + case string(InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm): + var imrucmi InMageRcmUpdateContainerMappingInput + err := json.Unmarshal(body, &imrucmi) + return imrucmi, err + default: + var rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput + err := json.Unmarshal(body, &rpsucmi) + return rpsucmi, err + } +} +func unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInputArray(body []byte) ([]BasicReplicationProviderSpecificUpdateContainerMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpsucmiArray := make([]BasicReplicationProviderSpecificUpdateContainerMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpsucmi, err := unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(*rawMessage) + if err != nil { + return nil, err + } + rpsucmiArray[index] = rpsucmi + } + return rpsucmiArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + rpsucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput + objectMap := make(map[string]interface{}) + if rpsucmi.InstanceType != "" { + objectMap["instanceType"] = rpsucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &rpsucmi, true +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &rpsucmi, true +} + +// ReplicationRecoveryPlansCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansCreateFuture.Result. +func (future *ReplicationRecoveryPlansCreateFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.CreateResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansCreateFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansDeleteFuture.Result. +func (future *ReplicationRecoveryPlansDeleteFuture) result(client ReplicationRecoveryPlansClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryPlansFailoverCancelFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationRecoveryPlansFailoverCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansFailoverCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansFailoverCancelFuture.Result. +func (future *ReplicationRecoveryPlansFailoverCancelFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansFailoverCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.FailoverCancelResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCancelFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansFailoverCommitFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationRecoveryPlansFailoverCommitFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansFailoverCommitFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansFailoverCommitFuture.Result. +func (future *ReplicationRecoveryPlansFailoverCommitFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCommitFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansFailoverCommitFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.FailoverCommitResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCommitFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansPlannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryPlansPlannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansPlannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansPlannedFailoverFuture.Result. +func (future *ReplicationRecoveryPlansPlannedFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.PlannedFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansReprotectFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansReprotectFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansReprotectFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansReprotectFuture.Result. +func (future *ReplicationRecoveryPlansReprotectFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansReprotectFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansReprotectFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.ReprotectResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansReprotectFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansTestFailoverCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryPlansTestFailoverCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansTestFailoverCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansTestFailoverCleanupFuture.Result. +func (future *ReplicationRecoveryPlansTestFailoverCleanupFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.TestFailoverCleanupResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansTestFailoverFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansTestFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansTestFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansTestFailoverFuture.Result. +func (future *ReplicationRecoveryPlansTestFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansTestFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.TestFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansUnplannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryPlansUnplannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansUnplannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansUnplannedFailoverFuture.Result. +func (future *ReplicationRecoveryPlansUnplannedFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.UnplannedFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansUpdateFuture.Result. +func (future *ReplicationRecoveryPlansUpdateFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.UpdateResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUpdateFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryServicesProvidersCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryServicesProvidersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (RecoveryServicesProvider, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersCreateFuture.Result. +func (future *ReplicationRecoveryServicesProvidersCreateFuture) result(client ReplicationRecoveryServicesProvidersClient) (rsp RecoveryServicesProvider, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rsp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rsp.Response.Response, err = future.GetResult(sender); err == nil && rsp.Response.Response.StatusCode != http.StatusNoContent { + rsp, err = client.CreateResponder(rsp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersCreateFuture", "Result", rsp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryServicesProvidersDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryServicesProvidersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersDeleteFuture.Result. +func (future *ReplicationRecoveryServicesProvidersDeleteFuture) result(client ReplicationRecoveryServicesProvidersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryServicesProvidersPurgeFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryServicesProvidersPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersPurgeFuture.Result. +func (future *ReplicationRecoveryServicesProvidersPurgeFuture) result(client ReplicationRecoveryServicesProvidersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryServicesProvidersRefreshProviderFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type ReplicationRecoveryServicesProvidersRefreshProviderFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (RecoveryServicesProvider, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersRefreshProviderFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersRefreshProviderFuture.Result. +func (future *ReplicationRecoveryServicesProvidersRefreshProviderFuture) result(client ReplicationRecoveryServicesProvidersClient) (rsp RecoveryServicesProvider, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rsp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rsp.Response.Response, err = future.GetResult(sender); err == nil && rsp.Response.Response.StatusCode != http.StatusNoContent { + rsp, err = client.RefreshProviderResponder(rsp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture", "Result", rsp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationStorageClassificationMappingsCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationStorageClassificationMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationStorageClassificationMappingsClient) (StorageClassificationMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationStorageClassificationMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationStorageClassificationMappingsCreateFuture.Result. +func (future *ReplicationStorageClassificationMappingsCreateFuture) result(client ReplicationStorageClassificationMappingsClient) (scm StorageClassificationMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + scm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationStorageClassificationMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if scm.Response.Response, err = future.GetResult(sender); err == nil && scm.Response.Response.StatusCode != http.StatusNoContent { + scm, err = client.CreateResponder(scm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsCreateFuture", "Result", scm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationStorageClassificationMappingsDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationStorageClassificationMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationStorageClassificationMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationStorageClassificationMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationStorageClassificationMappingsDeleteFuture.Result. +func (future *ReplicationStorageClassificationMappingsDeleteFuture) result(client ReplicationStorageClassificationMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationStorageClassificationMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationVaultHealthRefreshFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationVaultHealthRefreshFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationVaultHealthClient) (VaultHealthDetails, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationVaultHealthRefreshFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationVaultHealthRefreshFuture.Result. +func (future *ReplicationVaultHealthRefreshFuture) result(client ReplicationVaultHealthClient) (vhd VaultHealthDetails, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthRefreshFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vhd.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationVaultHealthRefreshFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vhd.Response.Response, err = future.GetResult(sender); err == nil && vhd.Response.Response.StatusCode != http.StatusNoContent { + vhd, err = client.RefreshResponder(vhd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthRefreshFuture", "Result", vhd.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationVaultSettingCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationVaultSettingCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationVaultSettingClient) (VaultSetting, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationVaultSettingCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationVaultSettingCreateFuture.Result. +func (future *ReplicationVaultSettingCreateFuture) result(client ReplicationVaultSettingClient) (vs VaultSetting, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vs.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationVaultSettingCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vs.Response.Response, err = future.GetResult(sender); err == nil && vs.Response.Response.StatusCode != http.StatusNoContent { + vs, err = client.CreateResponder(vs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingCreateFuture", "Result", vs.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationvCentersCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (VCenter, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersCreateFuture.Result. +func (future *ReplicationvCentersCreateFuture) result(client ReplicationvCentersClient) (vc VCenter, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent { + vc, err = client.CreateResponder(vc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersCreateFuture", "Result", vc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationvCentersDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersDeleteFuture.Result. +func (future *ReplicationvCentersDeleteFuture) result(client ReplicationvCentersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationvCentersUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (VCenter, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersUpdateFuture.Result. +func (future *ReplicationvCentersUpdateFuture) result(client ReplicationvCentersClient) (vc VCenter, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent { + vc, err = client.UpdateResponder(vc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersUpdateFuture", "Result", vc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReprotectAgentDetails reprotect agent details. +type ReprotectAgentDetails struct { + // ID - READ-ONLY; The reprotect agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The reprotect agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The reprotect agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The reprotect agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the reprotect agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the reprotect agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // ProtectedItemCount - READ-ONLY; The protected item count. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // AccessibleDatastores - READ-ONLY; The list of accessible datastores fetched from discovery. + AccessibleDatastores *[]string `json:"accessibleDatastores,omitempty"` + // VcenterID - READ-ONLY; The Vcenter Id. + VcenterID *string `json:"vcenterId,omitempty"` + // LastDiscoveryInUtc - READ-ONLY; The last time when SDS information discovered in SRS. + LastDiscoveryInUtc *date.Time `json:"lastDiscoveryInUtc,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReprotectAgentDetails. +func (rad ReprotectAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResolveHealthError resolve health errors input properties. +type ResolveHealthError struct { + // HealthErrorID - Health error id. + HealthErrorID *string `json:"healthErrorId,omitempty"` +} + +// ResolveHealthInput resolve health input. +type ResolveHealthInput struct { + // Properties - Disable resolve health input properties. + Properties *ResolveHealthInputProperties `json:"properties,omitempty"` +} + +// ResolveHealthInputProperties resolve health input properties. +type ResolveHealthInputProperties struct { + // HealthErrors - Health errors. + HealthErrors *[]ResolveHealthError `json:"healthErrors,omitempty"` +} + +// Resource azure resource. +type Resource struct { + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location + } + return json.Marshal(objectMap) +} + +// ResourceHealthSummary base class to define the health summary of the resources contained under an Arm +// resource. +type ResourceHealthSummary struct { + // ResourceCount - The count of total resources under the container. + ResourceCount *int32 `json:"resourceCount,omitempty"` + // Issues - The list of summary of health errors across the resources under the container. + Issues *[]HealthErrorSummary `json:"issues,omitempty"` + // CategorizedResourceCounts - The categorized resource counts. + CategorizedResourceCounts map[string]*int32 `json:"categorizedResourceCounts"` +} + +// MarshalJSON is the custom marshaler for ResourceHealthSummary. +func (RHS ResourceHealthSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if RHS.ResourceCount != nil { + objectMap["resourceCount"] = RHS.ResourceCount + } + if RHS.Issues != nil { + objectMap["issues"] = RHS.Issues + } + if RHS.CategorizedResourceCounts != nil { + objectMap["categorizedResourceCounts"] = RHS.CategorizedResourceCounts + } + return json.Marshal(objectMap) +} + +// ResumeJobParams resume job params. +type ResumeJobParams struct { + // Properties - Resume job properties. + Properties *ResumeJobParamsProperties `json:"properties,omitempty"` +} + +// ResumeJobParamsProperties resume job properties. +type ResumeJobParamsProperties struct { + // Comments - Resume job comments. + Comments *string `json:"comments,omitempty"` +} + +// ResyncInput resync input. +type ResyncInput struct { + // Properties - Resync input properties. + Properties *ResyncInputProperties `json:"properties,omitempty"` +} + +// ResyncInputProperties resync input properties. +type ResyncInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicResyncProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ResyncInputProperties struct. +func (rip *ResyncInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicResyncProviderSpecificInput(*v) + if err != nil { + return err + } + rip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicResyncProviderSpecificInput resync provider specific input. +type BasicResyncProviderSpecificInput interface { + AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) + AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) +} + +// ResyncProviderSpecificInput resync provider specific input. +type ResyncProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput', 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicResyncProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicResyncProviderSpecificInput(body []byte) (BasicResyncProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt): + var vmcri VMwareCbtResyncInput + err := json.Unmarshal(body, &vmcri) + return vmcri, err + default: + var rpsi ResyncProviderSpecificInput + err := json.Unmarshal(body, &rpsi) + return rpsi, err + } +} +func unmarshalBasicResyncProviderSpecificInputArray(body []byte) ([]BasicResyncProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpsiArray := make([]BasicResyncProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpsi, err := unmarshalBasicResyncProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rpsiArray[index] = rpsi + } + return rpsiArray, nil +} + +// MarshalJSON is the custom marshaler for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) MarshalJSON() ([]byte, error) { + rpsi.InstanceType = InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput + objectMap := make(map[string]interface{}) + if rpsi.InstanceType != "" { + objectMap["instanceType"] = rpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtResyncInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) { + return nil, false +} + +// AsResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) { + return &rpsi, true +} + +// AsBasicResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsBasicResyncProviderSpecificInput() (BasicResyncProviderSpecificInput, bool) { + return &rpsi, true +} + +// RetentionVolume the retention details of the MT. +type RetentionVolume struct { + // VolumeName - The volume name. + VolumeName *string `json:"volumeName,omitempty"` + // CapacityInBytes - The volume capacity. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // FreeSpaceInBytes - The free space available in this volume. + FreeSpaceInBytes *int64 `json:"freeSpaceInBytes,omitempty"` + // ThresholdPercentage - The threshold percentage. + ThresholdPercentage *int32 `json:"thresholdPercentage,omitempty"` +} + +// ReverseReplicationInput reverse replication input. +type ReverseReplicationInput struct { + // Properties - Reverse replication properties. + Properties *ReverseReplicationInputProperties `json:"properties,omitempty"` +} + +// ReverseReplicationInputProperties reverse replication input properties. +type ReverseReplicationInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - Provider specific reverse replication input. + ProviderSpecificDetails BasicReverseReplicationProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ReverseReplicationInputProperties struct. +func (rrip *ReverseReplicationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rrip.FailoverDirection = &failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReverseReplicationProviderSpecificInput(*v) + if err != nil { + return err + } + rrip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicReverseReplicationProviderSpecificInput provider specific reverse replication input. +type BasicReverseReplicationProviderSpecificInput interface { + AsA2AReprotectInput() (*A2AReprotectInput, bool) + AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) + AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) + AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) + AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) + AsInMageReprotectInput() (*InMageReprotectInput, bool) + AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) +} + +// ReverseReplicationProviderSpecificInput provider specific reverse replication input. +type ReverseReplicationProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReverseReplicationProviderSpecificInput(body []byte) (BasicReverseReplicationProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A): + var ari A2AReprotectInput + err := json.Unmarshal(body, &ari) + return ari, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvrari HyperVReplicaAzureReprotectInput + err := json.Unmarshal(body, &hvrari) + return hvrari, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2): + var imavri InMageAzureV2ReprotectInput + err := json.Unmarshal(body, &imavri) + return imavri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback): + var imrfri InMageRcmFailbackReprotectInput + err := json.Unmarshal(body, &imrfri) + return imrfri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm): + var imrri InMageRcmReprotectInput + err := json.Unmarshal(body, &imrri) + return imrri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage): + var imri InMageReprotectInput + err := json.Unmarshal(body, &imri) + return imri, err + default: + var rrpsi ReverseReplicationProviderSpecificInput + err := json.Unmarshal(body, &rrpsi) + return rrpsi, err + } +} +func unmarshalBasicReverseReplicationProviderSpecificInputArray(body []byte) ([]BasicReverseReplicationProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rrpsiArray := make([]BasicReverseReplicationProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rrpsi, err := unmarshalBasicReverseReplicationProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rrpsiArray[index] = rrpsi + } + return rrpsiArray, nil +} + +// MarshalJSON is the custom marshaler for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) MarshalJSON() ([]byte, error) { + rrpsi.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput + objectMap := make(map[string]interface{}) + if rrpsi.InstanceType != "" { + objectMap["instanceType"] = rrpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return &rrpsi, true +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &rrpsi, true +} + +// RoleAssignment azure role assignment details. +type RoleAssignment struct { + // ID - The ARM Id of the role assignment. + ID *string `json:"id,omitempty"` + // Name - The name of the role assignment. + Name *string `json:"name,omitempty"` + // Scope - Role assignment scope. + Scope *string `json:"scope,omitempty"` + // PrincipalID - Principal Id. + PrincipalID *string `json:"principalId,omitempty"` + // RoleDefinitionID - Role definition id. + RoleDefinitionID *string `json:"roleDefinitionId,omitempty"` +} + +// RunAsAccount CS Accounts Details. +type RunAsAccount struct { + // AccountID - The CS RunAs account Id. + AccountID *string `json:"accountId,omitempty"` + // AccountName - The CS RunAs account name. + AccountName *string `json:"accountName,omitempty"` +} + +// ScriptActionTaskDetails this class represents the script action task details. +type ScriptActionTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // Path - The path. + Path *string `json:"path,omitempty"` + // Output - The output. + Output *string `json:"output,omitempty"` + // IsPrimarySideScript - A value indicating whether it is a primary side script or not. + IsPrimarySideScript *bool `json:"isPrimarySideScript,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) MarshalJSON() ([]byte, error) { + satd.InstanceType = InstanceTypeScriptActionTaskDetails + objectMap := make(map[string]interface{}) + if satd.Name != nil { + objectMap["name"] = satd.Name + } + if satd.Path != nil { + objectMap["path"] = satd.Path + } + if satd.Output != nil { + objectMap["output"] = satd.Output + } + if satd.IsPrimarySideScript != nil { + objectMap["isPrimarySideScript"] = satd.IsPrimarySideScript + } + if satd.InstanceType != "" { + objectMap["instanceType"] = satd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return &satd, true +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &satd, true +} + +// ServiceError ASR error model. +type ServiceError struct { + // Code - Error code. + Code *string `json:"code,omitempty"` + // Message - Error message. + Message *string `json:"message,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ActivityID - Activity Id. + ActivityID *string `json:"activityId,omitempty"` +} + +// BasicStorageAccountCustomDetails storage account custom input. +type BasicStorageAccountCustomDetails interface { + AsExistingStorageAccount() (*ExistingStorageAccount, bool) + AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) +} + +// StorageAccountCustomDetails storage account custom input. +type StorageAccountCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails', 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicStorageAccountCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicStorageAccountCustomDetails(body []byte) (BasicStorageAccountCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting): + var esa ExistingStorageAccount + err := json.Unmarshal(body, &esa) + return esa, err + default: + var sacd StorageAccountCustomDetails + err := json.Unmarshal(body, &sacd) + return sacd, err + } +} +func unmarshalBasicStorageAccountCustomDetailsArray(body []byte) ([]BasicStorageAccountCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sacdArray := make([]BasicStorageAccountCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sacd, err := unmarshalBasicStorageAccountCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + sacdArray[index] = sacd + } + return sacdArray, nil +} + +// MarshalJSON is the custom marshaler for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) MarshalJSON() ([]byte, error) { + sacd.ResourceType = ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails + objectMap := make(map[string]interface{}) + if sacd.ResourceType != "" { + objectMap["resourceType"] = sacd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingStorageAccount is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsExistingStorageAccount() (*ExistingStorageAccount, bool) { + return nil, false +} + +// AsStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) { + return &sacd, true +} + +// AsBasicStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsBasicStorageAccountCustomDetails() (BasicStorageAccountCustomDetails, bool) { + return &sacd, true +} + +// StorageClassification storage object definition. +type StorageClassification struct { + autorest.Response `json:"-"` + // Properties - Properties of the storage object. + Properties *StorageClassificationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageClassification. +func (sc StorageClassification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sc.Properties != nil { + objectMap["properties"] = sc.Properties + } + if sc.Location != nil { + objectMap["location"] = sc.Location + } + return json.Marshal(objectMap) +} + +// StorageClassificationCollection collection of storage details. +type StorageClassificationCollection struct { + autorest.Response `json:"-"` + // Value - The storage details. + Value *[]StorageClassification `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// StorageClassificationCollectionIterator provides access to a complete listing of StorageClassification +// values. +type StorageClassificationCollectionIterator struct { + i int + page StorageClassificationCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StorageClassificationCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StorageClassificationCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StorageClassificationCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StorageClassificationCollectionIterator) Response() StorageClassificationCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StorageClassificationCollectionIterator) Value() StorageClassification { + if !iter.page.NotDone() { + return StorageClassification{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StorageClassificationCollectionIterator type. +func NewStorageClassificationCollectionIterator(page StorageClassificationCollectionPage) StorageClassificationCollectionIterator { + return StorageClassificationCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scc StorageClassificationCollection) IsEmpty() bool { + return scc.Value == nil || len(*scc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scc StorageClassificationCollection) hasNextLink() bool { + return scc.NextLink != nil && len(*scc.NextLink) != 0 +} + +// storageClassificationCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scc StorageClassificationCollection) storageClassificationCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !scc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scc.NextLink))) +} + +// StorageClassificationCollectionPage contains a page of StorageClassification values. +type StorageClassificationCollectionPage struct { + fn func(context.Context, StorageClassificationCollection) (StorageClassificationCollection, error) + scc StorageClassificationCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StorageClassificationCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.scc) + if err != nil { + return err + } + page.scc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StorageClassificationCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StorageClassificationCollectionPage) NotDone() bool { + return !page.scc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StorageClassificationCollectionPage) Response() StorageClassificationCollection { + return page.scc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StorageClassificationCollectionPage) Values() []StorageClassification { + if page.scc.IsEmpty() { + return nil + } + return *page.scc.Value +} + +// Creates a new instance of the StorageClassificationCollectionPage type. +func NewStorageClassificationCollectionPage(cur StorageClassificationCollection, getNextPage func(context.Context, StorageClassificationCollection) (StorageClassificationCollection, error)) StorageClassificationCollectionPage { + return StorageClassificationCollectionPage{ + fn: getNextPage, + scc: cur, + } +} + +// StorageClassificationMapping storage mapping object. +type StorageClassificationMapping struct { + autorest.Response `json:"-"` + // Properties - Properties of the storage mapping object. + Properties *StorageClassificationMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageClassificationMapping. +func (scm StorageClassificationMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scm.Properties != nil { + objectMap["properties"] = scm.Properties + } + if scm.Location != nil { + objectMap["location"] = scm.Location + } + return json.Marshal(objectMap) +} + +// StorageClassificationMappingCollection collection of storage mapping details. +type StorageClassificationMappingCollection struct { + autorest.Response `json:"-"` + // Value - The storage details. + Value *[]StorageClassificationMapping `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// StorageClassificationMappingCollectionIterator provides access to a complete listing of +// StorageClassificationMapping values. +type StorageClassificationMappingCollectionIterator struct { + i int + page StorageClassificationMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StorageClassificationMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StorageClassificationMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StorageClassificationMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StorageClassificationMappingCollectionIterator) Response() StorageClassificationMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StorageClassificationMappingCollectionIterator) Value() StorageClassificationMapping { + if !iter.page.NotDone() { + return StorageClassificationMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StorageClassificationMappingCollectionIterator type. +func NewStorageClassificationMappingCollectionIterator(page StorageClassificationMappingCollectionPage) StorageClassificationMappingCollectionIterator { + return StorageClassificationMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scmc StorageClassificationMappingCollection) IsEmpty() bool { + return scmc.Value == nil || len(*scmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scmc StorageClassificationMappingCollection) hasNextLink() bool { + return scmc.NextLink != nil && len(*scmc.NextLink) != 0 +} + +// storageClassificationMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scmc StorageClassificationMappingCollection) storageClassificationMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !scmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scmc.NextLink))) +} + +// StorageClassificationMappingCollectionPage contains a page of StorageClassificationMapping values. +type StorageClassificationMappingCollectionPage struct { + fn func(context.Context, StorageClassificationMappingCollection) (StorageClassificationMappingCollection, error) + scmc StorageClassificationMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StorageClassificationMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.scmc) + if err != nil { + return err + } + page.scmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StorageClassificationMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StorageClassificationMappingCollectionPage) NotDone() bool { + return !page.scmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StorageClassificationMappingCollectionPage) Response() StorageClassificationMappingCollection { + return page.scmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StorageClassificationMappingCollectionPage) Values() []StorageClassificationMapping { + if page.scmc.IsEmpty() { + return nil + } + return *page.scmc.Value +} + +// Creates a new instance of the StorageClassificationMappingCollectionPage type. +func NewStorageClassificationMappingCollectionPage(cur StorageClassificationMappingCollection, getNextPage func(context.Context, StorageClassificationMappingCollection) (StorageClassificationMappingCollection, error)) StorageClassificationMappingCollectionPage { + return StorageClassificationMappingCollectionPage{ + fn: getNextPage, + scmc: cur, + } +} + +// StorageClassificationMappingInput storage mapping input. +type StorageClassificationMappingInput struct { + // Properties - Storage mapping input properties. + Properties *StorageMappingInputProperties `json:"properties,omitempty"` +} + +// StorageClassificationMappingProperties storage mapping properties. +type StorageClassificationMappingProperties struct { + // TargetStorageClassificationID - Target storage object Id. + TargetStorageClassificationID *string `json:"targetStorageClassificationId,omitempty"` +} + +// StorageClassificationProperties storage object properties. +type StorageClassificationProperties struct { + // FriendlyName - Friendly name of the Storage classification. + FriendlyName *string `json:"friendlyName,omitempty"` +} + +// StorageMappingInputProperties storage mapping input properties. +type StorageMappingInputProperties struct { + // TargetStorageClassificationID - The ID of the storage object. + TargetStorageClassificationID *string `json:"targetStorageClassificationId,omitempty"` +} + +// Subnet subnets of the network. +type Subnet struct { + // Name - The subnet name. + Name *string `json:"name,omitempty"` + // FriendlyName - The subnet friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // AddressList - The list of addresses for the subnet. + AddressList *[]string `json:"addressList,omitempty"` +} + +// SupportedOperatingSystems supported operating systems. +type SupportedOperatingSystems struct { + autorest.Response `json:"-"` + // Properties - The supported operating systems properties. + Properties *SupportedOSProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for SupportedOperatingSystems. +func (sos SupportedOperatingSystems) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sos.Properties != nil { + objectMap["properties"] = sos.Properties + } + if sos.Location != nil { + objectMap["location"] = sos.Location + } + return json.Marshal(objectMap) +} + +// SupportedOSDetails supported operating system details. +type SupportedOSDetails struct { + // OsName - The name. + OsName *string `json:"osName,omitempty"` + // OsType - The type. + OsType *string `json:"osType,omitempty"` + // OsVersions - The list of version for operating system. + OsVersions *[]OSVersionWrapper `json:"osVersions,omitempty"` +} + +// SupportedOSProperties supported operating systems properties. +type SupportedOSProperties struct { + // SupportedOsList - The supported operating systems property list. + SupportedOsList *[]SupportedOSProperty `json:"supportedOsList,omitempty"` +} + +// SupportedOSProperty supported operating systems property. +type SupportedOSProperty struct { + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` + // SupportedOs - The list of supported operating systems. + SupportedOs *[]SupportedOSDetails `json:"supportedOs,omitempty"` +} + +// SwitchProtectionInput switch protection input. +type SwitchProtectionInput struct { + // Properties - Switch protection properties. + Properties *SwitchProtectionInputProperties `json:"properties,omitempty"` +} + +// SwitchProtectionInputProperties switch protection input properties. +type SwitchProtectionInputProperties struct { + // ReplicationProtectedItemName - The unique replication protected item name. + ReplicationProtectedItemName *string `json:"replicationProtectedItemName,omitempty"` + // ProviderSpecificDetails - Provider specific switch protection input. + ProviderSpecificDetails BasicSwitchProtectionProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SwitchProtectionInputProperties struct. +func (spip *SwitchProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "replicationProtectedItemName": + if v != nil { + var replicationProtectedItemName string + err = json.Unmarshal(*v, &replicationProtectedItemName) + if err != nil { + return err + } + spip.ReplicationProtectedItemName = &replicationProtectedItemName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicSwitchProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + spip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// SwitchProtectionJobDetails this class represents details for switch protection job. +type SwitchProtectionJobDetails struct { + // NewReplicationProtectedItemID - ARM Id of the new replication protected item. + NewReplicationProtectedItemID *string `json:"newReplicationProtectedItemId,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) MarshalJSON() ([]byte, error) { + spjd.InstanceType = InstanceTypeSwitchProtectionJobDetails + objectMap := make(map[string]interface{}) + if spjd.NewReplicationProtectedItemID != nil { + objectMap["newReplicationProtectedItemId"] = spjd.NewReplicationProtectedItemID + } + if spjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = spjd.AffectedObjectDetails + } + if spjd.InstanceType != "" { + objectMap["instanceType"] = spjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return &spjd, true +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &spjd, true +} + +// BasicSwitchProtectionProviderSpecificInput provider specific switch protection input. +type BasicSwitchProtectionProviderSpecificInput interface { + AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) + AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) +} + +// SwitchProtectionProviderSpecificInput provider specific switch protection input. +type SwitchProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput', 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicSwitchProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicSwitchProtectionProviderSpecificInput(body []byte) (BasicSwitchProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A): + var aspi A2ASwitchProtectionInput + err := json.Unmarshal(body, &aspi) + return aspi, err + default: + var sppsi SwitchProtectionProviderSpecificInput + err := json.Unmarshal(body, &sppsi) + return sppsi, err + } +} +func unmarshalBasicSwitchProtectionProviderSpecificInputArray(body []byte) ([]BasicSwitchProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sppsiArray := make([]BasicSwitchProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sppsi, err := unmarshalBasicSwitchProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + sppsiArray[index] = sppsi + } + return sppsiArray, nil +} + +// MarshalJSON is the custom marshaler for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + sppsi.InstanceType = InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if sppsi.InstanceType != "" { + objectMap["instanceType"] = sppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ASwitchProtectionInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) { + return nil, false +} + +// AsSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) { + return &sppsi, true +} + +// AsBasicSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsBasicSwitchProtectionProviderSpecificInput() (BasicSwitchProtectionProviderSpecificInput, bool) { + return &sppsi, true +} + +// SwitchProviderInput input definition for switch provider. +type SwitchProviderInput struct { + // Properties - Switch provider input properties. + Properties *SwitchProviderInputProperties `json:"properties,omitempty"` +} + +// SwitchProviderInputProperties input definition for switch provider input properties. +type SwitchProviderInputProperties struct { + // TargetInstanceType - Target provider type. + TargetInstanceType *string `json:"targetInstanceType,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicSwitchProviderProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SwitchProviderInputProperties struct. +func (spip *SwitchProviderInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetInstanceType": + if v != nil { + var targetInstanceType string + err = json.Unmarshal(*v, &targetInstanceType) + if err != nil { + return err + } + spip.TargetInstanceType = &targetInstanceType + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicSwitchProviderProviderSpecificInput(*v) + if err != nil { + return err + } + spip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicSwitchProviderProviderSpecificInput provider specific switch provider input. +type BasicSwitchProviderProviderSpecificInput interface { + AsInMageAzureV2SwitchProviderProviderInput() (*InMageAzureV2SwitchProviderProviderInput, bool) + AsSwitchProviderProviderSpecificInput() (*SwitchProviderProviderSpecificInput, bool) +} + +// SwitchProviderProviderSpecificInput provider specific switch provider input. +type SwitchProviderProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeSwitchProviderProviderSpecificInput', 'InstanceTypeInMageAzureV2' + InstanceType InstanceTypeBasicSwitchProviderProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicSwitchProviderProviderSpecificInput(body []byte) (BasicSwitchProviderProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInMageAzureV2): + var imavsppi InMageAzureV2SwitchProviderProviderInput + err := json.Unmarshal(body, &imavsppi) + return imavsppi, err + default: + var sppsi SwitchProviderProviderSpecificInput + err := json.Unmarshal(body, &sppsi) + return sppsi, err + } +} +func unmarshalBasicSwitchProviderProviderSpecificInputArray(body []byte) ([]BasicSwitchProviderProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sppsiArray := make([]BasicSwitchProviderProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sppsi, err := unmarshalBasicSwitchProviderProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + sppsiArray[index] = sppsi + } + return sppsiArray, nil +} + +// MarshalJSON is the custom marshaler for SwitchProviderProviderSpecificInput. +func (sppsi SwitchProviderProviderSpecificInput) MarshalJSON() ([]byte, error) { + sppsi.InstanceType = InstanceTypeSwitchProviderProviderSpecificInput + objectMap := make(map[string]interface{}) + if sppsi.InstanceType != "" { + objectMap["instanceType"] = sppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageAzureV2SwitchProviderProviderInput is the BasicSwitchProviderProviderSpecificInput implementation for SwitchProviderProviderSpecificInput. +func (sppsi SwitchProviderProviderSpecificInput) AsInMageAzureV2SwitchProviderProviderInput() (*InMageAzureV2SwitchProviderProviderInput, bool) { + return nil, false +} + +// AsSwitchProviderProviderSpecificInput is the BasicSwitchProviderProviderSpecificInput implementation for SwitchProviderProviderSpecificInput. +func (sppsi SwitchProviderProviderSpecificInput) AsSwitchProviderProviderSpecificInput() (*SwitchProviderProviderSpecificInput, bool) { + return &sppsi, true +} + +// AsBasicSwitchProviderProviderSpecificInput is the BasicSwitchProviderProviderSpecificInput implementation for SwitchProviderProviderSpecificInput. +func (sppsi SwitchProviderProviderSpecificInput) AsBasicSwitchProviderProviderSpecificInput() (BasicSwitchProviderProviderSpecificInput, bool) { + return &sppsi, true +} + +// TargetComputeSize represents applicable recovery vm sizes. +type TargetComputeSize struct { + // ID - The Id. + ID *string `json:"id,omitempty"` + // Name - The name. + Name *string `json:"name,omitempty"` + // Type - The Type of the object. + Type *string `json:"type,omitempty"` + // Properties - The custom data. + Properties *TargetComputeSizeProperties `json:"properties,omitempty"` +} + +// TargetComputeSizeCollection target compute size collection. +type TargetComputeSizeCollection struct { + autorest.Response `json:"-"` + // Value - The list of target compute sizes. + Value *[]TargetComputeSize `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// TargetComputeSizeCollectionIterator provides access to a complete listing of TargetComputeSize values. +type TargetComputeSizeCollectionIterator struct { + i int + page TargetComputeSizeCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *TargetComputeSizeCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizeCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *TargetComputeSizeCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TargetComputeSizeCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter TargetComputeSizeCollectionIterator) Response() TargetComputeSizeCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter TargetComputeSizeCollectionIterator) Value() TargetComputeSize { + if !iter.page.NotDone() { + return TargetComputeSize{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the TargetComputeSizeCollectionIterator type. +func NewTargetComputeSizeCollectionIterator(page TargetComputeSizeCollectionPage) TargetComputeSizeCollectionIterator { + return TargetComputeSizeCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (tcsc TargetComputeSizeCollection) IsEmpty() bool { + return tcsc.Value == nil || len(*tcsc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (tcsc TargetComputeSizeCollection) hasNextLink() bool { + return tcsc.NextLink != nil && len(*tcsc.NextLink) != 0 +} + +// targetComputeSizeCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tcsc TargetComputeSizeCollection) targetComputeSizeCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !tcsc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(tcsc.NextLink))) +} + +// TargetComputeSizeCollectionPage contains a page of TargetComputeSize values. +type TargetComputeSizeCollectionPage struct { + fn func(context.Context, TargetComputeSizeCollection) (TargetComputeSizeCollection, error) + tcsc TargetComputeSizeCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *TargetComputeSizeCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizeCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.tcsc) + if err != nil { + return err + } + page.tcsc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *TargetComputeSizeCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TargetComputeSizeCollectionPage) NotDone() bool { + return !page.tcsc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TargetComputeSizeCollectionPage) Response() TargetComputeSizeCollection { + return page.tcsc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TargetComputeSizeCollectionPage) Values() []TargetComputeSize { + if page.tcsc.IsEmpty() { + return nil + } + return *page.tcsc.Value +} + +// Creates a new instance of the TargetComputeSizeCollectionPage type. +func NewTargetComputeSizeCollectionPage(cur TargetComputeSizeCollection, getNextPage func(context.Context, TargetComputeSizeCollection) (TargetComputeSizeCollection, error)) TargetComputeSizeCollectionPage { + return TargetComputeSizeCollectionPage{ + fn: getNextPage, + tcsc: cur, + } +} + +// TargetComputeSizeProperties represents applicable recovery vm sizes properties. +type TargetComputeSizeProperties struct { + // Name - Target compute size name. + Name *string `json:"name,omitempty"` + // FriendlyName - Target compute size display name. + FriendlyName *string `json:"friendlyName,omitempty"` + // CPUCoresCount - The maximum cpu cores count supported by target compute size. + CPUCoresCount *int32 `json:"cpuCoresCount,omitempty"` + // VCPUsAvailable - READ-ONLY; The Available vCPUs supported by target compute size. + VCPUsAvailable *int32 `json:"vCPUsAvailable,omitempty"` + // MemoryInGB - The maximum memory in GB supported by target compute size. + MemoryInGB *float64 `json:"memoryInGB,omitempty"` + // MaxDataDiskCount - The maximum data disks count supported by target compute size. + MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` + // MaxNicsCount - The maximum Nics count supported by target compute size. + MaxNicsCount *int32 `json:"maxNicsCount,omitempty"` + // Errors - The reasons why the target compute size is not applicable for the protected item. + Errors *[]ComputeSizeErrorDetails `json:"errors,omitempty"` + // HighIopsSupported - The value indicating whether the target compute size supports high Iops. + HighIopsSupported *string `json:"highIopsSupported,omitempty"` + // HyperVGenerations - The supported HyperV Generations. + HyperVGenerations *[]string `json:"hyperVGenerations,omitempty"` +} + +// MarshalJSON is the custom marshaler for TargetComputeSizeProperties. +func (tcsp TargetComputeSizeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tcsp.Name != nil { + objectMap["name"] = tcsp.Name + } + if tcsp.FriendlyName != nil { + objectMap["friendlyName"] = tcsp.FriendlyName + } + if tcsp.CPUCoresCount != nil { + objectMap["cpuCoresCount"] = tcsp.CPUCoresCount + } + if tcsp.MemoryInGB != nil { + objectMap["memoryInGB"] = tcsp.MemoryInGB + } + if tcsp.MaxDataDiskCount != nil { + objectMap["maxDataDiskCount"] = tcsp.MaxDataDiskCount + } + if tcsp.MaxNicsCount != nil { + objectMap["maxNicsCount"] = tcsp.MaxNicsCount + } + if tcsp.Errors != nil { + objectMap["errors"] = tcsp.Errors + } + if tcsp.HighIopsSupported != nil { + objectMap["highIopsSupported"] = tcsp.HighIopsSupported + } + if tcsp.HyperVGenerations != nil { + objectMap["hyperVGenerations"] = tcsp.HyperVGenerations + } + return json.Marshal(objectMap) +} + +// BasicTaskTypeDetails task details based on specific task type. +type BasicTaskTypeDetails interface { + AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) + AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) + AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) + AsJobTaskDetails() (*JobTaskDetails, bool) + AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) + AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) + AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) + AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) + AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) + AsTaskTypeDetails() (*TaskTypeDetails, bool) +} + +// TaskTypeDetails task details based on specific task type. +type TaskTypeDetails struct { + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicTaskTypeDetails(body []byte) (BasicTaskTypeDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAutomationRunbookTaskDetails): + var artd AutomationRunbookTaskDetails + err := json.Unmarshal(body, &artd) + return artd, err + case string(InstanceTypeConsistencyCheckTaskDetails): + var cctd ConsistencyCheckTaskDetails + err := json.Unmarshal(body, &cctd) + return cctd, err + case string(InstanceTypeFabricReplicationGroupTaskDetails): + var frgtd FabricReplicationGroupTaskDetails + err := json.Unmarshal(body, &frgtd) + return frgtd, err + case string(InstanceTypeJobTaskDetails): + var jtd JobTaskDetails + err := json.Unmarshal(body, &jtd) + return jtd, err + case string(InstanceTypeManualActionTaskDetails): + var matd ManualActionTaskDetails + err := json.Unmarshal(body, &matd) + return matd, err + case string(InstanceTypeScriptActionTaskDetails): + var satd ScriptActionTaskDetails + err := json.Unmarshal(body, &satd) + return satd, err + case string(InstanceTypeVirtualMachineTaskDetails): + var vmtd VirtualMachineTaskDetails + err := json.Unmarshal(body, &vmtd) + return vmtd, err + case string(InstanceTypeVMNicUpdatesTaskDetails): + var vnutd VMNicUpdatesTaskDetails + err := json.Unmarshal(body, &vnutd) + return vnutd, err + default: + var ttd TaskTypeDetails + err := json.Unmarshal(body, &ttd) + return ttd, err + } +} +func unmarshalBasicTaskTypeDetailsArray(body []byte) ([]BasicTaskTypeDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ttdArray := make([]BasicTaskTypeDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ttd, err := unmarshalBasicTaskTypeDetails(*rawMessage) + if err != nil { + return nil, err + } + ttdArray[index] = ttd + } + return ttdArray, nil +} + +// MarshalJSON is the custom marshaler for TaskTypeDetails. +func (ttd TaskTypeDetails) MarshalJSON() ([]byte, error) { + ttd.InstanceType = InstanceTypeTaskTypeDetails + objectMap := make(map[string]interface{}) + if ttd.InstanceType != "" { + objectMap["instanceType"] = ttd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return &ttd, true +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &ttd, true +} + +// TestFailoverCleanupInput input definition for test failover cleanup. +type TestFailoverCleanupInput struct { + // Properties - Test failover cleanup input properties. + Properties *TestFailoverCleanupInputProperties `json:"properties,omitempty"` +} + +// TestFailoverCleanupInputProperties input definition for test failover cleanup input properties. +type TestFailoverCleanupInputProperties struct { + // Comments - Test failover cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// TestFailoverInput input definition for test failover. +type TestFailoverInput struct { + // Properties - Test failover input properties. + Properties *TestFailoverInputProperties `json:"properties,omitempty"` +} + +// TestFailoverInputProperties input definition for test failover input properties. +type TestFailoverInputProperties struct { + // FailoverDirection - Test failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // NetworkType - Network type to be used for test failover. + NetworkType *string `json:"networkType,omitempty"` + // NetworkID - The id of the network to be used for test failover. + NetworkID *string `json:"networkId,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicTestFailoverProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TestFailoverInputProperties struct. +func (tfip *TestFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + tfip.FailoverDirection = &failoverDirection + } + case "networkType": + if v != nil { + var networkType string + err = json.Unmarshal(*v, &networkType) + if err != nil { + return err + } + tfip.NetworkType = &networkType + } + case "networkId": + if v != nil { + var networkID string + err = json.Unmarshal(*v, &networkID) + if err != nil { + return err + } + tfip.NetworkID = &networkID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicTestFailoverProviderSpecificInput(*v) + if err != nil { + return err + } + tfip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// TestFailoverJobDetails this class represents the details for a test failover job. +type TestFailoverJobDetails struct { + // TestFailoverStatus - The test failover status. + TestFailoverStatus *string `json:"testFailoverStatus,omitempty"` + // Comments - The test failover comments. + Comments *string `json:"comments,omitempty"` + // NetworkName - The test network name. + NetworkName *string `json:"networkName,omitempty"` + // NetworkFriendlyName - The test network friendly name. + NetworkFriendlyName *string `json:"networkFriendlyName,omitempty"` + // NetworkType - The test network type (see TestFailoverInput enum for possible values). + NetworkType *string `json:"networkType,omitempty"` + // ProtectedItemDetails - The test VM details. + ProtectedItemDetails *[]FailoverReplicationProtectedItemDetails `json:"protectedItemDetails,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) MarshalJSON() ([]byte, error) { + tfjd.InstanceType = InstanceTypeTestFailoverJobDetails + objectMap := make(map[string]interface{}) + if tfjd.TestFailoverStatus != nil { + objectMap["testFailoverStatus"] = tfjd.TestFailoverStatus + } + if tfjd.Comments != nil { + objectMap["comments"] = tfjd.Comments + } + if tfjd.NetworkName != nil { + objectMap["networkName"] = tfjd.NetworkName + } + if tfjd.NetworkFriendlyName != nil { + objectMap["networkFriendlyName"] = tfjd.NetworkFriendlyName + } + if tfjd.NetworkType != nil { + objectMap["networkType"] = tfjd.NetworkType + } + if tfjd.ProtectedItemDetails != nil { + objectMap["protectedItemDetails"] = tfjd.ProtectedItemDetails + } + if tfjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = tfjd.AffectedObjectDetails + } + if tfjd.InstanceType != "" { + objectMap["instanceType"] = tfjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return &tfjd, true +} + +// AsJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &tfjd, true +} + +// BasicTestFailoverProviderSpecificInput provider specific test failover input. +type BasicTestFailoverProviderSpecificInput interface { + AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) + AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) + AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) + AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) + AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) + AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) +} + +// TestFailoverProviderSpecificInput provider specific test failover input. +type TestFailoverProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicTestFailoverProviderSpecificInput(body []byte) (BasicTestFailoverProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A): + var atfi A2ATestFailoverInput + err := json.Unmarshal(body, &atfi) + return atfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvratfi HyperVReplicaAzureTestFailoverInput + err := json.Unmarshal(body, &hvratfi) + return hvratfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2): + var imavtfi InMageAzureV2TestFailoverInput + err := json.Unmarshal(body, &imavtfi) + return imavtfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm): + var imrtfi InMageRcmTestFailoverInput + err := json.Unmarshal(body, &imrtfi) + return imrtfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage): + var imtfi InMageTestFailoverInput + err := json.Unmarshal(body, &imtfi) + return imtfi, err + default: + var tfpsi TestFailoverProviderSpecificInput + err := json.Unmarshal(body, &tfpsi) + return tfpsi, err + } +} +func unmarshalBasicTestFailoverProviderSpecificInputArray(body []byte) ([]BasicTestFailoverProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tfpsiArray := make([]BasicTestFailoverProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + tfpsi, err := unmarshalBasicTestFailoverProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + tfpsiArray[index] = tfpsi + } + return tfpsiArray, nil +} + +// MarshalJSON is the custom marshaler for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) MarshalJSON() ([]byte, error) { + tfpsi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput + objectMap := make(map[string]interface{}) + if tfpsi.InstanceType != "" { + objectMap["instanceType"] = tfpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return &tfpsi, true +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &tfpsi, true +} + +// TestMigrateCleanupInput input for test migrate cleanup. +type TestMigrateCleanupInput struct { + // Properties - Test migrate cleanup input properties. + Properties *TestMigrateCleanupInputProperties `json:"properties,omitempty"` +} + +// TestMigrateCleanupInputProperties test migrate cleanup input properties. +type TestMigrateCleanupInputProperties struct { + // Comments - Test migrate cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// TestMigrateInput input for test migrate. +type TestMigrateInput struct { + // Properties - Test migrate input properties. + Properties *TestMigrateInputProperties `json:"properties,omitempty"` +} + +// TestMigrateInputProperties test migrate input properties. +type TestMigrateInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicTestMigrateProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TestMigrateInputProperties struct. +func (tmip *TestMigrateInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicTestMigrateProviderSpecificInput(*v) + if err != nil { + return err + } + tmip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicTestMigrateProviderSpecificInput test migrate provider specific input. +type BasicTestMigrateProviderSpecificInput interface { + AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) + AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) +} + +// TestMigrateProviderSpecificInput test migrate provider specific input. +type TestMigrateProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput', 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicTestMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicTestMigrateProviderSpecificInput(body []byte) (BasicTestMigrateProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt): + var vmctmi VMwareCbtTestMigrateInput + err := json.Unmarshal(body, &vmctmi) + return vmctmi, err + default: + var tmpsi TestMigrateProviderSpecificInput + err := json.Unmarshal(body, &tmpsi) + return tmpsi, err + } +} +func unmarshalBasicTestMigrateProviderSpecificInputArray(body []byte) ([]BasicTestMigrateProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tmpsiArray := make([]BasicTestMigrateProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + tmpsi, err := unmarshalBasicTestMigrateProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + tmpsiArray[index] = tmpsi + } + return tmpsiArray, nil +} + +// MarshalJSON is the custom marshaler for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) MarshalJSON() ([]byte, error) { + tmpsi.InstanceType = InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput + objectMap := make(map[string]interface{}) + if tmpsi.InstanceType != "" { + objectMap["instanceType"] = tmpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtTestMigrateInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) { + return nil, false +} + +// AsTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) { + return &tmpsi, true +} + +// AsBasicTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsBasicTestMigrateProviderSpecificInput() (BasicTestMigrateProviderSpecificInput, bool) { + return &tmpsi, true +} + +// UnplannedFailoverInput input definition for unplanned failover. +type UnplannedFailoverInput struct { + // Properties - Unplanned failover input properties. + Properties *UnplannedFailoverInputProperties `json:"properties,omitempty"` +} + +// UnplannedFailoverInputProperties input definition for unplanned failover input properties. +type UnplannedFailoverInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // SourceSiteOperations - Source site operations status. + SourceSiteOperations *string `json:"sourceSiteOperations,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicUnplannedFailoverProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UnplannedFailoverInputProperties struct. +func (ufip *UnplannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + ufip.FailoverDirection = &failoverDirection + } + case "sourceSiteOperations": + if v != nil { + var sourceSiteOperations string + err = json.Unmarshal(*v, &sourceSiteOperations) + if err != nil { + return err + } + ufip.SourceSiteOperations = &sourceSiteOperations + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUnplannedFailoverProviderSpecificInput(*v) + if err != nil { + return err + } + ufip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUnplannedFailoverProviderSpecificInput provider specific unplanned failover input. +type BasicUnplannedFailoverProviderSpecificInput interface { + AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) + AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) + AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) + AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) + AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) + AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) +} + +// UnplannedFailoverProviderSpecificInput provider specific unplanned failover input. +type UnplannedFailoverProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUnplannedFailoverProviderSpecificInput(body []byte) (BasicUnplannedFailoverProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A): + var aufi A2AUnplannedFailoverInput + err := json.Unmarshal(body, &aufi) + return aufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraufi HyperVReplicaAzureUnplannedFailoverInput + err := json.Unmarshal(body, &hvraufi) + return hvraufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2): + var imavufi InMageAzureV2UnplannedFailoverInput + err := json.Unmarshal(body, &imavufi) + return imavufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm): + var imrufi InMageRcmUnplannedFailoverInput + err := json.Unmarshal(body, &imrufi) + return imrufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage): + var imufi InMageUnplannedFailoverInput + err := json.Unmarshal(body, &imufi) + return imufi, err + default: + var ufpsi UnplannedFailoverProviderSpecificInput + err := json.Unmarshal(body, &ufpsi) + return ufpsi, err + } +} +func unmarshalBasicUnplannedFailoverProviderSpecificInputArray(body []byte) ([]BasicUnplannedFailoverProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ufpsiArray := make([]BasicUnplannedFailoverProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ufpsi, err := unmarshalBasicUnplannedFailoverProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + ufpsiArray[index] = ufpsi + } + return ufpsiArray, nil +} + +// MarshalJSON is the custom marshaler for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) MarshalJSON() ([]byte, error) { + ufpsi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput + objectMap := make(map[string]interface{}) + if ufpsi.InstanceType != "" { + objectMap["instanceType"] = ufpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return &ufpsi, true +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &ufpsi, true +} + +// UpdateApplianceForReplicationProtectedItemInput update appliance for replication protected item input. +type UpdateApplianceForReplicationProtectedItemInput struct { + // Properties - Update appliance replication protected item properties. + Properties *UpdateApplianceForReplicationProtectedItemInputProperties `json:"properties,omitempty"` +} + +// UpdateApplianceForReplicationProtectedItemInputProperties update appliance for protected item input +// properties. +type UpdateApplianceForReplicationProtectedItemInputProperties struct { + // TargetApplianceID - The target appliance Id. + TargetApplianceID *string `json:"targetApplianceId,omitempty"` + // ProviderSpecificDetails - The provider specific input to update replication protected item. + ProviderSpecificDetails BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateApplianceForReplicationProtectedItemInputProperties struct. +func (uafrpiip *UpdateApplianceForReplicationProtectedItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetApplianceId": + if v != nil { + var targetApplianceID string + err = json.Unmarshal(*v, &targetApplianceID) + if err != nil { + return err + } + uafrpiip.TargetApplianceID = &targetApplianceID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput(*v) + if err != nil { + return err + } + uafrpiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput update replication protected item provider +// specific input. +type BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput interface { + AsInMageRcmUpdateApplianceForReplicationProtectedItemInput() (*InMageRcmUpdateApplianceForReplicationProtectedItemInput, bool) + AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (*UpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) +} + +// UpdateApplianceForReplicationProtectedItemProviderSpecificInput update replication protected item provider +// specific input. +type UpdateApplianceForReplicationProtectedItemProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput', 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput(body []byte) (BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm): + var imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput + err := json.Unmarshal(body, &imruafrpii) + return imruafrpii, err + default: + var uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput + err := json.Unmarshal(body, &uafrpipsi) + return uafrpipsi, err + } +} +func unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputArray(body []byte) ([]BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + uafrpipsiArray := make([]BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + uafrpipsi, err := unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + uafrpipsiArray[index] = uafrpipsi + } + return uafrpipsiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) MarshalJSON() ([]byte, error) { + uafrpipsi.InstanceType = InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput + objectMap := make(map[string]interface{}) + if uafrpipsi.InstanceType != "" { + objectMap["instanceType"] = uafrpipsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageRcmUpdateApplianceForReplicationProtectedItemInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) AsInMageRcmUpdateApplianceForReplicationProtectedItemInput() (*InMageRcmUpdateApplianceForReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (*UpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return &uafrpipsi, true +} + +// AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return &uafrpipsi, true +} + +// UpdateDiskInput disk input for update. +type UpdateDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // TargetDiskName - The target disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// UpdateMigrationItemInput update migration item input. +type UpdateMigrationItemInput struct { + // Properties - Update migration item input properties. + Properties *UpdateMigrationItemInputProperties `json:"properties,omitempty"` +} + +// UpdateMigrationItemInputProperties update migration item input properties. +type UpdateMigrationItemInputProperties struct { + // ProviderSpecificDetails - The provider specific input to update migration item. + ProviderSpecificDetails BasicUpdateMigrationItemProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateMigrationItemInputProperties struct. +func (umiip *UpdateMigrationItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateMigrationItemProviderSpecificInput(*v) + if err != nil { + return err + } + umiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateMigrationItemProviderSpecificInput update migration item provider specific input. +type BasicUpdateMigrationItemProviderSpecificInput interface { + AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) + AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) +} + +// UpdateMigrationItemProviderSpecificInput update migration item provider specific input. +type UpdateMigrationItemProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput', 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicUpdateMigrationItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateMigrationItemProviderSpecificInput(body []byte) (BasicUpdateMigrationItemProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt): + var vmcumii VMwareCbtUpdateMigrationItemInput + err := json.Unmarshal(body, &vmcumii) + return vmcumii, err + default: + var umipsi UpdateMigrationItemProviderSpecificInput + err := json.Unmarshal(body, &umipsi) + return umipsi, err + } +} +func unmarshalBasicUpdateMigrationItemProviderSpecificInputArray(body []byte) ([]BasicUpdateMigrationItemProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + umipsiArray := make([]BasicUpdateMigrationItemProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + umipsi, err := unmarshalBasicUpdateMigrationItemProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + umipsiArray[index] = umipsi + } + return umipsiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) MarshalJSON() ([]byte, error) { + umipsi.InstanceType = InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput + objectMap := make(map[string]interface{}) + if umipsi.InstanceType != "" { + objectMap["instanceType"] = umipsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtUpdateMigrationItemInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) { + return nil, false +} + +// AsUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) { + return &umipsi, true +} + +// AsBasicUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsBasicUpdateMigrationItemProviderSpecificInput() (BasicUpdateMigrationItemProviderSpecificInput, bool) { + return &umipsi, true +} + +// UpdateMobilityServiceRequest request to update the mobility service on a protected item. +type UpdateMobilityServiceRequest struct { + // Properties - The properties of the update mobility service request. + Properties *UpdateMobilityServiceRequestProperties `json:"properties,omitempty"` +} + +// UpdateMobilityServiceRequestProperties the properties of an update mobility service request. +type UpdateMobilityServiceRequestProperties struct { + // RunAsAccountID - The CS run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// UpdateNetworkMappingInput update network mapping input. +type UpdateNetworkMappingInput struct { + // Properties - The input properties needed to update network mapping. + Properties *UpdateNetworkMappingInputProperties `json:"properties,omitempty"` +} + +// UpdateNetworkMappingInputProperties common input details for network mapping operation. +type UpdateNetworkMappingInputProperties struct { + // RecoveryFabricName - Recovery fabric name. + RecoveryFabricName *string `json:"recoveryFabricName,omitempty"` + // RecoveryNetworkID - Recovery network Id. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // FabricSpecificDetails - Fabrics specific input network Id. + FabricSpecificDetails BasicFabricSpecificUpdateNetworkMappingInput `json:"fabricSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateNetworkMappingInputProperties struct. +func (unmip *UpdateNetworkMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryFabricName": + if v != nil { + var recoveryFabricName string + err = json.Unmarshal(*v, &recoveryFabricName) + if err != nil { + return err + } + unmip.RecoveryFabricName = &recoveryFabricName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + unmip.RecoveryNetworkID = &recoveryNetworkID + } + case "fabricSpecificDetails": + if v != nil { + fabricSpecificDetails, err := unmarshalBasicFabricSpecificUpdateNetworkMappingInput(*v) + if err != nil { + return err + } + unmip.FabricSpecificDetails = fabricSpecificDetails + } + } + } + + return nil +} + +// UpdatePolicyInput update policy input. +type UpdatePolicyInput struct { + // Properties - The ReplicationProviderSettings. + Properties *UpdatePolicyInputProperties `json:"properties,omitempty"` +} + +// UpdatePolicyInputProperties policy update properties. +type UpdatePolicyInputProperties struct { + // ReplicationProviderSettings - The ReplicationProviderSettings. + ReplicationProviderSettings BasicPolicyProviderSpecificInput `json:"replicationProviderSettings,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdatePolicyInputProperties struct. +func (upip *UpdatePolicyInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "replicationProviderSettings": + if v != nil { + replicationProviderSettings, err := unmarshalBasicPolicyProviderSpecificInput(*v) + if err != nil { + return err + } + upip.ReplicationProviderSettings = replicationProviderSettings + } + } + } + + return nil +} + +// UpdateProtectionContainerMappingInput container pairing update input. +type UpdateProtectionContainerMappingInput struct { + // Properties - Update protection container mapping input properties. + Properties *UpdateProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// UpdateProtectionContainerMappingInputProperties container pairing update input. +type UpdateProtectionContainerMappingInputProperties struct { + // ProviderSpecificInput - Provider specific input for updating protection container mapping. + ProviderSpecificInput BasicReplicationProviderSpecificUpdateContainerMappingInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateProtectionContainerMappingInputProperties struct. +func (upcmip *UpdateProtectionContainerMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(*v) + if err != nil { + return err + } + upcmip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// UpdateRecoveryPlanInput update recovery plan input class. +type UpdateRecoveryPlanInput struct { + // Properties - Recovery plan update properties. + Properties *UpdateRecoveryPlanInputProperties `json:"properties,omitempty"` +} + +// UpdateRecoveryPlanInputProperties recovery plan update properties. +type UpdateRecoveryPlanInputProperties struct { + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` +} + +// UpdateReplicationProtectedItemInput update replication protected item input. +type UpdateReplicationProtectedItemInput struct { + // Properties - Update replication protected item properties. + Properties *UpdateReplicationProtectedItemInputProperties `json:"properties,omitempty"` +} + +// UpdateReplicationProtectedItemInputProperties update protected item input properties. +type UpdateReplicationProtectedItemInputProperties struct { + // RecoveryAzureVMName - Target Azure VM name given by the user. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureVMSize - Target Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // SelectedRecoveryAzureNetworkID - Target Azure Network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The Azure Network Id for test failover. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // VMNics - The list of VM nic details. + VMNics *[]VMNicInputDetails `json:"vmNics,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // RecoveryAvailabilitySetID - The target availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // ProviderSpecificDetails - The provider specific input to update replication protected item. + ProviderSpecificDetails BasicUpdateReplicationProtectedItemProviderInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateReplicationProtectedItemInputProperties struct. +func (urpiip *UpdateReplicationProtectedItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryAzureVMName": + if v != nil { + var recoveryAzureVMName string + err = json.Unmarshal(*v, &recoveryAzureVMName) + if err != nil { + return err + } + urpiip.RecoveryAzureVMName = &recoveryAzureVMName + } + case "recoveryAzureVMSize": + if v != nil { + var recoveryAzureVMSize string + err = json.Unmarshal(*v, &recoveryAzureVMSize) + if err != nil { + return err + } + urpiip.RecoveryAzureVMSize = &recoveryAzureVMSize + } + case "selectedRecoveryAzureNetworkId": + if v != nil { + var selectedRecoveryAzureNetworkID string + err = json.Unmarshal(*v, &selectedRecoveryAzureNetworkID) + if err != nil { + return err + } + urpiip.SelectedRecoveryAzureNetworkID = &selectedRecoveryAzureNetworkID + } + case "selectedTfoAzureNetworkId": + if v != nil { + var selectedTfoAzureNetworkID string + err = json.Unmarshal(*v, &selectedTfoAzureNetworkID) + if err != nil { + return err + } + urpiip.SelectedTfoAzureNetworkID = &selectedTfoAzureNetworkID + } + case "selectedSourceNicId": + if v != nil { + var selectedSourceNicID string + err = json.Unmarshal(*v, &selectedSourceNicID) + if err != nil { + return err + } + urpiip.SelectedSourceNicID = &selectedSourceNicID + } + case "enableRdpOnTargetOption": + if v != nil { + var enableRdpOnTargetOption string + err = json.Unmarshal(*v, &enableRdpOnTargetOption) + if err != nil { + return err + } + urpiip.EnableRdpOnTargetOption = &enableRdpOnTargetOption + } + case "vmNics": + if v != nil { + var VMNics []VMNicInputDetails + err = json.Unmarshal(*v, &VMNics) + if err != nil { + return err + } + urpiip.VMNics = &VMNics + } + case "licenseType": + if v != nil { + var licenseType LicenseType + err = json.Unmarshal(*v, &licenseType) + if err != nil { + return err + } + urpiip.LicenseType = licenseType + } + case "recoveryAvailabilitySetId": + if v != nil { + var recoveryAvailabilitySetID string + err = json.Unmarshal(*v, &recoveryAvailabilitySetID) + if err != nil { + return err + } + urpiip.RecoveryAvailabilitySetID = &recoveryAvailabilitySetID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateReplicationProtectedItemProviderInput(*v) + if err != nil { + return err + } + urpiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateReplicationProtectedItemProviderInput update replication protected item provider specific input. +type BasicUpdateReplicationProtectedItemProviderInput interface { + AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) + AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) + AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) + AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) + AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) +} + +// UpdateReplicationProtectedItemProviderInput update replication protected item provider specific input. +type UpdateReplicationProtectedItemProviderInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateReplicationProtectedItemProviderInput(body []byte) (BasicUpdateReplicationProtectedItemProviderInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A): + var aurpii A2AUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &aurpii) + return aurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure): + var hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &hvraurpii) + return hvraurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2): + var imavurpii InMageAzureV2UpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &imavurpii) + return imavurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm): + var imrurpii InMageRcmUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &imrurpii) + return imrurpii, err + default: + var urpipi UpdateReplicationProtectedItemProviderInput + err := json.Unmarshal(body, &urpipi) + return urpipi, err + } +} +func unmarshalBasicUpdateReplicationProtectedItemProviderInputArray(body []byte) ([]BasicUpdateReplicationProtectedItemProviderInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + urpipiArray := make([]BasicUpdateReplicationProtectedItemProviderInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + urpipi, err := unmarshalBasicUpdateReplicationProtectedItemProviderInput(*rawMessage) + if err != nil { + return nil, err + } + urpipiArray[index] = urpipi + } + return urpipiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) MarshalJSON() ([]byte, error) { + urpipi.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput + objectMap := make(map[string]interface{}) + if urpipi.InstanceType != "" { + objectMap["instanceType"] = urpipi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return &urpipi, true +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &urpipi, true +} + +// UpdateVCenterRequest input required to update vCenter. +type UpdateVCenterRequest struct { + // Properties - The update VCenter Request Properties. + Properties *UpdateVCenterRequestProperties `json:"properties,omitempty"` +} + +// UpdateVCenterRequestProperties the properties of an update vCenter request. +type UpdateVCenterRequestProperties struct { + // FriendlyName - The friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the vCenter to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // ProcessServerID - The process server Id from where the update can be orchestrated. + ProcessServerID *string `json:"processServerId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The CS account Id which has privileges to update the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// VaultHealthDetails vault health details definition. +type VaultHealthDetails struct { + autorest.Response `json:"-"` + // Properties - The vault health related data. + Properties *VaultHealthProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VaultHealthDetails. +func (vhd VaultHealthDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vhd.Properties != nil { + objectMap["properties"] = vhd.Properties + } + if vhd.Location != nil { + objectMap["location"] = vhd.Location + } + return json.Marshal(objectMap) +} + +// VaultHealthProperties class to define the health summary of the Vault. +type VaultHealthProperties struct { + // VaultErrors - The list of errors on the vault. + VaultErrors *[]HealthError `json:"vaultErrors,omitempty"` + // ProtectedItemsHealth - The list of the health detail of the protected items in the vault. + ProtectedItemsHealth *ResourceHealthSummary `json:"protectedItemsHealth,omitempty"` + // FabricsHealth - The list of the health detail of the fabrics in the vault. + FabricsHealth *ResourceHealthSummary `json:"fabricsHealth,omitempty"` + // ContainersHealth - The list of the health detail of the containers in the vault. + ContainersHealth *ResourceHealthSummary `json:"containersHealth,omitempty"` +} + +// VaultSetting vault setting. +type VaultSetting struct { + autorest.Response `json:"-"` + // Properties - The vault setting properties. + Properties *VaultSettingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VaultSetting. +func (vs VaultSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vs.Properties != nil { + objectMap["properties"] = vs.Properties + } + if vs.Location != nil { + objectMap["location"] = vs.Location + } + return json.Marshal(objectMap) +} + +// VaultSettingCollection vault setting collection. +type VaultSettingCollection struct { + autorest.Response `json:"-"` + // Value - The list of vault setting. + Value *[]VaultSetting `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// VaultSettingCollectionIterator provides access to a complete listing of VaultSetting values. +type VaultSettingCollectionIterator struct { + i int + page VaultSettingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VaultSettingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VaultSettingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VaultSettingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VaultSettingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VaultSettingCollectionIterator) Response() VaultSettingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VaultSettingCollectionIterator) Value() VaultSetting { + if !iter.page.NotDone() { + return VaultSetting{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VaultSettingCollectionIterator type. +func NewVaultSettingCollectionIterator(page VaultSettingCollectionPage) VaultSettingCollectionIterator { + return VaultSettingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vsc VaultSettingCollection) IsEmpty() bool { + return vsc.Value == nil || len(*vsc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vsc VaultSettingCollection) hasNextLink() bool { + return vsc.NextLink != nil && len(*vsc.NextLink) != 0 +} + +// vaultSettingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vsc VaultSettingCollection) vaultSettingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !vsc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vsc.NextLink))) +} + +// VaultSettingCollectionPage contains a page of VaultSetting values. +type VaultSettingCollectionPage struct { + fn func(context.Context, VaultSettingCollection) (VaultSettingCollection, error) + vsc VaultSettingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VaultSettingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VaultSettingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vsc) + if err != nil { + return err + } + page.vsc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VaultSettingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VaultSettingCollectionPage) NotDone() bool { + return !page.vsc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VaultSettingCollectionPage) Response() VaultSettingCollection { + return page.vsc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VaultSettingCollectionPage) Values() []VaultSetting { + if page.vsc.IsEmpty() { + return nil + } + return *page.vsc.Value +} + +// Creates a new instance of the VaultSettingCollectionPage type. +func NewVaultSettingCollectionPage(cur VaultSettingCollection, getNextPage func(context.Context, VaultSettingCollection) (VaultSettingCollection, error)) VaultSettingCollectionPage { + return VaultSettingCollectionPage{ + fn: getNextPage, + vsc: cur, + } +} + +// VaultSettingCreationInput input to create vault setting. +type VaultSettingCreationInput struct { + // Properties - Vault setting creation input properties. + Properties *VaultSettingCreationInputProperties `json:"properties,omitempty"` +} + +// VaultSettingCreationInputProperties input to create vault setting. +type VaultSettingCreationInputProperties struct { + // MigrationSolutionID - The migration solution Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // VmwareToAzureProviderType - VMware to Azure provider type. + VmwareToAzureProviderType *string `json:"vmwareToAzureProviderType,omitempty"` +} + +// VaultSettingProperties vault setting properties. +type VaultSettingProperties struct { + // MigrationSolutionID - The migration solution ARM Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // VmwareToAzureProviderType - VMware to Azure provider type. + VmwareToAzureProviderType *string `json:"vmwareToAzureProviderType,omitempty"` +} + +// VCenter vCenter definition. +type VCenter struct { + autorest.Response `json:"-"` + // Properties - VCenter related data. + Properties *VCenterProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VCenter. +func (vc VCenter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vc.Properties != nil { + objectMap["properties"] = vc.Properties + } + if vc.Location != nil { + objectMap["location"] = vc.Location + } + return json.Marshal(objectMap) +} + +// VCenterCollection collection of vCenter details. +type VCenterCollection struct { + autorest.Response `json:"-"` + // Value - The vCenter details. + Value *[]VCenter `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// VCenterCollectionIterator provides access to a complete listing of VCenter values. +type VCenterCollectionIterator struct { + i int + page VCenterCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VCenterCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VCenterCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VCenterCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VCenterCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VCenterCollectionIterator) Response() VCenterCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VCenterCollectionIterator) Value() VCenter { + if !iter.page.NotDone() { + return VCenter{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VCenterCollectionIterator type. +func NewVCenterCollectionIterator(page VCenterCollectionPage) VCenterCollectionIterator { + return VCenterCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vcc VCenterCollection) IsEmpty() bool { + return vcc.Value == nil || len(*vcc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vcc VCenterCollection) hasNextLink() bool { + return vcc.NextLink != nil && len(*vcc.NextLink) != 0 +} + +// vCenterCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vcc VCenterCollection) vCenterCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !vcc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vcc.NextLink))) +} + +// VCenterCollectionPage contains a page of VCenter values. +type VCenterCollectionPage struct { + fn func(context.Context, VCenterCollection) (VCenterCollection, error) + vcc VCenterCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VCenterCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VCenterCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vcc) + if err != nil { + return err + } + page.vcc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VCenterCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VCenterCollectionPage) NotDone() bool { + return !page.vcc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VCenterCollectionPage) Response() VCenterCollection { + return page.vcc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VCenterCollectionPage) Values() []VCenter { + if page.vcc.IsEmpty() { + return nil + } + return *page.vcc.Value +} + +// Creates a new instance of the VCenterCollectionPage type. +func NewVCenterCollectionPage(cur VCenterCollection, getNextPage func(context.Context, VCenterCollection) (VCenterCollection, error)) VCenterCollectionPage { + return VCenterCollectionPage{ + fn: getNextPage, + vcc: cur, + } +} + +// VCenterProperties vCenter properties. +type VCenterProperties struct { + // FriendlyName - Friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // InternalID - VCenter internal ID. + InternalID *string `json:"internalId,omitempty"` + // LastHeartbeat - The time when the last heartbeat was received by vCenter. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // DiscoveryStatus - The VCenter discovery status. + DiscoveryStatus *string `json:"discoveryStatus,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // IPAddress - The IP address of the vCenter. + IPAddress *string `json:"ipAddress,omitempty"` + // InfrastructureID - The infrastructure Id of vCenter. + InfrastructureID *string `json:"infrastructureId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The account Id which has privileges to discover the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // FabricArmResourceName - The ARM resource name of the fabric containing this VCenter. + FabricArmResourceName *string `json:"fabricArmResourceName,omitempty"` + // HealthErrors - The health errors for this VCenter. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// VersionDetails version related details. +type VersionDetails struct { + // Version - The agent version. + Version *string `json:"version,omitempty"` + // ExpiryDate - Version expiry date. + ExpiryDate *date.Time `json:"expiryDate,omitempty"` + // Status - A value indicating whether security update required. Possible values include: 'Supported', 'NotSupported', 'Deprecated', 'UpdateRequired', 'SecurityUpdateRequired' + Status AgentVersionStatus `json:"status,omitempty"` +} + +// VirtualMachineTaskDetails this class represents the virtual machine task details. +type VirtualMachineTaskDetails struct { + // SkippedReason - The skipped reason. + SkippedReason *string `json:"skippedReason,omitempty"` + // SkippedReasonString - The skipped reason string. + SkippedReasonString *string `json:"skippedReasonString,omitempty"` + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) MarshalJSON() ([]byte, error) { + vmtd.InstanceType = InstanceTypeVirtualMachineTaskDetails + objectMap := make(map[string]interface{}) + if vmtd.SkippedReason != nil { + objectMap["skippedReason"] = vmtd.SkippedReason + } + if vmtd.SkippedReasonString != nil { + objectMap["skippedReasonString"] = vmtd.SkippedReasonString + } + if vmtd.JobTask != nil { + objectMap["jobTask"] = vmtd.JobTask + } + if vmtd.InstanceType != "" { + objectMap["instanceType"] = vmtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &vmtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return &vmtd, true +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &vmtd, true +} + +// VmmDetails VMM fabric specific details. +type VmmDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmDetails. +func (vd VmmDetails) MarshalJSON() ([]byte, error) { + vd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM + objectMap := make(map[string]interface{}) + if vd.InstanceType != "" { + objectMap["instanceType"] = vd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVmmDetails() (*VmmDetails, bool) { + return &vd, true +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vd, true +} + +// VmmToAzureCreateNetworkMappingInput create network mappings input properties/behavior specific to Vmm to +// Azure Network mapping. +type VmmToAzureCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtacnmi.InstanceType = InstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtacnmi.InstanceType != "" { + objectMap["instanceType"] = vtacnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return &vtacnmi, true +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &vtacnmi, true +} + +// VmmToAzureNetworkMappingSettings e2A Network Mapping fabric specific settings. +type VmmToAzureNetworkMappingSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) MarshalJSON() ([]byte, error) { + vtanms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtanms.InstanceType != "" { + objectMap["instanceType"] = vtanms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return &vtanms, true +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &vtanms, true +} + +// VmmToAzureUpdateNetworkMappingInput update network mappings input properties/behavior specific to vmm to +// azure. +type VmmToAzureUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtaunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtaunmi.InstanceType != "" { + objectMap["instanceType"] = vtaunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return &vtaunmi, true +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &vtaunmi, true +} + +// VmmToVmmCreateNetworkMappingInput create network mappings input properties/behavior specific to vmm to +// vmm Network mapping. +type VmmToVmmCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtvcnmi.InstanceType = InstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvcnmi.InstanceType != "" { + objectMap["instanceType"] = vtvcnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return &vtvcnmi, true +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &vtvcnmi, true +} + +// VmmToVmmNetworkMappingSettings e2E Network Mapping fabric specific settings. +type VmmToVmmNetworkMappingSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) MarshalJSON() ([]byte, error) { + vtvnms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvnms.InstanceType != "" { + objectMap["instanceType"] = vtvnms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return &vtvnms, true +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &vtvnms, true +} + +// VmmToVmmUpdateNetworkMappingInput update network mappings input properties/behavior specific to vmm to +// vmm. +type VmmToVmmUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtvunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvunmi.InstanceType != "" { + objectMap["instanceType"] = vtvunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return &vtvunmi, true +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &vtvunmi, true +} + +// VmmVirtualMachineDetails VMM fabric provider specific VM settings. +type VmmVirtualMachineDetails struct { + // SourceItemID - The source id of the object. + SourceItemID *string `json:"sourceItemId,omitempty"` + // Generation - The id of the object in fabric. + Generation *string `json:"generation,omitempty"` + // OsDetails - The Last replication time. + OsDetails *OSDetails `json:"osDetails,omitempty"` + // DiskDetails - The Last successful failover time. + DiskDetails *[]DiskDetails `json:"diskDetails,omitempty"` + // HasPhysicalDisk - A value indicating whether the VM has a physical disk attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasPhysicalDisk PresenceStatus `json:"hasPhysicalDisk,omitempty"` + // HasFibreChannelAdapter - A value indicating whether the VM has a fibre channel adapter attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasFibreChannelAdapter PresenceStatus `json:"hasFibreChannelAdapter,omitempty"` + // HasSharedVhd - A value indicating whether the VM has a shared VHD attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasSharedVhd PresenceStatus `json:"hasSharedVhd,omitempty"` + // HyperVHostID - The Id of the hyper-v host in fabric. + HyperVHostID *string `json:"hyperVHostId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) MarshalJSON() ([]byte, error) { + vvmd.InstanceType = InstanceTypeVmmVirtualMachine + objectMap := make(map[string]interface{}) + if vvmd.SourceItemID != nil { + objectMap["sourceItemId"] = vvmd.SourceItemID + } + if vvmd.Generation != nil { + objectMap["generation"] = vvmd.Generation + } + if vvmd.OsDetails != nil { + objectMap["osDetails"] = vvmd.OsDetails + } + if vvmd.DiskDetails != nil { + objectMap["diskDetails"] = vvmd.DiskDetails + } + if vvmd.HasPhysicalDisk != "" { + objectMap["hasPhysicalDisk"] = vvmd.HasPhysicalDisk + } + if vvmd.HasFibreChannelAdapter != "" { + objectMap["hasFibreChannelAdapter"] = vvmd.HasFibreChannelAdapter + } + if vvmd.HasSharedVhd != "" { + objectMap["hasSharedVhd"] = vvmd.HasSharedVhd + } + if vvmd.HyperVHostID != nil { + objectMap["hyperVHostId"] = vvmd.HyperVHostID + } + if vvmd.InstanceType != "" { + objectMap["instanceType"] = vvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return &vvmd, true +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return &vvmd, true +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &vvmd, true +} + +// VMNicDetails hyper V VM network details. +type VMNicDetails struct { + // NicID - The nic Id. + NicID *string `json:"nicId,omitempty"` + // ReplicaNicID - The replica nic Id. + ReplicaNicID *string `json:"replicaNicId,omitempty"` + // SourceNicArmID - The source nic ARM Id. + SourceNicArmID *string `json:"sourceNicArmId,omitempty"` + // VMNetworkName - VM network name. + VMNetworkName *string `json:"vMNetworkName,omitempty"` + // RecoveryVMNetworkID - Recovery VM network Id. + RecoveryVMNetworkID *string `json:"recoveryVMNetworkId,omitempty"` + // IPConfigs - The IP configurations of the NIC. + IPConfigs *[]IPConfigDetails `json:"ipConfigs,omitempty"` + // SelectionType - Selection type for failover. + SelectionType *string `json:"selectionType,omitempty"` + // RecoveryNetworkSecurityGroupID - The id of the NSG associated with the NIC. + RecoveryNetworkSecurityGroupID *string `json:"recoveryNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnRecovery - A value indicating whether the NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnRecovery *bool `json:"enableAcceleratedNetworkingOnRecovery,omitempty"` + // TfoVMNetworkID - The network to be used by NIC during test failover. + TfoVMNetworkID *string `json:"tfoVMNetworkId,omitempty"` + // TfoNetworkSecurityGroupID - The NSG to be used by NIC during test failover. + TfoNetworkSecurityGroupID *string `json:"tfoNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnTfo - Whether the TFO NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnTfo *bool `json:"enableAcceleratedNetworkingOnTfo,omitempty"` + // RecoveryNicName - The name of the NIC to be used when creating target NICs. + RecoveryNicName *string `json:"recoveryNicName,omitempty"` + // RecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs. + RecoveryNicResourceGroupName *string `json:"recoveryNicResourceGroupName,omitempty"` + // ReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during failover subject to availability. + ReuseExistingNic *bool `json:"reuseExistingNic,omitempty"` + // TfoRecoveryNicName - The name of the NIC to be used when creating target NICs in TFO. + TfoRecoveryNicName *string `json:"tfoRecoveryNicName,omitempty"` + // TfoRecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs in TFO. + TfoRecoveryNicResourceGroupName *string `json:"tfoRecoveryNicResourceGroupName,omitempty"` + // TfoReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during test failover subject to availability. + TfoReuseExistingNic *bool `json:"tfoReuseExistingNic,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` +} + +// VMNicInputDetails hyper V VM network input details. +type VMNicInputDetails struct { + // NicID - The nic Id. + NicID *string `json:"nicId,omitempty"` + // IPConfigs - The IP configurations to be used by NIC during test failover and failover. + IPConfigs *[]IPConfigInputDetails `json:"ipConfigs,omitempty"` + // SelectionType - Selection type for failover. + SelectionType *string `json:"selectionType,omitempty"` + // RecoveryNetworkSecurityGroupID - The id of the NSG associated with the NIC. + RecoveryNetworkSecurityGroupID *string `json:"recoveryNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnRecovery - Whether the NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnRecovery *bool `json:"enableAcceleratedNetworkingOnRecovery,omitempty"` + // TfoNetworkSecurityGroupID - The NSG to be used by NIC during test failover. + TfoNetworkSecurityGroupID *string `json:"tfoNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnTfo - Whether the test NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnTfo *bool `json:"enableAcceleratedNetworkingOnTfo,omitempty"` + // RecoveryNicName - The name of the NIC to be used when creating target NICs. + RecoveryNicName *string `json:"recoveryNicName,omitempty"` + // RecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs. + RecoveryNicResourceGroupName *string `json:"recoveryNicResourceGroupName,omitempty"` + // ReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during failover subject to availability. + ReuseExistingNic *bool `json:"reuseExistingNic,omitempty"` + // TfoNicName - The name of the NIC to be used when creating target NICs in TFO. + TfoNicName *string `json:"tfoNicName,omitempty"` + // TfoNicResourceGroupName - The resource group of the NIC to be used when creating target NICs in TFO. + TfoNicResourceGroupName *string `json:"tfoNicResourceGroupName,omitempty"` + // TfoReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during test failover subject to availability. + TfoReuseExistingNic *bool `json:"tfoReuseExistingNic,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` +} + +// VMNicUpdatesTaskDetails this class represents the vm NicUpdates task details. +type VMNicUpdatesTaskDetails struct { + // VMID - Virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // NicID - Nic Id. + NicID *string `json:"nicId,omitempty"` + // Name - Name of the Nic. + Name *string `json:"name,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) MarshalJSON() ([]byte, error) { + vnutd.InstanceType = InstanceTypeVMNicUpdatesTaskDetails + objectMap := make(map[string]interface{}) + if vnutd.VMID != nil { + objectMap["vmId"] = vnutd.VMID + } + if vnutd.NicID != nil { + objectMap["nicId"] = vnutd.NicID + } + if vnutd.Name != nil { + objectMap["name"] = vnutd.Name + } + if vnutd.InstanceType != "" { + objectMap["instanceType"] = vnutd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return &vnutd, true +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &vnutd, true +} + +// VMwareCbtContainerCreationInput vMwareCbt container creation input. +type VMwareCbtContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) MarshalJSON() ([]byte, error) { + vmccci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmccci.InstanceType != "" { + objectMap["instanceType"] = vmccci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return &vmccci, true +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &vmccci, true +} + +// VMwareCbtContainerMappingInput vMwareCbt container mapping input. +type VMwareCbtContainerMappingInput struct { + // KeyVaultID - The target key vault ARM Id. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyVaultURI - The target key vault URL. + KeyVaultURI *string `json:"keyVaultUri,omitempty"` + // StorageAccountID - The storage account ARM Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // StorageAccountSasSecretName - The secret name of the storage account. + StorageAccountSasSecretName *string `json:"storageAccountSasSecretName,omitempty"` + // ServiceBusConnectionStringSecretName - The secret name of the service bus connection string. + ServiceBusConnectionStringSecretName *string `json:"serviceBusConnectionStringSecretName,omitempty"` + // TargetLocation - The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) MarshalJSON() ([]byte, error) { + vmccmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmccmi.KeyVaultID != nil { + objectMap["keyVaultId"] = vmccmi.KeyVaultID + } + if vmccmi.KeyVaultURI != nil { + objectMap["keyVaultUri"] = vmccmi.KeyVaultURI + } + if vmccmi.StorageAccountID != nil { + objectMap["storageAccountId"] = vmccmi.StorageAccountID + } + if vmccmi.StorageAccountSasSecretName != nil { + objectMap["storageAccountSasSecretName"] = vmccmi.StorageAccountSasSecretName + } + if vmccmi.ServiceBusConnectionStringSecretName != nil { + objectMap["serviceBusConnectionStringSecretName"] = vmccmi.ServiceBusConnectionStringSecretName + } + if vmccmi.TargetLocation != nil { + objectMap["targetLocation"] = vmccmi.TargetLocation + } + if vmccmi.InstanceType != "" { + objectMap["instanceType"] = vmccmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return &vmccmi, true +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &vmccmi, true +} + +// VMwareCbtDiskInput vMwareCbt disk input. +type VMwareCbtDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // IsOSDisk - A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // LogStorageAccountSasSecretName - The key vault secret name of the log storage account. + LogStorageAccountSasSecretName *string `json:"logStorageAccountSasSecretName,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// VMwareCbtEnableMigrationInput vMwareCbt specific enable migration input. +type VMwareCbtEnableMigrationInput struct { + // VmwareMachineID - The ARM Id of the VM discovered in VMware. + VmwareMachineID *string `json:"vmwareMachineId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]VMwareCbtDiskInput `json:"disksToInclude,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // DataMoverRunAsAccountID - The data mover run as account Id. + DataMoverRunAsAccountID *string `json:"dataMoverRunAsAccountId,omitempty"` + // SnapshotRunAsAccountID - The snapshot run as account Id. + SnapshotRunAsAccountID *string `json:"snapshotRunAsAccountId,omitempty"` + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TargetSubnetName - The target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedDiskTags - The tags for the seed disks. + SeedDiskTags map[string]*string `json:"seedDiskTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeEnableMigrationProviderSpecificInput', 'InstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEnableMigrationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) MarshalJSON() ([]byte, error) { + vmcemi.InstanceType = InstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcemi.VmwareMachineID != nil { + objectMap["vmwareMachineId"] = vmcemi.VmwareMachineID + } + if vmcemi.DisksToInclude != nil { + objectMap["disksToInclude"] = vmcemi.DisksToInclude + } + if vmcemi.LicenseType != "" { + objectMap["licenseType"] = vmcemi.LicenseType + } + if vmcemi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = vmcemi.SQLServerLicenseType + } + if vmcemi.DataMoverRunAsAccountID != nil { + objectMap["dataMoverRunAsAccountId"] = vmcemi.DataMoverRunAsAccountID + } + if vmcemi.SnapshotRunAsAccountID != nil { + objectMap["snapshotRunAsAccountId"] = vmcemi.SnapshotRunAsAccountID + } + if vmcemi.TargetVMName != nil { + objectMap["targetVmName"] = vmcemi.TargetVMName + } + if vmcemi.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcemi.TargetVMSize + } + if vmcemi.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcemi.TargetResourceGroupID + } + if vmcemi.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcemi.TargetNetworkID + } + if vmcemi.TargetSubnetName != nil { + objectMap["targetSubnetName"] = vmcemi.TargetSubnetName + } + if vmcemi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcemi.TargetAvailabilitySetID + } + if vmcemi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcemi.TargetAvailabilityZone + } + if vmcemi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcemi.TargetProximityPlacementGroupID + } + if vmcemi.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcemi.TargetBootDiagnosticsStorageAccountID + } + if vmcemi.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcemi.PerformAutoResync + } + if vmcemi.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcemi.TargetVMTags + } + if vmcemi.SeedDiskTags != nil { + objectMap["seedDiskTags"] = vmcemi.SeedDiskTags + } + if vmcemi.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcemi.TargetDiskTags + } + if vmcemi.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcemi.TargetNicTags + } + if vmcemi.InstanceType != "" { + objectMap["instanceType"] = vmcemi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtEnableMigrationInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) { + return &vmcemi, true +} + +// AsEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsBasicEnableMigrationProviderSpecificInput() (BasicEnableMigrationProviderSpecificInput, bool) { + return &vmcemi, true +} + +// VMwareCbtEventDetails event details for VMwareCbt provider. +type VMwareCbtEventDetails struct { + // MigrationItemName - READ-ONLY; The migration item name. + MigrationItemName *string `json:"migrationItemName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) MarshalJSON() ([]byte, error) { + vmced.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmced.InstanceType != "" { + objectMap["instanceType"] = vmced.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return &vmced, true +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &vmced, true +} + +// VMwareCbtMigrateInput vMwareCbt specific migrate input. +type VMwareCbtMigrateInput struct { + // PerformShutdown - A value indicating whether VM is to be shutdown. + PerformShutdown *string `json:"performShutdown,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput', 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) MarshalJSON() ([]byte, error) { + vmcmi.InstanceType = InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcmi.PerformShutdown != nil { + objectMap["performShutdown"] = vmcmi.PerformShutdown + } + if vmcmi.InstanceType != "" { + objectMap["instanceType"] = vmcmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrateInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) { + return &vmcmi, true +} + +// AsMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsBasicMigrateProviderSpecificInput() (BasicMigrateProviderSpecificInput, bool) { + return &vmcmi, true +} + +// VMwareCbtMigrationDetails vMwareCbt provider specific settings. +type VMwareCbtMigrationDetails struct { + // VmwareMachineID - READ-ONLY; The ARM Id of the VM discovered in VMware. + VmwareMachineID *string `json:"vmwareMachineId,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // FirmwareType - READ-ONLY; The firmware type. + FirmwareType *string `json:"firmwareType,omitempty"` + // TargetGeneration - READ-ONLY; The target generation. + TargetGeneration *string `json:"targetGeneration,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // DataMoverRunAsAccountID - READ-ONLY; The data mover run as account Id. + DataMoverRunAsAccountID *string `json:"dataMoverRunAsAccountId,omitempty"` + // SnapshotRunAsAccountID - READ-ONLY; The snapshot run as account Id. + SnapshotRunAsAccountID *string `json:"snapshotRunAsAccountId,omitempty"` + // TargetVMName - Target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetLocation - READ-ONLY; The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // TargetResourceGroupID - The target resource group Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]VMwareCbtProtectedDiskDetails `json:"protectedDisks,omitempty"` + // TargetNetworkID - The target network Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // VMNics - The network details. + VMNics *[]VMwareCbtNicDetails `json:"vmNics,omitempty"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // MigrationRecoveryPointID - READ-ONLY; The recovery point Id to which the VM was migrated. + MigrationRecoveryPointID *string `json:"migrationRecoveryPointId,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // LastRecoveryPointID - READ-ONLY; The last recovery point Id. + LastRecoveryPointID *string `json:"lastRecoveryPointId,omitempty"` + // InitialSeedingProgressPercentage - READ-ONLY; The initial seeding progress percentage. + InitialSeedingProgressPercentage *int32 `json:"initialSeedingProgressPercentage,omitempty"` + // MigrationProgressPercentage - READ-ONLY; The migration progress percentage. + MigrationProgressPercentage *int32 `json:"migrationProgressPercentage,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // InitialSeedingRetryCount - READ-ONLY; The initial seeding retry count. + InitialSeedingRetryCount *int64 `json:"initialSeedingRetryCount,omitempty"` + // ResyncRetryCount - READ-ONLY; The resync retry count. + ResyncRetryCount *int64 `json:"resyncRetryCount,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // SeedDiskTags - The tags for the seed disks. + SeedDiskTags map[string]*string `json:"seedDiskTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings', 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) MarshalJSON() ([]byte, error) { + vmcmd.InstanceType = InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcmd.LicenseType != nil { + objectMap["licenseType"] = vmcmd.LicenseType + } + if vmcmd.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = vmcmd.SQLServerLicenseType + } + if vmcmd.TargetVMName != nil { + objectMap["targetVmName"] = vmcmd.TargetVMName + } + if vmcmd.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcmd.TargetVMSize + } + if vmcmd.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcmd.TargetResourceGroupID + } + if vmcmd.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcmd.TargetAvailabilitySetID + } + if vmcmd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcmd.TargetAvailabilityZone + } + if vmcmd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcmd.TargetProximityPlacementGroupID + } + if vmcmd.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcmd.TargetBootDiagnosticsStorageAccountID + } + if vmcmd.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcmd.TargetVMTags + } + if vmcmd.ProtectedDisks != nil { + objectMap["protectedDisks"] = vmcmd.ProtectedDisks + } + if vmcmd.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcmd.TargetNetworkID + } + if vmcmd.VMNics != nil { + objectMap["vmNics"] = vmcmd.VMNics + } + if vmcmd.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcmd.TargetNicTags + } + if vmcmd.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcmd.PerformAutoResync + } + if vmcmd.SeedDiskTags != nil { + objectMap["seedDiskTags"] = vmcmd.SeedDiskTags + } + if vmcmd.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcmd.TargetDiskTags + } + if vmcmd.InstanceType != "" { + objectMap["instanceType"] = vmcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrationDetails is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) { + return &vmcmd, true +} + +// AsMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsBasicMigrationProviderSpecificSettings() (BasicMigrationProviderSpecificSettings, bool) { + return &vmcmd, true +} + +// VMwareCbtNicDetails vMwareCbt NIC details. +type VMwareCbtNicDetails struct { + // NicID - READ-ONLY; The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // SourceIPAddress - READ-ONLY; The source IP address. + SourceIPAddress *string `json:"sourceIPAddress,omitempty"` + // SourceIPAddressType - READ-ONLY; The source IP address type. Possible values include: 'Dynamic', 'Static' + SourceIPAddressType EthernetAddressType `json:"sourceIPAddressType,omitempty"` + // SourceNetworkID - READ-ONLY; Source network Id. + SourceNetworkID *string `json:"sourceNetworkId,omitempty"` + // TargetIPAddress - The target IP address. + TargetIPAddress *string `json:"targetIPAddress,omitempty"` + // TargetIPAddressType - The target IP address type. Possible values include: 'Dynamic', 'Static' + TargetIPAddressType EthernetAddressType `json:"targetIPAddressType,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` + // IsSelectedForMigration - A value indicating whether this NIC is selected for migration. + IsSelectedForMigration *string `json:"isSelectedForMigration,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtNicDetails. +func (vmcnd VMwareCbtNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmcnd.IsPrimaryNic != nil { + objectMap["isPrimaryNic"] = vmcnd.IsPrimaryNic + } + if vmcnd.TargetIPAddress != nil { + objectMap["targetIPAddress"] = vmcnd.TargetIPAddress + } + if vmcnd.TargetIPAddressType != "" { + objectMap["targetIPAddressType"] = vmcnd.TargetIPAddressType + } + if vmcnd.TargetSubnetName != nil { + objectMap["targetSubnetName"] = vmcnd.TargetSubnetName + } + if vmcnd.TargetNicName != nil { + objectMap["targetNicName"] = vmcnd.TargetNicName + } + if vmcnd.IsSelectedForMigration != nil { + objectMap["isSelectedForMigration"] = vmcnd.IsSelectedForMigration + } + return json.Marshal(objectMap) +} + +// VMwareCbtNicInput vMwareCbt NIC input. +type VMwareCbtNicInput struct { + // NicID - The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetStaticIPAddress - The static IP address. + TargetStaticIPAddress *string `json:"targetStaticIPAddress,omitempty"` + // IsSelectedForMigration - A value indicating whether this NIC is selected for migration. + IsSelectedForMigration *string `json:"isSelectedForMigration,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` +} + +// VMwareCbtPolicyCreationInput vMware Cbt policy creation input. +type VMwareCbtPolicyCreationInput struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) MarshalJSON() ([]byte, error) { + vmcpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcpci.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = vmcpci.RecoveryPointHistoryInMinutes + } + if vmcpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = vmcpci.CrashConsistentFrequencyInMinutes + } + if vmcpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = vmcpci.AppConsistentFrequencyInMinutes + } + if vmcpci.InstanceType != "" { + objectMap["instanceType"] = vmcpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return &vmcpci, true +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &vmcpci, true +} + +// VmwareCbtPolicyDetails vMware Cbt specific policy details. +type VmwareCbtPolicyDetails struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) MarshalJSON() ([]byte, error) { + vcpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vcpd.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = vcpd.RecoveryPointHistoryInMinutes + } + if vcpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = vcpd.AppConsistentFrequencyInMinutes + } + if vcpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = vcpd.CrashConsistentFrequencyInMinutes + } + if vcpd.InstanceType != "" { + objectMap["instanceType"] = vcpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return &vcpd, true +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &vcpd, true +} + +// VMwareCbtProtectedDiskDetails vMwareCbt protected disk details. +type VMwareCbtProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskPath - READ-ONLY; The disk path. + DiskPath *string `json:"diskPath,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // LogStorageAccountSasSecretName - READ-ONLY; The key vault secret name of the log storage account. + LogStorageAccountSasSecretName *string `json:"logStorageAccountSasSecretName,omitempty"` + // DiskEncryptionSetID - READ-ONLY; The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // SeedManagedDiskID - READ-ONLY; The ARM Id of the seed managed disk. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // TargetManagedDiskID - READ-ONLY; The ARM Id of the target managed disk. + TargetManagedDiskID *string `json:"targetManagedDiskId,omitempty"` + // TargetDiskName - The name for the target managed disk. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtProtectedDiskDetails. +func (vmcpdd VMwareCbtProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmcpdd.DiskType != "" { + objectMap["diskType"] = vmcpdd.DiskType + } + if vmcpdd.TargetDiskName != nil { + objectMap["targetDiskName"] = vmcpdd.TargetDiskName + } + return json.Marshal(objectMap) +} + +// VMwareCbtProtectionContainerMappingDetails vMwareCbt provider specific container mapping details. +type VMwareCbtProtectionContainerMappingDetails struct { + // KeyVaultID - READ-ONLY; The target key vault ARM Id. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyVaultURI - READ-ONLY; The target key vault URI. + KeyVaultURI *string `json:"keyVaultUri,omitempty"` + // StorageAccountID - READ-ONLY; The storage account ARM Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // StorageAccountSasSecretName - READ-ONLY; The secret name of the storage account. + StorageAccountSasSecretName *string `json:"storageAccountSasSecretName,omitempty"` + // ServiceBusConnectionStringSecretName - READ-ONLY; The secret name of the service bus connection string. + ServiceBusConnectionStringSecretName *string `json:"serviceBusConnectionStringSecretName,omitempty"` + // TargetLocation - READ-ONLY; The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + vmcpcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcpcmd.InstanceType != "" { + objectMap["instanceType"] = vmcpcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return &vmcpcmd, true +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &vmcpcmd, true +} + +// VMwareCbtResyncInput vMwareCbt specific resync input. +type VMwareCbtResyncInput struct { + // SkipCbtReset - A value indicating whether CBT is to be reset. + SkipCbtReset *string `json:"skipCbtReset,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput', 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicResyncProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) MarshalJSON() ([]byte, error) { + vmcri.InstanceType = InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcri.SkipCbtReset != nil { + objectMap["skipCbtReset"] = vmcri.SkipCbtReset + } + if vmcri.InstanceType != "" { + objectMap["instanceType"] = vmcri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtResyncInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) { + return &vmcri, true +} + +// AsResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsBasicResyncProviderSpecificInput() (BasicResyncProviderSpecificInput, bool) { + return &vmcri, true +} + +// VMwareCbtTestMigrateInput vMwareCbt specific test migrate input. +type VMwareCbtTestMigrateInput struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // NetworkID - The test network Id. + NetworkID *string `json:"networkId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput', 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicTestMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) MarshalJSON() ([]byte, error) { + vmctmi.InstanceType = InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmctmi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = vmctmi.RecoveryPointID + } + if vmctmi.NetworkID != nil { + objectMap["networkId"] = vmctmi.NetworkID + } + if vmctmi.InstanceType != "" { + objectMap["instanceType"] = vmctmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtTestMigrateInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) { + return &vmctmi, true +} + +// AsTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsBasicTestMigrateProviderSpecificInput() (BasicTestMigrateProviderSpecificInput, bool) { + return &vmctmi, true +} + +// VMwareCbtUpdateDiskInput vMwareCbt disk input for update. +type VMwareCbtUpdateDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // TargetDiskName - The target disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// VMwareCbtUpdateMigrationItemInput vMwareCbt specific update migration item input. +type VMwareCbtUpdateMigrationItemInput struct { + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // VMNics - The list of NIC details. + VMNics *[]VMwareCbtNicInput `json:"vmNics,omitempty"` + // VMDisks - The list of disk update properties. + VMDisks *[]VMwareCbtUpdateDiskInput `json:"vmDisks,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput', 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicUpdateMigrationItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) MarshalJSON() ([]byte, error) { + vmcumii.InstanceType = InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcumii.TargetVMName != nil { + objectMap["targetVmName"] = vmcumii.TargetVMName + } + if vmcumii.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcumii.TargetVMSize + } + if vmcumii.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcumii.TargetResourceGroupID + } + if vmcumii.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcumii.TargetAvailabilitySetID + } + if vmcumii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcumii.TargetAvailabilityZone + } + if vmcumii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcumii.TargetProximityPlacementGroupID + } + if vmcumii.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcumii.TargetBootDiagnosticsStorageAccountID + } + if vmcumii.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcumii.TargetNetworkID + } + if vmcumii.VMNics != nil { + objectMap["vmNics"] = vmcumii.VMNics + } + if vmcumii.VMDisks != nil { + objectMap["vmDisks"] = vmcumii.VMDisks + } + if vmcumii.LicenseType != "" { + objectMap["licenseType"] = vmcumii.LicenseType + } + if vmcumii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = vmcumii.SQLServerLicenseType + } + if vmcumii.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcumii.PerformAutoResync + } + if vmcumii.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcumii.TargetVMTags + } + if vmcumii.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcumii.TargetDiskTags + } + if vmcumii.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcumii.TargetNicTags + } + if vmcumii.InstanceType != "" { + objectMap["instanceType"] = vmcumii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtUpdateMigrationItemInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) { + return &vmcumii, true +} + +// AsUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsBasicUpdateMigrationItemProviderSpecificInput() (BasicUpdateMigrationItemProviderSpecificInput, bool) { + return &vmcumii, true +} + +// VMwareDetails store the fabric details specific to the VMware fabric. +type VMwareDetails struct { + // ProcessServers - The list of Process Servers associated with the fabric. + ProcessServers *[]ProcessServer `json:"processServers,omitempty"` + // MasterTargetServers - The list of Master Target servers associated with the fabric. + MasterTargetServers *[]MasterTargetServer `json:"masterTargetServers,omitempty"` + // RunAsAccounts - The list of run as accounts created on the server. + RunAsAccounts *[]RunAsAccount `json:"runAsAccounts,omitempty"` + // ReplicationPairCount - The number of replication pairs configured in this CS. + ReplicationPairCount *string `json:"replicationPairCount,omitempty"` + // ProcessServerCount - The number of process servers. + ProcessServerCount *string `json:"processServerCount,omitempty"` + // AgentCount - The number of source and target servers configured to talk to this CS. + AgentCount *string `json:"agentCount,omitempty"` + // ProtectedServers - The number of protected servers. + ProtectedServers *string `json:"protectedServers,omitempty"` + // SystemLoad - The percentage of the system load. + SystemLoad *string `json:"systemLoad,omitempty"` + // SystemLoadStatus - The system load status. + SystemLoadStatus *string `json:"systemLoadStatus,omitempty"` + // CPULoad - The percentage of the CPU load. + CPULoad *string `json:"cpuLoad,omitempty"` + // CPULoadStatus - The CPU load status. + CPULoadStatus *string `json:"cpuLoadStatus,omitempty"` + // TotalMemoryInBytes - The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // MemoryUsageStatus - The memory usage status. + MemoryUsageStatus *string `json:"memoryUsageStatus,omitempty"` + // TotalSpaceInBytes - The total space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - The available space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // SpaceUsageStatus - The space usage status. + SpaceUsageStatus *string `json:"spaceUsageStatus,omitempty"` + // WebLoad - The web load. + WebLoad *string `json:"webLoad,omitempty"` + // WebLoadStatus - The web load status. + WebLoadStatus *string `json:"webLoadStatus,omitempty"` + // DatabaseServerLoad - The database server load. + DatabaseServerLoad *string `json:"databaseServerLoad,omitempty"` + // DatabaseServerLoadStatus - The database server load status. + DatabaseServerLoadStatus *string `json:"databaseServerLoadStatus,omitempty"` + // CsServiceStatus - The CS service status. + CsServiceStatus *string `json:"csServiceStatus,omitempty"` + // IPAddress - The IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // AgentVersion - The agent Version. + AgentVersion *string `json:"agentVersion,omitempty"` + // HostName - The host name. + HostName *string `json:"hostName,omitempty"` + // LastHeartbeat - The last heartbeat received from CS server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // SslCertExpiryDate - CS SSL cert expiry date. + SslCertExpiryDate *date.Time `json:"sslCertExpiryDate,omitempty"` + // SslCertExpiryRemainingDays - CS SSL cert expiry date. + SslCertExpiryRemainingDays *int32 `json:"sslCertExpiryRemainingDays,omitempty"` + // PsTemplateVersion - PS template version. + PsTemplateVersion *string `json:"psTemplateVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // AgentVersionDetails - The agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // SwitchProviderBlockingErrorDetails - The switch provider blocking error information. + SwitchProviderBlockingErrorDetails *[]InMageFabricSwitchProviderBlockingErrorDetails `json:"switchProviderBlockingErrorDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareDetails. +func (vmd VMwareDetails) MarshalJSON() ([]byte, error) { + vmd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware + objectMap := make(map[string]interface{}) + if vmd.ProcessServers != nil { + objectMap["processServers"] = vmd.ProcessServers + } + if vmd.MasterTargetServers != nil { + objectMap["masterTargetServers"] = vmd.MasterTargetServers + } + if vmd.RunAsAccounts != nil { + objectMap["runAsAccounts"] = vmd.RunAsAccounts + } + if vmd.ReplicationPairCount != nil { + objectMap["replicationPairCount"] = vmd.ReplicationPairCount + } + if vmd.ProcessServerCount != nil { + objectMap["processServerCount"] = vmd.ProcessServerCount + } + if vmd.AgentCount != nil { + objectMap["agentCount"] = vmd.AgentCount + } + if vmd.ProtectedServers != nil { + objectMap["protectedServers"] = vmd.ProtectedServers + } + if vmd.SystemLoad != nil { + objectMap["systemLoad"] = vmd.SystemLoad + } + if vmd.SystemLoadStatus != nil { + objectMap["systemLoadStatus"] = vmd.SystemLoadStatus + } + if vmd.CPULoad != nil { + objectMap["cpuLoad"] = vmd.CPULoad + } + if vmd.CPULoadStatus != nil { + objectMap["cpuLoadStatus"] = vmd.CPULoadStatus + } + if vmd.TotalMemoryInBytes != nil { + objectMap["totalMemoryInBytes"] = vmd.TotalMemoryInBytes + } + if vmd.AvailableMemoryInBytes != nil { + objectMap["availableMemoryInBytes"] = vmd.AvailableMemoryInBytes + } + if vmd.MemoryUsageStatus != nil { + objectMap["memoryUsageStatus"] = vmd.MemoryUsageStatus + } + if vmd.TotalSpaceInBytes != nil { + objectMap["totalSpaceInBytes"] = vmd.TotalSpaceInBytes + } + if vmd.AvailableSpaceInBytes != nil { + objectMap["availableSpaceInBytes"] = vmd.AvailableSpaceInBytes + } + if vmd.SpaceUsageStatus != nil { + objectMap["spaceUsageStatus"] = vmd.SpaceUsageStatus + } + if vmd.WebLoad != nil { + objectMap["webLoad"] = vmd.WebLoad + } + if vmd.WebLoadStatus != nil { + objectMap["webLoadStatus"] = vmd.WebLoadStatus + } + if vmd.DatabaseServerLoad != nil { + objectMap["databaseServerLoad"] = vmd.DatabaseServerLoad + } + if vmd.DatabaseServerLoadStatus != nil { + objectMap["databaseServerLoadStatus"] = vmd.DatabaseServerLoadStatus + } + if vmd.CsServiceStatus != nil { + objectMap["csServiceStatus"] = vmd.CsServiceStatus + } + if vmd.IPAddress != nil { + objectMap["ipAddress"] = vmd.IPAddress + } + if vmd.AgentVersion != nil { + objectMap["agentVersion"] = vmd.AgentVersion + } + if vmd.HostName != nil { + objectMap["hostName"] = vmd.HostName + } + if vmd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = vmd.LastHeartbeat + } + if vmd.VersionStatus != nil { + objectMap["versionStatus"] = vmd.VersionStatus + } + if vmd.SslCertExpiryDate != nil { + objectMap["sslCertExpiryDate"] = vmd.SslCertExpiryDate + } + if vmd.SslCertExpiryRemainingDays != nil { + objectMap["sslCertExpiryRemainingDays"] = vmd.SslCertExpiryRemainingDays + } + if vmd.PsTemplateVersion != nil { + objectMap["psTemplateVersion"] = vmd.PsTemplateVersion + } + if vmd.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = vmd.AgentExpiryDate + } + if vmd.AgentVersionDetails != nil { + objectMap["agentVersionDetails"] = vmd.AgentVersionDetails + } + if vmd.SwitchProviderBlockingErrorDetails != nil { + objectMap["switchProviderBlockingErrorDetails"] = vmd.SwitchProviderBlockingErrorDetails + } + if vmd.InstanceType != "" { + objectMap["instanceType"] = vmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return &vmd, true +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vmd, true +} + +// VMwareV2FabricCreationInput vMwareV2 fabric provider specific settings. +type VMwareV2FabricCreationInput struct { + // VmwareSiteID - The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // MigrationSolutionID - The ARM Id of the migration solution. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) MarshalJSON() ([]byte, error) { + vmvfci.InstanceType = InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2 + objectMap := make(map[string]interface{}) + if vmvfci.VmwareSiteID != nil { + objectMap["vmwareSiteId"] = vmvfci.VmwareSiteID + } + if vmvfci.PhysicalSiteID != nil { + objectMap["physicalSiteId"] = vmvfci.PhysicalSiteID + } + if vmvfci.MigrationSolutionID != nil { + objectMap["migrationSolutionId"] = vmvfci.MigrationSolutionID + } + if vmvfci.InstanceType != "" { + objectMap["instanceType"] = vmvfci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return &vmvfci, true +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &vmvfci, true +} + +// VMwareV2FabricSpecificDetails vMwareV2 fabric specific details. +type VMwareV2FabricSpecificDetails struct { + // VmwareSiteID - READ-ONLY; The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - READ-ONLY; The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // MigrationSolutionID - READ-ONLY; The Migration solution ARM Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // ServiceEndpoint - READ-ONLY; The service endpoint. + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` + // ServiceResourceID - READ-ONLY; The service resource Id. + ServiceResourceID *string `json:"serviceResourceId,omitempty"` + // ServiceContainerID - READ-ONLY; The service container Id. + ServiceContainerID *string `json:"serviceContainerId,omitempty"` + // ProcessServers - READ-ONLY; The list of process servers. + ProcessServers *[]ProcessServerDetails `json:"processServers,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) MarshalJSON() ([]byte, error) { + vmvfsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 + objectMap := make(map[string]interface{}) + if vmvfsd.InstanceType != "" { + objectMap["instanceType"] = vmvfsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return &vmvfsd, true +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vmvfsd, true +} + +// VMwareVirtualMachineDetails vMware provider specific settings. +type VMwareVirtualMachineDetails struct { + // AgentGeneratedID - The ID generated by the InMage agent after it gets installed on guest. This is the ID to be used during InMage CreateProtection. + AgentGeneratedID *string `json:"agentGeneratedId,omitempty"` + // AgentInstalled - The value indicating if InMage scout agent is installed on guest. + AgentInstalled *string `json:"agentInstalled,omitempty"` + // OsType - The OsType installed on VM. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // IPAddress - The IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // PoweredOn - The value indicating whether VM is powered on. + PoweredOn *string `json:"poweredOn,omitempty"` + // VCenterInfrastructureID - The VCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. Value can be vCenter or physical. + DiscoveryType *string `json:"discoveryType,omitempty"` + // DiskDetails - The disk details. + DiskDetails *[]InMageDiskDetails `json:"diskDetails,omitempty"` + // ValidationErrors - The validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) MarshalJSON() ([]byte, error) { + vmvmd.InstanceType = InstanceTypeVMwareVirtualMachine + objectMap := make(map[string]interface{}) + if vmvmd.AgentGeneratedID != nil { + objectMap["agentGeneratedId"] = vmvmd.AgentGeneratedID + } + if vmvmd.AgentInstalled != nil { + objectMap["agentInstalled"] = vmvmd.AgentInstalled + } + if vmvmd.OsType != nil { + objectMap["osType"] = vmvmd.OsType + } + if vmvmd.AgentVersion != nil { + objectMap["agentVersion"] = vmvmd.AgentVersion + } + if vmvmd.IPAddress != nil { + objectMap["ipAddress"] = vmvmd.IPAddress + } + if vmvmd.PoweredOn != nil { + objectMap["poweredOn"] = vmvmd.PoweredOn + } + if vmvmd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = vmvmd.VCenterInfrastructureID + } + if vmvmd.DiscoveryType != nil { + objectMap["discoveryType"] = vmvmd.DiscoveryType + } + if vmvmd.DiskDetails != nil { + objectMap["diskDetails"] = vmvmd.DiskDetails + } + if vmvmd.ValidationErrors != nil { + objectMap["validationErrors"] = vmvmd.ValidationErrors + } + if vmvmd.InstanceType != "" { + objectMap["instanceType"] = vmvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return &vmvmd, true +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &vmvmd, true +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/operations.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/operations.go new file mode 100644 index 000000000000..90401cff1d0e --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/operations.go @@ -0,0 +1,145 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the client for the Operations methods of the Siterecovery service. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string, resourceGroupName string, resourceName string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// List operation to return the list of available operations. +func (client OperationsClient) List(ctx context.Context) (result OperationsDiscoveryCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.odc.Response.Response != nil { + sc = result.odc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.odc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.odc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", resp, "Failure responding to request") + return + } + if result.odc.hasNextLink() && result.odc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/operations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationsDiscoveryCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationsDiscoveryCollection) (result OperationsDiscoveryCollection, err error) { + req, err := lastResults.operationsDiscoveryCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationsDiscoveryCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/recoverypoints.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/recoverypoints.go new file mode 100644 index 000000000000..74070cab231f --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/recoverypoints.go @@ -0,0 +1,235 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RecoveryPointsClient is the client for the RecoveryPoints methods of the Siterecovery service. +type RecoveryPointsClient struct { + BaseClient +} + +// NewRecoveryPointsClient creates an instance of the RecoveryPointsClient client. +func NewRecoveryPointsClient(subscriptionID string, resourceGroupName string, resourceName string) RecoveryPointsClient { + return NewRecoveryPointsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewRecoveryPointsClientWithBaseURI creates an instance of the RecoveryPointsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewRecoveryPointsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) RecoveryPointsClient { + return RecoveryPointsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get get the details of specified recovery point. +// Parameters: +// fabricName - the fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replication protected item name. +// recoveryPointName - the recovery point name. +func (client RecoveryPointsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (result RecoveryPoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, recoveryPointName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client RecoveryPointsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "recoveryPointName": autorest.Encode("path", recoveryPointName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints/{recoveryPointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RecoveryPointsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RecoveryPointsClient) GetResponder(resp *http.Response) (result RecoveryPoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationProtectedItems lists the available recovery points for a replication protected item. +// Parameters: +// fabricName - the fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replication protected item name. +func (client RecoveryPointsClient) ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result RecoveryPointCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.RPCVar.Response.Response != nil { + sc = result.RPCVar.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectedItemsNextResults + req, err := client.ListByReplicationProtectedItemsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.RPCVar.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", resp, "Failure sending request") + return + } + + result.RPCVar, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", resp, "Failure responding to request") + return + } + if result.RPCVar.hasNextLink() && result.RPCVar.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectedItemsPreparer prepares the ListByReplicationProtectedItems request. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectedItemsSender sends the ListByReplicationProtectedItems request. The method will close the +// http.Response Body if it receives an error. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectedItemsResponder handles the response to the ListByReplicationProtectedItems request. The method always +// closes the http.Response Body. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsResponder(resp *http.Response) (result RecoveryPointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectedItemsNextResults retrieves the next set of results, if any. +func (client RecoveryPointsClient) listByReplicationProtectedItemsNextResults(ctx context.Context, lastResults RecoveryPointCollection) (result RecoveryPointCollection, err error) { + req, err := lastResults.recoveryPointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectedItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result RecoveryPointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectedItems(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationalertsettings.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationalertsettings.go new file mode 100644 index 000000000000..0b1e29df36f2 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationalertsettings.go @@ -0,0 +1,302 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationAlertSettingsClient is the client for the ReplicationAlertSettings methods of the Siterecovery service. +type ReplicationAlertSettingsClient struct { + BaseClient +} + +// NewReplicationAlertSettingsClient creates an instance of the ReplicationAlertSettingsClient client. +func NewReplicationAlertSettingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationAlertSettingsClient { + return NewReplicationAlertSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationAlertSettingsClientWithBaseURI creates an instance of the ReplicationAlertSettingsClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationAlertSettingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationAlertSettingsClient { + return ReplicationAlertSettingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create create or update an email notification(alert) configuration. +// Parameters: +// alertSettingName - the name of the email notification(alert) configuration. +// request - the input to configure the email notification(alert). +func (client ReplicationAlertSettingsClient) Create(ctx context.Context, alertSettingName string, request ConfigureAlertRequest) (result Alert, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, alertSettingName, request) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationAlertSettingsClient) CreatePreparer(ctx context.Context, alertSettingName string, request ConfigureAlertRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertSettingName": autorest.Encode("path", alertSettingName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) CreateResponder(resp *http.Response) (result Alert, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of the specified email notification(alert) configuration. +// Parameters: +// alertSettingName - the name of the email notification configuration. +func (client ReplicationAlertSettingsClient) Get(ctx context.Context, alertSettingName string) (result Alert, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, alertSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationAlertSettingsClient) GetPreparer(ctx context.Context, alertSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertSettingName": autorest.Encode("path", alertSettingName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) GetResponder(resp *http.Response) (result Alert, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of email notification(alert) configurations for the vault. +func (client ReplicationAlertSettingsClient) List(ctx context.Context) (result AlertCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.List") + defer func() { + sc := -1 + if result.ac.Response.Response != nil { + sc = result.ac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", resp, "Failure sending request") + return + } + + result.ac, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", resp, "Failure responding to request") + return + } + if result.ac.hasNextLink() && result.ac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationAlertSettingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) ListResponder(resp *http.Response) (result AlertCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationAlertSettingsClient) listNextResults(ctx context.Context, lastResults AlertCollection) (result AlertCollection, err error) { + req, err := lastResults.alertCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationAlertSettingsClient) ListComplete(ctx context.Context) (result AlertCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationappliances.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationappliances.go new file mode 100644 index 000000000000..bd49a1066be0 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationappliances.go @@ -0,0 +1,152 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationAppliancesClient is the client for the ReplicationAppliances methods of the Siterecovery service. +type ReplicationAppliancesClient struct { + BaseClient +} + +// NewReplicationAppliancesClient creates an instance of the ReplicationAppliancesClient client. +func NewReplicationAppliancesClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationAppliancesClient { + return NewReplicationAppliancesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationAppliancesClientWithBaseURI creates an instance of the ReplicationAppliancesClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewReplicationAppliancesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationAppliancesClient { + return ReplicationAppliancesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// List gets the list of Azure Site Recovery appliances for the vault. +// Parameters: +// filter - oData filter options. +func (client ReplicationAppliancesClient) List(ctx context.Context, filter string) (result ApplianceCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAppliancesClient.List") + defer func() { + sc := -1 + if result.ac.Response.Response != nil { + sc = result.ac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "List", resp, "Failure sending request") + return + } + + result.ac, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "List", resp, "Failure responding to request") + return + } + if result.ac.hasNextLink() && result.ac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationAppliancesClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAppliances", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAppliancesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationAppliancesClient) ListResponder(resp *http.Response) (result ApplianceCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationAppliancesClient) listNextResults(ctx context.Context, lastResults ApplianceCollection) (result ApplianceCollection, err error) { + req, err := lastResults.applianceCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationAppliancesClient) ListComplete(ctx context.Context, filter string) (result ApplianceCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAppliancesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationeligibilityresults.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationeligibilityresults.go new file mode 100644 index 000000000000..71649ae50a00 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationeligibilityresults.go @@ -0,0 +1,183 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationEligibilityResultsClient is the client for the ReplicationEligibilityResults methods of the Siterecovery +// service. +type ReplicationEligibilityResultsClient struct { + BaseClient +} + +// NewReplicationEligibilityResultsClient creates an instance of the ReplicationEligibilityResultsClient client. +func NewReplicationEligibilityResultsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationEligibilityResultsClient { + return NewReplicationEligibilityResultsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationEligibilityResultsClientWithBaseURI creates an instance of the ReplicationEligibilityResultsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationEligibilityResultsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationEligibilityResultsClient { + return ReplicationEligibilityResultsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get validates whether a given VM can be protected or not in which case returns list of errors. +// Parameters: +// virtualMachineName - virtual Machine name. +func (client ReplicationEligibilityResultsClient) Get(ctx context.Context, virtualMachineName string) (result ReplicationEligibilityResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEligibilityResultsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, virtualMachineName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationEligibilityResultsClient) GetPreparer(ctx context.Context, virtualMachineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineName": autorest.Encode("path", virtualMachineName), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEligibilityResultsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationEligibilityResultsClient) GetResponder(resp *http.Response) (result ReplicationEligibilityResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List validates whether a given VM can be protected or not in which case returns list of errors. +// Parameters: +// virtualMachineName - virtual Machine name. +func (client ReplicationEligibilityResultsClient) List(ctx context.Context, virtualMachineName string) (result ReplicationEligibilityResultsCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEligibilityResultsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, virtualMachineName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationEligibilityResultsClient) ListPreparer(ctx context.Context, virtualMachineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineName": autorest.Encode("path", virtualMachineName), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEligibilityResultsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationEligibilityResultsClient) ListResponder(resp *http.Response) (result ReplicationEligibilityResultsCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationevents.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationevents.go new file mode 100644 index 000000000000..5c17e9d04bec --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationevents.go @@ -0,0 +1,228 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationEventsClient is the client for the ReplicationEvents methods of the Siterecovery service. +type ReplicationEventsClient struct { + BaseClient +} + +// NewReplicationEventsClient creates an instance of the ReplicationEventsClient client. +func NewReplicationEventsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationEventsClient { + return NewReplicationEventsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationEventsClientWithBaseURI creates an instance of the ReplicationEventsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationEventsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationEventsClient { + return ReplicationEventsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get the operation to get the details of an Azure Site recovery event. +// Parameters: +// eventName - the name of the Azure Site Recovery event. +func (client ReplicationEventsClient) Get(ctx context.Context, eventName string) (result Event, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, eventName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationEventsClient) GetPreparer(ctx context.Context, eventName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "eventName": autorest.Encode("path", eventName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents/{eventName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEventsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationEventsClient) GetResponder(resp *http.Response) (result Event, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of Azure Site Recovery events for the vault. +// Parameters: +// filter - oData filter options. +func (client ReplicationEventsClient) List(ctx context.Context, filter string) (result EventCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.List") + defer func() { + sc := -1 + if result.ec.Response.Response != nil { + sc = result.ec.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ec.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", resp, "Failure sending request") + return + } + + result.ec, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", resp, "Failure responding to request") + return + } + if result.ec.hasNextLink() && result.ec.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationEventsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEventsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationEventsClient) ListResponder(resp *http.Response) (result EventCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationEventsClient) listNextResults(ctx context.Context, lastResults EventCollection) (result EventCollection, err error) { + req, err := lastResults.eventCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationEventsClient) ListComplete(ctx context.Context, filter string) (result EventCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationfabrics.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationfabrics.go new file mode 100644 index 000000000000..fa027372859c --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationfabrics.go @@ -0,0 +1,786 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationFabricsClient is the client for the ReplicationFabrics methods of the Siterecovery service. +type ReplicationFabricsClient struct { + BaseClient +} + +// NewReplicationFabricsClient creates an instance of the ReplicationFabricsClient client. +func NewReplicationFabricsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationFabricsClient { + return NewReplicationFabricsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationFabricsClientWithBaseURI creates an instance of the ReplicationFabricsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationFabricsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationFabricsClient { + return ReplicationFabricsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// CheckConsistency the operation to perform a consistency check on the fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationFabricsClient) CheckConsistency(ctx context.Context, fabricName string) (result ReplicationFabricsCheckConsistencyFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.CheckConsistency") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CheckConsistencyPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "CheckConsistency", nil, "Failure preparing request") + return + } + + result, err = client.CheckConsistencySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "CheckConsistency", result.Response(), "Failure sending request") + return + } + + return +} + +// CheckConsistencyPreparer prepares the CheckConsistency request. +func (client ReplicationFabricsClient) CheckConsistencyPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/checkConsistency", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckConsistencySender sends the CheckConsistency request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) CheckConsistencySender(req *http.Request) (future ReplicationFabricsCheckConsistencyFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CheckConsistencyResponder handles the response to the CheckConsistency request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) CheckConsistencyResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Create the operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). +// Parameters: +// fabricName - name of the ASR fabric. +// input - fabric creation input. +func (client ReplicationFabricsClient) Create(ctx context.Context, fabricName string, input FabricCreationInput) (result ReplicationFabricsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationFabricsClient) CreatePreparer(ctx context.Context, fabricName string, input FabricCreationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) CreateSender(req *http.Request) (future ReplicationFabricsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) CreateResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete or remove an Azure Site Recovery fabric. +// Parameters: +// fabricName - ASR fabric to delete. +func (client ReplicationFabricsClient) Delete(ctx context.Context, fabricName string) (result ReplicationFabricsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationFabricsClient) DeletePreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) DeleteSender(req *http.Request) (future ReplicationFabricsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of an Azure Site Recovery fabric. +// Parameters: +// fabricName - fabric name. +// filter - oData filter options. +func (client ReplicationFabricsClient) Get(ctx context.Context, fabricName string, filter string) (result Fabric, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationFabricsClient) GetPreparer(ctx context.Context, fabricName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) GetResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of the Azure Site Recovery fabrics in the vault. +func (client ReplicationFabricsClient) List(ctx context.Context) (result FabricCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.List") + defer func() { + sc := -1 + if result.fc.Response.Response != nil { + sc = result.fc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.fc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", resp, "Failure sending request") + return + } + + result.fc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", resp, "Failure responding to request") + return + } + if result.fc.hasNextLink() && result.fc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationFabricsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) ListResponder(resp *http.Response) (result FabricCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationFabricsClient) listNextResults(ctx context.Context, lastResults FabricCollection) (result FabricCollection, err error) { + req, err := lastResults.fabricCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationFabricsClient) ListComplete(ctx context.Context) (result FabricCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// MigrateToAad the operation to migrate an Azure Site Recovery fabric to AAD. +// Parameters: +// fabricName - ASR fabric to migrate. +func (client ReplicationFabricsClient) MigrateToAad(ctx context.Context, fabricName string) (result ReplicationFabricsMigrateToAadFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.MigrateToAad") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.MigrateToAadPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "MigrateToAad", nil, "Failure preparing request") + return + } + + result, err = client.MigrateToAadSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "MigrateToAad", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateToAadPreparer prepares the MigrateToAad request. +func (client ReplicationFabricsClient) MigrateToAadPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/migratetoaad", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateToAadSender sends the MigrateToAad request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) MigrateToAadSender(req *http.Request) (future ReplicationFabricsMigrateToAadFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateToAadResponder handles the response to the MigrateToAad request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) MigrateToAadResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Purge the operation to purge(force delete) an Azure Site Recovery fabric. +// Parameters: +// fabricName - ASR fabric to purge. +func (client ReplicationFabricsClient) Purge(ctx context.Context, fabricName string) (result ReplicationFabricsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationFabricsClient) PurgePreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) PurgeSender(req *http.Request) (future ReplicationFabricsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// ReassociateGateway the operation to move replications from a process server to another process server. +// Parameters: +// fabricName - the name of the fabric containing the process server. +// failoverProcessServerRequest - the input to the failover process server operation. +func (client ReplicationFabricsClient) ReassociateGateway(ctx context.Context, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest) (result ReplicationFabricsReassociateGatewayFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.ReassociateGateway") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReassociateGatewayPreparer(ctx, fabricName, failoverProcessServerRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "ReassociateGateway", nil, "Failure preparing request") + return + } + + result, err = client.ReassociateGatewaySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "ReassociateGateway", result.Response(), "Failure sending request") + return + } + + return +} + +// ReassociateGatewayPreparer prepares the ReassociateGateway request. +func (client ReplicationFabricsClient) ReassociateGatewayPreparer(ctx context.Context, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/reassociateGateway", pathParameters), + autorest.WithJSON(failoverProcessServerRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReassociateGatewaySender sends the ReassociateGateway request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) ReassociateGatewaySender(req *http.Request) (future ReplicationFabricsReassociateGatewayFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReassociateGatewayResponder handles the response to the ReassociateGateway request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) ReassociateGatewayResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RenewCertificate renews the connection certificate for the ASR replication fabric. +// Parameters: +// fabricName - fabric name to renew certs for. +// renewCertificate - renew certificate input. +func (client ReplicationFabricsClient) RenewCertificate(ctx context.Context, fabricName string, renewCertificate RenewCertificateInput) (result ReplicationFabricsRenewCertificateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.RenewCertificate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RenewCertificatePreparer(ctx, fabricName, renewCertificate) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "RenewCertificate", nil, "Failure preparing request") + return + } + + result, err = client.RenewCertificateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "RenewCertificate", result.Response(), "Failure sending request") + return + } + + return +} + +// RenewCertificatePreparer prepares the RenewCertificate request. +func (client ReplicationFabricsClient) RenewCertificatePreparer(ctx context.Context, fabricName string, renewCertificate RenewCertificateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/renewCertificate", pathParameters), + autorest.WithJSON(renewCertificate), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RenewCertificateSender sends the RenewCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) RenewCertificateSender(req *http.Request) (future ReplicationFabricsRenewCertificateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RenewCertificateResponder handles the response to the RenewCertificate request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) RenewCertificateResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationjobs.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationjobs.go new file mode 100644 index 000000000000..1c32961fa10e --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationjobs.go @@ -0,0 +1,547 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationJobsClient is the client for the ReplicationJobs methods of the Siterecovery service. +type ReplicationJobsClient struct { + BaseClient +} + +// NewReplicationJobsClient creates an instance of the ReplicationJobsClient client. +func NewReplicationJobsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationJobsClient { + return NewReplicationJobsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationJobsClientWithBaseURI creates an instance of the ReplicationJobsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationJobsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationJobsClient { + return ReplicationJobsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Cancel the operation to cancel an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Cancel(ctx context.Context, jobName string) (result ReplicationJobsCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Cancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CancelPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Cancel", nil, "Failure preparing request") + return + } + + result, err = client.CancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Cancel", result.Response(), "Failure sending request") + return + } + + return +} + +// CancelPreparer prepares the Cancel request. +func (client ReplicationJobsClient) CancelPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/cancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CancelSender sends the Cancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) CancelSender(req *http.Request) (future ReplicationJobsCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CancelResponder handles the response to the Cancel request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) CancelResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Export the operation to export the details of the Azure Site Recovery jobs of the vault. +// Parameters: +// jobQueryParameter - job query filter. +func (client ReplicationJobsClient) Export(ctx context.Context, jobQueryParameter JobQueryParameter) (result ReplicationJobsExportFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Export") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ExportPreparer(ctx, jobQueryParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Export", nil, "Failure preparing request") + return + } + + result, err = client.ExportSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Export", result.Response(), "Failure sending request") + return + } + + return +} + +// ExportPreparer prepares the Export request. +func (client ReplicationJobsClient) ExportPreparer(ctx context.Context, jobQueryParameter JobQueryParameter) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/export", pathParameters), + autorest.WithJSON(jobQueryParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExportSender sends the Export request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ExportSender(req *http.Request) (future ReplicationJobsExportFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ExportResponder handles the response to the Export request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ExportResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get the details of an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Get(ctx context.Context, jobName string) (result Job, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationJobsClient) GetPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) GetResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of Azure Site Recovery Jobs for the vault. +// Parameters: +// filter - oData filter options. +func (client ReplicationJobsClient) List(ctx context.Context, filter string) (result JobCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.List") + defer func() { + sc := -1 + if result.jc.Response.Response != nil { + sc = result.jc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.jc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", resp, "Failure sending request") + return + } + + result.jc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", resp, "Failure responding to request") + return + } + if result.jc.hasNextLink() && result.jc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationJobsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ListResponder(resp *http.Response) (result JobCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationJobsClient) listNextResults(ctx context.Context, lastResults JobCollection) (result JobCollection, err error) { + req, err := lastResults.jobCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationJobsClient) ListComplete(ctx context.Context, filter string) (result JobCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} + +// Restart the operation to restart an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Restart(ctx context.Context, jobName string) (result ReplicationJobsRestartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Restart") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RestartPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Restart", nil, "Failure preparing request") + return + } + + result, err = client.RestartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Restart", result.Response(), "Failure sending request") + return + } + + return +} + +// RestartPreparer prepares the Restart request. +func (client ReplicationJobsClient) RestartPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartSender sends the Restart request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) RestartSender(req *http.Request) (future ReplicationJobsRestartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestartResponder handles the response to the Restart request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) RestartResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Resume the operation to resume an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +// resumeJobParams - resume rob comments. +func (client ReplicationJobsClient) Resume(ctx context.Context, jobName string, resumeJobParams ResumeJobParams) (result ReplicationJobsResumeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Resume") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResumePreparer(ctx, jobName, resumeJobParams) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Resume", nil, "Failure preparing request") + return + } + + result, err = client.ResumeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Resume", result.Response(), "Failure sending request") + return + } + + return +} + +// ResumePreparer prepares the Resume request. +func (client ReplicationJobsClient) ResumePreparer(ctx context.Context, jobName string, resumeJobParams ResumeJobParams) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/resume", pathParameters), + autorest.WithJSON(resumeJobParams), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResumeSender sends the Resume request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ResumeSender(req *http.Request) (future ReplicationJobsResumeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResumeResponder handles the response to the Resume request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ResumeResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationlogicalnetworks.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationlogicalnetworks.go new file mode 100644 index 000000000000..71b506405b6a --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationlogicalnetworks.go @@ -0,0 +1,229 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationLogicalNetworksClient is the client for the ReplicationLogicalNetworks methods of the Siterecovery +// service. +type ReplicationLogicalNetworksClient struct { + BaseClient +} + +// NewReplicationLogicalNetworksClient creates an instance of the ReplicationLogicalNetworksClient client. +func NewReplicationLogicalNetworksClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationLogicalNetworksClient { + return NewReplicationLogicalNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationLogicalNetworksClientWithBaseURI creates an instance of the ReplicationLogicalNetworksClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationLogicalNetworksClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationLogicalNetworksClient { + return ReplicationLogicalNetworksClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of a logical network. +// Parameters: +// fabricName - server Id. +// logicalNetworkName - logical network name. +func (client ReplicationLogicalNetworksClient) Get(ctx context.Context, fabricName string, logicalNetworkName string) (result LogicalNetwork, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, logicalNetworkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationLogicalNetworksClient) GetPreparer(ctx context.Context, fabricName string, logicalNetworkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "logicalNetworkName": autorest.Encode("path", logicalNetworkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks/{logicalNetworkName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationLogicalNetworksClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationLogicalNetworksClient) GetResponder(resp *http.Response) (result LogicalNetwork, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationFabrics lists all the logical networks of the Azure Site Recovery fabric. +// Parameters: +// fabricName - server Id. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result LogicalNetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.lnc.Response.Response != nil { + sc = result.lnc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.lnc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.lnc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.lnc.hasNextLink() && result.lnc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsResponder(resp *http.Response) (result LogicalNetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationLogicalNetworksClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults LogicalNetworkCollection) (result LogicalNetworkCollection, err error) { + req, err := lastResults.logicalNetworkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result LogicalNetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationmigrationitems.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationmigrationitems.go new file mode 100644 index 000000000000..6db5026fdc5e --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationmigrationitems.go @@ -0,0 +1,1009 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationMigrationItemsClient is the client for the ReplicationMigrationItems methods of the Siterecovery service. +type ReplicationMigrationItemsClient struct { + BaseClient +} + +// NewReplicationMigrationItemsClient creates an instance of the ReplicationMigrationItemsClient client. +func NewReplicationMigrationItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationMigrationItemsClient { + return NewReplicationMigrationItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationMigrationItemsClientWithBaseURI creates an instance of the ReplicationMigrationItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationMigrationItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationMigrationItemsClient { + return ReplicationMigrationItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR migration item (enable migration). +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - enable migration input. +func (client ReplicationMigrationItemsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input EnableMigrationInput) (result ReplicationMigrationItemsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.PolicyID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationMigrationItemsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input EnableMigrationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) CreateSender(req *http.Request) (future ReplicationMigrationItemsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) CreateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// deleteOption - the delete option. +func (client ReplicationMigrationItemsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (result ReplicationMigrationItemsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, migrationItemName, deleteOption) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationMigrationItemsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(deleteOption) > 0 { + queryParameters["deleteOption"] = autorest.Encode("query", deleteOption) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) DeleteSender(req *http.Request) (future ReplicationMigrationItemsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get sends the get request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +func (client ReplicationMigrationItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, migrationItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationMigrationItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) GetResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List sends the list request. +// Parameters: +// skipToken - the pagination token. +// takeToken - the page size. +// filter - oData filter options. +func (client ReplicationMigrationItemsClient) List(ctx context.Context, skipToken string, takeToken string, filter string) (result MigrationItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.List") + defer func() { + sc := -1 + if result.mic.Response.Response != nil { + sc = result.mic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, takeToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.mic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", resp, "Failure sending request") + return + } + + result.mic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", resp, "Failure responding to request") + return + } + if result.mic.hasNextLink() && result.mic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationMigrationItemsClient) ListPreparer(ctx context.Context, skipToken string, takeToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationMigrationItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ListResponder(resp *http.Response) (result MigrationItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationMigrationItemsClient) listNextResults(ctx context.Context, lastResults MigrationItemCollection) (result MigrationItemCollection, err error) { + req, err := lastResults.migrationItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationMigrationItemsClient) ListComplete(ctx context.Context, skipToken string, takeToken string, filter string) (result MigrationItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, takeToken, filter) + return +} + +// ListByReplicationProtectionContainers gets the list of ASR migration items in the protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// skipToken - the pagination token. +// takeToken - the page size. +// filter - oData filter options. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result MigrationItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.mic.Response.Response != nil { + sc = result.mic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName, skipToken, takeToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.mic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.mic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.mic.hasNextLink() && result.mic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result MigrationItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationMigrationItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults MigrationItemCollection) (result MigrationItemCollection, err error) { + req, err := lastResults.migrationItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result MigrationItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName, skipToken, takeToken, filter) + return +} + +// Migrate the operation to initiate migration of the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// migrateInput - migrate input. +func (client ReplicationMigrationItemsClient) Migrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput MigrateInput) (result ReplicationMigrationItemsMigrateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Migrate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: migrateInput, + Constraints: []validation.Constraint{{Target: "migrateInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Migrate", err.Error()) + } + + req, err := client.MigratePreparer(ctx, fabricName, protectionContainerName, migrationItemName, migrateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Migrate", nil, "Failure preparing request") + return + } + + result, err = client.MigrateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Migrate", result.Response(), "Failure sending request") + return + } + + return +} + +// MigratePreparer prepares the Migrate request. +func (client ReplicationMigrationItemsClient) MigratePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput MigrateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrate", pathParameters), + autorest.WithJSON(migrateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateSender sends the Migrate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) MigrateSender(req *http.Request) (future ReplicationMigrationItemsMigrateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateResponder handles the response to the Migrate request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) MigrateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Resync the operation to resynchronize replication of an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - resync input. +func (client ReplicationMigrationItemsClient) Resync(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input ResyncInput) (result ReplicationMigrationItemsResyncFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Resync") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Resync", err.Error()) + } + + req, err := client.ResyncPreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Resync", nil, "Failure preparing request") + return + } + + result, err = client.ResyncSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Resync", result.Response(), "Failure sending request") + return + } + + return +} + +// ResyncPreparer prepares the Resync request. +func (client ReplicationMigrationItemsClient) ResyncPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input ResyncInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/resync", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResyncSender sends the Resync request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ResyncSender(req *http.Request) (future ReplicationMigrationItemsResyncFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResyncResponder handles the response to the Resync request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ResyncResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestMigrate the operation to initiate test migration of the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// testMigrateInput - test migrate input. +func (client ReplicationMigrationItemsClient) TestMigrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput TestMigrateInput) (result ReplicationMigrationItemsTestMigrateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.TestMigrate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testMigrateInput, + Constraints: []validation.Constraint{{Target: "testMigrateInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "TestMigrate", err.Error()) + } + + req, err := client.TestMigratePreparer(ctx, fabricName, protectionContainerName, migrationItemName, testMigrateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrate", nil, "Failure preparing request") + return + } + + result, err = client.TestMigrateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrate", result.Response(), "Failure sending request") + return + } + + return +} + +// TestMigratePreparer prepares the TestMigrate request. +func (client ReplicationMigrationItemsClient) TestMigratePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput TestMigrateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrate", pathParameters), + autorest.WithJSON(testMigrateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestMigrateSender sends the TestMigrate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) TestMigrateSender(req *http.Request) (future ReplicationMigrationItemsTestMigrateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestMigrateResponder handles the response to the TestMigrate request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) TestMigrateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestMigrateCleanup the operation to initiate test migrate cleanup. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// testMigrateCleanupInput - test migrate cleanup input. +func (client ReplicationMigrationItemsClient) TestMigrateCleanup(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput TestMigrateCleanupInput) (result ReplicationMigrationItemsTestMigrateCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.TestMigrateCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testMigrateCleanupInput, + Constraints: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", err.Error()) + } + + req, err := client.TestMigrateCleanupPreparer(ctx, fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestMigrateCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestMigrateCleanupPreparer prepares the TestMigrateCleanup request. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput TestMigrateCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrateCleanup", pathParameters), + autorest.WithJSON(testMigrateCleanupInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestMigrateCleanupSender sends the TestMigrateCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupSender(req *http.Request) (future ReplicationMigrationItemsTestMigrateCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestMigrateCleanupResponder handles the response to the TestMigrateCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update the recovery settings of an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - update migration item input. +func (client ReplicationMigrationItemsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input UpdateMigrationItemInput) (result ReplicationMigrationItemsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationMigrationItemsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input UpdateMigrationItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) UpdateSender(req *http.Request) (future ReplicationMigrationItemsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) UpdateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationnetworkmappings.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationnetworkmappings.go new file mode 100644 index 000000000000..ba97ef3d22e1 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationnetworkmappings.go @@ -0,0 +1,610 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationNetworkMappingsClient is the client for the ReplicationNetworkMappings methods of the Siterecovery +// service. +type ReplicationNetworkMappingsClient struct { + BaseClient +} + +// NewReplicationNetworkMappingsClient creates an instance of the ReplicationNetworkMappingsClient client. +func NewReplicationNetworkMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworkMappingsClient { + return NewReplicationNetworkMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationNetworkMappingsClientWithBaseURI creates an instance of the ReplicationNetworkMappingsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationNetworkMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworkMappingsClient { + return ReplicationNetworkMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +// input - create network mapping input. +func (client ReplicationNetworkMappingsClient) Create(ctx context.Context, fabricName string, networkName string, networkMappingName string, input CreateNetworkMappingInput) (result ReplicationNetworkMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.RecoveryNetworkID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationNetworkMappingsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, networkName, networkMappingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationNetworkMappingsClient) CreatePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string, input CreateNetworkMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) CreateSender(req *http.Request) (future ReplicationNetworkMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) CreateResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - ARM Resource Name for network mapping. +func (client ReplicationNetworkMappingsClient) Delete(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result ReplicationNetworkMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, networkName, networkMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationNetworkMappingsClient) DeletePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) DeleteSender(req *http.Request) (future ReplicationNetworkMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +func (client ReplicationNetworkMappingsClient) Get(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result NetworkMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, networkName, networkMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationNetworkMappingsClient) GetPreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) GetResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all ASR network mappings in the vault. +func (client ReplicationNetworkMappingsClient) List(ctx context.Context) (result NetworkMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.List") + defer func() { + sc := -1 + if result.nmc.Response.Response != nil { + sc = result.nmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.nmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", resp, "Failure sending request") + return + } + + result.nmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.nmc.hasNextLink() && result.nmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationNetworkMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationNetworkMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) ListResponder(resp *http.Response) (result NetworkMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationNetworkMappingsClient) listNextResults(ctx context.Context, lastResults NetworkMappingCollection) (result NetworkMappingCollection, err error) { + req, err := lastResults.networkMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworkMappingsClient) ListComplete(ctx context.Context) (result NetworkMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationNetworks lists all ASR network mappings for the specified network. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworks(ctx context.Context, fabricName string, networkName string) (result NetworkMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.ListByReplicationNetworks") + defer func() { + sc := -1 + if result.nmc.Response.Response != nil { + sc = result.nmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationNetworksNextResults + req, err := client.ListByReplicationNetworksPreparer(ctx, fabricName, networkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationNetworksSender(req) + if err != nil { + result.nmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", resp, "Failure sending request") + return + } + + result.nmc, err = client.ListByReplicationNetworksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", resp, "Failure responding to request") + return + } + if result.nmc.hasNextLink() && result.nmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationNetworksPreparer prepares the ListByReplicationNetworks request. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksPreparer(ctx context.Context, fabricName string, networkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationNetworksSender sends the ListByReplicationNetworks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationNetworksResponder handles the response to the ListByReplicationNetworks request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksResponder(resp *http.Response) (result NetworkMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationNetworksNextResults retrieves the next set of results, if any. +func (client ReplicationNetworkMappingsClient) listByReplicationNetworksNextResults(ctx context.Context, lastResults NetworkMappingCollection) (result NetworkMappingCollection, err error) { + req, err := lastResults.networkMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationNetworksSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationNetworksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationNetworksComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksComplete(ctx context.Context, fabricName string, networkName string) (result NetworkMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.ListByReplicationNetworks") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationNetworks(ctx, fabricName, networkName) + return +} + +// Update the operation to update an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +// input - update network mapping input. +func (client ReplicationNetworkMappingsClient) Update(ctx context.Context, fabricName string, networkName string, networkMappingName string, input UpdateNetworkMappingInput) (result ReplicationNetworkMappingsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, networkName, networkMappingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationNetworkMappingsClient) UpdatePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string, input UpdateNetworkMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) UpdateSender(req *http.Request) (future ReplicationNetworkMappingsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) UpdateResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationnetworks.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationnetworks.go new file mode 100644 index 000000000000..368823296b1f --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationnetworks.go @@ -0,0 +1,343 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationNetworksClient is the client for the ReplicationNetworks methods of the Siterecovery service. +type ReplicationNetworksClient struct { + BaseClient +} + +// NewReplicationNetworksClient creates an instance of the ReplicationNetworksClient client. +func NewReplicationNetworksClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworksClient { + return NewReplicationNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationNetworksClientWithBaseURI creates an instance of the ReplicationNetworksClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationNetworksClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworksClient { + return ReplicationNetworksClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of a network. +// Parameters: +// fabricName - server Id. +// networkName - primary network name. +func (client ReplicationNetworksClient) Get(ctx context.Context, fabricName string, networkName string) (result Network, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, networkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationNetworksClient) GetPreparer(ctx context.Context, fabricName string, networkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) GetResponder(resp *http.Response) (result Network, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the networks available in a vault. +func (client ReplicationNetworksClient) List(ctx context.Context) (result NetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.List") + defer func() { + sc := -1 + if result.nc.Response.Response != nil { + sc = result.nc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.nc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", resp, "Failure sending request") + return + } + + result.nc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", resp, "Failure responding to request") + return + } + if result.nc.hasNextLink() && result.nc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationNetworksClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) ListResponder(resp *http.Response) (result NetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationNetworksClient) listNextResults(ctx context.Context, lastResults NetworkCollection) (result NetworkCollection, err error) { + req, err := lastResults.networkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworksClient) ListComplete(ctx context.Context) (result NetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the networks available for a fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationNetworksClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result NetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.nc.Response.Response != nil { + sc = result.nc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.nc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.nc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.nc.hasNextLink() && result.nc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationNetworksClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) ListByReplicationFabricsResponder(resp *http.Response) (result NetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationNetworksClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults NetworkCollection) (result NetworkCollection, err error) { + req, err := lastResults.networkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworksClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result NetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationpolicies.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationpolicies.go new file mode 100644 index 000000000000..3e9de0d7515a --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationpolicies.go @@ -0,0 +1,465 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationPoliciesClient is the client for the ReplicationPolicies methods of the Siterecovery service. +type ReplicationPoliciesClient struct { + BaseClient +} + +// NewReplicationPoliciesClient creates an instance of the ReplicationPoliciesClient client. +func NewReplicationPoliciesClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationPoliciesClient { + return NewReplicationPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationPoliciesClientWithBaseURI creates an instance of the ReplicationPoliciesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationPoliciesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationPoliciesClient { + return ReplicationPoliciesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a replication policy. +// Parameters: +// policyName - replication policy name. +// input - create policy input. +func (client ReplicationPoliciesClient) Create(ctx context.Context, policyName string, input CreatePolicyInput) (result ReplicationPoliciesCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, policyName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationPoliciesClient) CreatePreparer(ctx context.Context, policyName string, input CreatePolicyInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) CreateSender(req *http.Request) (future ReplicationPoliciesCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) CreateResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a replication policy. +// Parameters: +// policyName - replication policy name. +func (client ReplicationPoliciesClient) Delete(ctx context.Context, policyName string) (result ReplicationPoliciesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationPoliciesClient) DeletePreparer(ctx context.Context, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) DeleteSender(req *http.Request) (future ReplicationPoliciesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a replication policy. +// Parameters: +// policyName - replication policy name. +func (client ReplicationPoliciesClient) Get(ctx context.Context, policyName string) (result Policy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationPoliciesClient) GetPreparer(ctx context.Context, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) GetResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the replication policies for a vault. +func (client ReplicationPoliciesClient) List(ctx context.Context) (result PolicyCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.List") + defer func() { + sc := -1 + if result.pc.Response.Response != nil { + sc = result.pc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", resp, "Failure sending request") + return + } + + result.pc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", resp, "Failure responding to request") + return + } + if result.pc.hasNextLink() && result.pc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationPoliciesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) ListResponder(resp *http.Response) (result PolicyCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationPoliciesClient) listNextResults(ctx context.Context, lastResults PolicyCollection) (result PolicyCollection, err error) { + req, err := lastResults.policyCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationPoliciesClient) ListComplete(ctx context.Context) (result PolicyCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// Update the operation to update a replication policy. +// Parameters: +// policyName - policy Id. +// input - update Policy Input. +func (client ReplicationPoliciesClient) Update(ctx context.Context, policyName string, input UpdatePolicyInput) (result ReplicationPoliciesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, policyName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationPoliciesClient) UpdatePreparer(ctx context.Context, policyName string, input UpdatePolicyInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) UpdateSender(req *http.Request) (future ReplicationPoliciesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) UpdateResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationprotectableitems.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationprotectableitems.go new file mode 100644 index 000000000000..af0af063f9c0 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationprotectableitems.go @@ -0,0 +1,245 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectableItemsClient is the client for the ReplicationProtectableItems methods of the Siterecovery +// service. +type ReplicationProtectableItemsClient struct { + BaseClient +} + +// NewReplicationProtectableItemsClient creates an instance of the ReplicationProtectableItemsClient client. +func NewReplicationProtectableItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectableItemsClient { + return NewReplicationProtectableItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectableItemsClientWithBaseURI creates an instance of the ReplicationProtectableItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationProtectableItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectableItemsClient { + return ReplicationProtectableItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get the operation to get the details of a protectable item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// protectableItemName - protectable item name. +func (client ReplicationProtectableItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (result ProtectableItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, protectableItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectableItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectableItemName": autorest.Encode("path", protectableItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems/{protectableItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectableItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectableItemsClient) GetResponder(resp *http.Response) (result ProtectableItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationProtectionContainers lists the protectable items in a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// filter - oData filter options. +// take - take OData query parameter. +// skipToken - skipToken OData query parameter. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result ProtectableItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.pic.Response.Response != nil { + sc = result.pic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName, filter, take, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.pic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.pic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.pic.hasNextLink() && result.pic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(take) > 0 { + queryParameters["$take"] = autorest.Encode("query", take) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ProtectableItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectableItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ProtectableItemCollection) (result ProtectableItemCollection, err error) { + req, err := lastResults.protectableItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result ProtectableItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName, filter, take, skipToken) + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationprotecteditems.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationprotecteditems.go new file mode 100644 index 000000000000..a4f1909856c4 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationprotecteditems.go @@ -0,0 +1,2021 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectedItemsClient is the client for the ReplicationProtectedItems methods of the Siterecovery service. +type ReplicationProtectedItemsClient struct { + BaseClient +} + +// NewReplicationProtectedItemsClient creates an instance of the ReplicationProtectedItemsClient client. +func NewReplicationProtectedItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectedItemsClient { + return NewReplicationProtectedItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectedItemsClientWithBaseURI creates an instance of the ReplicationProtectedItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationProtectedItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectedItemsClient { + return ReplicationProtectedItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// AddDisks operation to add disks(s) to the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// addDisksInput - add disks input. +func (client ReplicationProtectedItemsClient) AddDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput AddDisksInput) (result ReplicationProtectedItemsAddDisksFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.AddDisks") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddDisksPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, addDisksInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "AddDisks", nil, "Failure preparing request") + return + } + + result, err = client.AddDisksSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "AddDisks", result.Response(), "Failure sending request") + return + } + + return +} + +// AddDisksPreparer prepares the AddDisks request. +func (client ReplicationProtectedItemsClient) AddDisksPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput AddDisksInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/addDisks", pathParameters), + autorest.WithJSON(addDisksInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddDisksSender sends the AddDisks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) AddDisksSender(req *http.Request) (future ReplicationProtectedItemsAddDisksFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// AddDisksResponder handles the response to the AddDisks request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) AddDisksResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ApplyRecoveryPoint the operation to change the recovery point of a failed over replication protected item. +// Parameters: +// fabricName - the ARM fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replicated protected item name. +// applyRecoveryPointInput - the ApplyRecoveryPointInput. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPoint(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput ApplyRecoveryPointInput) (result ReplicationProtectedItemsApplyRecoveryPointFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ApplyRecoveryPoint") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: applyRecoveryPointInput, + Constraints: []validation.Constraint{{Target: "applyRecoveryPointInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", err.Error()) + } + + req, err := client.ApplyRecoveryPointPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, applyRecoveryPointInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", nil, "Failure preparing request") + return + } + + result, err = client.ApplyRecoveryPointSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", result.Response(), "Failure sending request") + return + } + + return +} + +// ApplyRecoveryPointPreparer prepares the ApplyRecoveryPoint request. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput ApplyRecoveryPointInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/applyRecoveryPoint", pathParameters), + autorest.WithJSON(applyRecoveryPointInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ApplyRecoveryPointSender sends the ApplyRecoveryPoint request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointSender(req *http.Request) (future ReplicationProtectedItemsApplyRecoveryPointFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ApplyRecoveryPointResponder handles the response to the ApplyRecoveryPoint request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Create the operation to create an ASR replication protected item (Enable replication). +// Parameters: +// fabricName - name of the fabric. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - a name for the replication protected item. +// input - enable Protection Input. +func (client ReplicationProtectedItemsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input EnableProtectionInput) (result ReplicationProtectedItemsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectedItemsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input EnableProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) CreateSender(req *http.Request) (future ReplicationProtectedItemsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) CreateResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to disable replication on a replication protected item. This will also remove the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// disableProtectionInput - disable protection input. +func (client ReplicationProtectedItemsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput DisableProtectionInput) (result ReplicationProtectedItemsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: disableProtectionInput, + Constraints: []validation.Constraint{{Target: "disableProtectionInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, disableProtectionInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectedItemsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput DisableProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/remove", pathParameters), + autorest.WithJSON(disableProtectionInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) DeleteSender(req *http.Request) (future ReplicationProtectedItemsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// FailoverCancel operation to cancel the failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) FailoverCancel(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsFailoverCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.FailoverCancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCancelPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCancel", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCancel", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCancelPreparer prepares the FailoverCancel request. +func (client ReplicationProtectedItemsClient) FailoverCancelPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCancelSender sends the FailoverCancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) FailoverCancelSender(req *http.Request) (future ReplicationProtectedItemsFailoverCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCancelResponder handles the response to the FailoverCancel request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) FailoverCancelResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// FailoverCommit operation to commit the failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) FailoverCommit(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsFailoverCommitFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.FailoverCommit") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCommitPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCommit", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCommitSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCommit", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCommitPreparer prepares the FailoverCommit request. +func (client ReplicationProtectedItemsClient) FailoverCommitPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCommit", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCommitSender sends the FailoverCommit request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) FailoverCommitSender(req *http.Request) (future ReplicationProtectedItemsFailoverCommitFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCommitResponder handles the response to the FailoverCommit request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) FailoverCommitResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of an ASR replication protected item. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectedItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) GetResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of ASR replication protected items in the vault. +// Parameters: +// skipToken - the pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. +// filter - oData filter options. +func (client ReplicationProtectedItemsClient) List(ctx context.Context, skipToken string, filter string) (result ReplicationProtectedItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.List") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectedItemsClient) ListPreparer(ctx context.Context, skipToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectedItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ListResponder(resp *http.Response) (result ReplicationProtectedItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectedItemsClient) listNextResults(ctx context.Context, lastResults ReplicationProtectedItemCollection) (result ReplicationProtectedItemCollection, err error) { + req, err := lastResults.replicationProtectedItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectedItemsClient) ListComplete(ctx context.Context, skipToken string, filter string) (result ReplicationProtectedItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, filter) + return +} + +// ListByReplicationProtectionContainers gets the list of ASR replication protected items in the protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectedItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ReplicationProtectedItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectedItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ReplicationProtectedItemCollection) (result ReplicationProtectedItemCollection, err error) { + req, err := lastResults.replicationProtectedItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectedItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName) + return +} + +// PlannedFailover operation to initiate a planned failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// failoverInput - planned failover input. +func (client ReplicationProtectedItemsClient) PlannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput PlannedFailoverInput) (result ReplicationProtectedItemsPlannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.PlannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PlannedFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "PlannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.PlannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "PlannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// PlannedFailoverPreparer prepares the PlannedFailover request. +func (client ReplicationProtectedItemsClient) PlannedFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput PlannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/plannedFailover", pathParameters), + autorest.WithJSON(failoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PlannedFailoverSender sends the PlannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) PlannedFailoverSender(req *http.Request) (future ReplicationProtectedItemsPlannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PlannedFailoverResponder handles the response to the PlannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) PlannedFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Purge the operation to delete or purge a replication protected item. This operation will force delete the +// replication protected item. Use the remove operation on replication protected item to perform a clean disable +// replication for the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) Purge(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationProtectedItemsClient) PurgePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) PurgeSender(req *http.Request) (future ReplicationProtectedItemsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RemoveDisks operation to remove disk(s) from the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// removeDisksInput - remove disks input. +func (client ReplicationProtectedItemsClient) RemoveDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput RemoveDisksInput) (result ReplicationProtectedItemsRemoveDisksFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.RemoveDisks") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RemoveDisksPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, removeDisksInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RemoveDisks", nil, "Failure preparing request") + return + } + + result, err = client.RemoveDisksSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RemoveDisks", result.Response(), "Failure sending request") + return + } + + return +} + +// RemoveDisksPreparer prepares the RemoveDisks request. +func (client ReplicationProtectedItemsClient) RemoveDisksPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput RemoveDisksInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/removeDisks", pathParameters), + autorest.WithJSON(removeDisksInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RemoveDisksSender sends the RemoveDisks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) RemoveDisksSender(req *http.Request) (future ReplicationProtectedItemsRemoveDisksFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RemoveDisksResponder handles the response to the RemoveDisks request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) RemoveDisksResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RepairReplication the operation to start resynchronize/repair replication for a replication protected item requiring +// resynchronization. +// Parameters: +// fabricName - the name of the fabric. +// protectionContainerName - the name of the container. +// replicatedProtectedItemName - the name of the replication protected item. +func (client ReplicationProtectedItemsClient) RepairReplication(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsRepairReplicationFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.RepairReplication") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RepairReplicationPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RepairReplication", nil, "Failure preparing request") + return + } + + result, err = client.RepairReplicationSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RepairReplication", result.Response(), "Failure sending request") + return + } + + return +} + +// RepairReplicationPreparer prepares the RepairReplication request. +func (client ReplicationProtectedItemsClient) RepairReplicationPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/repairReplication", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RepairReplicationSender sends the RepairReplication request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) RepairReplicationSender(req *http.Request) (future ReplicationProtectedItemsRepairReplicationFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RepairReplicationResponder handles the response to the RepairReplication request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) RepairReplicationResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Reprotect operation to reprotect or reverse replicate a failed over replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// reprotectInput - reverse replication input. +func (client ReplicationProtectedItemsClient) Reprotect(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput ReverseReplicationInput) (result ReplicationProtectedItemsReprotectFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Reprotect") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReprotectPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, reprotectInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Reprotect", nil, "Failure preparing request") + return + } + + result, err = client.ReprotectSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Reprotect", result.Response(), "Failure sending request") + return + } + + return +} + +// ReprotectPreparer prepares the Reprotect request. +func (client ReplicationProtectedItemsClient) ReprotectPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput ReverseReplicationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/reProtect", pathParameters), + autorest.WithJSON(reprotectInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReprotectSender sends the Reprotect request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ReprotectSender(req *http.Request) (future ReplicationProtectedItemsReprotectFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReprotectResponder handles the response to the Reprotect request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ReprotectResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ResolveHealthErrors operation to resolve health issues of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// resolveHealthInput - health issue input object. +func (client ReplicationProtectedItemsClient) ResolveHealthErrors(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput ResolveHealthInput) (result ReplicationProtectedItemsResolveHealthErrorsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ResolveHealthErrors") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResolveHealthErrorsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, resolveHealthInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ResolveHealthErrors", nil, "Failure preparing request") + return + } + + result, err = client.ResolveHealthErrorsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ResolveHealthErrors", result.Response(), "Failure sending request") + return + } + + return +} + +// ResolveHealthErrorsPreparer prepares the ResolveHealthErrors request. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput ResolveHealthInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/resolveHealthErrors", pathParameters), + autorest.WithJSON(resolveHealthInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResolveHealthErrorsSender sends the ResolveHealthErrors request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsSender(req *http.Request) (future ReplicationProtectedItemsResolveHealthErrorsFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResolveHealthErrorsResponder handles the response to the ResolveHealthErrors request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SwitchProvider operation to initiate a switch provider of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// switchProviderInput - switch provider input. +func (client ReplicationProtectedItemsClient) SwitchProvider(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, switchProviderInput SwitchProviderInput) (result ReplicationProtectedItemsSwitchProviderFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.SwitchProvider") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.SwitchProviderPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, switchProviderInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "SwitchProvider", nil, "Failure preparing request") + return + } + + result, err = client.SwitchProviderSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "SwitchProvider", result.Response(), "Failure sending request") + return + } + + return +} + +// SwitchProviderPreparer prepares the SwitchProvider request. +func (client ReplicationProtectedItemsClient) SwitchProviderPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, switchProviderInput SwitchProviderInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/switchProvider", pathParameters), + autorest.WithJSON(switchProviderInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SwitchProviderSender sends the SwitchProvider request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) SwitchProviderSender(req *http.Request) (future ReplicationProtectedItemsSwitchProviderFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// SwitchProviderResponder handles the response to the SwitchProvider request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) SwitchProviderResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailover operation to perform a test failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// testfailoverInput - test failover input. +func (client ReplicationProtectedItemsClient) TestFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput TestFailoverInput) (result ReplicationProtectedItemsTestFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.TestFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testfailoverInput, + Constraints: []validation.Constraint{{Target: "testfailoverInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "TestFailover", err.Error()) + } + + req, err := client.TestFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, testfailoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailover", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverPreparer prepares the TestFailover request. +func (client ReplicationProtectedItemsClient) TestFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput TestFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailover", pathParameters), + autorest.WithJSON(testfailoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverSender sends the TestFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) TestFailoverSender(req *http.Request) (future ReplicationProtectedItemsTestFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverResponder handles the response to the TestFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) TestFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailoverCleanup operation to clean up the test failover of a replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// cleanupInput - test failover cleanup input. +func (client ReplicationProtectedItemsClient) TestFailoverCleanup(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput TestFailoverCleanupInput) (result ReplicationProtectedItemsTestFailoverCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.TestFailoverCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: cleanupInput, + Constraints: []validation.Constraint{{Target: "cleanupInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "cleanupInput.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "cleanupInput.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", err.Error()) + } + + req, err := client.TestFailoverCleanupPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, cleanupInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverCleanupPreparer prepares the TestFailoverCleanup request. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput TestFailoverCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailoverCleanup", pathParameters), + autorest.WithJSON(cleanupInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverCleanupSender sends the TestFailoverCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupSender(req *http.Request) (future ReplicationProtectedItemsTestFailoverCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverCleanupResponder handles the response to the TestFailoverCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UnplannedFailover operation to initiate a failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// failoverInput - failover input. +func (client ReplicationProtectedItemsClient) UnplannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput UnplannedFailoverInput) (result ReplicationProtectedItemsUnplannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UnplannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: failoverInput, + Constraints: []validation.Constraint{{Target: "failoverInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", err.Error()) + } + + req, err := client.UnplannedFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.UnplannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// UnplannedFailoverPreparer prepares the UnplannedFailover request. +func (client ReplicationProtectedItemsClient) UnplannedFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput UnplannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/unplannedFailover", pathParameters), + autorest.WithJSON(failoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UnplannedFailoverSender sends the UnplannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UnplannedFailoverSender(req *http.Request) (future ReplicationProtectedItemsUnplannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UnplannedFailoverResponder handles the response to the UnplannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UnplannedFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update the recovery settings of an ASR replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// updateProtectionInput - update protection input. +func (client ReplicationProtectedItemsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput UpdateReplicationProtectedItemInput) (result ReplicationProtectedItemsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, updateProtectionInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationProtectedItemsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput UpdateReplicationProtectedItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithJSON(updateProtectionInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateSender(req *http.Request) (future ReplicationProtectedItemsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateAppliance the operation to update appliance of an ASR replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// applianceUpdateInput - appliance update protection input. +func (client ReplicationProtectedItemsClient) UpdateAppliance(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput UpdateApplianceForReplicationProtectedItemInput) (result ReplicationProtectedItemsUpdateApplianceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UpdateAppliance") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: applianceUpdateInput, + Constraints: []validation.Constraint{{Target: "applianceUpdateInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "applianceUpdateInput.Properties.TargetApplianceID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "UpdateAppliance", err.Error()) + } + + req, err := client.UpdateAppliancePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, applianceUpdateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateAppliance", nil, "Failure preparing request") + return + } + + result, err = client.UpdateApplianceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateAppliance", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateAppliancePreparer prepares the UpdateAppliance request. +func (client ReplicationProtectedItemsClient) UpdateAppliancePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput UpdateApplianceForReplicationProtectedItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/updateAppliance", pathParameters), + autorest.WithJSON(applianceUpdateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateApplianceSender sends the UpdateAppliance request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateApplianceSender(req *http.Request) (future ReplicationProtectedItemsUpdateApplianceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateApplianceResponder handles the response to the UpdateAppliance request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateApplianceResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateMobilityService the operation to update(push update) the installed mobility service software on a replication +// protected item to the latest available version. +// Parameters: +// fabricName - the name of the fabric containing the protected item. +// protectionContainerName - the name of the container containing the protected item. +// replicationProtectedItemName - 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. +func (client ReplicationProtectedItemsClient) UpdateMobilityService(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest UpdateMobilityServiceRequest) (result ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UpdateMobilityService") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateMobilityServicePreparer(ctx, fabricName, protectionContainerName, replicationProtectedItemName, updateMobilityServiceRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateMobilityService", nil, "Failure preparing request") + return + } + + result, err = client.UpdateMobilityServiceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateMobilityService", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateMobilityServicePreparer prepares the UpdateMobilityService request. +func (client ReplicationProtectedItemsClient) UpdateMobilityServicePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest UpdateMobilityServiceRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicationProtectedItemName": autorest.Encode("path", replicationProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicationProtectedItemName}/updateMobilityService", pathParameters), + autorest.WithJSON(updateMobilityServiceRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateMobilityServiceSender sends the UpdateMobilityService request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateMobilityServiceSender(req *http.Request) (future ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateMobilityServiceResponder handles the response to the UpdateMobilityService request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateMobilityServiceResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationprotectioncontainermappings.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationprotectioncontainermappings.go new file mode 100644 index 000000000000..ee867d339339 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationprotectioncontainermappings.go @@ -0,0 +1,688 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionContainerMappingsClient is the client for the ReplicationProtectionContainerMappings methods of +// the Siterecovery service. +type ReplicationProtectionContainerMappingsClient struct { + BaseClient +} + +// NewReplicationProtectionContainerMappingsClient creates an instance of the +// ReplicationProtectionContainerMappingsClient client. +func NewReplicationProtectionContainerMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainerMappingsClient { + return NewReplicationProtectionContainerMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionContainerMappingsClientWithBaseURI creates an instance of the +// ReplicationProtectionContainerMappingsClient client using a custom endpoint. Use this when interacting with an +// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationProtectionContainerMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainerMappingsClient { + return ReplicationProtectionContainerMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// creationInput - mapping creation input. +func (client ReplicationProtectionContainerMappingsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput CreateProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, mappingName, creationInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionContainerMappingsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput CreateProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithJSON(creationInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) CreateSender(req *http.Request) (future ReplicationProtectionContainerMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) CreateResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete or remove a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// removalInput - removal input. +func (client ReplicationProtectionContainerMappingsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput RemoveProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, mappingName, removalInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectionContainerMappingsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput RemoveProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}/remove", pathParameters), + autorest.WithJSON(removalInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) DeleteSender(req *http.Request) (future ReplicationProtectionContainerMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection Container mapping name. +func (client ReplicationProtectionContainerMappingsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result ProtectionContainerMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, mappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionContainerMappingsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) GetResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the protection container mappings in the vault. +func (client ReplicationProtectionContainerMappingsClient) List(ctx context.Context) (result ProtectionContainerMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.List") + defer func() { + sc := -1 + if result.pcmc.Response.Response != nil { + sc = result.pcmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pcmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", resp, "Failure sending request") + return + } + + result.pcmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.pcmc.hasNextLink() && result.pcmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionContainerMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionContainerMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) ListResponder(resp *http.Response) (result ProtectionContainerMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainerMappingsClient) listNextResults(ctx context.Context, lastResults ProtectionContainerMappingCollection) (result ProtectionContainerMappingCollection, err error) { + req, err := lastResults.protectionContainerMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainerMappingsClient) ListComplete(ctx context.Context) (result ProtectionContainerMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationProtectionContainers lists the protection container mappings for a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainerMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.pcmc.Response.Response != nil { + sc = result.pcmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.pcmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.pcmc, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.pcmc.hasNextLink() && result.pcmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ProtectionContainerMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainerMappingsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ProtectionContainerMappingCollection) (result ProtectionContainerMappingCollection, err error) { + req, err := lastResults.protectionContainerMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainerMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName) + return +} + +// Purge the operation to purge(force delete) a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +func (client ReplicationProtectionContainerMappingsClient) Purge(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result ReplicationProtectionContainerMappingsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, protectionContainerName, mappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationProtectionContainerMappingsClient) PurgePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) PurgeSender(req *http.Request) (future ReplicationProtectionContainerMappingsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update the operation to update protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// updateInput - mapping update input. +func (client ReplicationProtectionContainerMappingsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput UpdateProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, mappingName, updateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationProtectionContainerMappingsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput UpdateProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithJSON(updateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) UpdateSender(req *http.Request) (future ReplicationProtectionContainerMappingsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) UpdateResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationprotectioncontainers.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationprotectioncontainers.go new file mode 100644 index 000000000000..1d57c9511585 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationprotectioncontainers.go @@ -0,0 +1,677 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionContainersClient is the client for the ReplicationProtectionContainers methods of the +// Siterecovery service. +type ReplicationProtectionContainersClient struct { + BaseClient +} + +// NewReplicationProtectionContainersClient creates an instance of the ReplicationProtectionContainersClient client. +func NewReplicationProtectionContainersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainersClient { + return NewReplicationProtectionContainersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionContainersClientWithBaseURI creates an instance of the ReplicationProtectionContainersClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationProtectionContainersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainersClient { + return ReplicationProtectionContainersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create operation to create a protection container. +// Parameters: +// fabricName - unique fabric ARM name. +// protectionContainerName - unique protection container ARM name. +// creationInput - creation input. +func (client ReplicationProtectionContainersClient) Create(ctx context.Context, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput) (result ReplicationProtectionContainersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, creationInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionContainersClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}", pathParameters), + autorest.WithJSON(creationInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) CreateSender(req *http.Request) (future ReplicationProtectionContainersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) CreateResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete operation to remove a protection container. +// Parameters: +// fabricName - unique fabric ARM name. +// protectionContainerName - unique protection container ARM name. +func (client ReplicationProtectionContainersClient) Delete(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectionContainersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectionContainersClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) DeleteSender(req *http.Request) (future ReplicationProtectionContainersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DiscoverProtectableItem the operation to a add a protectable item to a protection container(Add physical server). +// Parameters: +// fabricName - the name of the fabric. +// protectionContainerName - the name of the protection container. +// discoverProtectableItemRequest - the request object to add a protectable item. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItem(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest) (result ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.DiscoverProtectableItem") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DiscoverProtectableItemPreparer(ctx, fabricName, protectionContainerName, discoverProtectableItemRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "DiscoverProtectableItem", nil, "Failure preparing request") + return + } + + result, err = client.DiscoverProtectableItemSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "DiscoverProtectableItem", result.Response(), "Failure sending request") + return + } + + return +} + +// DiscoverProtectableItemPreparer prepares the DiscoverProtectableItem request. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemPreparer(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/discoverProtectableItem", pathParameters), + autorest.WithJSON(discoverProtectableItemRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DiscoverProtectableItemSender sends the DiscoverProtectableItem request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemSender(req *http.Request) (future ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DiscoverProtectableItemResponder handles the response to the DiscoverProtectableItem request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectionContainersClient) Get(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainer, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionContainersClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) GetResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the protection containers in a vault. +func (client ReplicationProtectionContainersClient) List(ctx context.Context) (result ProtectionContainerCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.List") + defer func() { + sc := -1 + if result.pcc.Response.Response != nil { + sc = result.pcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", resp, "Failure sending request") + return + } + + result.pcc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", resp, "Failure responding to request") + return + } + if result.pcc.hasNextLink() && result.pcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionContainersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionContainers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) ListResponder(resp *http.Response) (result ProtectionContainerCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainersClient) listNextResults(ctx context.Context, lastResults ProtectionContainerCollection) (result ProtectionContainerCollection, err error) { + req, err := lastResults.protectionContainerCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainersClient) ListComplete(ctx context.Context) (result ProtectionContainerCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the protection containers in the specified fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationProtectionContainersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result ProtectionContainerCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.pcc.Response.Response != nil { + sc = result.pcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.pcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.pcc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.pcc.hasNextLink() && result.pcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsResponder(resp *http.Response) (result ProtectionContainerCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults ProtectionContainerCollection) (result ProtectionContainerCollection, err error) { + req, err := lastResults.protectionContainerCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result ProtectionContainerCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// SwitchProtection operation to switch protection from one container to another or one replication provider to +// another. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// switchInput - switch protection input. +func (client ReplicationProtectionContainersClient) SwitchProtection(ctx context.Context, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput) (result ReplicationProtectionContainersSwitchProtectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.SwitchProtection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.SwitchProtectionPreparer(ctx, fabricName, protectionContainerName, switchInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "SwitchProtection", nil, "Failure preparing request") + return + } + + result, err = client.SwitchProtectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "SwitchProtection", result.Response(), "Failure sending request") + return + } + + return +} + +// SwitchProtectionPreparer prepares the SwitchProtection request. +func (client ReplicationProtectionContainersClient) SwitchProtectionPreparer(ctx context.Context, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/switchprotection", pathParameters), + autorest.WithJSON(switchInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SwitchProtectionSender sends the SwitchProtection request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) SwitchProtectionSender(req *http.Request) (future ReplicationProtectionContainersSwitchProtectionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// SwitchProtectionResponder handles the response to the SwitchProtection request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) SwitchProtectionResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationprotectionintents.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationprotectionintents.go new file mode 100644 index 000000000000..70001b660543 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationprotectionintents.go @@ -0,0 +1,312 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionIntentsClient is the client for the ReplicationProtectionIntents methods of the Siterecovery +// service. +type ReplicationProtectionIntentsClient struct { + BaseClient +} + +// NewReplicationProtectionIntentsClient creates an instance of the ReplicationProtectionIntentsClient client. +func NewReplicationProtectionIntentsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionIntentsClient { + return NewReplicationProtectionIntentsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionIntentsClientWithBaseURI creates an instance of the ReplicationProtectionIntentsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationProtectionIntentsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionIntentsClient { + return ReplicationProtectionIntentsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR replication protection intent item. +// Parameters: +// intentObjectName - a name for the replication protection item. +// input - create Protection Intent Input. +func (client ReplicationProtectionIntentsClient) Create(ctx context.Context, intentObjectName string, input CreateProtectionIntentInput) (result ReplicationProtectionIntent, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, intentObjectName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionIntentsClient) CreatePreparer(ctx context.Context, intentObjectName string, input CreateProtectionIntentInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "intentObjectName": autorest.Encode("path", intentObjectName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) CreateResponder(resp *http.Response) (result ReplicationProtectionIntent, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of an ASR replication protection intent. +// Parameters: +// intentObjectName - replication protection intent name. +func (client ReplicationProtectionIntentsClient) Get(ctx context.Context, intentObjectName string) (result ReplicationProtectionIntent, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, intentObjectName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionIntentsClient) GetPreparer(ctx context.Context, intentObjectName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "intentObjectName": autorest.Encode("path", intentObjectName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) GetResponder(resp *http.Response) (result ReplicationProtectionIntent, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of ASR replication protection intent objects in the vault. +// Parameters: +// skipToken - the pagination token. +// takeToken - the page size. +func (client ReplicationProtectionIntentsClient) List(ctx context.Context, skipToken string, takeToken string) (result ReplicationProtectionIntentCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.List") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, takeToken) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionIntentsClient) ListPreparer(ctx context.Context, skipToken string, takeToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) ListResponder(resp *http.Response) (result ReplicationProtectionIntentCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionIntentsClient) listNextResults(ctx context.Context, lastResults ReplicationProtectionIntentCollection) (result ReplicationProtectionIntentCollection, err error) { + req, err := lastResults.replicationProtectionIntentCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionIntentsClient) ListComplete(ctx context.Context, skipToken string, takeToken string) (result ReplicationProtectionIntentCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, takeToken) + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationrecoveryplans.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationrecoveryplans.go new file mode 100644 index 000000000000..4d1b0d58b023 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationrecoveryplans.go @@ -0,0 +1,1069 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationRecoveryPlansClient is the client for the ReplicationRecoveryPlans methods of the Siterecovery service. +type ReplicationRecoveryPlansClient struct { + BaseClient +} + +// NewReplicationRecoveryPlansClient creates an instance of the ReplicationRecoveryPlansClient client. +func NewReplicationRecoveryPlansClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryPlansClient { + return NewReplicationRecoveryPlansClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationRecoveryPlansClientWithBaseURI creates an instance of the ReplicationRecoveryPlansClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationRecoveryPlansClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryPlansClient { + return ReplicationRecoveryPlansClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery Plan creation input. +func (client ReplicationRecoveryPlansClient) Create(ctx context.Context, recoveryPlanName string, input CreateRecoveryPlanInput) (result ReplicationRecoveryPlansCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.PrimaryFabricID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "input.Properties.RecoveryFabricID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "input.Properties.Groups", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationRecoveryPlansClient) CreatePreparer(ctx context.Context, recoveryPlanName string, input CreateRecoveryPlanInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) CreateSender(req *http.Request) (future ReplicationRecoveryPlansCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) CreateResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) Delete(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationRecoveryPlansClient) DeletePreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) DeleteSender(req *http.Request) (future ReplicationRecoveryPlansDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// FailoverCancel the operation to cancel the failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) FailoverCancel(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansFailoverCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.FailoverCancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCancelPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCancel", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCancel", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCancelPreparer prepares the FailoverCancel request. +func (client ReplicationRecoveryPlansClient) FailoverCancelPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCancelSender sends the FailoverCancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) FailoverCancelSender(req *http.Request) (future ReplicationRecoveryPlansFailoverCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCancelResponder handles the response to the FailoverCancel request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) FailoverCancelResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// FailoverCommit the operation to commit the failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) FailoverCommit(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansFailoverCommitFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.FailoverCommit") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCommitPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCommit", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCommitSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCommit", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCommitPreparer prepares the FailoverCommit request. +func (client ReplicationRecoveryPlansClient) FailoverCommitPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCommit", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCommitSender sends the FailoverCommit request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) FailoverCommitSender(req *http.Request) (future ReplicationRecoveryPlansFailoverCommitFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCommitResponder handles the response to the FailoverCommit request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) FailoverCommitResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of the recovery plan. +// Parameters: +// recoveryPlanName - name of the recovery plan. +func (client ReplicationRecoveryPlansClient) Get(ctx context.Context, recoveryPlanName string) (result RecoveryPlan, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationRecoveryPlansClient) GetPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) GetResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the recovery plans in the vault. +func (client ReplicationRecoveryPlansClient) List(ctx context.Context) (result RecoveryPlanCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.List") + defer func() { + sc := -1 + if result.RPCVar.Response.Response != nil { + sc = result.RPCVar.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.RPCVar.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", resp, "Failure sending request") + return + } + + result.RPCVar, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", resp, "Failure responding to request") + return + } + if result.RPCVar.hasNextLink() && result.RPCVar.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationRecoveryPlansClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) ListResponder(resp *http.Response) (result RecoveryPlanCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryPlansClient) listNextResults(ctx context.Context, lastResults RecoveryPlanCollection) (result RecoveryPlanCollection, err error) { + req, err := lastResults.recoveryPlanCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryPlansClient) ListComplete(ctx context.Context) (result RecoveryPlanCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// PlannedFailover the operation to start the planned failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - failover input. +func (client ReplicationRecoveryPlansClient) PlannedFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput) (result ReplicationRecoveryPlansPlannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.PlannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", err.Error()) + } + + req, err := client.PlannedFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.PlannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// PlannedFailoverPreparer prepares the PlannedFailover request. +func (client ReplicationRecoveryPlansClient) PlannedFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/plannedFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PlannedFailoverSender sends the PlannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) PlannedFailoverSender(req *http.Request) (future ReplicationRecoveryPlansPlannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PlannedFailoverResponder handles the response to the PlannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) PlannedFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Reprotect the operation to reprotect(reverse replicate) a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) Reprotect(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansReprotectFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Reprotect") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReprotectPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Reprotect", nil, "Failure preparing request") + return + } + + result, err = client.ReprotectSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Reprotect", result.Response(), "Failure sending request") + return + } + + return +} + +// ReprotectPreparer prepares the Reprotect request. +func (client ReplicationRecoveryPlansClient) ReprotectPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/reProtect", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReprotectSender sends the Reprotect request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) ReprotectSender(req *http.Request) (future ReplicationRecoveryPlansReprotectFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReprotectResponder handles the response to the Reprotect request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) ReprotectResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailover the operation to start the test failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan test failover input. +func (client ReplicationRecoveryPlansClient) TestFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverInput) (result ReplicationRecoveryPlansTestFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.TestFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.NetworkType", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "TestFailover", err.Error()) + } + + req, err := client.TestFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailover", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverPreparer prepares the TestFailover request. +func (client ReplicationRecoveryPlansClient) TestFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverSender sends the TestFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) TestFailoverSender(req *http.Request) (future ReplicationRecoveryPlansTestFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverResponder handles the response to the TestFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) TestFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailoverCleanup the operation to cleanup test failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan test failover cleanup input. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanup(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput) (result ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.TestFailoverCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "input.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", err.Error()) + } + + req, err := client.TestFailoverCleanupPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverCleanupPreparer prepares the TestFailoverCleanup request. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailoverCleanup", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverCleanupSender sends the TestFailoverCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupSender(req *http.Request) (future ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverCleanupResponder handles the response to the TestFailoverCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UnplannedFailover the operation to start the unplanned failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan unplanned failover input. +func (client ReplicationRecoveryPlansClient) UnplannedFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput) (result ReplicationRecoveryPlansUnplannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.UnplannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", err.Error()) + } + + req, err := client.UnplannedFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.UnplannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// UnplannedFailoverPreparer prepares the UnplannedFailover request. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/unplannedFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UnplannedFailoverSender sends the UnplannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverSender(req *http.Request) (future ReplicationRecoveryPlansUnplannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UnplannedFailoverResponder handles the response to the UnplannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - update recovery plan input. +func (client ReplicationRecoveryPlansClient) Update(ctx context.Context, recoveryPlanName string, input UpdateRecoveryPlanInput) (result ReplicationRecoveryPlansUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationRecoveryPlansClient) UpdatePreparer(ctx context.Context, recoveryPlanName string, input UpdateRecoveryPlanInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) UpdateSender(req *http.Request) (future ReplicationRecoveryPlansUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) UpdateResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationrecoveryservicesproviders.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationrecoveryservicesproviders.go new file mode 100644 index 000000000000..2800611f157f --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationrecoveryservicesproviders.go @@ -0,0 +1,700 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationRecoveryServicesProvidersClient is the client for the ReplicationRecoveryServicesProviders methods of the +// Siterecovery service. +type ReplicationRecoveryServicesProvidersClient struct { + BaseClient +} + +// NewReplicationRecoveryServicesProvidersClient creates an instance of the ReplicationRecoveryServicesProvidersClient +// client. +func NewReplicationRecoveryServicesProvidersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryServicesProvidersClient { + return NewReplicationRecoveryServicesProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationRecoveryServicesProvidersClientWithBaseURI creates an instance of the +// ReplicationRecoveryServicesProvidersClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationRecoveryServicesProvidersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryServicesProvidersClient { + return ReplicationRecoveryServicesProvidersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to add a recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +// addProviderInput - add provider input. +func (client ReplicationRecoveryServicesProvidersClient) Create(ctx context.Context, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput) (result ReplicationRecoveryServicesProvidersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: addProviderInput, + Constraints: []validation.Constraint{{Target: "addProviderInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.MachineName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.AuthenticationIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.ResourceAccessIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, providerName, addProviderInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationRecoveryServicesProvidersClient) CreatePreparer(ctx context.Context, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithJSON(addProviderInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) CreateSender(req *http.Request) (future ReplicationRecoveryServicesProvidersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) CreateResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to removes/delete(unregister) a recovery services provider from the vault. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Delete(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationRecoveryServicesProvidersClient) DeletePreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) DeleteSender(req *http.Request) (future ReplicationRecoveryServicesProvidersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of registered recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Get(ctx context.Context, fabricName string, providerName string) (result RecoveryServicesProvider, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationRecoveryServicesProvidersClient) GetPreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) GetResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the registered recovery services providers in the vault. +func (client ReplicationRecoveryServicesProvidersClient) List(ctx context.Context) (result RecoveryServicesProviderCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.List") + defer func() { + sc := -1 + if result.rspc.Response.Response != nil { + sc = result.rspc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rspc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", resp, "Failure sending request") + return + } + + result.rspc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", resp, "Failure responding to request") + return + } + if result.rspc.hasNextLink() && result.rspc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationRecoveryServicesProvidersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryServicesProviders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) ListResponder(resp *http.Response) (result RecoveryServicesProviderCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryServicesProvidersClient) listNextResults(ctx context.Context, lastResults RecoveryServicesProviderCollection) (result RecoveryServicesProviderCollection, err error) { + req, err := lastResults.recoveryServicesProviderCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryServicesProvidersClient) ListComplete(ctx context.Context) (result RecoveryServicesProviderCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the registered recovery services providers for the specified fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result RecoveryServicesProviderCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.rspc.Response.Response != nil { + sc = result.rspc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.rspc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.rspc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.rspc.hasNextLink() && result.rspc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsResponder(resp *http.Response) (result RecoveryServicesProviderCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryServicesProvidersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults RecoveryServicesProviderCollection) (result RecoveryServicesProviderCollection, err error) { + req, err := lastResults.recoveryServicesProviderCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result RecoveryServicesProviderCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// Purge the operation to purge(force delete) a recovery services provider from the vault. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Purge(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationRecoveryServicesProvidersClient) PurgePreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) PurgeSender(req *http.Request) (future ReplicationRecoveryServicesProvidersPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RefreshProvider the operation to refresh the information from the recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProvider(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.RefreshProvider") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RefreshProviderPreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "RefreshProvider", nil, "Failure preparing request") + return + } + + result, err = client.RefreshProviderSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "RefreshProvider", result.Response(), "Failure sending request") + return + } + + return +} + +// RefreshProviderPreparer prepares the RefreshProvider request. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderPreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/refreshProvider", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RefreshProviderSender sends the RefreshProvider request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderSender(req *http.Request) (future ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RefreshProviderResponder handles the response to the RefreshProvider request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationstorageclassificationmappings.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationstorageclassificationmappings.go new file mode 100644 index 000000000000..deb54a37bc2d --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationstorageclassificationmappings.go @@ -0,0 +1,517 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationStorageClassificationMappingsClient is the client for the ReplicationStorageClassificationMappings +// methods of the Siterecovery service. +type ReplicationStorageClassificationMappingsClient struct { + BaseClient +} + +// NewReplicationStorageClassificationMappingsClient creates an instance of the +// ReplicationStorageClassificationMappingsClient client. +func NewReplicationStorageClassificationMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationMappingsClient { + return NewReplicationStorageClassificationMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationStorageClassificationMappingsClientWithBaseURI creates an instance of the +// ReplicationStorageClassificationMappingsClient client using a custom endpoint. Use this when interacting with an +// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationStorageClassificationMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationMappingsClient { + return ReplicationStorageClassificationMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +// pairingInput - pairing input. +func (client ReplicationStorageClassificationMappingsClient) Create(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput StorageClassificationMappingInput) (result ReplicationStorageClassificationMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName, pairingInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationStorageClassificationMappingsClient) CreatePreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput StorageClassificationMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithJSON(pairingInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) CreateSender(req *http.Request) (future ReplicationStorageClassificationMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) CreateResponder(resp *http.Response) (result StorageClassificationMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +func (client ReplicationStorageClassificationMappingsClient) Delete(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result ReplicationStorageClassificationMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationStorageClassificationMappingsClient) DeletePreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) DeleteSender(req *http.Request) (future ReplicationStorageClassificationMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the specified storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +func (client ReplicationStorageClassificationMappingsClient) Get(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result StorageClassificationMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationStorageClassificationMappingsClient) GetPreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) GetResponder(resp *http.Response) (result StorageClassificationMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the storage classification mappings in the vault. +func (client ReplicationStorageClassificationMappingsClient) List(ctx context.Context) (result StorageClassificationMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.List") + defer func() { + sc := -1 + if result.scmc.Response.Response != nil { + sc = result.scmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.scmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", resp, "Failure sending request") + return + } + + result.scmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.scmc.hasNextLink() && result.scmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationStorageClassificationMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationStorageClassificationMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) ListResponder(resp *http.Response) (result StorageClassificationMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationMappingsClient) listNextResults(ctx context.Context, lastResults StorageClassificationMappingCollection) (result StorageClassificationMappingCollection, err error) { + req, err := lastResults.storageClassificationMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationMappingsClient) ListComplete(ctx context.Context) (result StorageClassificationMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationStorageClassifications lists the storage classification mappings for the fabric. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassifications(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassificationMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.ListByReplicationStorageClassifications") + defer func() { + sc := -1 + if result.scmc.Response.Response != nil { + sc = result.scmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationStorageClassificationsNextResults + req, err := client.ListByReplicationStorageClassificationsPreparer(ctx, fabricName, storageClassificationName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationStorageClassificationsSender(req) + if err != nil { + result.scmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", resp, "Failure sending request") + return + } + + result.scmc, err = client.ListByReplicationStorageClassificationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", resp, "Failure responding to request") + return + } + if result.scmc.hasNextLink() && result.scmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationStorageClassificationsPreparer prepares the ListByReplicationStorageClassifications request. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsPreparer(ctx context.Context, fabricName string, storageClassificationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationStorageClassificationsSender sends the ListByReplicationStorageClassifications request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationStorageClassificationsResponder handles the response to the ListByReplicationStorageClassifications request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsResponder(resp *http.Response) (result StorageClassificationMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationStorageClassificationsNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationMappingsClient) listByReplicationStorageClassificationsNextResults(ctx context.Context, lastResults StorageClassificationMappingCollection) (result StorageClassificationMappingCollection, err error) { + req, err := lastResults.storageClassificationMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationStorageClassificationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationStorageClassificationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationStorageClassificationsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsComplete(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassificationMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.ListByReplicationStorageClassifications") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationStorageClassifications(ctx, fabricName, storageClassificationName) + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationstorageclassifications.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationstorageclassifications.go new file mode 100644 index 000000000000..0da91d1f3118 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationstorageclassifications.go @@ -0,0 +1,345 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationStorageClassificationsClient is the client for the ReplicationStorageClassifications methods of the +// Siterecovery service. +type ReplicationStorageClassificationsClient struct { + BaseClient +} + +// NewReplicationStorageClassificationsClient creates an instance of the ReplicationStorageClassificationsClient +// client. +func NewReplicationStorageClassificationsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationsClient { + return NewReplicationStorageClassificationsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationStorageClassificationsClientWithBaseURI creates an instance of the +// ReplicationStorageClassificationsClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationStorageClassificationsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationsClient { + return ReplicationStorageClassificationsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of the specified storage classification. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +func (client ReplicationStorageClassificationsClient) Get(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassification, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, storageClassificationName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationStorageClassificationsClient) GetPreparer(ctx context.Context, fabricName string, storageClassificationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) GetResponder(resp *http.Response) (result StorageClassification, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the storage classifications in the vault. +func (client ReplicationStorageClassificationsClient) List(ctx context.Context) (result StorageClassificationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.List") + defer func() { + sc := -1 + if result.scc.Response.Response != nil { + sc = result.scc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.scc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", resp, "Failure sending request") + return + } + + result.scc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", resp, "Failure responding to request") + return + } + if result.scc.hasNextLink() && result.scc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationStorageClassificationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationStorageClassifications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) ListResponder(resp *http.Response) (result StorageClassificationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationsClient) listNextResults(ctx context.Context, lastResults StorageClassificationCollection) (result StorageClassificationCollection, err error) { + req, err := lastResults.storageClassificationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationsClient) ListComplete(ctx context.Context) (result StorageClassificationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the storage classifications available in the specified fabric. +// Parameters: +// fabricName - site name of interest. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result StorageClassificationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.scc.Response.Response != nil { + sc = result.scc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.scc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.scc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.scc.hasNextLink() && result.scc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsResponder(resp *http.Response) (result StorageClassificationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationsClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults StorageClassificationCollection) (result StorageClassificationCollection, err error) { + req, err := lastResults.storageClassificationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result StorageClassificationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationvaulthealth.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationvaulthealth.go new file mode 100644 index 000000000000..c64db5988bc8 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationvaulthealth.go @@ -0,0 +1,181 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationVaultHealthClient is the client for the ReplicationVaultHealth methods of the Siterecovery service. +type ReplicationVaultHealthClient struct { + BaseClient +} + +// NewReplicationVaultHealthClient creates an instance of the ReplicationVaultHealthClient client. +func NewReplicationVaultHealthClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultHealthClient { + return NewReplicationVaultHealthClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationVaultHealthClientWithBaseURI creates an instance of the ReplicationVaultHealthClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewReplicationVaultHealthClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultHealthClient { + return ReplicationVaultHealthClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the health details of the vault. +func (client ReplicationVaultHealthClient) Get(ctx context.Context) (result VaultHealthDetails, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultHealthClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationVaultHealthClient) GetPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultHealthClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationVaultHealthClient) GetResponder(resp *http.Response) (result VaultHealthDetails, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Refresh sends the refresh request. +func (client ReplicationVaultHealthClient) Refresh(ctx context.Context) (result ReplicationVaultHealthRefreshFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultHealthClient.Refresh") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RefreshPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Refresh", nil, "Failure preparing request") + return + } + + result, err = client.RefreshSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Refresh", result.Response(), "Failure sending request") + return + } + + return +} + +// RefreshPreparer prepares the Refresh request. +func (client ReplicationVaultHealthClient) RefreshPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth/default/refresh", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RefreshSender sends the Refresh request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultHealthClient) RefreshSender(req *http.Request) (future ReplicationVaultHealthRefreshFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RefreshResponder handles the response to the Refresh request. The method always +// closes the http.Response Body. +func (client ReplicationVaultHealthClient) RefreshResponder(resp *http.Response) (result VaultHealthDetails, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationvaultsetting.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationvaultsetting.go new file mode 100644 index 000000000000..dc6749fd699b --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationvaultsetting.go @@ -0,0 +1,312 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationVaultSettingClient is the client for the ReplicationVaultSetting methods of the Siterecovery service. +type ReplicationVaultSettingClient struct { + BaseClient +} + +// NewReplicationVaultSettingClient creates an instance of the ReplicationVaultSettingClient client. +func NewReplicationVaultSettingClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultSettingClient { + return NewReplicationVaultSettingClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationVaultSettingClientWithBaseURI creates an instance of the ReplicationVaultSettingClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewReplicationVaultSettingClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultSettingClient { + return ReplicationVaultSettingClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to configure vault setting. +// Parameters: +// vaultSettingName - vault setting name. +// input - vault setting creation input. +func (client ReplicationVaultSettingClient) Create(ctx context.Context, vaultSettingName string, input VaultSettingCreationInput) (result ReplicationVaultSettingCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationVaultSettingClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, vaultSettingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationVaultSettingClient) CreatePreparer(ctx context.Context, vaultSettingName string, input VaultSettingCreationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultSettingName": autorest.Encode("path", vaultSettingName), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) CreateSender(req *http.Request) (future ReplicationVaultSettingCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) CreateResponder(resp *http.Response) (result VaultSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the vault setting. This includes the Migration Hub connection settings. +// Parameters: +// vaultSettingName - vault setting name. +func (client ReplicationVaultSettingClient) Get(ctx context.Context, vaultSettingName string) (result VaultSetting, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, vaultSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationVaultSettingClient) GetPreparer(ctx context.Context, vaultSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultSettingName": autorest.Encode("path", vaultSettingName), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) GetResponder(resp *http.Response) (result VaultSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of vault setting. This includes the Migration Hub connection settings. +func (client ReplicationVaultSettingClient) List(ctx context.Context) (result VaultSettingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.List") + defer func() { + sc := -1 + if result.vsc.Response.Response != nil { + sc = result.vsc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vsc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", resp, "Failure sending request") + return + } + + result.vsc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", resp, "Failure responding to request") + return + } + if result.vsc.hasNextLink() && result.vsc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationVaultSettingClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) ListResponder(resp *http.Response) (result VaultSettingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationVaultSettingClient) listNextResults(ctx context.Context, lastResults VaultSettingCollection) (result VaultSettingCollection, err error) { + req, err := lastResults.vaultSettingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationVaultSettingClient) ListComplete(ctx context.Context) (result VaultSettingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationvcenters.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationvcenters.go new file mode 100644 index 000000000000..6b7fef688914 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/replicationvcenters.go @@ -0,0 +1,591 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationvCentersClient is the client for the ReplicationvCenters methods of the Siterecovery service. +type ReplicationvCentersClient struct { + BaseClient +} + +// NewReplicationvCentersClient creates an instance of the ReplicationvCentersClient client. +func NewReplicationvCentersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationvCentersClient { + return NewReplicationvCentersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationvCentersClientWithBaseURI creates an instance of the ReplicationvCentersClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationvCentersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationvCentersClient { + return ReplicationvCentersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a vCenter object.. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +// addVCenterRequest - the input to the add vCenter operation. +func (client ReplicationvCentersClient) Create(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest) (result ReplicationvCentersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, vcenterName, addVCenterRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationvCentersClient) CreatePreparer(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithJSON(addVCenterRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) CreateSender(req *http.Request) (future ReplicationvCentersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) CreateResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to remove(unregister) a registered vCenter server from the vault. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +func (client ReplicationvCentersClient) Delete(ctx context.Context, fabricName string, vcenterName string) (result ReplicationvCentersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, vcenterName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationvCentersClient) DeletePreparer(ctx context.Context, fabricName string, vcenterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) DeleteSender(req *http.Request) (future ReplicationvCentersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a registered vCenter server(Add vCenter server). +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +func (client ReplicationvCentersClient) Get(ctx context.Context, fabricName string, vcenterName string) (result VCenter, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, vcenterName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationvCentersClient) GetPreparer(ctx context.Context, fabricName string, vcenterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) GetResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the vCenter servers registered in the vault. +func (client ReplicationvCentersClient) List(ctx context.Context) (result VCenterCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.List") + defer func() { + sc := -1 + if result.vcc.Response.Response != nil { + sc = result.vcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", resp, "Failure sending request") + return + } + + result.vcc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", resp, "Failure responding to request") + return + } + if result.vcc.hasNextLink() && result.vcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationvCentersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationvCenters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) ListResponder(resp *http.Response) (result VCenterCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationvCentersClient) listNextResults(ctx context.Context, lastResults VCenterCollection) (result VCenterCollection, err error) { + req, err := lastResults.vCenterCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationvCentersClient) ListComplete(ctx context.Context) (result VCenterCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the vCenter servers registered in a fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationvCentersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result VCenterCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.vcc.Response.Response != nil { + sc = result.vcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.vcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.vcc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.vcc.hasNextLink() && result.vcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationvCentersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) ListByReplicationFabricsResponder(resp *http.Response) (result VCenterCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationvCentersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults VCenterCollection) (result VCenterCollection, err error) { + req, err := lastResults.vCenterCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationvCentersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result VCenterCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// Update the operation to update a registered vCenter. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +// updateVCenterRequest - the input to the update vCenter operation. +func (client ReplicationvCentersClient) Update(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest) (result ReplicationvCentersUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, vcenterName, updateVCenterRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationvCentersClient) UpdatePreparer(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithJSON(updateVCenterRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) UpdateSender(req *http.Request) (future ReplicationvCentersUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) UpdateResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/siterecoveryapi/interfaces.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/siterecoveryapi/interfaces.go new file mode 100644 index 000000000000..8b7c9ceca2d6 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/siterecoveryapi/interfaces.go @@ -0,0 +1,350 @@ +package siterecoveryapi + +// 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. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-11-01/siterecovery" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result siterecovery.OperationsDiscoveryCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.OperationsDiscoveryCollectionIterator, err error) +} + +var _ OperationsClientAPI = (*siterecovery.OperationsClient)(nil) + +// ReplicationAlertSettingsClientAPI contains the set of methods on the ReplicationAlertSettingsClient type. +type ReplicationAlertSettingsClientAPI interface { + Create(ctx context.Context, alertSettingName string, request siterecovery.ConfigureAlertRequest) (result siterecovery.Alert, err error) + Get(ctx context.Context, alertSettingName string) (result siterecovery.Alert, err error) + List(ctx context.Context) (result siterecovery.AlertCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.AlertCollectionIterator, err error) +} + +var _ ReplicationAlertSettingsClientAPI = (*siterecovery.ReplicationAlertSettingsClient)(nil) + +// ReplicationAppliancesClientAPI contains the set of methods on the ReplicationAppliancesClient type. +type ReplicationAppliancesClientAPI interface { + List(ctx context.Context, filter string) (result siterecovery.ApplianceCollectionPage, err error) + ListComplete(ctx context.Context, filter string) (result siterecovery.ApplianceCollectionIterator, err error) +} + +var _ ReplicationAppliancesClientAPI = (*siterecovery.ReplicationAppliancesClient)(nil) + +// ReplicationEligibilityResultsClientAPI contains the set of methods on the ReplicationEligibilityResultsClient type. +type ReplicationEligibilityResultsClientAPI interface { + Get(ctx context.Context, virtualMachineName string) (result siterecovery.ReplicationEligibilityResults, err error) + List(ctx context.Context, virtualMachineName string) (result siterecovery.ReplicationEligibilityResultsCollection, err error) +} + +var _ ReplicationEligibilityResultsClientAPI = (*siterecovery.ReplicationEligibilityResultsClient)(nil) + +// ReplicationEventsClientAPI contains the set of methods on the ReplicationEventsClient type. +type ReplicationEventsClientAPI interface { + Get(ctx context.Context, eventName string) (result siterecovery.Event, err error) + List(ctx context.Context, filter string) (result siterecovery.EventCollectionPage, err error) + ListComplete(ctx context.Context, filter string) (result siterecovery.EventCollectionIterator, err error) +} + +var _ ReplicationEventsClientAPI = (*siterecovery.ReplicationEventsClient)(nil) + +// ReplicationFabricsClientAPI contains the set of methods on the ReplicationFabricsClient type. +type ReplicationFabricsClientAPI interface { + CheckConsistency(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsCheckConsistencyFuture, err error) + Create(ctx context.Context, fabricName string, input siterecovery.FabricCreationInput) (result siterecovery.ReplicationFabricsCreateFuture, err error) + Delete(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, filter string) (result siterecovery.Fabric, err error) + List(ctx context.Context) (result siterecovery.FabricCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.FabricCollectionIterator, err error) + MigrateToAad(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsMigrateToAadFuture, err error) + Purge(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsPurgeFuture, err error) + ReassociateGateway(ctx context.Context, fabricName string, failoverProcessServerRequest siterecovery.FailoverProcessServerRequest) (result siterecovery.ReplicationFabricsReassociateGatewayFuture, err error) + RenewCertificate(ctx context.Context, fabricName string, renewCertificate siterecovery.RenewCertificateInput) (result siterecovery.ReplicationFabricsRenewCertificateFuture, err error) +} + +var _ ReplicationFabricsClientAPI = (*siterecovery.ReplicationFabricsClient)(nil) + +// ReplicationLogicalNetworksClientAPI contains the set of methods on the ReplicationLogicalNetworksClient type. +type ReplicationLogicalNetworksClientAPI interface { + Get(ctx context.Context, fabricName string, logicalNetworkName string) (result siterecovery.LogicalNetwork, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.LogicalNetworkCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.LogicalNetworkCollectionIterator, err error) +} + +var _ ReplicationLogicalNetworksClientAPI = (*siterecovery.ReplicationLogicalNetworksClient)(nil) + +// ReplicationNetworksClientAPI contains the set of methods on the ReplicationNetworksClient type. +type ReplicationNetworksClientAPI interface { + Get(ctx context.Context, fabricName string, networkName string) (result siterecovery.Network, err error) + List(ctx context.Context) (result siterecovery.NetworkCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.NetworkCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.NetworkCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.NetworkCollectionIterator, err error) +} + +var _ ReplicationNetworksClientAPI = (*siterecovery.ReplicationNetworksClient)(nil) + +// ReplicationNetworkMappingsClientAPI contains the set of methods on the ReplicationNetworkMappingsClient type. +type ReplicationNetworkMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, networkName string, networkMappingName string, input siterecovery.CreateNetworkMappingInput) (result siterecovery.ReplicationNetworkMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result siterecovery.ReplicationNetworkMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result siterecovery.NetworkMapping, err error) + List(ctx context.Context) (result siterecovery.NetworkMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.NetworkMappingCollectionIterator, err error) + ListByReplicationNetworks(ctx context.Context, fabricName string, networkName string) (result siterecovery.NetworkMappingCollectionPage, err error) + ListByReplicationNetworksComplete(ctx context.Context, fabricName string, networkName string) (result siterecovery.NetworkMappingCollectionIterator, err error) + Update(ctx context.Context, fabricName string, networkName string, networkMappingName string, input siterecovery.UpdateNetworkMappingInput) (result siterecovery.ReplicationNetworkMappingsUpdateFuture, err error) +} + +var _ ReplicationNetworkMappingsClientAPI = (*siterecovery.ReplicationNetworkMappingsClient)(nil) + +// ReplicationProtectionContainersClientAPI contains the set of methods on the ReplicationProtectionContainersClient type. +type ReplicationProtectionContainersClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, creationInput siterecovery.CreateProtectionContainerInput) (result siterecovery.ReplicationProtectionContainersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectionContainersDeleteFuture, err error) + DiscoverProtectableItem(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest siterecovery.DiscoverProtectableItemRequest) (result siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainer, err error) + List(ctx context.Context) (result siterecovery.ProtectionContainerCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.ProtectionContainerCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.ProtectionContainerCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.ProtectionContainerCollectionIterator, err error) + SwitchProtection(ctx context.Context, fabricName string, protectionContainerName string, switchInput siterecovery.SwitchProtectionInput) (result siterecovery.ReplicationProtectionContainersSwitchProtectionFuture, err error) +} + +var _ ReplicationProtectionContainersClientAPI = (*siterecovery.ReplicationProtectionContainersClient)(nil) + +// ReplicationMigrationItemsClientAPI contains the set of methods on the ReplicationMigrationItemsClient type. +type ReplicationMigrationItemsClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.EnableMigrationInput) (result siterecovery.ReplicationMigrationItemsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (result siterecovery.ReplicationMigrationItemsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationItem, err error) + List(ctx context.Context, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionIterator, err error) + Migrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput siterecovery.MigrateInput) (result siterecovery.ReplicationMigrationItemsMigrateFuture, err error) + Resync(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.ResyncInput) (result siterecovery.ReplicationMigrationItemsResyncFuture, err error) + TestMigrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput siterecovery.TestMigrateInput) (result siterecovery.ReplicationMigrationItemsTestMigrateFuture, err error) + TestMigrateCleanup(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput siterecovery.TestMigrateCleanupInput) (result siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.UpdateMigrationItemInput) (result siterecovery.ReplicationMigrationItemsUpdateFuture, err error) +} + +var _ ReplicationMigrationItemsClientAPI = (*siterecovery.ReplicationMigrationItemsClient)(nil) + +// MigrationRecoveryPointsClientAPI contains the set of methods on the MigrationRecoveryPointsClient type. +type MigrationRecoveryPointsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (result siterecovery.MigrationRecoveryPoint, err error) + ListByReplicationMigrationItems(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationRecoveryPointCollectionPage, err error) + ListByReplicationMigrationItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationRecoveryPointCollectionIterator, err error) +} + +var _ MigrationRecoveryPointsClientAPI = (*siterecovery.MigrationRecoveryPointsClient)(nil) + +// ReplicationProtectableItemsClientAPI contains the set of methods on the ReplicationProtectableItemsClient type. +type ReplicationProtectableItemsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (result siterecovery.ProtectableItem, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result siterecovery.ProtectableItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result siterecovery.ProtectableItemCollectionIterator, err error) +} + +var _ ReplicationProtectableItemsClientAPI = (*siterecovery.ReplicationProtectableItemsClient)(nil) + +// ReplicationProtectedItemsClientAPI contains the set of methods on the ReplicationProtectedItemsClient type. +type ReplicationProtectedItemsClientAPI interface { + AddDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput siterecovery.AddDisksInput) (result siterecovery.ReplicationProtectedItemsAddDisksFuture, err error) + ApplyRecoveryPoint(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput siterecovery.ApplyRecoveryPointInput) (result siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture, err error) + Create(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input siterecovery.EnableProtectionInput) (result siterecovery.ReplicationProtectedItemsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput siterecovery.DisableProtectionInput) (result siterecovery.ReplicationProtectedItemsDeleteFuture, err error) + FailoverCancel(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsFailoverCancelFuture, err error) + FailoverCommit(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsFailoverCommitFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItem, err error) + List(ctx context.Context, skipToken string, filter string) (result siterecovery.ReplicationProtectedItemCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, filter string) (result siterecovery.ReplicationProtectedItemCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectedItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectedItemCollectionIterator, err error) + PlannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput siterecovery.PlannedFailoverInput) (result siterecovery.ReplicationProtectedItemsPlannedFailoverFuture, err error) + Purge(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsPurgeFuture, err error) + RemoveDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput siterecovery.RemoveDisksInput) (result siterecovery.ReplicationProtectedItemsRemoveDisksFuture, err error) + RepairReplication(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsRepairReplicationFuture, err error) + Reprotect(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput siterecovery.ReverseReplicationInput) (result siterecovery.ReplicationProtectedItemsReprotectFuture, err error) + ResolveHealthErrors(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput siterecovery.ResolveHealthInput) (result siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture, err error) + SwitchProvider(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, switchProviderInput siterecovery.SwitchProviderInput) (result siterecovery.ReplicationProtectedItemsSwitchProviderFuture, err error) + TestFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput siterecovery.TestFailoverInput) (result siterecovery.ReplicationProtectedItemsTestFailoverFuture, err error) + TestFailoverCleanup(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput siterecovery.TestFailoverCleanupInput) (result siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture, err error) + UnplannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput siterecovery.UnplannedFailoverInput) (result siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput siterecovery.UpdateReplicationProtectedItemInput) (result siterecovery.ReplicationProtectedItemsUpdateFuture, err error) + UpdateAppliance(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput siterecovery.UpdateApplianceForReplicationProtectedItemInput) (result siterecovery.ReplicationProtectedItemsUpdateApplianceFuture, err error) + UpdateMobilityService(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest siterecovery.UpdateMobilityServiceRequest) (result siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) +} + +var _ ReplicationProtectedItemsClientAPI = (*siterecovery.ReplicationProtectedItemsClient)(nil) + +// RecoveryPointsClientAPI contains the set of methods on the RecoveryPointsClient type. +type RecoveryPointsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (result siterecovery.RecoveryPoint, err error) + ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.RecoveryPointCollectionPage, err error) + ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.RecoveryPointCollectionIterator, err error) +} + +var _ RecoveryPointsClientAPI = (*siterecovery.RecoveryPointsClient)(nil) + +// TargetComputeSizesClientAPI contains the set of methods on the TargetComputeSizesClient type. +type TargetComputeSizesClientAPI interface { + ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.TargetComputeSizeCollectionPage, err error) + ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.TargetComputeSizeCollectionIterator, err error) +} + +var _ TargetComputeSizesClientAPI = (*siterecovery.TargetComputeSizesClient)(nil) + +// ReplicationProtectionContainerMappingsClientAPI contains the set of methods on the ReplicationProtectionContainerMappingsClient type. +type ReplicationProtectionContainerMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput siterecovery.CreateProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput siterecovery.RemoveProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result siterecovery.ProtectionContainerMapping, err error) + List(ctx context.Context) (result siterecovery.ProtectionContainerMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.ProtectionContainerMappingCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainerMappingCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainerMappingCollectionIterator, err error) + Purge(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result siterecovery.ReplicationProtectionContainerMappingsPurgeFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput siterecovery.UpdateProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsUpdateFuture, err error) +} + +var _ ReplicationProtectionContainerMappingsClientAPI = (*siterecovery.ReplicationProtectionContainerMappingsClient)(nil) + +// ReplicationRecoveryServicesProvidersClientAPI contains the set of methods on the ReplicationRecoveryServicesProvidersClient type. +type ReplicationRecoveryServicesProvidersClientAPI interface { + Create(ctx context.Context, fabricName string, providerName string, addProviderInput siterecovery.AddRecoveryServicesProviderInput) (result siterecovery.ReplicationRecoveryServicesProvidersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture, err error) + Get(ctx context.Context, fabricName string, providerName string) (result siterecovery.RecoveryServicesProvider, err error) + List(ctx context.Context) (result siterecovery.RecoveryServicesProviderCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.RecoveryServicesProviderCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.RecoveryServicesProviderCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.RecoveryServicesProviderCollectionIterator, err error) + Purge(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture, err error) + RefreshProvider(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) +} + +var _ ReplicationRecoveryServicesProvidersClientAPI = (*siterecovery.ReplicationRecoveryServicesProvidersClient)(nil) + +// ReplicationStorageClassificationsClientAPI contains the set of methods on the ReplicationStorageClassificationsClient type. +type ReplicationStorageClassificationsClientAPI interface { + Get(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassification, err error) + List(ctx context.Context) (result siterecovery.StorageClassificationCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.StorageClassificationCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.StorageClassificationCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.StorageClassificationCollectionIterator, err error) +} + +var _ ReplicationStorageClassificationsClientAPI = (*siterecovery.ReplicationStorageClassificationsClient)(nil) + +// ReplicationStorageClassificationMappingsClientAPI contains the set of methods on the ReplicationStorageClassificationMappingsClient type. +type ReplicationStorageClassificationMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput siterecovery.StorageClassificationMappingInput) (result siterecovery.ReplicationStorageClassificationMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result siterecovery.ReplicationStorageClassificationMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result siterecovery.StorageClassificationMapping, err error) + List(ctx context.Context) (result siterecovery.StorageClassificationMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.StorageClassificationMappingCollectionIterator, err error) + ListByReplicationStorageClassifications(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassificationMappingCollectionPage, err error) + ListByReplicationStorageClassificationsComplete(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassificationMappingCollectionIterator, err error) +} + +var _ ReplicationStorageClassificationMappingsClientAPI = (*siterecovery.ReplicationStorageClassificationMappingsClient)(nil) + +// ReplicationvCentersClientAPI contains the set of methods on the ReplicationvCentersClient type. +type ReplicationvCentersClientAPI interface { + Create(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest siterecovery.AddVCenterRequest) (result siterecovery.ReplicationvCentersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, vcenterName string) (result siterecovery.ReplicationvCentersDeleteFuture, err error) + Get(ctx context.Context, fabricName string, vcenterName string) (result siterecovery.VCenter, err error) + List(ctx context.Context) (result siterecovery.VCenterCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.VCenterCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.VCenterCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.VCenterCollectionIterator, err error) + Update(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest siterecovery.UpdateVCenterRequest) (result siterecovery.ReplicationvCentersUpdateFuture, err error) +} + +var _ ReplicationvCentersClientAPI = (*siterecovery.ReplicationvCentersClient)(nil) + +// ReplicationJobsClientAPI contains the set of methods on the ReplicationJobsClient type. +type ReplicationJobsClientAPI interface { + Cancel(ctx context.Context, jobName string) (result siterecovery.ReplicationJobsCancelFuture, err error) + Export(ctx context.Context, jobQueryParameter siterecovery.JobQueryParameter) (result siterecovery.ReplicationJobsExportFuture, err error) + Get(ctx context.Context, jobName string) (result siterecovery.Job, err error) + List(ctx context.Context, filter string) (result siterecovery.JobCollectionPage, err error) + ListComplete(ctx context.Context, filter string) (result siterecovery.JobCollectionIterator, err error) + Restart(ctx context.Context, jobName string) (result siterecovery.ReplicationJobsRestartFuture, err error) + Resume(ctx context.Context, jobName string, resumeJobParams siterecovery.ResumeJobParams) (result siterecovery.ReplicationJobsResumeFuture, err error) +} + +var _ ReplicationJobsClientAPI = (*siterecovery.ReplicationJobsClient)(nil) + +// ReplicationPoliciesClientAPI contains the set of methods on the ReplicationPoliciesClient type. +type ReplicationPoliciesClientAPI interface { + Create(ctx context.Context, policyName string, input siterecovery.CreatePolicyInput) (result siterecovery.ReplicationPoliciesCreateFuture, err error) + Delete(ctx context.Context, policyName string) (result siterecovery.ReplicationPoliciesDeleteFuture, err error) + Get(ctx context.Context, policyName string) (result siterecovery.Policy, err error) + List(ctx context.Context) (result siterecovery.PolicyCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.PolicyCollectionIterator, err error) + Update(ctx context.Context, policyName string, input siterecovery.UpdatePolicyInput) (result siterecovery.ReplicationPoliciesUpdateFuture, err error) +} + +var _ ReplicationPoliciesClientAPI = (*siterecovery.ReplicationPoliciesClient)(nil) + +// ReplicationProtectionIntentsClientAPI contains the set of methods on the ReplicationProtectionIntentsClient type. +type ReplicationProtectionIntentsClientAPI interface { + Create(ctx context.Context, intentObjectName string, input siterecovery.CreateProtectionIntentInput) (result siterecovery.ReplicationProtectionIntent, err error) + Get(ctx context.Context, intentObjectName string) (result siterecovery.ReplicationProtectionIntent, err error) + List(ctx context.Context, skipToken string, takeToken string) (result siterecovery.ReplicationProtectionIntentCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, takeToken string) (result siterecovery.ReplicationProtectionIntentCollectionIterator, err error) +} + +var _ ReplicationProtectionIntentsClientAPI = (*siterecovery.ReplicationProtectionIntentsClient)(nil) + +// ReplicationRecoveryPlansClientAPI contains the set of methods on the ReplicationRecoveryPlansClient type. +type ReplicationRecoveryPlansClientAPI interface { + Create(ctx context.Context, recoveryPlanName string, input siterecovery.CreateRecoveryPlanInput) (result siterecovery.ReplicationRecoveryPlansCreateFuture, err error) + Delete(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansDeleteFuture, err error) + FailoverCancel(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansFailoverCancelFuture, err error) + FailoverCommit(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansFailoverCommitFuture, err error) + Get(ctx context.Context, recoveryPlanName string) (result siterecovery.RecoveryPlan, err error) + List(ctx context.Context) (result siterecovery.RecoveryPlanCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.RecoveryPlanCollectionIterator, err error) + PlannedFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanPlannedFailoverInput) (result siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture, err error) + Reprotect(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansReprotectFuture, err error) + TestFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanTestFailoverInput) (result siterecovery.ReplicationRecoveryPlansTestFailoverFuture, err error) + TestFailoverCleanup(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanTestFailoverCleanupInput) (result siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) + UnplannedFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanUnplannedFailoverInput) (result siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture, err error) + Update(ctx context.Context, recoveryPlanName string, input siterecovery.UpdateRecoveryPlanInput) (result siterecovery.ReplicationRecoveryPlansUpdateFuture, err error) +} + +var _ ReplicationRecoveryPlansClientAPI = (*siterecovery.ReplicationRecoveryPlansClient)(nil) + +// SupportedOperatingSystemsClientAPI contains the set of methods on the SupportedOperatingSystemsClient type. +type SupportedOperatingSystemsClientAPI interface { + Get(ctx context.Context, instanceType string) (result siterecovery.SupportedOperatingSystems, err error) +} + +var _ SupportedOperatingSystemsClientAPI = (*siterecovery.SupportedOperatingSystemsClient)(nil) + +// ReplicationVaultHealthClientAPI contains the set of methods on the ReplicationVaultHealthClient type. +type ReplicationVaultHealthClientAPI interface { + Get(ctx context.Context) (result siterecovery.VaultHealthDetails, err error) + Refresh(ctx context.Context) (result siterecovery.ReplicationVaultHealthRefreshFuture, err error) +} + +var _ ReplicationVaultHealthClientAPI = (*siterecovery.ReplicationVaultHealthClient)(nil) + +// ReplicationVaultSettingClientAPI contains the set of methods on the ReplicationVaultSettingClient type. +type ReplicationVaultSettingClientAPI interface { + Create(ctx context.Context, vaultSettingName string, input siterecovery.VaultSettingCreationInput) (result siterecovery.ReplicationVaultSettingCreateFuture, err error) + Get(ctx context.Context, vaultSettingName string) (result siterecovery.VaultSetting, err error) + List(ctx context.Context) (result siterecovery.VaultSettingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.VaultSettingCollectionIterator, err error) +} + +var _ ReplicationVaultSettingClientAPI = (*siterecovery.ReplicationVaultSettingClient)(nil) diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/supportedoperatingsystems.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/supportedoperatingsystems.go new file mode 100644 index 000000000000..42e589ed2b98 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/supportedoperatingsystems.go @@ -0,0 +1,110 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SupportedOperatingSystemsClient is the client for the SupportedOperatingSystems methods of the Siterecovery service. +type SupportedOperatingSystemsClient struct { + BaseClient +} + +// NewSupportedOperatingSystemsClient creates an instance of the SupportedOperatingSystemsClient client. +func NewSupportedOperatingSystemsClient(subscriptionID string, resourceGroupName string, resourceName string) SupportedOperatingSystemsClient { + return NewSupportedOperatingSystemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewSupportedOperatingSystemsClientWithBaseURI creates an instance of the SupportedOperatingSystemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewSupportedOperatingSystemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) SupportedOperatingSystemsClient { + return SupportedOperatingSystemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get sends the get request. +// Parameters: +// instanceType - the instance type. +func (client SupportedOperatingSystemsClient) Get(ctx context.Context, instanceType string) (result SupportedOperatingSystems, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SupportedOperatingSystemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, instanceType) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SupportedOperatingSystemsClient) GetPreparer(ctx context.Context, instanceType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(instanceType) > 0 { + queryParameters["instanceType"] = autorest.Encode("query", instanceType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationSupportedOperatingSystems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SupportedOperatingSystemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SupportedOperatingSystemsClient) GetResponder(resp *http.Response) (result SupportedOperatingSystems, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/targetcomputesizes.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/targetcomputesizes.go new file mode 100644 index 000000000000..678cabd8b046 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/targetcomputesizes.go @@ -0,0 +1,154 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// TargetComputeSizesClient is the client for the TargetComputeSizes methods of the Siterecovery service. +type TargetComputeSizesClient struct { + BaseClient +} + +// NewTargetComputeSizesClient creates an instance of the TargetComputeSizesClient client. +func NewTargetComputeSizesClient(subscriptionID string, resourceGroupName string, resourceName string) TargetComputeSizesClient { + return NewTargetComputeSizesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewTargetComputeSizesClientWithBaseURI creates an instance of the TargetComputeSizesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewTargetComputeSizesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) TargetComputeSizesClient { + return TargetComputeSizesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// ListByReplicationProtectedItems lists the available target compute sizes for a replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client TargetComputeSizesClient) ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result TargetComputeSizeCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizesClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.tcsc.Response.Response != nil { + sc = result.tcsc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectedItemsNextResults + req, err := client.ListByReplicationProtectedItemsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.tcsc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", resp, "Failure sending request") + return + } + + result.tcsc, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", resp, "Failure responding to request") + return + } + if result.tcsc.hasNextLink() && result.tcsc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectedItemsPreparer prepares the ListByReplicationProtectedItems request. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/targetComputeSizes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectedItemsSender sends the ListByReplicationProtectedItems request. The method will close the +// http.Response Body if it receives an error. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectedItemsResponder handles the response to the ListByReplicationProtectedItems request. The method always +// closes the http.Response Body. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsResponder(resp *http.Response) (result TargetComputeSizeCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectedItemsNextResults retrieves the next set of results, if any. +func (client TargetComputeSizesClient) listByReplicationProtectedItemsNextResults(ctx context.Context, lastResults TargetComputeSizeCollection) (result TargetComputeSizeCollection, err error) { + req, err := lastResults.targetComputeSizeCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectedItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result TargetComputeSizeCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizesClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectedItems(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + return +} diff --git a/services/recoveryservices/mgmt/2021-11-01/siterecovery/version.go b/services/recoveryservices/mgmt/2021-11-01/siterecovery/version.go new file mode 100644 index 000000000000..e8eeeda7a346 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-11-01/siterecovery/version.go @@ -0,0 +1,19 @@ +package siterecovery + +import "github.com/Azure/azure-sdk-for-go/version" + +// 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. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " siterecovery/2021-11-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/CHANGELOG.md b/services/recoveryservices/mgmt/2021-12-01/siterecovery/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/_meta.json b/services/recoveryservices/mgmt/2021-12-01/siterecovery/_meta.json new file mode 100644 index 000000000000..e574ecc04c55 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "16f5f98c30852b877949ea63418f609233470bf7", + "readme": "/_/azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.md", + "tag": "package-2021-12", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-12 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/client.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/client.go new file mode 100644 index 000000000000..49cb22738315 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/client.go @@ -0,0 +1,45 @@ +// Package siterecovery implements the Azure ARM Siterecovery service API version 2021-12-01. +// +// +package siterecovery + +// 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. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Siterecovery + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Siterecovery. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string + ResourceGroupName string + ResourceName string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string, resourceGroupName string, resourceName string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + ResourceGroupName: resourceGroupName, + ResourceName: resourceName, + } +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/enums.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/enums.go new file mode 100644 index 000000000000..80944d8b57f4 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/enums.go @@ -0,0 +1,1916 @@ +package siterecovery + +// 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. + +// A2ARecoveryAvailabilityType enumerates the values for a2a recovery availability type. +type A2ARecoveryAvailabilityType string + +const ( + // AvailabilitySet ... + AvailabilitySet A2ARecoveryAvailabilityType = "AvailabilitySet" + // AvailabilityZone ... + AvailabilityZone A2ARecoveryAvailabilityType = "AvailabilityZone" + // Single ... + Single A2ARecoveryAvailabilityType = "Single" +) + +// PossibleA2ARecoveryAvailabilityTypeValues returns an array of possible values for the A2ARecoveryAvailabilityType const type. +func PossibleA2ARecoveryAvailabilityTypeValues() []A2ARecoveryAvailabilityType { + return []A2ARecoveryAvailabilityType{AvailabilitySet, AvailabilityZone, Single} +} + +// A2ARpRecoveryPointType enumerates the values for a2a rp recovery point type. +type A2ARpRecoveryPointType string + +const ( + // Latest ... + Latest A2ARpRecoveryPointType = "Latest" + // LatestApplicationConsistent ... + LatestApplicationConsistent A2ARpRecoveryPointType = "LatestApplicationConsistent" + // LatestCrashConsistent ... + LatestCrashConsistent A2ARpRecoveryPointType = "LatestCrashConsistent" + // LatestProcessed ... + LatestProcessed A2ARpRecoveryPointType = "LatestProcessed" +) + +// PossibleA2ARpRecoveryPointTypeValues returns an array of possible values for the A2ARpRecoveryPointType const type. +func PossibleA2ARpRecoveryPointTypeValues() []A2ARpRecoveryPointType { + return []A2ARpRecoveryPointType{Latest, LatestApplicationConsistent, LatestCrashConsistent, LatestProcessed} +} + +// AgentAutoUpdateStatus enumerates the values for agent auto update status. +type AgentAutoUpdateStatus string + +const ( + // Disabled ... + Disabled AgentAutoUpdateStatus = "Disabled" + // Enabled ... + Enabled AgentAutoUpdateStatus = "Enabled" +) + +// PossibleAgentAutoUpdateStatusValues returns an array of possible values for the AgentAutoUpdateStatus const type. +func PossibleAgentAutoUpdateStatusValues() []AgentAutoUpdateStatus { + return []AgentAutoUpdateStatus{Disabled, Enabled} +} + +// AgentUpgradeBlockedReason enumerates the values for agent upgrade blocked reason. +type AgentUpgradeBlockedReason string + +const ( + // AgentNoHeartbeat ... + AgentNoHeartbeat AgentUpgradeBlockedReason = "AgentNoHeartbeat" + // AlreadyOnLatestVersion ... + AlreadyOnLatestVersion AgentUpgradeBlockedReason = "AlreadyOnLatestVersion" + // DistroIsNotReported ... + DistroIsNotReported AgentUpgradeBlockedReason = "DistroIsNotReported" + // DistroNotSupportedForUpgrade ... + DistroNotSupportedForUpgrade AgentUpgradeBlockedReason = "DistroNotSupportedForUpgrade" + // IncompatibleApplianceVersion ... + IncompatibleApplianceVersion AgentUpgradeBlockedReason = "IncompatibleApplianceVersion" + // InvalidAgentVersion ... + InvalidAgentVersion AgentUpgradeBlockedReason = "InvalidAgentVersion" + // InvalidDriverVersion ... + InvalidDriverVersion AgentUpgradeBlockedReason = "InvalidDriverVersion" + // MissingUpgradePath ... + MissingUpgradePath AgentUpgradeBlockedReason = "MissingUpgradePath" + // NotProtected ... + NotProtected AgentUpgradeBlockedReason = "NotProtected" + // ProcessServerNoHeartbeat ... + ProcessServerNoHeartbeat AgentUpgradeBlockedReason = "ProcessServerNoHeartbeat" + // RcmProxyNoHeartbeat ... + RcmProxyNoHeartbeat AgentUpgradeBlockedReason = "RcmProxyNoHeartbeat" + // RebootRequired ... + RebootRequired AgentUpgradeBlockedReason = "RebootRequired" + // Unknown ... + Unknown AgentUpgradeBlockedReason = "Unknown" + // UnsupportedProtectionScenario ... + UnsupportedProtectionScenario AgentUpgradeBlockedReason = "UnsupportedProtectionScenario" +) + +// PossibleAgentUpgradeBlockedReasonValues returns an array of possible values for the AgentUpgradeBlockedReason const type. +func PossibleAgentUpgradeBlockedReasonValues() []AgentUpgradeBlockedReason { + return []AgentUpgradeBlockedReason{AgentNoHeartbeat, AlreadyOnLatestVersion, DistroIsNotReported, DistroNotSupportedForUpgrade, IncompatibleApplianceVersion, InvalidAgentVersion, InvalidDriverVersion, MissingUpgradePath, NotProtected, ProcessServerNoHeartbeat, RcmProxyNoHeartbeat, RebootRequired, Unknown, UnsupportedProtectionScenario} +} + +// AgentVersionStatus enumerates the values for agent version status. +type AgentVersionStatus string + +const ( + // Deprecated ... + Deprecated AgentVersionStatus = "Deprecated" + // NotSupported ... + NotSupported AgentVersionStatus = "NotSupported" + // SecurityUpdateRequired ... + SecurityUpdateRequired AgentVersionStatus = "SecurityUpdateRequired" + // Supported ... + Supported AgentVersionStatus = "Supported" + // UpdateRequired ... + UpdateRequired AgentVersionStatus = "UpdateRequired" +) + +// PossibleAgentVersionStatusValues returns an array of possible values for the AgentVersionStatus const type. +func PossibleAgentVersionStatusValues() []AgentVersionStatus { + return []AgentVersionStatus{Deprecated, NotSupported, SecurityUpdateRequired, Supported, UpdateRequired} +} + +// AlternateLocationRecoveryOption enumerates the values for alternate location recovery option. +type AlternateLocationRecoveryOption string + +const ( + // CreateVMIfNotFound ... + CreateVMIfNotFound AlternateLocationRecoveryOption = "CreateVmIfNotFound" + // NoAction ... + NoAction AlternateLocationRecoveryOption = "NoAction" +) + +// PossibleAlternateLocationRecoveryOptionValues returns an array of possible values for the AlternateLocationRecoveryOption const type. +func PossibleAlternateLocationRecoveryOptionValues() []AlternateLocationRecoveryOption { + return []AlternateLocationRecoveryOption{CreateVMIfNotFound, NoAction} +} + +// AutomationAccountAuthenticationType enumerates the values for automation account authentication type. +type AutomationAccountAuthenticationType string + +const ( + // AutomationAccountAuthenticationTypeRunAsAccount ... + AutomationAccountAuthenticationTypeRunAsAccount AutomationAccountAuthenticationType = "RunAsAccount" + // AutomationAccountAuthenticationTypeSystemAssignedIdentity ... + AutomationAccountAuthenticationTypeSystemAssignedIdentity AutomationAccountAuthenticationType = "SystemAssignedIdentity" +) + +// PossibleAutomationAccountAuthenticationTypeValues returns an array of possible values for the AutomationAccountAuthenticationType const type. +func PossibleAutomationAccountAuthenticationTypeValues() []AutomationAccountAuthenticationType { + return []AutomationAccountAuthenticationType{AutomationAccountAuthenticationTypeRunAsAccount, AutomationAccountAuthenticationTypeSystemAssignedIdentity} +} + +// AutoProtectionOfDataDisk enumerates the values for auto protection of data disk. +type AutoProtectionOfDataDisk string + +const ( + // AutoProtectionOfDataDiskDisabled ... + AutoProtectionOfDataDiskDisabled AutoProtectionOfDataDisk = "Disabled" + // AutoProtectionOfDataDiskEnabled ... + AutoProtectionOfDataDiskEnabled AutoProtectionOfDataDisk = "Enabled" +) + +// PossibleAutoProtectionOfDataDiskValues returns an array of possible values for the AutoProtectionOfDataDisk const type. +func PossibleAutoProtectionOfDataDiskValues() []AutoProtectionOfDataDisk { + return []AutoProtectionOfDataDisk{AutoProtectionOfDataDiskDisabled, AutoProtectionOfDataDiskEnabled} +} + +// DataSyncStatus enumerates the values for data sync status. +type DataSyncStatus string + +const ( + // ForDownTime ... + ForDownTime DataSyncStatus = "ForDownTime" + // ForSynchronization ... + ForSynchronization DataSyncStatus = "ForSynchronization" +) + +// PossibleDataSyncStatusValues returns an array of possible values for the DataSyncStatus const type. +func PossibleDataSyncStatusValues() []DataSyncStatus { + return []DataSyncStatus{ForDownTime, ForSynchronization} +} + +// DisableProtectionReason enumerates the values for disable protection reason. +type DisableProtectionReason string + +const ( + // MigrationComplete ... + MigrationComplete DisableProtectionReason = "MigrationComplete" + // NotSpecified ... + NotSpecified DisableProtectionReason = "NotSpecified" +) + +// PossibleDisableProtectionReasonValues returns an array of possible values for the DisableProtectionReason const type. +func PossibleDisableProtectionReasonValues() []DisableProtectionReason { + return []DisableProtectionReason{MigrationComplete, NotSpecified} +} + +// DiskAccountType enumerates the values for disk account type. +type DiskAccountType string + +const ( + // PremiumLRS ... + PremiumLRS DiskAccountType = "Premium_LRS" + // StandardLRS ... + StandardLRS DiskAccountType = "Standard_LRS" + // StandardSSDLRS ... + StandardSSDLRS DiskAccountType = "StandardSSD_LRS" +) + +// PossibleDiskAccountTypeValues returns an array of possible values for the DiskAccountType const type. +func PossibleDiskAccountTypeValues() []DiskAccountType { + return []DiskAccountType{PremiumLRS, StandardLRS, StandardSSDLRS} +} + +// DiskReplicationProgressHealth enumerates the values for disk replication progress health. +type DiskReplicationProgressHealth string + +const ( + // InProgress ... + InProgress DiskReplicationProgressHealth = "InProgress" + // None ... + None DiskReplicationProgressHealth = "None" + // NoProgress ... + NoProgress DiskReplicationProgressHealth = "NoProgress" + // Queued ... + Queued DiskReplicationProgressHealth = "Queued" + // SlowProgress ... + SlowProgress DiskReplicationProgressHealth = "SlowProgress" +) + +// PossibleDiskReplicationProgressHealthValues returns an array of possible values for the DiskReplicationProgressHealth const type. +func PossibleDiskReplicationProgressHealthValues() []DiskReplicationProgressHealth { + return []DiskReplicationProgressHealth{InProgress, None, NoProgress, Queued, SlowProgress} +} + +// EthernetAddressType enumerates the values for ethernet address type. +type EthernetAddressType string + +const ( + // Dynamic ... + Dynamic EthernetAddressType = "Dynamic" + // Static ... + Static EthernetAddressType = "Static" +) + +// PossibleEthernetAddressTypeValues returns an array of possible values for the EthernetAddressType const type. +func PossibleEthernetAddressTypeValues() []EthernetAddressType { + return []EthernetAddressType{Dynamic, Static} +} + +// ExportJobOutputSerializationType enumerates the values for export job output serialization type. +type ExportJobOutputSerializationType string + +const ( + // Excel ... + Excel ExportJobOutputSerializationType = "Excel" + // JSON ... + JSON ExportJobOutputSerializationType = "Json" + // XML ... + XML ExportJobOutputSerializationType = "Xml" +) + +// PossibleExportJobOutputSerializationTypeValues returns an array of possible values for the ExportJobOutputSerializationType const type. +func PossibleExportJobOutputSerializationTypeValues() []ExportJobOutputSerializationType { + return []ExportJobOutputSerializationType{Excel, JSON, XML} +} + +// FailoverDeploymentModel enumerates the values for failover deployment model. +type FailoverDeploymentModel string + +const ( + // Classic ... + Classic FailoverDeploymentModel = "Classic" + // NotApplicable ... + NotApplicable FailoverDeploymentModel = "NotApplicable" + // ResourceManager ... + ResourceManager FailoverDeploymentModel = "ResourceManager" +) + +// PossibleFailoverDeploymentModelValues returns an array of possible values for the FailoverDeploymentModel const type. +func PossibleFailoverDeploymentModelValues() []FailoverDeploymentModel { + return []FailoverDeploymentModel{Classic, NotApplicable, ResourceManager} +} + +// HealthErrorCategory enumerates the values for health error category. +type HealthErrorCategory string + +const ( + // HealthErrorCategoryAgentAutoUpdateArtifactDeleted ... + HealthErrorCategoryAgentAutoUpdateArtifactDeleted HealthErrorCategory = "AgentAutoUpdateArtifactDeleted" + // HealthErrorCategoryAgentAutoUpdateInfra ... + HealthErrorCategoryAgentAutoUpdateInfra HealthErrorCategory = "AgentAutoUpdateInfra" + // HealthErrorCategoryAgentAutoUpdateRunAsAccount ... + HealthErrorCategoryAgentAutoUpdateRunAsAccount HealthErrorCategory = "AgentAutoUpdateRunAsAccount" + // HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired ... + HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired HealthErrorCategory = "AgentAutoUpdateRunAsAccountExpired" + // HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry ... + HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry HealthErrorCategory = "AgentAutoUpdateRunAsAccountExpiry" + // HealthErrorCategoryConfiguration ... + HealthErrorCategoryConfiguration HealthErrorCategory = "Configuration" + // HealthErrorCategoryFabricInfrastructure ... + HealthErrorCategoryFabricInfrastructure HealthErrorCategory = "FabricInfrastructure" + // HealthErrorCategoryNone ... + HealthErrorCategoryNone HealthErrorCategory = "None" + // HealthErrorCategoryReplication ... + HealthErrorCategoryReplication HealthErrorCategory = "Replication" + // HealthErrorCategoryTestFailover ... + HealthErrorCategoryTestFailover HealthErrorCategory = "TestFailover" + // HealthErrorCategoryVersionExpiry ... + HealthErrorCategoryVersionExpiry HealthErrorCategory = "VersionExpiry" +) + +// PossibleHealthErrorCategoryValues returns an array of possible values for the HealthErrorCategory const type. +func PossibleHealthErrorCategoryValues() []HealthErrorCategory { + return []HealthErrorCategory{HealthErrorCategoryAgentAutoUpdateArtifactDeleted, HealthErrorCategoryAgentAutoUpdateInfra, HealthErrorCategoryAgentAutoUpdateRunAsAccount, HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired, HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry, HealthErrorCategoryConfiguration, HealthErrorCategoryFabricInfrastructure, HealthErrorCategoryNone, HealthErrorCategoryReplication, HealthErrorCategoryTestFailover, HealthErrorCategoryVersionExpiry} +} + +// HealthErrorCustomerResolvability enumerates the values for health error customer resolvability. +type HealthErrorCustomerResolvability string + +const ( + // Allowed ... + Allowed HealthErrorCustomerResolvability = "Allowed" + // NotAllowed ... + NotAllowed HealthErrorCustomerResolvability = "NotAllowed" +) + +// PossibleHealthErrorCustomerResolvabilityValues returns an array of possible values for the HealthErrorCustomerResolvability const type. +func PossibleHealthErrorCustomerResolvabilityValues() []HealthErrorCustomerResolvability { + return []HealthErrorCustomerResolvability{Allowed, NotAllowed} +} + +// HyperVReplicaAzureRpRecoveryPointType enumerates the values for hyper v replica azure rp recovery point +// type. +type HyperVReplicaAzureRpRecoveryPointType string + +const ( + // HyperVReplicaAzureRpRecoveryPointTypeLatest ... + HyperVReplicaAzureRpRecoveryPointTypeLatest HyperVReplicaAzureRpRecoveryPointType = "Latest" + // HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent ... + HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent HyperVReplicaAzureRpRecoveryPointType = "LatestApplicationConsistent" + // HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed ... + HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed HyperVReplicaAzureRpRecoveryPointType = "LatestProcessed" +) + +// PossibleHyperVReplicaAzureRpRecoveryPointTypeValues returns an array of possible values for the HyperVReplicaAzureRpRecoveryPointType const type. +func PossibleHyperVReplicaAzureRpRecoveryPointTypeValues() []HyperVReplicaAzureRpRecoveryPointType { + return []HyperVReplicaAzureRpRecoveryPointType{HyperVReplicaAzureRpRecoveryPointTypeLatest, HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent, HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed} +} + +// InMageRcmFailbackRecoveryPointType enumerates the values for in mage rcm failback recovery point type. +type InMageRcmFailbackRecoveryPointType string + +const ( + // ApplicationConsistent ... + ApplicationConsistent InMageRcmFailbackRecoveryPointType = "ApplicationConsistent" + // CrashConsistent ... + CrashConsistent InMageRcmFailbackRecoveryPointType = "CrashConsistent" +) + +// PossibleInMageRcmFailbackRecoveryPointTypeValues returns an array of possible values for the InMageRcmFailbackRecoveryPointType const type. +func PossibleInMageRcmFailbackRecoveryPointTypeValues() []InMageRcmFailbackRecoveryPointType { + return []InMageRcmFailbackRecoveryPointType{ApplicationConsistent, CrashConsistent} +} + +// InMageV2RpRecoveryPointType enumerates the values for in mage v2 rp recovery point type. +type InMageV2RpRecoveryPointType string + +const ( + // InMageV2RpRecoveryPointTypeLatest ... + InMageV2RpRecoveryPointTypeLatest InMageV2RpRecoveryPointType = "Latest" + // InMageV2RpRecoveryPointTypeLatestApplicationConsistent ... + InMageV2RpRecoveryPointTypeLatestApplicationConsistent InMageV2RpRecoveryPointType = "LatestApplicationConsistent" + // InMageV2RpRecoveryPointTypeLatestCrashConsistent ... + InMageV2RpRecoveryPointTypeLatestCrashConsistent InMageV2RpRecoveryPointType = "LatestCrashConsistent" + // InMageV2RpRecoveryPointTypeLatestProcessed ... + InMageV2RpRecoveryPointTypeLatestProcessed InMageV2RpRecoveryPointType = "LatestProcessed" +) + +// PossibleInMageV2RpRecoveryPointTypeValues returns an array of possible values for the InMageV2RpRecoveryPointType const type. +func PossibleInMageV2RpRecoveryPointTypeValues() []InMageV2RpRecoveryPointType { + return []InMageV2RpRecoveryPointType{InMageV2RpRecoveryPointTypeLatest, InMageV2RpRecoveryPointTypeLatestApplicationConsistent, InMageV2RpRecoveryPointTypeLatestCrashConsistent, InMageV2RpRecoveryPointTypeLatestProcessed} +} + +// InstanceType enumerates the values for instance type. +type InstanceType string + +const ( + // InstanceTypeA2A ... + InstanceTypeA2A InstanceType = "A2A" + // InstanceTypeAddDisksProviderSpecificInput ... + InstanceTypeAddDisksProviderSpecificInput InstanceType = "AddDisksProviderSpecificInput" +) + +// PossibleInstanceTypeValues returns an array of possible values for the InstanceType const type. +func PossibleInstanceTypeValues() []InstanceType { + return []InstanceType{InstanceTypeA2A, InstanceTypeAddDisksProviderSpecificInput} +} + +// InstanceTypeBasicApplianceSpecificDetails enumerates the values for instance type basic appliance specific +// details. +type InstanceTypeBasicApplianceSpecificDetails string + +const ( + // InstanceTypeApplianceSpecificDetails ... + InstanceTypeApplianceSpecificDetails InstanceTypeBasicApplianceSpecificDetails = "ApplianceSpecificDetails" + // InstanceTypeInMageRcm ... + InstanceTypeInMageRcm InstanceTypeBasicApplianceSpecificDetails = "InMageRcm" +) + +// PossibleInstanceTypeBasicApplianceSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicApplianceSpecificDetails const type. +func PossibleInstanceTypeBasicApplianceSpecificDetailsValues() []InstanceTypeBasicApplianceSpecificDetails { + return []InstanceTypeBasicApplianceSpecificDetails{InstanceTypeApplianceSpecificDetails, InstanceTypeInMageRcm} +} + +// InstanceTypeBasicApplyRecoveryPointProviderSpecificInput enumerates the values for instance type basic apply +// recovery point provider specific input. +type InstanceTypeBasicApplyRecoveryPointProviderSpecificInput string + +const ( + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "A2A" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "ApplyRecoveryPointProviderSpecificInput" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "InMageRcm" +) + +// PossibleInstanceTypeBasicApplyRecoveryPointProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicApplyRecoveryPointProviderSpecificInput const type. +func PossibleInstanceTypeBasicApplyRecoveryPointProviderSpecificInputValues() []InstanceTypeBasicApplyRecoveryPointProviderSpecificInput { + return []InstanceTypeBasicApplyRecoveryPointProviderSpecificInput{InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm} +} + +// InstanceTypeBasicConfigurationSettings enumerates the values for instance type basic configuration settings. +type InstanceTypeBasicConfigurationSettings string + +const ( + // InstanceTypeConfigurationSettings ... + InstanceTypeConfigurationSettings InstanceTypeBasicConfigurationSettings = "ConfigurationSettings" + // InstanceTypeHyperVVirtualMachine ... + InstanceTypeHyperVVirtualMachine InstanceTypeBasicConfigurationSettings = "HyperVVirtualMachine" + // InstanceTypeReplicationGroupDetails ... + InstanceTypeReplicationGroupDetails InstanceTypeBasicConfigurationSettings = "ReplicationGroupDetails" + // InstanceTypeVmmVirtualMachine ... + InstanceTypeVmmVirtualMachine InstanceTypeBasicConfigurationSettings = "VmmVirtualMachine" + // InstanceTypeVMwareVirtualMachine ... + InstanceTypeVMwareVirtualMachine InstanceTypeBasicConfigurationSettings = "VMwareVirtualMachine" +) + +// PossibleInstanceTypeBasicConfigurationSettingsValues returns an array of possible values for the InstanceTypeBasicConfigurationSettings const type. +func PossibleInstanceTypeBasicConfigurationSettingsValues() []InstanceTypeBasicConfigurationSettings { + return []InstanceTypeBasicConfigurationSettings{InstanceTypeConfigurationSettings, InstanceTypeHyperVVirtualMachine, InstanceTypeReplicationGroupDetails, InstanceTypeVmmVirtualMachine, InstanceTypeVMwareVirtualMachine} +} + +// InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails enumerates the values for instance type basic +// create protection intent provider specific details. +type InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails string + +const ( + // InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails = "A2A" + // InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails ... + InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails = "CreateProtectionIntentProviderSpecificDetails" +) + +// PossibleInstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails const type. +func PossibleInstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsValues() []InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails { + return []InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails{InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails} +} + +// InstanceTypeBasicDisableProtectionProviderSpecificInput enumerates the values for instance type basic +// disable protection provider specific input. +type InstanceTypeBasicDisableProtectionProviderSpecificInput string + +const ( + // InstanceTypeDisableProtectionProviderSpecificInput ... + InstanceTypeDisableProtectionProviderSpecificInput InstanceTypeBasicDisableProtectionProviderSpecificInput = "DisableProtectionProviderSpecificInput" + // InstanceTypeInMage ... + InstanceTypeInMage InstanceTypeBasicDisableProtectionProviderSpecificInput = "InMage" +) + +// PossibleInstanceTypeBasicDisableProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicDisableProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicDisableProtectionProviderSpecificInputValues() []InstanceTypeBasicDisableProtectionProviderSpecificInput { + return []InstanceTypeBasicDisableProtectionProviderSpecificInput{InstanceTypeDisableProtectionProviderSpecificInput, InstanceTypeInMage} +} + +// InstanceTypeBasicEnableMigrationProviderSpecificInput enumerates the values for instance type basic enable +// migration provider specific input. +type InstanceTypeBasicEnableMigrationProviderSpecificInput string + +const ( + // InstanceTypeEnableMigrationProviderSpecificInput ... + InstanceTypeEnableMigrationProviderSpecificInput InstanceTypeBasicEnableMigrationProviderSpecificInput = "EnableMigrationProviderSpecificInput" + // InstanceTypeVMwareCbt ... + InstanceTypeVMwareCbt InstanceTypeBasicEnableMigrationProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicEnableMigrationProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicEnableMigrationProviderSpecificInput const type. +func PossibleInstanceTypeBasicEnableMigrationProviderSpecificInputValues() []InstanceTypeBasicEnableMigrationProviderSpecificInput { + return []InstanceTypeBasicEnableMigrationProviderSpecificInput{InstanceTypeEnableMigrationProviderSpecificInput, InstanceTypeVMwareCbt} +} + +// InstanceTypeBasicEnableProtectionProviderSpecificInput enumerates the values for instance type basic enable +// protection provider specific input. +type InstanceTypeBasicEnableProtectionProviderSpecificInput string + +const ( + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A InstanceTypeBasicEnableProtectionProviderSpecificInput = "A2A" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicEnableProtectionProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput InstanceTypeBasicEnableProtectionProviderSpecificInput = "EnableProtectionProviderSpecificInput" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicEnableProtectionProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMage" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMageRcm" +) + +// PossibleInstanceTypeBasicEnableProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicEnableProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicEnableProtectionProviderSpecificInputValues() []InstanceTypeBasicEnableProtectionProviderSpecificInput { + return []InstanceTypeBasicEnableProtectionProviderSpecificInput{InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm} +} + +// InstanceTypeBasicEventProviderSpecificDetails enumerates the values for instance type basic event provider +// specific details. +type InstanceTypeBasicEventProviderSpecificDetails string + +const ( + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicEventProviderSpecificDetails = "A2A" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails InstanceTypeBasicEventProviderSpecificDetails = "EventProviderSpecificDetails" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplica2012" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplica2012R2" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplicaAzure" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplicaBaseEventDetails" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicEventProviderSpecificDetails = "InMageAzureV2" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicEventProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback InstanceTypeBasicEventProviderSpecificDetails = "InMageRcmFailback" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicEventProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicEventProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicEventProviderSpecificDetails const type. +func PossibleInstanceTypeBasicEventProviderSpecificDetailsValues() []InstanceTypeBasicEventProviderSpecificDetails { + return []InstanceTypeBasicEventProviderSpecificDetails{InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicEventSpecificDetails enumerates the values for instance type basic event specific details. +type InstanceTypeBasicEventSpecificDetails string + +const ( + // InstanceTypeEventSpecificDetails ... + InstanceTypeEventSpecificDetails InstanceTypeBasicEventSpecificDetails = "EventSpecificDetails" + // InstanceTypeJobStatus ... + InstanceTypeJobStatus InstanceTypeBasicEventSpecificDetails = "JobStatus" +) + +// PossibleInstanceTypeBasicEventSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicEventSpecificDetails const type. +func PossibleInstanceTypeBasicEventSpecificDetailsValues() []InstanceTypeBasicEventSpecificDetails { + return []InstanceTypeBasicEventSpecificDetails{InstanceTypeEventSpecificDetails, InstanceTypeJobStatus} +} + +// InstanceTypeBasicFabricSpecificCreateNetworkMappingInput enumerates the values for instance type basic +// fabric specific create network mapping input. +type InstanceTypeBasicFabricSpecificCreateNetworkMappingInput string + +const ( + // InstanceTypeAzureToAzure ... + InstanceTypeAzureToAzure InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "AzureToAzure" + // InstanceTypeFabricSpecificCreateNetworkMappingInput ... + InstanceTypeFabricSpecificCreateNetworkMappingInput InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "FabricSpecificCreateNetworkMappingInput" + // InstanceTypeVmmToAzure ... + InstanceTypeVmmToAzure InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "VmmToAzure" + // InstanceTypeVmmToVmm ... + InstanceTypeVmmToVmm InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "VmmToVmm" +) + +// PossibleInstanceTypeBasicFabricSpecificCreateNetworkMappingInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificCreateNetworkMappingInput const type. +func PossibleInstanceTypeBasicFabricSpecificCreateNetworkMappingInputValues() []InstanceTypeBasicFabricSpecificCreateNetworkMappingInput { + return []InstanceTypeBasicFabricSpecificCreateNetworkMappingInput{InstanceTypeAzureToAzure, InstanceTypeFabricSpecificCreateNetworkMappingInput, InstanceTypeVmmToAzure, InstanceTypeVmmToVmm} +} + +// InstanceTypeBasicFabricSpecificCreationInput enumerates the values for instance type basic fabric specific +// creation input. +type InstanceTypeBasicFabricSpecificCreationInput string + +const ( + // InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure ... + InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure InstanceTypeBasicFabricSpecificCreationInput = "Azure" + // InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput ... + InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput InstanceTypeBasicFabricSpecificCreationInput = "FabricSpecificCreationInput" + // InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm ... + InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm InstanceTypeBasicFabricSpecificCreationInput = "InMageRcm" + // InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2 ... + InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2 InstanceTypeBasicFabricSpecificCreationInput = "VMwareV2" +) + +// PossibleInstanceTypeBasicFabricSpecificCreationInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificCreationInput const type. +func PossibleInstanceTypeBasicFabricSpecificCreationInputValues() []InstanceTypeBasicFabricSpecificCreationInput { + return []InstanceTypeBasicFabricSpecificCreationInput{InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure, InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput, InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm, InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2} +} + +// InstanceTypeBasicFabricSpecificDetails enumerates the values for instance type basic fabric specific +// details. +type InstanceTypeBasicFabricSpecificDetails string + +const ( + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure InstanceTypeBasicFabricSpecificDetails = "Azure" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails InstanceTypeBasicFabricSpecificDetails = "FabricSpecificDetails" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite InstanceTypeBasicFabricSpecificDetails = "HyperVSite" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicFabricSpecificDetails = "InMageRcm" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM InstanceTypeBasicFabricSpecificDetails = "VMM" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware InstanceTypeBasicFabricSpecificDetails = "VMware" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 InstanceTypeBasicFabricSpecificDetails = "VMwareV2" +) + +// PossibleInstanceTypeBasicFabricSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicFabricSpecificDetails const type. +func PossibleInstanceTypeBasicFabricSpecificDetailsValues() []InstanceTypeBasicFabricSpecificDetails { + return []InstanceTypeBasicFabricSpecificDetails{InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure, InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails, InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite, InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2} +} + +// InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput enumerates the values for instance type basic +// fabric specific update network mapping input. +type InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput string + +const ( + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "AzureToAzure" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "FabricSpecificUpdateNetworkMappingInput" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "VmmToAzure" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "VmmToVmm" +) + +// PossibleInstanceTypeBasicFabricSpecificUpdateNetworkMappingInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput const type. +func PossibleInstanceTypeBasicFabricSpecificUpdateNetworkMappingInputValues() []InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput { + return []InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput{InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm} +} + +// InstanceTypeBasicGroupTaskDetails enumerates the values for instance type basic group task details. +type InstanceTypeBasicGroupTaskDetails string + +const ( + // InstanceTypeGroupTaskDetails ... + InstanceTypeGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "GroupTaskDetails" + // InstanceTypeInlineWorkflowTaskDetails ... + InstanceTypeInlineWorkflowTaskDetails InstanceTypeBasicGroupTaskDetails = "InlineWorkflowTaskDetails" + // InstanceTypeRecoveryPlanGroupTaskDetails ... + InstanceTypeRecoveryPlanGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "RecoveryPlanGroupTaskDetails" + // InstanceTypeRecoveryPlanShutdownGroupTaskDetails ... + InstanceTypeRecoveryPlanShutdownGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "RecoveryPlanShutdownGroupTaskDetails" +) + +// PossibleInstanceTypeBasicGroupTaskDetailsValues returns an array of possible values for the InstanceTypeBasicGroupTaskDetails const type. +func PossibleInstanceTypeBasicGroupTaskDetailsValues() []InstanceTypeBasicGroupTaskDetails { + return []InstanceTypeBasicGroupTaskDetails{InstanceTypeGroupTaskDetails, InstanceTypeInlineWorkflowTaskDetails, InstanceTypeRecoveryPlanGroupTaskDetails, InstanceTypeRecoveryPlanShutdownGroupTaskDetails} +} + +// InstanceTypeBasicJobDetails enumerates the values for instance type basic job details. +type InstanceTypeBasicJobDetails string + +const ( + // InstanceTypeAsrJobDetails ... + InstanceTypeAsrJobDetails InstanceTypeBasicJobDetails = "AsrJobDetails" + // InstanceTypeExportJobDetails ... + InstanceTypeExportJobDetails InstanceTypeBasicJobDetails = "ExportJobDetails" + // InstanceTypeFailoverJobDetails ... + InstanceTypeFailoverJobDetails InstanceTypeBasicJobDetails = "FailoverJobDetails" + // InstanceTypeJobDetails ... + InstanceTypeJobDetails InstanceTypeBasicJobDetails = "JobDetails" + // InstanceTypeSwitchProtectionJobDetails ... + InstanceTypeSwitchProtectionJobDetails InstanceTypeBasicJobDetails = "SwitchProtectionJobDetails" + // InstanceTypeTestFailoverJobDetails ... + InstanceTypeTestFailoverJobDetails InstanceTypeBasicJobDetails = "TestFailoverJobDetails" +) + +// PossibleInstanceTypeBasicJobDetailsValues returns an array of possible values for the InstanceTypeBasicJobDetails const type. +func PossibleInstanceTypeBasicJobDetailsValues() []InstanceTypeBasicJobDetails { + return []InstanceTypeBasicJobDetails{InstanceTypeAsrJobDetails, InstanceTypeExportJobDetails, InstanceTypeFailoverJobDetails, InstanceTypeJobDetails, InstanceTypeSwitchProtectionJobDetails, InstanceTypeTestFailoverJobDetails} +} + +// InstanceTypeBasicMigrateProviderSpecificInput enumerates the values for instance type basic migrate provider +// specific input. +type InstanceTypeBasicMigrateProviderSpecificInput string + +const ( + // InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput ... + InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput InstanceTypeBasicMigrateProviderSpecificInput = "MigrateProviderSpecificInput" + // InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicMigrateProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicMigrateProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicMigrateProviderSpecificInput const type. +func PossibleInstanceTypeBasicMigrateProviderSpecificInputValues() []InstanceTypeBasicMigrateProviderSpecificInput { + return []InstanceTypeBasicMigrateProviderSpecificInput{InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput, InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicMigrationProviderSpecificSettings enumerates the values for instance type basic migration +// provider specific settings. +type InstanceTypeBasicMigrationProviderSpecificSettings string + +const ( + // InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings ... + InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings InstanceTypeBasicMigrationProviderSpecificSettings = "MigrationProviderSpecificSettings" + // InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt ... + InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt InstanceTypeBasicMigrationProviderSpecificSettings = "VMwareCbt" +) + +// PossibleInstanceTypeBasicMigrationProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicMigrationProviderSpecificSettings const type. +func PossibleInstanceTypeBasicMigrationProviderSpecificSettingsValues() []InstanceTypeBasicMigrationProviderSpecificSettings { + return []InstanceTypeBasicMigrationProviderSpecificSettings{InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings, InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicNetworkMappingFabricSpecificSettings enumerates the values for instance type basic network +// mapping fabric specific settings. +type InstanceTypeBasicNetworkMappingFabricSpecificSettings string + +const ( + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure InstanceTypeBasicNetworkMappingFabricSpecificSettings = "AzureToAzure" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings InstanceTypeBasicNetworkMappingFabricSpecificSettings = "NetworkMappingFabricSpecificSettings" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure InstanceTypeBasicNetworkMappingFabricSpecificSettings = "VmmToAzure" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm InstanceTypeBasicNetworkMappingFabricSpecificSettings = "VmmToVmm" +) + +// PossibleInstanceTypeBasicNetworkMappingFabricSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicNetworkMappingFabricSpecificSettings const type. +func PossibleInstanceTypeBasicNetworkMappingFabricSpecificSettingsValues() []InstanceTypeBasicNetworkMappingFabricSpecificSettings { + return []InstanceTypeBasicNetworkMappingFabricSpecificSettings{InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm} +} + +// InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput enumerates the values for instance type basic +// planned failover provider specific failover input. +type InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput string + +const ( + // InstanceTypeHyperVReplicaAzure ... + InstanceTypeHyperVReplicaAzure InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "HyperVReplicaAzure" + // InstanceTypeHyperVReplicaAzureFailback ... + InstanceTypeHyperVReplicaAzureFailback InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "HyperVReplicaAzureFailback" + // InstanceTypeInMageRcmFailback ... + InstanceTypeInMageRcmFailback InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "InMageRcmFailback" + // InstanceTypePlannedFailoverProviderSpecificFailoverInput ... + InstanceTypePlannedFailoverProviderSpecificFailoverInput InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "PlannedFailoverProviderSpecificFailoverInput" +) + +// PossibleInstanceTypeBasicPlannedFailoverProviderSpecificFailoverInputValues returns an array of possible values for the InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput const type. +func PossibleInstanceTypeBasicPlannedFailoverProviderSpecificFailoverInputValues() []InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput { + return []InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput{InstanceTypeHyperVReplicaAzure, InstanceTypeHyperVReplicaAzureFailback, InstanceTypeInMageRcmFailback, InstanceTypePlannedFailoverProviderSpecificFailoverInput} +} + +// InstanceTypeBasicPolicyProviderSpecificDetails enumerates the values for instance type basic policy provider +// specific details. +type InstanceTypeBasicPolicyProviderSpecificDetails string + +const ( + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicPolicyProviderSpecificDetails = "A2A" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplica2012" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplica2012R2" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplicaAzure" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplicaBasePolicyDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage InstanceTypeBasicPolicyProviderSpecificDetails = "InMage" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicPolicyProviderSpecificDetails = "InMageAzureV2" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails InstanceTypeBasicPolicyProviderSpecificDetails = "InMageBasePolicyDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicPolicyProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback InstanceTypeBasicPolicyProviderSpecificDetails = "InMageRcmFailback" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails InstanceTypeBasicPolicyProviderSpecificDetails = "PolicyProviderSpecificDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicPolicyProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicPolicyProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicPolicyProviderSpecificDetails const type. +func PossibleInstanceTypeBasicPolicyProviderSpecificDetailsValues() []InstanceTypeBasicPolicyProviderSpecificDetails { + return []InstanceTypeBasicPolicyProviderSpecificDetails{InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicPolicyProviderSpecificInput enumerates the values for instance type basic policy provider +// specific input. +type InstanceTypeBasicPolicyProviderSpecificInput string + +const ( + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A InstanceTypeBasicPolicyProviderSpecificInput = "A2A" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicPolicyProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplica2012" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplica2012R2" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage InstanceTypeBasicPolicyProviderSpecificInput = "InMage" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicPolicyProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicPolicyProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback InstanceTypeBasicPolicyProviderSpecificInput = "InMageRcmFailback" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput InstanceTypeBasicPolicyProviderSpecificInput = "PolicyProviderSpecificInput" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicPolicyProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicPolicyProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicPolicyProviderSpecificInput const type. +func PossibleInstanceTypeBasicPolicyProviderSpecificInputValues() []InstanceTypeBasicPolicyProviderSpecificInput { + return []InstanceTypeBasicPolicyProviderSpecificInput{InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails enumerates the values for instance type +// basic protection container mapping provider specific details. +type InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails string + +const ( + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "A2A" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "ProtectionContainerMappingProviderSpecificDetails" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails const type. +func PossibleInstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsValues() []InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails { + return []InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails{InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicProviderSpecificRecoveryPointDetails enumerates the values for instance type basic provider +// specific recovery point details. +type InstanceTypeBasicProviderSpecificRecoveryPointDetails string + +const ( + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A InstanceTypeBasicProviderSpecificRecoveryPointDetails = "A2A" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicProviderSpecificRecoveryPointDetails = "InMageAzureV2" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm InstanceTypeBasicProviderSpecificRecoveryPointDetails = "InMageRcm" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails InstanceTypeBasicProviderSpecificRecoveryPointDetails = "ProviderSpecificRecoveryPointDetails" +) + +// PossibleInstanceTypeBasicProviderSpecificRecoveryPointDetailsValues returns an array of possible values for the InstanceTypeBasicProviderSpecificRecoveryPointDetails const type. +func PossibleInstanceTypeBasicProviderSpecificRecoveryPointDetailsValues() []InstanceTypeBasicProviderSpecificRecoveryPointDetails { + return []InstanceTypeBasicProviderSpecificRecoveryPointDetails{InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails} +} + +// InstanceTypeBasicRecoveryPlanActionDetails enumerates the values for instance type basic recovery plan +// action details. +type InstanceTypeBasicRecoveryPlanActionDetails string + +const ( + // InstanceTypeAutomationRunbookActionDetails ... + InstanceTypeAutomationRunbookActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "AutomationRunbookActionDetails" + // InstanceTypeManualActionDetails ... + InstanceTypeManualActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "ManualActionDetails" + // InstanceTypeRecoveryPlanActionDetails ... + InstanceTypeRecoveryPlanActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "RecoveryPlanActionDetails" + // InstanceTypeScriptActionDetails ... + InstanceTypeScriptActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "ScriptActionDetails" +) + +// PossibleInstanceTypeBasicRecoveryPlanActionDetailsValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanActionDetails const type. +func PossibleInstanceTypeBasicRecoveryPlanActionDetailsValues() []InstanceTypeBasicRecoveryPlanActionDetails { + return []InstanceTypeBasicRecoveryPlanActionDetails{InstanceTypeAutomationRunbookActionDetails, InstanceTypeManualActionDetails, InstanceTypeRecoveryPlanActionDetails, InstanceTypeScriptActionDetails} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificDetails enumerates the values for instance type basic recovery +// plan provider specific details. +type InstanceTypeBasicRecoveryPlanProviderSpecificDetails string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificDetails = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails ... + InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails InstanceTypeBasicRecoveryPlanProviderSpecificDetails = "RecoveryPlanProviderSpecificDetails" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificDetails const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificDetailsValues() []InstanceTypeBasicRecoveryPlanProviderSpecificDetails { + return []InstanceTypeBasicRecoveryPlanProviderSpecificDetails{InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput enumerates the values for instance type basic +// recovery plan provider specific failover input. +type InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "HyperVReplicaAzure" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "HyperVReplicaAzureFailback" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMage" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageAzureV2" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageRcm" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageRcmFailback" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "RecoveryPlanProviderSpecificFailoverInput" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputValues() []InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput { + return []InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput{InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificInput enumerates the values for instance type basic recovery +// plan provider specific input. +type InstanceTypeBasicRecoveryPlanProviderSpecificInput string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificInput = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput ... + InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput InstanceTypeBasicRecoveryPlanProviderSpecificInput = "RecoveryPlanProviderSpecificInput" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificInput const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificInputValues() []InstanceTypeBasicRecoveryPlanProviderSpecificInput { + return []InstanceTypeBasicRecoveryPlanProviderSpecificInput{InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput} +} + +// InstanceTypeBasicRemoveDisksProviderSpecificInput enumerates the values for instance type basic remove disks +// provider specific input. +type InstanceTypeBasicRemoveDisksProviderSpecificInput string + +const ( + // InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A InstanceTypeBasicRemoveDisksProviderSpecificInput = "A2A" + // InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput ... + InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput InstanceTypeBasicRemoveDisksProviderSpecificInput = "RemoveDisksProviderSpecificInput" +) + +// PossibleInstanceTypeBasicRemoveDisksProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicRemoveDisksProviderSpecificInput const type. +func PossibleInstanceTypeBasicRemoveDisksProviderSpecificInputValues() []InstanceTypeBasicRemoveDisksProviderSpecificInput { + return []InstanceTypeBasicRemoveDisksProviderSpecificInput{InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput} +} + +// InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings enumerates the values for instance type +// basic replication protection intent provider specific settings. +type InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings string + +const ( + // InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A ... + InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings = "A2A" + // InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings ... + InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings = "ReplicationProtectionIntentProviderSpecificSettings" +) + +// PossibleInstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings const type. +func PossibleInstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsValues() []InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings { + return []InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings{InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A, InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings} +} + +// InstanceTypeBasicReplicationProviderSpecificContainerCreationInput enumerates the values for instance type +// basic replication provider specific container creation input. +type InstanceTypeBasicReplicationProviderSpecificContainerCreationInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "A2ACrossClusterMigration" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "ReplicationProviderSpecificContainerCreationInput" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificContainerCreationInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificContainerCreationInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificContainerCreationInputValues() []InstanceTypeBasicReplicationProviderSpecificContainerCreationInput { + return []InstanceTypeBasicReplicationProviderSpecificContainerCreationInput{InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReplicationProviderSpecificContainerMappingInput enumerates the values for instance type +// basic replication provider specific container mapping input. +type InstanceTypeBasicReplicationProviderSpecificContainerMappingInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "ReplicationProviderSpecificContainerMappingInput" + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificContainerMappingInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificContainerMappingInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificContainerMappingInputValues() []InstanceTypeBasicReplicationProviderSpecificContainerMappingInput { + return []InstanceTypeBasicReplicationProviderSpecificContainerMappingInput{InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput, InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReplicationProviderSpecificSettings enumerates the values for instance type basic +// replication provider specific settings. +type InstanceTypeBasicReplicationProviderSpecificSettings string + +const ( + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificSettings = "A2A" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration InstanceTypeBasicReplicationProviderSpecificSettings = "A2ACrossClusterMigration" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplica2012" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplica2012R2" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplicaAzure" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplicaBaseReplicationDetails" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage InstanceTypeBasicReplicationProviderSpecificSettings = "InMage" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 InstanceTypeBasicReplicationProviderSpecificSettings = "InMageAzureV2" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm InstanceTypeBasicReplicationProviderSpecificSettings = "InMageRcm" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback InstanceTypeBasicReplicationProviderSpecificSettings = "InMageRcmFailback" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings InstanceTypeBasicReplicationProviderSpecificSettings = "ReplicationProviderSpecificSettings" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificSettings const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificSettingsValues() []InstanceTypeBasicReplicationProviderSpecificSettings { + return []InstanceTypeBasicReplicationProviderSpecificSettings{InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings} +} + +// InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput enumerates the values for instance +// type basic replication provider specific update container mapping input. +type InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "InMageRcm" + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "ReplicationProviderSpecificUpdateContainerMappingInput" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputValues() []InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput { + return []InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput{InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm, InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput} +} + +// InstanceTypeBasicResyncProviderSpecificInput enumerates the values for instance type basic resync provider +// specific input. +type InstanceTypeBasicResyncProviderSpecificInput string + +const ( + // InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput ... + InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput InstanceTypeBasicResyncProviderSpecificInput = "ResyncProviderSpecificInput" + // InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicResyncProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicResyncProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicResyncProviderSpecificInput const type. +func PossibleInstanceTypeBasicResyncProviderSpecificInputValues() []InstanceTypeBasicResyncProviderSpecificInput { + return []InstanceTypeBasicResyncProviderSpecificInput{InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput, InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReverseReplicationProviderSpecificInput enumerates the values for instance type basic +// reverse replication provider specific input. +type InstanceTypeBasicReverseReplicationProviderSpecificInput string + +const ( + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A InstanceTypeBasicReverseReplicationProviderSpecificInput = "A2A" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicReverseReplicationProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMage" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageRcmFailback" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput InstanceTypeBasicReverseReplicationProviderSpecificInput = "ReverseReplicationProviderSpecificInput" +) + +// PossibleInstanceTypeBasicReverseReplicationProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicReverseReplicationProviderSpecificInput const type. +func PossibleInstanceTypeBasicReverseReplicationProviderSpecificInputValues() []InstanceTypeBasicReverseReplicationProviderSpecificInput { + return []InstanceTypeBasicReverseReplicationProviderSpecificInput{InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput} +} + +// InstanceTypeBasicSwitchProtectionProviderSpecificInput enumerates the values for instance type basic switch +// protection provider specific input. +type InstanceTypeBasicSwitchProtectionProviderSpecificInput string + +const ( + // InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A InstanceTypeBasicSwitchProtectionProviderSpecificInput = "A2A" + // InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput ... + InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput InstanceTypeBasicSwitchProtectionProviderSpecificInput = "SwitchProtectionProviderSpecificInput" +) + +// PossibleInstanceTypeBasicSwitchProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicSwitchProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicSwitchProtectionProviderSpecificInputValues() []InstanceTypeBasicSwitchProtectionProviderSpecificInput { + return []InstanceTypeBasicSwitchProtectionProviderSpecificInput{InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput} +} + +// InstanceTypeBasicSwitchProviderProviderSpecificInput enumerates the values for instance type basic switch +// provider provider specific input. +type InstanceTypeBasicSwitchProviderProviderSpecificInput string + +const ( + // InstanceTypeInMageAzureV2 ... + InstanceTypeInMageAzureV2 InstanceTypeBasicSwitchProviderProviderSpecificInput = "InMageAzureV2" + // InstanceTypeSwitchProviderProviderSpecificInput ... + InstanceTypeSwitchProviderProviderSpecificInput InstanceTypeBasicSwitchProviderProviderSpecificInput = "SwitchProviderProviderSpecificInput" +) + +// PossibleInstanceTypeBasicSwitchProviderProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicSwitchProviderProviderSpecificInput const type. +func PossibleInstanceTypeBasicSwitchProviderProviderSpecificInputValues() []InstanceTypeBasicSwitchProviderProviderSpecificInput { + return []InstanceTypeBasicSwitchProviderProviderSpecificInput{InstanceTypeInMageAzureV2, InstanceTypeSwitchProviderProviderSpecificInput} +} + +// InstanceTypeBasicTaskTypeDetails enumerates the values for instance type basic task type details. +type InstanceTypeBasicTaskTypeDetails string + +const ( + // InstanceTypeAutomationRunbookTaskDetails ... + InstanceTypeAutomationRunbookTaskDetails InstanceTypeBasicTaskTypeDetails = "AutomationRunbookTaskDetails" + // InstanceTypeConsistencyCheckTaskDetails ... + InstanceTypeConsistencyCheckTaskDetails InstanceTypeBasicTaskTypeDetails = "ConsistencyCheckTaskDetails" + // InstanceTypeFabricReplicationGroupTaskDetails ... + InstanceTypeFabricReplicationGroupTaskDetails InstanceTypeBasicTaskTypeDetails = "FabricReplicationGroupTaskDetails" + // InstanceTypeJobTaskDetails ... + InstanceTypeJobTaskDetails InstanceTypeBasicTaskTypeDetails = "JobTaskDetails" + // InstanceTypeManualActionTaskDetails ... + InstanceTypeManualActionTaskDetails InstanceTypeBasicTaskTypeDetails = "ManualActionTaskDetails" + // InstanceTypeScriptActionTaskDetails ... + InstanceTypeScriptActionTaskDetails InstanceTypeBasicTaskTypeDetails = "ScriptActionTaskDetails" + // InstanceTypeTaskTypeDetails ... + InstanceTypeTaskTypeDetails InstanceTypeBasicTaskTypeDetails = "TaskTypeDetails" + // InstanceTypeVirtualMachineTaskDetails ... + InstanceTypeVirtualMachineTaskDetails InstanceTypeBasicTaskTypeDetails = "VirtualMachineTaskDetails" + // InstanceTypeVMNicUpdatesTaskDetails ... + InstanceTypeVMNicUpdatesTaskDetails InstanceTypeBasicTaskTypeDetails = "VmNicUpdatesTaskDetails" +) + +// PossibleInstanceTypeBasicTaskTypeDetailsValues returns an array of possible values for the InstanceTypeBasicTaskTypeDetails const type. +func PossibleInstanceTypeBasicTaskTypeDetailsValues() []InstanceTypeBasicTaskTypeDetails { + return []InstanceTypeBasicTaskTypeDetails{InstanceTypeAutomationRunbookTaskDetails, InstanceTypeConsistencyCheckTaskDetails, InstanceTypeFabricReplicationGroupTaskDetails, InstanceTypeJobTaskDetails, InstanceTypeManualActionTaskDetails, InstanceTypeScriptActionTaskDetails, InstanceTypeTaskTypeDetails, InstanceTypeVirtualMachineTaskDetails, InstanceTypeVMNicUpdatesTaskDetails} +} + +// InstanceTypeBasicTestFailoverProviderSpecificInput enumerates the values for instance type basic test +// failover provider specific input. +type InstanceTypeBasicTestFailoverProviderSpecificInput string + +const ( + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A InstanceTypeBasicTestFailoverProviderSpecificInput = "A2A" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicTestFailoverProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage InstanceTypeBasicTestFailoverProviderSpecificInput = "InMage" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicTestFailoverProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicTestFailoverProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput InstanceTypeBasicTestFailoverProviderSpecificInput = "TestFailoverProviderSpecificInput" +) + +// PossibleInstanceTypeBasicTestFailoverProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicTestFailoverProviderSpecificInput const type. +func PossibleInstanceTypeBasicTestFailoverProviderSpecificInputValues() []InstanceTypeBasicTestFailoverProviderSpecificInput { + return []InstanceTypeBasicTestFailoverProviderSpecificInput{InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput} +} + +// InstanceTypeBasicTestMigrateProviderSpecificInput enumerates the values for instance type basic test migrate +// provider specific input. +type InstanceTypeBasicTestMigrateProviderSpecificInput string + +const ( + // InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput ... + InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput InstanceTypeBasicTestMigrateProviderSpecificInput = "TestMigrateProviderSpecificInput" + // InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicTestMigrateProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicTestMigrateProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicTestMigrateProviderSpecificInput const type. +func PossibleInstanceTypeBasicTestMigrateProviderSpecificInputValues() []InstanceTypeBasicTestMigrateProviderSpecificInput { + return []InstanceTypeBasicTestMigrateProviderSpecificInput{InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput, InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicUnplannedFailoverProviderSpecificInput enumerates the values for instance type basic +// unplanned failover provider specific input. +type InstanceTypeBasicUnplannedFailoverProviderSpecificInput string + +const ( + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "A2A" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMage" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "UnplannedFailoverProviderSpecificInput" +) + +// PossibleInstanceTypeBasicUnplannedFailoverProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUnplannedFailoverProviderSpecificInput const type. +func PossibleInstanceTypeBasicUnplannedFailoverProviderSpecificInputValues() []InstanceTypeBasicUnplannedFailoverProviderSpecificInput { + return []InstanceTypeBasicUnplannedFailoverProviderSpecificInput{InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput} +} + +// InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput enumerates the values for +// instance type basic update appliance for replication protected item provider specific input. +type InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput string + +const ( + // InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput ... + InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput = "UpdateApplianceForReplicationProtectedItemProviderSpecificInput" +) + +// PossibleInstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput const type. +func PossibleInstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputValues() []InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput { + return []InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput{InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput} +} + +// InstanceTypeBasicUpdateMigrationItemProviderSpecificInput enumerates the values for instance type basic +// update migration item provider specific input. +type InstanceTypeBasicUpdateMigrationItemProviderSpecificInput string + +const ( + // InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput ... + InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput InstanceTypeBasicUpdateMigrationItemProviderSpecificInput = "UpdateMigrationItemProviderSpecificInput" + // InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicUpdateMigrationItemProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicUpdateMigrationItemProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUpdateMigrationItemProviderSpecificInput const type. +func PossibleInstanceTypeBasicUpdateMigrationItemProviderSpecificInputValues() []InstanceTypeBasicUpdateMigrationItemProviderSpecificInput { + return []InstanceTypeBasicUpdateMigrationItemProviderSpecificInput{InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput, InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicUpdateReplicationProtectedItemProviderInput enumerates the values for instance type basic +// update replication protected item provider input. +type InstanceTypeBasicUpdateReplicationProtectedItemProviderInput string + +const ( + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "A2A" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "HyperVReplicaAzure" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "InMageAzureV2" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "InMageRcm" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "UpdateReplicationProtectedItemProviderInput" +) + +// PossibleInstanceTypeBasicUpdateReplicationProtectedItemProviderInputValues returns an array of possible values for the InstanceTypeBasicUpdateReplicationProtectedItemProviderInput const type. +func PossibleInstanceTypeBasicUpdateReplicationProtectedItemProviderInputValues() []InstanceTypeBasicUpdateReplicationProtectedItemProviderInput { + return []InstanceTypeBasicUpdateReplicationProtectedItemProviderInput{InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput} +} + +// LicenseType enumerates the values for license type. +type LicenseType string + +const ( + // LicenseTypeNoLicenseType ... + LicenseTypeNoLicenseType LicenseType = "NoLicenseType" + // LicenseTypeNotSpecified ... + LicenseTypeNotSpecified LicenseType = "NotSpecified" + // LicenseTypeWindowsServer ... + LicenseTypeWindowsServer LicenseType = "WindowsServer" +) + +// PossibleLicenseTypeValues returns an array of possible values for the LicenseType const type. +func PossibleLicenseTypeValues() []LicenseType { + return []LicenseType{LicenseTypeNoLicenseType, LicenseTypeNotSpecified, LicenseTypeWindowsServer} +} + +// MigrationItemOperation enumerates the values for migration item operation. +type MigrationItemOperation string + +const ( + // DisableMigration ... + DisableMigration MigrationItemOperation = "DisableMigration" + // Migrate ... + Migrate MigrationItemOperation = "Migrate" + // StartResync ... + StartResync MigrationItemOperation = "StartResync" + // TestMigrate ... + TestMigrate MigrationItemOperation = "TestMigrate" + // TestMigrateCleanup ... + TestMigrateCleanup MigrationItemOperation = "TestMigrateCleanup" +) + +// PossibleMigrationItemOperationValues returns an array of possible values for the MigrationItemOperation const type. +func PossibleMigrationItemOperationValues() []MigrationItemOperation { + return []MigrationItemOperation{DisableMigration, Migrate, StartResync, TestMigrate, TestMigrateCleanup} +} + +// MigrationRecoveryPointType enumerates the values for migration recovery point type. +type MigrationRecoveryPointType string + +const ( + // MigrationRecoveryPointTypeApplicationConsistent ... + MigrationRecoveryPointTypeApplicationConsistent MigrationRecoveryPointType = "ApplicationConsistent" + // MigrationRecoveryPointTypeCrashConsistent ... + MigrationRecoveryPointTypeCrashConsistent MigrationRecoveryPointType = "CrashConsistent" + // MigrationRecoveryPointTypeNotSpecified ... + MigrationRecoveryPointTypeNotSpecified MigrationRecoveryPointType = "NotSpecified" +) + +// PossibleMigrationRecoveryPointTypeValues returns an array of possible values for the MigrationRecoveryPointType const type. +func PossibleMigrationRecoveryPointTypeValues() []MigrationRecoveryPointType { + return []MigrationRecoveryPointType{MigrationRecoveryPointTypeApplicationConsistent, MigrationRecoveryPointTypeCrashConsistent, MigrationRecoveryPointTypeNotSpecified} +} + +// MigrationState enumerates the values for migration state. +type MigrationState string + +const ( + // MigrationStateDisableMigrationFailed ... + MigrationStateDisableMigrationFailed MigrationState = "DisableMigrationFailed" + // MigrationStateDisableMigrationInProgress ... + MigrationStateDisableMigrationInProgress MigrationState = "DisableMigrationInProgress" + // MigrationStateEnableMigrationFailed ... + MigrationStateEnableMigrationFailed MigrationState = "EnableMigrationFailed" + // MigrationStateEnableMigrationInProgress ... + MigrationStateEnableMigrationInProgress MigrationState = "EnableMigrationInProgress" + // MigrationStateInitialSeedingFailed ... + MigrationStateInitialSeedingFailed MigrationState = "InitialSeedingFailed" + // MigrationStateInitialSeedingInProgress ... + MigrationStateInitialSeedingInProgress MigrationState = "InitialSeedingInProgress" + // MigrationStateMigrationFailed ... + MigrationStateMigrationFailed MigrationState = "MigrationFailed" + // MigrationStateMigrationInProgress ... + MigrationStateMigrationInProgress MigrationState = "MigrationInProgress" + // MigrationStateMigrationSucceeded ... + MigrationStateMigrationSucceeded MigrationState = "MigrationSucceeded" + // MigrationStateNone ... + MigrationStateNone MigrationState = "None" + // MigrationStateReplicating ... + MigrationStateReplicating MigrationState = "Replicating" +) + +// PossibleMigrationStateValues returns an array of possible values for the MigrationState const type. +func PossibleMigrationStateValues() []MigrationState { + return []MigrationState{MigrationStateDisableMigrationFailed, MigrationStateDisableMigrationInProgress, MigrationStateEnableMigrationFailed, MigrationStateEnableMigrationInProgress, MigrationStateInitialSeedingFailed, MigrationStateInitialSeedingInProgress, MigrationStateMigrationFailed, MigrationStateMigrationInProgress, MigrationStateMigrationSucceeded, MigrationStateNone, MigrationStateReplicating} +} + +// MobilityAgentUpgradeState enumerates the values for mobility agent upgrade state. +type MobilityAgentUpgradeState string + +const ( + // MobilityAgentUpgradeStateCommit ... + MobilityAgentUpgradeStateCommit MobilityAgentUpgradeState = "Commit" + // MobilityAgentUpgradeStateCompleted ... + MobilityAgentUpgradeStateCompleted MobilityAgentUpgradeState = "Completed" + // MobilityAgentUpgradeStateNone ... + MobilityAgentUpgradeStateNone MobilityAgentUpgradeState = "None" + // MobilityAgentUpgradeStateStarted ... + MobilityAgentUpgradeStateStarted MobilityAgentUpgradeState = "Started" +) + +// PossibleMobilityAgentUpgradeStateValues returns an array of possible values for the MobilityAgentUpgradeState const type. +func PossibleMobilityAgentUpgradeStateValues() []MobilityAgentUpgradeState { + return []MobilityAgentUpgradeState{MobilityAgentUpgradeStateCommit, MobilityAgentUpgradeStateCompleted, MobilityAgentUpgradeStateNone, MobilityAgentUpgradeStateStarted} +} + +// MultiVMGroupCreateOption enumerates the values for multi vm group create option. +type MultiVMGroupCreateOption string + +const ( + // AutoCreated ... + AutoCreated MultiVMGroupCreateOption = "AutoCreated" + // UserSpecified ... + UserSpecified MultiVMGroupCreateOption = "UserSpecified" +) + +// PossibleMultiVMGroupCreateOptionValues returns an array of possible values for the MultiVMGroupCreateOption const type. +func PossibleMultiVMGroupCreateOptionValues() []MultiVMGroupCreateOption { + return []MultiVMGroupCreateOption{AutoCreated, UserSpecified} +} + +// MultiVMSyncPointOption enumerates the values for multi vm sync point option. +type MultiVMSyncPointOption string + +const ( + // UseMultiVMSyncRecoveryPoint ... + UseMultiVMSyncRecoveryPoint MultiVMSyncPointOption = "UseMultiVmSyncRecoveryPoint" + // UsePerVMRecoveryPoint ... + UsePerVMRecoveryPoint MultiVMSyncPointOption = "UsePerVmRecoveryPoint" +) + +// PossibleMultiVMSyncPointOptionValues returns an array of possible values for the MultiVMSyncPointOption const type. +func PossibleMultiVMSyncPointOptionValues() []MultiVMSyncPointOption { + return []MultiVMSyncPointOption{UseMultiVMSyncRecoveryPoint, UsePerVMRecoveryPoint} +} + +// PlannedFailoverStatus enumerates the values for planned failover status. +type PlannedFailoverStatus string + +const ( + // PlannedFailoverStatusCancelled ... + PlannedFailoverStatusCancelled PlannedFailoverStatus = "Cancelled" + // PlannedFailoverStatusFailed ... + PlannedFailoverStatusFailed PlannedFailoverStatus = "Failed" + // PlannedFailoverStatusSucceeded ... + PlannedFailoverStatusSucceeded PlannedFailoverStatus = "Succeeded" + // PlannedFailoverStatusUnknown ... + PlannedFailoverStatusUnknown PlannedFailoverStatus = "Unknown" +) + +// PossiblePlannedFailoverStatusValues returns an array of possible values for the PlannedFailoverStatus const type. +func PossiblePlannedFailoverStatusValues() []PlannedFailoverStatus { + return []PlannedFailoverStatus{PlannedFailoverStatusCancelled, PlannedFailoverStatusFailed, PlannedFailoverStatusSucceeded, PlannedFailoverStatusUnknown} +} + +// PossibleOperationsDirections enumerates the values for possible operations directions. +type PossibleOperationsDirections string + +const ( + // PrimaryToRecovery ... + PrimaryToRecovery PossibleOperationsDirections = "PrimaryToRecovery" + // RecoveryToPrimary ... + RecoveryToPrimary PossibleOperationsDirections = "RecoveryToPrimary" +) + +// PossiblePossibleOperationsDirectionsValues returns an array of possible values for the PossibleOperationsDirections const type. +func PossiblePossibleOperationsDirectionsValues() []PossibleOperationsDirections { + return []PossibleOperationsDirections{PrimaryToRecovery, RecoveryToPrimary} +} + +// PresenceStatus enumerates the values for presence status. +type PresenceStatus string + +const ( + // PresenceStatusNotPresent ... + PresenceStatusNotPresent PresenceStatus = "NotPresent" + // PresenceStatusPresent ... + PresenceStatusPresent PresenceStatus = "Present" + // PresenceStatusUnknown ... + PresenceStatusUnknown PresenceStatus = "Unknown" +) + +// PossiblePresenceStatusValues returns an array of possible values for the PresenceStatus const type. +func PossiblePresenceStatusValues() []PresenceStatus { + return []PresenceStatus{PresenceStatusNotPresent, PresenceStatusPresent, PresenceStatusUnknown} +} + +// ProtectionHealth enumerates the values for protection health. +type ProtectionHealth string + +const ( + // ProtectionHealthCritical ... + ProtectionHealthCritical ProtectionHealth = "Critical" + // ProtectionHealthNone ... + ProtectionHealthNone ProtectionHealth = "None" + // ProtectionHealthNormal ... + ProtectionHealthNormal ProtectionHealth = "Normal" + // ProtectionHealthWarning ... + ProtectionHealthWarning ProtectionHealth = "Warning" +) + +// PossibleProtectionHealthValues returns an array of possible values for the ProtectionHealth const type. +func PossibleProtectionHealthValues() []ProtectionHealth { + return []ProtectionHealth{ProtectionHealthCritical, ProtectionHealthNone, ProtectionHealthNormal, ProtectionHealthWarning} +} + +// RcmComponentStatus enumerates the values for rcm component status. +type RcmComponentStatus string + +const ( + // RcmComponentStatusCritical ... + RcmComponentStatusCritical RcmComponentStatus = "Critical" + // RcmComponentStatusHealthy ... + RcmComponentStatusHealthy RcmComponentStatus = "Healthy" + // RcmComponentStatusUnknown ... + RcmComponentStatusUnknown RcmComponentStatus = "Unknown" + // RcmComponentStatusWarning ... + RcmComponentStatusWarning RcmComponentStatus = "Warning" +) + +// PossibleRcmComponentStatusValues returns an array of possible values for the RcmComponentStatus const type. +func PossibleRcmComponentStatusValues() []RcmComponentStatus { + return []RcmComponentStatus{RcmComponentStatusCritical, RcmComponentStatusHealthy, RcmComponentStatusUnknown, RcmComponentStatusWarning} +} + +// RecoveryPlanActionLocation enumerates the values for recovery plan action location. +type RecoveryPlanActionLocation string + +const ( + // Primary ... + Primary RecoveryPlanActionLocation = "Primary" + // Recovery ... + Recovery RecoveryPlanActionLocation = "Recovery" +) + +// PossibleRecoveryPlanActionLocationValues returns an array of possible values for the RecoveryPlanActionLocation const type. +func PossibleRecoveryPlanActionLocationValues() []RecoveryPlanActionLocation { + return []RecoveryPlanActionLocation{Primary, Recovery} +} + +// RecoveryPlanGroupType enumerates the values for recovery plan group type. +type RecoveryPlanGroupType string + +const ( + // Boot ... + Boot RecoveryPlanGroupType = "Boot" + // Failover ... + Failover RecoveryPlanGroupType = "Failover" + // Shutdown ... + Shutdown RecoveryPlanGroupType = "Shutdown" +) + +// PossibleRecoveryPlanGroupTypeValues returns an array of possible values for the RecoveryPlanGroupType const type. +func PossibleRecoveryPlanGroupTypeValues() []RecoveryPlanGroupType { + return []RecoveryPlanGroupType{Boot, Failover, Shutdown} +} + +// RecoveryPlanPointType enumerates the values for recovery plan point type. +type RecoveryPlanPointType string + +const ( + // RecoveryPlanPointTypeLatest ... + RecoveryPlanPointTypeLatest RecoveryPlanPointType = "Latest" + // RecoveryPlanPointTypeLatestApplicationConsistent ... + RecoveryPlanPointTypeLatestApplicationConsistent RecoveryPlanPointType = "LatestApplicationConsistent" + // RecoveryPlanPointTypeLatestCrashConsistent ... + RecoveryPlanPointTypeLatestCrashConsistent RecoveryPlanPointType = "LatestCrashConsistent" + // RecoveryPlanPointTypeLatestProcessed ... + RecoveryPlanPointTypeLatestProcessed RecoveryPlanPointType = "LatestProcessed" +) + +// PossibleRecoveryPlanPointTypeValues returns an array of possible values for the RecoveryPlanPointType const type. +func PossibleRecoveryPlanPointTypeValues() []RecoveryPlanPointType { + return []RecoveryPlanPointType{RecoveryPlanPointTypeLatest, RecoveryPlanPointTypeLatestApplicationConsistent, RecoveryPlanPointTypeLatestCrashConsistent, RecoveryPlanPointTypeLatestProcessed} +} + +// RecoveryPointSyncType enumerates the values for recovery point sync type. +type RecoveryPointSyncType string + +const ( + // MultiVMSyncRecoveryPoint ... + MultiVMSyncRecoveryPoint RecoveryPointSyncType = "MultiVmSyncRecoveryPoint" + // PerVMRecoveryPoint ... + PerVMRecoveryPoint RecoveryPointSyncType = "PerVmRecoveryPoint" +) + +// PossibleRecoveryPointSyncTypeValues returns an array of possible values for the RecoveryPointSyncType const type. +func PossibleRecoveryPointSyncTypeValues() []RecoveryPointSyncType { + return []RecoveryPointSyncType{MultiVMSyncRecoveryPoint, PerVMRecoveryPoint} +} + +// RecoveryPointType enumerates the values for recovery point type. +type RecoveryPointType string + +const ( + // Custom ... + Custom RecoveryPointType = "Custom" + // LatestTag ... + LatestTag RecoveryPointType = "LatestTag" + // LatestTime ... + LatestTime RecoveryPointType = "LatestTime" +) + +// PossibleRecoveryPointTypeValues returns an array of possible values for the RecoveryPointType const type. +func PossibleRecoveryPointTypeValues() []RecoveryPointType { + return []RecoveryPointType{Custom, LatestTag, LatestTime} +} + +// ReplicationProtectedItemOperation enumerates the values for replication protected item operation. +type ReplicationProtectedItemOperation string + +const ( + // CancelFailover ... + CancelFailover ReplicationProtectedItemOperation = "CancelFailover" + // ChangePit ... + ChangePit ReplicationProtectedItemOperation = "ChangePit" + // Commit ... + Commit ReplicationProtectedItemOperation = "Commit" + // CompleteMigration ... + CompleteMigration ReplicationProtectedItemOperation = "CompleteMigration" + // DisableProtection ... + DisableProtection ReplicationProtectedItemOperation = "DisableProtection" + // Failback ... + Failback ReplicationProtectedItemOperation = "Failback" + // FinalizeFailback ... + FinalizeFailback ReplicationProtectedItemOperation = "FinalizeFailback" + // PlannedFailover ... + PlannedFailover ReplicationProtectedItemOperation = "PlannedFailover" + // RepairReplication ... + RepairReplication ReplicationProtectedItemOperation = "RepairReplication" + // ReverseReplicate ... + ReverseReplicate ReplicationProtectedItemOperation = "ReverseReplicate" + // SwitchProtection ... + SwitchProtection ReplicationProtectedItemOperation = "SwitchProtection" + // TestFailover ... + TestFailover ReplicationProtectedItemOperation = "TestFailover" + // TestFailoverCleanup ... + TestFailoverCleanup ReplicationProtectedItemOperation = "TestFailoverCleanup" + // UnplannedFailover ... + UnplannedFailover ReplicationProtectedItemOperation = "UnplannedFailover" +) + +// PossibleReplicationProtectedItemOperationValues returns an array of possible values for the ReplicationProtectedItemOperation const type. +func PossibleReplicationProtectedItemOperationValues() []ReplicationProtectedItemOperation { + return []ReplicationProtectedItemOperation{CancelFailover, ChangePit, Commit, CompleteMigration, DisableProtection, Failback, FinalizeFailback, PlannedFailover, RepairReplication, ReverseReplicate, SwitchProtection, TestFailover, TestFailoverCleanup, UnplannedFailover} +} + +// ResourceType enumerates the values for resource type. +type ResourceType string + +const ( + // ResourceTypeExisting ... + ResourceTypeExisting ResourceType = "Existing" + // ResourceTypeNew ... + ResourceTypeNew ResourceType = "New" + // ResourceTypeProtectionProfileCustomDetails ... + ResourceTypeProtectionProfileCustomDetails ResourceType = "ProtectionProfileCustomDetails" +) + +// PossibleResourceTypeValues returns an array of possible values for the ResourceType const type. +func PossibleResourceTypeValues() []ResourceType { + return []ResourceType{ResourceTypeExisting, ResourceTypeNew, ResourceTypeProtectionProfileCustomDetails} +} + +// ResourceTypeBasicRecoveryAvailabilitySetCustomDetails enumerates the values for resource type basic recovery +// availability set custom details. +type ResourceTypeBasicRecoveryAvailabilitySetCustomDetails string + +const ( + // ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryAvailabilitySetCustomDetails = "Existing" + // ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails ... + ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails ResourceTypeBasicRecoveryAvailabilitySetCustomDetails = "RecoveryAvailabilitySetCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryAvailabilitySetCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryAvailabilitySetCustomDetails const type. +func PossibleResourceTypeBasicRecoveryAvailabilitySetCustomDetailsValues() []ResourceTypeBasicRecoveryAvailabilitySetCustomDetails { + return []ResourceTypeBasicRecoveryAvailabilitySetCustomDetails{ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails} +} + +// ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails enumerates the values for resource type basic +// recovery proximity placement group custom details. +type ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails string + +const ( + // ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails = "Existing" + // ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails ... + ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails = "RecoveryProximityPlacementGroupCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails const type. +func PossibleResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsValues() []ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails { + return []ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails{ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails} +} + +// ResourceTypeBasicRecoveryResourceGroupCustomDetails enumerates the values for resource type basic recovery +// resource group custom details. +type ResourceTypeBasicRecoveryResourceGroupCustomDetails string + +const ( + // ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryResourceGroupCustomDetails = "Existing" + // ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails ... + ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails ResourceTypeBasicRecoveryResourceGroupCustomDetails = "RecoveryResourceGroupCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryResourceGroupCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryResourceGroupCustomDetails const type. +func PossibleResourceTypeBasicRecoveryResourceGroupCustomDetailsValues() []ResourceTypeBasicRecoveryResourceGroupCustomDetails { + return []ResourceTypeBasicRecoveryResourceGroupCustomDetails{ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails} +} + +// ResourceTypeBasicRecoveryVirtualNetworkCustomDetails enumerates the values for resource type basic recovery +// virtual network custom details. +type ResourceTypeBasicRecoveryVirtualNetworkCustomDetails string + +const ( + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "Existing" + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "New" + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "RecoveryVirtualNetworkCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryVirtualNetworkCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryVirtualNetworkCustomDetails const type. +func PossibleResourceTypeBasicRecoveryVirtualNetworkCustomDetailsValues() []ResourceTypeBasicRecoveryVirtualNetworkCustomDetails { + return []ResourceTypeBasicRecoveryVirtualNetworkCustomDetails{ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew, ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails} +} + +// ResourceTypeBasicStorageAccountCustomDetails enumerates the values for resource type basic storage account +// custom details. +type ResourceTypeBasicStorageAccountCustomDetails string + +const ( + // ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting ... + ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting ResourceTypeBasicStorageAccountCustomDetails = "Existing" + // ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails ... + ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails ResourceTypeBasicStorageAccountCustomDetails = "StorageAccountCustomDetails" +) + +// PossibleResourceTypeBasicStorageAccountCustomDetailsValues returns an array of possible values for the ResourceTypeBasicStorageAccountCustomDetails const type. +func PossibleResourceTypeBasicStorageAccountCustomDetailsValues() []ResourceTypeBasicStorageAccountCustomDetails { + return []ResourceTypeBasicStorageAccountCustomDetails{ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting, ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails} +} + +// ResyncState enumerates the values for resync state. +type ResyncState string + +const ( + // ResyncStateNone ... + ResyncStateNone ResyncState = "None" + // ResyncStatePreparedForResynchronization ... + ResyncStatePreparedForResynchronization ResyncState = "PreparedForResynchronization" + // ResyncStateStartedResynchronization ... + ResyncStateStartedResynchronization ResyncState = "StartedResynchronization" +) + +// PossibleResyncStateValues returns an array of possible values for the ResyncState const type. +func PossibleResyncStateValues() []ResyncState { + return []ResyncState{ResyncStateNone, ResyncStatePreparedForResynchronization, ResyncStateStartedResynchronization} +} + +// RpInMageRecoveryPointType enumerates the values for rp in mage recovery point type. +type RpInMageRecoveryPointType string + +const ( + // RpInMageRecoveryPointTypeCustom ... + RpInMageRecoveryPointTypeCustom RpInMageRecoveryPointType = "Custom" + // RpInMageRecoveryPointTypeLatestTag ... + RpInMageRecoveryPointTypeLatestTag RpInMageRecoveryPointType = "LatestTag" + // RpInMageRecoveryPointTypeLatestTime ... + RpInMageRecoveryPointTypeLatestTime RpInMageRecoveryPointType = "LatestTime" +) + +// PossibleRpInMageRecoveryPointTypeValues returns an array of possible values for the RpInMageRecoveryPointType const type. +func PossibleRpInMageRecoveryPointTypeValues() []RpInMageRecoveryPointType { + return []RpInMageRecoveryPointType{RpInMageRecoveryPointTypeCustom, RpInMageRecoveryPointTypeLatestTag, RpInMageRecoveryPointTypeLatestTime} +} + +// SetMultiVMSyncStatus enumerates the values for set multi vm sync status. +type SetMultiVMSyncStatus string + +const ( + // Disable ... + Disable SetMultiVMSyncStatus = "Disable" + // Enable ... + Enable SetMultiVMSyncStatus = "Enable" +) + +// PossibleSetMultiVMSyncStatusValues returns an array of possible values for the SetMultiVMSyncStatus const type. +func PossibleSetMultiVMSyncStatusValues() []SetMultiVMSyncStatus { + return []SetMultiVMSyncStatus{Disable, Enable} +} + +// Severity enumerates the values for severity. +type Severity string + +const ( + // Error ... + Error Severity = "Error" + // Info ... + Info Severity = "Info" + // NONE ... + NONE Severity = "NONE" + // Warning ... + Warning Severity = "Warning" +) + +// PossibleSeverityValues returns an array of possible values for the Severity const type. +func PossibleSeverityValues() []Severity { + return []Severity{Error, Info, NONE, Warning} +} + +// SourceSiteOperations enumerates the values for source site operations. +type SourceSiteOperations string + +const ( + // NotRequired ... + NotRequired SourceSiteOperations = "NotRequired" + // Required ... + Required SourceSiteOperations = "Required" +) + +// PossibleSourceSiteOperationsValues returns an array of possible values for the SourceSiteOperations const type. +func PossibleSourceSiteOperationsValues() []SourceSiteOperations { + return []SourceSiteOperations{NotRequired, Required} +} + +// SQLServerLicenseType enumerates the values for sql server license type. +type SQLServerLicenseType string + +const ( + // SQLServerLicenseTypeAHUB ... + SQLServerLicenseTypeAHUB SQLServerLicenseType = "AHUB" + // SQLServerLicenseTypeNoLicenseType ... + SQLServerLicenseTypeNoLicenseType SQLServerLicenseType = "NoLicenseType" + // SQLServerLicenseTypeNotSpecified ... + SQLServerLicenseTypeNotSpecified SQLServerLicenseType = "NotSpecified" + // SQLServerLicenseTypePAYG ... + SQLServerLicenseTypePAYG SQLServerLicenseType = "PAYG" +) + +// PossibleSQLServerLicenseTypeValues returns an array of possible values for the SQLServerLicenseType const type. +func PossibleSQLServerLicenseTypeValues() []SQLServerLicenseType { + return []SQLServerLicenseType{SQLServerLicenseTypeAHUB, SQLServerLicenseTypeNoLicenseType, SQLServerLicenseTypeNotSpecified, SQLServerLicenseTypePAYG} +} + +// TestMigrationState enumerates the values for test migration state. +type TestMigrationState string + +const ( + // TestMigrationStateNone ... + TestMigrationStateNone TestMigrationState = "None" + // TestMigrationStateTestMigrationCleanupInProgress ... + TestMigrationStateTestMigrationCleanupInProgress TestMigrationState = "TestMigrationCleanupInProgress" + // TestMigrationStateTestMigrationFailed ... + TestMigrationStateTestMigrationFailed TestMigrationState = "TestMigrationFailed" + // TestMigrationStateTestMigrationInProgress ... + TestMigrationStateTestMigrationInProgress TestMigrationState = "TestMigrationInProgress" + // TestMigrationStateTestMigrationSucceeded ... + TestMigrationStateTestMigrationSucceeded TestMigrationState = "TestMigrationSucceeded" +) + +// PossibleTestMigrationStateValues returns an array of possible values for the TestMigrationState const type. +func PossibleTestMigrationStateValues() []TestMigrationState { + return []TestMigrationState{TestMigrationStateNone, TestMigrationStateTestMigrationCleanupInProgress, TestMigrationStateTestMigrationFailed, TestMigrationStateTestMigrationInProgress, TestMigrationStateTestMigrationSucceeded} +} + +// VMEncryptionType enumerates the values for vm encryption type. +type VMEncryptionType string + +const ( + // NotEncrypted ... + NotEncrypted VMEncryptionType = "NotEncrypted" + // OnePassEncrypted ... + OnePassEncrypted VMEncryptionType = "OnePassEncrypted" + // TwoPassEncrypted ... + TwoPassEncrypted VMEncryptionType = "TwoPassEncrypted" +) + +// PossibleVMEncryptionTypeValues returns an array of possible values for the VMEncryptionType const type. +func PossibleVMEncryptionTypeValues() []VMEncryptionType { + return []VMEncryptionType{NotEncrypted, OnePassEncrypted, TwoPassEncrypted} +} + +// VMReplicationProgressHealth enumerates the values for vm replication progress health. +type VMReplicationProgressHealth string + +const ( + // VMReplicationProgressHealthInProgress ... + VMReplicationProgressHealthInProgress VMReplicationProgressHealth = "InProgress" + // VMReplicationProgressHealthNone ... + VMReplicationProgressHealthNone VMReplicationProgressHealth = "None" + // VMReplicationProgressHealthNoProgress ... + VMReplicationProgressHealthNoProgress VMReplicationProgressHealth = "NoProgress" + // VMReplicationProgressHealthSlowProgress ... + VMReplicationProgressHealthSlowProgress VMReplicationProgressHealth = "SlowProgress" +) + +// PossibleVMReplicationProgressHealthValues returns an array of possible values for the VMReplicationProgressHealth const type. +func PossibleVMReplicationProgressHealthValues() []VMReplicationProgressHealth { + return []VMReplicationProgressHealth{VMReplicationProgressHealthInProgress, VMReplicationProgressHealthNone, VMReplicationProgressHealthNoProgress, VMReplicationProgressHealthSlowProgress} +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/migrationrecoverypoints.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/migrationrecoverypoints.go new file mode 100644 index 000000000000..883d5f563555 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/migrationrecoverypoints.go @@ -0,0 +1,236 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// MigrationRecoveryPointsClient is the client for the MigrationRecoveryPoints methods of the Siterecovery service. +type MigrationRecoveryPointsClient struct { + BaseClient +} + +// NewMigrationRecoveryPointsClient creates an instance of the MigrationRecoveryPointsClient client. +func NewMigrationRecoveryPointsClient(subscriptionID string, resourceGroupName string, resourceName string) MigrationRecoveryPointsClient { + return NewMigrationRecoveryPointsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewMigrationRecoveryPointsClientWithBaseURI creates an instance of the MigrationRecoveryPointsClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewMigrationRecoveryPointsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) MigrationRecoveryPointsClient { + return MigrationRecoveryPointsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get sends the get request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// migrationRecoveryPointName - the migration recovery point name. +func (client MigrationRecoveryPointsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (result MigrationRecoveryPoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, migrationItemName, migrationRecoveryPointName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client MigrationRecoveryPointsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "migrationRecoveryPointName": autorest.Encode("path", migrationRecoveryPointName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints/{migrationRecoveryPointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client MigrationRecoveryPointsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client MigrationRecoveryPointsClient) GetResponder(resp *http.Response) (result MigrationRecoveryPoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationMigrationItems sends the list by replication migration items request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItems(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationRecoveryPointCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.ListByReplicationMigrationItems") + defer func() { + sc := -1 + if result.mrpc.Response.Response != nil { + sc = result.mrpc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationMigrationItemsNextResults + req, err := client.ListByReplicationMigrationItemsPreparer(ctx, fabricName, protectionContainerName, migrationItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationMigrationItemsSender(req) + if err != nil { + result.mrpc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", resp, "Failure sending request") + return + } + + result.mrpc, err = client.ListByReplicationMigrationItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", resp, "Failure responding to request") + return + } + if result.mrpc.hasNextLink() && result.mrpc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationMigrationItemsPreparer prepares the ListByReplicationMigrationItems request. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationMigrationItemsSender sends the ListByReplicationMigrationItems request. The method will close the +// http.Response Body if it receives an error. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationMigrationItemsResponder handles the response to the ListByReplicationMigrationItems request. The method always +// closes the http.Response Body. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsResponder(resp *http.Response) (result MigrationRecoveryPointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationMigrationItemsNextResults retrieves the next set of results, if any. +func (client MigrationRecoveryPointsClient) listByReplicationMigrationItemsNextResults(ctx context.Context, lastResults MigrationRecoveryPointCollection) (result MigrationRecoveryPointCollection, err error) { + req, err := lastResults.migrationRecoveryPointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationMigrationItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationMigrationItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationMigrationItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationRecoveryPointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.ListByReplicationMigrationItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationMigrationItems(ctx, fabricName, protectionContainerName, migrationItemName) + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/models.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/models.go new file mode 100644 index 000000000000..521a802ef0db --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/models.go @@ -0,0 +1,33181 @@ +package siterecovery + +// 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. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/siterecovery" + +// A2AAddDisksInput a2A add disk(s) input. +type A2AAddDisksInput struct { + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeAddDisksProviderSpecificInput', 'InstanceTypeA2A' + InstanceType InstanceType `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AAddDisksInput. +func (aadi A2AAddDisksInput) MarshalJSON() ([]byte, error) { + aadi.InstanceType = InstanceTypeA2A + objectMap := make(map[string]interface{}) + if aadi.VMDisks != nil { + objectMap["vmDisks"] = aadi.VMDisks + } + if aadi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aadi.VMManagedDisks + } + if aadi.InstanceType != "" { + objectMap["instanceType"] = aadi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AAddDisksInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsA2AAddDisksInput() (*A2AAddDisksInput, bool) { + return &aadi, true +} + +// AsAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsBasicAddDisksProviderSpecificInput() (BasicAddDisksProviderSpecificInput, bool) { + return &aadi, true +} + +// A2AApplyRecoveryPointInput applyRecoveryPoint input specific to A2A provider. +type A2AApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + aarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aarpi.InstanceType != "" { + objectMap["instanceType"] = aarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return &aarpi, true +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &aarpi, true +} + +// A2AContainerCreationInput a2A cloud creation input. +type A2AContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) MarshalJSON() ([]byte, error) { + acci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acci.InstanceType != "" { + objectMap["instanceType"] = acci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return &acci, true +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &acci, true +} + +// A2AContainerMappingInput a2A container mapping input. +type A2AContainerMappingInput struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) MarshalJSON() ([]byte, error) { + acmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acmi.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = acmi.AgentAutoUpdateStatus + } + if acmi.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = acmi.AutomationAccountArmID + } + if acmi.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = acmi.AutomationAccountAuthenticationType + } + if acmi.InstanceType != "" { + objectMap["instanceType"] = acmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return &acmi, true +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &acmi, true +} + +// A2ACreateProtectionIntentInput a2A create protection intent input. +type A2ACreateProtectionIntentInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryLocation - The primary location for the virtual machine. + PrimaryLocation *string `json:"primaryLocation,omitempty"` + // RecoveryLocation - The recovery location for the virtual machine. + RecoveryLocation *string `json:"recoveryLocation,omitempty"` + // RecoverySubscriptionID - The recovery subscription Id of the virtual machine. + RecoverySubscriptionID *string `json:"recoverySubscriptionId,omitempty"` + // RecoveryAvailabilityType - The recovery availability type of the virtual machine. Possible values include: 'Single', 'AvailabilitySet', 'AvailabilityZone' + RecoveryAvailabilityType A2ARecoveryAvailabilityType `json:"recoveryAvailabilityType,omitempty"` + // ProtectionProfileCustomInput - The protection profile custom inputs. + ProtectionProfileCustomInput BasicProtectionProfileCustomDetails `json:"protectionProfileCustomInput,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` + // RecoveryAvailabilitySetCustomInput - The recovery availability set input. + RecoveryAvailabilitySetCustomInput BasicRecoveryAvailabilitySetCustomDetails `json:"recoveryAvailabilitySetCustomInput,omitempty"` + // RecoveryVirtualNetworkCustomInput - The recovery virtual network input. + RecoveryVirtualNetworkCustomInput BasicRecoveryVirtualNetworkCustomDetails `json:"recoveryVirtualNetworkCustomInput,omitempty"` + // RecoveryProximityPlacementGroupCustomInput - The recovery proximity placement group custom input. + RecoveryProximityPlacementGroupCustomInput BasicRecoveryProximityPlacementGroupCustomDetails `json:"recoveryProximityPlacementGroupCustomInput,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // VMDisks - The list of vm disk inputs. + VMDisks *[]A2AProtectionIntentDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk inputs. + VMManagedDisks *[]A2AProtectionIntentManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccount - The boot diagnostic storage account. + RecoveryBootDiagStorageAccount BasicStorageAccountCustomDetails `json:"recoveryBootDiagStorageAccount,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the authentication type for automation account. The default value is "RunAsAccount". Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails', 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) MarshalJSON() ([]byte, error) { + acpii.InstanceType = InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acpii.FabricObjectID != nil { + objectMap["fabricObjectId"] = acpii.FabricObjectID + } + if acpii.PrimaryLocation != nil { + objectMap["primaryLocation"] = acpii.PrimaryLocation + } + if acpii.RecoveryLocation != nil { + objectMap["recoveryLocation"] = acpii.RecoveryLocation + } + if acpii.RecoverySubscriptionID != nil { + objectMap["recoverySubscriptionId"] = acpii.RecoverySubscriptionID + } + if acpii.RecoveryAvailabilityType != "" { + objectMap["recoveryAvailabilityType"] = acpii.RecoveryAvailabilityType + } + objectMap["protectionProfileCustomInput"] = acpii.ProtectionProfileCustomInput + if acpii.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = acpii.RecoveryResourceGroupID + } + objectMap["primaryStagingStorageAccountCustomInput"] = acpii.PrimaryStagingStorageAccountCustomInput + objectMap["recoveryAvailabilitySetCustomInput"] = acpii.RecoveryAvailabilitySetCustomInput + objectMap["recoveryVirtualNetworkCustomInput"] = acpii.RecoveryVirtualNetworkCustomInput + objectMap["recoveryProximityPlacementGroupCustomInput"] = acpii.RecoveryProximityPlacementGroupCustomInput + if acpii.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = acpii.AutoProtectionOfDataDisk + } + if acpii.VMDisks != nil { + objectMap["vmDisks"] = acpii.VMDisks + } + if acpii.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = acpii.VMManagedDisks + } + if acpii.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = acpii.MultiVMGroupName + } + if acpii.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = acpii.MultiVMGroupID + } + objectMap["recoveryBootDiagStorageAccount"] = acpii.RecoveryBootDiagStorageAccount + if acpii.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = acpii.DiskEncryptionInfo + } + if acpii.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = acpii.RecoveryAvailabilityZone + } + if acpii.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = acpii.AgentAutoUpdateStatus + } + if acpii.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = acpii.AutomationAccountAuthenticationType + } + if acpii.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = acpii.AutomationAccountArmID + } + if acpii.InstanceType != "" { + objectMap["instanceType"] = acpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACreateProtectionIntentInput is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) { + return &acpii, true +} + +// AsCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsBasicCreateProtectionIntentProviderSpecificDetails() (BasicCreateProtectionIntentProviderSpecificDetails, bool) { + return &acpii, true +} + +// UnmarshalJSON is the custom unmarshaler for A2ACreateProtectionIntentInput struct. +func (acpii *A2ACreateProtectionIntentInput) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "fabricObjectId": + if v != nil { + var fabricObjectID string + err = json.Unmarshal(*v, &fabricObjectID) + if err != nil { + return err + } + acpii.FabricObjectID = &fabricObjectID + } + case "primaryLocation": + if v != nil { + var primaryLocation string + err = json.Unmarshal(*v, &primaryLocation) + if err != nil { + return err + } + acpii.PrimaryLocation = &primaryLocation + } + case "recoveryLocation": + if v != nil { + var recoveryLocation string + err = json.Unmarshal(*v, &recoveryLocation) + if err != nil { + return err + } + acpii.RecoveryLocation = &recoveryLocation + } + case "recoverySubscriptionId": + if v != nil { + var recoverySubscriptionID string + err = json.Unmarshal(*v, &recoverySubscriptionID) + if err != nil { + return err + } + acpii.RecoverySubscriptionID = &recoverySubscriptionID + } + case "recoveryAvailabilityType": + if v != nil { + var recoveryAvailabilityType A2ARecoveryAvailabilityType + err = json.Unmarshal(*v, &recoveryAvailabilityType) + if err != nil { + return err + } + acpii.RecoveryAvailabilityType = recoveryAvailabilityType + } + case "protectionProfileCustomInput": + if v != nil { + protectionProfileCustomInput, err := unmarshalBasicProtectionProfileCustomDetails(*v) + if err != nil { + return err + } + acpii.ProtectionProfileCustomInput = protectionProfileCustomInput + } + case "recoveryResourceGroupId": + if v != nil { + var recoveryResourceGroupID string + err = json.Unmarshal(*v, &recoveryResourceGroupID) + if err != nil { + return err + } + acpii.RecoveryResourceGroupID = &recoveryResourceGroupID + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + acpii.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + case "recoveryAvailabilitySetCustomInput": + if v != nil { + recoveryAvailabilitySetCustomInput, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryAvailabilitySetCustomInput = recoveryAvailabilitySetCustomInput + } + case "recoveryVirtualNetworkCustomInput": + if v != nil { + recoveryVirtualNetworkCustomInput, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryVirtualNetworkCustomInput = recoveryVirtualNetworkCustomInput + } + case "recoveryProximityPlacementGroupCustomInput": + if v != nil { + recoveryProximityPlacementGroupCustomInput, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryProximityPlacementGroupCustomInput = recoveryProximityPlacementGroupCustomInput + } + case "autoProtectionOfDataDisk": + if v != nil { + var autoProtectionOfDataDisk AutoProtectionOfDataDisk + err = json.Unmarshal(*v, &autoProtectionOfDataDisk) + if err != nil { + return err + } + acpii.AutoProtectionOfDataDisk = autoProtectionOfDataDisk + } + case "vmDisks": + if v != nil { + var VMDisks []A2AProtectionIntentDiskInputDetails + err = json.Unmarshal(*v, &VMDisks) + if err != nil { + return err + } + acpii.VMDisks = &VMDisks + } + case "vmManagedDisks": + if v != nil { + var VMManagedDisks []A2AProtectionIntentManagedDiskInputDetails + err = json.Unmarshal(*v, &VMManagedDisks) + if err != nil { + return err + } + acpii.VMManagedDisks = &VMManagedDisks + } + case "multiVmGroupName": + if v != nil { + var multiVMGroupName string + err = json.Unmarshal(*v, &multiVMGroupName) + if err != nil { + return err + } + acpii.MultiVMGroupName = &multiVMGroupName + } + case "multiVmGroupId": + if v != nil { + var multiVMGroupID string + err = json.Unmarshal(*v, &multiVMGroupID) + if err != nil { + return err + } + acpii.MultiVMGroupID = &multiVMGroupID + } + case "recoveryBootDiagStorageAccount": + if v != nil { + recoveryBootDiagStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryBootDiagStorageAccount = recoveryBootDiagStorageAccount + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + acpii.DiskEncryptionInfo = &diskEncryptionInfo + } + case "recoveryAvailabilityZone": + if v != nil { + var recoveryAvailabilityZone string + err = json.Unmarshal(*v, &recoveryAvailabilityZone) + if err != nil { + return err + } + acpii.RecoveryAvailabilityZone = &recoveryAvailabilityZone + } + case "agentAutoUpdateStatus": + if v != nil { + var agentAutoUpdateStatus AgentAutoUpdateStatus + err = json.Unmarshal(*v, &agentAutoUpdateStatus) + if err != nil { + return err + } + acpii.AgentAutoUpdateStatus = agentAutoUpdateStatus + } + case "automationAccountAuthenticationType": + if v != nil { + var automationAccountAuthenticationType AutomationAccountAuthenticationType + err = json.Unmarshal(*v, &automationAccountAuthenticationType) + if err != nil { + return err + } + acpii.AutomationAccountAuthenticationType = automationAccountAuthenticationType + } + case "automationAccountArmId": + if v != nil { + var automationAccountArmID string + err = json.Unmarshal(*v, &automationAccountArmID) + if err != nil { + return err + } + acpii.AutomationAccountArmID = &automationAccountArmID + } + case "instanceType": + if v != nil { + var instanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails + err = json.Unmarshal(*v, &instanceType) + if err != nil { + return err + } + acpii.InstanceType = instanceType + } + } + } + + return nil +} + +// A2ACrossClusterMigrationApplyRecoveryPointInput applyRecoveryPoint input specific to +// A2ACrossClusterMigration provider. +type A2ACrossClusterMigrationApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + accmarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmarpi.InstanceType != "" { + objectMap["instanceType"] = accmarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return &accmarpi, true +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &accmarpi, true +} + +// A2ACrossClusterMigrationContainerCreationInput a2ACrossClusterMigration cloud creation input. +type A2ACrossClusterMigrationContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) MarshalJSON() ([]byte, error) { + accmcci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmcci.InstanceType != "" { + objectMap["instanceType"] = accmcci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return &accmcci, true +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &accmcci, true +} + +// A2ACrossClusterMigrationEnableProtectionInput a2A Cross-Cluster Migration enable protection input. +type A2ACrossClusterMigrationEnableProtectionInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) MarshalJSON() ([]byte, error) { + accmepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmepi.FabricObjectID != nil { + objectMap["fabricObjectId"] = accmepi.FabricObjectID + } + if accmepi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = accmepi.RecoveryContainerID + } + if accmepi.InstanceType != "" { + objectMap["instanceType"] = accmepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return &accmepi, true +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &accmepi, true +} + +// A2ACrossClusterMigrationPolicyCreationInput a2A Cross-Cluster Migration Policy creation input. +type A2ACrossClusterMigrationPolicyCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) MarshalJSON() ([]byte, error) { + accmpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmpci.InstanceType != "" { + objectMap["instanceType"] = accmpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return &accmpci, true +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &accmpci, true +} + +// A2ACrossClusterMigrationReplicationDetails a2A provider specific settings. +type A2ACrossClusterMigrationReplicationDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryFabricLocation - Primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // OsType - The type of operating system. + OsType *string `json:"osType,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // LifecycleID - An id associated with the PE 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 item even though other internal Ids/ARM Id might be changing. + LifecycleID *string `json:"lifecycleId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) MarshalJSON() ([]byte, error) { + accmrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmrd.FabricObjectID != nil { + objectMap["fabricObjectId"] = accmrd.FabricObjectID + } + if accmrd.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = accmrd.PrimaryFabricLocation + } + if accmrd.OsType != nil { + objectMap["osType"] = accmrd.OsType + } + if accmrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = accmrd.VMProtectionState + } + if accmrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = accmrd.VMProtectionStateDescription + } + if accmrd.LifecycleID != nil { + objectMap["lifecycleId"] = accmrd.LifecycleID + } + if accmrd.InstanceType != "" { + objectMap["instanceType"] = accmrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return &accmrd, true +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &accmrd, true +} + +// A2AEnableProtectionInput a2A enable protection input. +type A2AEnableProtectionInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryExtendedLocation - The recovery extended location. + RecoveryExtendedLocation *ExtendedLocation `json:"recoveryExtendedLocation,omitempty"` + // RecoveryAzureNetworkID - The recovery Azure virtual network ARM id. + RecoveryAzureNetworkID *string `json:"recoveryAzureNetworkId,omitempty"` + // RecoverySubnetName - The recovery subnet name. + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + // RecoveryVirtualMachineScaleSetID - The virtual machine scale set Id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) MarshalJSON() ([]byte, error) { + aepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aepi.FabricObjectID != nil { + objectMap["fabricObjectId"] = aepi.FabricObjectID + } + if aepi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = aepi.RecoveryContainerID + } + if aepi.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aepi.RecoveryResourceGroupID + } + if aepi.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aepi.RecoveryCloudServiceID + } + if aepi.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = aepi.RecoveryAvailabilitySetID + } + if aepi.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aepi.RecoveryProximityPlacementGroupID + } + if aepi.VMDisks != nil { + objectMap["vmDisks"] = aepi.VMDisks + } + if aepi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aepi.VMManagedDisks + } + if aepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = aepi.MultiVMGroupName + } + if aepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = aepi.MultiVMGroupID + } + if aepi.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aepi.RecoveryBootDiagStorageAccountID + } + if aepi.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aepi.DiskEncryptionInfo + } + if aepi.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = aepi.RecoveryAvailabilityZone + } + if aepi.RecoveryExtendedLocation != nil { + objectMap["recoveryExtendedLocation"] = aepi.RecoveryExtendedLocation + } + if aepi.RecoveryAzureNetworkID != nil { + objectMap["recoveryAzureNetworkId"] = aepi.RecoveryAzureNetworkID + } + if aepi.RecoverySubnetName != nil { + objectMap["recoverySubnetName"] = aepi.RecoverySubnetName + } + if aepi.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aepi.RecoveryVirtualMachineScaleSetID + } + if aepi.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = aepi.RecoveryCapacityReservationGroupID + } + if aepi.InstanceType != "" { + objectMap["instanceType"] = aepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return &aepi, true +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &aepi, true +} + +// A2AEventDetails model class for event details of a A2A event. +type A2AEventDetails struct { + // ProtectedItemName - The protected item arm name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // FabricObjectID - The azure vm arm id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // FabricName - Fabric arm name. + FabricName *string `json:"fabricName,omitempty"` + // FabricLocation - The fabric location. + FabricLocation *string `json:"fabricLocation,omitempty"` + // RemoteFabricName - Remote fabric arm name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // RemoteFabricLocation - Remote fabric location. + RemoteFabricLocation *string `json:"remoteFabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AEventDetails. +func (aed A2AEventDetails) MarshalJSON() ([]byte, error) { + aed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aed.ProtectedItemName != nil { + objectMap["protectedItemName"] = aed.ProtectedItemName + } + if aed.FabricObjectID != nil { + objectMap["fabricObjectId"] = aed.FabricObjectID + } + if aed.FabricName != nil { + objectMap["fabricName"] = aed.FabricName + } + if aed.FabricLocation != nil { + objectMap["fabricLocation"] = aed.FabricLocation + } + if aed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = aed.RemoteFabricName + } + if aed.RemoteFabricLocation != nil { + objectMap["remoteFabricLocation"] = aed.RemoteFabricLocation + } + if aed.InstanceType != "" { + objectMap["instanceType"] = aed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return &aed, true +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &aed, true +} + +// A2APolicyCreationInput a2A Policy creation input. +type A2APolicyCreationInput struct { + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) MarshalJSON() ([]byte, error) { + apci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apci.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = apci.RecoveryPointHistory + } + if apci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = apci.CrashConsistentFrequencyInMinutes + } + if apci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = apci.AppConsistentFrequencyInMinutes + } + if apci.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = apci.MultiVMSyncStatus + } + if apci.InstanceType != "" { + objectMap["instanceType"] = apci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return &apci, true +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &apci, true +} + +// A2APolicyDetails a2A specific policy details. +type A2APolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2APolicyDetails. +func (apd A2APolicyDetails) MarshalJSON() ([]byte, error) { + apd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = apd.RecoveryPointThresholdInMinutes + } + if apd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = apd.RecoveryPointHistory + } + if apd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = apd.AppConsistentFrequencyInMinutes + } + if apd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = apd.MultiVMSyncStatus + } + if apd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = apd.CrashConsistentFrequencyInMinutes + } + if apd.InstanceType != "" { + objectMap["instanceType"] = apd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return &apd, true +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &apd, true +} + +// A2AProtectedDiskDetails a2A protected disk details. +type A2AProtectedDiskDetails struct { + // DiskURI - The disk uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountID - The recovery disk storage account. + RecoveryAzureStorageAccountID *string `json:"recoveryAzureStorageAccountId,omitempty"` + // PrimaryDiskAzureStorageAccountID - The primary disk storage account. + PrimaryDiskAzureStorageAccountID *string `json:"primaryDiskAzureStorageAccountId,omitempty"` + // RecoveryDiskURI - Recovery disk uri. + RecoveryDiskURI *string `json:"recoveryDiskUri,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // DiskType - The type of disk. + DiskType *string `json:"diskType,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *bool `json:"resyncRequired,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // DataPendingInStagingStorageAccountInMB - The data pending for replication in MB at staging account. + DataPendingInStagingStorageAccountInMB *float64 `json:"dataPendingInStagingStorageAccountInMB,omitempty"` + // DataPendingAtSourceAgentInMB - The data pending at source virtual machine in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // DiskState - The disk state. + DiskState *string `json:"diskState,omitempty"` + // AllowedDiskLevelOperation - The disk level operations list. + AllowedDiskLevelOperation *[]string `json:"allowedDiskLevelOperation,omitempty"` + // IsDiskEncrypted - A value indicating whether vm has encrypted os disk or not. + IsDiskEncrypted *bool `json:"isDiskEncrypted,omitempty"` + // SecretIdentifier - The secret URL / identifier (BEK). + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // DekKeyVaultArmID - The KeyVault resource id for secret (BEK). + DekKeyVaultArmID *string `json:"dekKeyVaultArmId,omitempty"` + // IsDiskKeyEncrypted - A value indicating whether disk key got encrypted or not. + IsDiskKeyEncrypted *bool `json:"isDiskKeyEncrypted,omitempty"` + // KeyIdentifier - The key URL / identifier (KEK). + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KekKeyVaultArmID - The KeyVault resource id for key (KEK). + KekKeyVaultArmID *string `json:"kekKeyVaultArmId,omitempty"` + // FailoverDiskName - The failover name for the managed disk. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The test failover name for the managed disk. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AProtectedManagedDiskDetails a2A protected managed disk details. +type A2AProtectedManagedDiskDetails struct { + // DiskID - The managed disk Arm id. + DiskID *string `json:"diskId,omitempty"` + // RecoveryResourceGroupID - The recovery disk resource group Arm Id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryTargetDiskID - Recovery target disk Arm Id. + RecoveryTargetDiskID *string `json:"recoveryTargetDiskId,omitempty"` + // RecoveryReplicaDiskID - Recovery replica disk Arm Id. + RecoveryReplicaDiskID *string `json:"recoveryReplicaDiskId,omitempty"` + // RecoveryOrignalTargetDiskID - Recovery original target disk Arm Id. + RecoveryOrignalTargetDiskID *string `json:"recoveryOrignalTargetDiskId,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // PrimaryDiskEncryptionSetID - The primary disk encryption set Id. + PrimaryDiskEncryptionSetID *string `json:"primaryDiskEncryptionSetId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // DiskType - The type of disk. + DiskType *string `json:"diskType,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *bool `json:"resyncRequired,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // DataPendingInStagingStorageAccountInMB - The data pending for replication in MB at staging account. + DataPendingInStagingStorageAccountInMB *float64 `json:"dataPendingInStagingStorageAccountInMB,omitempty"` + // DataPendingAtSourceAgentInMB - The data pending at source virtual machine in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // DiskState - The disk state. + DiskState *string `json:"diskState,omitempty"` + // AllowedDiskLevelOperation - The disk level operations list. + AllowedDiskLevelOperation *[]string `json:"allowedDiskLevelOperation,omitempty"` + // IsDiskEncrypted - A value indicating whether vm has encrypted os disk or not. + IsDiskEncrypted *bool `json:"isDiskEncrypted,omitempty"` + // SecretIdentifier - The secret URL / identifier (BEK). + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // DekKeyVaultArmID - The KeyVault resource id for secret (BEK). + DekKeyVaultArmID *string `json:"dekKeyVaultArmId,omitempty"` + // IsDiskKeyEncrypted - A value indicating whether disk key got encrypted or not. + IsDiskKeyEncrypted *bool `json:"isDiskKeyEncrypted,omitempty"` + // KeyIdentifier - The key URL / identifier (KEK). + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KekKeyVaultArmID - The KeyVault resource id for key (KEK). + KekKeyVaultArmID *string `json:"kekKeyVaultArmId,omitempty"` + // FailoverDiskName - The failover name for the managed disk. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The test failover name for the managed disk. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AProtectionContainerMappingDetails a2A provider specific settings. +type A2AProtectionContainerMappingDetails struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // ScheduleName - The schedule arm name. + ScheduleName *string `json:"scheduleName,omitempty"` + // JobScheduleName - The job schedule arm name. + JobScheduleName *string `json:"jobScheduleName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + apcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apcmd.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = apcmd.AgentAutoUpdateStatus + } + if apcmd.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = apcmd.AutomationAccountArmID + } + if apcmd.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = apcmd.AutomationAccountAuthenticationType + } + if apcmd.ScheduleName != nil { + objectMap["scheduleName"] = apcmd.ScheduleName + } + if apcmd.JobScheduleName != nil { + objectMap["jobScheduleName"] = apcmd.JobScheduleName + } + if apcmd.InstanceType != "" { + objectMap["instanceType"] = apcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return &apcmd, true +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &apcmd, true +} + +// A2AProtectionIntentDiskInputDetails azure VM unmanaged disk input details. +type A2AProtectionIntentDiskInputDetails struct { + // DiskURI - The disk Uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountCustomInput - The recovery VHD storage account input. + RecoveryAzureStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"recoveryAzureStorageAccountCustomInput,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for A2AProtectionIntentDiskInputDetails struct. +func (apidid *A2AProtectionIntentDiskInputDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "diskUri": + if v != nil { + var diskURI string + err = json.Unmarshal(*v, &diskURI) + if err != nil { + return err + } + apidid.DiskURI = &diskURI + } + case "recoveryAzureStorageAccountCustomInput": + if v != nil { + recoveryAzureStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apidid.RecoveryAzureStorageAccountCustomInput = recoveryAzureStorageAccountCustomInput + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apidid.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + } + } + + return nil +} + +// A2AProtectionIntentManagedDiskInputDetails azure VM managed disk input details. +type A2AProtectionIntentManagedDiskInputDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` + // RecoveryResourceGroupCustomInput - The recovery resource group input. + RecoveryResourceGroupCustomInput BasicRecoveryResourceGroupCustomDetails `json:"recoveryResourceGroupCustomInput,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for one / single pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for A2AProtectionIntentManagedDiskInputDetails struct. +func (apimdid *A2AProtectionIntentManagedDiskInputDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "diskId": + if v != nil { + var diskID string + err = json.Unmarshal(*v, &diskID) + if err != nil { + return err + } + apimdid.DiskID = &diskID + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apimdid.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + case "recoveryResourceGroupCustomInput": + if v != nil { + recoveryResourceGroupCustomInput, err := unmarshalBasicRecoveryResourceGroupCustomDetails(*v) + if err != nil { + return err + } + apimdid.RecoveryResourceGroupCustomInput = recoveryResourceGroupCustomInput + } + case "recoveryReplicaDiskAccountType": + if v != nil { + var recoveryReplicaDiskAccountType string + err = json.Unmarshal(*v, &recoveryReplicaDiskAccountType) + if err != nil { + return err + } + apimdid.RecoveryReplicaDiskAccountType = &recoveryReplicaDiskAccountType + } + case "recoveryTargetDiskAccountType": + if v != nil { + var recoveryTargetDiskAccountType string + err = json.Unmarshal(*v, &recoveryTargetDiskAccountType) + if err != nil { + return err + } + apimdid.RecoveryTargetDiskAccountType = &recoveryTargetDiskAccountType + } + case "recoveryDiskEncryptionSetId": + if v != nil { + var recoveryDiskEncryptionSetID string + err = json.Unmarshal(*v, &recoveryDiskEncryptionSetID) + if err != nil { + return err + } + apimdid.RecoveryDiskEncryptionSetID = &recoveryDiskEncryptionSetID + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + apimdid.DiskEncryptionInfo = &diskEncryptionInfo + } + } + } + + return nil +} + +// A2ARecoveryPointDetails a2A provider specific recovery point details. +type A2ARecoveryPointDetails struct { + // RecoveryPointSyncType - A value indicating whether the recovery point is multi VM consistent. Possible values include: 'MultiVMSyncRecoveryPoint', 'PerVMRecoveryPoint' + RecoveryPointSyncType RecoveryPointSyncType `json:"recoveryPointSyncType,omitempty"` + // Disks - List of disk ids representing a recovery point. + Disks *[]string `json:"disks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) MarshalJSON() ([]byte, error) { + arpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if arpd.RecoveryPointSyncType != "" { + objectMap["recoveryPointSyncType"] = arpd.RecoveryPointSyncType + } + if arpd.Disks != nil { + objectMap["disks"] = arpd.Disks + } + if arpd.InstanceType != "" { + objectMap["instanceType"] = arpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return &arpd, true +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &arpd, true +} + +// A2ARemoveDisksInput a2A remove disk(s) input. +type A2ARemoveDisksInput struct { + // VMDisksUris - The list of vm disk vhd URIs. + VMDisksUris *[]string `json:"vmDisksUris,omitempty"` + // VMManagedDisksIds - The list of vm managed disk Ids. + VMManagedDisksIds *[]string `json:"vmManagedDisksIds,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput', 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRemoveDisksProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) MarshalJSON() ([]byte, error) { + ardi.InstanceType = InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ardi.VMDisksUris != nil { + objectMap["vmDisksUris"] = ardi.VMDisksUris + } + if ardi.VMManagedDisksIds != nil { + objectMap["vmManagedDisksIds"] = ardi.VMManagedDisksIds + } + if ardi.InstanceType != "" { + objectMap["instanceType"] = ardi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARemoveDisksInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) { + return &ardi, true +} + +// AsRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsBasicRemoveDisksProviderSpecificInput() (BasicRemoveDisksProviderSpecificInput, bool) { + return &ardi, true +} + +// A2AReplicationDetails a2A provider specific settings. +type A2AReplicationDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // InitialPrimaryZone - READ-ONLY; The initial primary availability zone. + InitialPrimaryZone *string `json:"initialPrimaryZone,omitempty"` + // InitialPrimaryFabricLocation - READ-ONLY; The initial primary fabric location. + InitialPrimaryFabricLocation *string `json:"initialPrimaryFabricLocation,omitempty"` + // InitialRecoveryZone - READ-ONLY; The initial recovery availability zone. + InitialRecoveryZone *string `json:"initialRecoveryZone,omitempty"` + // InitialPrimaryExtendedLocation - The initial primary extended location. + InitialPrimaryExtendedLocation *ExtendedLocation `json:"initialPrimaryExtendedLocation,omitempty"` + // InitialRecoveryExtendedLocation - The initial recovery extended location. + InitialRecoveryExtendedLocation *ExtendedLocation `json:"initialRecoveryExtendedLocation,omitempty"` + // InitialRecoveryFabricLocation - READ-ONLY; The initial recovery fabric location. + InitialRecoveryFabricLocation *string `json:"initialRecoveryFabricLocation,omitempty"` + // MultiVMGroupID - The multi vm group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupCreateOption - Whether Multi VM group is auto created or specified by user. Possible values include: 'AutoCreated', 'UserSpecified' + MultiVMGroupCreateOption MultiVMGroupCreateOption `json:"multiVmGroupCreateOption,omitempty"` + // ManagementID - The management Id. + ManagementID *string `json:"managementId,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]A2AProtectedDiskDetails `json:"protectedDisks,omitempty"` + // UnprotectedDisks - The list of unprotected disks. + UnprotectedDisks *[]A2AUnprotectedDiskDetails `json:"unprotectedDisks,omitempty"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]A2AProtectedManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // RecoveryBootDiagStorageAccountID - The recovery boot diagnostic storage account Arm Id. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // PrimaryFabricLocation - Primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // RecoveryFabricLocation - The recovery fabric location. + RecoveryFabricLocation *string `json:"recoveryFabricLocation,omitempty"` + // OsType - The type of operating system. + OsType *string `json:"osType,omitempty"` + // RecoveryAzureVMSize - The size of recovery virtual machine. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureVMName - The name of recovery virtual machine. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureResourceGroupID - The recovery resource group. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryCloudService - The recovery cloud service. + RecoveryCloudService *string `json:"recoveryCloudService,omitempty"` + // RecoveryAvailabilitySet - The recovery availability set. + RecoveryAvailabilitySet *string `json:"recoveryAvailabilitySet,omitempty"` + // SelectedRecoveryAzureNetworkID - The recovery virtual network. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The test failover virtual network. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // VMNics - The virtual machine nic details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMSyncedConfigDetails - The synced configuration details. + VMSyncedConfigDetails *AzureToAzureVMSyncedConfigDetails `json:"vmSyncedConfigDetails,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // IsReplicationAgentUpdateRequired - A value indicating whether replication agent update is required. + IsReplicationAgentUpdateRequired *bool `json:"isReplicationAgentUpdateRequired,omitempty"` + // AgentCertificateExpiryDate - READ-ONLY; Agent certificate expiry date. + AgentCertificateExpiryDate *date.Time `json:"agentCertificateExpiryDate,omitempty"` + // IsReplicationAgentCertificateUpdateRequired - A value indicating whether agent certificate update is required. + IsReplicationAgentCertificateUpdateRequired *bool `json:"isReplicationAgentCertificateUpdateRequired,omitempty"` + // RecoveryFabricObjectID - The recovery fabric object Id. + RecoveryFabricObjectID *string `json:"recoveryFabricObjectId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // LifecycleID - An id associated with the PE 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 item even though other internal Ids/ARM Id might be changing. + LifecycleID *string `json:"lifecycleId,omitempty"` + // TestFailoverRecoveryFabricObjectID - The test failover fabric object Id. + TestFailoverRecoveryFabricObjectID *string `json:"testFailoverRecoveryFabricObjectId,omitempty"` + // RpoInSeconds - The last RPO value in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // LastRpoCalculatedTime - The time (in UTC) when the last RPO value was calculated by Protection Service. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // PrimaryAvailabilityZone - The primary availability zone. + PrimaryAvailabilityZone *string `json:"primaryAvailabilityZone,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // PrimaryExtendedLocation - The primary Extended Location. + PrimaryExtendedLocation *ExtendedLocation `json:"primaryExtendedLocation,omitempty"` + // RecoveryExtendedLocation - The recovery Extended Location. + RecoveryExtendedLocation *ExtendedLocation `json:"recoveryExtendedLocation,omitempty"` + // VMEncryptionType - READ-ONLY; The encryption type of the VM. Possible values include: 'NotEncrypted', 'OnePassEncrypted', 'TwoPassEncrypted' + VMEncryptionType VMEncryptionType `json:"vmEncryptionType,omitempty"` + // TfoAzureVMName - The test failover vm name. + TfoAzureVMName *string `json:"tfoAzureVMName,omitempty"` + // RecoveryAzureGeneration - READ-ONLY; The recovery azure generation. + RecoveryAzureGeneration *string `json:"recoveryAzureGeneration,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // RecoveryVirtualMachineScaleSetID - The recovery virtual machine scale set id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReplicationDetails. +func (ard A2AReplicationDetails) MarshalJSON() ([]byte, error) { + ard.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ard.FabricObjectID != nil { + objectMap["fabricObjectId"] = ard.FabricObjectID + } + if ard.InitialPrimaryExtendedLocation != nil { + objectMap["initialPrimaryExtendedLocation"] = ard.InitialPrimaryExtendedLocation + } + if ard.InitialRecoveryExtendedLocation != nil { + objectMap["initialRecoveryExtendedLocation"] = ard.InitialRecoveryExtendedLocation + } + if ard.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = ard.MultiVMGroupID + } + if ard.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = ard.MultiVMGroupName + } + if ard.MultiVMGroupCreateOption != "" { + objectMap["multiVmGroupCreateOption"] = ard.MultiVMGroupCreateOption + } + if ard.ManagementID != nil { + objectMap["managementId"] = ard.ManagementID + } + if ard.ProtectedDisks != nil { + objectMap["protectedDisks"] = ard.ProtectedDisks + } + if ard.UnprotectedDisks != nil { + objectMap["unprotectedDisks"] = ard.UnprotectedDisks + } + if ard.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = ard.ProtectedManagedDisks + } + if ard.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = ard.RecoveryBootDiagStorageAccountID + } + if ard.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = ard.PrimaryFabricLocation + } + if ard.RecoveryFabricLocation != nil { + objectMap["recoveryFabricLocation"] = ard.RecoveryFabricLocation + } + if ard.OsType != nil { + objectMap["osType"] = ard.OsType + } + if ard.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = ard.RecoveryAzureVMSize + } + if ard.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVMName"] = ard.RecoveryAzureVMName + } + if ard.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = ard.RecoveryAzureResourceGroupID + } + if ard.RecoveryCloudService != nil { + objectMap["recoveryCloudService"] = ard.RecoveryCloudService + } + if ard.RecoveryAvailabilitySet != nil { + objectMap["recoveryAvailabilitySet"] = ard.RecoveryAvailabilitySet + } + if ard.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = ard.SelectedRecoveryAzureNetworkID + } + if ard.SelectedTfoAzureNetworkID != nil { + objectMap["selectedTfoAzureNetworkId"] = ard.SelectedTfoAzureNetworkID + } + if ard.VMNics != nil { + objectMap["vmNics"] = ard.VMNics + } + if ard.VMSyncedConfigDetails != nil { + objectMap["vmSyncedConfigDetails"] = ard.VMSyncedConfigDetails + } + if ard.MonitoringPercentageCompletion != nil { + objectMap["monitoringPercentageCompletion"] = ard.MonitoringPercentageCompletion + } + if ard.MonitoringJobType != nil { + objectMap["monitoringJobType"] = ard.MonitoringJobType + } + if ard.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = ard.LastHeartbeat + } + if ard.AgentVersion != nil { + objectMap["agentVersion"] = ard.AgentVersion + } + if ard.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = ard.AgentExpiryDate + } + if ard.IsReplicationAgentUpdateRequired != nil { + objectMap["isReplicationAgentUpdateRequired"] = ard.IsReplicationAgentUpdateRequired + } + if ard.IsReplicationAgentCertificateUpdateRequired != nil { + objectMap["isReplicationAgentCertificateUpdateRequired"] = ard.IsReplicationAgentCertificateUpdateRequired + } + if ard.RecoveryFabricObjectID != nil { + objectMap["recoveryFabricObjectId"] = ard.RecoveryFabricObjectID + } + if ard.VMProtectionState != nil { + objectMap["vmProtectionState"] = ard.VMProtectionState + } + if ard.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = ard.VMProtectionStateDescription + } + if ard.LifecycleID != nil { + objectMap["lifecycleId"] = ard.LifecycleID + } + if ard.TestFailoverRecoveryFabricObjectID != nil { + objectMap["testFailoverRecoveryFabricObjectId"] = ard.TestFailoverRecoveryFabricObjectID + } + if ard.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = ard.RpoInSeconds + } + if ard.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = ard.LastRpoCalculatedTime + } + if ard.PrimaryAvailabilityZone != nil { + objectMap["primaryAvailabilityZone"] = ard.PrimaryAvailabilityZone + } + if ard.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = ard.RecoveryAvailabilityZone + } + if ard.PrimaryExtendedLocation != nil { + objectMap["primaryExtendedLocation"] = ard.PrimaryExtendedLocation + } + if ard.RecoveryExtendedLocation != nil { + objectMap["recoveryExtendedLocation"] = ard.RecoveryExtendedLocation + } + if ard.TfoAzureVMName != nil { + objectMap["tfoAzureVMName"] = ard.TfoAzureVMName + } + if ard.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = ard.RecoveryProximityPlacementGroupID + } + if ard.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = ard.AutoProtectionOfDataDisk + } + if ard.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = ard.RecoveryVirtualMachineScaleSetID + } + if ard.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = ard.RecoveryCapacityReservationGroupID + } + if ard.InstanceType != "" { + objectMap["instanceType"] = ard.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return &ard, true +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &ard, true +} + +// A2AReplicationIntentDetails a2A provider specific settings. +type A2AReplicationIntentDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryLocation - The primary location for the virtual machine. + PrimaryLocation *string `json:"primaryLocation,omitempty"` + // RecoveryLocation - The recovery location for the virtual machine. + RecoveryLocation *string `json:"recoveryLocation,omitempty"` + // RecoverySubscriptionID - The recovery subscription Id of the virtual machine. + RecoverySubscriptionID *string `json:"recoverySubscriptionId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AProtectionIntentDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AProtectionIntentManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ProtectionProfile - The protection profile custom details. + ProtectionProfile BasicProtectionProfileCustomDetails `json:"protectionProfile,omitempty"` + // PrimaryStagingStorageAccount - The primary staging storage account details. + PrimaryStagingStorageAccount BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccount,omitempty"` + // RecoveryAvailabilitySet - The recovery availability set details. + RecoveryAvailabilitySet BasicRecoveryAvailabilitySetCustomDetails `json:"recoveryAvailabilitySet,omitempty"` + // RecoveryVirtualNetwork - The recovery virtual network details. + RecoveryVirtualNetwork BasicRecoveryVirtualNetworkCustomDetails `json:"recoveryVirtualNetwork,omitempty"` + // RecoveryProximityPlacementGroup - The recovery proximity placement group custom details. + RecoveryProximityPlacementGroup BasicRecoveryProximityPlacementGroupCustomDetails `json:"recoveryProximityPlacementGroup,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccount - The boot diagnostic storage account. + RecoveryBootDiagStorageAccount BasicStorageAccountCustomDetails `json:"recoveryBootDiagStorageAccount,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryAvailabilityType - The recovery availability type of the virtual machine. + RecoveryAvailabilityType *string `json:"recoveryAvailabilityType,omitempty"` + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings', 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A' + InstanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) MarshalJSON() ([]byte, error) { + arid.InstanceType = InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if arid.FabricObjectID != nil { + objectMap["fabricObjectId"] = arid.FabricObjectID + } + if arid.PrimaryLocation != nil { + objectMap["primaryLocation"] = arid.PrimaryLocation + } + if arid.RecoveryLocation != nil { + objectMap["recoveryLocation"] = arid.RecoveryLocation + } + if arid.RecoverySubscriptionID != nil { + objectMap["recoverySubscriptionId"] = arid.RecoverySubscriptionID + } + if arid.VMDisks != nil { + objectMap["vmDisks"] = arid.VMDisks + } + if arid.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = arid.VMManagedDisks + } + if arid.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = arid.RecoveryResourceGroupID + } + objectMap["protectionProfile"] = arid.ProtectionProfile + objectMap["primaryStagingStorageAccount"] = arid.PrimaryStagingStorageAccount + objectMap["recoveryAvailabilitySet"] = arid.RecoveryAvailabilitySet + objectMap["recoveryVirtualNetwork"] = arid.RecoveryVirtualNetwork + objectMap["recoveryProximityPlacementGroup"] = arid.RecoveryProximityPlacementGroup + if arid.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = arid.AutoProtectionOfDataDisk + } + if arid.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = arid.MultiVMGroupName + } + if arid.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = arid.MultiVMGroupID + } + objectMap["recoveryBootDiagStorageAccount"] = arid.RecoveryBootDiagStorageAccount + if arid.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = arid.DiskEncryptionInfo + } + if arid.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = arid.RecoveryAvailabilityZone + } + if arid.RecoveryAvailabilityType != nil { + objectMap["recoveryAvailabilityType"] = arid.RecoveryAvailabilityType + } + if arid.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = arid.AgentAutoUpdateStatus + } + if arid.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = arid.AutomationAccountArmID + } + if arid.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = arid.AutomationAccountAuthenticationType + } + if arid.InstanceType != "" { + objectMap["instanceType"] = arid.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReplicationIntentDetails is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) { + return &arid, true +} + +// AsReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsBasicReplicationProtectionIntentProviderSpecificSettings() (BasicReplicationProtectionIntentProviderSpecificSettings, bool) { + return &arid, true +} + +// UnmarshalJSON is the custom unmarshaler for A2AReplicationIntentDetails struct. +func (arid *A2AReplicationIntentDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "fabricObjectId": + if v != nil { + var fabricObjectID string + err = json.Unmarshal(*v, &fabricObjectID) + if err != nil { + return err + } + arid.FabricObjectID = &fabricObjectID + } + case "primaryLocation": + if v != nil { + var primaryLocation string + err = json.Unmarshal(*v, &primaryLocation) + if err != nil { + return err + } + arid.PrimaryLocation = &primaryLocation + } + case "recoveryLocation": + if v != nil { + var recoveryLocation string + err = json.Unmarshal(*v, &recoveryLocation) + if err != nil { + return err + } + arid.RecoveryLocation = &recoveryLocation + } + case "recoverySubscriptionId": + if v != nil { + var recoverySubscriptionID string + err = json.Unmarshal(*v, &recoverySubscriptionID) + if err != nil { + return err + } + arid.RecoverySubscriptionID = &recoverySubscriptionID + } + case "vmDisks": + if v != nil { + var VMDisks []A2AProtectionIntentDiskInputDetails + err = json.Unmarshal(*v, &VMDisks) + if err != nil { + return err + } + arid.VMDisks = &VMDisks + } + case "vmManagedDisks": + if v != nil { + var VMManagedDisks []A2AProtectionIntentManagedDiskInputDetails + err = json.Unmarshal(*v, &VMManagedDisks) + if err != nil { + return err + } + arid.VMManagedDisks = &VMManagedDisks + } + case "recoveryResourceGroupId": + if v != nil { + var recoveryResourceGroupID string + err = json.Unmarshal(*v, &recoveryResourceGroupID) + if err != nil { + return err + } + arid.RecoveryResourceGroupID = &recoveryResourceGroupID + } + case "protectionProfile": + if v != nil { + protectionProfile, err := unmarshalBasicProtectionProfileCustomDetails(*v) + if err != nil { + return err + } + arid.ProtectionProfile = protectionProfile + } + case "primaryStagingStorageAccount": + if v != nil { + primaryStagingStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + arid.PrimaryStagingStorageAccount = primaryStagingStorageAccount + } + case "recoveryAvailabilitySet": + if v != nil { + recoveryAvailabilitySet, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryAvailabilitySet = recoveryAvailabilitySet + } + case "recoveryVirtualNetwork": + if v != nil { + recoveryVirtualNetwork, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryVirtualNetwork = recoveryVirtualNetwork + } + case "recoveryProximityPlacementGroup": + if v != nil { + recoveryProximityPlacementGroup, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryProximityPlacementGroup = recoveryProximityPlacementGroup + } + case "autoProtectionOfDataDisk": + if v != nil { + var autoProtectionOfDataDisk AutoProtectionOfDataDisk + err = json.Unmarshal(*v, &autoProtectionOfDataDisk) + if err != nil { + return err + } + arid.AutoProtectionOfDataDisk = autoProtectionOfDataDisk + } + case "multiVmGroupName": + if v != nil { + var multiVMGroupName string + err = json.Unmarshal(*v, &multiVMGroupName) + if err != nil { + return err + } + arid.MultiVMGroupName = &multiVMGroupName + } + case "multiVmGroupId": + if v != nil { + var multiVMGroupID string + err = json.Unmarshal(*v, &multiVMGroupID) + if err != nil { + return err + } + arid.MultiVMGroupID = &multiVMGroupID + } + case "recoveryBootDiagStorageAccount": + if v != nil { + recoveryBootDiagStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryBootDiagStorageAccount = recoveryBootDiagStorageAccount + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + arid.DiskEncryptionInfo = &diskEncryptionInfo + } + case "recoveryAvailabilityZone": + if v != nil { + var recoveryAvailabilityZone string + err = json.Unmarshal(*v, &recoveryAvailabilityZone) + if err != nil { + return err + } + arid.RecoveryAvailabilityZone = &recoveryAvailabilityZone + } + case "recoveryAvailabilityType": + if v != nil { + var recoveryAvailabilityType string + err = json.Unmarshal(*v, &recoveryAvailabilityType) + if err != nil { + return err + } + arid.RecoveryAvailabilityType = &recoveryAvailabilityType + } + case "agentAutoUpdateStatus": + if v != nil { + var agentAutoUpdateStatus AgentAutoUpdateStatus + err = json.Unmarshal(*v, &agentAutoUpdateStatus) + if err != nil { + return err + } + arid.AgentAutoUpdateStatus = agentAutoUpdateStatus + } + case "automationAccountArmId": + if v != nil { + var automationAccountArmID string + err = json.Unmarshal(*v, &automationAccountArmID) + if err != nil { + return err + } + arid.AutomationAccountArmID = &automationAccountArmID + } + case "automationAccountAuthenticationType": + if v != nil { + var automationAccountAuthenticationType AutomationAccountAuthenticationType + err = json.Unmarshal(*v, &automationAccountAuthenticationType) + if err != nil { + return err + } + arid.AutomationAccountAuthenticationType = automationAccountAuthenticationType + } + case "instanceType": + if v != nil { + var instanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings + err = json.Unmarshal(*v, &instanceType) + if err != nil { + return err + } + arid.InstanceType = instanceType + } + } + } + + return nil +} + +// A2AReprotectInput azure specific reprotect input. +type A2AReprotectInput struct { + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReprotectInput. +func (ari A2AReprotectInput) MarshalJSON() ([]byte, error) { + ari.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ari.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = ari.RecoveryContainerID + } + if ari.VMDisks != nil { + objectMap["vmDisks"] = ari.VMDisks + } + if ari.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = ari.RecoveryResourceGroupID + } + if ari.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = ari.RecoveryCloudServiceID + } + if ari.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = ari.RecoveryAvailabilitySetID + } + if ari.PolicyID != nil { + objectMap["policyId"] = ari.PolicyID + } + if ari.InstanceType != "" { + objectMap["instanceType"] = ari.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return &ari, true +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &ari, true +} + +// A2ASwitchProtectionInput a2A specific switch protection input. +type A2ASwitchProtectionInput struct { + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // RecoveryVirtualMachineScaleSetID - The virtual machine scale set id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput', 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicSwitchProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) MarshalJSON() ([]byte, error) { + aspi.InstanceType = InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aspi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = aspi.RecoveryContainerID + } + if aspi.VMDisks != nil { + objectMap["vmDisks"] = aspi.VMDisks + } + if aspi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aspi.VMManagedDisks + } + if aspi.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aspi.RecoveryResourceGroupID + } + if aspi.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aspi.RecoveryCloudServiceID + } + if aspi.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = aspi.RecoveryAvailabilitySetID + } + if aspi.PolicyID != nil { + objectMap["policyId"] = aspi.PolicyID + } + if aspi.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aspi.RecoveryBootDiagStorageAccountID + } + if aspi.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = aspi.RecoveryAvailabilityZone + } + if aspi.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aspi.RecoveryProximityPlacementGroupID + } + if aspi.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aspi.RecoveryVirtualMachineScaleSetID + } + if aspi.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = aspi.RecoveryCapacityReservationGroupID + } + if aspi.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aspi.DiskEncryptionInfo + } + if aspi.InstanceType != "" { + objectMap["instanceType"] = aspi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ASwitchProtectionInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) { + return &aspi, true +} + +// AsSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsBasicSwitchProtectionProviderSpecificInput() (BasicSwitchProtectionProviderSpecificInput, bool) { + return &aspi, true +} + +// A2ATestFailoverInput a2A provider specific input for test failover. +type A2ATestFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for TFO or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) MarshalJSON() ([]byte, error) { + atfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if atfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = atfi.RecoveryPointID + } + if atfi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = atfi.CloudServiceCreationOption + } + if atfi.InstanceType != "" { + objectMap["instanceType"] = atfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return &atfi, true +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &atfi, true +} + +// A2AUnplannedFailoverInput a2A provider specific input for unplanned failover. +type A2AUnplannedFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for failover or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + aufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = aufi.RecoveryPointID + } + if aufi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = aufi.CloudServiceCreationOption + } + if aufi.InstanceType != "" { + objectMap["instanceType"] = aufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return &aufi, true +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &aufi, true +} + +// A2AUnprotectedDiskDetails a2A unprotected disk details. +type A2AUnprotectedDiskDetails struct { + // DiskLunID - The source lun Id for the data disk. + DiskLunID *int32 `json:"diskLunId,omitempty"` + // DiskAutoProtectionStatus - A value indicating whether the disk auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + DiskAutoProtectionStatus AutoProtectionOfDataDisk `json:"diskAutoProtectionStatus,omitempty"` +} + +// A2AUpdateContainerMappingInput a2A update protection container mapping. +type A2AUpdateContainerMappingInput struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + aucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aucmi.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = aucmi.AgentAutoUpdateStatus + } + if aucmi.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = aucmi.AutomationAccountArmID + } + if aucmi.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = aucmi.AutomationAccountAuthenticationType + } + if aucmi.InstanceType != "" { + objectMap["instanceType"] = aucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return &aucmi, true +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &aucmi, true +} + +// A2AUpdateReplicationProtectedItemInput inMage Azure V2 input to update replication protected item. +type A2AUpdateReplicationProtectedItemInput struct { + // RecoveryCloudServiceID - The target cloud service ARM Id (for V1). + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryResourceGroupID - The target resource group ARM Id (for V2). + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ManagedDiskUpdateDetails - Managed disk update details. + ManagedDiskUpdateDetails *[]A2AVMManagedDiskUpdateDetails `json:"managedDiskUpdateDetails,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // DiskEncryptionInfo - The recovery os disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // TfoAzureVMName - The user given name for Test Failover VM. + TfoAzureVMName *string `json:"tfoAzureVMName,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // RecoveryVirtualMachineScaleSetID - The recovery virtual machine scale set Id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + aurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aurpii.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aurpii.RecoveryCloudServiceID + } + if aurpii.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aurpii.RecoveryResourceGroupID + } + if aurpii.ManagedDiskUpdateDetails != nil { + objectMap["managedDiskUpdateDetails"] = aurpii.ManagedDiskUpdateDetails + } + if aurpii.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aurpii.RecoveryBootDiagStorageAccountID + } + if aurpii.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aurpii.DiskEncryptionInfo + } + if aurpii.TfoAzureVMName != nil { + objectMap["tfoAzureVMName"] = aurpii.TfoAzureVMName + } + if aurpii.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aurpii.RecoveryProximityPlacementGroupID + } + if aurpii.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aurpii.RecoveryVirtualMachineScaleSetID + } + if aurpii.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = aurpii.RecoveryCapacityReservationGroupID + } + if aurpii.InstanceType != "" { + objectMap["instanceType"] = aurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return &aurpii, true +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &aurpii, true +} + +// A2AVMDiskInputDetails a2A disk input details. +type A2AVMDiskInputDetails struct { + // DiskURI - The disk Uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountID - The recovery VHD storage account Id. + RecoveryAzureStorageAccountID *string `json:"recoveryAzureStorageAccountId,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account Id. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` +} + +// A2AVMManagedDiskInputDetails a2A managed disk input details. +type A2AVMManagedDiskInputDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account Arm Id. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // RecoveryResourceGroupID - The target resource group Arm Id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for one / single pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` +} + +// A2AVMManagedDiskUpdateDetails a2A Vm managed disk update details. +type A2AVMManagedDiskUpdateDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type before failover. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type before failover. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // DiskEncryptionInfo - The recovery os disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // FailoverDiskName - The target disk name for unplanned failover operation. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The target disk name for test failover operation. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AZoneDetails zone details data. +type A2AZoneDetails struct { + // Source - Source zone info. + Source *string `json:"source,omitempty"` + // Target - The target zone info. + Target *string `json:"target,omitempty"` +} + +// AddDisksInput input for add disk(s) operation. +type AddDisksInput struct { + // Properties - Add disks input properties. + Properties *AddDisksInputProperties `json:"properties,omitempty"` +} + +// AddDisksInputProperties add Disks input properties. +type AddDisksInputProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicAddDisksProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AddDisksInputProperties struct. +func (adip *AddDisksInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicAddDisksProviderSpecificInput(*v) + if err != nil { + return err + } + adip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicAddDisksProviderSpecificInput add Disks provider specific input. +type BasicAddDisksProviderSpecificInput interface { + AsA2AAddDisksInput() (*A2AAddDisksInput, bool) + AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) +} + +// AddDisksProviderSpecificInput add Disks provider specific input. +type AddDisksProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeAddDisksProviderSpecificInput', 'InstanceTypeA2A' + InstanceType InstanceType `json:"instanceType,omitempty"` +} + +func unmarshalBasicAddDisksProviderSpecificInput(body []byte) (BasicAddDisksProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeA2A): + var aadi A2AAddDisksInput + err := json.Unmarshal(body, &aadi) + return aadi, err + default: + var adpsi AddDisksProviderSpecificInput + err := json.Unmarshal(body, &adpsi) + return adpsi, err + } +} +func unmarshalBasicAddDisksProviderSpecificInputArray(body []byte) ([]BasicAddDisksProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + adpsiArray := make([]BasicAddDisksProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + adpsi, err := unmarshalBasicAddDisksProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + adpsiArray[index] = adpsi + } + return adpsiArray, nil +} + +// MarshalJSON is the custom marshaler for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) MarshalJSON() ([]byte, error) { + adpsi.InstanceType = InstanceTypeAddDisksProviderSpecificInput + objectMap := make(map[string]interface{}) + if adpsi.InstanceType != "" { + objectMap["instanceType"] = adpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AAddDisksInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsA2AAddDisksInput() (*A2AAddDisksInput, bool) { + return nil, false +} + +// AsAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) { + return &adpsi, true +} + +// AsBasicAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsBasicAddDisksProviderSpecificInput() (BasicAddDisksProviderSpecificInput, bool) { + return &adpsi, true +} + +// AddRecoveryServicesProviderInput input required to add a provider. +type AddRecoveryServicesProviderInput struct { + // Properties - The properties of an add provider request. + Properties *AddRecoveryServicesProviderInputProperties `json:"properties,omitempty"` +} + +// AddRecoveryServicesProviderInputProperties the properties of an add provider request. +type AddRecoveryServicesProviderInputProperties struct { + // MachineName - The name of the machine where the provider is getting added. + MachineName *string `json:"machineName,omitempty"` + // MachineID - The Id of the machine where the provider is getting added. + MachineID *string `json:"machineId,omitempty"` + // BiosID - The Bios Id of the machine. + BiosID *string `json:"biosId,omitempty"` + // AuthenticationIdentityInput - The identity provider input for DRA authentication. + AuthenticationIdentityInput *IdentityProviderInput `json:"authenticationIdentityInput,omitempty"` + // ResourceAccessIdentityInput - The identity provider input for resource access. + ResourceAccessIdentityInput *IdentityProviderInput `json:"resourceAccessIdentityInput,omitempty"` + // DataPlaneAuthenticationIdentityInput - The identity provider input for data plane authentication. + DataPlaneAuthenticationIdentityInput *IdentityProviderInput `json:"dataPlaneAuthenticationIdentityInput,omitempty"` +} + +// AddVCenterRequest input required to add vCenter. +type AddVCenterRequest struct { + // Properties - The properties of an add vCenter request. + Properties *AddVCenterRequestProperties `json:"properties,omitempty"` +} + +// AddVCenterRequestProperties the properties of an add vCenter request. +type AddVCenterRequestProperties struct { + // FriendlyName - The friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the vCenter to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // ProcessServerID - The process server Id from where the discovery is orchestrated. + ProcessServerID *string `json:"processServerId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The account Id which has privileges to discover the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// AgentDetails agent details. +type AgentDetails struct { + // AgentID - READ-ONLY; The Id of the agent running on the server. + AgentID *string `json:"agentId,omitempty"` + // MachineID - READ-ONLY; The Id of the machine to which the agent is registered. + MachineID *string `json:"machineId,omitempty"` + // BiosID - READ-ONLY; The machine BIOS Id. + BiosID *string `json:"biosId,omitempty"` + // Fqdn - READ-ONLY; The machine FQDN. + Fqdn *string `json:"fqdn,omitempty"` + // Disks - READ-ONLY; The disks. + Disks *[]AgentDiskDetails `json:"disks,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentDetails. +func (ad AgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AgentDiskDetails agent disk details. +type AgentDiskDetails struct { + // DiskID - READ-ONLY; The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LunID - READ-ONLY; The lun of disk. + LunID *int32 `json:"lunId,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentDiskDetails. +func (add AgentDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Alert implements the Alert class. +type Alert struct { + autorest.Response `json:"-"` + // Properties - Alert related data. + Properties *AlertProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Alert. +func (a Alert) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.Properties != nil { + objectMap["properties"] = a.Properties + } + if a.Location != nil { + objectMap["location"] = a.Location + } + return json.Marshal(objectMap) +} + +// AlertCollection collection of alerts. +type AlertCollection struct { + autorest.Response `json:"-"` + // Value - The list of alerts. + Value *[]Alert `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// AlertCollectionIterator provides access to a complete listing of Alert values. +type AlertCollectionIterator struct { + i int + page AlertCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AlertCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AlertCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AlertCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AlertCollectionIterator) Response() AlertCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AlertCollectionIterator) Value() Alert { + if !iter.page.NotDone() { + return Alert{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AlertCollectionIterator type. +func NewAlertCollectionIterator(page AlertCollectionPage) AlertCollectionIterator { + return AlertCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ac AlertCollection) IsEmpty() bool { + return ac.Value == nil || len(*ac.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ac AlertCollection) hasNextLink() bool { + return ac.NextLink != nil && len(*ac.NextLink) != 0 +} + +// alertCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ac AlertCollection) alertCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ac.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ac.NextLink))) +} + +// AlertCollectionPage contains a page of Alert values. +type AlertCollectionPage struct { + fn func(context.Context, AlertCollection) (AlertCollection, error) + ac AlertCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AlertCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ac) + if err != nil { + return err + } + page.ac = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AlertCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AlertCollectionPage) NotDone() bool { + return !page.ac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AlertCollectionPage) Response() AlertCollection { + return page.ac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AlertCollectionPage) Values() []Alert { + if page.ac.IsEmpty() { + return nil + } + return *page.ac.Value +} + +// Creates a new instance of the AlertCollectionPage type. +func NewAlertCollectionPage(cur AlertCollection, getNextPage func(context.Context, AlertCollection) (AlertCollection, error)) AlertCollectionPage { + return AlertCollectionPage{ + fn: getNextPage, + ac: cur, + } +} + +// AlertProperties the properties of an alert. +type AlertProperties struct { + // SendToOwners - A value indicating whether to send email to subscription administrator. + SendToOwners *string `json:"sendToOwners,omitempty"` + // CustomEmailAddresses - The custom email address for sending emails. + CustomEmailAddresses *[]string `json:"customEmailAddresses,omitempty"` + // Locale - The locale for the email notification. + Locale *string `json:"locale,omitempty"` +} + +// ApplianceCollection collection of appliance details. +type ApplianceCollection struct { + autorest.Response `json:"-"` + // Value - The appliance details. + Value *[]ReplicationAppliance `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ApplianceCollectionIterator provides access to a complete listing of ReplicationAppliance values. +type ApplianceCollectionIterator struct { + i int + page ApplianceCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ApplianceCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplianceCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ApplianceCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ApplianceCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ApplianceCollectionIterator) Response() ApplianceCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ApplianceCollectionIterator) Value() ReplicationAppliance { + if !iter.page.NotDone() { + return ReplicationAppliance{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ApplianceCollectionIterator type. +func NewApplianceCollectionIterator(page ApplianceCollectionPage) ApplianceCollectionIterator { + return ApplianceCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ac ApplianceCollection) IsEmpty() bool { + return ac.Value == nil || len(*ac.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ac ApplianceCollection) hasNextLink() bool { + return ac.NextLink != nil && len(*ac.NextLink) != 0 +} + +// applianceCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ac ApplianceCollection) applianceCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ac.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ac.NextLink))) +} + +// ApplianceCollectionPage contains a page of ReplicationAppliance values. +type ApplianceCollectionPage struct { + fn func(context.Context, ApplianceCollection) (ApplianceCollection, error) + ac ApplianceCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ApplianceCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplianceCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ac) + if err != nil { + return err + } + page.ac = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ApplianceCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ApplianceCollectionPage) NotDone() bool { + return !page.ac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ApplianceCollectionPage) Response() ApplianceCollection { + return page.ac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ApplianceCollectionPage) Values() []ReplicationAppliance { + if page.ac.IsEmpty() { + return nil + } + return *page.ac.Value +} + +// Creates a new instance of the ApplianceCollectionPage type. +func NewApplianceCollectionPage(cur ApplianceCollection, getNextPage func(context.Context, ApplianceCollection) (ApplianceCollection, error)) ApplianceCollectionPage { + return ApplianceCollectionPage{ + fn: getNextPage, + ac: cur, + } +} + +// ApplianceQueryParameter query parameter to get appliance. +type ApplianceQueryParameter struct { + // ProviderType - The providerType to be used for fetching appliance details. + ProviderType *string `json:"providerType,omitempty"` +} + +// BasicApplianceSpecificDetails appliance specific details. +type BasicApplianceSpecificDetails interface { + AsInMageRcmApplianceSpecificDetails() (*InMageRcmApplianceSpecificDetails, bool) + AsApplianceSpecificDetails() (*ApplianceSpecificDetails, bool) +} + +// ApplianceSpecificDetails appliance specific details. +type ApplianceSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeApplianceSpecificDetails', 'InstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplianceSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicApplianceSpecificDetails(body []byte) (BasicApplianceSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInMageRcm): + var imrasd InMageRcmApplianceSpecificDetails + err := json.Unmarshal(body, &imrasd) + return imrasd, err + default: + var asd ApplianceSpecificDetails + err := json.Unmarshal(body, &asd) + return asd, err + } +} +func unmarshalBasicApplianceSpecificDetailsArray(body []byte) ([]BasicApplianceSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + asdArray := make([]BasicApplianceSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + asd, err := unmarshalBasicApplianceSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + asdArray[index] = asd + } + return asdArray, nil +} + +// MarshalJSON is the custom marshaler for ApplianceSpecificDetails. +func (asd ApplianceSpecificDetails) MarshalJSON() ([]byte, error) { + asd.InstanceType = InstanceTypeApplianceSpecificDetails + objectMap := make(map[string]interface{}) + if asd.InstanceType != "" { + objectMap["instanceType"] = asd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageRcmApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for ApplianceSpecificDetails. +func (asd ApplianceSpecificDetails) AsInMageRcmApplianceSpecificDetails() (*InMageRcmApplianceSpecificDetails, bool) { + return nil, false +} + +// AsApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for ApplianceSpecificDetails. +func (asd ApplianceSpecificDetails) AsApplianceSpecificDetails() (*ApplianceSpecificDetails, bool) { + return &asd, true +} + +// AsBasicApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for ApplianceSpecificDetails. +func (asd ApplianceSpecificDetails) AsBasicApplianceSpecificDetails() (BasicApplianceSpecificDetails, bool) { + return &asd, true +} + +// ApplyRecoveryPointInput input to apply recovery point. +type ApplyRecoveryPointInput struct { + // Properties - The input properties to apply recovery point. + Properties *ApplyRecoveryPointInputProperties `json:"properties,omitempty"` +} + +// ApplyRecoveryPointInputProperties input properties to apply recovery point. +type ApplyRecoveryPointInputProperties struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // ProviderSpecificDetails - Provider specific input for applying recovery point. + ProviderSpecificDetails BasicApplyRecoveryPointProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ApplyRecoveryPointInputProperties struct. +func (arpip *ApplyRecoveryPointInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryPointId": + if v != nil { + var recoveryPointID string + err = json.Unmarshal(*v, &recoveryPointID) + if err != nil { + return err + } + arpip.RecoveryPointID = &recoveryPointID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicApplyRecoveryPointProviderSpecificInput(*v) + if err != nil { + return err + } + arpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicApplyRecoveryPointProviderSpecificInput provider specific input for apply recovery point. +type BasicApplyRecoveryPointProviderSpecificInput interface { + AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) + AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) + AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) + AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) + AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) + AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) +} + +// ApplyRecoveryPointProviderSpecificInput provider specific input for apply recovery point. +type ApplyRecoveryPointProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicApplyRecoveryPointProviderSpecificInput(body []byte) (BasicApplyRecoveryPointProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A): + var aarpi A2AApplyRecoveryPointInput + err := json.Unmarshal(body, &aarpi) + return aarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput + err := json.Unmarshal(body, &accmarpi) + return accmarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraarpi HyperVReplicaAzureApplyRecoveryPointInput + err := json.Unmarshal(body, &hvraarpi) + return hvraarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2): + var imavarpi InMageAzureV2ApplyRecoveryPointInput + err := json.Unmarshal(body, &imavarpi) + return imavarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm): + var imrarpi InMageRcmApplyRecoveryPointInput + err := json.Unmarshal(body, &imrarpi) + return imrarpi, err + default: + var arppsi ApplyRecoveryPointProviderSpecificInput + err := json.Unmarshal(body, &arppsi) + return arppsi, err + } +} +func unmarshalBasicApplyRecoveryPointProviderSpecificInputArray(body []byte) ([]BasicApplyRecoveryPointProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + arppsiArray := make([]BasicApplyRecoveryPointProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + arppsi, err := unmarshalBasicApplyRecoveryPointProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + arppsiArray[index] = arppsi + } + return arppsiArray, nil +} + +// MarshalJSON is the custom marshaler for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) MarshalJSON() ([]byte, error) { + arppsi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput + objectMap := make(map[string]interface{}) + if arppsi.InstanceType != "" { + objectMap["instanceType"] = arppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return &arppsi, true +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &arppsi, true +} + +// AsrJobDetails this class represents job details based on specific job type. +type AsrJobDetails struct { + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AsrJobDetails. +func (ajd AsrJobDetails) MarshalJSON() ([]byte, error) { + ajd.InstanceType = InstanceTypeAsrJobDetails + objectMap := make(map[string]interface{}) + if ajd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = ajd.AffectedObjectDetails + } + if ajd.InstanceType != "" { + objectMap["instanceType"] = ajd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return &ajd, true +} + +// AsExportJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &ajd, true +} + +// ASRTask task of the Job. +type ASRTask struct { + // TaskID - The Id. + TaskID *string `json:"taskId,omitempty"` + // Name - The unique Task name. + Name *string `json:"name,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // AllowedActions - The state/actions applicable on this task. + AllowedActions *[]string `json:"allowedActions,omitempty"` + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // State - The State. It is one of these values - NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or Other. + State *string `json:"state,omitempty"` + // StateDescription - The description of the task state. For example - For Succeeded state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. + StateDescription *string `json:"stateDescription,omitempty"` + // TaskType - The type of task. Details in CustomDetails property depend on this type. + TaskType *string `json:"taskType,omitempty"` + // CustomDetails - The custom task details based on the task type. + CustomDetails BasicTaskTypeDetails `json:"customDetails,omitempty"` + // GroupTaskCustomDetails - The custom task details based on the task type, if the task type is GroupTaskDetails or one of the types derived from it. + GroupTaskCustomDetails BasicGroupTaskDetails `json:"groupTaskCustomDetails,omitempty"` + // Errors - The task error details. + Errors *[]JobErrorDetails `json:"errors,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ASRTask struct. +func (at *ASRTask) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "taskId": + if v != nil { + var taskID string + err = json.Unmarshal(*v, &taskID) + if err != nil { + return err + } + at.TaskID = &taskID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + at.Name = &name + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + at.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + at.EndTime = &endTime + } + case "allowedActions": + if v != nil { + var allowedActions []string + err = json.Unmarshal(*v, &allowedActions) + if err != nil { + return err + } + at.AllowedActions = &allowedActions + } + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + at.FriendlyName = &friendlyName + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + at.State = &state + } + case "stateDescription": + if v != nil { + var stateDescription string + err = json.Unmarshal(*v, &stateDescription) + if err != nil { + return err + } + at.StateDescription = &stateDescription + } + case "taskType": + if v != nil { + var taskType string + err = json.Unmarshal(*v, &taskType) + if err != nil { + return err + } + at.TaskType = &taskType + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicTaskTypeDetails(*v) + if err != nil { + return err + } + at.CustomDetails = customDetails + } + case "groupTaskCustomDetails": + if v != nil { + groupTaskCustomDetails, err := unmarshalBasicGroupTaskDetails(*v) + if err != nil { + return err + } + at.GroupTaskCustomDetails = groupTaskCustomDetails + } + case "errors": + if v != nil { + var errorsVar []JobErrorDetails + err = json.Unmarshal(*v, &errorsVar) + if err != nil { + return err + } + at.Errors = &errorsVar + } + } + } + + return nil +} + +// AutomationRunbookTaskDetails this class represents the task details for an automation runbook. +type AutomationRunbookTaskDetails struct { + // Name - The recovery plan task name. + Name *string `json:"name,omitempty"` + // CloudServiceName - The cloud service of the automation runbook account. + CloudServiceName *string `json:"cloudServiceName,omitempty"` + // SubscriptionID - The subscription Id of the automation runbook account. + SubscriptionID *string `json:"subscriptionId,omitempty"` + // AccountName - The automation account name of the runbook. + AccountName *string `json:"accountName,omitempty"` + // RunbookID - The runbook Id. + RunbookID *string `json:"runbookId,omitempty"` + // RunbookName - The runbook name. + RunbookName *string `json:"runbookName,omitempty"` + // JobID - The job Id of the runbook execution. + JobID *string `json:"jobId,omitempty"` + // JobOutput - The execution output of the runbook. + JobOutput *string `json:"jobOutput,omitempty"` + // IsPrimarySideScript - A value indicating whether it is a primary side script or not. + IsPrimarySideScript *bool `json:"isPrimarySideScript,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) MarshalJSON() ([]byte, error) { + artd.InstanceType = InstanceTypeAutomationRunbookTaskDetails + objectMap := make(map[string]interface{}) + if artd.Name != nil { + objectMap["name"] = artd.Name + } + if artd.CloudServiceName != nil { + objectMap["cloudServiceName"] = artd.CloudServiceName + } + if artd.SubscriptionID != nil { + objectMap["subscriptionId"] = artd.SubscriptionID + } + if artd.AccountName != nil { + objectMap["accountName"] = artd.AccountName + } + if artd.RunbookID != nil { + objectMap["runbookId"] = artd.RunbookID + } + if artd.RunbookName != nil { + objectMap["runbookName"] = artd.RunbookName + } + if artd.JobID != nil { + objectMap["jobId"] = artd.JobID + } + if artd.JobOutput != nil { + objectMap["jobOutput"] = artd.JobOutput + } + if artd.IsPrimarySideScript != nil { + objectMap["isPrimarySideScript"] = artd.IsPrimarySideScript + } + if artd.InstanceType != "" { + objectMap["instanceType"] = artd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return &artd, true +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &artd, true +} + +// AzureFabricCreationInput fabric provider specific settings. +type AzureFabricCreationInput struct { + // Location - The Location. + Location *string `json:"location,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) MarshalJSON() ([]byte, error) { + afci.InstanceType = InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure + objectMap := make(map[string]interface{}) + if afci.Location != nil { + objectMap["location"] = afci.Location + } + if afci.InstanceType != "" { + objectMap["instanceType"] = afci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return &afci, true +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &afci, true +} + +// AzureFabricSpecificDetails azure Fabric Specific Details. +type AzureFabricSpecificDetails struct { + // Location - The Location for the Azure fabric. + Location *string `json:"location,omitempty"` + // ContainerIds - The container Ids for the Azure fabric. + ContainerIds *[]string `json:"containerIds,omitempty"` + // Zones - The zones. + Zones *[]A2AZoneDetails `json:"zones,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) MarshalJSON() ([]byte, error) { + afsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure + objectMap := make(map[string]interface{}) + if afsd.Location != nil { + objectMap["location"] = afsd.Location + } + if afsd.ContainerIds != nil { + objectMap["containerIds"] = afsd.ContainerIds + } + if afsd.Zones != nil { + objectMap["zones"] = afsd.Zones + } + if afsd.InstanceType != "" { + objectMap["instanceType"] = afsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return &afsd, true +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &afsd, true +} + +// AzureToAzureCreateNetworkMappingInput create network mappings input properties/behavior specific to +// Azure to Azure Network mapping. +type AzureToAzureCreateNetworkMappingInput struct { + // PrimaryNetworkID - The primary azure vnet Id. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + atacnmi.InstanceType = InstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if atacnmi.PrimaryNetworkID != nil { + objectMap["primaryNetworkId"] = atacnmi.PrimaryNetworkID + } + if atacnmi.InstanceType != "" { + objectMap["instanceType"] = atacnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return &atacnmi, true +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &atacnmi, true +} + +// AzureToAzureNetworkMappingSettings a2A Network Mapping fabric specific settings. +type AzureToAzureNetworkMappingSettings struct { + // PrimaryFabricLocation - The primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // RecoveryFabricLocation - The recovery fabric location. + RecoveryFabricLocation *string `json:"recoveryFabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) MarshalJSON() ([]byte, error) { + atanms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if atanms.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = atanms.PrimaryFabricLocation + } + if atanms.RecoveryFabricLocation != nil { + objectMap["recoveryFabricLocation"] = atanms.RecoveryFabricLocation + } + if atanms.InstanceType != "" { + objectMap["instanceType"] = atanms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return &atanms, true +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &atanms, true +} + +// AzureToAzureUpdateNetworkMappingInput updates network mappings input. +type AzureToAzureUpdateNetworkMappingInput struct { + // PrimaryNetworkID - The primary azure vnet Id. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + ataunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if ataunmi.PrimaryNetworkID != nil { + objectMap["primaryNetworkId"] = ataunmi.PrimaryNetworkID + } + if ataunmi.InstanceType != "" { + objectMap["instanceType"] = ataunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return &ataunmi, true +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &ataunmi, true +} + +// AzureToAzureVMSyncedConfigDetails azure to Azure VM synced configuration details. +type AzureToAzureVMSyncedConfigDetails struct { + // Tags - The Azure VM tags. + Tags map[string]*string `json:"tags"` + // InputEndpoints - The Azure VM input endpoints. + InputEndpoints *[]InputEndpoint `json:"inputEndpoints,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureVMSyncedConfigDetails. +func (atavscd AzureToAzureVMSyncedConfigDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if atavscd.Tags != nil { + objectMap["tags"] = atavscd.Tags + } + if atavscd.InputEndpoints != nil { + objectMap["inputEndpoints"] = atavscd.InputEndpoints + } + return json.Marshal(objectMap) +} + +// AzureVMDiskDetails disk details for E2A provider. +type AzureVMDiskDetails struct { + // VhdType - VHD type. + VhdType *string `json:"vhdType,omitempty"` + // VhdID - The VHD id. + VhdID *string `json:"vhdId,omitempty"` + // DiskID - The disk resource id. + DiskID *string `json:"diskId,omitempty"` + // VhdName - VHD name. + VhdName *string `json:"vhdName,omitempty"` + // MaxSizeMB - Max side in MB. + MaxSizeMB *string `json:"maxSizeMB,omitempty"` + // TargetDiskLocation - Blob uri of the Azure disk. + TargetDiskLocation *string `json:"targetDiskLocation,omitempty"` + // TargetDiskName - The target Azure disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` + // LunID - Ordinal\LunId of the disk for the Azure VM. + LunID *string `json:"lunId,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // CustomTargetDiskName - The custom target Azure disk name. + CustomTargetDiskName *string `json:"customTargetDiskName,omitempty"` +} + +// ComputeSizeErrorDetails represents the error used to indicate why the target compute size is not +// applicable. +type ComputeSizeErrorDetails struct { + // Message - The error message. + Message *string `json:"message,omitempty"` + // Severity - The severity of the error. + Severity *string `json:"severity,omitempty"` +} + +// BasicConfigurationSettings replication provider specific settings. +type BasicConfigurationSettings interface { + AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) + AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) + AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) + AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) + AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) + AsConfigurationSettings() (*ConfigurationSettings, bool) +} + +// ConfigurationSettings replication provider specific settings. +type ConfigurationSettings struct { + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicConfigurationSettings(body []byte) (BasicConfigurationSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeHyperVVirtualMachine): + var hvvmd HyperVVirtualMachineDetails + err := json.Unmarshal(body, &hvvmd) + return hvvmd, err + case string(InstanceTypeReplicationGroupDetails): + var rgd ReplicationGroupDetails + err := json.Unmarshal(body, &rgd) + return rgd, err + case string(InstanceTypeVmmVirtualMachine): + var vvmd VmmVirtualMachineDetails + err := json.Unmarshal(body, &vvmd) + return vvmd, err + case string(InstanceTypeVMwareVirtualMachine): + var vmvmd VMwareVirtualMachineDetails + err := json.Unmarshal(body, &vmvmd) + return vmvmd, err + default: + var cs ConfigurationSettings + err := json.Unmarshal(body, &cs) + return cs, err + } +} +func unmarshalBasicConfigurationSettingsArray(body []byte) ([]BasicConfigurationSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + csArray := make([]BasicConfigurationSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cs, err := unmarshalBasicConfigurationSettings(*rawMessage) + if err != nil { + return nil, err + } + csArray[index] = cs + } + return csArray, nil +} + +// MarshalJSON is the custom marshaler for ConfigurationSettings. +func (cs ConfigurationSettings) MarshalJSON() ([]byte, error) { + cs.InstanceType = InstanceTypeConfigurationSettings + objectMap := make(map[string]interface{}) + if cs.InstanceType != "" { + objectMap["instanceType"] = cs.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return &cs, true +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &cs, true +} + +// ConfigureAlertRequest request to configure alerts for the system. +type ConfigureAlertRequest struct { + // Properties - The properties of a configure alert request. + Properties *ConfigureAlertRequestProperties `json:"properties,omitempty"` +} + +// ConfigureAlertRequestProperties properties of a configure alert request. +type ConfigureAlertRequestProperties struct { + // SendToOwners - A value indicating whether to send email to subscription administrator. + SendToOwners *string `json:"sendToOwners,omitempty"` + // CustomEmailAddresses - The custom email address for sending emails. + CustomEmailAddresses *[]string `json:"customEmailAddresses,omitempty"` + // Locale - The locale for the email notification. + Locale *string `json:"locale,omitempty"` +} + +// ConsistencyCheckTaskDetails this class contains monitoring details of all the inconsistent Protected +// Entities in Vmm. +type ConsistencyCheckTaskDetails struct { + // VMDetails - The list of inconsistent Vm details. + VMDetails *[]InconsistentVMDetails `json:"vmDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) MarshalJSON() ([]byte, error) { + cctd.InstanceType = InstanceTypeConsistencyCheckTaskDetails + objectMap := make(map[string]interface{}) + if cctd.VMDetails != nil { + objectMap["vmDetails"] = cctd.VMDetails + } + if cctd.InstanceType != "" { + objectMap["instanceType"] = cctd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return &cctd, true +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &cctd, true +} + +// CreateNetworkMappingInput create network mappings input. +type CreateNetworkMappingInput struct { + // Properties - Input properties for creating network mapping. + Properties *CreateNetworkMappingInputProperties `json:"properties,omitempty"` +} + +// CreateNetworkMappingInputProperties common input details for network mapping operation. +type CreateNetworkMappingInputProperties struct { + // RecoveryFabricName - Recovery fabric Name. + RecoveryFabricName *string `json:"recoveryFabricName,omitempty"` + // RecoveryNetworkID - Recovery network Id. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // FabricSpecificDetails - Fabric specific input properties. + FabricSpecificDetails BasicFabricSpecificCreateNetworkMappingInput `json:"fabricSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateNetworkMappingInputProperties struct. +func (cnmip *CreateNetworkMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryFabricName": + if v != nil { + var recoveryFabricName string + err = json.Unmarshal(*v, &recoveryFabricName) + if err != nil { + return err + } + cnmip.RecoveryFabricName = &recoveryFabricName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + cnmip.RecoveryNetworkID = &recoveryNetworkID + } + case "fabricSpecificDetails": + if v != nil { + fabricSpecificDetails, err := unmarshalBasicFabricSpecificCreateNetworkMappingInput(*v) + if err != nil { + return err + } + cnmip.FabricSpecificDetails = fabricSpecificDetails + } + } + } + + return nil +} + +// CreatePolicyInput protection Policy input. +type CreatePolicyInput struct { + // Properties - Policy creation properties. + Properties *CreatePolicyInputProperties `json:"properties,omitempty"` +} + +// CreatePolicyInputProperties policy creation properties. +type CreatePolicyInputProperties struct { + // ProviderSpecificInput - The ReplicationProviderSettings. + ProviderSpecificInput BasicPolicyProviderSpecificInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreatePolicyInputProperties struct. +func (cpip *CreatePolicyInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicPolicyProviderSpecificInput(*v) + if err != nil { + return err + } + cpip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionContainerInput create protection container input. +type CreateProtectionContainerInput struct { + // Properties - Create protection container input properties. + Properties *CreateProtectionContainerInputProperties `json:"properties,omitempty"` +} + +// CreateProtectionContainerInputProperties create protection container input properties. +type CreateProtectionContainerInputProperties struct { + // ProviderSpecificInput - Provider specific inputs for container creation. + ProviderSpecificInput *[]BasicReplicationProviderSpecificContainerCreationInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionContainerInputProperties struct. +func (cpcip *CreateProtectionContainerInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificContainerCreationInputArray(*v) + if err != nil { + return err + } + cpcip.ProviderSpecificInput = &providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionContainerMappingInput configure pairing input. +type CreateProtectionContainerMappingInput struct { + // Properties - Configure protection input properties. + Properties *CreateProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// CreateProtectionContainerMappingInputProperties configure pairing input properties. +type CreateProtectionContainerMappingInputProperties struct { + // TargetProtectionContainerID - The target unique protection container name. + TargetProtectionContainerID *string `json:"targetProtectionContainerId,omitempty"` + // PolicyID - Applicable policy. + PolicyID *string `json:"policyId,omitempty"` + // ProviderSpecificInput - Provider specific input for pairing. + ProviderSpecificInput BasicReplicationProviderSpecificContainerMappingInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionContainerMappingInputProperties struct. +func (cpcmip *CreateProtectionContainerMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetProtectionContainerId": + if v != nil { + var targetProtectionContainerID string + err = json.Unmarshal(*v, &targetProtectionContainerID) + if err != nil { + return err + } + cpcmip.TargetProtectionContainerID = &targetProtectionContainerID + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + cpcmip.PolicyID = &policyID + } + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificContainerMappingInput(*v) + if err != nil { + return err + } + cpcmip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionIntentInput create protection intent input. +type CreateProtectionIntentInput struct { + // Properties - Create protection intent input properties. + Properties *CreateProtectionIntentProperties `json:"properties,omitempty"` +} + +// CreateProtectionIntentProperties create protection intent input properties. +type CreateProtectionIntentProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For A2A provider, it will be A2ACreateProtectionIntentInput object. + ProviderSpecificDetails BasicCreateProtectionIntentProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionIntentProperties struct. +func (cpip *CreateProtectionIntentProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicCreateProtectionIntentProviderSpecificDetails(*v) + if err != nil { + return err + } + cpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicCreateProtectionIntentProviderSpecificDetails create protection intent provider specific input. +type BasicCreateProtectionIntentProviderSpecificDetails interface { + AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) + AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) +} + +// CreateProtectionIntentProviderSpecificDetails create protection intent provider specific input. +type CreateProtectionIntentProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails', 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicCreateProtectionIntentProviderSpecificDetails(body []byte) (BasicCreateProtectionIntentProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A): + var acpii A2ACreateProtectionIntentInput + err := json.Unmarshal(body, &acpii) + return acpii, err + default: + var cpipsd CreateProtectionIntentProviderSpecificDetails + err := json.Unmarshal(body, &cpipsd) + return cpipsd, err + } +} +func unmarshalBasicCreateProtectionIntentProviderSpecificDetailsArray(body []byte) ([]BasicCreateProtectionIntentProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + cpipsdArray := make([]BasicCreateProtectionIntentProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cpipsd, err := unmarshalBasicCreateProtectionIntentProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + cpipsdArray[index] = cpipsd + } + return cpipsdArray, nil +} + +// MarshalJSON is the custom marshaler for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) MarshalJSON() ([]byte, error) { + cpipsd.InstanceType = InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails + objectMap := make(map[string]interface{}) + if cpipsd.InstanceType != "" { + objectMap["instanceType"] = cpipsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACreateProtectionIntentInput is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) { + return nil, false +} + +// AsCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) { + return &cpipsd, true +} + +// AsBasicCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsBasicCreateProtectionIntentProviderSpecificDetails() (BasicCreateProtectionIntentProviderSpecificDetails, bool) { + return &cpipsd, true +} + +// CreateRecoveryPlanInput create recovery plan input class. +type CreateRecoveryPlanInput struct { + // Properties - Recovery plan creation properties. + Properties *CreateRecoveryPlanInputProperties `json:"properties,omitempty"` +} + +// CreateRecoveryPlanInputProperties recovery plan creation properties. +type CreateRecoveryPlanInputProperties struct { + // PrimaryFabricID - The primary fabric Id. + PrimaryFabricID *string `json:"primaryFabricId,omitempty"` + // RecoveryFabricID - The recovery fabric Id. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // FailoverDeploymentModel - The failover deployment model. Possible values include: 'NotApplicable', 'Classic', 'ResourceManager' + FailoverDeploymentModel FailoverDeploymentModel `json:"failoverDeploymentModel,omitempty"` + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` + // ProviderSpecificInput - The provider specific input. + ProviderSpecificInput *[]BasicRecoveryPlanProviderSpecificInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateRecoveryPlanInputProperties struct. +func (crpip *CreateRecoveryPlanInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "primaryFabricId": + if v != nil { + var primaryFabricID string + err = json.Unmarshal(*v, &primaryFabricID) + if err != nil { + return err + } + crpip.PrimaryFabricID = &primaryFabricID + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + crpip.RecoveryFabricID = &recoveryFabricID + } + case "failoverDeploymentModel": + if v != nil { + var failoverDeploymentModel FailoverDeploymentModel + err = json.Unmarshal(*v, &failoverDeploymentModel) + if err != nil { + return err + } + crpip.FailoverDeploymentModel = failoverDeploymentModel + } + case "groups": + if v != nil { + var groups []RecoveryPlanGroup + err = json.Unmarshal(*v, &groups) + if err != nil { + return err + } + crpip.Groups = &groups + } + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicRecoveryPlanProviderSpecificInputArray(*v) + if err != nil { + return err + } + crpip.ProviderSpecificInput = &providerSpecificInput + } + } + } + + return nil +} + +// CurrentJobDetails current job details of the migration item. +type CurrentJobDetails struct { + // JobName - READ-ONLY; The job name. + JobName *string `json:"jobName,omitempty"` + // JobID - READ-ONLY; The ARM Id of the job being executed. + JobID *string `json:"jobId,omitempty"` + // StartTime - READ-ONLY; The start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for CurrentJobDetails. +func (cjd CurrentJobDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CurrentScenarioDetails current scenario details of the protected entity. +type CurrentScenarioDetails struct { + // ScenarioName - Scenario name. + ScenarioName *string `json:"scenarioName,omitempty"` + // JobID - ARM Id of the job being executed. + JobID *string `json:"jobId,omitempty"` + // StartTime - Start time of the workflow. + StartTime *date.Time `json:"startTime,omitempty"` +} + +// DataStore the datastore details of the MT. +type DataStore struct { + // SymbolicName - The symbolic name of data store. + SymbolicName *string `json:"symbolicName,omitempty"` + // UUID - The uuid of data store. + UUID *string `json:"uuid,omitempty"` + // Capacity - The capacity of data store in GBs. + Capacity *string `json:"capacity,omitempty"` + // FreeSpace - The free space of data store in GBs. + FreeSpace *string `json:"freeSpace,omitempty"` + // Type - The type of data store. + Type *string `json:"type,omitempty"` +} + +// DisableProtectionInput disable protection input. +type DisableProtectionInput struct { + // Properties - Disable protection input properties. + Properties *DisableProtectionInputProperties `json:"properties,omitempty"` +} + +// DisableProtectionInputProperties disable protection input properties. +type DisableProtectionInputProperties struct { + // DisableProtectionReason - Disable protection reason. It can have values NotSpecified/MigrationComplete. Possible values include: 'NotSpecified', 'MigrationComplete' + DisableProtectionReason DisableProtectionReason `json:"disableProtectionReason,omitempty"` + // ReplicationProviderInput - Replication provider specific input. + ReplicationProviderInput BasicDisableProtectionProviderSpecificInput `json:"replicationProviderInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DisableProtectionInputProperties struct. +func (dpip *DisableProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "disableProtectionReason": + if v != nil { + var disableProtectionReason DisableProtectionReason + err = json.Unmarshal(*v, &disableProtectionReason) + if err != nil { + return err + } + dpip.DisableProtectionReason = disableProtectionReason + } + case "replicationProviderInput": + if v != nil { + replicationProviderInput, err := unmarshalBasicDisableProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + dpip.ReplicationProviderInput = replicationProviderInput + } + } + } + + return nil +} + +// BasicDisableProtectionProviderSpecificInput disable protection provider specific input. +type BasicDisableProtectionProviderSpecificInput interface { + AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) + AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) +} + +// DisableProtectionProviderSpecificInput disable protection provider specific input. +type DisableProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeDisableProtectionProviderSpecificInput', 'InstanceTypeInMage' + InstanceType InstanceTypeBasicDisableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicDisableProtectionProviderSpecificInput(body []byte) (BasicDisableProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInMage): + var imdppsi InMageDisableProtectionProviderSpecificInput + err := json.Unmarshal(body, &imdppsi) + return imdppsi, err + default: + var dppsi DisableProtectionProviderSpecificInput + err := json.Unmarshal(body, &dppsi) + return dppsi, err + } +} +func unmarshalBasicDisableProtectionProviderSpecificInputArray(body []byte) ([]BasicDisableProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dppsiArray := make([]BasicDisableProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + dppsi, err := unmarshalBasicDisableProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + dppsiArray[index] = dppsi + } + return dppsiArray, nil +} + +// MarshalJSON is the custom marshaler for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + dppsi.InstanceType = InstanceTypeDisableProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if dppsi.InstanceType != "" { + objectMap["instanceType"] = dppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) { + return &dppsi, true +} + +// AsBasicDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsBasicDisableProtectionProviderSpecificInput() (BasicDisableProtectionProviderSpecificInput, bool) { + return &dppsi, true +} + +// DiscoverProtectableItemRequest request to add a physical machine as a protectable item in a container. +type DiscoverProtectableItemRequest struct { + // Properties - The properties of a discover protectable item request. + Properties *DiscoverProtectableItemRequestProperties `json:"properties,omitempty"` +} + +// DiscoverProtectableItemRequestProperties discover protectable item properties. +type DiscoverProtectableItemRequestProperties struct { + // FriendlyName - The friendly name of the physical machine. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the physical machine to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // OsType - The OS type on the physical machine. + OsType *string `json:"osType,omitempty"` +} + +// DiskDetails onprem disk details data. +type DiskDetails struct { + // MaxSizeMB - The hard disk max size in MB. + MaxSizeMB *int64 `json:"maxSizeMB,omitempty"` + // VhdType - The type of the volume. + VhdType *string `json:"vhdType,omitempty"` + // VhdID - The VHD Id. + VhdID *string `json:"vhdId,omitempty"` + // VhdName - The VHD name. + VhdName *string `json:"vhdName,omitempty"` +} + +// DiskEncryptionInfo recovery disk encryption info (BEK and KEK). +type DiskEncryptionInfo struct { + // DiskEncryptionKeyInfo - The recovery KeyVault reference for secret. + DiskEncryptionKeyInfo *DiskEncryptionKeyInfo `json:"diskEncryptionKeyInfo,omitempty"` + // KeyEncryptionKeyInfo - The recovery KeyVault reference for key. + KeyEncryptionKeyInfo *KeyEncryptionKeyInfo `json:"keyEncryptionKeyInfo,omitempty"` +} + +// DiskEncryptionKeyInfo disk Encryption Key Information (BitLocker Encryption Key (BEK) on Windows). +type DiskEncryptionKeyInfo struct { + // SecretIdentifier - The secret url / identifier. + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // KeyVaultResourceArmID - The KeyVault resource ARM id for secret. + KeyVaultResourceArmID *string `json:"keyVaultResourceArmId,omitempty"` +} + +// DiskVolumeDetails volume details. +type DiskVolumeDetails struct { + // Label - The volume label. + Label *string `json:"label,omitempty"` + // Name - The volume name. + Name *string `json:"name,omitempty"` +} + +// Display contains the localized display information for this particular operation / action. These value +// will be used by several clients for (1) custom role definitions for RBAC; (2) complex query filters for +// the event service; and (3) audit history / records for management operations. +type Display struct { + // Provider - The provider. The localized friendly form of the resource provider name - it is expected to also include the publisher/company responsible. It should use Title Casing and begin with "Microsoft" for 1st party services. e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". + Provider *string `json:"provider,omitempty"` + // Resource - The resource. The localized friendly form of the resource related to this action/operation - it should match the public documentation for the resource provider. It should use Title Casing. This value should be unique for a particular URL type (e.g. nested types should *not* reuse their parent's display.resource field). e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual Machine VM Sizes" or "Scheduler Jobs". + Resource *string `json:"resource,omitempty"` + // Operation - The operation. The localized friendly name for the operation, as it should be shown to the user. It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use Title Casing. Prescriptive guidance: Read Create or Update Delete 'ActionName'. + Operation *string `json:"operation,omitempty"` + // Description - The description. The localized friendly description for the operation, as it should be shown to the user. It should be thorough, yet concise - it will be used in tool tips and detailed views. Prescriptive guidance for namespaces: Read any 'display.provider' resource Create or Update any 'display.provider' resource Delete any 'display.provider' resource Perform any other action on any 'display.provider' resource Prescriptive guidance for namespaces: Read any 'display.resource' Create or Update any 'display.resource' Delete any 'display.resource' 'ActionName' any 'display.resources'. + Description *string `json:"description,omitempty"` +} + +// DraDetails DRA details. +type DraDetails struct { + // ID - READ-ONLY; The DRA Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The DRA name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The DRA Bios Id. + BiosID *string `json:"biosId,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the DRA. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // ForwardProtectedItemCount - READ-ONLY; The count of protected items which are protected in forward direction. + ForwardProtectedItemCount *int32 `json:"forwardProtectedItemCount,omitempty"` + // ReverseProtectedItemCount - READ-ONLY; The count of protected items which are protected in reverse direction. + ReverseProtectedItemCount *int32 `json:"reverseProtectedItemCount,omitempty"` +} + +// MarshalJSON is the custom marshaler for DraDetails. +func (dd DraDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// EnableMigrationInput enable migration input. +type EnableMigrationInput struct { + // Properties - Enable migration input properties. + Properties *EnableMigrationInputProperties `json:"properties,omitempty"` +} + +// EnableMigrationInputProperties enable migration input properties. +type EnableMigrationInputProperties struct { + // PolicyID - The policy Id. + PolicyID *string `json:"policyId,omitempty"` + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicEnableMigrationProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EnableMigrationInputProperties struct. +func (emip *EnableMigrationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + emip.PolicyID = &policyID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEnableMigrationProviderSpecificInput(*v) + if err != nil { + return err + } + emip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicEnableMigrationProviderSpecificInput enable migration provider specific input. +type BasicEnableMigrationProviderSpecificInput interface { + AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) + AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) +} + +// EnableMigrationProviderSpecificInput enable migration provider specific input. +type EnableMigrationProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeEnableMigrationProviderSpecificInput', 'InstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEnableMigrationProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicEnableMigrationProviderSpecificInput(body []byte) (BasicEnableMigrationProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeVMwareCbt): + var vmcemi VMwareCbtEnableMigrationInput + err := json.Unmarshal(body, &vmcemi) + return vmcemi, err + default: + var empsi EnableMigrationProviderSpecificInput + err := json.Unmarshal(body, &empsi) + return empsi, err + } +} +func unmarshalBasicEnableMigrationProviderSpecificInputArray(body []byte) ([]BasicEnableMigrationProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + empsiArray := make([]BasicEnableMigrationProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + empsi, err := unmarshalBasicEnableMigrationProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + empsiArray[index] = empsi + } + return empsiArray, nil +} + +// MarshalJSON is the custom marshaler for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) MarshalJSON() ([]byte, error) { + empsi.InstanceType = InstanceTypeEnableMigrationProviderSpecificInput + objectMap := make(map[string]interface{}) + if empsi.InstanceType != "" { + objectMap["instanceType"] = empsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtEnableMigrationInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) { + return nil, false +} + +// AsEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) { + return &empsi, true +} + +// AsBasicEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsBasicEnableMigrationProviderSpecificInput() (BasicEnableMigrationProviderSpecificInput, bool) { + return &empsi, true +} + +// EnableProtectionInput enable protection input. +type EnableProtectionInput struct { + // Properties - Enable protection input properties. + Properties *EnableProtectionInputProperties `json:"properties,omitempty"` +} + +// EnableProtectionInputProperties enable protection input properties. +type EnableProtectionInputProperties struct { + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // ProtectableItemID - The protectable item Id. + ProtectableItemID *string `json:"protectableItemId,omitempty"` + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicEnableProtectionProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EnableProtectionInputProperties struct. +func (epip *EnableProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + epip.PolicyID = &policyID + } + case "protectableItemId": + if v != nil { + var protectableItemID string + err = json.Unmarshal(*v, &protectableItemID) + if err != nil { + return err + } + epip.ProtectableItemID = &protectableItemID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEnableProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + epip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicEnableProtectionProviderSpecificInput enable protection provider specific input. +type BasicEnableProtectionProviderSpecificInput interface { + AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) + AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) + AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) + AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) + AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) + AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) + AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) +} + +// EnableProtectionProviderSpecificInput enable protection provider specific input. +type EnableProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicEnableProtectionProviderSpecificInput(body []byte) (BasicEnableProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmepi A2ACrossClusterMigrationEnableProtectionInput + err := json.Unmarshal(body, &accmepi) + return accmepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A): + var aepi A2AEnableProtectionInput + err := json.Unmarshal(body, &aepi) + return aepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraepi HyperVReplicaAzureEnableProtectionInput + err := json.Unmarshal(body, &hvraepi) + return hvraepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2): + var imavepi InMageAzureV2EnableProtectionInput + err := json.Unmarshal(body, &imavepi) + return imavepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage): + var imepi InMageEnableProtectionInput + err := json.Unmarshal(body, &imepi) + return imepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm): + var imrepi InMageRcmEnableProtectionInput + err := json.Unmarshal(body, &imrepi) + return imrepi, err + default: + var eppsi EnableProtectionProviderSpecificInput + err := json.Unmarshal(body, &eppsi) + return eppsi, err + } +} +func unmarshalBasicEnableProtectionProviderSpecificInputArray(body []byte) ([]BasicEnableProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + eppsiArray := make([]BasicEnableProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + eppsi, err := unmarshalBasicEnableProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + eppsiArray[index] = eppsi + } + return eppsiArray, nil +} + +// MarshalJSON is the custom marshaler for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + eppsi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if eppsi.InstanceType != "" { + objectMap["instanceType"] = eppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return &eppsi, true +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &eppsi, true +} + +// EncryptionDetails encryption details for the fabric. +type EncryptionDetails struct { + // KekState - The key encryption key state for the Vmm. + KekState *string `json:"kekState,omitempty"` + // KekCertThumbprint - The key encryption key certificate thumbprint. + KekCertThumbprint *string `json:"kekCertThumbprint,omitempty"` + // KekCertExpiryDate - The key encryption key certificate expiry date. + KekCertExpiryDate *date.Time `json:"kekCertExpiryDate,omitempty"` +} + +// Event implements the Event class. +type Event struct { + autorest.Response `json:"-"` + // Properties - Event related data. + Properties *EventProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Event. +func (e Event) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if e.Properties != nil { + objectMap["properties"] = e.Properties + } + if e.Location != nil { + objectMap["location"] = e.Location + } + return json.Marshal(objectMap) +} + +// EventCollection collection of fabric details. +type EventCollection struct { + autorest.Response `json:"-"` + // Value - The list of events. + Value *[]Event `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// EventCollectionIterator provides access to a complete listing of Event values. +type EventCollectionIterator struct { + i int + page EventCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *EventCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EventCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *EventCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EventCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter EventCollectionIterator) Response() EventCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter EventCollectionIterator) Value() Event { + if !iter.page.NotDone() { + return Event{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the EventCollectionIterator type. +func NewEventCollectionIterator(page EventCollectionPage) EventCollectionIterator { + return EventCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ec EventCollection) IsEmpty() bool { + return ec.Value == nil || len(*ec.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ec EventCollection) hasNextLink() bool { + return ec.NextLink != nil && len(*ec.NextLink) != 0 +} + +// eventCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ec EventCollection) eventCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ec.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ec.NextLink))) +} + +// EventCollectionPage contains a page of Event values. +type EventCollectionPage struct { + fn func(context.Context, EventCollection) (EventCollection, error) + ec EventCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *EventCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EventCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ec) + if err != nil { + return err + } + page.ec = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *EventCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EventCollectionPage) NotDone() bool { + return !page.ec.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EventCollectionPage) Response() EventCollection { + return page.ec +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EventCollectionPage) Values() []Event { + if page.ec.IsEmpty() { + return nil + } + return *page.ec.Value +} + +// Creates a new instance of the EventCollectionPage type. +func NewEventCollectionPage(cur EventCollection, getNextPage func(context.Context, EventCollection) (EventCollection, error)) EventCollectionPage { + return EventCollectionPage{ + fn: getNextPage, + ec: cur, + } +} + +// EventProperties the properties of a monitoring event. +type EventProperties struct { + // EventCode - The Id of the monitoring event. + EventCode *string `json:"eventCode,omitempty"` + // Description - The event name. + Description *string `json:"description,omitempty"` + // EventType - The type of the event. for example: VM Health, Server Health, Job Failure etc. + EventType *string `json:"eventType,omitempty"` + // AffectedObjectFriendlyName - The friendly name of the source of the event on which it is raised (for example, VM, VMM etc). + AffectedObjectFriendlyName *string `json:"affectedObjectFriendlyName,omitempty"` + // AffectedObjectCorrelationID - The affected object correlationId for the event. + AffectedObjectCorrelationID *string `json:"affectedObjectCorrelationId,omitempty"` + // Severity - The severity of the event. + Severity *string `json:"severity,omitempty"` + // TimeOfOccurrence - The time of occurrence of the event. + TimeOfOccurrence *date.Time `json:"timeOfOccurrence,omitempty"` + // FabricID - The ARM ID of the fabric. + FabricID *string `json:"fabricId,omitempty"` + // ProviderSpecificDetails - The provider specific settings. + ProviderSpecificDetails BasicEventProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` + // EventSpecificDetails - The event specific settings. + EventSpecificDetails BasicEventSpecificDetails `json:"eventSpecificDetails,omitempty"` + // HealthErrors - The list of errors / warnings capturing details associated with the issue(s). + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EventProperties struct. +func (ep *EventProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "eventCode": + if v != nil { + var eventCode string + err = json.Unmarshal(*v, &eventCode) + if err != nil { + return err + } + ep.EventCode = &eventCode + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ep.Description = &description + } + case "eventType": + if v != nil { + var eventType string + err = json.Unmarshal(*v, &eventType) + if err != nil { + return err + } + ep.EventType = &eventType + } + case "affectedObjectFriendlyName": + if v != nil { + var affectedObjectFriendlyName string + err = json.Unmarshal(*v, &affectedObjectFriendlyName) + if err != nil { + return err + } + ep.AffectedObjectFriendlyName = &affectedObjectFriendlyName + } + case "affectedObjectCorrelationId": + if v != nil { + var affectedObjectCorrelationID string + err = json.Unmarshal(*v, &affectedObjectCorrelationID) + if err != nil { + return err + } + ep.AffectedObjectCorrelationID = &affectedObjectCorrelationID + } + case "severity": + if v != nil { + var severity string + err = json.Unmarshal(*v, &severity) + if err != nil { + return err + } + ep.Severity = &severity + } + case "timeOfOccurrence": + if v != nil { + var timeOfOccurrence date.Time + err = json.Unmarshal(*v, &timeOfOccurrence) + if err != nil { + return err + } + ep.TimeOfOccurrence = &timeOfOccurrence + } + case "fabricId": + if v != nil { + var fabricID string + err = json.Unmarshal(*v, &fabricID) + if err != nil { + return err + } + ep.FabricID = &fabricID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEventProviderSpecificDetails(*v) + if err != nil { + return err + } + ep.ProviderSpecificDetails = providerSpecificDetails + } + case "eventSpecificDetails": + if v != nil { + eventSpecificDetails, err := unmarshalBasicEventSpecificDetails(*v) + if err != nil { + return err + } + ep.EventSpecificDetails = eventSpecificDetails + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + ep.HealthErrors = &healthErrors + } + } + } + + return nil +} + +// BasicEventProviderSpecificDetails model class for provider specific details for an event. +type BasicEventProviderSpecificDetails interface { + AsA2AEventDetails() (*A2AEventDetails, bool) + AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) + AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) + AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) + AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) + AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) + AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) + AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) + AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) + AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) +} + +// EventProviderSpecificDetails model class for provider specific details for an event. +type EventProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicEventProviderSpecificDetails(body []byte) (BasicEventProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A): + var aed A2AEventDetails + err := json.Unmarshal(body, &aed) + return aed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012): + var hvr2ed HyperVReplica2012EventDetails + err := json.Unmarshal(body, &hvr2ed) + return hvr2ed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2): + var hvr2ed HyperVReplica2012R2EventDetails + err := json.Unmarshal(body, &hvr2ed) + return hvr2ed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure): + var hvraed HyperVReplicaAzureEventDetails + err := json.Unmarshal(body, &hvraed) + return hvraed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails): + var hvrbed HyperVReplicaBaseEventDetails + err := json.Unmarshal(body, &hvrbed) + return hvrbed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2): + var imaved InMageAzureV2EventDetails + err := json.Unmarshal(body, &imaved) + return imaved, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm): + var imred InMageRcmEventDetails + err := json.Unmarshal(body, &imred) + return imred, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback): + var imrfed InMageRcmFailbackEventDetails + err := json.Unmarshal(body, &imrfed) + return imrfed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt): + var vmced VMwareCbtEventDetails + err := json.Unmarshal(body, &vmced) + return vmced, err + default: + var epsd EventProviderSpecificDetails + err := json.Unmarshal(body, &epsd) + return epsd, err + } +} +func unmarshalBasicEventProviderSpecificDetailsArray(body []byte) ([]BasicEventProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + epsdArray := make([]BasicEventProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + epsd, err := unmarshalBasicEventProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + epsdArray[index] = epsd + } + return epsdArray, nil +} + +// MarshalJSON is the custom marshaler for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) MarshalJSON() ([]byte, error) { + epsd.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails + objectMap := make(map[string]interface{}) + if epsd.InstanceType != "" { + objectMap["instanceType"] = epsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return &epsd, true +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &epsd, true +} + +// EventQueryParameter implements the event query parameter. +type EventQueryParameter struct { + // EventCode - The source id of the events to be queried. + EventCode *string `json:"eventCode,omitempty"` + // Severity - The severity of the events to be queried. + Severity *string `json:"severity,omitempty"` + // EventType - The type of the events to be queried. + EventType *string `json:"eventType,omitempty"` + // FabricName - The affected object server id of the events to be queried. + FabricName *string `json:"fabricName,omitempty"` + // AffectedObjectFriendlyName - The affected object name of the events to be queried. + AffectedObjectFriendlyName *string `json:"affectedObjectFriendlyName,omitempty"` + // AffectedObjectCorrelationID - The affected object correlationId for the events to be queried. + AffectedObjectCorrelationID *string `json:"affectedObjectCorrelationId,omitempty"` + // StartTime - The start time of the time range within which the events are to be queried. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time of the time range within which the events are to be queried. + EndTime *date.Time `json:"endTime,omitempty"` +} + +// BasicEventSpecificDetails model class for event specific details for an event. +type BasicEventSpecificDetails interface { + AsJobStatusEventDetails() (*JobStatusEventDetails, bool) + AsEventSpecificDetails() (*EventSpecificDetails, bool) +} + +// EventSpecificDetails model class for event specific details for an event. +type EventSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeEventSpecificDetails', 'InstanceTypeJobStatus' + InstanceType InstanceTypeBasicEventSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicEventSpecificDetails(body []byte) (BasicEventSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeJobStatus): + var jsed JobStatusEventDetails + err := json.Unmarshal(body, &jsed) + return jsed, err + default: + var esd EventSpecificDetails + err := json.Unmarshal(body, &esd) + return esd, err + } +} +func unmarshalBasicEventSpecificDetailsArray(body []byte) ([]BasicEventSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + esdArray := make([]BasicEventSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + esd, err := unmarshalBasicEventSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + esdArray[index] = esd + } + return esdArray, nil +} + +// MarshalJSON is the custom marshaler for EventSpecificDetails. +func (esd EventSpecificDetails) MarshalJSON() ([]byte, error) { + esd.InstanceType = InstanceTypeEventSpecificDetails + objectMap := make(map[string]interface{}) + if esd.InstanceType != "" { + objectMap["instanceType"] = esd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsJobStatusEventDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsJobStatusEventDetails() (*JobStatusEventDetails, bool) { + return nil, false +} + +// AsEventSpecificDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsEventSpecificDetails() (*EventSpecificDetails, bool) { + return &esd, true +} + +// AsBasicEventSpecificDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsBasicEventSpecificDetails() (BasicEventSpecificDetails, bool) { + return &esd, true +} + +// ExistingProtectionProfile existing storage account input. +type ExistingProtectionProfile struct { + // ProtectionProfileID - The protection profile Arm Id. Throw error, if resource does not exists. + ProtectionProfileID *string `json:"protectionProfileId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) MarshalJSON() ([]byte, error) { + epp.ResourceType = ResourceTypeExisting + objectMap := make(map[string]interface{}) + if epp.ProtectionProfileID != nil { + objectMap["protectionProfileId"] = epp.ProtectionProfileID + } + if epp.ResourceType != "" { + objectMap["resourceType"] = epp.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return &epp, true +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return nil, false +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return nil, false +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &epp, true +} + +// ExistingRecoveryAvailabilitySet existing recovery availability set input. +type ExistingRecoveryAvailabilitySet struct { + // RecoveryAvailabilitySetID - The recovery availability set Id. Will throw error, if resource does not exist. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails', 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryAvailabilitySetCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) MarshalJSON() ([]byte, error) { + eras.ResourceType = ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if eras.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = eras.RecoveryAvailabilitySetID + } + if eras.ResourceType != "" { + objectMap["resourceType"] = eras.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryAvailabilitySet is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) { + return &eras, true +} + +// AsRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsBasicRecoveryAvailabilitySetCustomDetails() (BasicRecoveryAvailabilitySetCustomDetails, bool) { + return &eras, true +} + +// ExistingRecoveryProximityPlacementGroup existing recovery proximity placement group input. +type ExistingRecoveryProximityPlacementGroup struct { + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. Will throw error, if resource does not exist. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails', 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) MarshalJSON() ([]byte, error) { + erppg.ResourceType = ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if erppg.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = erppg.RecoveryProximityPlacementGroupID + } + if erppg.ResourceType != "" { + objectMap["resourceType"] = erppg.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryProximityPlacementGroup is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) { + return &erppg, true +} + +// AsRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsBasicRecoveryProximityPlacementGroupCustomDetails() (BasicRecoveryProximityPlacementGroupCustomDetails, bool) { + return &erppg, true +} + +// ExistingRecoveryRecoveryResourceGroup existing recovery resource group input. +type ExistingRecoveryRecoveryResourceGroup struct { + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails', 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryResourceGroupCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) MarshalJSON() ([]byte, error) { + errrg.ResourceType = ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if errrg.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = errrg.RecoveryResourceGroupID + } + if errrg.ResourceType != "" { + objectMap["resourceType"] = errrg.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryRecoveryResourceGroup is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) { + return &errrg, true +} + +// AsRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsBasicRecoveryResourceGroupCustomDetails() (BasicRecoveryResourceGroupCustomDetails, bool) { + return &errrg, true +} + +// ExistingRecoveryVirtualNetwork existing recovery virtual network input. +type ExistingRecoveryVirtualNetwork struct { + // RecoveryVirtualNetworkID - The recovery virtual network Id. Will throw error, if resource does not exist. + RecoveryVirtualNetworkID *string `json:"recoveryVirtualNetworkId,omitempty"` + // RecoverySubnetName - The recovery subnet name. + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) MarshalJSON() ([]byte, error) { + ervn.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if ervn.RecoveryVirtualNetworkID != nil { + objectMap["recoveryVirtualNetworkId"] = ervn.RecoveryVirtualNetworkID + } + if ervn.RecoverySubnetName != nil { + objectMap["recoverySubnetName"] = ervn.RecoverySubnetName + } + if ervn.ResourceType != "" { + objectMap["resourceType"] = ervn.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return &ervn, true +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &ervn, true +} + +// ExistingStorageAccount existing storage account input. +type ExistingStorageAccount struct { + // AzureStorageAccountID - The storage account Arm Id. Throw error, if resource does not exists. + AzureStorageAccountID *string `json:"azureStorageAccountId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails', 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicStorageAccountCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingStorageAccount. +func (esa ExistingStorageAccount) MarshalJSON() ([]byte, error) { + esa.ResourceType = ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if esa.AzureStorageAccountID != nil { + objectMap["azureStorageAccountId"] = esa.AzureStorageAccountID + } + if esa.ResourceType != "" { + objectMap["resourceType"] = esa.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingStorageAccount is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsExistingStorageAccount() (*ExistingStorageAccount, bool) { + return &esa, true +} + +// AsStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) { + return nil, false +} + +// AsBasicStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsBasicStorageAccountCustomDetails() (BasicStorageAccountCustomDetails, bool) { + return &esa, true +} + +// ExportJobDetails this class represents details for export jobs workflow. +type ExportJobDetails struct { + // BlobURI - BlobUri of the exported jobs. + BlobURI *string `json:"blobUri,omitempty"` + // SasToken - The sas token to access blob. + SasToken *string `json:"sasToken,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExportJobDetails. +func (ejd ExportJobDetails) MarshalJSON() ([]byte, error) { + ejd.InstanceType = InstanceTypeExportJobDetails + objectMap := make(map[string]interface{}) + if ejd.BlobURI != nil { + objectMap["blobUri"] = ejd.BlobURI + } + if ejd.SasToken != nil { + objectMap["sasToken"] = ejd.SasToken + } + if ejd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = ejd.AffectedObjectDetails + } + if ejd.InstanceType != "" { + objectMap["instanceType"] = ejd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return &ejd, true +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &ejd, true +} + +// ExtendedLocation extended location of the resource. +type ExtendedLocation struct { + // Name - The name of the extended location. + Name *string `json:"name,omitempty"` + // Type - The extended location type. + Type *string `json:"type,omitempty"` +} + +// Fabric fabric definition. +type Fabric struct { + autorest.Response `json:"-"` + // Properties - Fabric related data. + Properties *FabricProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Fabric. +func (f Fabric) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if f.Properties != nil { + objectMap["properties"] = f.Properties + } + if f.Location != nil { + objectMap["location"] = f.Location + } + return json.Marshal(objectMap) +} + +// FabricCollection collection of fabric details. +type FabricCollection struct { + autorest.Response `json:"-"` + // Value - The fabric details. + Value *[]Fabric `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// FabricCollectionIterator provides access to a complete listing of Fabric values. +type FabricCollectionIterator struct { + i int + page FabricCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *FabricCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FabricCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *FabricCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter FabricCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter FabricCollectionIterator) Response() FabricCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter FabricCollectionIterator) Value() Fabric { + if !iter.page.NotDone() { + return Fabric{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the FabricCollectionIterator type. +func NewFabricCollectionIterator(page FabricCollectionPage) FabricCollectionIterator { + return FabricCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (fc FabricCollection) IsEmpty() bool { + return fc.Value == nil || len(*fc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (fc FabricCollection) hasNextLink() bool { + return fc.NextLink != nil && len(*fc.NextLink) != 0 +} + +// fabricCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (fc FabricCollection) fabricCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !fc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(fc.NextLink))) +} + +// FabricCollectionPage contains a page of Fabric values. +type FabricCollectionPage struct { + fn func(context.Context, FabricCollection) (FabricCollection, error) + fc FabricCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *FabricCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FabricCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.fc) + if err != nil { + return err + } + page.fc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *FabricCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page FabricCollectionPage) NotDone() bool { + return !page.fc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page FabricCollectionPage) Response() FabricCollection { + return page.fc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page FabricCollectionPage) Values() []Fabric { + if page.fc.IsEmpty() { + return nil + } + return *page.fc.Value +} + +// Creates a new instance of the FabricCollectionPage type. +func NewFabricCollectionPage(cur FabricCollection, getNextPage func(context.Context, FabricCollection) (FabricCollection, error)) FabricCollectionPage { + return FabricCollectionPage{ + fn: getNextPage, + fc: cur, + } +} + +// FabricCreationInput site details provided during the time of site creation. +type FabricCreationInput struct { + // Properties - Fabric creation input. + Properties *FabricCreationInputProperties `json:"properties,omitempty"` +} + +// FabricCreationInputProperties properties of site details provided during the time of site creation. +type FabricCreationInputProperties struct { + // CustomDetails - Fabric provider specific creation input. + CustomDetails BasicFabricSpecificCreationInput `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for FabricCreationInputProperties struct. +func (fcip *FabricCreationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicFabricSpecificCreationInput(*v) + if err != nil { + return err + } + fcip.CustomDetails = customDetails + } + } + } + + return nil +} + +// FabricProperties fabric properties. +type FabricProperties struct { + // FriendlyName - Friendly name of the fabric. + FriendlyName *string `json:"friendlyName,omitempty"` + // EncryptionDetails - Encryption details for the fabric. + EncryptionDetails *EncryptionDetails `json:"encryptionDetails,omitempty"` + // RolloverEncryptionDetails - Rollover encryption details for the fabric. + RolloverEncryptionDetails *EncryptionDetails `json:"rolloverEncryptionDetails,omitempty"` + // InternalIdentifier - Dra Registration Id. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // BcdrState - BCDR state of the fabric. + BcdrState *string `json:"bcdrState,omitempty"` + // CustomDetails - Fabric specific settings. + CustomDetails BasicFabricSpecificDetails `json:"customDetails,omitempty"` + // HealthErrorDetails - Fabric health error details. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // Health - Health of fabric. + Health *string `json:"health,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for FabricProperties struct. +func (fp *FabricProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + fp.FriendlyName = &friendlyName + } + case "encryptionDetails": + if v != nil { + var encryptionDetails EncryptionDetails + err = json.Unmarshal(*v, &encryptionDetails) + if err != nil { + return err + } + fp.EncryptionDetails = &encryptionDetails + } + case "rolloverEncryptionDetails": + if v != nil { + var rolloverEncryptionDetails EncryptionDetails + err = json.Unmarshal(*v, &rolloverEncryptionDetails) + if err != nil { + return err + } + fp.RolloverEncryptionDetails = &rolloverEncryptionDetails + } + case "internalIdentifier": + if v != nil { + var internalIdentifier string + err = json.Unmarshal(*v, &internalIdentifier) + if err != nil { + return err + } + fp.InternalIdentifier = &internalIdentifier + } + case "bcdrState": + if v != nil { + var bcdrState string + err = json.Unmarshal(*v, &bcdrState) + if err != nil { + return err + } + fp.BcdrState = &bcdrState + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicFabricSpecificDetails(*v) + if err != nil { + return err + } + fp.CustomDetails = customDetails + } + case "healthErrorDetails": + if v != nil { + var healthErrorDetails []HealthError + err = json.Unmarshal(*v, &healthErrorDetails) + if err != nil { + return err + } + fp.HealthErrorDetails = &healthErrorDetails + } + case "health": + if v != nil { + var health string + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + fp.Health = &health + } + } + } + + return nil +} + +// FabricQueryParameter query parameter to get fabric. +type FabricQueryParameter struct { + // ZoneToZoneMappings - A value indicating whether the zone to zone mappings are to be returned. + ZoneToZoneMappings *string `json:"zoneToZoneMappings,omitempty"` + // FetchAgentDetails - A value indicating whether the agent details are to be fetched. + FetchAgentDetails *string `json:"fetchAgentDetails,omitempty"` + // BiosID - The BIOS Id to be used for fetching agent details. + BiosID *string `json:"biosId,omitempty"` + // Fqdn - The FQDN to be used for fetching agent details. + Fqdn *string `json:"fqdn,omitempty"` + // DiscoveryType - The type of the discovered machine to be used for fetching agent details. + DiscoveryType *string `json:"discoveryType,omitempty"` + // OsType - The OS type to be used for fetching agent details. + OsType *string `json:"osType,omitempty"` +} + +// FabricReplicationGroupTaskDetails this class represents the fabric replication group task details. +type FabricReplicationGroupTaskDetails struct { + // SkippedReason - The skipped reason. + SkippedReason *string `json:"skippedReason,omitempty"` + // SkippedReasonString - The skipped reason string. + SkippedReasonString *string `json:"skippedReasonString,omitempty"` + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) MarshalJSON() ([]byte, error) { + frgtd.InstanceType = InstanceTypeFabricReplicationGroupTaskDetails + objectMap := make(map[string]interface{}) + if frgtd.SkippedReason != nil { + objectMap["skippedReason"] = frgtd.SkippedReason + } + if frgtd.SkippedReasonString != nil { + objectMap["skippedReasonString"] = frgtd.SkippedReasonString + } + if frgtd.JobTask != nil { + objectMap["jobTask"] = frgtd.JobTask + } + if frgtd.InstanceType != "" { + objectMap["instanceType"] = frgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return &frgtd, true +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &frgtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &frgtd, true +} + +// BasicFabricSpecificCreateNetworkMappingInput input details specific to fabrics during Network Mapping. +type BasicFabricSpecificCreateNetworkMappingInput interface { + AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) + AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) + AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) + AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) +} + +// FabricSpecificCreateNetworkMappingInput input details specific to fabrics during Network Mapping. +type FabricSpecificCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificCreateNetworkMappingInput(body []byte) (BasicFabricSpecificCreateNetworkMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAzureToAzure): + var atacnmi AzureToAzureCreateNetworkMappingInput + err := json.Unmarshal(body, &atacnmi) + return atacnmi, err + case string(InstanceTypeVmmToAzure): + var vtacnmi VmmToAzureCreateNetworkMappingInput + err := json.Unmarshal(body, &vtacnmi) + return vtacnmi, err + case string(InstanceTypeVmmToVmm): + var vtvcnmi VmmToVmmCreateNetworkMappingInput + err := json.Unmarshal(body, &vtvcnmi) + return vtvcnmi, err + default: + var fscnmi FabricSpecificCreateNetworkMappingInput + err := json.Unmarshal(body, &fscnmi) + return fscnmi, err + } +} +func unmarshalBasicFabricSpecificCreateNetworkMappingInputArray(body []byte) ([]BasicFabricSpecificCreateNetworkMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fscnmiArray := make([]BasicFabricSpecificCreateNetworkMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fscnmi, err := unmarshalBasicFabricSpecificCreateNetworkMappingInput(*rawMessage) + if err != nil { + return nil, err + } + fscnmiArray[index] = fscnmi + } + return fscnmiArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + fscnmi.InstanceType = InstanceTypeFabricSpecificCreateNetworkMappingInput + objectMap := make(map[string]interface{}) + if fscnmi.InstanceType != "" { + objectMap["instanceType"] = fscnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return &fscnmi, true +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &fscnmi, true +} + +// BasicFabricSpecificCreationInput fabric provider specific settings. +type BasicFabricSpecificCreationInput interface { + AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) + AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) + AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) + AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) +} + +// FabricSpecificCreationInput fabric provider specific settings. +type FabricSpecificCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificCreationInput(body []byte) (BasicFabricSpecificCreationInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure): + var afci AzureFabricCreationInput + err := json.Unmarshal(body, &afci) + return afci, err + case string(InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm): + var imrfci InMageRcmFabricCreationInput + err := json.Unmarshal(body, &imrfci) + return imrfci, err + case string(InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2): + var vmvfci VMwareV2FabricCreationInput + err := json.Unmarshal(body, &vmvfci) + return vmvfci, err + default: + var fsci FabricSpecificCreationInput + err := json.Unmarshal(body, &fsci) + return fsci, err + } +} +func unmarshalBasicFabricSpecificCreationInputArray(body []byte) ([]BasicFabricSpecificCreationInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsciArray := make([]BasicFabricSpecificCreationInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsci, err := unmarshalBasicFabricSpecificCreationInput(*rawMessage) + if err != nil { + return nil, err + } + fsciArray[index] = fsci + } + return fsciArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) MarshalJSON() ([]byte, error) { + fsci.InstanceType = InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput + objectMap := make(map[string]interface{}) + if fsci.InstanceType != "" { + objectMap["instanceType"] = fsci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return &fsci, true +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &fsci, true +} + +// BasicFabricSpecificDetails fabric specific details. +type BasicFabricSpecificDetails interface { + AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) + AsHyperVSiteDetails() (*HyperVSiteDetails, bool) + AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) + AsVmmDetails() (*VmmDetails, bool) + AsVMwareDetails() (*VMwareDetails, bool) + AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) + AsFabricSpecificDetails() (*FabricSpecificDetails, bool) +} + +// FabricSpecificDetails fabric specific details. +type FabricSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificDetails(body []byte) (BasicFabricSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure): + var afsd AzureFabricSpecificDetails + err := json.Unmarshal(body, &afsd) + return afsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite): + var hvsd HyperVSiteDetails + err := json.Unmarshal(body, &hvsd) + return hvsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm): + var imrfsd InMageRcmFabricSpecificDetails + err := json.Unmarshal(body, &imrfsd) + return imrfsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM): + var vd VmmDetails + err := json.Unmarshal(body, &vd) + return vd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware): + var vmd VMwareDetails + err := json.Unmarshal(body, &vmd) + return vmd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2): + var vmvfsd VMwareV2FabricSpecificDetails + err := json.Unmarshal(body, &vmvfsd) + return vmvfsd, err + default: + var fsd FabricSpecificDetails + err := json.Unmarshal(body, &fsd) + return fsd, err + } +} +func unmarshalBasicFabricSpecificDetailsArray(body []byte) ([]BasicFabricSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsdArray := make([]BasicFabricSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsd, err := unmarshalBasicFabricSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + fsdArray[index] = fsd + } + return fsdArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificDetails. +func (fsd FabricSpecificDetails) MarshalJSON() ([]byte, error) { + fsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails + objectMap := make(map[string]interface{}) + if fsd.InstanceType != "" { + objectMap["instanceType"] = fsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return &fsd, true +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &fsd, true +} + +// BasicFabricSpecificUpdateNetworkMappingInput input details specific to fabrics during Network Mapping. +type BasicFabricSpecificUpdateNetworkMappingInput interface { + AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) + AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) + AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) + AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) +} + +// FabricSpecificUpdateNetworkMappingInput input details specific to fabrics during Network Mapping. +type FabricSpecificUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificUpdateNetworkMappingInput(body []byte) (BasicFabricSpecificUpdateNetworkMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure): + var ataunmi AzureToAzureUpdateNetworkMappingInput + err := json.Unmarshal(body, &ataunmi) + return ataunmi, err + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure): + var vtaunmi VmmToAzureUpdateNetworkMappingInput + err := json.Unmarshal(body, &vtaunmi) + return vtaunmi, err + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm): + var vtvunmi VmmToVmmUpdateNetworkMappingInput + err := json.Unmarshal(body, &vtvunmi) + return vtvunmi, err + default: + var fsunmi FabricSpecificUpdateNetworkMappingInput + err := json.Unmarshal(body, &fsunmi) + return fsunmi, err + } +} +func unmarshalBasicFabricSpecificUpdateNetworkMappingInputArray(body []byte) ([]BasicFabricSpecificUpdateNetworkMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsunmiArray := make([]BasicFabricSpecificUpdateNetworkMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsunmi, err := unmarshalBasicFabricSpecificUpdateNetworkMappingInput(*rawMessage) + if err != nil { + return nil, err + } + fsunmiArray[index] = fsunmi + } + return fsunmiArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + fsunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput + objectMap := make(map[string]interface{}) + if fsunmi.InstanceType != "" { + objectMap["instanceType"] = fsunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return &fsunmi, true +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &fsunmi, true +} + +// FailoverJobDetails this class represents the details for a failover job. +type FailoverJobDetails struct { + // ProtectedItemDetails - The test VM details. + ProtectedItemDetails *[]FailoverReplicationProtectedItemDetails `json:"protectedItemDetails,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for FailoverJobDetails. +func (fjd FailoverJobDetails) MarshalJSON() ([]byte, error) { + fjd.InstanceType = InstanceTypeFailoverJobDetails + objectMap := make(map[string]interface{}) + if fjd.ProtectedItemDetails != nil { + objectMap["protectedItemDetails"] = fjd.ProtectedItemDetails + } + if fjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = fjd.AffectedObjectDetails + } + if fjd.InstanceType != "" { + objectMap["instanceType"] = fjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return &fjd, true +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &fjd, true +} + +// FailoverProcessServerRequest request to failover a process server. +type FailoverProcessServerRequest struct { + // Properties - The properties of the PS Failover request. + Properties *FailoverProcessServerRequestProperties `json:"properties,omitempty"` +} + +// FailoverProcessServerRequestProperties the properties of the Failover Process Server request. +type FailoverProcessServerRequestProperties struct { + // ContainerName - The container identifier. + ContainerName *string `json:"containerName,omitempty"` + // SourceProcessServerID - The source process server. + SourceProcessServerID *string `json:"sourceProcessServerId,omitempty"` + // TargetProcessServerID - The new process server. + TargetProcessServerID *string `json:"targetProcessServerId,omitempty"` + // VmsToMigrate - The VMS to migrate. + VmsToMigrate *[]string `json:"vmsToMigrate,omitempty"` + // UpdateType - A value for failover type. It can be systemlevel/serverlevel. + UpdateType *string `json:"updateType,omitempty"` +} + +// FailoverReplicationProtectedItemDetails failover details for a replication protected item. +type FailoverReplicationProtectedItemDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // FriendlyName - The friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // TestVMName - The test Vm name. + TestVMName *string `json:"testVmName,omitempty"` + // TestVMFriendlyName - The test Vm friendly name. + TestVMFriendlyName *string `json:"testVmFriendlyName,omitempty"` + // NetworkConnectionStatus - The network connection status. + NetworkConnectionStatus *string `json:"networkConnectionStatus,omitempty"` + // NetworkFriendlyName - The network friendly name. + NetworkFriendlyName *string `json:"networkFriendlyName,omitempty"` + // Subnet - The network subnet. + Subnet *string `json:"subnet,omitempty"` + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // RecoveryPointTime - The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` +} + +// BasicGroupTaskDetails this class represents the group task details when parent child relationship exists in the +// drill down. +type BasicGroupTaskDetails interface { + AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) + AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) + AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) + AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) + AsGroupTaskDetails() (*GroupTaskDetails, bool) +} + +// GroupTaskDetails this class represents the group task details when parent child relationship exists in the +// drill down. +type GroupTaskDetails struct { + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicGroupTaskDetails(body []byte) (BasicGroupTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInlineWorkflowTaskDetails): + var iwtd InlineWorkflowTaskDetails + err := json.Unmarshal(body, &iwtd) + return iwtd, err + case string(InstanceTypeRecoveryPlanGroupTaskDetails): + var rpgtd RecoveryPlanGroupTaskDetails + err := json.Unmarshal(body, &rpgtd) + return rpgtd, err + case string(InstanceTypeRecoveryPlanShutdownGroupTaskDetails): + var rpsgtd RecoveryPlanShutdownGroupTaskDetails + err := json.Unmarshal(body, &rpsgtd) + return rpsgtd, err + default: + var gtd GroupTaskDetails + err := json.Unmarshal(body, >d) + return gtd, err + } +} +func unmarshalBasicGroupTaskDetailsArray(body []byte) ([]BasicGroupTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + gtdArray := make([]BasicGroupTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + gtd, err := unmarshalBasicGroupTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + gtdArray[index] = gtd + } + return gtdArray, nil +} + +// MarshalJSON is the custom marshaler for GroupTaskDetails. +func (gtd GroupTaskDetails) MarshalJSON() ([]byte, error) { + gtd.InstanceType = InstanceTypeGroupTaskDetails + objectMap := make(map[string]interface{}) + if gtd.ChildTasks != nil { + objectMap["childTasks"] = gtd.ChildTasks + } + if gtd.InstanceType != "" { + objectMap["instanceType"] = gtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return >d, true +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return >d, true +} + +// HealthError health Error. +type HealthError struct { + // InnerHealthErrors - The inner health errors. HealthError having a list of HealthError as child errors is problematic. InnerHealthError is used because this will prevent an infinite loop of structures when Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health errors and all API consumers can utilize this in the same fashion as Exception -> InnerException. + InnerHealthErrors *[]InnerHealthError `json:"innerHealthErrors,omitempty"` + // ErrorSource - Source of error. + ErrorSource *string `json:"errorSource,omitempty"` + // ErrorType - Type of error. + ErrorType *string `json:"errorType,omitempty"` + // ErrorLevel - Level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // ErrorCategory - Category of error. + ErrorCategory *string `json:"errorCategory,omitempty"` + // ErrorCode - Error code. + ErrorCode *string `json:"errorCode,omitempty"` + // SummaryMessage - Summary message of the entity. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // ErrorMessage - Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // CreationTimeUtc - Error creation time (UTC). + CreationTimeUtc *date.Time `json:"creationTimeUtc,omitempty"` + // RecoveryProviderErrorMessage - DRA error message. + RecoveryProviderErrorMessage *string `json:"recoveryProviderErrorMessage,omitempty"` + // EntityID - ID of the entity. + EntityID *string `json:"entityId,omitempty"` + // ErrorID - The health error unique id. + ErrorID *string `json:"errorId,omitempty"` + // CustomerResolvability - Value indicating whether the health error is customer resolvable. Possible values include: 'Allowed', 'NotAllowed' + CustomerResolvability HealthErrorCustomerResolvability `json:"customerResolvability,omitempty"` +} + +// HealthErrorSummary class to define the summary of the health error details. +type HealthErrorSummary struct { + // SummaryCode - The code of the health error. + SummaryCode *string `json:"summaryCode,omitempty"` + // Category - The category of the health error. Possible values include: 'HealthErrorCategoryNone', 'HealthErrorCategoryReplication', 'HealthErrorCategoryTestFailover', 'HealthErrorCategoryConfiguration', 'HealthErrorCategoryFabricInfrastructure', 'HealthErrorCategoryVersionExpiry', 'HealthErrorCategoryAgentAutoUpdateInfra', 'HealthErrorCategoryAgentAutoUpdateArtifactDeleted', 'HealthErrorCategoryAgentAutoUpdateRunAsAccount', 'HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry', 'HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired' + Category HealthErrorCategory `json:"category,omitempty"` + // Severity - Severity of error. Possible values include: 'NONE', 'Warning', 'Error', 'Info' + Severity Severity `json:"severity,omitempty"` + // SummaryMessage - The summary message of the health error. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // AffectedResourceType - The type of affected ARM resource. + AffectedResourceType *string `json:"affectedResourceType,omitempty"` + // AffectedResourceSubtype - The sub type of any subcomponent within the ARM resource that this might be applicable. Value remains null if not applicable. + AffectedResourceSubtype *string `json:"affectedResourceSubtype,omitempty"` + // AffectedResourceCorrelationIds - The list of affected resource correlation Ids. This can be used to uniquely identify the count of items affected by a specific category and severity as well as count of item affected by an specific issue. + AffectedResourceCorrelationIds *[]string `json:"affectedResourceCorrelationIds,omitempty"` +} + +// HyperVHostDetails hyper-V host details. +type HyperVHostDetails struct { + // ID - READ-ONLY; The Hyper-V host Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The Hyper-V host name. + Name *string `json:"name,omitempty"` + // MarsAgentVersion - READ-ONLY; The Mars agent version. + MarsAgentVersion *string `json:"marsAgentVersion,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVHostDetails. +func (hvhd HyperVHostDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// HyperVReplica2012EventDetails model class for event details of a HyperVReplica E2E event. +type HyperVReplica2012EventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) MarshalJSON() ([]byte, error) { + hvr2ed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvr2ed.ContainerName != nil { + objectMap["containerName"] = hvr2ed.ContainerName + } + if hvr2ed.FabricName != nil { + objectMap["fabricName"] = hvr2ed.FabricName + } + if hvr2ed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvr2ed.RemoteContainerName + } + if hvr2ed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvr2ed.RemoteFabricName + } + if hvr2ed.InstanceType != "" { + objectMap["instanceType"] = hvr2ed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return &hvr2ed, true +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvr2ed, true +} + +// HyperVReplica2012R2EventDetails model class for event details of a HyperVReplica blue E2E event. +type HyperVReplica2012R2EventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) MarshalJSON() ([]byte, error) { + hvr2ed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvr2ed.ContainerName != nil { + objectMap["containerName"] = hvr2ed.ContainerName + } + if hvr2ed.FabricName != nil { + objectMap["fabricName"] = hvr2ed.FabricName + } + if hvr2ed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvr2ed.RemoteContainerName + } + if hvr2ed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvr2ed.RemoteFabricName + } + if hvr2ed.InstanceType != "" { + objectMap["instanceType"] = hvr2ed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return &hvr2ed, true +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvr2ed, true +} + +// HyperVReplicaAzureApplyRecoveryPointInput applyRecoveryPoint input specific to HyperVReplicaAzure +// provider. +type HyperVReplicaAzureApplyRecoveryPointInput struct { + // PrimaryKekCertificatePfx - The primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - The secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + hvraarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraarpi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvraarpi.PrimaryKekCertificatePfx + } + if hvraarpi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvraarpi.SecondaryKekCertificatePfx + } + if hvraarpi.InstanceType != "" { + objectMap["instanceType"] = hvraarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return &hvraarpi, true +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &hvraarpi, true +} + +// HyperVReplicaAzureDiskInputDetails disk input details. +type HyperVReplicaAzureDiskInputDetails struct { + // DiskID - The DiskId. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The LogStorageAccountId. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// HyperVReplicaAzureEnableProtectionInput hyperVReplicaAzure specific enable protection input. +type HyperVReplicaAzureEnableProtectionInput struct { + // HvHostVMID - The Hyper-V host VM Id. + HvHostVMID *string `json:"hvHostVmId,omitempty"` + // VMName - The VM Name. + VMName *string `json:"vmName,omitempty"` + // OsType - The OS type associated with VM. + OsType *string `json:"osType,omitempty"` + // VhdID - The OS disk VHD id associated with VM. + VhdID *string `json:"vhdId,omitempty"` + // TargetStorageAccountID - The storage account Id. + TargetStorageAccountID *string `json:"targetStorageAccountId,omitempty"` + // TargetAzureNetworkID - The selected target Azure network Id. + TargetAzureNetworkID *string `json:"targetAzureNetworkId,omitempty"` + // TargetAzureSubnetID - The selected target Azure subnet Id. + TargetAzureSubnetID *string `json:"targetAzureSubnetId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // TargetAzureVMName - The target azure VM Name. + TargetAzureVMName *string `json:"targetAzureVmName,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DisksToInclude - The list of VHD Ids of disks to be protected. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // TargetAzureV1ResourceGroupID - The Id of the target resource group (for classic deployment) in which the failover VM is to be created. + TargetAzureV1ResourceGroupID *string `json:"targetAzureV1ResourceGroupId,omitempty"` + // TargetAzureV2ResourceGroupID - The Id of the target resource group (for resource manager deployment) in which the failover VM is to be created. + TargetAzureV2ResourceGroupID *string `json:"targetAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id for resource manager deployment. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetProximityPlacementGroupID - The proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisksForReplication - A value indicating whether managed disks should be used during replication. + UseManagedDisksForReplication *string `json:"useManagedDisksForReplication,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DisksToIncludeForManagedDisks - The disks to include list for managed disks. + DisksToIncludeForManagedDisks *[]HyperVReplicaAzureDiskInputDetails `json:"disksToIncludeForManagedDisks,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) MarshalJSON() ([]byte, error) { + hvraepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraepi.HvHostVMID != nil { + objectMap["hvHostVmId"] = hvraepi.HvHostVMID + } + if hvraepi.VMName != nil { + objectMap["vmName"] = hvraepi.VMName + } + if hvraepi.OsType != nil { + objectMap["osType"] = hvraepi.OsType + } + if hvraepi.VhdID != nil { + objectMap["vhdId"] = hvraepi.VhdID + } + if hvraepi.TargetStorageAccountID != nil { + objectMap["targetStorageAccountId"] = hvraepi.TargetStorageAccountID + } + if hvraepi.TargetAzureNetworkID != nil { + objectMap["targetAzureNetworkId"] = hvraepi.TargetAzureNetworkID + } + if hvraepi.TargetAzureSubnetID != nil { + objectMap["targetAzureSubnetId"] = hvraepi.TargetAzureSubnetID + } + if hvraepi.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = hvraepi.EnableRdpOnTargetOption + } + if hvraepi.TargetAzureVMName != nil { + objectMap["targetAzureVmName"] = hvraepi.TargetAzureVMName + } + if hvraepi.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = hvraepi.LogStorageAccountID + } + if hvraepi.DisksToInclude != nil { + objectMap["disksToInclude"] = hvraepi.DisksToInclude + } + if hvraepi.TargetAzureV1ResourceGroupID != nil { + objectMap["targetAzureV1ResourceGroupId"] = hvraepi.TargetAzureV1ResourceGroupID + } + if hvraepi.TargetAzureV2ResourceGroupID != nil { + objectMap["targetAzureV2ResourceGroupId"] = hvraepi.TargetAzureV2ResourceGroupID + } + if hvraepi.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvraepi.UseManagedDisks + } + if hvraepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = hvraepi.TargetAvailabilitySetID + } + if hvraepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvraepi.TargetAvailabilityZone + } + if hvraepi.LicenseType != "" { + objectMap["licenseType"] = hvraepi.LicenseType + } + if hvraepi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = hvraepi.SQLServerLicenseType + } + if hvraepi.TargetVMSize != nil { + objectMap["targetVmSize"] = hvraepi.TargetVMSize + } + if hvraepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvraepi.TargetProximityPlacementGroupID + } + if hvraepi.UseManagedDisksForReplication != nil { + objectMap["useManagedDisksForReplication"] = hvraepi.UseManagedDisksForReplication + } + if hvraepi.DiskType != "" { + objectMap["diskType"] = hvraepi.DiskType + } + if hvraepi.DisksToIncludeForManagedDisks != nil { + objectMap["disksToIncludeForManagedDisks"] = hvraepi.DisksToIncludeForManagedDisks + } + if hvraepi.DiskEncryptionSetID != nil { + objectMap["diskEncryptionSetId"] = hvraepi.DiskEncryptionSetID + } + if hvraepi.TargetVMTags != nil { + objectMap["targetVmTags"] = hvraepi.TargetVMTags + } + if hvraepi.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = hvraepi.SeedManagedDiskTags + } + if hvraepi.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvraepi.TargetManagedDiskTags + } + if hvraepi.TargetNicTags != nil { + objectMap["targetNicTags"] = hvraepi.TargetNicTags + } + if hvraepi.InstanceType != "" { + objectMap["instanceType"] = hvraepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return &hvraepi, true +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &hvraepi, true +} + +// HyperVReplicaAzureEventDetails model class for event details of a HyperVReplica E2A event. +type HyperVReplicaAzureEventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) MarshalJSON() ([]byte, error) { + hvraed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraed.ContainerName != nil { + objectMap["containerName"] = hvraed.ContainerName + } + if hvraed.FabricName != nil { + objectMap["fabricName"] = hvraed.FabricName + } + if hvraed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvraed.RemoteContainerName + } + if hvraed.InstanceType != "" { + objectMap["instanceType"] = hvraed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return &hvraed, true +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvraed, true +} + +// HyperVReplicaAzureFailbackProviderInput hyperVReplicaAzureFailback specific planned failover input. +type HyperVReplicaAzureFailbackProviderInput struct { + // DataSyncOption - Data sync option. + DataSyncOption *string `json:"dataSyncOption,omitempty"` + // RecoveryVMCreationOption - ALR options to create alternate recovery. + RecoveryVMCreationOption *string `json:"recoveryVmCreationOption,omitempty"` + // ProviderIDForAlternateRecovery - Provider Id for alternate location. + ProviderIDForAlternateRecovery *string `json:"providerIdForAlternateRecovery,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) MarshalJSON() ([]byte, error) { + hvrafpi.InstanceType = InstanceTypeHyperVReplicaAzureFailback + objectMap := make(map[string]interface{}) + if hvrafpi.DataSyncOption != nil { + objectMap["dataSyncOption"] = hvrafpi.DataSyncOption + } + if hvrafpi.RecoveryVMCreationOption != nil { + objectMap["recoveryVmCreationOption"] = hvrafpi.RecoveryVMCreationOption + } + if hvrafpi.ProviderIDForAlternateRecovery != nil { + objectMap["providerIdForAlternateRecovery"] = hvrafpi.ProviderIDForAlternateRecovery + } + if hvrafpi.InstanceType != "" { + objectMap["instanceType"] = hvrafpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return &hvrafpi, true +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &hvrafpi, true +} + +// HyperVReplicaAzureManagedDiskDetails hyper-V Managed disk details. +type HyperVReplicaAzureManagedDiskDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // SeedManagedDiskID - Seed managed disk Id. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // ReplicaDiskType - The replica disk type. + ReplicaDiskType *string `json:"replicaDiskType,omitempty"` + // DiskEncryptionSetID - The disk encryption set ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// HyperVReplicaAzurePlannedFailoverProviderInput hyperVReplicaAzure specific planned failover input. +type HyperVReplicaAzurePlannedFailoverProviderInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) MarshalJSON() ([]byte, error) { + hvrapfpi.InstanceType = InstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapfpi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvrapfpi.PrimaryKekCertificatePfx + } + if hvrapfpi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvrapfpi.SecondaryKekCertificatePfx + } + if hvrapfpi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvrapfpi.RecoveryPointID + } + if hvrapfpi.InstanceType != "" { + objectMap["instanceType"] = hvrapfpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return &hvrapfpi, true +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &hvrapfpi, true +} + +// HyperVReplicaAzurePolicyDetails hyper-V Replica Azure specific protection profile details. +type HyperVReplicaAzurePolicyDetails struct { + // RecoveryPointHistoryDurationInHours - The duration (in hours) to which point the recovery history needs to be maintained. + RecoveryPointHistoryDurationInHours *int32 `json:"recoveryPointHistoryDurationInHours,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - The interval (in hours) at which Hyper-V Replica should create an application consistent snapshot within the VM. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // ReplicationInterval - The replication interval. + ReplicationInterval *int32 `json:"replicationInterval,omitempty"` + // OnlineReplicationStartTime - The scheduled start time for the initial replication. If this parameter is Null, the initial replication starts immediately. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // Encryption - A value indicating whether encryption is enabled for virtual machines in this cloud. + Encryption *string `json:"encryption,omitempty"` + // ActiveStorageAccountID - The active storage account Id. + ActiveStorageAccountID *string `json:"activeStorageAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) MarshalJSON() ([]byte, error) { + hvrapd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapd.RecoveryPointHistoryDurationInHours != nil { + objectMap["recoveryPointHistoryDurationInHours"] = hvrapd.RecoveryPointHistoryDurationInHours + } + if hvrapd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrapd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrapd.ReplicationInterval != nil { + objectMap["replicationInterval"] = hvrapd.ReplicationInterval + } + if hvrapd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrapd.OnlineReplicationStartTime + } + if hvrapd.Encryption != nil { + objectMap["encryption"] = hvrapd.Encryption + } + if hvrapd.ActiveStorageAccountID != nil { + objectMap["activeStorageAccountId"] = hvrapd.ActiveStorageAccountID + } + if hvrapd.InstanceType != "" { + objectMap["instanceType"] = hvrapd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return &hvrapd, true +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrapd, true +} + +// HyperVReplicaAzurePolicyInput hyper-V Replica Azure specific input for creating a protection profile. +type HyperVReplicaAzurePolicyInput struct { + // RecoveryPointHistoryDuration - The duration (in hours) to which point the recovery history needs to be maintained. + RecoveryPointHistoryDuration *int32 `json:"recoveryPointHistoryDuration,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - The interval (in hours) at which Hyper-V Replica should create an application consistent snapshot within the VM. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // ReplicationInterval - The replication interval. + ReplicationInterval *int32 `json:"replicationInterval,omitempty"` + // OnlineReplicationStartTime - The scheduled start time for the initial replication. If this parameter is Null, the initial replication starts immediately. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // StorageAccounts - The list of storage accounts to which the VMs in the primary cloud can replicate to. + StorageAccounts *[]string `json:"storageAccounts,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) MarshalJSON() ([]byte, error) { + hvrapi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapi.RecoveryPointHistoryDuration != nil { + objectMap["recoveryPointHistoryDuration"] = hvrapi.RecoveryPointHistoryDuration + } + if hvrapi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrapi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrapi.ReplicationInterval != nil { + objectMap["replicationInterval"] = hvrapi.ReplicationInterval + } + if hvrapi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrapi.OnlineReplicationStartTime + } + if hvrapi.StorageAccounts != nil { + objectMap["storageAccounts"] = hvrapi.StorageAccounts + } + if hvrapi.InstanceType != "" { + objectMap["instanceType"] = hvrapi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return &hvrapi, true +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrapi, true +} + +// HyperVReplicaAzureReplicationDetails hyper V Replica Azure provider specific settings. +type HyperVReplicaAzureReplicationDetails struct { + // AzureVMDiskDetails - Azure VM Disk details. + AzureVMDiskDetails *[]AzureVMDiskDetails `json:"azureVmDiskDetails,omitempty"` + // RecoveryAzureVMName - Recovery Azure given name. + RecoveryAzureVMName *string `json:"recoveryAzureVmName,omitempty"` + // RecoveryAzureVMSize - The Recovery Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureStorageAccount - The recovery Azure storage account. + RecoveryAzureStorageAccount *string `json:"recoveryAzureStorageAccount,omitempty"` + // RecoveryAzureLogStorageAccountID - The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. + RecoveryAzureLogStorageAccountID *string `json:"recoveryAzureLogStorageAccountId,omitempty"` + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // RpoInSeconds - Last RPO value. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // SelectedRecoveryAzureNetworkID - The selected recovery azure network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // Encryption - The encryption info. + Encryption *string `json:"encryption,omitempty"` + // OSDetails - The operating system info. + OSDetails *OSDetails `json:"oSDetails,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // RecoveryAzureResourceGroupID - The target resource group Id. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]HyperVReplicaAzureManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) MarshalJSON() ([]byte, error) { + hvrard.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrard.AzureVMDiskDetails != nil { + objectMap["azureVmDiskDetails"] = hvrard.AzureVMDiskDetails + } + if hvrard.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVmName"] = hvrard.RecoveryAzureVMName + } + if hvrard.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = hvrard.RecoveryAzureVMSize + } + if hvrard.RecoveryAzureStorageAccount != nil { + objectMap["recoveryAzureStorageAccount"] = hvrard.RecoveryAzureStorageAccount + } + if hvrard.RecoveryAzureLogStorageAccountID != nil { + objectMap["recoveryAzureLogStorageAccountId"] = hvrard.RecoveryAzureLogStorageAccountID + } + if hvrard.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrard.LastReplicatedTime + } + if hvrard.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = hvrard.RpoInSeconds + } + if hvrard.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = hvrard.LastRpoCalculatedTime + } + if hvrard.VMID != nil { + objectMap["vmId"] = hvrard.VMID + } + if hvrard.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrard.VMProtectionState + } + if hvrard.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrard.VMProtectionStateDescription + } + if hvrard.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrard.InitialReplicationDetails + } + if hvrard.VMNics != nil { + objectMap["vmNics"] = hvrard.VMNics + } + if hvrard.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = hvrard.SelectedRecoveryAzureNetworkID + } + if hvrard.SelectedSourceNicID != nil { + objectMap["selectedSourceNicId"] = hvrard.SelectedSourceNicID + } + if hvrard.Encryption != nil { + objectMap["encryption"] = hvrard.Encryption + } + if hvrard.OSDetails != nil { + objectMap["oSDetails"] = hvrard.OSDetails + } + if hvrard.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = hvrard.SourceVMRAMSizeInMB + } + if hvrard.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = hvrard.SourceVMCPUCount + } + if hvrard.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = hvrard.EnableRdpOnTargetOption + } + if hvrard.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = hvrard.RecoveryAzureResourceGroupID + } + if hvrard.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = hvrard.RecoveryAvailabilitySetID + } + if hvrard.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvrard.TargetAvailabilityZone + } + if hvrard.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvrard.TargetProximityPlacementGroupID + } + if hvrard.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvrard.UseManagedDisks + } + if hvrard.LicenseType != nil { + objectMap["licenseType"] = hvrard.LicenseType + } + if hvrard.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = hvrard.SQLServerLicenseType + } + if hvrard.TargetVMTags != nil { + objectMap["targetVmTags"] = hvrard.TargetVMTags + } + if hvrard.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = hvrard.SeedManagedDiskTags + } + if hvrard.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvrard.TargetManagedDiskTags + } + if hvrard.TargetNicTags != nil { + objectMap["targetNicTags"] = hvrard.TargetNicTags + } + if hvrard.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = hvrard.ProtectedManagedDisks + } + if hvrard.InstanceType != "" { + objectMap["instanceType"] = hvrard.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return &hvrard, true +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrard, true +} + +// HyperVReplicaAzureReprotectInput azure specific reprotect input. +type HyperVReplicaAzureReprotectInput struct { + // HvHostVMID - The Hyper-V host Vm Id. + HvHostVMID *string `json:"hvHostVmId,omitempty"` + // VMName - The Vm Name. + VMName *string `json:"vmName,omitempty"` + // OsType - The OS type associated with vm. + OsType *string `json:"osType,omitempty"` + // VHDID - The OS disk VHD id associated with vm. + VHDID *string `json:"vHDId,omitempty"` + // StorageAccountID - The storage account name. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) MarshalJSON() ([]byte, error) { + hvrari.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrari.HvHostVMID != nil { + objectMap["hvHostVmId"] = hvrari.HvHostVMID + } + if hvrari.VMName != nil { + objectMap["vmName"] = hvrari.VMName + } + if hvrari.OsType != nil { + objectMap["osType"] = hvrari.OsType + } + if hvrari.VHDID != nil { + objectMap["vHDId"] = hvrari.VHDID + } + if hvrari.StorageAccountID != nil { + objectMap["storageAccountId"] = hvrari.StorageAccountID + } + if hvrari.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = hvrari.LogStorageAccountID + } + if hvrari.InstanceType != "" { + objectMap["instanceType"] = hvrari.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return &hvrari, true +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &hvrari, true +} + +// HyperVReplicaAzureTestFailoverInput hvrA provider specific input for test failover. +type HyperVReplicaAzureTestFailoverInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) MarshalJSON() ([]byte, error) { + hvratfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvratfi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvratfi.PrimaryKekCertificatePfx + } + if hvratfi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvratfi.SecondaryKekCertificatePfx + } + if hvratfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvratfi.RecoveryPointID + } + if hvratfi.InstanceType != "" { + objectMap["instanceType"] = hvratfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return &hvratfi, true +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &hvratfi, true +} + +// HyperVReplicaAzureUnplannedFailoverInput hvrA provider specific input for unplanned failover. +type HyperVReplicaAzureUnplannedFailoverInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + hvraufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraufi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvraufi.PrimaryKekCertificatePfx + } + if hvraufi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvraufi.SecondaryKekCertificatePfx + } + if hvraufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvraufi.RecoveryPointID + } + if hvraufi.InstanceType != "" { + objectMap["instanceType"] = hvraufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return &hvraufi, true +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &hvraufi, true +} + +// HyperVReplicaAzureUpdateReplicationProtectedItemInput hyperV replica Azure input to update replication +// protected item. +type HyperVReplicaAzureUpdateReplicationProtectedItemInput struct { + // RecoveryAzureV1ResourceGroupID - The recovery Azure resource group Id for classic deployment. + RecoveryAzureV1ResourceGroupID *string `json:"recoveryAzureV1ResourceGroupId,omitempty"` + // RecoveryAzureV2ResourceGroupID - The recovery Azure resource group Id for resource manager deployment. + RecoveryAzureV2ResourceGroupID *string `json:"recoveryAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // DiskIDToDiskEncryptionMap - The dictionary of disk resource Id to disk encryption set ARM Id. + DiskIDToDiskEncryptionMap map[string]*string `json:"diskIdToDiskEncryptionMap"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // VMDisks - The list of disk update properties. + VMDisks *[]UpdateDiskInput `json:"vmDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + hvraurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraurpii.RecoveryAzureV1ResourceGroupID != nil { + objectMap["recoveryAzureV1ResourceGroupId"] = hvraurpii.RecoveryAzureV1ResourceGroupID + } + if hvraurpii.RecoveryAzureV2ResourceGroupID != nil { + objectMap["recoveryAzureV2ResourceGroupId"] = hvraurpii.RecoveryAzureV2ResourceGroupID + } + if hvraurpii.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvraurpii.UseManagedDisks + } + if hvraurpii.DiskIDToDiskEncryptionMap != nil { + objectMap["diskIdToDiskEncryptionMap"] = hvraurpii.DiskIDToDiskEncryptionMap + } + if hvraurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvraurpii.TargetProximityPlacementGroupID + } + if hvraurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvraurpii.TargetAvailabilityZone + } + if hvraurpii.TargetVMTags != nil { + objectMap["targetVmTags"] = hvraurpii.TargetVMTags + } + if hvraurpii.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvraurpii.TargetManagedDiskTags + } + if hvraurpii.TargetNicTags != nil { + objectMap["targetNicTags"] = hvraurpii.TargetNicTags + } + if hvraurpii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = hvraurpii.SQLServerLicenseType + } + if hvraurpii.VMDisks != nil { + objectMap["vmDisks"] = hvraurpii.VMDisks + } + if hvraurpii.InstanceType != "" { + objectMap["instanceType"] = hvraurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return &hvraurpii, true +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &hvraurpii, true +} + +// HyperVReplicaBaseEventDetails abstract model class for event details of a HyperVReplica E2E event. +type HyperVReplicaBaseEventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) MarshalJSON() ([]byte, error) { + hvrbed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails + objectMap := make(map[string]interface{}) + if hvrbed.ContainerName != nil { + objectMap["containerName"] = hvrbed.ContainerName + } + if hvrbed.FabricName != nil { + objectMap["fabricName"] = hvrbed.FabricName + } + if hvrbed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvrbed.RemoteContainerName + } + if hvrbed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvrbed.RemoteFabricName + } + if hvrbed.InstanceType != "" { + objectMap["instanceType"] = hvrbed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return &hvrbed, true +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvrbed, true +} + +// HyperVReplicaBasePolicyDetails base class for HyperVReplica policy details. +type HyperVReplicaBasePolicyDetails struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud. + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) MarshalJSON() ([]byte, error) { + hvrbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails + objectMap := make(map[string]interface{}) + if hvrbpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpd.RecoveryPoints + } + if hvrbpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpd.Compression != nil { + objectMap["compression"] = hvrbpd.Compression + } + if hvrbpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpd.InitialReplicationMethod + } + if hvrbpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpd.OnlineReplicationStartTime + } + if hvrbpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpd.OfflineReplicationImportPath + } + if hvrbpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpd.OfflineReplicationExportPath + } + if hvrbpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpd.ReplicationPort + } + if hvrbpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpd.AllowedAuthenticationType + } + if hvrbpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrbpd.ReplicaDeletionOption + } + if hvrbpd.InstanceType != "" { + objectMap["instanceType"] = hvrbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return &hvrbpd, true +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrbpd, true +} + +// HyperVReplicaBaseReplicationDetails hyper V replica provider specific settings base class. +type HyperVReplicaBaseReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) MarshalJSON() ([]byte, error) { + hvrbrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails + objectMap := make(map[string]interface{}) + if hvrbrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrbrd.LastReplicatedTime + } + if hvrbrd.VMNics != nil { + objectMap["vmNics"] = hvrbrd.VMNics + } + if hvrbrd.VMID != nil { + objectMap["vmId"] = hvrbrd.VMID + } + if hvrbrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrbrd.VMProtectionState + } + if hvrbrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrbrd.VMProtectionStateDescription + } + if hvrbrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrbrd.InitialReplicationDetails + } + if hvrbrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrbrd.VMDiskDetails + } + if hvrbrd.InstanceType != "" { + objectMap["instanceType"] = hvrbrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return &hvrbrd, true +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrbrd, true +} + +// HyperVReplicaBluePolicyDetails hyper-V Replica Blue specific protection profile details. +type HyperVReplicaBluePolicyDetails struct { + // ReplicationFrequencyInSeconds - A value indicating the replication interval. + ReplicationFrequencyInSeconds *int32 `json:"replicationFrequencyInSeconds,omitempty"` + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) MarshalJSON() ([]byte, error) { + hvrbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbpd.ReplicationFrequencyInSeconds != nil { + objectMap["replicationFrequencyInSeconds"] = hvrbpd.ReplicationFrequencyInSeconds + } + if hvrbpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpd.RecoveryPoints + } + if hvrbpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpd.Compression != nil { + objectMap["compression"] = hvrbpd.Compression + } + if hvrbpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpd.InitialReplicationMethod + } + if hvrbpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpd.OnlineReplicationStartTime + } + if hvrbpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpd.OfflineReplicationImportPath + } + if hvrbpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpd.OfflineReplicationExportPath + } + if hvrbpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpd.ReplicationPort + } + if hvrbpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpd.AllowedAuthenticationType + } + if hvrbpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrbpd.ReplicaDeletionOption + } + if hvrbpd.InstanceType != "" { + objectMap["instanceType"] = hvrbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return &hvrbpd, true +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrbpd, true +} + +// HyperVReplicaBluePolicyInput hyperV Replica Blue policy input. +type HyperVReplicaBluePolicyInput struct { + // ReplicationFrequencyInSeconds - A value indicating the replication interval. + ReplicationFrequencyInSeconds *int32 `json:"replicationFrequencyInSeconds,omitempty"` + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletion - A value indicating whether the VM has to be auto deleted. + ReplicaDeletion *string `json:"replicaDeletion,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) MarshalJSON() ([]byte, error) { + hvrbpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbpi.ReplicationFrequencyInSeconds != nil { + objectMap["replicationFrequencyInSeconds"] = hvrbpi.ReplicationFrequencyInSeconds + } + if hvrbpi.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpi.RecoveryPoints + } + if hvrbpi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpi.Compression != nil { + objectMap["compression"] = hvrbpi.Compression + } + if hvrbpi.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpi.InitialReplicationMethod + } + if hvrbpi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpi.OnlineReplicationStartTime + } + if hvrbpi.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpi.OfflineReplicationImportPath + } + if hvrbpi.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpi.OfflineReplicationExportPath + } + if hvrbpi.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpi.ReplicationPort + } + if hvrbpi.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpi.AllowedAuthenticationType + } + if hvrbpi.ReplicaDeletion != nil { + objectMap["replicaDeletion"] = hvrbpi.ReplicaDeletion + } + if hvrbpi.InstanceType != "" { + objectMap["instanceType"] = hvrbpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return &hvrbpi, true +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return &hvrbpi, true +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrbpi, true +} + +// HyperVReplicaBlueReplicationDetails hyperV replica 2012 R2 (Blue) replication details. +type HyperVReplicaBlueReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) MarshalJSON() ([]byte, error) { + hvrbrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrbrd.LastReplicatedTime + } + if hvrbrd.VMNics != nil { + objectMap["vmNics"] = hvrbrd.VMNics + } + if hvrbrd.VMID != nil { + objectMap["vmId"] = hvrbrd.VMID + } + if hvrbrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrbrd.VMProtectionState + } + if hvrbrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrbrd.VMProtectionStateDescription + } + if hvrbrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrbrd.InitialReplicationDetails + } + if hvrbrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrbrd.VMDiskDetails + } + if hvrbrd.InstanceType != "" { + objectMap["instanceType"] = hvrbrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return &hvrbrd, true +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrbrd, true +} + +// HyperVReplicaPolicyDetails hyper-V Replica Blue specific protection profile details. +type HyperVReplicaPolicyDetails struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) MarshalJSON() ([]byte, error) { + hvrpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrpd.RecoveryPoints + } + if hvrpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrpd.Compression != nil { + objectMap["compression"] = hvrpd.Compression + } + if hvrpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrpd.InitialReplicationMethod + } + if hvrpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrpd.OnlineReplicationStartTime + } + if hvrpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrpd.OfflineReplicationImportPath + } + if hvrpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrpd.OfflineReplicationExportPath + } + if hvrpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrpd.ReplicationPort + } + if hvrpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrpd.AllowedAuthenticationType + } + if hvrpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrpd.ReplicaDeletionOption + } + if hvrpd.InstanceType != "" { + objectMap["instanceType"] = hvrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return &hvrpd, true +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrpd, true +} + +// BasicHyperVReplicaPolicyInput hyper-V Replica specific policy Input. +type BasicHyperVReplicaPolicyInput interface { + AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) + AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) +} + +// HyperVReplicaPolicyInput hyper-V Replica specific policy Input. +type HyperVReplicaPolicyInput struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletion - A value indicating whether the VM has to be auto deleted. + ReplicaDeletion *string `json:"replicaDeletion,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicHyperVReplicaPolicyInput(body []byte) (BasicHyperVReplicaPolicyInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2): + var hvrbpi HyperVReplicaBluePolicyInput + err := json.Unmarshal(body, &hvrbpi) + return hvrbpi, err + default: + var hvrpi HyperVReplicaPolicyInput + err := json.Unmarshal(body, &hvrpi) + return hvrpi, err + } +} +func unmarshalBasicHyperVReplicaPolicyInputArray(body []byte) ([]BasicHyperVReplicaPolicyInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + hvrpiArray := make([]BasicHyperVReplicaPolicyInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + hvrpi, err := unmarshalBasicHyperVReplicaPolicyInput(*rawMessage) + if err != nil { + return nil, err + } + hvrpiArray[index] = hvrpi + } + return hvrpiArray, nil +} + +// MarshalJSON is the custom marshaler for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) MarshalJSON() ([]byte, error) { + hvrpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrpi.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrpi.RecoveryPoints + } + if hvrpi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrpi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrpi.Compression != nil { + objectMap["compression"] = hvrpi.Compression + } + if hvrpi.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrpi.InitialReplicationMethod + } + if hvrpi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrpi.OnlineReplicationStartTime + } + if hvrpi.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrpi.OfflineReplicationImportPath + } + if hvrpi.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrpi.OfflineReplicationExportPath + } + if hvrpi.ReplicationPort != nil { + objectMap["replicationPort"] = hvrpi.ReplicationPort + } + if hvrpi.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrpi.AllowedAuthenticationType + } + if hvrpi.ReplicaDeletion != nil { + objectMap["replicaDeletion"] = hvrpi.ReplicaDeletion + } + if hvrpi.InstanceType != "" { + objectMap["instanceType"] = hvrpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return &hvrpi, true +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return &hvrpi, true +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrpi, true +} + +// HyperVReplicaReplicationDetails hyperV replica 2012 replication details. +type HyperVReplicaReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) MarshalJSON() ([]byte, error) { + hvrrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrrd.LastReplicatedTime + } + if hvrrd.VMNics != nil { + objectMap["vmNics"] = hvrrd.VMNics + } + if hvrrd.VMID != nil { + objectMap["vmId"] = hvrrd.VMID + } + if hvrrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrrd.VMProtectionState + } + if hvrrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrrd.VMProtectionStateDescription + } + if hvrrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrrd.InitialReplicationDetails + } + if hvrrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrrd.VMDiskDetails + } + if hvrrd.InstanceType != "" { + objectMap["instanceType"] = hvrrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return &hvrrd, true +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrrd, true +} + +// HyperVSiteDetails hyperVSite fabric specific details. +type HyperVSiteDetails struct { + // HyperVHosts - The list of Hyper-V hosts associated with the fabric. + HyperVHosts *[]HyperVHostDetails `json:"hyperVHosts,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) MarshalJSON() ([]byte, error) { + hvsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite + objectMap := make(map[string]interface{}) + if hvsd.HyperVHosts != nil { + objectMap["hyperVHosts"] = hvsd.HyperVHosts + } + if hvsd.InstanceType != "" { + objectMap["instanceType"] = hvsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return &hvsd, true +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &hvsd, true +} + +// BasicHyperVVirtualMachineDetails single Host fabric provider specific VM settings. +type BasicHyperVVirtualMachineDetails interface { + AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) + AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) +} + +// HyperVVirtualMachineDetails single Host fabric provider specific VM settings. +type HyperVVirtualMachineDetails struct { + // SourceItemID - The source id of the object. + SourceItemID *string `json:"sourceItemId,omitempty"` + // Generation - The id of the object in fabric. + Generation *string `json:"generation,omitempty"` + // OsDetails - The Last replication time. + OsDetails *OSDetails `json:"osDetails,omitempty"` + // DiskDetails - The Last successful failover time. + DiskDetails *[]DiskDetails `json:"diskDetails,omitempty"` + // HasPhysicalDisk - A value indicating whether the VM has a physical disk attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasPhysicalDisk PresenceStatus `json:"hasPhysicalDisk,omitempty"` + // HasFibreChannelAdapter - A value indicating whether the VM has a fibre channel adapter attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasFibreChannelAdapter PresenceStatus `json:"hasFibreChannelAdapter,omitempty"` + // HasSharedVhd - A value indicating whether the VM has a shared VHD attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasSharedVhd PresenceStatus `json:"hasSharedVhd,omitempty"` + // HyperVHostID - The Id of the hyper-v host in fabric. + HyperVHostID *string `json:"hyperVHostId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicHyperVVirtualMachineDetails(body []byte) (BasicHyperVVirtualMachineDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeVmmVirtualMachine): + var vvmd VmmVirtualMachineDetails + err := json.Unmarshal(body, &vvmd) + return vvmd, err + default: + var hvvmd HyperVVirtualMachineDetails + err := json.Unmarshal(body, &hvvmd) + return hvvmd, err + } +} +func unmarshalBasicHyperVVirtualMachineDetailsArray(body []byte) ([]BasicHyperVVirtualMachineDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + hvvmdArray := make([]BasicHyperVVirtualMachineDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + hvvmd, err := unmarshalBasicHyperVVirtualMachineDetails(*rawMessage) + if err != nil { + return nil, err + } + hvvmdArray[index] = hvvmd + } + return hvvmdArray, nil +} + +// MarshalJSON is the custom marshaler for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) MarshalJSON() ([]byte, error) { + hvvmd.InstanceType = InstanceTypeHyperVVirtualMachine + objectMap := make(map[string]interface{}) + if hvvmd.SourceItemID != nil { + objectMap["sourceItemId"] = hvvmd.SourceItemID + } + if hvvmd.Generation != nil { + objectMap["generation"] = hvvmd.Generation + } + if hvvmd.OsDetails != nil { + objectMap["osDetails"] = hvvmd.OsDetails + } + if hvvmd.DiskDetails != nil { + objectMap["diskDetails"] = hvvmd.DiskDetails + } + if hvvmd.HasPhysicalDisk != "" { + objectMap["hasPhysicalDisk"] = hvvmd.HasPhysicalDisk + } + if hvvmd.HasFibreChannelAdapter != "" { + objectMap["hasFibreChannelAdapter"] = hvvmd.HasFibreChannelAdapter + } + if hvvmd.HasSharedVhd != "" { + objectMap["hasSharedVhd"] = hvvmd.HasSharedVhd + } + if hvvmd.HyperVHostID != nil { + objectMap["hyperVHostId"] = hvvmd.HyperVHostID + } + if hvvmd.InstanceType != "" { + objectMap["instanceType"] = hvvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return &hvvmd, true +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return &hvvmd, true +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &hvvmd, true +} + +// IdentityProviderDetails identity provider details. +type IdentityProviderDetails struct { + // TenantID - The tenant Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + TenantID *string `json:"tenantId,omitempty"` + // ApplicationID - The application/client Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ApplicationID *string `json:"applicationId,omitempty"` + // ObjectID - The object Id of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ObjectID *string `json:"objectId,omitempty"` + // Audience - The intended Audience of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + Audience *string `json:"audience,omitempty"` + // AadAuthority - The base authority for Azure Active Directory authentication. + AadAuthority *string `json:"aadAuthority,omitempty"` +} + +// IdentityProviderInput identity provider input. +type IdentityProviderInput struct { + // TenantID - The tenant Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + TenantID *string `json:"tenantId,omitempty"` + // ApplicationID - The application/client Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ApplicationID *string `json:"applicationId,omitempty"` + // ObjectID - The object Id of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ObjectID *string `json:"objectId,omitempty"` + // Audience - The intended Audience of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + Audience *string `json:"audience,omitempty"` + // AadAuthority - The base authority for Azure Active Directory authentication. + AadAuthority *string `json:"aadAuthority,omitempty"` +} + +// InconsistentVMDetails this class stores the monitoring details for consistency check of inconsistent +// Protected Entity. +type InconsistentVMDetails struct { + // VMName - The Vm name. + VMName *string `json:"vmName,omitempty"` + // CloudName - The Cloud name. + CloudName *string `json:"cloudName,omitempty"` + // Details - The list of details regarding state of the Protected Entity in SRS and On prem. + Details *[]string `json:"details,omitempty"` + // ErrorIds - The list of error ids. + ErrorIds *[]string `json:"errorIds,omitempty"` +} + +// InitialReplicationDetails initial replication details. +type InitialReplicationDetails struct { + // InitialReplicationType - Initial replication type. + InitialReplicationType *string `json:"initialReplicationType,omitempty"` + // InitialReplicationProgressPercentage - The initial replication progress percentage. + InitialReplicationProgressPercentage *string `json:"initialReplicationProgressPercentage,omitempty"` +} + +// InlineWorkflowTaskDetails this class represents the inline workflow task details. +type InlineWorkflowTaskDetails struct { + // WorkflowIds - The list of child workflow ids. + WorkflowIds *[]string `json:"workflowIds,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) MarshalJSON() ([]byte, error) { + iwtd.InstanceType = InstanceTypeInlineWorkflowTaskDetails + objectMap := make(map[string]interface{}) + if iwtd.WorkflowIds != nil { + objectMap["workflowIds"] = iwtd.WorkflowIds + } + if iwtd.ChildTasks != nil { + objectMap["childTasks"] = iwtd.ChildTasks + } + if iwtd.InstanceType != "" { + objectMap["instanceType"] = iwtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return &iwtd, true +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &iwtd, true +} + +// InMageAgentDetails the details of the InMage agent. +type InMageAgentDetails struct { + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentUpdateStatus - A value indicating whether installed agent needs to be updated. + AgentUpdateStatus *string `json:"agentUpdateStatus,omitempty"` + // PostUpdateRebootStatus - A value indicating whether reboot is required after update is applied. + PostUpdateRebootStatus *string `json:"postUpdateRebootStatus,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` +} + +// InMageAzureV2ApplyRecoveryPointInput applyRecoveryPoint input specific to InMageAzureV2 provider. +type InMageAzureV2ApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + imavarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavarpi.InstanceType != "" { + objectMap["instanceType"] = imavarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return &imavarpi, true +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &imavarpi, true +} + +// InMageAzureV2DiskInputDetails disk input details. +type InMageAzureV2DiskInputDetails struct { + // DiskID - The DiskId. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The LogStorageAccountId. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageAzureV2EnableProtectionInput vMware Azure specific enable protection input. +type InMageAzureV2EnableProtectionInput struct { + // MasterTargetID - The Master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // StorageAccountID - The storage account Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // MultiVMGroupID - The multi VM group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]InMageAzureV2DiskInputDetails `json:"disksToInclude,omitempty"` + // TargetAzureNetworkID - The selected target Azure network Id. + TargetAzureNetworkID *string `json:"targetAzureNetworkId,omitempty"` + // TargetAzureSubnetID - The selected target Azure subnet Id. + TargetAzureSubnetID *string `json:"targetAzureSubnetId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target VM after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // TargetAzureVMName - The target azure VM Name. + TargetAzureVMName *string `json:"targetAzureVmName,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // TargetAzureV1ResourceGroupID - The Id of the target resource group (for classic deployment) in which the failover VM is to be created. + TargetAzureV1ResourceGroupID *string `json:"targetAzureV1ResourceGroupId,omitempty"` + // TargetAzureV2ResourceGroupID - The Id of the target resource group (for resource manager deployment) in which the failover VM is to be created. + TargetAzureV2ResourceGroupID *string `json:"targetAzureV2ResourceGroupId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id for resource manager deployment. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) MarshalJSON() ([]byte, error) { + imavepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavepi.MasterTargetID != nil { + objectMap["masterTargetId"] = imavepi.MasterTargetID + } + if imavepi.ProcessServerID != nil { + objectMap["processServerId"] = imavepi.ProcessServerID + } + if imavepi.StorageAccountID != nil { + objectMap["storageAccountId"] = imavepi.StorageAccountID + } + if imavepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imavepi.RunAsAccountID + } + if imavepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imavepi.MultiVMGroupID + } + if imavepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imavepi.MultiVMGroupName + } + if imavepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imavepi.DisksToInclude + } + if imavepi.TargetAzureNetworkID != nil { + objectMap["targetAzureNetworkId"] = imavepi.TargetAzureNetworkID + } + if imavepi.TargetAzureSubnetID != nil { + objectMap["targetAzureSubnetId"] = imavepi.TargetAzureSubnetID + } + if imavepi.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = imavepi.EnableRdpOnTargetOption + } + if imavepi.TargetAzureVMName != nil { + objectMap["targetAzureVmName"] = imavepi.TargetAzureVMName + } + if imavepi.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imavepi.LogStorageAccountID + } + if imavepi.TargetAzureV1ResourceGroupID != nil { + objectMap["targetAzureV1ResourceGroupId"] = imavepi.TargetAzureV1ResourceGroupID + } + if imavepi.TargetAzureV2ResourceGroupID != nil { + objectMap["targetAzureV2ResourceGroupId"] = imavepi.TargetAzureV2ResourceGroupID + } + if imavepi.DiskType != "" { + objectMap["diskType"] = imavepi.DiskType + } + if imavepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imavepi.TargetAvailabilitySetID + } + if imavepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavepi.TargetAvailabilityZone + } + if imavepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavepi.TargetProximityPlacementGroupID + } + if imavepi.LicenseType != "" { + objectMap["licenseType"] = imavepi.LicenseType + } + if imavepi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = imavepi.SQLServerLicenseType + } + if imavepi.TargetVMSize != nil { + objectMap["targetVmSize"] = imavepi.TargetVMSize + } + if imavepi.DiskEncryptionSetID != nil { + objectMap["diskEncryptionSetId"] = imavepi.DiskEncryptionSetID + } + if imavepi.TargetVMTags != nil { + objectMap["targetVmTags"] = imavepi.TargetVMTags + } + if imavepi.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = imavepi.SeedManagedDiskTags + } + if imavepi.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavepi.TargetManagedDiskTags + } + if imavepi.TargetNicTags != nil { + objectMap["targetNicTags"] = imavepi.TargetNicTags + } + if imavepi.InstanceType != "" { + objectMap["instanceType"] = imavepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return &imavepi, true +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imavepi, true +} + +// InMageAzureV2EventDetails model class for event details of a VMwareAzureV2 event. +type InMageAzureV2EventDetails struct { + // EventType - InMage Event type. Takes one of the values of InMageDataContract.InMageMonitoringEventType. + EventType *string `json:"eventType,omitempty"` + // Category - InMage Event Category. + Category *string `json:"category,omitempty"` + // Component - InMage Event Component. + Component *string `json:"component,omitempty"` + // CorrectiveAction - Corrective Action string for the event. + CorrectiveAction *string `json:"correctiveAction,omitempty"` + // Details - InMage Event Details. + Details *string `json:"details,omitempty"` + // Summary - InMage Event Summary. + Summary *string `json:"summary,omitempty"` + // SiteName - VMware Site name. + SiteName *string `json:"siteName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) MarshalJSON() ([]byte, error) { + imaved.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imaved.EventType != nil { + objectMap["eventType"] = imaved.EventType + } + if imaved.Category != nil { + objectMap["category"] = imaved.Category + } + if imaved.Component != nil { + objectMap["component"] = imaved.Component + } + if imaved.CorrectiveAction != nil { + objectMap["correctiveAction"] = imaved.CorrectiveAction + } + if imaved.Details != nil { + objectMap["details"] = imaved.Details + } + if imaved.Summary != nil { + objectMap["summary"] = imaved.Summary + } + if imaved.SiteName != nil { + objectMap["siteName"] = imaved.SiteName + } + if imaved.InstanceType != "" { + objectMap["instanceType"] = imaved.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return &imaved, true +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imaved, true +} + +// InMageAzureV2ManagedDiskDetails inMageAzureV2 Managed disk details. +type InMageAzureV2ManagedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // SeedManagedDiskID - Seed managed disk Id. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // ReplicaDiskType - The replica disk type. + ReplicaDiskType *string `json:"replicaDiskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetDiskName - The target disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// InMageAzureV2PolicyDetails inMage Azure v2 specific protection profile details. +type InMageAzureV2PolicyDetails struct { + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) MarshalJSON() ([]byte, error) { + imavpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imavpd.CrashConsistentFrequencyInMinutes + } + if imavpd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imavpd.RecoveryPointThresholdInMinutes + } + if imavpd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imavpd.RecoveryPointHistory + } + if imavpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imavpd.AppConsistentFrequencyInMinutes + } + if imavpd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imavpd.MultiVMSyncStatus + } + if imavpd.InstanceType != "" { + objectMap["instanceType"] = imavpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return &imavpd, true +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imavpd, true +} + +// InMageAzureV2PolicyInput vMWare Azure specific policy Input. +type InMageAzureV2PolicyInput struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) MarshalJSON() ([]byte, error) { + imavpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavpi.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imavpi.RecoveryPointThresholdInMinutes + } + if imavpi.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imavpi.RecoveryPointHistory + } + if imavpi.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imavpi.CrashConsistentFrequencyInMinutes + } + if imavpi.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imavpi.AppConsistentFrequencyInMinutes + } + if imavpi.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = imavpi.MultiVMSyncStatus + } + if imavpi.InstanceType != "" { + objectMap["instanceType"] = imavpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return &imavpi, true +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imavpi, true +} + +// InMageAzureV2ProtectedDiskDetails inMageAzureV2 protected disk details. +type InMageAzureV2ProtectedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // HealthErrorCode - The health error code for the disk. + HealthErrorCode *string `json:"healthErrorCode,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncDurationInSeconds - The resync duration in seconds. + ResyncDurationInSeconds *int64 `json:"resyncDurationInSeconds,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // FileSystemCapacityInBytes - The disk file system capacity in bytes. + FileSystemCapacityInBytes *int64 `json:"fileSystemCapacityInBytes,omitempty"` + // SourceDataInMegaBytes - The source data transit in MB. + SourceDataInMegaBytes *float64 `json:"sourceDataInMegaBytes,omitempty"` + // PsDataInMegaBytes - The PS data transit in MB. + PsDataInMegaBytes *float64 `json:"psDataInMegaBytes,omitempty"` + // TargetDataInMegaBytes - The target data transit in MB. + TargetDataInMegaBytes *float64 `json:"targetDataInMegaBytes,omitempty"` + // DiskResized - A value indicating whether disk is resized. + DiskResized *string `json:"diskResized,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // ResyncProcessedBytes - The resync processed bytes. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTotalTransferredBytes - The resync total transferred bytes. + ResyncTotalTransferredBytes *int64 `json:"resyncTotalTransferredBytes,omitempty"` + // ResyncLast15MinutesTransferredBytes - The resync last 15 minutes transferred bytes. + ResyncLast15MinutesTransferredBytes *int64 `json:"resyncLast15MinutesTransferredBytes,omitempty"` + // ResyncLastDataTransferTimeUTC - The last data transfer time in UTC. + ResyncLastDataTransferTimeUTC *date.Time `json:"resyncLastDataTransferTimeUTC,omitempty"` + // ResyncStartTime - The resync start time. + ResyncStartTime *date.Time `json:"resyncStartTime,omitempty"` + // ProgressHealth - The Progress Health. + ProgressHealth *string `json:"progressHealth,omitempty"` + // ProgressStatus - The Progress Status. + ProgressStatus *string `json:"progressStatus,omitempty"` + // SecondsToTakeSwitchProvider - The seconds to take for switch provider. + SecondsToTakeSwitchProvider *int64 `json:"secondsToTakeSwitchProvider,omitempty"` +} + +// InMageAzureV2RecoveryPointDetails inMage Azure V2 provider specific recovery point details. +type InMageAzureV2RecoveryPointDetails struct { + // IsMultiVMSyncPoint - A value indicating whether the recovery point is multi VM consistent. + IsMultiVMSyncPoint *string `json:"isMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) MarshalJSON() ([]byte, error) { + imavrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavrpd.IsMultiVMSyncPoint != nil { + objectMap["isMultiVmSyncPoint"] = imavrpd.IsMultiVMSyncPoint + } + if imavrpd.InstanceType != "" { + objectMap["instanceType"] = imavrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return &imavrpd, true +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &imavrpd, true +} + +// InMageAzureV2ReplicationDetails inMageAzureV2 provider specific settings. +type InMageAzureV2ReplicationDetails struct { + // InfrastructureVMID - The infrastructure VM Id. + InfrastructureVMID *string `json:"infrastructureVmId,omitempty"` + // VCenterInfrastructureID - The vCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // CompressedDataRateInMB - The compressed data change rate in MB. + CompressedDataRateInMB *float64 `json:"compressedDataRateInMB,omitempty"` + // UncompressedDataRateInMB - The uncompressed data change rate in MB. + UncompressedDataRateInMB *float64 `json:"uncompressedDataRateInMB,omitempty"` + // IPAddress - The source IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // IsAgentUpdateRequired - A value indicating whether installed agent needs to be updated. + IsAgentUpdateRequired *string `json:"isAgentUpdateRequired,omitempty"` + // IsRebootAfterUpdateRequired - A value indicating whether the source server requires a restart after update. + IsRebootAfterUpdateRequired *string `json:"isRebootAfterUpdateRequired,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // ProcessServerName - The process server name. + ProcessServerName *string `json:"processServerName,omitempty"` + // MultiVMGroupID - The multi vm group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi vm sync is enabled or disabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageAzureV2ProtectedDiskDetails `json:"protectedDisks,omitempty"` + // DiskResized - A value indicating whether any disk is resized for this VM. + DiskResized *string `json:"diskResized,omitempty"` + // MasterTargetID - The master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // OsType - The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // VhdName - The OS disk VHD name. + VhdName *string `json:"vhdName,omitempty"` + // OsDiskID - The id of the disk containing the OS. + OsDiskID *string `json:"osDiskId,omitempty"` + // AzureVMDiskDetails - Azure VM Disk details. + AzureVMDiskDetails *[]AzureVMDiskDetails `json:"azureVMDiskDetails,omitempty"` + // RecoveryAzureVMName - Recovery Azure given name. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureVMSize - The Recovery Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureStorageAccount - The recovery Azure storage account. + RecoveryAzureStorageAccount *string `json:"recoveryAzureStorageAccount,omitempty"` + // RecoveryAzureLogStorageAccountID - The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. + RecoveryAzureLogStorageAccountID *string `json:"recoveryAzureLogStorageAccountId,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // SelectedRecoveryAzureNetworkID - The selected recovery azure network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The test failover virtual network. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. Value can be vCenter or physical. + DiscoveryType *string `json:"discoveryType,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // Datastores - The datastores of the on-premise machine. Value can be list of strings that contain datastore names. + Datastores *[]string `json:"datastores,omitempty"` + // TargetVMID - The ARM Id of the target Azure VM. This value will be null until the VM is failed over. Only after failure it will be populated with the ARM Id of the Azure VM. + TargetVMID *string `json:"targetVmId,omitempty"` + // RecoveryAzureResourceGroupID - The target resource group Id. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // ValidationErrors - The validation errors of the on-premise machine Value can be list of validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastUpdateReceivedTime - The last update time received from on-prem components. + LastUpdateReceivedTime *date.Time `json:"lastUpdateReceivedTime,omitempty"` + // ReplicaID - The replica id of the protected item. + ReplicaID *string `json:"replicaId,omitempty"` + // OsVersion - The OS Version of the protected item. + OsVersion *string `json:"osVersion,omitempty"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]InMageAzureV2ManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // FirmwareType - The firmware type of this protected item. + FirmwareType *string `json:"firmwareType,omitempty"` + // AzureVMGeneration - The target generation for this protected item. + AzureVMGeneration *string `json:"azureVmGeneration,omitempty"` + // IsAdditionalStatsAvailable - A value indicating whether additional IR stats are available or not. + IsAdditionalStatsAvailable *bool `json:"isAdditionalStatsAvailable,omitempty"` + // TotalDataTransferred - The total transferred data in bytes. + TotalDataTransferred *int64 `json:"totalDataTransferred,omitempty"` + // TotalProgressHealth - The progress health. + TotalProgressHealth *string `json:"totalProgressHealth,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // SwitchProviderBlockingErrorDetails - The switch provider blocking error information. + SwitchProviderBlockingErrorDetails *[]InMageAzureV2SwitchProviderBlockingErrorDetails `json:"switchProviderBlockingErrorDetails,omitempty"` + // SwitchProviderDetails - The switch provider blocking error information. + SwitchProviderDetails *InMageAzureV2SwitchProviderDetails `json:"switchProviderDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) MarshalJSON() ([]byte, error) { + imavrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavrd.InfrastructureVMID != nil { + objectMap["infrastructureVmId"] = imavrd.InfrastructureVMID + } + if imavrd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = imavrd.VCenterInfrastructureID + } + if imavrd.ProtectionStage != nil { + objectMap["protectionStage"] = imavrd.ProtectionStage + } + if imavrd.VMID != nil { + objectMap["vmId"] = imavrd.VMID + } + if imavrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = imavrd.VMProtectionState + } + if imavrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = imavrd.VMProtectionStateDescription + } + if imavrd.ResyncProgressPercentage != nil { + objectMap["resyncProgressPercentage"] = imavrd.ResyncProgressPercentage + } + if imavrd.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = imavrd.RpoInSeconds + } + if imavrd.CompressedDataRateInMB != nil { + objectMap["compressedDataRateInMB"] = imavrd.CompressedDataRateInMB + } + if imavrd.UncompressedDataRateInMB != nil { + objectMap["uncompressedDataRateInMB"] = imavrd.UncompressedDataRateInMB + } + if imavrd.IPAddress != nil { + objectMap["ipAddress"] = imavrd.IPAddress + } + if imavrd.AgentVersion != nil { + objectMap["agentVersion"] = imavrd.AgentVersion + } + if imavrd.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = imavrd.AgentExpiryDate + } + if imavrd.IsAgentUpdateRequired != nil { + objectMap["isAgentUpdateRequired"] = imavrd.IsAgentUpdateRequired + } + if imavrd.IsRebootAfterUpdateRequired != nil { + objectMap["isRebootAfterUpdateRequired"] = imavrd.IsRebootAfterUpdateRequired + } + if imavrd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = imavrd.LastHeartbeat + } + if imavrd.ProcessServerID != nil { + objectMap["processServerId"] = imavrd.ProcessServerID + } + if imavrd.ProcessServerName != nil { + objectMap["processServerName"] = imavrd.ProcessServerName + } + if imavrd.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imavrd.MultiVMGroupID + } + if imavrd.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imavrd.MultiVMGroupName + } + if imavrd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imavrd.MultiVMSyncStatus + } + if imavrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imavrd.ProtectedDisks + } + if imavrd.DiskResized != nil { + objectMap["diskResized"] = imavrd.DiskResized + } + if imavrd.MasterTargetID != nil { + objectMap["masterTargetId"] = imavrd.MasterTargetID + } + if imavrd.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = imavrd.SourceVMCPUCount + } + if imavrd.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = imavrd.SourceVMRAMSizeInMB + } + if imavrd.OsType != nil { + objectMap["osType"] = imavrd.OsType + } + if imavrd.VhdName != nil { + objectMap["vhdName"] = imavrd.VhdName + } + if imavrd.OsDiskID != nil { + objectMap["osDiskId"] = imavrd.OsDiskID + } + if imavrd.AzureVMDiskDetails != nil { + objectMap["azureVMDiskDetails"] = imavrd.AzureVMDiskDetails + } + if imavrd.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVMName"] = imavrd.RecoveryAzureVMName + } + if imavrd.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = imavrd.RecoveryAzureVMSize + } + if imavrd.RecoveryAzureStorageAccount != nil { + objectMap["recoveryAzureStorageAccount"] = imavrd.RecoveryAzureStorageAccount + } + if imavrd.RecoveryAzureLogStorageAccountID != nil { + objectMap["recoveryAzureLogStorageAccountId"] = imavrd.RecoveryAzureLogStorageAccountID + } + if imavrd.VMNics != nil { + objectMap["vmNics"] = imavrd.VMNics + } + if imavrd.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = imavrd.SelectedRecoveryAzureNetworkID + } + if imavrd.SelectedTfoAzureNetworkID != nil { + objectMap["selectedTfoAzureNetworkId"] = imavrd.SelectedTfoAzureNetworkID + } + if imavrd.SelectedSourceNicID != nil { + objectMap["selectedSourceNicId"] = imavrd.SelectedSourceNicID + } + if imavrd.DiscoveryType != nil { + objectMap["discoveryType"] = imavrd.DiscoveryType + } + if imavrd.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = imavrd.EnableRdpOnTargetOption + } + if imavrd.Datastores != nil { + objectMap["datastores"] = imavrd.Datastores + } + if imavrd.TargetVMID != nil { + objectMap["targetVmId"] = imavrd.TargetVMID + } + if imavrd.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = imavrd.RecoveryAzureResourceGroupID + } + if imavrd.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = imavrd.RecoveryAvailabilitySetID + } + if imavrd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavrd.TargetAvailabilityZone + } + if imavrd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavrd.TargetProximityPlacementGroupID + } + if imavrd.UseManagedDisks != nil { + objectMap["useManagedDisks"] = imavrd.UseManagedDisks + } + if imavrd.LicenseType != nil { + objectMap["licenseType"] = imavrd.LicenseType + } + if imavrd.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = imavrd.SQLServerLicenseType + } + if imavrd.ValidationErrors != nil { + objectMap["validationErrors"] = imavrd.ValidationErrors + } + if imavrd.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = imavrd.LastRpoCalculatedTime + } + if imavrd.LastUpdateReceivedTime != nil { + objectMap["lastUpdateReceivedTime"] = imavrd.LastUpdateReceivedTime + } + if imavrd.ReplicaID != nil { + objectMap["replicaId"] = imavrd.ReplicaID + } + if imavrd.OsVersion != nil { + objectMap["osVersion"] = imavrd.OsVersion + } + if imavrd.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = imavrd.ProtectedManagedDisks + } + if imavrd.FirmwareType != nil { + objectMap["firmwareType"] = imavrd.FirmwareType + } + if imavrd.AzureVMGeneration != nil { + objectMap["azureVmGeneration"] = imavrd.AzureVMGeneration + } + if imavrd.IsAdditionalStatsAvailable != nil { + objectMap["isAdditionalStatsAvailable"] = imavrd.IsAdditionalStatsAvailable + } + if imavrd.TotalDataTransferred != nil { + objectMap["totalDataTransferred"] = imavrd.TotalDataTransferred + } + if imavrd.TotalProgressHealth != nil { + objectMap["totalProgressHealth"] = imavrd.TotalProgressHealth + } + if imavrd.TargetVMTags != nil { + objectMap["targetVmTags"] = imavrd.TargetVMTags + } + if imavrd.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = imavrd.SeedManagedDiskTags + } + if imavrd.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavrd.TargetManagedDiskTags + } + if imavrd.TargetNicTags != nil { + objectMap["targetNicTags"] = imavrd.TargetNicTags + } + if imavrd.SwitchProviderBlockingErrorDetails != nil { + objectMap["switchProviderBlockingErrorDetails"] = imavrd.SwitchProviderBlockingErrorDetails + } + if imavrd.SwitchProviderDetails != nil { + objectMap["switchProviderDetails"] = imavrd.SwitchProviderDetails + } + if imavrd.InstanceType != "" { + objectMap["instanceType"] = imavrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return &imavrd, true +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imavrd, true +} + +// InMageAzureV2ReprotectInput inMageAzureV2 specific provider input. +type InMageAzureV2ReprotectInput struct { + // MasterTargetID - The Master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // StorageAccountID - The storage account id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) MarshalJSON() ([]byte, error) { + imavri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavri.MasterTargetID != nil { + objectMap["masterTargetId"] = imavri.MasterTargetID + } + if imavri.ProcessServerID != nil { + objectMap["processServerId"] = imavri.ProcessServerID + } + if imavri.StorageAccountID != nil { + objectMap["storageAccountId"] = imavri.StorageAccountID + } + if imavri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imavri.RunAsAccountID + } + if imavri.PolicyID != nil { + objectMap["policyId"] = imavri.PolicyID + } + if imavri.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imavri.LogStorageAccountID + } + if imavri.DisksToInclude != nil { + objectMap["disksToInclude"] = imavri.DisksToInclude + } + if imavri.InstanceType != "" { + objectMap["instanceType"] = imavri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return &imavri, true +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imavri, true +} + +// InMageAzureV2SwitchProviderBlockingErrorDetails inMageAzureV2 switch provider blocking error details. +type InMageAzureV2SwitchProviderBlockingErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2SwitchProviderBlockingErrorDetails. +func (imavspbed InMageAzureV2SwitchProviderBlockingErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageAzureV2SwitchProviderDetails inMageAzureV2 switch provider details. +type InMageAzureV2SwitchProviderDetails struct { + // TargetVaultID - READ-ONLY; The target vault Id. + TargetVaultID *string `json:"targetVaultId,omitempty"` + // TargetResourceID - READ-ONLY; The target resource Id. + TargetResourceID *string `json:"targetResourceId,omitempty"` + // TargetFabricID - READ-ONLY; The target fabric Id. + TargetFabricID *string `json:"targetFabricId,omitempty"` + // TargetApplianceID - READ-ONLY; The target appliance Id. + TargetApplianceID *string `json:"targetApplianceId,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2SwitchProviderDetails. +func (imavspd InMageAzureV2SwitchProviderDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageAzureV2SwitchProviderProviderInput provider specific input for InMageAzureV2 switch provider. +type InMageAzureV2SwitchProviderProviderInput struct { + // TargetVaultID - The target vault Id. + TargetVaultID *string `json:"targetVaultID,omitempty"` + // TargetFabricID - The target fabric Id. + TargetFabricID *string `json:"targetFabricID,omitempty"` + // TargetApplianceID - The target appliance Id. + TargetApplianceID *string `json:"targetApplianceID,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeSwitchProviderProviderSpecificInput', 'InstanceTypeInMageAzureV2' + InstanceType InstanceTypeBasicSwitchProviderProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2SwitchProviderProviderInput. +func (imavsppi InMageAzureV2SwitchProviderProviderInput) MarshalJSON() ([]byte, error) { + imavsppi.InstanceType = InstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavsppi.TargetVaultID != nil { + objectMap["targetVaultID"] = imavsppi.TargetVaultID + } + if imavsppi.TargetFabricID != nil { + objectMap["targetFabricID"] = imavsppi.TargetFabricID + } + if imavsppi.TargetApplianceID != nil { + objectMap["targetApplianceID"] = imavsppi.TargetApplianceID + } + if imavsppi.InstanceType != "" { + objectMap["instanceType"] = imavsppi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageAzureV2SwitchProviderProviderInput is the BasicSwitchProviderProviderSpecificInput implementation for InMageAzureV2SwitchProviderProviderInput. +func (imavsppi InMageAzureV2SwitchProviderProviderInput) AsInMageAzureV2SwitchProviderProviderInput() (*InMageAzureV2SwitchProviderProviderInput, bool) { + return &imavsppi, true +} + +// AsSwitchProviderProviderSpecificInput is the BasicSwitchProviderProviderSpecificInput implementation for InMageAzureV2SwitchProviderProviderInput. +func (imavsppi InMageAzureV2SwitchProviderProviderInput) AsSwitchProviderProviderSpecificInput() (*SwitchProviderProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicSwitchProviderProviderSpecificInput is the BasicSwitchProviderProviderSpecificInput implementation for InMageAzureV2SwitchProviderProviderInput. +func (imavsppi InMageAzureV2SwitchProviderProviderInput) AsBasicSwitchProviderProviderSpecificInput() (BasicSwitchProviderProviderSpecificInput, bool) { + return &imavsppi, true +} + +// InMageAzureV2TestFailoverInput inMageAzureV2 provider specific input for test failover. +type InMageAzureV2TestFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) MarshalJSON() ([]byte, error) { + imavtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imavtfi.RecoveryPointID + } + if imavtfi.InstanceType != "" { + objectMap["instanceType"] = imavtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return &imavtfi, true +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imavtfi, true +} + +// InMageAzureV2UnplannedFailoverInput inMageAzureV2 provider specific input for unplanned failover. +type InMageAzureV2UnplannedFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imavufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imavufi.RecoveryPointID + } + if imavufi.InstanceType != "" { + objectMap["instanceType"] = imavufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return &imavufi, true +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imavufi, true +} + +// InMageAzureV2UpdateReplicationProtectedItemInput inMage Azure V2 input to update replication protected +// item. +type InMageAzureV2UpdateReplicationProtectedItemInput struct { + // RecoveryAzureV1ResourceGroupID - The recovery Azure resource group Id for classic deployment. + RecoveryAzureV1ResourceGroupID *string `json:"recoveryAzureV1ResourceGroupId,omitempty"` + // RecoveryAzureV2ResourceGroupID - The recovery Azure resource group Id for resource manager deployment. + RecoveryAzureV2ResourceGroupID *string `json:"recoveryAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // VMDisks - The list of disk update properties. + VMDisks *[]UpdateDiskInput `json:"vmDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imavurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavurpii.RecoveryAzureV1ResourceGroupID != nil { + objectMap["recoveryAzureV1ResourceGroupId"] = imavurpii.RecoveryAzureV1ResourceGroupID + } + if imavurpii.RecoveryAzureV2ResourceGroupID != nil { + objectMap["recoveryAzureV2ResourceGroupId"] = imavurpii.RecoveryAzureV2ResourceGroupID + } + if imavurpii.UseManagedDisks != nil { + objectMap["useManagedDisks"] = imavurpii.UseManagedDisks + } + if imavurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavurpii.TargetProximityPlacementGroupID + } + if imavurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavurpii.TargetAvailabilityZone + } + if imavurpii.TargetVMTags != nil { + objectMap["targetVmTags"] = imavurpii.TargetVMTags + } + if imavurpii.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavurpii.TargetManagedDiskTags + } + if imavurpii.TargetNicTags != nil { + objectMap["targetNicTags"] = imavurpii.TargetNicTags + } + if imavurpii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = imavurpii.SQLServerLicenseType + } + if imavurpii.VMDisks != nil { + objectMap["vmDisks"] = imavurpii.VMDisks + } + if imavurpii.InstanceType != "" { + objectMap["instanceType"] = imavurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return &imavurpii, true +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &imavurpii, true +} + +// InMageBasePolicyDetails base class for the policies of providers using InMage replication. +type InMageBasePolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) MarshalJSON() ([]byte, error) { + imbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails + objectMap := make(map[string]interface{}) + if imbpd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imbpd.RecoveryPointThresholdInMinutes + } + if imbpd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imbpd.RecoveryPointHistory + } + if imbpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imbpd.AppConsistentFrequencyInMinutes + } + if imbpd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imbpd.MultiVMSyncStatus + } + if imbpd.InstanceType != "" { + objectMap["instanceType"] = imbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return &imbpd, true +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imbpd, true +} + +// InMageDisableProtectionProviderSpecificInput inMage disable protection provider specific input. +type InMageDisableProtectionProviderSpecificInput struct { + // ReplicaVMDeletionStatus - A value indicating whether the replica VM should be destroyed or retained. Values from Delete and Retain. + ReplicaVMDeletionStatus *string `json:"replicaVmDeletionStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeDisableProtectionProviderSpecificInput', 'InstanceTypeInMage' + InstanceType InstanceTypeBasicDisableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + imdppsi.InstanceType = InstanceTypeInMage + objectMap := make(map[string]interface{}) + if imdppsi.ReplicaVMDeletionStatus != nil { + objectMap["replicaVmDeletionStatus"] = imdppsi.ReplicaVMDeletionStatus + } + if imdppsi.InstanceType != "" { + objectMap["instanceType"] = imdppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) { + return &imdppsi, true +} + +// AsDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsBasicDisableProtectionProviderSpecificInput() (BasicDisableProtectionProviderSpecificInput, bool) { + return &imdppsi, true +} + +// InMageDiskDetails vMware/Physical specific Disk Details. +type InMageDiskDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskSizeInMB - The disk size in MB. + DiskSizeInMB *string `json:"diskSizeInMB,omitempty"` + // DiskType - Whether disk is system disk or data disk. + DiskType *string `json:"diskType,omitempty"` + // DiskConfiguration - Whether disk is dynamic disk or basic disk. + DiskConfiguration *string `json:"diskConfiguration,omitempty"` + // VolumeList - Volumes of the disk. + VolumeList *[]DiskVolumeDetails `json:"volumeList,omitempty"` +} + +// InMageDiskExclusionInput diskExclusionInput when doing enable protection of virtual machine in InMage +// provider. +type InMageDiskExclusionInput struct { + // VolumeOptions - The volume label based option for disk exclusion. + VolumeOptions *[]InMageVolumeExclusionOptions `json:"volumeOptions,omitempty"` + // DiskSignatureOptions - The guest disk signature based option for disk exclusion. + DiskSignatureOptions *[]InMageDiskSignatureExclusionOptions `json:"diskSignatureOptions,omitempty"` +} + +// InMageDiskSignatureExclusionOptions guest disk signature based disk exclusion option when doing enable +// protection of virtual machine in InMage provider. +type InMageDiskSignatureExclusionOptions struct { + // DiskSignature - The guest signature of disk to be excluded from replication. + DiskSignature *string `json:"diskSignature,omitempty"` +} + +// InMageEnableProtectionInput vMware Azure specific enable protection input. +type InMageEnableProtectionInput struct { + // VMFriendlyName - The VM Name. + VMFriendlyName *string `json:"vmFriendlyName,omitempty"` + // MasterTargetID - The Master Target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RetentionDrive - The retention drive to use on the MT. + RetentionDrive *string `json:"retentionDrive,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // MultiVMGroupID - The multi VM group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // DiskExclusionInput - The enable disk exclusion input. + DiskExclusionInput *InMageDiskExclusionInput `json:"diskExclusionInput,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) MarshalJSON() ([]byte, error) { + imepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imepi.VMFriendlyName != nil { + objectMap["vmFriendlyName"] = imepi.VMFriendlyName + } + if imepi.MasterTargetID != nil { + objectMap["masterTargetId"] = imepi.MasterTargetID + } + if imepi.ProcessServerID != nil { + objectMap["processServerId"] = imepi.ProcessServerID + } + if imepi.RetentionDrive != nil { + objectMap["retentionDrive"] = imepi.RetentionDrive + } + if imepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imepi.RunAsAccountID + } + if imepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imepi.MultiVMGroupID + } + if imepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imepi.MultiVMGroupName + } + if imepi.DatastoreName != nil { + objectMap["datastoreName"] = imepi.DatastoreName + } + if imepi.DiskExclusionInput != nil { + objectMap["diskExclusionInput"] = imepi.DiskExclusionInput + } + if imepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imepi.DisksToInclude + } + if imepi.InstanceType != "" { + objectMap["instanceType"] = imepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return &imepi, true +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imepi, true +} + +// InMageFabricSwitchProviderBlockingErrorDetails inMageFabric switch provider blocking error details. +type InMageFabricSwitchProviderBlockingErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageFabricSwitchProviderBlockingErrorDetails. +func (imfspbed InMageFabricSwitchProviderBlockingErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMagePolicyDetails inMage specific protection profile details. +type InMagePolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMagePolicyDetails. +func (impd InMagePolicyDetails) MarshalJSON() ([]byte, error) { + impd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage + objectMap := make(map[string]interface{}) + if impd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = impd.RecoveryPointThresholdInMinutes + } + if impd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = impd.RecoveryPointHistory + } + if impd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = impd.AppConsistentFrequencyInMinutes + } + if impd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = impd.MultiVMSyncStatus + } + if impd.InstanceType != "" { + objectMap["instanceType"] = impd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return &impd, true +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &impd, true +} + +// InMagePolicyInput vMWare Azure specific protection profile Input. +type InMagePolicyInput struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMagePolicyInput. +func (impi InMagePolicyInput) MarshalJSON() ([]byte, error) { + impi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if impi.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = impi.RecoveryPointThresholdInMinutes + } + if impi.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = impi.RecoveryPointHistory + } + if impi.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = impi.AppConsistentFrequencyInMinutes + } + if impi.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = impi.MultiVMSyncStatus + } + if impi.InstanceType != "" { + objectMap["instanceType"] = impi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return &impi, true +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &impi, true +} + +// InMageProtectedDiskDetails inMage protected disk details. +type InMageProtectedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // HealthErrorCode - The health error code for the disk. + HealthErrorCode *string `json:"healthErrorCode,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncDurationInSeconds - The resync duration in seconds. + ResyncDurationInSeconds *int64 `json:"resyncDurationInSeconds,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // FileSystemCapacityInBytes - The file system capacity in bytes. + FileSystemCapacityInBytes *int64 `json:"fileSystemCapacityInBytes,omitempty"` + // SourceDataInMB - The source data transit in MB. + SourceDataInMB *float64 `json:"sourceDataInMB,omitempty"` + // PsDataInMB - The PS data transit in MB. + PsDataInMB *float64 `json:"psDataInMB,omitempty"` + // TargetDataInMB - The target data transit in MB. + TargetDataInMB *float64 `json:"targetDataInMB,omitempty"` + // DiskResized - A value indicating whether disk is resized. + DiskResized *string `json:"diskResized,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // ResyncProcessedBytes - The resync processed bytes. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTotalTransferredBytes - The resync total transferred bytes. + ResyncTotalTransferredBytes *int64 `json:"resyncTotalTransferredBytes,omitempty"` + // ResyncLast15MinutesTransferredBytes - The resync last 15 minutes transferred bytes. + ResyncLast15MinutesTransferredBytes *int64 `json:"resyncLast15MinutesTransferredBytes,omitempty"` + // ResyncLastDataTransferTimeUTC - The last data transfer time in UTC. + ResyncLastDataTransferTimeUTC *date.Time `json:"resyncLastDataTransferTimeUTC,omitempty"` + // ResyncStartTime - The resync start time. + ResyncStartTime *date.Time `json:"resyncStartTime,omitempty"` + // ProgressHealth - The Progress Health. + ProgressHealth *string `json:"progressHealth,omitempty"` + // ProgressStatus - The Progress Status. + ProgressStatus *string `json:"progressStatus,omitempty"` +} + +// InMageRcmAgentUpgradeBlockingErrorDetails inMageRcm source agent upgrade blocking error details. +type InMageRcmAgentUpgradeBlockingErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageRcmAgentUpgradeBlockingErrorDetails. +func (imraubed InMageRcmAgentUpgradeBlockingErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmApplianceDetails inMageRcm appliance details. +type InMageRcmApplianceDetails struct { + // ID - READ-ONLY; The appliance Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The appliance name. + Name *string `json:"name,omitempty"` + // FabricArmID - READ-ONLY; The fabric ARM Id. + FabricArmID *string `json:"fabricArmId,omitempty"` + // ProcessServer - READ-ONLY; The process server. + ProcessServer *ProcessServerDetails `json:"processServer,omitempty"` + // RcmProxy - READ-ONLY; The of RCM proxy. + RcmProxy *RcmProxyDetails `json:"rcmProxy,omitempty"` + // PushInstaller - READ-ONLY; The push installer. + PushInstaller *PushInstallerDetails `json:"pushInstaller,omitempty"` + // ReplicationAgent - READ-ONLY; The replication agent. + ReplicationAgent *ReplicationAgentDetails `json:"replicationAgent,omitempty"` + // ReprotectAgent - READ-ONLY; The reprotect agent. + ReprotectAgent *ReprotectAgentDetails `json:"reprotectAgent,omitempty"` + // MarsAgent - READ-ONLY; The Mars agent. + MarsAgent *MarsAgentDetails `json:"marsAgent,omitempty"` + // Dra - READ-ONLY; The DRA. + Dra *DraDetails `json:"dra,omitempty"` + // SwitchProviderBlockingErrorDetails - READ-ONLY; The switch provider blocking error information. + SwitchProviderBlockingErrorDetails *[]InMageRcmFabricSwitchProviderBlockingErrorDetails `json:"switchProviderBlockingErrorDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmApplianceDetails. +func (imrad InMageRcmApplianceDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmApplianceSpecificDetails inMageRcm appliance specific details. +type InMageRcmApplianceSpecificDetails struct { + // Appliances - READ-ONLY; The list of appliances. + Appliances *[]InMageRcmApplianceDetails `json:"appliances,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeApplianceSpecificDetails', 'InstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplianceSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmApplianceSpecificDetails. +func (imrasd InMageRcmApplianceSpecificDetails) MarshalJSON() ([]byte, error) { + imrasd.InstanceType = InstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrasd.InstanceType != "" { + objectMap["instanceType"] = imrasd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageRcmApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for InMageRcmApplianceSpecificDetails. +func (imrasd InMageRcmApplianceSpecificDetails) AsInMageRcmApplianceSpecificDetails() (*InMageRcmApplianceSpecificDetails, bool) { + return &imrasd, true +} + +// AsApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for InMageRcmApplianceSpecificDetails. +func (imrasd InMageRcmApplianceSpecificDetails) AsApplianceSpecificDetails() (*ApplianceSpecificDetails, bool) { + return nil, false +} + +// AsBasicApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for InMageRcmApplianceSpecificDetails. +func (imrasd InMageRcmApplianceSpecificDetails) AsBasicApplianceSpecificDetails() (BasicApplianceSpecificDetails, bool) { + return &imrasd, true +} + +// InMageRcmApplyRecoveryPointInput applyRecoveryPoint input specific to InMageRcm provider. +type InMageRcmApplyRecoveryPointInput struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + imrarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrarpi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrarpi.RecoveryPointID + } + if imrarpi.InstanceType != "" { + objectMap["instanceType"] = imrarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return &imrarpi, true +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &imrarpi, true +} + +// InMageRcmDiscoveredProtectedVMDetails inMageRcm discovered protected VM details. +type InMageRcmDiscoveredProtectedVMDetails struct { + // VCenterID - READ-ONLY; The VCenter Id. + VCenterID *string `json:"vCenterId,omitempty"` + // VCenterFqdn - READ-ONLY; The VCenter fqdn. + VCenterFqdn *string `json:"vCenterFqdn,omitempty"` + // Datastores - READ-ONLY; The list of datastores. + Datastores *[]string `json:"datastores,omitempty"` + // IPAddresses - READ-ONLY; The list of IP addresses. + IPAddresses *[]string `json:"ipAddresses,omitempty"` + // VmwareToolsStatus - READ-ONLY; The VMware tools status. + VmwareToolsStatus *string `json:"vmwareToolsStatus,omitempty"` + // PowerStatus - READ-ONLY; The VM power status. + PowerStatus *string `json:"powerStatus,omitempty"` + // VMFqdn - READ-ONLY; The VM fqdn. + VMFqdn *string `json:"vmFqdn,omitempty"` + // OsName - READ-ONLY; The VM's OS name. + OsName *string `json:"osName,omitempty"` + // CreatedTimestamp - READ-ONLY; The SDS created timestamp. + CreatedTimestamp *date.Time `json:"createdTimestamp,omitempty"` + // UpdatedTimestamp - READ-ONLY; The SDS updated timestamp. + UpdatedTimestamp *date.Time `json:"updatedTimestamp,omitempty"` + // IsDeleted - READ-ONLY; A value indicating whether the VM is deleted. + IsDeleted *bool `json:"isDeleted,omitempty"` + // LastDiscoveryTimeInUtc - READ-ONLY; The last time when SDS information discovered in SRS. + LastDiscoveryTimeInUtc *date.Time `json:"lastDiscoveryTimeInUtc,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmDiscoveredProtectedVMDetails. +func (imrdpvd InMageRcmDiscoveredProtectedVMDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmDiskInput inMageRcm disk input. +type InMageRcmDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageRcmDisksDefaultInput inMageRcm disk input. +type InMageRcmDisksDefaultInput struct { + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageRcmEnableProtectionInput inMageRcm specific enable protection input. +type InMageRcmEnableProtectionInput struct { + // FabricDiscoveryMachineID - The ARM Id of discovered machine. + FabricDiscoveryMachineID *string `json:"fabricDiscoveryMachineId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]InMageRcmDiskInput `json:"disksToInclude,omitempty"` + // DisksDefault - The default disk input. + DisksDefault *InMageRcmDisksDefaultInput `json:"disksDefault,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetNetworkID - The selected target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The selected test network ARM Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // TargetSubnetName - The selected target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TestSubnetName - The selected test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // RunAsAccountID - The run-as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) MarshalJSON() ([]byte, error) { + imrepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrepi.FabricDiscoveryMachineID != nil { + objectMap["fabricDiscoveryMachineId"] = imrepi.FabricDiscoveryMachineID + } + if imrepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imrepi.DisksToInclude + } + if imrepi.DisksDefault != nil { + objectMap["disksDefault"] = imrepi.DisksDefault + } + if imrepi.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrepi.TargetResourceGroupID + } + if imrepi.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrepi.TargetNetworkID + } + if imrepi.TestNetworkID != nil { + objectMap["testNetworkId"] = imrepi.TestNetworkID + } + if imrepi.TargetSubnetName != nil { + objectMap["targetSubnetName"] = imrepi.TargetSubnetName + } + if imrepi.TestSubnetName != nil { + objectMap["testSubnetName"] = imrepi.TestSubnetName + } + if imrepi.TargetVMName != nil { + objectMap["targetVmName"] = imrepi.TargetVMName + } + if imrepi.TargetVMSize != nil { + objectMap["targetVmSize"] = imrepi.TargetVMSize + } + if imrepi.LicenseType != "" { + objectMap["licenseType"] = imrepi.LicenseType + } + if imrepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrepi.TargetAvailabilitySetID + } + if imrepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrepi.TargetAvailabilityZone + } + if imrepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrepi.TargetProximityPlacementGroupID + } + if imrepi.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrepi.TargetBootDiagnosticsStorageAccountID + } + if imrepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imrepi.RunAsAccountID + } + if imrepi.ProcessServerID != nil { + objectMap["processServerId"] = imrepi.ProcessServerID + } + if imrepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imrepi.MultiVMGroupName + } + if imrepi.InstanceType != "" { + objectMap["instanceType"] = imrepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return &imrepi, true +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imrepi, true +} + +// InMageRcmEventDetails event details for InMageRcm provider. +type InMageRcmEventDetails struct { + // ProtectedItemName - READ-ONLY; The protected item name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // VMName - READ-ONLY; The protected item name. + VMName *string `json:"vmName,omitempty"` + // LatestAgentVersion - READ-ONLY; The latest agent version. + LatestAgentVersion *string `json:"latestAgentVersion,omitempty"` + // JobID - READ-ONLY; The job Id. + JobID *string `json:"jobId,omitempty"` + // FabricName - READ-ONLY; The fabric name. + FabricName *string `json:"fabricName,omitempty"` + // ApplianceName - READ-ONLY; The appliance name. + ApplianceName *string `json:"applianceName,omitempty"` + // ServerType - READ-ONLY; The server type. + ServerType *string `json:"serverType,omitempty"` + // ComponentDisplayName - READ-ONLY; The component display name. + ComponentDisplayName *string `json:"componentDisplayName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) MarshalJSON() ([]byte, error) { + imred.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imred.InstanceType != "" { + objectMap["instanceType"] = imred.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return &imred, true +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imred, true +} + +// InMageRcmFabricCreationInput inMageRcm fabric provider specific settings. +type InMageRcmFabricCreationInput struct { + // VmwareSiteID - The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // SourceAgentIdentity - The identity provider input for source agent authentication. + SourceAgentIdentity *IdentityProviderInput `json:"sourceAgentIdentity,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) MarshalJSON() ([]byte, error) { + imrfci.InstanceType = InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrfci.VmwareSiteID != nil { + objectMap["vmwareSiteId"] = imrfci.VmwareSiteID + } + if imrfci.PhysicalSiteID != nil { + objectMap["physicalSiteId"] = imrfci.PhysicalSiteID + } + if imrfci.SourceAgentIdentity != nil { + objectMap["sourceAgentIdentity"] = imrfci.SourceAgentIdentity + } + if imrfci.InstanceType != "" { + objectMap["instanceType"] = imrfci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return &imrfci, true +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &imrfci, true +} + +// InMageRcmFabricSpecificDetails inMageRcm fabric specific details. +type InMageRcmFabricSpecificDetails struct { + // VmwareSiteID - READ-ONLY; The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - READ-ONLY; The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // ServiceEndpoint - READ-ONLY; The service endpoint. + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` + // ServiceResourceID - READ-ONLY; The service resource Id. + ServiceResourceID *string `json:"serviceResourceId,omitempty"` + // ServiceContainerID - READ-ONLY; The service container Id. + ServiceContainerID *string `json:"serviceContainerId,omitempty"` + // DataPlaneURI - READ-ONLY; The data plane Uri. + DataPlaneURI *string `json:"dataPlaneUri,omitempty"` + // ControlPlaneURI - READ-ONLY; The control plane Uri. + ControlPlaneURI *string `json:"controlPlaneUri,omitempty"` + // SourceAgentIdentityDetails - The source agent identity details. + SourceAgentIdentityDetails *IdentityProviderDetails `json:"sourceAgentIdentityDetails,omitempty"` + // ProcessServers - READ-ONLY; The list of process servers. + ProcessServers *[]ProcessServerDetails `json:"processServers,omitempty"` + // RcmProxies - READ-ONLY; The list of RCM proxies. + RcmProxies *[]RcmProxyDetails `json:"rcmProxies,omitempty"` + // PushInstallers - READ-ONLY; The list of push installers. + PushInstallers *[]PushInstallerDetails `json:"pushInstallers,omitempty"` + // ReplicationAgents - READ-ONLY; The list of replication agents. + ReplicationAgents *[]ReplicationAgentDetails `json:"replicationAgents,omitempty"` + // ReprotectAgents - READ-ONLY; The list of reprotect agents. + ReprotectAgents *[]ReprotectAgentDetails `json:"reprotectAgents,omitempty"` + // MarsAgents - READ-ONLY; The list of Mars agents. + MarsAgents *[]MarsAgentDetails `json:"marsAgents,omitempty"` + // Dras - READ-ONLY; The list of DRAs. + Dras *[]DraDetails `json:"dras,omitempty"` + // AgentDetails - READ-ONLY; The list of agent details. + AgentDetails *[]AgentDetails `json:"agentDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) MarshalJSON() ([]byte, error) { + imrfsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrfsd.SourceAgentIdentityDetails != nil { + objectMap["sourceAgentIdentityDetails"] = imrfsd.SourceAgentIdentityDetails + } + if imrfsd.InstanceType != "" { + objectMap["instanceType"] = imrfsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return &imrfsd, true +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &imrfsd, true +} + +// InMageRcmFabricSwitchProviderBlockingErrorDetails inMageRcmFabric switch provider blocking error +// details. +type InMageRcmFabricSwitchProviderBlockingErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFabricSwitchProviderBlockingErrorDetails. +func (imrfspbed InMageRcmFabricSwitchProviderBlockingErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackDiscoveredProtectedVMDetails inMageRcmFailback discovered VM details. +type InMageRcmFailbackDiscoveredProtectedVMDetails struct { + // VCenterID - READ-ONLY; The VCenter Id. + VCenterID *string `json:"vCenterId,omitempty"` + // VCenterFqdn - READ-ONLY; The VCenter fqdn. + VCenterFqdn *string `json:"vCenterFqdn,omitempty"` + // Datastores - READ-ONLY; The list of datastores. + Datastores *[]string `json:"datastores,omitempty"` + // IPAddresses - READ-ONLY; The list of IP addresses. + IPAddresses *[]string `json:"ipAddresses,omitempty"` + // VmwareToolsStatus - READ-ONLY; The VMware tools status. + VmwareToolsStatus *string `json:"vmwareToolsStatus,omitempty"` + // PowerStatus - READ-ONLY; The VM power status. + PowerStatus *string `json:"powerStatus,omitempty"` + // VMFqdn - READ-ONLY; The VM fqdn. + VMFqdn *string `json:"vmFqdn,omitempty"` + // OsName - READ-ONLY; The VM's OS name. + OsName *string `json:"osName,omitempty"` + // CreatedTimestamp - READ-ONLY; The SDS created timestamp. + CreatedTimestamp *date.Time `json:"createdTimestamp,omitempty"` + // UpdatedTimestamp - READ-ONLY; The SDS updated timestamp. + UpdatedTimestamp *date.Time `json:"updatedTimestamp,omitempty"` + // IsDeleted - READ-ONLY; A value indicating whether the VM is deleted. + IsDeleted *bool `json:"isDeleted,omitempty"` + // LastDiscoveryTimeInUtc - READ-ONLY; The last time when SDS information discovered in SRS. + LastDiscoveryTimeInUtc *date.Time `json:"lastDiscoveryTimeInUtc,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackDiscoveredProtectedVMDetails. +func (imrfdpvd InMageRcmFailbackDiscoveredProtectedVMDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackEventDetails event details for InMageRcmFailback provider. +type InMageRcmFailbackEventDetails struct { + // ProtectedItemName - READ-ONLY; The protected item name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // VMName - READ-ONLY; The protected item name. + VMName *string `json:"vmName,omitempty"` + // ApplianceName - READ-ONLY; The appliance name. + ApplianceName *string `json:"applianceName,omitempty"` + // ServerType - READ-ONLY; The server type. + ServerType *string `json:"serverType,omitempty"` + // ComponentDisplayName - READ-ONLY; The component display name. + ComponentDisplayName *string `json:"componentDisplayName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) MarshalJSON() ([]byte, error) { + imrfed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfed.InstanceType != "" { + objectMap["instanceType"] = imrfed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return &imrfed, true +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imrfed, true +} + +// InMageRcmFailbackMobilityAgentDetails inMageRcmFailback mobility agent details. +type InMageRcmFailbackMobilityAgentDetails struct { + // Version - READ-ONLY; The agent version. + Version *string `json:"version,omitempty"` + // LatestVersion - READ-ONLY; The latest agent version available. + LatestVersion *string `json:"latestVersion,omitempty"` + // DriverVersion - READ-ONLY; The driver version. + DriverVersion *string `json:"driverVersion,omitempty"` + // LatestUpgradableVersionWithoutReboot - READ-ONLY; The latest upgradeable version available without reboot. + LatestUpgradableVersionWithoutReboot *string `json:"latestUpgradableVersionWithoutReboot,omitempty"` + // AgentVersionExpiryDate - READ-ONLY; The agent version expiry date. + AgentVersionExpiryDate *date.Time `json:"agentVersionExpiryDate,omitempty"` + // DriverVersionExpiryDate - READ-ONLY; The driver version expiry date. + DriverVersionExpiryDate *date.Time `json:"driverVersionExpiryDate,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The time of the last heartbeat received from the agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // ReasonsBlockingUpgrade - READ-ONLY; The whether update is possible or not. + ReasonsBlockingUpgrade *[]AgentUpgradeBlockedReason `json:"reasonsBlockingUpgrade,omitempty"` + // IsUpgradeable - READ-ONLY; A value indicating whether agent is upgradeable or not. + IsUpgradeable *string `json:"isUpgradeable,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackMobilityAgentDetails. +func (imrfmad InMageRcmFailbackMobilityAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackNicDetails inMageRcmFailback NIC details. +type InMageRcmFailbackNicDetails struct { + // MacAddress - READ-ONLY; The mac address. + MacAddress *string `json:"macAddress,omitempty"` + // NetworkName - READ-ONLY; The network name. + NetworkName *string `json:"networkName,omitempty"` + // AdapterType - READ-ONLY; The adapter type. + AdapterType *string `json:"adapterType,omitempty"` + // SourceIPAddress - READ-ONLY; The IP address. + SourceIPAddress *string `json:"sourceIpAddress,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackNicDetails. +func (imrfnd InMageRcmFailbackNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackPlannedFailoverProviderInput provider specific input for InMageRcmFailback failover. +type InMageRcmFailbackPlannedFailoverProviderInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'ApplicationConsistent', 'CrashConsistent' + RecoveryPointType InMageRcmFailbackRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) MarshalJSON() ([]byte, error) { + imrfpfpi.InstanceType = InstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpfpi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imrfpfpi.RecoveryPointType + } + if imrfpfpi.InstanceType != "" { + objectMap["instanceType"] = imrfpfpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return &imrfpfpi, true +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &imrfpfpi, true +} + +// InMageRcmFailbackPolicyCreationInput inMageRcmFailback policy creation input. +type InMageRcmFailbackPolicyCreationInput struct { + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) MarshalJSON() ([]byte, error) { + imrfpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrfpci.CrashConsistentFrequencyInMinutes + } + if imrfpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrfpci.AppConsistentFrequencyInMinutes + } + if imrfpci.InstanceType != "" { + objectMap["instanceType"] = imrfpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return &imrfpci, true +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imrfpci, true +} + +// InMageRcmFailbackPolicyDetails inMageRcm failback specific policy details. +type InMageRcmFailbackPolicyDetails struct { + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) MarshalJSON() ([]byte, error) { + imrfpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrfpd.AppConsistentFrequencyInMinutes + } + if imrfpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrfpd.CrashConsistentFrequencyInMinutes + } + if imrfpd.InstanceType != "" { + objectMap["instanceType"] = imrfpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return &imrfpd, true +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imrfpd, true +} + +// InMageRcmFailbackProtectedDiskDetails inMageRcmFailback protected disk details. +type InMageRcmFailbackProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk Id (reported by source agent). + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // DiskUUID - READ-ONLY; The disk Uuid (reported by vCenter). + DiskUUID *string `json:"diskUuid,omitempty"` + // DataPendingInLogDataStoreInMB - READ-ONLY; The data pending in log data store in MB. + DataPendingInLogDataStoreInMB *float64 `json:"dataPendingInLogDataStoreInMB,omitempty"` + // DataPendingAtSourceAgentInMB - READ-ONLY; The data pending at source agent in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // IsInitialReplicationComplete - READ-ONLY; A value indicating whether initial replication is complete or not. + IsInitialReplicationComplete *string `json:"isInitialReplicationComplete,omitempty"` + // IrDetails - The initial replication details. + IrDetails *InMageRcmFailbackSyncDetails `json:"irDetails,omitempty"` + // ResyncDetails - The resync details. + ResyncDetails *InMageRcmFailbackSyncDetails `json:"resyncDetails,omitempty"` + // LastSyncTime - READ-ONLY; The last sync time. + LastSyncTime *date.Time `json:"lastSyncTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackProtectedDiskDetails. +func (imrfpdd InMageRcmFailbackProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrfpdd.IrDetails != nil { + objectMap["irDetails"] = imrfpdd.IrDetails + } + if imrfpdd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrfpdd.ResyncDetails + } + return json.Marshal(objectMap) +} + +// InMageRcmFailbackReplicationDetails inMageRcmFailback provider specific details. +type InMageRcmFailbackReplicationDetails struct { + // InternalIdentifier - READ-ONLY; The virtual machine internal identifier. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // AzureVirtualMachineID - READ-ONLY; The ARM Id of the azure VM. + AzureVirtualMachineID *string `json:"azureVirtualMachineId,omitempty"` + // MultiVMGroupName - READ-ONLY; The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // ReprotectAgentID - READ-ONLY; The reprotect agent Id. + ReprotectAgentID *string `json:"reprotectAgentId,omitempty"` + // ReprotectAgentName - READ-ONLY; The reprotect agent name. + ReprotectAgentName *string `json:"reprotectAgentName,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // TargetvCenterID - READ-ONLY; The target vCenter Id. + TargetvCenterID *string `json:"targetvCenterId,omitempty"` + // TargetDataStoreName - READ-ONLY; The target datastore name. + TargetDataStoreName *string `json:"targetDataStoreName,omitempty"` + // TargetVMName - READ-ONLY; The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // InitialReplicationProgressPercentage - READ-ONLY; The initial replication progress percentage. + InitialReplicationProgressPercentage *int32 `json:"initialReplicationProgressPercentage,omitempty"` + // InitialReplicationProcessedBytes - READ-ONLY; The initial replication processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + InitialReplicationProcessedBytes *int64 `json:"initialReplicationProcessedBytes,omitempty"` + // InitialReplicationTransferredBytes - READ-ONLY; The initial replication transferred bytes from source VM to target for all selected disks on source VM. + InitialReplicationTransferredBytes *int64 `json:"initialReplicationTransferredBytes,omitempty"` + // InitialReplicationProgressHealth - READ-ONLY; The initial replication progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + InitialReplicationProgressHealth VMReplicationProgressHealth `json:"initialReplicationProgressHealth,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncProcessedBytes - READ-ONLY; The resync processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTransferredBytes - READ-ONLY; The resync transferred bytes from source VM to target for all selected disks on source VM. + ResyncTransferredBytes *int64 `json:"resyncTransferredBytes,omitempty"` + // ResyncProgressHealth - READ-ONLY; The resync progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + ResyncProgressHealth VMReplicationProgressHealth `json:"resyncProgressHealth,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageRcmFailbackProtectedDiskDetails `json:"protectedDisks,omitempty"` + // MobilityAgentDetails - The mobility agent information. + MobilityAgentDetails *InMageRcmFailbackMobilityAgentDetails `json:"mobilityAgentDetails,omitempty"` + // VMNics - The network details. + VMNics *[]InMageRcmFailbackNicDetails `json:"vmNics,omitempty"` + // LastPlannedFailoverStartTime - READ-ONLY; The last planned failover start time. + LastPlannedFailoverStartTime *date.Time `json:"lastPlannedFailoverStartTime,omitempty"` + // LastPlannedFailoverStatus - READ-ONLY; The last planned failover status. Possible values include: 'PlannedFailoverStatusSucceeded', 'PlannedFailoverStatusFailed', 'PlannedFailoverStatusCancelled', 'PlannedFailoverStatusUnknown' + LastPlannedFailoverStatus PlannedFailoverStatus `json:"lastPlannedFailoverStatus,omitempty"` + // DiscoveredVMDetails - The discovered VM information. + DiscoveredVMDetails *InMageRcmFailbackDiscoveredProtectedVMDetails `json:"discoveredVmDetails,omitempty"` + // LastUsedPolicyID - READ-ONLY; The policy Id used by the forward replication. + LastUsedPolicyID *string `json:"lastUsedPolicyId,omitempty"` + // LastUsedPolicyFriendlyName - READ-ONLY; The policy friendly name used by the forward replication. + LastUsedPolicyFriendlyName *string `json:"lastUsedPolicyFriendlyName,omitempty"` + // IsAgentRegistrationSuccessfulAfterFailover - READ-ONLY; A value indicating whether agent registration was successful after failover. + IsAgentRegistrationSuccessfulAfterFailover *bool `json:"isAgentRegistrationSuccessfulAfterFailover,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) MarshalJSON() ([]byte, error) { + imrfrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrfrd.ProtectedDisks + } + if imrfrd.MobilityAgentDetails != nil { + objectMap["mobilityAgentDetails"] = imrfrd.MobilityAgentDetails + } + if imrfrd.VMNics != nil { + objectMap["vmNics"] = imrfrd.VMNics + } + if imrfrd.DiscoveredVMDetails != nil { + objectMap["discoveredVmDetails"] = imrfrd.DiscoveredVMDetails + } + if imrfrd.InstanceType != "" { + objectMap["instanceType"] = imrfrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return &imrfrd, true +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrfrd, true +} + +// InMageRcmFailbackReprotectInput inMageRcmFailback specific provider input. +type InMageRcmFailbackReprotectInput struct { + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RunAsAccountID - The run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) MarshalJSON() ([]byte, error) { + imrfri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfri.ProcessServerID != nil { + objectMap["processServerId"] = imrfri.ProcessServerID + } + if imrfri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imrfri.RunAsAccountID + } + if imrfri.PolicyID != nil { + objectMap["policyId"] = imrfri.PolicyID + } + if imrfri.InstanceType != "" { + objectMap["instanceType"] = imrfri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return &imrfri, true +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imrfri, true +} + +// InMageRcmFailbackSyncDetails inMageRcmFailback disk level sync details. +type InMageRcmFailbackSyncDetails struct { + // ProgressHealth - READ-ONLY; The progress health. Possible values include: 'None', 'InProgress', 'SlowProgress', 'NoProgress', 'Queued' + ProgressHealth DiskReplicationProgressHealth `json:"progressHealth,omitempty"` + // TransferredBytes - READ-ONLY; The transferred bytes from source VM to azure for the disk. + TransferredBytes *int64 `json:"transferredBytes,omitempty"` + // Last15MinutesTransferredBytes - READ-ONLY; The bytes transferred in last 15 minutes from source VM to target. + Last15MinutesTransferredBytes *int64 `json:"last15MinutesTransferredBytes,omitempty"` + // LastDataTransferTimeUtc - READ-ONLY; The time of the last data transfer from source VM to target. + LastDataTransferTimeUtc *string `json:"lastDataTransferTimeUtc,omitempty"` + // ProcessedBytes - READ-ONLY; The total processed bytes. This includes bytes that are transferred from source VM to target and matched bytes. + ProcessedBytes *int64 `json:"processedBytes,omitempty"` + // StartTime - READ-ONLY; The start time. + StartTime *string `json:"startTime,omitempty"` + // LastRefreshTime - READ-ONLY; The last refresh time. + LastRefreshTime *string `json:"lastRefreshTime,omitempty"` + // ProgressPercentage - READ-ONLY; Progress in percentage. Progress percentage is calculated based on processed bytes. + ProgressPercentage *int32 `json:"progressPercentage,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackSyncDetails. +func (imrfsd InMageRcmFailbackSyncDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmLastAgentUpgradeErrorDetails inMageRcm last source agent upgrade error details. +type InMageRcmLastAgentUpgradeErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageRcmLastAgentUpgradeErrorDetails. +func (imrlaued InMageRcmLastAgentUpgradeErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmMobilityAgentDetails inMageRcm mobility agent details. +type InMageRcmMobilityAgentDetails struct { + // Version - READ-ONLY; The agent version. + Version *string `json:"version,omitempty"` + // LatestVersion - READ-ONLY; The latest agent version available. + LatestVersion *string `json:"latestVersion,omitempty"` + // LatestAgentReleaseDate - READ-ONLY; The latest agent version release date. + LatestAgentReleaseDate *string `json:"latestAgentReleaseDate,omitempty"` + // DriverVersion - READ-ONLY; The driver version. + DriverVersion *string `json:"driverVersion,omitempty"` + // LatestUpgradableVersionWithoutReboot - READ-ONLY; The latest upgradeable version available without reboot. + LatestUpgradableVersionWithoutReboot *string `json:"latestUpgradableVersionWithoutReboot,omitempty"` + // AgentVersionExpiryDate - READ-ONLY; The agent version expiry date. + AgentVersionExpiryDate *date.Time `json:"agentVersionExpiryDate,omitempty"` + // DriverVersionExpiryDate - READ-ONLY; The driver version expiry date. + DriverVersionExpiryDate *date.Time `json:"driverVersionExpiryDate,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The time of the last heartbeat received from the agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // ReasonsBlockingUpgrade - READ-ONLY; The whether update is possible or not. + ReasonsBlockingUpgrade *[]AgentUpgradeBlockedReason `json:"reasonsBlockingUpgrade,omitempty"` + // IsUpgradeable - READ-ONLY; A value indicating whether agent is upgradeable or not. + IsUpgradeable *string `json:"isUpgradeable,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmMobilityAgentDetails. +func (imrmad InMageRcmMobilityAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmNicDetails inMageRcm NIC details. +type InMageRcmNicDetails struct { + // NicID - READ-ONLY; The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // IsSelectedForFailover - A value indicating whether this NIC is selected for failover. + IsSelectedForFailover *string `json:"isSelectedForFailover,omitempty"` + // SourceIPAddress - READ-ONLY; The source IP address. + SourceIPAddress *string `json:"sourceIPAddress,omitempty"` + // SourceIPAddressType - READ-ONLY; The source IP address type. Possible values include: 'Dynamic', 'Static' + SourceIPAddressType EthernetAddressType `json:"sourceIPAddressType,omitempty"` + // SourceNetworkID - READ-ONLY; Source network Id. + SourceNetworkID *string `json:"sourceNetworkId,omitempty"` + // SourceSubnetName - READ-ONLY; Source subnet name. + SourceSubnetName *string `json:"sourceSubnetName,omitempty"` + // TargetIPAddress - The target IP address. + TargetIPAddress *string `json:"targetIPAddress,omitempty"` + // TargetIPAddressType - The target IP address type. Possible values include: 'Dynamic', 'Static' + TargetIPAddressType EthernetAddressType `json:"targetIPAddressType,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TestSubnetName - Test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TestIPAddress - The test IP address. + TestIPAddress *string `json:"testIPAddress,omitempty"` + // TestIPAddressType - The test IP address type. Possible values include: 'Dynamic', 'Static' + TestIPAddressType EthernetAddressType `json:"testIPAddressType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmNicDetails. +func (imrnd InMageRcmNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrnd.IsPrimaryNic != nil { + objectMap["isPrimaryNic"] = imrnd.IsPrimaryNic + } + if imrnd.IsSelectedForFailover != nil { + objectMap["isSelectedForFailover"] = imrnd.IsSelectedForFailover + } + if imrnd.TargetIPAddress != nil { + objectMap["targetIPAddress"] = imrnd.TargetIPAddress + } + if imrnd.TargetIPAddressType != "" { + objectMap["targetIPAddressType"] = imrnd.TargetIPAddressType + } + if imrnd.TargetSubnetName != nil { + objectMap["targetSubnetName"] = imrnd.TargetSubnetName + } + if imrnd.TestSubnetName != nil { + objectMap["testSubnetName"] = imrnd.TestSubnetName + } + if imrnd.TestIPAddress != nil { + objectMap["testIPAddress"] = imrnd.TestIPAddress + } + if imrnd.TestIPAddressType != "" { + objectMap["testIPAddressType"] = imrnd.TestIPAddressType + } + return json.Marshal(objectMap) +} + +// InMageRcmNicInput inMageRcm NIC input. +type InMageRcmNicInput struct { + // NicID - The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // IsSelectedForFailover - A value indicating whether this NIC is selected for failover. + IsSelectedForFailover *string `json:"isSelectedForFailover,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetStaticIPAddress - The target static IP address. + TargetStaticIPAddress *string `json:"targetStaticIPAddress,omitempty"` + // TestSubnetName - The test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TestStaticIPAddress - The test static IP address. + TestStaticIPAddress *string `json:"testStaticIPAddress,omitempty"` +} + +// InMageRcmPolicyCreationInput inMageRcm policy creation input. +type InMageRcmPolicyCreationInput struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // EnableMultiVMSync - A value indicating whether multi-VM sync has to be enabled. + EnableMultiVMSync *string `json:"enableMultiVmSync,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) MarshalJSON() ([]byte, error) { + imrpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpci.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = imrpci.RecoveryPointHistoryInMinutes + } + if imrpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrpci.CrashConsistentFrequencyInMinutes + } + if imrpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrpci.AppConsistentFrequencyInMinutes + } + if imrpci.EnableMultiVMSync != nil { + objectMap["enableMultiVmSync"] = imrpci.EnableMultiVMSync + } + if imrpci.InstanceType != "" { + objectMap["instanceType"] = imrpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return &imrpci, true +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imrpci, true +} + +// InMageRcmPolicyDetails inMageRcm specific policy details. +type InMageRcmPolicyDetails struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // EnableMultiVMSync - A value indicating whether multi-VM sync has to be enabled. + EnableMultiVMSync *string `json:"enableMultiVmSync,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) MarshalJSON() ([]byte, error) { + imrpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpd.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = imrpd.RecoveryPointHistoryInMinutes + } + if imrpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrpd.AppConsistentFrequencyInMinutes + } + if imrpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrpd.CrashConsistentFrequencyInMinutes + } + if imrpd.EnableMultiVMSync != nil { + objectMap["enableMultiVmSync"] = imrpd.EnableMultiVMSync + } + if imrpd.InstanceType != "" { + objectMap["instanceType"] = imrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return &imrpd, true +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imrpd, true +} + +// InMageRcmProtectedDiskDetails inMageRcm protected disk details. +type InMageRcmProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskEncryptionSetID - READ-ONLY; The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // SeedManagedDiskID - READ-ONLY; The ARM Id of the seed managed disk. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // TargetManagedDiskID - READ-ONLY; The ARM Id of the target managed disk. + TargetManagedDiskID *string `json:"targetManagedDiskId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DataPendingInLogDataStoreInMB - READ-ONLY; The data pending in log data store in MB. + DataPendingInLogDataStoreInMB *float64 `json:"dataPendingInLogDataStoreInMB,omitempty"` + // DataPendingAtSourceAgentInMB - READ-ONLY; The data pending at source agent in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // IsInitialReplicationComplete - READ-ONLY; A value indicating whether initial replication is complete or not. + IsInitialReplicationComplete *string `json:"isInitialReplicationComplete,omitempty"` + // IrDetails - The initial replication details. + IrDetails *InMageRcmSyncDetails `json:"irDetails,omitempty"` + // ResyncDetails - The resync details. + ResyncDetails *InMageRcmSyncDetails `json:"resyncDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmProtectedDiskDetails. +func (imrpdd InMageRcmProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrpdd.DiskType != "" { + objectMap["diskType"] = imrpdd.DiskType + } + if imrpdd.IrDetails != nil { + objectMap["irDetails"] = imrpdd.IrDetails + } + if imrpdd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrpdd.ResyncDetails + } + return json.Marshal(objectMap) +} + +// InMageRcmProtectionContainerMappingDetails inMageRcm provider specific container mapping details. +type InMageRcmProtectionContainerMappingDetails struct { + // EnableAgentAutoUpgrade - READ-ONLY; A value indicating whether the flag for enable agent auto upgrade. + EnableAgentAutoUpgrade *string `json:"enableAgentAutoUpgrade,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + imrpcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpcmd.InstanceType != "" { + objectMap["instanceType"] = imrpcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return &imrpcmd, true +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &imrpcmd, true +} + +// InMageRcmRecoveryPointDetails inMageRcm provider specific recovery point details. +type InMageRcmRecoveryPointDetails struct { + // IsMultiVMSyncPoint - READ-ONLY; A value indicating whether the recovery point is multi VM consistent. + IsMultiVMSyncPoint *string `json:"isMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) MarshalJSON() ([]byte, error) { + imrrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrrpd.InstanceType != "" { + objectMap["instanceType"] = imrrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return &imrrpd, true +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &imrrpd, true +} + +// InMageRcmReplicationDetails inMageRcm provider specific details. +type InMageRcmReplicationDetails struct { + // InternalIdentifier - READ-ONLY; The virtual machine internal identifier. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // FabricDiscoveryMachineID - READ-ONLY; The ARM Id of the discovered VM. + FabricDiscoveryMachineID *string `json:"fabricDiscoveryMachineId,omitempty"` + // MultiVMGroupName - READ-ONLY; The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DiscoveryType - READ-ONLY; The type of the discovered VM. + DiscoveryType *string `json:"discoveryType,omitempty"` + // ProcessServerID - READ-ONLY; The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // ProcessorCoreCount - READ-ONLY; The processor core count. + ProcessorCoreCount *int32 `json:"processorCoreCount,omitempty"` + // AllocatedMemoryInMB - READ-ONLY; The allocated memory in MB. + AllocatedMemoryInMB *float64 `json:"allocatedMemoryInMB,omitempty"` + // ProcessServerName - READ-ONLY; The process server name. + ProcessServerName *string `json:"processServerName,omitempty"` + // RunAsAccountID - READ-ONLY; The run-as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // FirmwareType - READ-ONLY; The firmware type. + FirmwareType *string `json:"firmwareType,omitempty"` + // PrimaryNicIPAddress - READ-ONLY; The IP address of the primary network interface. + PrimaryNicIPAddress *string `json:"primaryNicIpAddress,omitempty"` + // TargetGeneration - READ-ONLY; The target generation. + TargetGeneration *string `json:"targetGeneration,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // TargetVMName - Target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetLocation - The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // TargetAvailabilitySetID - The target availability set Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The test network Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // FailoverRecoveryPointID - READ-ONLY; The recovery point Id to which the VM was failed over. + FailoverRecoveryPointID *string `json:"failoverRecoveryPointId,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // LastRpoInSeconds - READ-ONLY; The last recovery point objective value. + LastRpoInSeconds *int64 `json:"lastRpoInSeconds,omitempty"` + // LastRpoCalculatedTime - READ-ONLY; The last recovery point objective calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastRecoveryPointID - READ-ONLY; The last recovery point Id. + LastRecoveryPointID *string `json:"lastRecoveryPointId,omitempty"` + // InitialReplicationProgressPercentage - READ-ONLY; The initial replication progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + InitialReplicationProgressPercentage *int32 `json:"initialReplicationProgressPercentage,omitempty"` + // InitialReplicationProcessedBytes - READ-ONLY; The initial replication processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + InitialReplicationProcessedBytes *int64 `json:"initialReplicationProcessedBytes,omitempty"` + // InitialReplicationTransferredBytes - READ-ONLY; The initial replication transferred bytes from source VM to azure for all selected disks on source VM. + InitialReplicationTransferredBytes *int64 `json:"initialReplicationTransferredBytes,omitempty"` + // InitialReplicationProgressHealth - READ-ONLY; The initial replication progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + InitialReplicationProgressHealth VMReplicationProgressHealth `json:"initialReplicationProgressHealth,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncProcessedBytes - READ-ONLY; The resync processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTransferredBytes - READ-ONLY; The resync transferred bytes from source VM to azure for all selected disks on source VM. + ResyncTransferredBytes *int64 `json:"resyncTransferredBytes,omitempty"` + // ResyncProgressHealth - READ-ONLY; The resync progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + ResyncProgressHealth VMReplicationProgressHealth `json:"resyncProgressHealth,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // AgentUpgradeState - READ-ONLY; The agent auto upgrade state. Possible values include: 'MobilityAgentUpgradeStateNone', 'MobilityAgentUpgradeStateStarted', 'MobilityAgentUpgradeStateCompleted', 'MobilityAgentUpgradeStateCommit' + AgentUpgradeState MobilityAgentUpgradeState `json:"agentUpgradeState,omitempty"` + // LastAgentUpgradeType - READ-ONLY; The last agent upgrade type. + LastAgentUpgradeType *string `json:"lastAgentUpgradeType,omitempty"` + // AgentUpgradeJobID - READ-ONLY; The agent upgrade job Id. + AgentUpgradeJobID *string `json:"agentUpgradeJobId,omitempty"` + // AgentUpgradeAttemptToVersion - READ-ONLY; The agent version to which last agent upgrade was attempted. + AgentUpgradeAttemptToVersion *string `json:"agentUpgradeAttemptToVersion,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageRcmProtectedDiskDetails `json:"protectedDisks,omitempty"` + // IsLastUpgradeSuccessful - READ-ONLY; A value indicating whether last agent upgrade was successful or not. + IsLastUpgradeSuccessful *string `json:"isLastUpgradeSuccessful,omitempty"` + // IsAgentRegistrationSuccessfulAfterFailover - READ-ONLY; A value indicating whether agent registration was successful after failover. + IsAgentRegistrationSuccessfulAfterFailover *bool `json:"isAgentRegistrationSuccessfulAfterFailover,omitempty"` + // MobilityAgentDetails - The mobility agent information. + MobilityAgentDetails *InMageRcmMobilityAgentDetails `json:"mobilityAgentDetails,omitempty"` + // LastAgentUpgradeErrorDetails - The last agent upgrade error information. + LastAgentUpgradeErrorDetails *[]InMageRcmLastAgentUpgradeErrorDetails `json:"lastAgentUpgradeErrorDetails,omitempty"` + // AgentUpgradeBlockingErrorDetails - The agent upgrade blocking error information. + AgentUpgradeBlockingErrorDetails *[]InMageRcmAgentUpgradeBlockingErrorDetails `json:"agentUpgradeBlockingErrorDetails,omitempty"` + // VMNics - The network details. + VMNics *[]InMageRcmNicDetails `json:"vmNics,omitempty"` + // DiscoveredVMDetails - The discovered VM details. + DiscoveredVMDetails *InMageRcmDiscoveredProtectedVMDetails `json:"discoveredVmDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) MarshalJSON() ([]byte, error) { + imrrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrrd.LicenseType != nil { + objectMap["licenseType"] = imrrd.LicenseType + } + if imrrd.TargetVMName != nil { + objectMap["targetVmName"] = imrrd.TargetVMName + } + if imrrd.TargetVMSize != nil { + objectMap["targetVmSize"] = imrrd.TargetVMSize + } + if imrrd.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrrd.TargetResourceGroupID + } + if imrrd.TargetLocation != nil { + objectMap["targetLocation"] = imrrd.TargetLocation + } + if imrrd.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrrd.TargetAvailabilitySetID + } + if imrrd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrrd.TargetAvailabilityZone + } + if imrrd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrrd.TargetProximityPlacementGroupID + } + if imrrd.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrrd.TargetBootDiagnosticsStorageAccountID + } + if imrrd.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrrd.TargetNetworkID + } + if imrrd.TestNetworkID != nil { + objectMap["testNetworkId"] = imrrd.TestNetworkID + } + if imrrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrrd.ProtectedDisks + } + if imrrd.MobilityAgentDetails != nil { + objectMap["mobilityAgentDetails"] = imrrd.MobilityAgentDetails + } + if imrrd.LastAgentUpgradeErrorDetails != nil { + objectMap["lastAgentUpgradeErrorDetails"] = imrrd.LastAgentUpgradeErrorDetails + } + if imrrd.AgentUpgradeBlockingErrorDetails != nil { + objectMap["agentUpgradeBlockingErrorDetails"] = imrrd.AgentUpgradeBlockingErrorDetails + } + if imrrd.VMNics != nil { + objectMap["vmNics"] = imrrd.VMNics + } + if imrrd.DiscoveredVMDetails != nil { + objectMap["discoveredVmDetails"] = imrrd.DiscoveredVMDetails + } + if imrrd.InstanceType != "" { + objectMap["instanceType"] = imrrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return &imrrd, true +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrrd, true +} + +// InMageRcmReprotectInput inMageRcm specific provider input. +type InMageRcmReprotectInput struct { + // ReprotectAgentID - The reprotect agent Id. + ReprotectAgentID *string `json:"reprotectAgentId,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) MarshalJSON() ([]byte, error) { + imrri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrri.ReprotectAgentID != nil { + objectMap["reprotectAgentId"] = imrri.ReprotectAgentID + } + if imrri.DatastoreName != nil { + objectMap["datastoreName"] = imrri.DatastoreName + } + if imrri.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imrri.LogStorageAccountID + } + if imrri.PolicyID != nil { + objectMap["policyId"] = imrri.PolicyID + } + if imrri.InstanceType != "" { + objectMap["instanceType"] = imrri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return &imrri, true +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imrri, true +} + +// InMageRcmSyncDetails inMageRcm disk level sync details. +type InMageRcmSyncDetails struct { + // ProgressHealth - READ-ONLY; The progress health. Possible values include: 'None', 'InProgress', 'SlowProgress', 'NoProgress', 'Queued' + ProgressHealth DiskReplicationProgressHealth `json:"progressHealth,omitempty"` + // TransferredBytes - READ-ONLY; The transferred bytes from source VM to azure for the disk. + TransferredBytes *int64 `json:"transferredBytes,omitempty"` + // Last15MinutesTransferredBytes - READ-ONLY; The bytes transferred in last 15 minutes from source VM to azure. + Last15MinutesTransferredBytes *int64 `json:"last15MinutesTransferredBytes,omitempty"` + // LastDataTransferTimeUtc - READ-ONLY; The time of the last data transfer from source VM to azure. + LastDataTransferTimeUtc *string `json:"lastDataTransferTimeUtc,omitempty"` + // ProcessedBytes - READ-ONLY; The total processed bytes. This includes bytes that are transferred from source VM to azure and matched bytes. + ProcessedBytes *int64 `json:"processedBytes,omitempty"` + // StartTime - READ-ONLY; The start time. + StartTime *string `json:"startTime,omitempty"` + // LastRefreshTime - READ-ONLY; The last refresh time. + LastRefreshTime *string `json:"lastRefreshTime,omitempty"` + // ProgressPercentage - READ-ONLY; Progress in percentage. Progress percentage is calculated based on processed bytes. + ProgressPercentage *int32 `json:"progressPercentage,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmSyncDetails. +func (imrsd InMageRcmSyncDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmTestFailoverInput inMageRcm provider specific input for test failover. +type InMageRcmTestFailoverInput struct { + // NetworkID - The test network Id. + NetworkID *string `json:"networkId,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) MarshalJSON() ([]byte, error) { + imrtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrtfi.NetworkID != nil { + objectMap["networkId"] = imrtfi.NetworkID + } + if imrtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrtfi.RecoveryPointID + } + if imrtfi.InstanceType != "" { + objectMap["instanceType"] = imrtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return &imrtfi, true +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imrtfi, true +} + +// InMageRcmUnplannedFailoverInput inMageRcm provider specific input for unplanned failover. +type InMageRcmUnplannedFailoverInput struct { + // PerformShutdown - A value indicating whether VM is to be shutdown. + PerformShutdown *string `json:"performShutdown,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imrufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrufi.PerformShutdown != nil { + objectMap["performShutdown"] = imrufi.PerformShutdown + } + if imrufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrufi.RecoveryPointID + } + if imrufi.InstanceType != "" { + objectMap["instanceType"] = imrufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return &imrufi, true +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imrufi, true +} + +// InMageRcmUpdateApplianceForReplicationProtectedItemInput inMageRcm provider specific input to update +// appliance for replication protected item. +type InMageRcmUpdateApplianceForReplicationProtectedItemInput struct { + // RunAsAccountID - The run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput', 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imruafrpii.InstanceType = InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imruafrpii.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imruafrpii.RunAsAccountID + } + if imruafrpii.InstanceType != "" { + objectMap["instanceType"] = imruafrpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageRcmUpdateApplianceForReplicationProtectedItemInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) AsInMageRcmUpdateApplianceForReplicationProtectedItemInput() (*InMageRcmUpdateApplianceForReplicationProtectedItemInput, bool) { + return &imruafrpii, true +} + +// AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (*UpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return &imruafrpii, true +} + +// InMageRcmUpdateContainerMappingInput inMageRcm update protection container mapping. +type InMageRcmUpdateContainerMappingInput struct { + // EnableAgentAutoUpgrade - A value indicating whether agent auto upgrade has to be enabled. + EnableAgentAutoUpgrade *string `json:"enableAgentAutoUpgrade,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + imrucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrucmi.EnableAgentAutoUpgrade != nil { + objectMap["enableAgentAutoUpgrade"] = imrucmi.EnableAgentAutoUpgrade + } + if imrucmi.InstanceType != "" { + objectMap["instanceType"] = imrucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return &imrucmi, true +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &imrucmi, true +} + +// InMageRcmUpdateReplicationProtectedItemInput inMageRcm provider specific input to update replication +// protected item. +type InMageRcmUpdateReplicationProtectedItemInput struct { + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The test network ARM Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // VMNics - The list of NIC details. + VMNics *[]InMageRcmNicInput `json:"vmNics,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imrurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrurpii.TargetVMName != nil { + objectMap["targetVmName"] = imrurpii.TargetVMName + } + if imrurpii.TargetVMSize != nil { + objectMap["targetVmSize"] = imrurpii.TargetVMSize + } + if imrurpii.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrurpii.TargetResourceGroupID + } + if imrurpii.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrurpii.TargetAvailabilitySetID + } + if imrurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrurpii.TargetAvailabilityZone + } + if imrurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrurpii.TargetProximityPlacementGroupID + } + if imrurpii.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrurpii.TargetBootDiagnosticsStorageAccountID + } + if imrurpii.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrurpii.TargetNetworkID + } + if imrurpii.TestNetworkID != nil { + objectMap["testNetworkId"] = imrurpii.TestNetworkID + } + if imrurpii.VMNics != nil { + objectMap["vmNics"] = imrurpii.VMNics + } + if imrurpii.LicenseType != "" { + objectMap["licenseType"] = imrurpii.LicenseType + } + if imrurpii.InstanceType != "" { + objectMap["instanceType"] = imrurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return &imrurpii, true +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &imrurpii, true +} + +// InMageReplicationDetails inMage provider specific settings. +type InMageReplicationDetails struct { + // ActiveSiteType - The active location of the VM. If the VM is being protected from Azure, this field will take values from { Azure, OnPrem }. If the VM is being protected between two data-centers, this field will be OnPrem always. + ActiveSiteType *string `json:"activeSiteType,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // OsDetails - The OS details. + OsDetails *OSDiskDetails `json:"osDetails,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // ResyncDetails - The resync details of the machine. + ResyncDetails *InitialReplicationDetails `json:"resyncDetails,omitempty"` + // RetentionWindowStart - The retention window start time. + RetentionWindowStart *date.Time `json:"retentionWindowStart,omitempty"` + // RetentionWindowEnd - The retention window end time. + RetentionWindowEnd *date.Time `json:"retentionWindowEnd,omitempty"` + // CompressedDataRateInMB - The compressed data change rate in MB. + CompressedDataRateInMB *float64 `json:"compressedDataRateInMB,omitempty"` + // UncompressedDataRateInMB - The uncompressed data change rate in MB. + UncompressedDataRateInMB *float64 `json:"uncompressedDataRateInMB,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageProtectedDiskDetails `json:"protectedDisks,omitempty"` + // IPAddress - The source IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // MasterTargetID - The master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ConsistencyPoints - The collection of Consistency points. + ConsistencyPoints map[string]*date.Time `json:"consistencyPoints"` + // DiskResized - A value indicating whether any disk is resized for this VM. + DiskResized *string `json:"diskResized,omitempty"` + // RebootAfterUpdateStatus - A value indicating whether the source server requires a restart after update. + RebootAfterUpdateStatus *string `json:"rebootAfterUpdateStatus,omitempty"` + // MultiVMGroupID - The multi vm group Id, if any. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name, if any. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMSyncStatus - A value indicating whether the multi vm sync is enabled or disabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // AgentDetails - The agent details. + AgentDetails *InMageAgentDetails `json:"agentDetails,omitempty"` + // VCenterInfrastructureID - The vCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // InfrastructureVMID - The infrastructure VM Id. + InfrastructureVMID *string `json:"infrastructureVmId,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. + DiscoveryType *string `json:"discoveryType,omitempty"` + // AzureStorageAccountID - A value indicating the underlying Azure storage account. If the VM is not running in Azure, this value shall be set to null. + AzureStorageAccountID *string `json:"azureStorageAccountId,omitempty"` + // Datastores - The datastores of the on-premise machine Value can be list of strings that contain datastore names. + Datastores *[]string `json:"datastores,omitempty"` + // ValidationErrors - The validation errors of the on-premise machine Value can be list of validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastUpdateReceivedTime - The last update time received from on-prem components. + LastUpdateReceivedTime *date.Time `json:"lastUpdateReceivedTime,omitempty"` + // ReplicaID - The replica id of the protected item. + ReplicaID *string `json:"replicaId,omitempty"` + // OsVersion - The OS Version of the protected item. + OsVersion *string `json:"osVersion,omitempty"` + // IsAdditionalStatsAvailable - A value indicating whether additional IR stats are available or not. + IsAdditionalStatsAvailable *bool `json:"isAdditionalStatsAvailable,omitempty"` + // TotalDataTransferred - The total transferred data in bytes. + TotalDataTransferred *int64 `json:"totalDataTransferred,omitempty"` + // TotalProgressHealth - The progress health. + TotalProgressHealth *string `json:"totalProgressHealth,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageReplicationDetails. +func (imrd InMageReplicationDetails) MarshalJSON() ([]byte, error) { + imrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imrd.ActiveSiteType != nil { + objectMap["activeSiteType"] = imrd.ActiveSiteType + } + if imrd.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = imrd.SourceVMCPUCount + } + if imrd.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = imrd.SourceVMRAMSizeInMB + } + if imrd.OsDetails != nil { + objectMap["osDetails"] = imrd.OsDetails + } + if imrd.ProtectionStage != nil { + objectMap["protectionStage"] = imrd.ProtectionStage + } + if imrd.VMID != nil { + objectMap["vmId"] = imrd.VMID + } + if imrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = imrd.VMProtectionState + } + if imrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = imrd.VMProtectionStateDescription + } + if imrd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrd.ResyncDetails + } + if imrd.RetentionWindowStart != nil { + objectMap["retentionWindowStart"] = imrd.RetentionWindowStart + } + if imrd.RetentionWindowEnd != nil { + objectMap["retentionWindowEnd"] = imrd.RetentionWindowEnd + } + if imrd.CompressedDataRateInMB != nil { + objectMap["compressedDataRateInMB"] = imrd.CompressedDataRateInMB + } + if imrd.UncompressedDataRateInMB != nil { + objectMap["uncompressedDataRateInMB"] = imrd.UncompressedDataRateInMB + } + if imrd.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = imrd.RpoInSeconds + } + if imrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrd.ProtectedDisks + } + if imrd.IPAddress != nil { + objectMap["ipAddress"] = imrd.IPAddress + } + if imrd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = imrd.LastHeartbeat + } + if imrd.ProcessServerID != nil { + objectMap["processServerId"] = imrd.ProcessServerID + } + if imrd.MasterTargetID != nil { + objectMap["masterTargetId"] = imrd.MasterTargetID + } + if imrd.ConsistencyPoints != nil { + objectMap["consistencyPoints"] = imrd.ConsistencyPoints + } + if imrd.DiskResized != nil { + objectMap["diskResized"] = imrd.DiskResized + } + if imrd.RebootAfterUpdateStatus != nil { + objectMap["rebootAfterUpdateStatus"] = imrd.RebootAfterUpdateStatus + } + if imrd.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imrd.MultiVMGroupID + } + if imrd.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imrd.MultiVMGroupName + } + if imrd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imrd.MultiVMSyncStatus + } + if imrd.AgentDetails != nil { + objectMap["agentDetails"] = imrd.AgentDetails + } + if imrd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = imrd.VCenterInfrastructureID + } + if imrd.InfrastructureVMID != nil { + objectMap["infrastructureVmId"] = imrd.InfrastructureVMID + } + if imrd.VMNics != nil { + objectMap["vmNics"] = imrd.VMNics + } + if imrd.DiscoveryType != nil { + objectMap["discoveryType"] = imrd.DiscoveryType + } + if imrd.AzureStorageAccountID != nil { + objectMap["azureStorageAccountId"] = imrd.AzureStorageAccountID + } + if imrd.Datastores != nil { + objectMap["datastores"] = imrd.Datastores + } + if imrd.ValidationErrors != nil { + objectMap["validationErrors"] = imrd.ValidationErrors + } + if imrd.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = imrd.LastRpoCalculatedTime + } + if imrd.LastUpdateReceivedTime != nil { + objectMap["lastUpdateReceivedTime"] = imrd.LastUpdateReceivedTime + } + if imrd.ReplicaID != nil { + objectMap["replicaId"] = imrd.ReplicaID + } + if imrd.OsVersion != nil { + objectMap["osVersion"] = imrd.OsVersion + } + if imrd.IsAdditionalStatsAvailable != nil { + objectMap["isAdditionalStatsAvailable"] = imrd.IsAdditionalStatsAvailable + } + if imrd.TotalDataTransferred != nil { + objectMap["totalDataTransferred"] = imrd.TotalDataTransferred + } + if imrd.TotalProgressHealth != nil { + objectMap["totalProgressHealth"] = imrd.TotalProgressHealth + } + if imrd.InstanceType != "" { + objectMap["instanceType"] = imrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return &imrd, true +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrd, true +} + +// InMageReprotectInput inMageAzureV2 specific provider input. +type InMageReprotectInput struct { + // MasterTargetID - The Master Target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RetentionDrive - The retention drive to use on the MT. + RetentionDrive *string `json:"retentionDrive,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // DiskExclusionInput - The enable disk exclusion input. + DiskExclusionInput *InMageDiskExclusionInput `json:"diskExclusionInput,omitempty"` + // ProfileID - The Policy Id. + ProfileID *string `json:"profileId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageReprotectInput. +func (imri InMageReprotectInput) MarshalJSON() ([]byte, error) { + imri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imri.MasterTargetID != nil { + objectMap["masterTargetId"] = imri.MasterTargetID + } + if imri.ProcessServerID != nil { + objectMap["processServerId"] = imri.ProcessServerID + } + if imri.RetentionDrive != nil { + objectMap["retentionDrive"] = imri.RetentionDrive + } + if imri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imri.RunAsAccountID + } + if imri.DatastoreName != nil { + objectMap["datastoreName"] = imri.DatastoreName + } + if imri.DiskExclusionInput != nil { + objectMap["diskExclusionInput"] = imri.DiskExclusionInput + } + if imri.ProfileID != nil { + objectMap["profileId"] = imri.ProfileID + } + if imri.DisksToInclude != nil { + objectMap["disksToInclude"] = imri.DisksToInclude + } + if imri.InstanceType != "" { + objectMap["instanceType"] = imri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return &imri, true +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imri, true +} + +// InMageTestFailoverInput provider specific input for InMage test failover. +type InMageTestFailoverInput struct { + // RecoveryPointType - The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. Possible values include: 'LatestTime', 'LatestTag', 'Custom' + RecoveryPointType RecoveryPointType `json:"recoveryPointType,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) MarshalJSON() ([]byte, error) { + imtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imtfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imtfi.RecoveryPointType + } + if imtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imtfi.RecoveryPointID + } + if imtfi.InstanceType != "" { + objectMap["instanceType"] = imtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return &imtfi, true +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imtfi, true +} + +// InMageUnplannedFailoverInput provider specific input for InMage unplanned failover. +type InMageUnplannedFailoverInput struct { + // RecoveryPointType - The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. Possible values include: 'LatestTime', 'LatestTag', 'Custom' + RecoveryPointType RecoveryPointType `json:"recoveryPointType,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imufi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imufi.RecoveryPointType + } + if imufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imufi.RecoveryPointID + } + if imufi.InstanceType != "" { + objectMap["instanceType"] = imufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return &imufi, true +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imufi, true +} + +// InMageVolumeExclusionOptions guest disk signature based disk exclusion option when doing enable +// protection of virtual machine in InMage provider. +type InMageVolumeExclusionOptions struct { + // VolumeLabel - The volume label. The disk having any volume with this label will be excluded from replication. + VolumeLabel *string `json:"volumeLabel,omitempty"` + // OnlyExcludeIfSingleVolume - The value indicating whether to exclude multi volume disk or not. If a disk has multiple volumes and one of the volume has label matching with VolumeLabel this disk will be excluded from replication if OnlyExcludeIfSingleVolume is false. + OnlyExcludeIfSingleVolume *string `json:"onlyExcludeIfSingleVolume,omitempty"` +} + +// InnerHealthError implements InnerHealthError class. HealthError object has a list of InnerHealthErrors +// as child errors. InnerHealthError is used because this will prevent an infinite loop of structures when +// Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health +// errors and all API consumers can utilize this in the same fashion as Exception -> InnerException. +type InnerHealthError struct { + // ErrorSource - Source of error. + ErrorSource *string `json:"errorSource,omitempty"` + // ErrorType - Type of error. + ErrorType *string `json:"errorType,omitempty"` + // ErrorLevel - Level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // ErrorCategory - Category of error. + ErrorCategory *string `json:"errorCategory,omitempty"` + // ErrorCode - Error code. + ErrorCode *string `json:"errorCode,omitempty"` + // SummaryMessage - Summary message of the entity. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // ErrorMessage - Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // CreationTimeUtc - Error creation time (UTC). + CreationTimeUtc *date.Time `json:"creationTimeUtc,omitempty"` + // RecoveryProviderErrorMessage - DRA error message. + RecoveryProviderErrorMessage *string `json:"recoveryProviderErrorMessage,omitempty"` + // EntityID - ID of the entity. + EntityID *string `json:"entityId,omitempty"` + // ErrorID - The health error unique id. + ErrorID *string `json:"errorId,omitempty"` + // CustomerResolvability - Value indicating whether the health error is customer resolvable. Possible values include: 'Allowed', 'NotAllowed' + CustomerResolvability HealthErrorCustomerResolvability `json:"customerResolvability,omitempty"` +} + +// InputEndpoint ... +type InputEndpoint struct { + EndpointName *string `json:"endpointName,omitempty"` + PrivatePort *int32 `json:"privatePort,omitempty"` + PublicPort *int32 `json:"publicPort,omitempty"` + Protocol *string `json:"protocol,omitempty"` +} + +// IPConfigDetails ... +type IPConfigDetails struct { + Name *string `json:"name,omitempty"` + IsPrimary *bool `json:"isPrimary,omitempty"` + SubnetName *string `json:"subnetName,omitempty"` + StaticIPAddress *string `json:"staticIPAddress,omitempty"` + IPAddressType *string `json:"ipAddressType,omitempty"` + IsSeletedForFailover *bool `json:"isSeletedForFailover,omitempty"` + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + RecoveryStaticIPAddress *string `json:"recoveryStaticIPAddress,omitempty"` + RecoveryIPAddressType *string `json:"recoveryIPAddressType,omitempty"` + RecoveryPublicIPAddressID *string `json:"recoveryPublicIPAddressId,omitempty"` + RecoveryLBBackendAddressPoolIds *[]string `json:"recoveryLBBackendAddressPoolIds,omitempty"` + TfoSubnetName *string `json:"tfoSubnetName,omitempty"` + TfoStaticIPAddress *string `json:"tfoStaticIPAddress,omitempty"` + TfoPublicIPAddressID *string `json:"tfoPublicIPAddressId,omitempty"` + TfoLBBackendAddressPoolIds *[]string `json:"tfoLBBackendAddressPoolIds,omitempty"` +} + +// IPConfigInputDetails ... +type IPConfigInputDetails struct { + IPConfigName *string `json:"ipConfigName,omitempty"` + IsPrimary *bool `json:"isPrimary,omitempty"` + IsSeletedForFailover *bool `json:"isSeletedForFailover,omitempty"` + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + RecoveryStaticIPAddress *string `json:"recoveryStaticIPAddress,omitempty"` + RecoveryPublicIPAddressID *string `json:"recoveryPublicIPAddressId,omitempty"` + RecoveryLBBackendAddressPoolIds *[]string `json:"recoveryLBBackendAddressPoolIds,omitempty"` + TfoSubnetName *string `json:"tfoSubnetName,omitempty"` + TfoStaticIPAddress *string `json:"tfoStaticIPAddress,omitempty"` + TfoPublicIPAddressID *string `json:"tfoPublicIPAddressId,omitempty"` + TfoLBBackendAddressPoolIds *[]string `json:"tfoLBBackendAddressPoolIds,omitempty"` +} + +// Job job details. +type Job struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *JobProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if j.Properties != nil { + objectMap["properties"] = j.Properties + } + if j.Location != nil { + objectMap["location"] = j.Location + } + return json.Marshal(objectMap) +} + +// JobCollection collection of jobs. +type JobCollection struct { + autorest.Response `json:"-"` + // Value - The list of jobs. + Value *[]Job `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// JobCollectionIterator provides access to a complete listing of Job values. +type JobCollectionIterator struct { + i int + page JobCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *JobCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *JobCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter JobCollectionIterator) Response() JobCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter JobCollectionIterator) Value() Job { + if !iter.page.NotDone() { + return Job{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the JobCollectionIterator type. +func NewJobCollectionIterator(page JobCollectionPage) JobCollectionIterator { + return JobCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (jc JobCollection) IsEmpty() bool { + return jc.Value == nil || len(*jc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (jc JobCollection) hasNextLink() bool { + return jc.NextLink != nil && len(*jc.NextLink) != 0 +} + +// jobCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jc JobCollection) jobCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !jc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jc.NextLink))) +} + +// JobCollectionPage contains a page of Job values. +type JobCollectionPage struct { + fn func(context.Context, JobCollection) (JobCollection, error) + jc JobCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *JobCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.jc) + if err != nil { + return err + } + page.jc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *JobCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobCollectionPage) NotDone() bool { + return !page.jc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobCollectionPage) Response() JobCollection { + return page.jc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobCollectionPage) Values() []Job { + if page.jc.IsEmpty() { + return nil + } + return *page.jc.Value +} + +// Creates a new instance of the JobCollectionPage type. +func NewJobCollectionPage(cur JobCollection, getNextPage func(context.Context, JobCollection) (JobCollection, error)) JobCollectionPage { + return JobCollectionPage{ + fn: getNextPage, + jc: cur, + } +} + +// BasicJobDetails job details based on specific job type. +type BasicJobDetails interface { + AsAsrJobDetails() (*AsrJobDetails, bool) + AsExportJobDetails() (*ExportJobDetails, bool) + AsFailoverJobDetails() (*FailoverJobDetails, bool) + AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) + AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) + AsJobDetails() (*JobDetails, bool) +} + +// JobDetails job details based on specific job type. +type JobDetails struct { + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicJobDetails(body []byte) (BasicJobDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAsrJobDetails): + var ajd AsrJobDetails + err := json.Unmarshal(body, &ajd) + return ajd, err + case string(InstanceTypeExportJobDetails): + var ejd ExportJobDetails + err := json.Unmarshal(body, &ejd) + return ejd, err + case string(InstanceTypeFailoverJobDetails): + var fjd FailoverJobDetails + err := json.Unmarshal(body, &fjd) + return fjd, err + case string(InstanceTypeSwitchProtectionJobDetails): + var spjd SwitchProtectionJobDetails + err := json.Unmarshal(body, &spjd) + return spjd, err + case string(InstanceTypeTestFailoverJobDetails): + var tfjd TestFailoverJobDetails + err := json.Unmarshal(body, &tfjd) + return tfjd, err + default: + var jd JobDetails + err := json.Unmarshal(body, &jd) + return jd, err + } +} +func unmarshalBasicJobDetailsArray(body []byte) ([]BasicJobDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jdArray := make([]BasicJobDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + jd, err := unmarshalBasicJobDetails(*rawMessage) + if err != nil { + return nil, err + } + jdArray[index] = jd + } + return jdArray, nil +} + +// MarshalJSON is the custom marshaler for JobDetails. +func (jd JobDetails) MarshalJSON() ([]byte, error) { + jd.InstanceType = InstanceTypeJobDetails + objectMap := make(map[string]interface{}) + if jd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = jd.AffectedObjectDetails + } + if jd.InstanceType != "" { + objectMap["instanceType"] = jd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsJobDetails() (*JobDetails, bool) { + return &jd, true +} + +// AsBasicJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &jd, true +} + +// JobEntity this class contains the minimal job details required to navigate to the desired drill down. +type JobEntity struct { + // JobID - The job id. + JobID *string `json:"jobId,omitempty"` + // JobFriendlyName - The job display name. + JobFriendlyName *string `json:"jobFriendlyName,omitempty"` + // TargetObjectID - The object id. + TargetObjectID *string `json:"targetObjectId,omitempty"` + // TargetObjectName - The object name. + TargetObjectName *string `json:"targetObjectName,omitempty"` + // TargetInstanceType - The workflow affected object type. + TargetInstanceType *string `json:"targetInstanceType,omitempty"` + // JobScenarioName - The job name. Enum type ScenarioName. + JobScenarioName *string `json:"jobScenarioName,omitempty"` +} + +// JobErrorDetails this class contains the error details per object. +type JobErrorDetails struct { + // ServiceErrorDetails - The Service error details. + ServiceErrorDetails *ServiceError `json:"serviceErrorDetails,omitempty"` + // ProviderErrorDetails - The Provider error details. + ProviderErrorDetails *ProviderError `json:"providerErrorDetails,omitempty"` + // ErrorLevel - Error level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // CreationTime - The creation time of job error. + CreationTime *date.Time `json:"creationTime,omitempty"` + // TaskID - The Id of the task. + TaskID *string `json:"taskId,omitempty"` +} + +// JobProperties job custom data details. +type JobProperties struct { + // ActivityID - The activity id. + ActivityID *string `json:"activityId,omitempty"` + // ScenarioName - The ScenarioName. + ScenarioName *string `json:"scenarioName,omitempty"` + // FriendlyName - The DisplayName. + FriendlyName *string `json:"friendlyName,omitempty"` + // State - The status of the Job. It is one of these values - NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or Other. + State *string `json:"state,omitempty"` + // StateDescription - The description of the state of the Job. For e.g. - For Succeeded state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. + StateDescription *string `json:"stateDescription,omitempty"` + // Tasks - The tasks. + Tasks *[]ASRTask `json:"tasks,omitempty"` + // Errors - The errors. + Errors *[]JobErrorDetails `json:"errors,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // AllowedActions - The Allowed action the job. + AllowedActions *[]string `json:"allowedActions,omitempty"` + // TargetObjectID - The affected Object Id. + TargetObjectID *string `json:"targetObjectId,omitempty"` + // TargetObjectName - The name of the affected object. + TargetObjectName *string `json:"targetObjectName,omitempty"` + // TargetInstanceType - The type of the affected object which is of Microsoft.Azure.SiteRecovery.V2015_11_10.AffectedObjectType class. + TargetInstanceType *string `json:"targetInstanceType,omitempty"` + // CustomDetails - The custom job details like test failover job details. + CustomDetails BasicJobDetails `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for JobProperties struct. +func (jp *JobProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "activityId": + if v != nil { + var activityID string + err = json.Unmarshal(*v, &activityID) + if err != nil { + return err + } + jp.ActivityID = &activityID + } + case "scenarioName": + if v != nil { + var scenarioName string + err = json.Unmarshal(*v, &scenarioName) + if err != nil { + return err + } + jp.ScenarioName = &scenarioName + } + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + jp.FriendlyName = &friendlyName + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + jp.State = &state + } + case "stateDescription": + if v != nil { + var stateDescription string + err = json.Unmarshal(*v, &stateDescription) + if err != nil { + return err + } + jp.StateDescription = &stateDescription + } + case "tasks": + if v != nil { + var tasks []ASRTask + err = json.Unmarshal(*v, &tasks) + if err != nil { + return err + } + jp.Tasks = &tasks + } + case "errors": + if v != nil { + var errorsVar []JobErrorDetails + err = json.Unmarshal(*v, &errorsVar) + if err != nil { + return err + } + jp.Errors = &errorsVar + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + jp.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + jp.EndTime = &endTime + } + case "allowedActions": + if v != nil { + var allowedActions []string + err = json.Unmarshal(*v, &allowedActions) + if err != nil { + return err + } + jp.AllowedActions = &allowedActions + } + case "targetObjectId": + if v != nil { + var targetObjectID string + err = json.Unmarshal(*v, &targetObjectID) + if err != nil { + return err + } + jp.TargetObjectID = &targetObjectID + } + case "targetObjectName": + if v != nil { + var targetObjectName string + err = json.Unmarshal(*v, &targetObjectName) + if err != nil { + return err + } + jp.TargetObjectName = &targetObjectName + } + case "targetInstanceType": + if v != nil { + var targetInstanceType string + err = json.Unmarshal(*v, &targetInstanceType) + if err != nil { + return err + } + jp.TargetInstanceType = &targetInstanceType + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicJobDetails(*v) + if err != nil { + return err + } + jp.CustomDetails = customDetails + } + } + } + + return nil +} + +// JobQueryParameter query parameter to enumerate jobs. +type JobQueryParameter struct { + // StartTime - Date time to get jobs from. + StartTime *string `json:"startTime,omitempty"` + // EndTime - Date time to get jobs upto. + EndTime *string `json:"endTime,omitempty"` + // FabricID - The Id of the fabric to search jobs under. + FabricID *string `json:"fabricId,omitempty"` + // AffectedObjectTypes - The type of objects. + AffectedObjectTypes *string `json:"affectedObjectTypes,omitempty"` + // JobStatus - The states of the job to be filtered can be in. + JobStatus *string `json:"jobStatus,omitempty"` + // JobOutputType - The output type of the jobs. Possible values include: 'JSON', 'XML', 'Excel' + JobOutputType ExportJobOutputSerializationType `json:"jobOutputType,omitempty"` + // JobName - The job Name. + JobName *string `json:"jobName,omitempty"` + // TimezoneOffset - The timezone offset for the location of the request (in minutes). + TimezoneOffset *float64 `json:"timezoneOffset,omitempty"` +} + +// JobStatusEventDetails model class for event details of a job status event. +type JobStatusEventDetails struct { + // JobID - Job arm id for the event. + JobID *string `json:"jobId,omitempty"` + // JobFriendlyName - JobName for the Event. + JobFriendlyName *string `json:"jobFriendlyName,omitempty"` + // JobStatus - JobStatus for the Event. + JobStatus *string `json:"jobStatus,omitempty"` + // AffectedObjectType - AffectedObjectType for the event. + AffectedObjectType *string `json:"affectedObjectType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeEventSpecificDetails', 'InstanceTypeJobStatus' + InstanceType InstanceTypeBasicEventSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobStatusEventDetails. +func (jsed JobStatusEventDetails) MarshalJSON() ([]byte, error) { + jsed.InstanceType = InstanceTypeJobStatus + objectMap := make(map[string]interface{}) + if jsed.JobID != nil { + objectMap["jobId"] = jsed.JobID + } + if jsed.JobFriendlyName != nil { + objectMap["jobFriendlyName"] = jsed.JobFriendlyName + } + if jsed.JobStatus != nil { + objectMap["jobStatus"] = jsed.JobStatus + } + if jsed.AffectedObjectType != nil { + objectMap["affectedObjectType"] = jsed.AffectedObjectType + } + if jsed.InstanceType != "" { + objectMap["instanceType"] = jsed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsJobStatusEventDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsJobStatusEventDetails() (*JobStatusEventDetails, bool) { + return &jsed, true +} + +// AsEventSpecificDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsEventSpecificDetails() (*EventSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventSpecificDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsBasicEventSpecificDetails() (BasicEventSpecificDetails, bool) { + return &jsed, true +} + +// BasicJobTaskDetails this class represents a task which is actually a workflow so that one can navigate to its +// individual drill down. +type BasicJobTaskDetails interface { + AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) + AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) + AsJobTaskDetails() (*JobTaskDetails, bool) +} + +// JobTaskDetails this class represents a task which is actually a workflow so that one can navigate to its +// individual drill down. +type JobTaskDetails struct { + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicJobTaskDetails(body []byte) (BasicJobTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeFabricReplicationGroupTaskDetails): + var frgtd FabricReplicationGroupTaskDetails + err := json.Unmarshal(body, &frgtd) + return frgtd, err + case string(InstanceTypeVirtualMachineTaskDetails): + var vmtd VirtualMachineTaskDetails + err := json.Unmarshal(body, &vmtd) + return vmtd, err + default: + var jtd JobTaskDetails + err := json.Unmarshal(body, &jtd) + return jtd, err + } +} +func unmarshalBasicJobTaskDetailsArray(body []byte) ([]BasicJobTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jtdArray := make([]BasicJobTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + jtd, err := unmarshalBasicJobTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + jtdArray[index] = jtd + } + return jtdArray, nil +} + +// MarshalJSON is the custom marshaler for JobTaskDetails. +func (jtd JobTaskDetails) MarshalJSON() ([]byte, error) { + jtd.InstanceType = InstanceTypeJobTaskDetails + objectMap := make(map[string]interface{}) + if jtd.JobTask != nil { + objectMap["jobTask"] = jtd.JobTask + } + if jtd.InstanceType != "" { + objectMap["instanceType"] = jtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return &jtd, true +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &jtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &jtd, true +} + +// KeyEncryptionKeyInfo key Encryption Key (KEK) information. +type KeyEncryptionKeyInfo struct { + // KeyIdentifier - The key URL / identifier. + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KeyVaultResourceArmID - The KeyVault resource ARM Id for key. + KeyVaultResourceArmID *string `json:"keyVaultResourceArmId,omitempty"` +} + +// LogicalNetwork logical network data model. +type LogicalNetwork struct { + autorest.Response `json:"-"` + // Properties - The Logical Network Properties. + Properties *LogicalNetworkProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for LogicalNetwork. +func (ln LogicalNetwork) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ln.Properties != nil { + objectMap["properties"] = ln.Properties + } + if ln.Location != nil { + objectMap["location"] = ln.Location + } + return json.Marshal(objectMap) +} + +// LogicalNetworkCollection list of logical networks. +type LogicalNetworkCollection struct { + autorest.Response `json:"-"` + // Value - The Logical Networks list details. + Value *[]LogicalNetwork `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// LogicalNetworkCollectionIterator provides access to a complete listing of LogicalNetwork values. +type LogicalNetworkCollectionIterator struct { + i int + page LogicalNetworkCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *LogicalNetworkCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LogicalNetworkCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *LogicalNetworkCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter LogicalNetworkCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter LogicalNetworkCollectionIterator) Response() LogicalNetworkCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter LogicalNetworkCollectionIterator) Value() LogicalNetwork { + if !iter.page.NotDone() { + return LogicalNetwork{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the LogicalNetworkCollectionIterator type. +func NewLogicalNetworkCollectionIterator(page LogicalNetworkCollectionPage) LogicalNetworkCollectionIterator { + return LogicalNetworkCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lnc LogicalNetworkCollection) IsEmpty() bool { + return lnc.Value == nil || len(*lnc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (lnc LogicalNetworkCollection) hasNextLink() bool { + return lnc.NextLink != nil && len(*lnc.NextLink) != 0 +} + +// logicalNetworkCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lnc LogicalNetworkCollection) logicalNetworkCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !lnc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lnc.NextLink))) +} + +// LogicalNetworkCollectionPage contains a page of LogicalNetwork values. +type LogicalNetworkCollectionPage struct { + fn func(context.Context, LogicalNetworkCollection) (LogicalNetworkCollection, error) + lnc LogicalNetworkCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *LogicalNetworkCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LogicalNetworkCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.lnc) + if err != nil { + return err + } + page.lnc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *LogicalNetworkCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page LogicalNetworkCollectionPage) NotDone() bool { + return !page.lnc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page LogicalNetworkCollectionPage) Response() LogicalNetworkCollection { + return page.lnc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page LogicalNetworkCollectionPage) Values() []LogicalNetwork { + if page.lnc.IsEmpty() { + return nil + } + return *page.lnc.Value +} + +// Creates a new instance of the LogicalNetworkCollectionPage type. +func NewLogicalNetworkCollectionPage(cur LogicalNetworkCollection, getNextPage func(context.Context, LogicalNetworkCollection) (LogicalNetworkCollection, error)) LogicalNetworkCollectionPage { + return LogicalNetworkCollectionPage{ + fn: getNextPage, + lnc: cur, + } +} + +// LogicalNetworkProperties logical Network Properties. +type LogicalNetworkProperties struct { + // FriendlyName - The Friendly Name. + FriendlyName *string `json:"friendlyName,omitempty"` + // NetworkVirtualizationStatus - A value indicating whether Network Virtualization is enabled for the logical network. + NetworkVirtualizationStatus *string `json:"networkVirtualizationStatus,omitempty"` + // LogicalNetworkUsage - A value indicating whether logical network is used as private test network by test failover. + LogicalNetworkUsage *string `json:"logicalNetworkUsage,omitempty"` + // LogicalNetworkDefinitionsStatus - A value indicating whether logical network definitions are isolated. + LogicalNetworkDefinitionsStatus *string `json:"logicalNetworkDefinitionsStatus,omitempty"` +} + +// ManualActionTaskDetails this class represents the manual action task details. +type ManualActionTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // Instructions - The instructions. + Instructions *string `json:"instructions,omitempty"` + // Observation - The observation. + Observation *string `json:"observation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) MarshalJSON() ([]byte, error) { + matd.InstanceType = InstanceTypeManualActionTaskDetails + objectMap := make(map[string]interface{}) + if matd.Name != nil { + objectMap["name"] = matd.Name + } + if matd.Instructions != nil { + objectMap["instructions"] = matd.Instructions + } + if matd.Observation != nil { + objectMap["observation"] = matd.Observation + } + if matd.InstanceType != "" { + objectMap["instanceType"] = matd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return &matd, true +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &matd, true +} + +// MarsAgentDetails mars agent details. +type MarsAgentDetails struct { + // ID - READ-ONLY; The Mars agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The Mars agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The Mars agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The Mars agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the Mars agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the Mars agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for MarsAgentDetails. +func (mad MarsAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MasterTargetServer details of a Master Target Server. +type MasterTargetServer struct { + // ID - The server Id. + ID *string `json:"id,omitempty"` + // IPAddress - The IP address of the server. + IPAddress *string `json:"ipAddress,omitempty"` + // Name - The server name. + Name *string `json:"name,omitempty"` + // OsType - The OS type of the server. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The version of the scout component on the server. + AgentVersion *string `json:"agentVersion,omitempty"` + // LastHeartbeat - The last heartbeat received from the server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // RetentionVolumes - The retention volumes of Master target Server. + RetentionVolumes *[]RetentionVolume `json:"retentionVolumes,omitempty"` + // DataStores - The list of data stores in the fabric. + DataStores *[]DataStore `json:"dataStores,omitempty"` + // ValidationErrors - Validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // HealthErrors - Health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // DiskCount - Disk count of the master target. + DiskCount *int32 `json:"diskCount,omitempty"` + // OsVersion - OS Version of the master target. + OsVersion *string `json:"osVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // MarsAgentVersion - MARS agent version. + MarsAgentVersion *string `json:"marsAgentVersion,omitempty"` + // MarsAgentExpiryDate - MARS agent expiry date. + MarsAgentExpiryDate *date.Time `json:"marsAgentExpiryDate,omitempty"` + // AgentVersionDetails - Agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // MarsAgentVersionDetails - Mars agent version details. + MarsAgentVersionDetails *VersionDetails `json:"marsAgentVersionDetails,omitempty"` +} + +// MigrateInput input for migrate. +type MigrateInput struct { + // Properties - Migrate input properties. + Properties *MigrateInputProperties `json:"properties,omitempty"` +} + +// MigrateInputProperties migrate input properties. +type MigrateInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicMigrateProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for MigrateInputProperties struct. +func (mip *MigrateInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicMigrateProviderSpecificInput(*v) + if err != nil { + return err + } + mip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicMigrateProviderSpecificInput migrate provider specific input. +type BasicMigrateProviderSpecificInput interface { + AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) + AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) +} + +// MigrateProviderSpecificInput migrate provider specific input. +type MigrateProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput', 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicMigrateProviderSpecificInput(body []byte) (BasicMigrateProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt): + var vmcmi VMwareCbtMigrateInput + err := json.Unmarshal(body, &vmcmi) + return vmcmi, err + default: + var mpsi MigrateProviderSpecificInput + err := json.Unmarshal(body, &mpsi) + return mpsi, err + } +} +func unmarshalBasicMigrateProviderSpecificInputArray(body []byte) ([]BasicMigrateProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + mpsiArray := make([]BasicMigrateProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + mpsi, err := unmarshalBasicMigrateProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + mpsiArray[index] = mpsi + } + return mpsiArray, nil +} + +// MarshalJSON is the custom marshaler for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) MarshalJSON() ([]byte, error) { + mpsi.InstanceType = InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput + objectMap := make(map[string]interface{}) + if mpsi.InstanceType != "" { + objectMap["instanceType"] = mpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrateInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) { + return nil, false +} + +// AsMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) { + return &mpsi, true +} + +// AsBasicMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsBasicMigrateProviderSpecificInput() (BasicMigrateProviderSpecificInput, bool) { + return &mpsi, true +} + +// MigrationItem migration item. +type MigrationItem struct { + autorest.Response `json:"-"` + // Properties - The migration item properties. + Properties *MigrationItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationItem. +func (mi MigrationItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mi.Properties != nil { + objectMap["properties"] = mi.Properties + } + if mi.Location != nil { + objectMap["location"] = mi.Location + } + return json.Marshal(objectMap) +} + +// MigrationItemCollection migration item collection. +type MigrationItemCollection struct { + autorest.Response `json:"-"` + // Value - The list of migration items. + Value *[]MigrationItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MigrationItemCollectionIterator provides access to a complete listing of MigrationItem values. +type MigrationItemCollectionIterator struct { + i int + page MigrationItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *MigrationItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *MigrationItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MigrationItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter MigrationItemCollectionIterator) Response() MigrationItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter MigrationItemCollectionIterator) Value() MigrationItem { + if !iter.page.NotDone() { + return MigrationItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the MigrationItemCollectionIterator type. +func NewMigrationItemCollectionIterator(page MigrationItemCollectionPage) MigrationItemCollectionIterator { + return MigrationItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mic MigrationItemCollection) IsEmpty() bool { + return mic.Value == nil || len(*mic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mic MigrationItemCollection) hasNextLink() bool { + return mic.NextLink != nil && len(*mic.NextLink) != 0 +} + +// migrationItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mic MigrationItemCollection) migrationItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !mic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mic.NextLink))) +} + +// MigrationItemCollectionPage contains a page of MigrationItem values. +type MigrationItemCollectionPage struct { + fn func(context.Context, MigrationItemCollection) (MigrationItemCollection, error) + mic MigrationItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *MigrationItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.mic) + if err != nil { + return err + } + page.mic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *MigrationItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MigrationItemCollectionPage) NotDone() bool { + return !page.mic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MigrationItemCollectionPage) Response() MigrationItemCollection { + return page.mic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MigrationItemCollectionPage) Values() []MigrationItem { + if page.mic.IsEmpty() { + return nil + } + return *page.mic.Value +} + +// Creates a new instance of the MigrationItemCollectionPage type. +func NewMigrationItemCollectionPage(cur MigrationItemCollection, getNextPage func(context.Context, MigrationItemCollection) (MigrationItemCollection, error)) MigrationItemCollectionPage { + return MigrationItemCollectionPage{ + fn: getNextPage, + mic: cur, + } +} + +// MigrationItemProperties migration item properties. +type MigrationItemProperties struct { + // MachineName - READ-ONLY; The on-premise virtual machine name. + MachineName *string `json:"machineName,omitempty"` + // PolicyID - READ-ONLY; The ARM Id of policy governing this item. + PolicyID *string `json:"policyId,omitempty"` + // PolicyFriendlyName - READ-ONLY; The name of policy governing this item. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` + // MigrationState - READ-ONLY; The migration status. Possible values include: 'MigrationStateNone', 'MigrationStateEnableMigrationInProgress', 'MigrationStateEnableMigrationFailed', 'MigrationStateDisableMigrationInProgress', 'MigrationStateDisableMigrationFailed', 'MigrationStateInitialSeedingInProgress', 'MigrationStateInitialSeedingFailed', 'MigrationStateReplicating', 'MigrationStateMigrationInProgress', 'MigrationStateMigrationSucceeded', 'MigrationStateMigrationFailed' + MigrationState MigrationState `json:"migrationState,omitempty"` + // MigrationStateDescription - READ-ONLY; The migration state description. + MigrationStateDescription *string `json:"migrationStateDescription,omitempty"` + // LastTestMigrationTime - READ-ONLY; The last test migration time. + LastTestMigrationTime *date.Time `json:"lastTestMigrationTime,omitempty"` + // LastTestMigrationStatus - READ-ONLY; The status of the last test migration. + LastTestMigrationStatus *string `json:"lastTestMigrationStatus,omitempty"` + // TestMigrateState - READ-ONLY; The test migrate state. Possible values include: 'TestMigrationStateNone', 'TestMigrationStateTestMigrationInProgress', 'TestMigrationStateTestMigrationSucceeded', 'TestMigrationStateTestMigrationFailed', 'TestMigrationStateTestMigrationCleanupInProgress' + TestMigrateState TestMigrationState `json:"testMigrateState,omitempty"` + // TestMigrateStateDescription - READ-ONLY; The test migrate state description. + TestMigrateStateDescription *string `json:"testMigrateStateDescription,omitempty"` + // Health - READ-ONLY; The consolidated health. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The list of health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // AllowedOperations - READ-ONLY; The allowed operations on the migration item based on the current migration state of the item. + AllowedOperations *[]MigrationItemOperation `json:"allowedOperations,omitempty"` + // CurrentJob - READ-ONLY; The current job details. + CurrentJob *CurrentJobDetails `json:"currentJob,omitempty"` + // EventCorrelationID - READ-ONLY; The correlation Id for events associated with this migration item. + EventCorrelationID *string `json:"eventCorrelationId,omitempty"` + // ProviderSpecificDetails - The migration provider custom settings. + ProviderSpecificDetails BasicMigrationProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationItemProperties. +func (mip MigrationItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["providerSpecificDetails"] = mip.ProviderSpecificDetails + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MigrationItemProperties struct. +func (mip *MigrationItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "machineName": + if v != nil { + var machineName string + err = json.Unmarshal(*v, &machineName) + if err != nil { + return err + } + mip.MachineName = &machineName + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + mip.PolicyID = &policyID + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + mip.PolicyFriendlyName = &policyFriendlyName + } + case "migrationState": + if v != nil { + var migrationState MigrationState + err = json.Unmarshal(*v, &migrationState) + if err != nil { + return err + } + mip.MigrationState = migrationState + } + case "migrationStateDescription": + if v != nil { + var migrationStateDescription string + err = json.Unmarshal(*v, &migrationStateDescription) + if err != nil { + return err + } + mip.MigrationStateDescription = &migrationStateDescription + } + case "lastTestMigrationTime": + if v != nil { + var lastTestMigrationTime date.Time + err = json.Unmarshal(*v, &lastTestMigrationTime) + if err != nil { + return err + } + mip.LastTestMigrationTime = &lastTestMigrationTime + } + case "lastTestMigrationStatus": + if v != nil { + var lastTestMigrationStatus string + err = json.Unmarshal(*v, &lastTestMigrationStatus) + if err != nil { + return err + } + mip.LastTestMigrationStatus = &lastTestMigrationStatus + } + case "testMigrateState": + if v != nil { + var testMigrateState TestMigrationState + err = json.Unmarshal(*v, &testMigrateState) + if err != nil { + return err + } + mip.TestMigrateState = testMigrateState + } + case "testMigrateStateDescription": + if v != nil { + var testMigrateStateDescription string + err = json.Unmarshal(*v, &testMigrateStateDescription) + if err != nil { + return err + } + mip.TestMigrateStateDescription = &testMigrateStateDescription + } + case "health": + if v != nil { + var health ProtectionHealth + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + mip.Health = health + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + mip.HealthErrors = &healthErrors + } + case "allowedOperations": + if v != nil { + var allowedOperations []MigrationItemOperation + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + mip.AllowedOperations = &allowedOperations + } + case "currentJob": + if v != nil { + var currentJob CurrentJobDetails + err = json.Unmarshal(*v, ¤tJob) + if err != nil { + return err + } + mip.CurrentJob = ¤tJob + } + case "eventCorrelationId": + if v != nil { + var eventCorrelationID string + err = json.Unmarshal(*v, &eventCorrelationID) + if err != nil { + return err + } + mip.EventCorrelationID = &eventCorrelationID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicMigrationProviderSpecificSettings(*v) + if err != nil { + return err + } + mip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// MigrationItemsQueryParameter query parameter to enumerate migration items. +type MigrationItemsQueryParameter struct { + // SourceFabricName - The source fabric name filter. + SourceFabricName *string `json:"sourceFabricName,omitempty"` + // SourceContainerName - The source container name filter. + SourceContainerName *string `json:"sourceContainerName,omitempty"` + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` +} + +// BasicMigrationProviderSpecificSettings migration provider specific settings. +type BasicMigrationProviderSpecificSettings interface { + AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) + AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) +} + +// MigrationProviderSpecificSettings migration provider specific settings. +type MigrationProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings', 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicMigrationProviderSpecificSettings(body []byte) (BasicMigrationProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt): + var vmcmd VMwareCbtMigrationDetails + err := json.Unmarshal(body, &vmcmd) + return vmcmd, err + default: + var mpss MigrationProviderSpecificSettings + err := json.Unmarshal(body, &mpss) + return mpss, err + } +} +func unmarshalBasicMigrationProviderSpecificSettingsArray(body []byte) ([]BasicMigrationProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + mpssArray := make([]BasicMigrationProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + mpss, err := unmarshalBasicMigrationProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + mpssArray[index] = mpss + } + return mpssArray, nil +} + +// MarshalJSON is the custom marshaler for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) MarshalJSON() ([]byte, error) { + mpss.InstanceType = InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings + objectMap := make(map[string]interface{}) + if mpss.InstanceType != "" { + objectMap["instanceType"] = mpss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrationDetails is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) { + return nil, false +} + +// AsMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) { + return &mpss, true +} + +// AsBasicMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsBasicMigrationProviderSpecificSettings() (BasicMigrationProviderSpecificSettings, bool) { + return &mpss, true +} + +// MigrationRecoveryPoint recovery point for a migration item. +type MigrationRecoveryPoint struct { + autorest.Response `json:"-"` + // Properties - Recovery point properties. + Properties *MigrationRecoveryPointProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationRecoveryPoint. +func (mrp MigrationRecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mrp.Properties != nil { + objectMap["properties"] = mrp.Properties + } + if mrp.Location != nil { + objectMap["location"] = mrp.Location + } + return json.Marshal(objectMap) +} + +// MigrationRecoveryPointCollection collection of migration recovery points. +type MigrationRecoveryPointCollection struct { + autorest.Response `json:"-"` + // Value - The migration recovery point details. + Value *[]MigrationRecoveryPoint `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MigrationRecoveryPointCollectionIterator provides access to a complete listing of MigrationRecoveryPoint +// values. +type MigrationRecoveryPointCollectionIterator struct { + i int + page MigrationRecoveryPointCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *MigrationRecoveryPointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *MigrationRecoveryPointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MigrationRecoveryPointCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter MigrationRecoveryPointCollectionIterator) Response() MigrationRecoveryPointCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter MigrationRecoveryPointCollectionIterator) Value() MigrationRecoveryPoint { + if !iter.page.NotDone() { + return MigrationRecoveryPoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the MigrationRecoveryPointCollectionIterator type. +func NewMigrationRecoveryPointCollectionIterator(page MigrationRecoveryPointCollectionPage) MigrationRecoveryPointCollectionIterator { + return MigrationRecoveryPointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mrpc MigrationRecoveryPointCollection) IsEmpty() bool { + return mrpc.Value == nil || len(*mrpc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mrpc MigrationRecoveryPointCollection) hasNextLink() bool { + return mrpc.NextLink != nil && len(*mrpc.NextLink) != 0 +} + +// migrationRecoveryPointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mrpc MigrationRecoveryPointCollection) migrationRecoveryPointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !mrpc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mrpc.NextLink))) +} + +// MigrationRecoveryPointCollectionPage contains a page of MigrationRecoveryPoint values. +type MigrationRecoveryPointCollectionPage struct { + fn func(context.Context, MigrationRecoveryPointCollection) (MigrationRecoveryPointCollection, error) + mrpc MigrationRecoveryPointCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *MigrationRecoveryPointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.mrpc) + if err != nil { + return err + } + page.mrpc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *MigrationRecoveryPointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MigrationRecoveryPointCollectionPage) NotDone() bool { + return !page.mrpc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MigrationRecoveryPointCollectionPage) Response() MigrationRecoveryPointCollection { + return page.mrpc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MigrationRecoveryPointCollectionPage) Values() []MigrationRecoveryPoint { + if page.mrpc.IsEmpty() { + return nil + } + return *page.mrpc.Value +} + +// Creates a new instance of the MigrationRecoveryPointCollectionPage type. +func NewMigrationRecoveryPointCollectionPage(cur MigrationRecoveryPointCollection, getNextPage func(context.Context, MigrationRecoveryPointCollection) (MigrationRecoveryPointCollection, error)) MigrationRecoveryPointCollectionPage { + return MigrationRecoveryPointCollectionPage{ + fn: getNextPage, + mrpc: cur, + } +} + +// MigrationRecoveryPointProperties migration item recovery point properties. +type MigrationRecoveryPointProperties struct { + // RecoveryPointTime - READ-ONLY; The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointType - READ-ONLY; The recovery point type. Possible values include: 'MigrationRecoveryPointTypeNotSpecified', 'MigrationRecoveryPointTypeApplicationConsistent', 'MigrationRecoveryPointTypeCrashConsistent' + RecoveryPointType MigrationRecoveryPointType `json:"recoveryPointType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationRecoveryPointProperties. +func (mrpp MigrationRecoveryPointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MobilityServiceUpdate the Mobility Service update details. +type MobilityServiceUpdate struct { + // Version - The version of the latest update. + Version *string `json:"version,omitempty"` + // RebootStatus - The reboot status of the update - whether it is required or not. + RebootStatus *string `json:"rebootStatus,omitempty"` + // OsType - The OS type. + OsType *string `json:"osType,omitempty"` +} + +// Network network model. +type Network struct { + autorest.Response `json:"-"` + // Properties - The Network Properties. + Properties *NetworkProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Network. +func (n Network) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if n.Properties != nil { + objectMap["properties"] = n.Properties + } + if n.Location != nil { + objectMap["location"] = n.Location + } + return json.Marshal(objectMap) +} + +// NetworkCollection list of networks. +type NetworkCollection struct { + autorest.Response `json:"-"` + // Value - The Networks list details. + Value *[]Network `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// NetworkCollectionIterator provides access to a complete listing of Network values. +type NetworkCollectionIterator struct { + i int + page NetworkCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *NetworkCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *NetworkCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter NetworkCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter NetworkCollectionIterator) Response() NetworkCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter NetworkCollectionIterator) Value() Network { + if !iter.page.NotDone() { + return Network{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the NetworkCollectionIterator type. +func NewNetworkCollectionIterator(page NetworkCollectionPage) NetworkCollectionIterator { + return NetworkCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (nc NetworkCollection) IsEmpty() bool { + return nc.Value == nil || len(*nc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (nc NetworkCollection) hasNextLink() bool { + return nc.NextLink != nil && len(*nc.NextLink) != 0 +} + +// networkCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (nc NetworkCollection) networkCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !nc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(nc.NextLink))) +} + +// NetworkCollectionPage contains a page of Network values. +type NetworkCollectionPage struct { + fn func(context.Context, NetworkCollection) (NetworkCollection, error) + nc NetworkCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *NetworkCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.nc) + if err != nil { + return err + } + page.nc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *NetworkCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page NetworkCollectionPage) NotDone() bool { + return !page.nc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page NetworkCollectionPage) Response() NetworkCollection { + return page.nc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page NetworkCollectionPage) Values() []Network { + if page.nc.IsEmpty() { + return nil + } + return *page.nc.Value +} + +// Creates a new instance of the NetworkCollectionPage type. +func NewNetworkCollectionPage(cur NetworkCollection, getNextPage func(context.Context, NetworkCollection) (NetworkCollection, error)) NetworkCollectionPage { + return NetworkCollectionPage{ + fn: getNextPage, + nc: cur, + } +} + +// NetworkMapping network Mapping model. Ideally it should have been possible to inherit this class from +// prev version in InheritedModels as long as there is no difference in structure or method signature. +// Since there were no base Models for certain fields and methods viz NetworkMappingProperties and Load +// with required return type, the class has been introduced in its entirety with references to base models +// to facilitate extensions in subsequent versions. +type NetworkMapping struct { + autorest.Response `json:"-"` + // Properties - The Network Mapping Properties. + Properties *NetworkMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for NetworkMapping. +func (nm NetworkMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if nm.Properties != nil { + objectMap["properties"] = nm.Properties + } + if nm.Location != nil { + objectMap["location"] = nm.Location + } + return json.Marshal(objectMap) +} + +// NetworkMappingCollection list of network mappings. As with NetworkMapping, it should be possible to +// reuse a prev version of this class. It doesn't seem likely this class could be anything more than a +// slightly bespoke collection of NetworkMapping. Hence it makes sense to override Load with +// Base.NetworkMapping instead of existing CurrentVersion.NetworkMapping. +type NetworkMappingCollection struct { + autorest.Response `json:"-"` + // Value - The Network Mappings list. + Value *[]NetworkMapping `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// NetworkMappingCollectionIterator provides access to a complete listing of NetworkMapping values. +type NetworkMappingCollectionIterator struct { + i int + page NetworkMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *NetworkMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *NetworkMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter NetworkMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter NetworkMappingCollectionIterator) Response() NetworkMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter NetworkMappingCollectionIterator) Value() NetworkMapping { + if !iter.page.NotDone() { + return NetworkMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the NetworkMappingCollectionIterator type. +func NewNetworkMappingCollectionIterator(page NetworkMappingCollectionPage) NetworkMappingCollectionIterator { + return NetworkMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (nmc NetworkMappingCollection) IsEmpty() bool { + return nmc.Value == nil || len(*nmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (nmc NetworkMappingCollection) hasNextLink() bool { + return nmc.NextLink != nil && len(*nmc.NextLink) != 0 +} + +// networkMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (nmc NetworkMappingCollection) networkMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !nmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(nmc.NextLink))) +} + +// NetworkMappingCollectionPage contains a page of NetworkMapping values. +type NetworkMappingCollectionPage struct { + fn func(context.Context, NetworkMappingCollection) (NetworkMappingCollection, error) + nmc NetworkMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *NetworkMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.nmc) + if err != nil { + return err + } + page.nmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *NetworkMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page NetworkMappingCollectionPage) NotDone() bool { + return !page.nmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page NetworkMappingCollectionPage) Response() NetworkMappingCollection { + return page.nmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page NetworkMappingCollectionPage) Values() []NetworkMapping { + if page.nmc.IsEmpty() { + return nil + } + return *page.nmc.Value +} + +// Creates a new instance of the NetworkMappingCollectionPage type. +func NewNetworkMappingCollectionPage(cur NetworkMappingCollection, getNextPage func(context.Context, NetworkMappingCollection) (NetworkMappingCollection, error)) NetworkMappingCollectionPage { + return NetworkMappingCollectionPage{ + fn: getNextPage, + nmc: cur, + } +} + +// BasicNetworkMappingFabricSpecificSettings network Mapping fabric specific settings. +type BasicNetworkMappingFabricSpecificSettings interface { + AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) + AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) + AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) + AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) +} + +// NetworkMappingFabricSpecificSettings network Mapping fabric specific settings. +type NetworkMappingFabricSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicNetworkMappingFabricSpecificSettings(body []byte) (BasicNetworkMappingFabricSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure): + var atanms AzureToAzureNetworkMappingSettings + err := json.Unmarshal(body, &atanms) + return atanms, err + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure): + var vtanms VmmToAzureNetworkMappingSettings + err := json.Unmarshal(body, &vtanms) + return vtanms, err + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm): + var vtvnms VmmToVmmNetworkMappingSettings + err := json.Unmarshal(body, &vtvnms) + return vtvnms, err + default: + var nmfss NetworkMappingFabricSpecificSettings + err := json.Unmarshal(body, &nmfss) + return nmfss, err + } +} +func unmarshalBasicNetworkMappingFabricSpecificSettingsArray(body []byte) ([]BasicNetworkMappingFabricSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + nmfssArray := make([]BasicNetworkMappingFabricSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + nmfss, err := unmarshalBasicNetworkMappingFabricSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + nmfssArray[index] = nmfss + } + return nmfssArray, nil +} + +// MarshalJSON is the custom marshaler for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) MarshalJSON() ([]byte, error) { + nmfss.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings + objectMap := make(map[string]interface{}) + if nmfss.InstanceType != "" { + objectMap["instanceType"] = nmfss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return &nmfss, true +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &nmfss, true +} + +// NetworkMappingProperties network Mapping Properties. +type NetworkMappingProperties struct { + // State - The pairing state for network mapping. + State *string `json:"state,omitempty"` + // PrimaryNetworkFriendlyName - The primary network friendly name. + PrimaryNetworkFriendlyName *string `json:"primaryNetworkFriendlyName,omitempty"` + // PrimaryNetworkID - The primary network id for network mapping. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // PrimaryFabricFriendlyName - The primary fabric friendly name. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // RecoveryNetworkFriendlyName - The recovery network friendly name. + RecoveryNetworkFriendlyName *string `json:"recoveryNetworkFriendlyName,omitempty"` + // RecoveryNetworkID - The recovery network id for network mapping. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // RecoveryFabricArmID - The recovery fabric ARM id. + RecoveryFabricArmID *string `json:"recoveryFabricArmId,omitempty"` + // RecoveryFabricFriendlyName - The recovery fabric friendly name. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // FabricSpecificSettings - The fabric specific settings. + FabricSpecificSettings BasicNetworkMappingFabricSpecificSettings `json:"fabricSpecificSettings,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for NetworkMappingProperties struct. +func (nmp *NetworkMappingProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + nmp.State = &state + } + case "primaryNetworkFriendlyName": + if v != nil { + var primaryNetworkFriendlyName string + err = json.Unmarshal(*v, &primaryNetworkFriendlyName) + if err != nil { + return err + } + nmp.PrimaryNetworkFriendlyName = &primaryNetworkFriendlyName + } + case "primaryNetworkId": + if v != nil { + var primaryNetworkID string + err = json.Unmarshal(*v, &primaryNetworkID) + if err != nil { + return err + } + nmp.PrimaryNetworkID = &primaryNetworkID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + nmp.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "recoveryNetworkFriendlyName": + if v != nil { + var recoveryNetworkFriendlyName string + err = json.Unmarshal(*v, &recoveryNetworkFriendlyName) + if err != nil { + return err + } + nmp.RecoveryNetworkFriendlyName = &recoveryNetworkFriendlyName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + nmp.RecoveryNetworkID = &recoveryNetworkID + } + case "recoveryFabricArmId": + if v != nil { + var recoveryFabricArmID string + err = json.Unmarshal(*v, &recoveryFabricArmID) + if err != nil { + return err + } + nmp.RecoveryFabricArmID = &recoveryFabricArmID + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + nmp.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "fabricSpecificSettings": + if v != nil { + fabricSpecificSettings, err := unmarshalBasicNetworkMappingFabricSpecificSettings(*v) + if err != nil { + return err + } + nmp.FabricSpecificSettings = fabricSpecificSettings + } + } + } + + return nil +} + +// NetworkProperties network Properties. +type NetworkProperties struct { + // FabricType - The Fabric Type. + FabricType *string `json:"fabricType,omitempty"` + // Subnets - The List of subnets. + Subnets *[]Subnet `json:"subnets,omitempty"` + // FriendlyName - The Friendly Name. + FriendlyName *string `json:"friendlyName,omitempty"` + // NetworkType - The Network Type. + NetworkType *string `json:"networkType,omitempty"` +} + +// NewProtectionProfile new Protection profile input. +type NewProtectionProfile struct { + // PolicyName - The protection profile input. + PolicyName *string `json:"policyName,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for NewProtectionProfile. +func (npp NewProtectionProfile) MarshalJSON() ([]byte, error) { + npp.ResourceType = ResourceTypeNew + objectMap := make(map[string]interface{}) + if npp.PolicyName != nil { + objectMap["policyName"] = npp.PolicyName + } + if npp.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = npp.RecoveryPointHistory + } + if npp.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = npp.CrashConsistentFrequencyInMinutes + } + if npp.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = npp.AppConsistentFrequencyInMinutes + } + if npp.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = npp.MultiVMSyncStatus + } + if npp.ResourceType != "" { + objectMap["resourceType"] = npp.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return nil, false +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return &npp, true +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return nil, false +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &npp, true +} + +// NewRecoveryVirtualNetwork recovery virtual network input to create new virtual network from given source +// network. +type NewRecoveryVirtualNetwork struct { + // RecoveryVirtualNetworkResourceGroupName - The name of the resource group to be used to create the recovery virtual network. If absent, target network would be created in the same resource group as target VM. + RecoveryVirtualNetworkResourceGroupName *string `json:"recoveryVirtualNetworkResourceGroupName,omitempty"` + // RecoveryVirtualNetworkName - The recovery virtual network name. + RecoveryVirtualNetworkName *string `json:"recoveryVirtualNetworkName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) MarshalJSON() ([]byte, error) { + nrvn.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew + objectMap := make(map[string]interface{}) + if nrvn.RecoveryVirtualNetworkResourceGroupName != nil { + objectMap["recoveryVirtualNetworkResourceGroupName"] = nrvn.RecoveryVirtualNetworkResourceGroupName + } + if nrvn.RecoveryVirtualNetworkName != nil { + objectMap["recoveryVirtualNetworkName"] = nrvn.RecoveryVirtualNetworkName + } + if nrvn.ResourceType != "" { + objectMap["resourceType"] = nrvn.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return &nrvn, true +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &nrvn, true +} + +// OperationsDiscovery operations discovery class. +type OperationsDiscovery struct { + // Name - Name of the API. The name of the operation being performed on this particular object. It should match the action name that appears in RBAC / the event service. Examples of operations include: * Microsoft.Compute/virtualMachine/capture/action * Microsoft.Compute/virtualMachine/restart/action * Microsoft.Compute/virtualMachine/write * Microsoft.Compute/virtualMachine/read * Microsoft.Compute/virtualMachine/delete Each action should include, in order: (1) Resource Provider Namespace (2) Type hierarchy for which the action applies (e.g. server/databases for a SQL Azure database) (3) Read, Write, Action or Delete indicating which type applies. If it is a PUT/PATCH on a collection or named value, Write should be used. If it is a GET, Read should be used. If it is a DELETE, Delete should be used. If it is a POST, Action should be used. As a note: all resource providers would need to include the "{Resource Provider Namespace}/register/action" operation in their response. This API is used to register for their service, and should include details about the operation (e.g. a localized name for the resource provider + any special considerations like PII release). + Name *string `json:"name,omitempty"` + // Display - Object type. + Display *Display `json:"display,omitempty"` + // Origin - Origin. The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. Default value is "user,system". + Origin *string `json:"origin,omitempty"` + // Properties - Properties. Reserved for future use. + Properties interface{} `json:"properties,omitempty"` +} + +// OperationsDiscoveryCollection collection of ClientDiscovery details. +type OperationsDiscoveryCollection struct { + autorest.Response `json:"-"` + // Value - The ClientDiscovery details. + Value *[]OperationsDiscovery `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationsDiscoveryCollectionIterator provides access to a complete listing of OperationsDiscovery +// values. +type OperationsDiscoveryCollectionIterator struct { + i int + page OperationsDiscoveryCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationsDiscoveryCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsDiscoveryCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationsDiscoveryCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationsDiscoveryCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationsDiscoveryCollectionIterator) Response() OperationsDiscoveryCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationsDiscoveryCollectionIterator) Value() OperationsDiscovery { + if !iter.page.NotDone() { + return OperationsDiscovery{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationsDiscoveryCollectionIterator type. +func NewOperationsDiscoveryCollectionIterator(page OperationsDiscoveryCollectionPage) OperationsDiscoveryCollectionIterator { + return OperationsDiscoveryCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (odc OperationsDiscoveryCollection) IsEmpty() bool { + return odc.Value == nil || len(*odc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (odc OperationsDiscoveryCollection) hasNextLink() bool { + return odc.NextLink != nil && len(*odc.NextLink) != 0 +} + +// operationsDiscoveryCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (odc OperationsDiscoveryCollection) operationsDiscoveryCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !odc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(odc.NextLink))) +} + +// OperationsDiscoveryCollectionPage contains a page of OperationsDiscovery values. +type OperationsDiscoveryCollectionPage struct { + fn func(context.Context, OperationsDiscoveryCollection) (OperationsDiscoveryCollection, error) + odc OperationsDiscoveryCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationsDiscoveryCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsDiscoveryCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.odc) + if err != nil { + return err + } + page.odc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationsDiscoveryCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationsDiscoveryCollectionPage) NotDone() bool { + return !page.odc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationsDiscoveryCollectionPage) Response() OperationsDiscoveryCollection { + return page.odc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationsDiscoveryCollectionPage) Values() []OperationsDiscovery { + if page.odc.IsEmpty() { + return nil + } + return *page.odc.Value +} + +// Creates a new instance of the OperationsDiscoveryCollectionPage type. +func NewOperationsDiscoveryCollectionPage(cur OperationsDiscoveryCollection, getNextPage func(context.Context, OperationsDiscoveryCollection) (OperationsDiscoveryCollection, error)) OperationsDiscoveryCollectionPage { + return OperationsDiscoveryCollectionPage{ + fn: getNextPage, + odc: cur, + } +} + +// OSDetails disk Details. +type OSDetails struct { + // OsType - VM Disk details. + OsType *string `json:"osType,omitempty"` + // ProductType - Product type. + ProductType *string `json:"productType,omitempty"` + // OsEdition - The OSEdition. + OsEdition *string `json:"osEdition,omitempty"` + // OSVersion - The OS Version. + OSVersion *string `json:"oSVersion,omitempty"` + // OSMajorVersion - The OS Major Version. + OSMajorVersion *string `json:"oSMajorVersion,omitempty"` + // OSMinorVersion - The OS Minor Version. + OSMinorVersion *string `json:"oSMinorVersion,omitempty"` +} + +// OSDiskDetails details of the OS Disk. +type OSDiskDetails struct { + // OsVhdID - The id of the disk containing the OS. + OsVhdID *string `json:"osVhdId,omitempty"` + // OsType - The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // VhdName - The OS disk VHD name. + VhdName *string `json:"vhdName,omitempty"` +} + +// OSVersionWrapper wrapper model for OSVersion to include version and service pack info. +type OSVersionWrapper struct { + // Version - The version. + Version *string `json:"version,omitempty"` + // ServicePack - The service pack. + ServicePack *string `json:"servicePack,omitempty"` +} + +// PlannedFailoverInput input definition for planned failover. +type PlannedFailoverInput struct { + // Properties - Planned failover input properties. + Properties *PlannedFailoverInputProperties `json:"properties,omitempty"` +} + +// PlannedFailoverInputProperties input definition for planned failover input properties. +type PlannedFailoverInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicPlannedFailoverProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for PlannedFailoverInputProperties struct. +func (pfip *PlannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + pfip.FailoverDirection = &failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(*v) + if err != nil { + return err + } + pfip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicPlannedFailoverProviderSpecificFailoverInput provider specific failover input. +type BasicPlannedFailoverProviderSpecificFailoverInput interface { + AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) + AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) + AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) + AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) +} + +// PlannedFailoverProviderSpecificFailoverInput provider specific failover input. +type PlannedFailoverProviderSpecificFailoverInput struct { + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(body []byte) (BasicPlannedFailoverProviderSpecificFailoverInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeHyperVReplicaAzureFailback): + var hvrafpi HyperVReplicaAzureFailbackProviderInput + err := json.Unmarshal(body, &hvrafpi) + return hvrafpi, err + case string(InstanceTypeHyperVReplicaAzure): + var hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput + err := json.Unmarshal(body, &hvrapfpi) + return hvrapfpi, err + case string(InstanceTypeInMageRcmFailback): + var imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput + err := json.Unmarshal(body, &imrfpfpi) + return imrfpfpi, err + default: + var pfpsfi PlannedFailoverProviderSpecificFailoverInput + err := json.Unmarshal(body, &pfpsfi) + return pfpsfi, err + } +} +func unmarshalBasicPlannedFailoverProviderSpecificFailoverInputArray(body []byte) ([]BasicPlannedFailoverProviderSpecificFailoverInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pfpsfiArray := make([]BasicPlannedFailoverProviderSpecificFailoverInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pfpsfi, err := unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(*rawMessage) + if err != nil { + return nil, err + } + pfpsfiArray[index] = pfpsfi + } + return pfpsfiArray, nil +} + +// MarshalJSON is the custom marshaler for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) MarshalJSON() ([]byte, error) { + pfpsfi.InstanceType = InstanceTypePlannedFailoverProviderSpecificFailoverInput + objectMap := make(map[string]interface{}) + if pfpsfi.InstanceType != "" { + objectMap["instanceType"] = pfpsfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return &pfpsfi, true +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &pfpsfi, true +} + +// Policy protection profile details. +type Policy struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *PolicyProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Policy. +func (p Policy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.Properties != nil { + objectMap["properties"] = p.Properties + } + if p.Location != nil { + objectMap["location"] = p.Location + } + return json.Marshal(objectMap) +} + +// PolicyCollection protection Profile Collection details. +type PolicyCollection struct { + autorest.Response `json:"-"` + // Value - The policy details. + Value *[]Policy `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// PolicyCollectionIterator provides access to a complete listing of Policy values. +type PolicyCollectionIterator struct { + i int + page PolicyCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PolicyCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PolicyCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PolicyCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PolicyCollectionIterator) Response() PolicyCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PolicyCollectionIterator) Value() Policy { + if !iter.page.NotDone() { + return Policy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PolicyCollectionIterator type. +func NewPolicyCollectionIterator(page PolicyCollectionPage) PolicyCollectionIterator { + return PolicyCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pc PolicyCollection) IsEmpty() bool { + return pc.Value == nil || len(*pc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pc PolicyCollection) hasNextLink() bool { + return pc.NextLink != nil && len(*pc.NextLink) != 0 +} + +// policyCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pc PolicyCollection) policyCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pc.NextLink))) +} + +// PolicyCollectionPage contains a page of Policy values. +type PolicyCollectionPage struct { + fn func(context.Context, PolicyCollection) (PolicyCollection, error) + pc PolicyCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PolicyCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pc) + if err != nil { + return err + } + page.pc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PolicyCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PolicyCollectionPage) NotDone() bool { + return !page.pc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PolicyCollectionPage) Response() PolicyCollection { + return page.pc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PolicyCollectionPage) Values() []Policy { + if page.pc.IsEmpty() { + return nil + } + return *page.pc.Value +} + +// Creates a new instance of the PolicyCollectionPage type. +func NewPolicyCollectionPage(cur PolicyCollection, getNextPage func(context.Context, PolicyCollection) (PolicyCollection, error)) PolicyCollectionPage { + return PolicyCollectionPage{ + fn: getNextPage, + pc: cur, + } +} + +// PolicyProperties protection profile custom data details. +type PolicyProperties struct { + // FriendlyName - The FriendlyName. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProviderSpecificDetails - The ReplicationChannelSetting. + ProviderSpecificDetails BasicPolicyProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for PolicyProperties struct. +func (pp *PolicyProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + pp.FriendlyName = &friendlyName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicPolicyProviderSpecificDetails(*v) + if err != nil { + return err + } + pp.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicPolicyProviderSpecificDetails base class for Provider specific details for policies. +type BasicPolicyProviderSpecificDetails interface { + AsA2APolicyDetails() (*A2APolicyDetails, bool) + AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) + AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) + AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) + AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) + AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) + AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) + AsInMagePolicyDetails() (*InMagePolicyDetails, bool) + AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) + AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) + AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) + AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) +} + +// PolicyProviderSpecificDetails base class for Provider specific details for policies. +type PolicyProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicPolicyProviderSpecificDetails(body []byte) (BasicPolicyProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A): + var apd A2APolicyDetails + err := json.Unmarshal(body, &apd) + return apd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure): + var hvrapd HyperVReplicaAzurePolicyDetails + err := json.Unmarshal(body, &hvrapd) + return hvrapd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails): + var hvrbpd HyperVReplicaBasePolicyDetails + err := json.Unmarshal(body, &hvrbpd) + return hvrbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2): + var hvrbpd HyperVReplicaBluePolicyDetails + err := json.Unmarshal(body, &hvrbpd) + return hvrbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012): + var hvrpd HyperVReplicaPolicyDetails + err := json.Unmarshal(body, &hvrpd) + return hvrpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2): + var imavpd InMageAzureV2PolicyDetails + err := json.Unmarshal(body, &imavpd) + return imavpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails): + var imbpd InMageBasePolicyDetails + err := json.Unmarshal(body, &imbpd) + return imbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage): + var impd InMagePolicyDetails + err := json.Unmarshal(body, &impd) + return impd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback): + var imrfpd InMageRcmFailbackPolicyDetails + err := json.Unmarshal(body, &imrfpd) + return imrfpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm): + var imrpd InMageRcmPolicyDetails + err := json.Unmarshal(body, &imrpd) + return imrpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt): + var vcpd VmwareCbtPolicyDetails + err := json.Unmarshal(body, &vcpd) + return vcpd, err + default: + var ppsd PolicyProviderSpecificDetails + err := json.Unmarshal(body, &ppsd) + return ppsd, err + } +} +func unmarshalBasicPolicyProviderSpecificDetailsArray(body []byte) ([]BasicPolicyProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppsdArray := make([]BasicPolicyProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppsd, err := unmarshalBasicPolicyProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + ppsdArray[index] = ppsd + } + return ppsdArray, nil +} + +// MarshalJSON is the custom marshaler for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) MarshalJSON() ([]byte, error) { + ppsd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails + objectMap := make(map[string]interface{}) + if ppsd.InstanceType != "" { + objectMap["instanceType"] = ppsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return &ppsd, true +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &ppsd, true +} + +// BasicPolicyProviderSpecificInput base class for provider specific input. +type BasicPolicyProviderSpecificInput interface { + AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) + AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) + AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) + AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) + AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) + AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) + AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) + AsInMagePolicyInput() (*InMagePolicyInput, bool) + AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) + AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) + AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) + AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) +} + +// PolicyProviderSpecificInput base class for provider specific input. +type PolicyProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicPolicyProviderSpecificInput(body []byte) (BasicPolicyProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmpci A2ACrossClusterMigrationPolicyCreationInput + err := json.Unmarshal(body, &accmpci) + return accmpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A): + var apci A2APolicyCreationInput + err := json.Unmarshal(body, &apci) + return apci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvrapi HyperVReplicaAzurePolicyInput + err := json.Unmarshal(body, &hvrapi) + return hvrapi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2): + var hvrbpi HyperVReplicaBluePolicyInput + err := json.Unmarshal(body, &hvrbpi) + return hvrbpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012): + var hvrpi HyperVReplicaPolicyInput + err := json.Unmarshal(body, &hvrpi) + return hvrpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2): + var imavpi InMageAzureV2PolicyInput + err := json.Unmarshal(body, &imavpi) + return imavpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage): + var impi InMagePolicyInput + err := json.Unmarshal(body, &impi) + return impi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback): + var imrfpci InMageRcmFailbackPolicyCreationInput + err := json.Unmarshal(body, &imrfpci) + return imrfpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm): + var imrpci InMageRcmPolicyCreationInput + err := json.Unmarshal(body, &imrpci) + return imrpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt): + var vmcpci VMwareCbtPolicyCreationInput + err := json.Unmarshal(body, &vmcpci) + return vmcpci, err + default: + var ppsi PolicyProviderSpecificInput + err := json.Unmarshal(body, &ppsi) + return ppsi, err + } +} +func unmarshalBasicPolicyProviderSpecificInputArray(body []byte) ([]BasicPolicyProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppsiArray := make([]BasicPolicyProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppsi, err := unmarshalBasicPolicyProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + ppsiArray[index] = ppsi + } + return ppsiArray, nil +} + +// MarshalJSON is the custom marshaler for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) MarshalJSON() ([]byte, error) { + ppsi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput + objectMap := make(map[string]interface{}) + if ppsi.InstanceType != "" { + objectMap["instanceType"] = ppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return &ppsi, true +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &ppsi, true +} + +// ProcessServer details of the Process Server. +type ProcessServer struct { + // FriendlyName - The Process Server's friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ID - The Process Server Id. + ID *string `json:"id,omitempty"` + // IPAddress - The IP address of the server. + IPAddress *string `json:"ipAddress,omitempty"` + // OsType - The OS type of the server. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The version of the scout component on the server. + AgentVersion *string `json:"agentVersion,omitempty"` + // LastHeartbeat - The last heartbeat received from the server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // MobilityServiceUpdates - The list of the mobility service updates available on the Process Server. + MobilityServiceUpdates *[]MobilityServiceUpdate `json:"mobilityServiceUpdates,omitempty"` + // HostID - The agent generated Id. + HostID *string `json:"hostId,omitempty"` + // MachineCount - The servers configured with this PS. + MachineCount *string `json:"machineCount,omitempty"` + // ReplicationPairCount - The number of replication pairs configured in this PS. + ReplicationPairCount *string `json:"replicationPairCount,omitempty"` + // SystemLoad - The percentage of the system load. + SystemLoad *string `json:"systemLoad,omitempty"` + // SystemLoadStatus - The system load status. + SystemLoadStatus *string `json:"systemLoadStatus,omitempty"` + // CPULoad - The percentage of the CPU load. + CPULoad *string `json:"cpuLoad,omitempty"` + // CPULoadStatus - The CPU load status. + CPULoadStatus *string `json:"cpuLoadStatus,omitempty"` + // TotalMemoryInBytes - The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // MemoryUsageStatus - The memory usage status. + MemoryUsageStatus *string `json:"memoryUsageStatus,omitempty"` + // TotalSpaceInBytes - The total space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - The available space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // SpaceUsageStatus - The space usage status. + SpaceUsageStatus *string `json:"spaceUsageStatus,omitempty"` + // PsServiceStatus - The PS service status. + PsServiceStatus *string `json:"psServiceStatus,omitempty"` + // SslCertExpiryDate - The PS SSL cert expiry date. + SslCertExpiryDate *date.Time `json:"sslCertExpiryDate,omitempty"` + // SslCertExpiryRemainingDays - CS SSL cert expiry date. + SslCertExpiryRemainingDays *int32 `json:"sslCertExpiryRemainingDays,omitempty"` + // OsVersion - OS Version of the process server. Note: This will get populated if user has CS version greater than 9.12.0.0. + OsVersion *string `json:"osVersion,omitempty"` + // HealthErrors - Health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // AgentVersionDetails - The agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // Health - READ-ONLY; The health of Process Server. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // PsStatsRefreshTime - READ-ONLY; The process server stats refresh time. + PsStatsRefreshTime *date.Time `json:"psStatsRefreshTime,omitempty"` + // ThroughputUploadPendingDataInBytes - READ-ONLY; The uploading pending data in bytes. + ThroughputUploadPendingDataInBytes *int64 `json:"throughputUploadPendingDataInBytes,omitempty"` + // ThroughputInMBps - READ-ONLY; The throughput in MBps. + ThroughputInMBps *int64 `json:"throughputInMBps,omitempty"` + // ThroughputInBytes - READ-ONLY; The throughput in bytes. + ThroughputInBytes *int64 `json:"throughputInBytes,omitempty"` + // ThroughputStatus - READ-ONLY; The throughput status. + ThroughputStatus *string `json:"throughputStatus,omitempty"` + // MarsCommunicationStatus - READ-ONLY; The MARS communication status. + MarsCommunicationStatus *string `json:"marsCommunicationStatus,omitempty"` + // MarsRegistrationStatus - READ-ONLY; The MARS registration status. + MarsRegistrationStatus *string `json:"marsRegistrationStatus,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessServer. +func (ps ProcessServer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ps.FriendlyName != nil { + objectMap["friendlyName"] = ps.FriendlyName + } + if ps.ID != nil { + objectMap["id"] = ps.ID + } + if ps.IPAddress != nil { + objectMap["ipAddress"] = ps.IPAddress + } + if ps.OsType != nil { + objectMap["osType"] = ps.OsType + } + if ps.AgentVersion != nil { + objectMap["agentVersion"] = ps.AgentVersion + } + if ps.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = ps.LastHeartbeat + } + if ps.VersionStatus != nil { + objectMap["versionStatus"] = ps.VersionStatus + } + if ps.MobilityServiceUpdates != nil { + objectMap["mobilityServiceUpdates"] = ps.MobilityServiceUpdates + } + if ps.HostID != nil { + objectMap["hostId"] = ps.HostID + } + if ps.MachineCount != nil { + objectMap["machineCount"] = ps.MachineCount + } + if ps.ReplicationPairCount != nil { + objectMap["replicationPairCount"] = ps.ReplicationPairCount + } + if ps.SystemLoad != nil { + objectMap["systemLoad"] = ps.SystemLoad + } + if ps.SystemLoadStatus != nil { + objectMap["systemLoadStatus"] = ps.SystemLoadStatus + } + if ps.CPULoad != nil { + objectMap["cpuLoad"] = ps.CPULoad + } + if ps.CPULoadStatus != nil { + objectMap["cpuLoadStatus"] = ps.CPULoadStatus + } + if ps.TotalMemoryInBytes != nil { + objectMap["totalMemoryInBytes"] = ps.TotalMemoryInBytes + } + if ps.AvailableMemoryInBytes != nil { + objectMap["availableMemoryInBytes"] = ps.AvailableMemoryInBytes + } + if ps.MemoryUsageStatus != nil { + objectMap["memoryUsageStatus"] = ps.MemoryUsageStatus + } + if ps.TotalSpaceInBytes != nil { + objectMap["totalSpaceInBytes"] = ps.TotalSpaceInBytes + } + if ps.AvailableSpaceInBytes != nil { + objectMap["availableSpaceInBytes"] = ps.AvailableSpaceInBytes + } + if ps.SpaceUsageStatus != nil { + objectMap["spaceUsageStatus"] = ps.SpaceUsageStatus + } + if ps.PsServiceStatus != nil { + objectMap["psServiceStatus"] = ps.PsServiceStatus + } + if ps.SslCertExpiryDate != nil { + objectMap["sslCertExpiryDate"] = ps.SslCertExpiryDate + } + if ps.SslCertExpiryRemainingDays != nil { + objectMap["sslCertExpiryRemainingDays"] = ps.SslCertExpiryRemainingDays + } + if ps.OsVersion != nil { + objectMap["osVersion"] = ps.OsVersion + } + if ps.HealthErrors != nil { + objectMap["healthErrors"] = ps.HealthErrors + } + if ps.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = ps.AgentExpiryDate + } + if ps.AgentVersionDetails != nil { + objectMap["agentVersionDetails"] = ps.AgentVersionDetails + } + return json.Marshal(objectMap) +} + +// ProcessServerDetails process server details. +type ProcessServerDetails struct { + // ID - READ-ONLY; The process server Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The process server name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The process server Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The process server Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // IPAddresses - READ-ONLY; The list of IP addresses for communicating with the RCM component. + IPAddresses *[]string `json:"ipAddresses,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the process server. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // TotalMemoryInBytes - READ-ONLY; The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - READ-ONLY; The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // UsedMemoryInBytes - READ-ONLY; The used memory. + UsedMemoryInBytes *int64 `json:"usedMemoryInBytes,omitempty"` + // MemoryUsagePercentage - READ-ONLY; The memory usage percentage. + MemoryUsagePercentage *float64 `json:"memoryUsagePercentage,omitempty"` + // TotalSpaceInBytes - READ-ONLY; The total disk space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - READ-ONLY; The available disk space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // UsedSpaceInBytes - READ-ONLY; The used disk space. + UsedSpaceInBytes *int64 `json:"usedSpaceInBytes,omitempty"` + // FreeSpacePercentage - READ-ONLY; The free disk space percentage. + FreeSpacePercentage *float64 `json:"freeSpacePercentage,omitempty"` + // ThroughputUploadPendingDataInBytes - READ-ONLY; The uploading pending data in bytes. + ThroughputUploadPendingDataInBytes *int64 `json:"throughputUploadPendingDataInBytes,omitempty"` + // ThroughputInBytes - READ-ONLY; The throughput in bytes. + ThroughputInBytes *int64 `json:"throughputInBytes,omitempty"` + // ProcessorUsagePercentage - READ-ONLY; The processor usage percentage. + ProcessorUsagePercentage *float64 `json:"processorUsagePercentage,omitempty"` + // ThroughputStatus - READ-ONLY; The throughput status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + ThroughputStatus RcmComponentStatus `json:"throughputStatus,omitempty"` + // SystemLoad - READ-ONLY; The system load. + SystemLoad *int64 `json:"systemLoad,omitempty"` + // SystemLoadStatus - READ-ONLY; The system load status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + SystemLoadStatus RcmComponentStatus `json:"systemLoadStatus,omitempty"` + // DiskUsageStatus - READ-ONLY; The disk usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + DiskUsageStatus RcmComponentStatus `json:"diskUsageStatus,omitempty"` + // MemoryUsageStatus - READ-ONLY; The memory usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + MemoryUsageStatus RcmComponentStatus `json:"memoryUsageStatus,omitempty"` + // ProcessorUsageStatus - READ-ONLY; The processor usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + ProcessorUsageStatus RcmComponentStatus `json:"processorUsageStatus,omitempty"` + // Health - READ-ONLY; The health of the process server. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // ProtectedItemCount - READ-ONLY; The protected item count. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // HistoricHealth - READ-ONLY; The historic health of the process server based on the health in last 24 hours. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + HistoricHealth ProtectionHealth `json:"historicHealth,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessServerDetails. +func (psd ProcessServerDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ProtectableItem replication protected item. +type ProtectableItem struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectableItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectableItem. +func (pi ProtectableItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pi.Properties != nil { + objectMap["properties"] = pi.Properties + } + if pi.Location != nil { + objectMap["location"] = pi.Location + } + return json.Marshal(objectMap) +} + +// ProtectableItemCollection protectable item collection. +type ProtectableItemCollection struct { + autorest.Response `json:"-"` + // Value - The Protectable item details. + Value *[]ProtectableItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectableItemCollectionIterator provides access to a complete listing of ProtectableItem values. +type ProtectableItemCollectionIterator struct { + i int + page ProtectableItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectableItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectableItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectableItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectableItemCollectionIterator) Response() ProtectableItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectableItemCollectionIterator) Value() ProtectableItem { + if !iter.page.NotDone() { + return ProtectableItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectableItemCollectionIterator type. +func NewProtectableItemCollectionIterator(page ProtectableItemCollectionPage) ProtectableItemCollectionIterator { + return ProtectableItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pic ProtectableItemCollection) IsEmpty() bool { + return pic.Value == nil || len(*pic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pic ProtectableItemCollection) hasNextLink() bool { + return pic.NextLink != nil && len(*pic.NextLink) != 0 +} + +// protectableItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pic ProtectableItemCollection) protectableItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pic.NextLink))) +} + +// ProtectableItemCollectionPage contains a page of ProtectableItem values. +type ProtectableItemCollectionPage struct { + fn func(context.Context, ProtectableItemCollection) (ProtectableItemCollection, error) + pic ProtectableItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectableItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pic) + if err != nil { + return err + } + page.pic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectableItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectableItemCollectionPage) NotDone() bool { + return !page.pic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectableItemCollectionPage) Response() ProtectableItemCollection { + return page.pic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectableItemCollectionPage) Values() []ProtectableItem { + if page.pic.IsEmpty() { + return nil + } + return *page.pic.Value +} + +// Creates a new instance of the ProtectableItemCollectionPage type. +func NewProtectableItemCollectionPage(cur ProtectableItemCollection, getNextPage func(context.Context, ProtectableItemCollection) (ProtectableItemCollection, error)) ProtectableItemCollectionPage { + return ProtectableItemCollectionPage{ + fn: getNextPage, + pic: cur, + } +} + +// ProtectableItemProperties replication protected item custom data details. +type ProtectableItemProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionStatus - The protection status. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ReplicationProtectedItemID - The ARM resource of protected items. + ReplicationProtectedItemID *string `json:"replicationProtectedItemId,omitempty"` + // RecoveryServicesProviderID - The recovery provider ARM Id. + RecoveryServicesProviderID *string `json:"recoveryServicesProviderId,omitempty"` + // ProtectionReadinessErrors - The Current protection readiness errors. + ProtectionReadinessErrors *[]string `json:"protectionReadinessErrors,omitempty"` + // SupportedReplicationProviders - The list of replication providers supported for the protectable item. + SupportedReplicationProviders *[]string `json:"supportedReplicationProviders,omitempty"` + // CustomDetails - The Replication provider custom settings. + CustomDetails BasicConfigurationSettings `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ProtectableItemProperties struct. +func (pip *ProtectableItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + pip.FriendlyName = &friendlyName + } + case "protectionStatus": + if v != nil { + var protectionStatus string + err = json.Unmarshal(*v, &protectionStatus) + if err != nil { + return err + } + pip.ProtectionStatus = &protectionStatus + } + case "replicationProtectedItemId": + if v != nil { + var replicationProtectedItemID string + err = json.Unmarshal(*v, &replicationProtectedItemID) + if err != nil { + return err + } + pip.ReplicationProtectedItemID = &replicationProtectedItemID + } + case "recoveryServicesProviderId": + if v != nil { + var recoveryServicesProviderID string + err = json.Unmarshal(*v, &recoveryServicesProviderID) + if err != nil { + return err + } + pip.RecoveryServicesProviderID = &recoveryServicesProviderID + } + case "protectionReadinessErrors": + if v != nil { + var protectionReadinessErrors []string + err = json.Unmarshal(*v, &protectionReadinessErrors) + if err != nil { + return err + } + pip.ProtectionReadinessErrors = &protectionReadinessErrors + } + case "supportedReplicationProviders": + if v != nil { + var supportedReplicationProviders []string + err = json.Unmarshal(*v, &supportedReplicationProviders) + if err != nil { + return err + } + pip.SupportedReplicationProviders = &supportedReplicationProviders + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicConfigurationSettings(*v) + if err != nil { + return err + } + pip.CustomDetails = customDetails + } + } + } + + return nil +} + +// ProtectableItemQueryParameter query parameter to enumerate Protectable items. +type ProtectableItemQueryParameter struct { + // State - State of the Protectable item query filter. + State *string `json:"state,omitempty"` +} + +// ProtectedItemsQueryParameter query parameter to enumerate protected items. +type ProtectedItemsQueryParameter struct { + // SourceFabricName - The source fabric name filter. + SourceFabricName *string `json:"sourceFabricName,omitempty"` + // RecoveryPlanName - The recovery plan filter. + RecoveryPlanName *string `json:"recoveryPlanName,omitempty"` + // SourceFabricLocation - The source fabric location filter. + SourceFabricLocation *string `json:"sourceFabricLocation,omitempty"` + // FabricObjectID - The fabric object Id filter. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // VCenterName - The vCenter name filter. + VCenterName *string `json:"vCenterName,omitempty"` + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` + // MultiVMGroupCreateOption - Whether Multi VM group is auto created or specified by user. Possible values include: 'AutoCreated', 'UserSpecified' + MultiVMGroupCreateOption MultiVMGroupCreateOption `json:"multiVmGroupCreateOption,omitempty"` + // ProcessServerID - The process server Id filter. + ProcessServerID *string `json:"processServerId,omitempty"` +} + +// ProtectionContainer protection container details. +type ProtectionContainer struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectionContainerProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainer. +func (pc ProtectionContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pc.Properties != nil { + objectMap["properties"] = pc.Properties + } + if pc.Location != nil { + objectMap["location"] = pc.Location + } + return json.Marshal(objectMap) +} + +// ProtectionContainerCollection protection Container collection. +type ProtectionContainerCollection struct { + autorest.Response `json:"-"` + // Value - The Protection Container details. + Value *[]ProtectionContainer `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectionContainerCollectionIterator provides access to a complete listing of ProtectionContainer +// values. +type ProtectionContainerCollectionIterator struct { + i int + page ProtectionContainerCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectionContainerCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionContainerCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionContainerCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectionContainerCollectionIterator) Response() ProtectionContainerCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectionContainerCollectionIterator) Value() ProtectionContainer { + if !iter.page.NotDone() { + return ProtectionContainer{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectionContainerCollectionIterator type. +func NewProtectionContainerCollectionIterator(page ProtectionContainerCollectionPage) ProtectionContainerCollectionIterator { + return ProtectionContainerCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcc ProtectionContainerCollection) IsEmpty() bool { + return pcc.Value == nil || len(*pcc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pcc ProtectionContainerCollection) hasNextLink() bool { + return pcc.NextLink != nil && len(*pcc.NextLink) != 0 +} + +// protectionContainerCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcc ProtectionContainerCollection) protectionContainerCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pcc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcc.NextLink))) +} + +// ProtectionContainerCollectionPage contains a page of ProtectionContainer values. +type ProtectionContainerCollectionPage struct { + fn func(context.Context, ProtectionContainerCollection) (ProtectionContainerCollection, error) + pcc ProtectionContainerCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectionContainerCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pcc) + if err != nil { + return err + } + page.pcc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionContainerCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionContainerCollectionPage) NotDone() bool { + return !page.pcc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionContainerCollectionPage) Response() ProtectionContainerCollection { + return page.pcc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionContainerCollectionPage) Values() []ProtectionContainer { + if page.pcc.IsEmpty() { + return nil + } + return *page.pcc.Value +} + +// Creates a new instance of the ProtectionContainerCollectionPage type. +func NewProtectionContainerCollectionPage(cur ProtectionContainerCollection, getNextPage func(context.Context, ProtectionContainerCollection) (ProtectionContainerCollection, error)) ProtectionContainerCollectionPage { + return ProtectionContainerCollectionPage{ + fn: getNextPage, + pcc: cur, + } +} + +// ProtectionContainerFabricSpecificDetails base class for fabric specific details of container. +type ProtectionContainerFabricSpecificDetails struct { + // InstanceType - READ-ONLY; Gets the class type. Overridden in derived classes. + InstanceType *string `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainerFabricSpecificDetails. +func (pcfsd ProtectionContainerFabricSpecificDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ProtectionContainerMapping protection container mapping object. +type ProtectionContainerMapping struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectionContainerMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainerMapping. +func (pcm ProtectionContainerMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pcm.Properties != nil { + objectMap["properties"] = pcm.Properties + } + if pcm.Location != nil { + objectMap["location"] = pcm.Location + } + return json.Marshal(objectMap) +} + +// ProtectionContainerMappingCollection protection container mapping collection class. +type ProtectionContainerMappingCollection struct { + autorest.Response `json:"-"` + // Value - List of container mappings. + Value *[]ProtectionContainerMapping `json:"value,omitempty"` + // NextLink - Link to fetch rest of the data. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectionContainerMappingCollectionIterator provides access to a complete listing of +// ProtectionContainerMapping values. +type ProtectionContainerMappingCollectionIterator struct { + i int + page ProtectionContainerMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectionContainerMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionContainerMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionContainerMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectionContainerMappingCollectionIterator) Response() ProtectionContainerMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectionContainerMappingCollectionIterator) Value() ProtectionContainerMapping { + if !iter.page.NotDone() { + return ProtectionContainerMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectionContainerMappingCollectionIterator type. +func NewProtectionContainerMappingCollectionIterator(page ProtectionContainerMappingCollectionPage) ProtectionContainerMappingCollectionIterator { + return ProtectionContainerMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcmc ProtectionContainerMappingCollection) IsEmpty() bool { + return pcmc.Value == nil || len(*pcmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pcmc ProtectionContainerMappingCollection) hasNextLink() bool { + return pcmc.NextLink != nil && len(*pcmc.NextLink) != 0 +} + +// protectionContainerMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcmc ProtectionContainerMappingCollection) protectionContainerMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pcmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcmc.NextLink))) +} + +// ProtectionContainerMappingCollectionPage contains a page of ProtectionContainerMapping values. +type ProtectionContainerMappingCollectionPage struct { + fn func(context.Context, ProtectionContainerMappingCollection) (ProtectionContainerMappingCollection, error) + pcmc ProtectionContainerMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectionContainerMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pcmc) + if err != nil { + return err + } + page.pcmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionContainerMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionContainerMappingCollectionPage) NotDone() bool { + return !page.pcmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionContainerMappingCollectionPage) Response() ProtectionContainerMappingCollection { + return page.pcmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionContainerMappingCollectionPage) Values() []ProtectionContainerMapping { + if page.pcmc.IsEmpty() { + return nil + } + return *page.pcmc.Value +} + +// Creates a new instance of the ProtectionContainerMappingCollectionPage type. +func NewProtectionContainerMappingCollectionPage(cur ProtectionContainerMappingCollection, getNextPage func(context.Context, ProtectionContainerMappingCollection) (ProtectionContainerMappingCollection, error)) ProtectionContainerMappingCollectionPage { + return ProtectionContainerMappingCollectionPage{ + fn: getNextPage, + pcmc: cur, + } +} + +// ProtectionContainerMappingProperties protection container mapping properties. +type ProtectionContainerMappingProperties struct { + // TargetProtectionContainerID - Paired protection container ARM ID. + TargetProtectionContainerID *string `json:"targetProtectionContainerId,omitempty"` + // TargetProtectionContainerFriendlyName - Friendly name of paired container. + TargetProtectionContainerFriendlyName *string `json:"targetProtectionContainerFriendlyName,omitempty"` + // ProviderSpecificDetails - Provider specific provider details. + ProviderSpecificDetails BasicProtectionContainerMappingProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` + // Health - Health of pairing. + Health *string `json:"health,omitempty"` + // HealthErrorDetails - Health error. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // PolicyID - Policy ARM Id. + PolicyID *string `json:"policyId,omitempty"` + // State - Association Status. + State *string `json:"state,omitempty"` + // SourceProtectionContainerFriendlyName - Friendly name of source protection container. + SourceProtectionContainerFriendlyName *string `json:"sourceProtectionContainerFriendlyName,omitempty"` + // SourceFabricFriendlyName - Friendly name of source fabric. + SourceFabricFriendlyName *string `json:"sourceFabricFriendlyName,omitempty"` + // TargetFabricFriendlyName - Friendly name of target fabric. + TargetFabricFriendlyName *string `json:"targetFabricFriendlyName,omitempty"` + // PolicyFriendlyName - Friendly name of replication policy. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ProtectionContainerMappingProperties struct. +func (pcmp *ProtectionContainerMappingProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetProtectionContainerId": + if v != nil { + var targetProtectionContainerID string + err = json.Unmarshal(*v, &targetProtectionContainerID) + if err != nil { + return err + } + pcmp.TargetProtectionContainerID = &targetProtectionContainerID + } + case "targetProtectionContainerFriendlyName": + if v != nil { + var targetProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &targetProtectionContainerFriendlyName) + if err != nil { + return err + } + pcmp.TargetProtectionContainerFriendlyName = &targetProtectionContainerFriendlyName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicProtectionContainerMappingProviderSpecificDetails(*v) + if err != nil { + return err + } + pcmp.ProviderSpecificDetails = providerSpecificDetails + } + case "health": + if v != nil { + var health string + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + pcmp.Health = &health + } + case "healthErrorDetails": + if v != nil { + var healthErrorDetails []HealthError + err = json.Unmarshal(*v, &healthErrorDetails) + if err != nil { + return err + } + pcmp.HealthErrorDetails = &healthErrorDetails + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + pcmp.PolicyID = &policyID + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + pcmp.State = &state + } + case "sourceProtectionContainerFriendlyName": + if v != nil { + var sourceProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &sourceProtectionContainerFriendlyName) + if err != nil { + return err + } + pcmp.SourceProtectionContainerFriendlyName = &sourceProtectionContainerFriendlyName + } + case "sourceFabricFriendlyName": + if v != nil { + var sourceFabricFriendlyName string + err = json.Unmarshal(*v, &sourceFabricFriendlyName) + if err != nil { + return err + } + pcmp.SourceFabricFriendlyName = &sourceFabricFriendlyName + } + case "targetFabricFriendlyName": + if v != nil { + var targetFabricFriendlyName string + err = json.Unmarshal(*v, &targetFabricFriendlyName) + if err != nil { + return err + } + pcmp.TargetFabricFriendlyName = &targetFabricFriendlyName + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + pcmp.PolicyFriendlyName = &policyFriendlyName + } + } + } + + return nil +} + +// BasicProtectionContainerMappingProviderSpecificDetails container mapping provider specific details. +type BasicProtectionContainerMappingProviderSpecificDetails interface { + AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) + AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) + AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) + AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) +} + +// ProtectionContainerMappingProviderSpecificDetails container mapping provider specific details. +type ProtectionContainerMappingProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicProtectionContainerMappingProviderSpecificDetails(body []byte) (BasicProtectionContainerMappingProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A): + var apcmd A2AProtectionContainerMappingDetails + err := json.Unmarshal(body, &apcmd) + return apcmd, err + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm): + var imrpcmd InMageRcmProtectionContainerMappingDetails + err := json.Unmarshal(body, &imrpcmd) + return imrpcmd, err + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt): + var vmcpcmd VMwareCbtProtectionContainerMappingDetails + err := json.Unmarshal(body, &vmcpcmd) + return vmcpcmd, err + default: + var pcmpsd ProtectionContainerMappingProviderSpecificDetails + err := json.Unmarshal(body, &pcmpsd) + return pcmpsd, err + } +} +func unmarshalBasicProtectionContainerMappingProviderSpecificDetailsArray(body []byte) ([]BasicProtectionContainerMappingProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pcmpsdArray := make([]BasicProtectionContainerMappingProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pcmpsd, err := unmarshalBasicProtectionContainerMappingProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + pcmpsdArray[index] = pcmpsd + } + return pcmpsdArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) MarshalJSON() ([]byte, error) { + pcmpsd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails + objectMap := make(map[string]interface{}) + if pcmpsd.InstanceType != "" { + objectMap["instanceType"] = pcmpsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return &pcmpsd, true +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &pcmpsd, true +} + +// ProtectionContainerProperties protection profile custom data details. +type ProtectionContainerProperties struct { + // FabricFriendlyName - Fabric friendly name. + FabricFriendlyName *string `json:"fabricFriendlyName,omitempty"` + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // FabricType - The fabric type. + FabricType *string `json:"fabricType,omitempty"` + // ProtectedItemCount - Number of protected PEs. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // PairingStatus - The pairing status of this cloud. + PairingStatus *string `json:"pairingStatus,omitempty"` + // Role - The role of this cloud. + Role *string `json:"role,omitempty"` + // FabricSpecificDetails - Fabric specific details. + FabricSpecificDetails *ProtectionContainerFabricSpecificDetails `json:"fabricSpecificDetails,omitempty"` +} + +// BasicProtectionProfileCustomDetails protection Profile custom input. +type BasicProtectionProfileCustomDetails interface { + AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) + AsNewProtectionProfile() (*NewProtectionProfile, bool) + AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) +} + +// ProtectionProfileCustomDetails protection Profile custom input. +type ProtectionProfileCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +func unmarshalBasicProtectionProfileCustomDetails(body []byte) (BasicProtectionProfileCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeExisting): + var epp ExistingProtectionProfile + err := json.Unmarshal(body, &epp) + return epp, err + case string(ResourceTypeNew): + var npp NewProtectionProfile + err := json.Unmarshal(body, &npp) + return npp, err + default: + var ppcd ProtectionProfileCustomDetails + err := json.Unmarshal(body, &ppcd) + return ppcd, err + } +} +func unmarshalBasicProtectionProfileCustomDetailsArray(body []byte) ([]BasicProtectionProfileCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppcdArray := make([]BasicProtectionProfileCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppcd, err := unmarshalBasicProtectionProfileCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + ppcdArray[index] = ppcd + } + return ppcdArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) MarshalJSON() ([]byte, error) { + ppcd.ResourceType = ResourceTypeProtectionProfileCustomDetails + objectMap := make(map[string]interface{}) + if ppcd.ResourceType != "" { + objectMap["resourceType"] = ppcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return nil, false +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return nil, false +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return &ppcd, true +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &ppcd, true +} + +// ProviderError this class contains the error details per object. +type ProviderError struct { + // ErrorCode - The Error code. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorMessage - The Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // ErrorID - The Provider error Id. + ErrorID *string `json:"errorId,omitempty"` + // PossibleCauses - The possible causes for the error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - The recommended action to resolve the error. + RecommendedAction *string `json:"recommendedAction,omitempty"` +} + +// BasicProviderSpecificRecoveryPointDetails replication provider specific recovery point details. +type BasicProviderSpecificRecoveryPointDetails interface { + AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) + AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) + AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) + AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) +} + +// ProviderSpecificRecoveryPointDetails replication provider specific recovery point details. +type ProviderSpecificRecoveryPointDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicProviderSpecificRecoveryPointDetails(body []byte) (BasicProviderSpecificRecoveryPointDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A): + var arpd A2ARecoveryPointDetails + err := json.Unmarshal(body, &arpd) + return arpd, err + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2): + var imavrpd InMageAzureV2RecoveryPointDetails + err := json.Unmarshal(body, &imavrpd) + return imavrpd, err + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm): + var imrrpd InMageRcmRecoveryPointDetails + err := json.Unmarshal(body, &imrrpd) + return imrrpd, err + default: + var psrpd ProviderSpecificRecoveryPointDetails + err := json.Unmarshal(body, &psrpd) + return psrpd, err + } +} +func unmarshalBasicProviderSpecificRecoveryPointDetailsArray(body []byte) ([]BasicProviderSpecificRecoveryPointDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + psrpdArray := make([]BasicProviderSpecificRecoveryPointDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + psrpd, err := unmarshalBasicProviderSpecificRecoveryPointDetails(*rawMessage) + if err != nil { + return nil, err + } + psrpdArray[index] = psrpd + } + return psrpdArray, nil +} + +// MarshalJSON is the custom marshaler for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) MarshalJSON() ([]byte, error) { + psrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails + objectMap := make(map[string]interface{}) + if psrpd.InstanceType != "" { + objectMap["instanceType"] = psrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return &psrpd, true +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &psrpd, true +} + +// PushInstallerDetails push installer details. +type PushInstallerDetails struct { + // ID - READ-ONLY; The push installer Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The push installer name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The push installer Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The push installer Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the push installer. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the push installer. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for PushInstallerDetails. +func (pid PushInstallerDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RcmProxyDetails RCM proxy details. +type RcmProxyDetails struct { + // ID - READ-ONLY; The RCM proxy Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The RCM proxy name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The RCM proxy Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The RCM proxy Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // ClientAuthenticationType - READ-ONLY; The client authentication type. + ClientAuthenticationType *string `json:"clientAuthenticationType,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the RCM proxy. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the RCM proxy. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for RcmProxyDetails. +func (rpd RcmProxyDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// BasicRecoveryAvailabilitySetCustomDetails recovery Availability Set custom input. +type BasicRecoveryAvailabilitySetCustomDetails interface { + AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) + AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) +} + +// RecoveryAvailabilitySetCustomDetails recovery Availability Set custom input. +type RecoveryAvailabilitySetCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails', 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryAvailabilitySetCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryAvailabilitySetCustomDetails(body []byte) (BasicRecoveryAvailabilitySetCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting): + var eras ExistingRecoveryAvailabilitySet + err := json.Unmarshal(body, &eras) + return eras, err + default: + var rascd RecoveryAvailabilitySetCustomDetails + err := json.Unmarshal(body, &rascd) + return rascd, err + } +} +func unmarshalBasicRecoveryAvailabilitySetCustomDetailsArray(body []byte) ([]BasicRecoveryAvailabilitySetCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rascdArray := make([]BasicRecoveryAvailabilitySetCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rascd, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rascdArray[index] = rascd + } + return rascdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) MarshalJSON() ([]byte, error) { + rascd.ResourceType = ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails + objectMap := make(map[string]interface{}) + if rascd.ResourceType != "" { + objectMap["resourceType"] = rascd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryAvailabilitySet is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) { + return nil, false +} + +// AsRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) { + return &rascd, true +} + +// AsBasicRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsBasicRecoveryAvailabilitySetCustomDetails() (BasicRecoveryAvailabilitySetCustomDetails, bool) { + return &rascd, true +} + +// RecoveryPlan recovery plan details. +type RecoveryPlan struct { + autorest.Response `json:"-"` + // Properties - The custom details. + Properties *RecoveryPlanProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlan. +func (rp RecoveryPlan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.Properties != nil { + objectMap["properties"] = rp.Properties + } + if rp.Location != nil { + objectMap["location"] = rp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryPlanA2ADetails recovery plan A2A specific details. +type RecoveryPlanA2ADetails struct { + // PrimaryZone - The primary zone. + PrimaryZone *string `json:"primaryZone,omitempty"` + // RecoveryZone - The recovery zone. + RecoveryZone *string `json:"recoveryZone,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails', 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) MarshalJSON() ([]byte, error) { + rpad.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpad.PrimaryZone != nil { + objectMap["primaryZone"] = rpad.PrimaryZone + } + if rpad.RecoveryZone != nil { + objectMap["recoveryZone"] = rpad.RecoveryZone + } + if rpad.InstanceType != "" { + objectMap["instanceType"] = rpad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2ADetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) { + return &rpad, true +} + +// AsRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsBasicRecoveryPlanProviderSpecificDetails() (BasicRecoveryPlanProviderSpecificDetails, bool) { + return &rpad, true +} + +// RecoveryPlanA2AFailoverInput recovery plan A2A failover input. +type RecoveryPlanA2AFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'Latest', 'LatestApplicationConsistent', 'LatestCrashConsistent', 'LatestProcessed' + RecoveryPointType A2ARpRecoveryPointType `json:"recoveryPointType,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for TFO or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // MultiVMSyncPointOption - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. Possible values include: 'UseMultiVMSyncRecoveryPoint', 'UsePerVMRecoveryPoint' + MultiVMSyncPointOption MultiVMSyncPointOption `json:"multiVmSyncPointOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) MarshalJSON() ([]byte, error) { + rpafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpafi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpafi.RecoveryPointType + } + if rpafi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = rpafi.CloudServiceCreationOption + } + if rpafi.MultiVMSyncPointOption != "" { + objectMap["multiVmSyncPointOption"] = rpafi.MultiVMSyncPointOption + } + if rpafi.InstanceType != "" { + objectMap["instanceType"] = rpafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return &rpafi, true +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpafi, true +} + +// RecoveryPlanA2AInput recovery plan A2A input. +type RecoveryPlanA2AInput struct { + // PrimaryZone - The primary zone. + PrimaryZone *string `json:"primaryZone,omitempty"` + // RecoveryZone - The recovery zone. + RecoveryZone *string `json:"recoveryZone,omitempty"` + // PrimaryExtendedLocation - The primary extended location. + PrimaryExtendedLocation *ExtendedLocation `json:"primaryExtendedLocation,omitempty"` + // RecoveryExtendedLocation - The recovery extended location. + RecoveryExtendedLocation *ExtendedLocation `json:"recoveryExtendedLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) MarshalJSON() ([]byte, error) { + rpai.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpai.PrimaryZone != nil { + objectMap["primaryZone"] = rpai.PrimaryZone + } + if rpai.RecoveryZone != nil { + objectMap["recoveryZone"] = rpai.RecoveryZone + } + if rpai.PrimaryExtendedLocation != nil { + objectMap["primaryExtendedLocation"] = rpai.PrimaryExtendedLocation + } + if rpai.RecoveryExtendedLocation != nil { + objectMap["recoveryExtendedLocation"] = rpai.RecoveryExtendedLocation + } + if rpai.InstanceType != "" { + objectMap["instanceType"] = rpai.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) { + return &rpai, true +} + +// AsRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsBasicRecoveryPlanProviderSpecificInput() (BasicRecoveryPlanProviderSpecificInput, bool) { + return &rpai, true +} + +// RecoveryPlanAction recovery plan action details. +type RecoveryPlanAction struct { + // ActionName - The action name. + ActionName *string `json:"actionName,omitempty"` + // FailoverTypes - The list of failover types. + FailoverTypes *[]ReplicationProtectedItemOperation `json:"failoverTypes,omitempty"` + // FailoverDirections - The list of failover directions. + FailoverDirections *[]PossibleOperationsDirections `json:"failoverDirections,omitempty"` + // CustomDetails - The custom details. + CustomDetails BasicRecoveryPlanActionDetails `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanAction struct. +func (rpa *RecoveryPlanAction) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "actionName": + if v != nil { + var actionName string + err = json.Unmarshal(*v, &actionName) + if err != nil { + return err + } + rpa.ActionName = &actionName + } + case "failoverTypes": + if v != nil { + var failoverTypes []ReplicationProtectedItemOperation + err = json.Unmarshal(*v, &failoverTypes) + if err != nil { + return err + } + rpa.FailoverTypes = &failoverTypes + } + case "failoverDirections": + if v != nil { + var failoverDirections []PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirections) + if err != nil { + return err + } + rpa.FailoverDirections = &failoverDirections + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicRecoveryPlanActionDetails(*v) + if err != nil { + return err + } + rpa.CustomDetails = customDetails + } + } + } + + return nil +} + +// BasicRecoveryPlanActionDetails recovery plan action custom details. +type BasicRecoveryPlanActionDetails interface { + AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) + AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) + AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) + AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) +} + +// RecoveryPlanActionDetails recovery plan action custom details. +type RecoveryPlanActionDetails struct { + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanActionDetails(body []byte) (BasicRecoveryPlanActionDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAutomationRunbookActionDetails): + var rparad RecoveryPlanAutomationRunbookActionDetails + err := json.Unmarshal(body, &rparad) + return rparad, err + case string(InstanceTypeManualActionDetails): + var rpmad RecoveryPlanManualActionDetails + err := json.Unmarshal(body, &rpmad) + return rpmad, err + case string(InstanceTypeScriptActionDetails): + var rpsad RecoveryPlanScriptActionDetails + err := json.Unmarshal(body, &rpsad) + return rpsad, err + default: + var rpad RecoveryPlanActionDetails + err := json.Unmarshal(body, &rpad) + return rpad, err + } +} +func unmarshalBasicRecoveryPlanActionDetailsArray(body []byte) ([]BasicRecoveryPlanActionDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpadArray := make([]BasicRecoveryPlanActionDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpad, err := unmarshalBasicRecoveryPlanActionDetails(*rawMessage) + if err != nil { + return nil, err + } + rpadArray[index] = rpad + } + return rpadArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) MarshalJSON() ([]byte, error) { + rpad.InstanceType = InstanceTypeRecoveryPlanActionDetails + objectMap := make(map[string]interface{}) + if rpad.InstanceType != "" { + objectMap["instanceType"] = rpad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return &rpad, true +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpad, true +} + +// RecoveryPlanAutomationRunbookActionDetails recovery plan Automation runbook action details. +type RecoveryPlanAutomationRunbookActionDetails struct { + // RunbookID - The runbook ARM Id. + RunbookID *string `json:"runbookId,omitempty"` + // Timeout - The runbook timeout. + Timeout *string `json:"timeout,omitempty"` + // FabricLocation - The fabric location. Possible values include: 'Primary', 'Recovery' + FabricLocation RecoveryPlanActionLocation `json:"fabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) MarshalJSON() ([]byte, error) { + rparad.InstanceType = InstanceTypeAutomationRunbookActionDetails + objectMap := make(map[string]interface{}) + if rparad.RunbookID != nil { + objectMap["runbookId"] = rparad.RunbookID + } + if rparad.Timeout != nil { + objectMap["timeout"] = rparad.Timeout + } + if rparad.FabricLocation != "" { + objectMap["fabricLocation"] = rparad.FabricLocation + } + if rparad.InstanceType != "" { + objectMap["instanceType"] = rparad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return &rparad, true +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rparad, true +} + +// RecoveryPlanCollection recovery plan collection details. +type RecoveryPlanCollection struct { + autorest.Response `json:"-"` + // Value - The list of recovery plans. + Value *[]RecoveryPlan `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryPlanCollectionIterator provides access to a complete listing of RecoveryPlan values. +type RecoveryPlanCollectionIterator struct { + i int + page RecoveryPlanCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryPlanCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPlanCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryPlanCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryPlanCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryPlanCollectionIterator) Response() RecoveryPlanCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryPlanCollectionIterator) Value() RecoveryPlan { + if !iter.page.NotDone() { + return RecoveryPlan{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryPlanCollectionIterator type. +func NewRecoveryPlanCollectionIterator(page RecoveryPlanCollectionPage) RecoveryPlanCollectionIterator { + return RecoveryPlanCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (RPCVar RecoveryPlanCollection) IsEmpty() bool { + return RPCVar.Value == nil || len(*RPCVar.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (RPCVar RecoveryPlanCollection) hasNextLink() bool { + return RPCVar.NextLink != nil && len(*RPCVar.NextLink) != 0 +} + +// recoveryPlanCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (RPCVar RecoveryPlanCollection) recoveryPlanCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !RPCVar.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(RPCVar.NextLink))) +} + +// RecoveryPlanCollectionPage contains a page of RecoveryPlan values. +type RecoveryPlanCollectionPage struct { + fn func(context.Context, RecoveryPlanCollection) (RecoveryPlanCollection, error) + RPCVar RecoveryPlanCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryPlanCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPlanCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.RPCVar) + if err != nil { + return err + } + page.RPCVar = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryPlanCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryPlanCollectionPage) NotDone() bool { + return !page.RPCVar.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryPlanCollectionPage) Response() RecoveryPlanCollection { + return page.RPCVar +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryPlanCollectionPage) Values() []RecoveryPlan { + if page.RPCVar.IsEmpty() { + return nil + } + return *page.RPCVar.Value +} + +// Creates a new instance of the RecoveryPlanCollectionPage type. +func NewRecoveryPlanCollectionPage(cur RecoveryPlanCollection, getNextPage func(context.Context, RecoveryPlanCollection) (RecoveryPlanCollection, error)) RecoveryPlanCollectionPage { + return RecoveryPlanCollectionPage{ + fn: getNextPage, + RPCVar: cur, + } +} + +// RecoveryPlanGroup recovery plan group details. +type RecoveryPlanGroup struct { + // GroupType - The group type. Possible values include: 'Shutdown', 'Boot', 'Failover' + GroupType RecoveryPlanGroupType `json:"groupType,omitempty"` + // ReplicationProtectedItems - The list of protected items. + ReplicationProtectedItems *[]RecoveryPlanProtectedItem `json:"replicationProtectedItems,omitempty"` + // StartGroupActions - The start group actions. + StartGroupActions *[]RecoveryPlanAction `json:"startGroupActions,omitempty"` + // EndGroupActions - The end group actions. + EndGroupActions *[]RecoveryPlanAction `json:"endGroupActions,omitempty"` +} + +// BasicRecoveryPlanGroupTaskDetails this class represents the recovery plan group task. +type BasicRecoveryPlanGroupTaskDetails interface { + AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) + AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) +} + +// RecoveryPlanGroupTaskDetails this class represents the recovery plan group task. +type RecoveryPlanGroupTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // GroupID - The group identifier. + GroupID *string `json:"groupId,omitempty"` + // RpGroupType - The group type. + RpGroupType *string `json:"rpGroupType,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanGroupTaskDetails(body []byte) (BasicRecoveryPlanGroupTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeRecoveryPlanShutdownGroupTaskDetails): + var rpsgtd RecoveryPlanShutdownGroupTaskDetails + err := json.Unmarshal(body, &rpsgtd) + return rpsgtd, err + default: + var rpgtd RecoveryPlanGroupTaskDetails + err := json.Unmarshal(body, &rpgtd) + return rpgtd, err + } +} +func unmarshalBasicRecoveryPlanGroupTaskDetailsArray(body []byte) ([]BasicRecoveryPlanGroupTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpgtdArray := make([]BasicRecoveryPlanGroupTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpgtd, err := unmarshalBasicRecoveryPlanGroupTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + rpgtdArray[index] = rpgtd + } + return rpgtdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) MarshalJSON() ([]byte, error) { + rpgtd.InstanceType = InstanceTypeRecoveryPlanGroupTaskDetails + objectMap := make(map[string]interface{}) + if rpgtd.Name != nil { + objectMap["name"] = rpgtd.Name + } + if rpgtd.GroupID != nil { + objectMap["groupId"] = rpgtd.GroupID + } + if rpgtd.RpGroupType != nil { + objectMap["rpGroupType"] = rpgtd.RpGroupType + } + if rpgtd.ChildTasks != nil { + objectMap["childTasks"] = rpgtd.ChildTasks + } + if rpgtd.InstanceType != "" { + objectMap["instanceType"] = rpgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return &rpgtd, true +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return &rpgtd, true +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &rpgtd, true +} + +// RecoveryPlanHyperVReplicaAzureFailbackInput recovery plan HVR Azure failback input. +type RecoveryPlanHyperVReplicaAzureFailbackInput struct { + // DataSyncOption - The data sync option. Possible values include: 'ForDownTime', 'ForSynchronization' + DataSyncOption DataSyncStatus `json:"dataSyncOption,omitempty"` + // RecoveryVMCreationOption - The ALR option. Possible values include: 'CreateVMIfNotFound', 'NoAction' + RecoveryVMCreationOption AlternateLocationRecoveryOption `json:"recoveryVmCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) MarshalJSON() ([]byte, error) { + rphvrafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback + objectMap := make(map[string]interface{}) + if rphvrafi.DataSyncOption != "" { + objectMap["dataSyncOption"] = rphvrafi.DataSyncOption + } + if rphvrafi.RecoveryVMCreationOption != "" { + objectMap["recoveryVmCreationOption"] = rphvrafi.RecoveryVMCreationOption + } + if rphvrafi.InstanceType != "" { + objectMap["instanceType"] = rphvrafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return &rphvrafi, true +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rphvrafi, true +} + +// RecoveryPlanHyperVReplicaAzureFailoverInput recovery plan HVR Azure failover input. +type RecoveryPlanHyperVReplicaAzureFailoverInput struct { + // PrimaryKekCertificatePfx - The primary KEK certificate PFX. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - The secondary KEK certificate PFX. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointType - The recovery point type. Possible values include: 'HyperVReplicaAzureRpRecoveryPointTypeLatest', 'HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent', 'HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed' + RecoveryPointType HyperVReplicaAzureRpRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) MarshalJSON() ([]byte, error) { + rphvrafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if rphvrafi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = rphvrafi.PrimaryKekCertificatePfx + } + if rphvrafi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = rphvrafi.SecondaryKekCertificatePfx + } + if rphvrafi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rphvrafi.RecoveryPointType + } + if rphvrafi.InstanceType != "" { + objectMap["instanceType"] = rphvrafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return &rphvrafi, true +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rphvrafi, true +} + +// RecoveryPlanInMageAzureV2FailoverInput recovery plan InMageAzureV2 failover input. +type RecoveryPlanInMageAzureV2FailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'InMageV2RpRecoveryPointTypeLatest', 'InMageV2RpRecoveryPointTypeLatestApplicationConsistent', 'InMageV2RpRecoveryPointTypeLatestCrashConsistent', 'InMageV2RpRecoveryPointTypeLatestProcessed' + RecoveryPointType InMageV2RpRecoveryPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) MarshalJSON() ([]byte, error) { + rpimavfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if rpimavfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimavfi.RecoveryPointType + } + if rpimavfi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimavfi.UseMultiVMSyncPoint + } + if rpimavfi.InstanceType != "" { + objectMap["instanceType"] = rpimavfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return &rpimavfi, true +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimavfi, true +} + +// RecoveryPlanInMageFailoverInput recovery plan InMage failover input. +type RecoveryPlanInMageFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'RpInMageRecoveryPointTypeLatestTime', 'RpInMageRecoveryPointTypeLatestTag', 'RpInMageRecoveryPointTypeCustom' + RecoveryPointType RpInMageRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) MarshalJSON() ([]byte, error) { + rpimfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if rpimfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimfi.RecoveryPointType + } + if rpimfi.InstanceType != "" { + objectMap["instanceType"] = rpimfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return &rpimfi, true +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimfi, true +} + +// RecoveryPlanInMageRcmFailbackFailoverInput recovery plan InMageRcmFailback failover input. +type RecoveryPlanInMageRcmFailbackFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'ApplicationConsistent', 'CrashConsistent' + RecoveryPointType InMageRcmFailbackRecoveryPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) MarshalJSON() ([]byte, error) { + rpimrffi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if rpimrffi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimrffi.RecoveryPointType + } + if rpimrffi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimrffi.UseMultiVMSyncPoint + } + if rpimrffi.InstanceType != "" { + objectMap["instanceType"] = rpimrffi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return &rpimrffi, true +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimrffi, true +} + +// RecoveryPlanInMageRcmFailoverInput recovery plan InMageRcm failover input. +type RecoveryPlanInMageRcmFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'RecoveryPlanPointTypeLatest', 'RecoveryPlanPointTypeLatestApplicationConsistent', 'RecoveryPlanPointTypeLatestCrashConsistent', 'RecoveryPlanPointTypeLatestProcessed' + RecoveryPointType RecoveryPlanPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) MarshalJSON() ([]byte, error) { + rpimrfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if rpimrfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimrfi.RecoveryPointType + } + if rpimrfi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimrfi.UseMultiVMSyncPoint + } + if rpimrfi.InstanceType != "" { + objectMap["instanceType"] = rpimrfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return &rpimrfi, true +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimrfi, true +} + +// RecoveryPlanManualActionDetails recovery plan manual action details. +type RecoveryPlanManualActionDetails struct { + // Description - The manual action description. + Description *string `json:"description,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) MarshalJSON() ([]byte, error) { + rpmad.InstanceType = InstanceTypeManualActionDetails + objectMap := make(map[string]interface{}) + if rpmad.Description != nil { + objectMap["description"] = rpmad.Description + } + if rpmad.InstanceType != "" { + objectMap["instanceType"] = rpmad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return &rpmad, true +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpmad, true +} + +// RecoveryPlanPlannedFailoverInput recovery plan planned failover input. +type RecoveryPlanPlannedFailoverInput struct { + // Properties - The recovery plan planned failover input properties. + Properties *RecoveryPlanPlannedFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanPlannedFailoverInputProperties recovery plan planned failover input properties. +type RecoveryPlanPlannedFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanPlannedFailoverInputProperties struct. +func (rppfip *RecoveryPlanPlannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rppfip.FailoverDirection = failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rppfip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanProperties recovery plan properties. +type RecoveryPlanProperties struct { + // FriendlyName - The friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // PrimaryFabricID - The primary fabric Id. + PrimaryFabricID *string `json:"primaryFabricId,omitempty"` + // PrimaryFabricFriendlyName - The primary fabric friendly name. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // RecoveryFabricID - The recovery fabric Id. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // RecoveryFabricFriendlyName - The recovery fabric friendly name. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // FailoverDeploymentModel - The failover deployment model. + FailoverDeploymentModel *string `json:"failoverDeploymentModel,omitempty"` + // ReplicationProviders - The list of replication providers. + ReplicationProviders *[]string `json:"replicationProviders,omitempty"` + // AllowedOperations - The list of allowed operations. + AllowedOperations *[]string `json:"allowedOperations,omitempty"` + // LastPlannedFailoverTime - The start time of the last planned failover. + LastPlannedFailoverTime *date.Time `json:"lastPlannedFailoverTime,omitempty"` + // LastUnplannedFailoverTime - The start time of the last unplanned failover. + LastUnplannedFailoverTime *date.Time `json:"lastUnplannedFailoverTime,omitempty"` + // LastTestFailoverTime - The start time of the last test failover. + LastTestFailoverTime *date.Time `json:"lastTestFailoverTime,omitempty"` + // CurrentScenario - The current scenario details. + CurrentScenario *CurrentScenarioDetails `json:"currentScenario,omitempty"` + // CurrentScenarioStatus - The recovery plan status. + CurrentScenarioStatus *string `json:"currentScenarioStatus,omitempty"` + // CurrentScenarioStatusDescription - The recovery plan status description. + CurrentScenarioStatusDescription *string `json:"currentScenarioStatusDescription,omitempty"` + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` + // ProviderSpecificDetails - The provider id and provider specific details. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanProperties struct. +func (rpp *RecoveryPlanProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpp.FriendlyName = &friendlyName + } + case "primaryFabricId": + if v != nil { + var primaryFabricID string + err = json.Unmarshal(*v, &primaryFabricID) + if err != nil { + return err + } + rpp.PrimaryFabricID = &primaryFabricID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + rpp.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + rpp.RecoveryFabricID = &recoveryFabricID + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + rpp.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "failoverDeploymentModel": + if v != nil { + var failoverDeploymentModel string + err = json.Unmarshal(*v, &failoverDeploymentModel) + if err != nil { + return err + } + rpp.FailoverDeploymentModel = &failoverDeploymentModel + } + case "replicationProviders": + if v != nil { + var replicationProviders []string + err = json.Unmarshal(*v, &replicationProviders) + if err != nil { + return err + } + rpp.ReplicationProviders = &replicationProviders + } + case "allowedOperations": + if v != nil { + var allowedOperations []string + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + rpp.AllowedOperations = &allowedOperations + } + case "lastPlannedFailoverTime": + if v != nil { + var lastPlannedFailoverTime date.Time + err = json.Unmarshal(*v, &lastPlannedFailoverTime) + if err != nil { + return err + } + rpp.LastPlannedFailoverTime = &lastPlannedFailoverTime + } + case "lastUnplannedFailoverTime": + if v != nil { + var lastUnplannedFailoverTime date.Time + err = json.Unmarshal(*v, &lastUnplannedFailoverTime) + if err != nil { + return err + } + rpp.LastUnplannedFailoverTime = &lastUnplannedFailoverTime + } + case "lastTestFailoverTime": + if v != nil { + var lastTestFailoverTime date.Time + err = json.Unmarshal(*v, &lastTestFailoverTime) + if err != nil { + return err + } + rpp.LastTestFailoverTime = &lastTestFailoverTime + } + case "currentScenario": + if v != nil { + var currentScenario CurrentScenarioDetails + err = json.Unmarshal(*v, ¤tScenario) + if err != nil { + return err + } + rpp.CurrentScenario = ¤tScenario + } + case "currentScenarioStatus": + if v != nil { + var currentScenarioStatus string + err = json.Unmarshal(*v, ¤tScenarioStatus) + if err != nil { + return err + } + rpp.CurrentScenarioStatus = ¤tScenarioStatus + } + case "currentScenarioStatusDescription": + if v != nil { + var currentScenarioStatusDescription string + err = json.Unmarshal(*v, ¤tScenarioStatusDescription) + if err != nil { + return err + } + rpp.CurrentScenarioStatusDescription = ¤tScenarioStatusDescription + } + case "groups": + if v != nil { + var groups []RecoveryPlanGroup + err = json.Unmarshal(*v, &groups) + if err != nil { + return err + } + rpp.Groups = &groups + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificDetailsArray(*v) + if err != nil { + return err + } + rpp.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanProtectedItem recovery plan protected item. +type RecoveryPlanProtectedItem struct { + // ID - The ARM Id of the recovery plan protected item. + ID *string `json:"id,omitempty"` + // VirtualMachineID - The virtual machine Id. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` +} + +// BasicRecoveryPlanProviderSpecificDetails recovery plan provider specific details. +type BasicRecoveryPlanProviderSpecificDetails interface { + AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) + AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) +} + +// RecoveryPlanProviderSpecificDetails recovery plan provider specific details. +type RecoveryPlanProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails', 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificDetails(body []byte) (BasicRecoveryPlanProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A): + var rpad RecoveryPlanA2ADetails + err := json.Unmarshal(body, &rpad) + return rpad, err + default: + var rppsd RecoveryPlanProviderSpecificDetails + err := json.Unmarshal(body, &rppsd) + return rppsd, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificDetailsArray(body []byte) ([]BasicRecoveryPlanProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsdArray := make([]BasicRecoveryPlanProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsd, err := unmarshalBasicRecoveryPlanProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + rppsdArray[index] = rppsd + } + return rppsdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) MarshalJSON() ([]byte, error) { + rppsd.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails + objectMap := make(map[string]interface{}) + if rppsd.InstanceType != "" { + objectMap["instanceType"] = rppsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2ADetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) { + return &rppsd, true +} + +// AsBasicRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsBasicRecoveryPlanProviderSpecificDetails() (BasicRecoveryPlanProviderSpecificDetails, bool) { + return &rppsd, true +} + +// BasicRecoveryPlanProviderSpecificFailoverInput recovery plan provider specific failover input. +type BasicRecoveryPlanProviderSpecificFailoverInput interface { + AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) + AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) + AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) + AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) + AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) + AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) + AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) + AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) +} + +// RecoveryPlanProviderSpecificFailoverInput recovery plan provider specific failover input. +type RecoveryPlanProviderSpecificFailoverInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificFailoverInput(body []byte) (BasicRecoveryPlanProviderSpecificFailoverInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A): + var rpafi RecoveryPlanA2AFailoverInput + err := json.Unmarshal(body, &rpafi) + return rpafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback): + var rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput + err := json.Unmarshal(body, &rphvrafi) + return rphvrafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure): + var rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput + err := json.Unmarshal(body, &rphvrafi) + return rphvrafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2): + var rpimavfi RecoveryPlanInMageAzureV2FailoverInput + err := json.Unmarshal(body, &rpimavfi) + return rpimavfi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage): + var rpimfi RecoveryPlanInMageFailoverInput + err := json.Unmarshal(body, &rpimfi) + return rpimfi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback): + var rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput + err := json.Unmarshal(body, &rpimrffi) + return rpimrffi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm): + var rpimrfi RecoveryPlanInMageRcmFailoverInput + err := json.Unmarshal(body, &rpimrfi) + return rpimrfi, err + default: + var rppsfi RecoveryPlanProviderSpecificFailoverInput + err := json.Unmarshal(body, &rppsfi) + return rppsfi, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(body []byte) ([]BasicRecoveryPlanProviderSpecificFailoverInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsfiArray := make([]BasicRecoveryPlanProviderSpecificFailoverInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsfi, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInput(*rawMessage) + if err != nil { + return nil, err + } + rppsfiArray[index] = rppsfi + } + return rppsfiArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) MarshalJSON() ([]byte, error) { + rppsfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput + objectMap := make(map[string]interface{}) + if rppsfi.InstanceType != "" { + objectMap["instanceType"] = rppsfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return &rppsfi, true +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rppsfi, true +} + +// BasicRecoveryPlanProviderSpecificInput recovery plan provider specific input base class. +type BasicRecoveryPlanProviderSpecificInput interface { + AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) + AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) +} + +// RecoveryPlanProviderSpecificInput recovery plan provider specific input base class. +type RecoveryPlanProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificInput(body []byte) (BasicRecoveryPlanProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A): + var rpai RecoveryPlanA2AInput + err := json.Unmarshal(body, &rpai) + return rpai, err + default: + var rppsi RecoveryPlanProviderSpecificInput + err := json.Unmarshal(body, &rppsi) + return rppsi, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificInputArray(body []byte) ([]BasicRecoveryPlanProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsiArray := make([]BasicRecoveryPlanProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsi, err := unmarshalBasicRecoveryPlanProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rppsiArray[index] = rppsi + } + return rppsiArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) MarshalJSON() ([]byte, error) { + rppsi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput + objectMap := make(map[string]interface{}) + if rppsi.InstanceType != "" { + objectMap["instanceType"] = rppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) { + return &rppsi, true +} + +// AsBasicRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsBasicRecoveryPlanProviderSpecificInput() (BasicRecoveryPlanProviderSpecificInput, bool) { + return &rppsi, true +} + +// RecoveryPlanScriptActionDetails recovery plan script action details. +type RecoveryPlanScriptActionDetails struct { + // Path - The script path. + Path *string `json:"path,omitempty"` + // Timeout - The script timeout. + Timeout *string `json:"timeout,omitempty"` + // FabricLocation - The fabric location. Possible values include: 'Primary', 'Recovery' + FabricLocation RecoveryPlanActionLocation `json:"fabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) MarshalJSON() ([]byte, error) { + rpsad.InstanceType = InstanceTypeScriptActionDetails + objectMap := make(map[string]interface{}) + if rpsad.Path != nil { + objectMap["path"] = rpsad.Path + } + if rpsad.Timeout != nil { + objectMap["timeout"] = rpsad.Timeout + } + if rpsad.FabricLocation != "" { + objectMap["fabricLocation"] = rpsad.FabricLocation + } + if rpsad.InstanceType != "" { + objectMap["instanceType"] = rpsad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return &rpsad, true +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpsad, true +} + +// RecoveryPlanShutdownGroupTaskDetails this class represents the recovery plan shutdown group task +// details. +type RecoveryPlanShutdownGroupTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // GroupID - The group identifier. + GroupID *string `json:"groupId,omitempty"` + // RpGroupType - The group type. + RpGroupType *string `json:"rpGroupType,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) MarshalJSON() ([]byte, error) { + rpsgtd.InstanceType = InstanceTypeRecoveryPlanShutdownGroupTaskDetails + objectMap := make(map[string]interface{}) + if rpsgtd.Name != nil { + objectMap["name"] = rpsgtd.Name + } + if rpsgtd.GroupID != nil { + objectMap["groupId"] = rpsgtd.GroupID + } + if rpsgtd.RpGroupType != nil { + objectMap["rpGroupType"] = rpsgtd.RpGroupType + } + if rpsgtd.ChildTasks != nil { + objectMap["childTasks"] = rpsgtd.ChildTasks + } + if rpsgtd.InstanceType != "" { + objectMap["instanceType"] = rpsgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// RecoveryPlanTestFailoverCleanupInput recovery plan test failover cleanup input. +type RecoveryPlanTestFailoverCleanupInput struct { + // Properties - The recovery plan test failover cleanup input properties. + Properties *RecoveryPlanTestFailoverCleanupInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanTestFailoverCleanupInputProperties recovery plan test failover cleanup input properties. +type RecoveryPlanTestFailoverCleanupInputProperties struct { + // Comments - The test failover cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// RecoveryPlanTestFailoverInput recovery plan test failover input. +type RecoveryPlanTestFailoverInput struct { + // Properties - The recovery plan test failover input properties. + Properties *RecoveryPlanTestFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanTestFailoverInputProperties recovery plan test failover input properties. +type RecoveryPlanTestFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // NetworkType - The network type to be used for test failover. + NetworkType *string `json:"networkType,omitempty"` + // NetworkID - The Id of the network to be used for test failover. + NetworkID *string `json:"networkId,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanTestFailoverInputProperties struct. +func (rptfip *RecoveryPlanTestFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rptfip.FailoverDirection = failoverDirection + } + case "networkType": + if v != nil { + var networkType string + err = json.Unmarshal(*v, &networkType) + if err != nil { + return err + } + rptfip.NetworkType = &networkType + } + case "networkId": + if v != nil { + var networkID string + err = json.Unmarshal(*v, &networkID) + if err != nil { + return err + } + rptfip.NetworkID = &networkID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rptfip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanUnplannedFailoverInput recovery plan unplanned failover input. +type RecoveryPlanUnplannedFailoverInput struct { + // Properties - The recovery plan unplanned failover input properties. + Properties *RecoveryPlanUnplannedFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanUnplannedFailoverInputProperties recovery plan unplanned failover input properties. +type RecoveryPlanUnplannedFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // SourceSiteOperations - A value indicating whether source site operations are required. Possible values include: 'Required', 'NotRequired' + SourceSiteOperations SourceSiteOperations `json:"sourceSiteOperations,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanUnplannedFailoverInputProperties struct. +func (rpufip *RecoveryPlanUnplannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rpufip.FailoverDirection = failoverDirection + } + case "sourceSiteOperations": + if v != nil { + var sourceSiteOperations SourceSiteOperations + err = json.Unmarshal(*v, &sourceSiteOperations) + if err != nil { + return err + } + rpufip.SourceSiteOperations = sourceSiteOperations + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rpufip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPoint recovery point. +type RecoveryPoint struct { + autorest.Response `json:"-"` + // Properties - The recovery point properties. + Properties *RecoveryPointProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPoint. +func (rp RecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.Properties != nil { + objectMap["properties"] = rp.Properties + } + if rp.Location != nil { + objectMap["location"] = rp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryPointCollection collection of recovery point details. +type RecoveryPointCollection struct { + autorest.Response `json:"-"` + // Value - The recovery point details. + Value *[]RecoveryPoint `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryPointCollectionIterator provides access to a complete listing of RecoveryPoint values. +type RecoveryPointCollectionIterator struct { + i int + page RecoveryPointCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryPointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryPointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryPointCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryPointCollectionIterator) Response() RecoveryPointCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryPointCollectionIterator) Value() RecoveryPoint { + if !iter.page.NotDone() { + return RecoveryPoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryPointCollectionIterator type. +func NewRecoveryPointCollectionIterator(page RecoveryPointCollectionPage) RecoveryPointCollectionIterator { + return RecoveryPointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (RPCVar RecoveryPointCollection) IsEmpty() bool { + return RPCVar.Value == nil || len(*RPCVar.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (RPCVar RecoveryPointCollection) hasNextLink() bool { + return RPCVar.NextLink != nil && len(*RPCVar.NextLink) != 0 +} + +// recoveryPointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (RPCVar RecoveryPointCollection) recoveryPointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !RPCVar.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(RPCVar.NextLink))) +} + +// RecoveryPointCollectionPage contains a page of RecoveryPoint values. +type RecoveryPointCollectionPage struct { + fn func(context.Context, RecoveryPointCollection) (RecoveryPointCollection, error) + RPCVar RecoveryPointCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryPointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.RPCVar) + if err != nil { + return err + } + page.RPCVar = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryPointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryPointCollectionPage) NotDone() bool { + return !page.RPCVar.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryPointCollectionPage) Response() RecoveryPointCollection { + return page.RPCVar +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryPointCollectionPage) Values() []RecoveryPoint { + if page.RPCVar.IsEmpty() { + return nil + } + return *page.RPCVar.Value +} + +// Creates a new instance of the RecoveryPointCollectionPage type. +func NewRecoveryPointCollectionPage(cur RecoveryPointCollection, getNextPage func(context.Context, RecoveryPointCollection) (RecoveryPointCollection, error)) RecoveryPointCollectionPage { + return RecoveryPointCollectionPage{ + fn: getNextPage, + RPCVar: cur, + } +} + +// RecoveryPointProperties recovery point properties. +type RecoveryPointProperties struct { + // RecoveryPointTime - The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointType - The recovery point type: ApplicationConsistent, CrashConsistent. + RecoveryPointType *string `json:"recoveryPointType,omitempty"` + // ProviderSpecificDetails - The provider specific details for the recovery point. + ProviderSpecificDetails BasicProviderSpecificRecoveryPointDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPointProperties struct. +func (rpp *RecoveryPointProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryPointTime": + if v != nil { + var recoveryPointTime date.Time + err = json.Unmarshal(*v, &recoveryPointTime) + if err != nil { + return err + } + rpp.RecoveryPointTime = &recoveryPointTime + } + case "recoveryPointType": + if v != nil { + var recoveryPointType string + err = json.Unmarshal(*v, &recoveryPointType) + if err != nil { + return err + } + rpp.RecoveryPointType = &recoveryPointType + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicProviderSpecificRecoveryPointDetails(*v) + if err != nil { + return err + } + rpp.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicRecoveryProximityPlacementGroupCustomDetails recovery Proximity placement group custom input. +type BasicRecoveryProximityPlacementGroupCustomDetails interface { + AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) + AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) +} + +// RecoveryProximityPlacementGroupCustomDetails recovery Proximity placement group custom input. +type RecoveryProximityPlacementGroupCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails', 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(body []byte) (BasicRecoveryProximityPlacementGroupCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting): + var erppg ExistingRecoveryProximityPlacementGroup + err := json.Unmarshal(body, &erppg) + return erppg, err + default: + var rppgcd RecoveryProximityPlacementGroupCustomDetails + err := json.Unmarshal(body, &rppgcd) + return rppgcd, err + } +} +func unmarshalBasicRecoveryProximityPlacementGroupCustomDetailsArray(body []byte) ([]BasicRecoveryProximityPlacementGroupCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppgcdArray := make([]BasicRecoveryProximityPlacementGroupCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppgcd, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rppgcdArray[index] = rppgcd + } + return rppgcdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) MarshalJSON() ([]byte, error) { + rppgcd.ResourceType = ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails + objectMap := make(map[string]interface{}) + if rppgcd.ResourceType != "" { + objectMap["resourceType"] = rppgcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryProximityPlacementGroup is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) { + return nil, false +} + +// AsRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) { + return &rppgcd, true +} + +// AsBasicRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsBasicRecoveryProximityPlacementGroupCustomDetails() (BasicRecoveryProximityPlacementGroupCustomDetails, bool) { + return &rppgcd, true +} + +// BasicRecoveryResourceGroupCustomDetails recovery Resource Group custom input. +type BasicRecoveryResourceGroupCustomDetails interface { + AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) + AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) +} + +// RecoveryResourceGroupCustomDetails recovery Resource Group custom input. +type RecoveryResourceGroupCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails', 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryResourceGroupCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryResourceGroupCustomDetails(body []byte) (BasicRecoveryResourceGroupCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting): + var errrg ExistingRecoveryRecoveryResourceGroup + err := json.Unmarshal(body, &errrg) + return errrg, err + default: + var rrgcd RecoveryResourceGroupCustomDetails + err := json.Unmarshal(body, &rrgcd) + return rrgcd, err + } +} +func unmarshalBasicRecoveryResourceGroupCustomDetailsArray(body []byte) ([]BasicRecoveryResourceGroupCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rrgcdArray := make([]BasicRecoveryResourceGroupCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rrgcd, err := unmarshalBasicRecoveryResourceGroupCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rrgcdArray[index] = rrgcd + } + return rrgcdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) MarshalJSON() ([]byte, error) { + rrgcd.ResourceType = ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails + objectMap := make(map[string]interface{}) + if rrgcd.ResourceType != "" { + objectMap["resourceType"] = rrgcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryRecoveryResourceGroup is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) { + return nil, false +} + +// AsRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) { + return &rrgcd, true +} + +// AsBasicRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsBasicRecoveryResourceGroupCustomDetails() (BasicRecoveryResourceGroupCustomDetails, bool) { + return &rrgcd, true +} + +// RecoveryServicesProvider provider details. +type RecoveryServicesProvider struct { + autorest.Response `json:"-"` + // Properties - Provider properties. + Properties *RecoveryServicesProviderProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryServicesProvider. +func (rsp RecoveryServicesProvider) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rsp.Properties != nil { + objectMap["properties"] = rsp.Properties + } + if rsp.Location != nil { + objectMap["location"] = rsp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryServicesProviderCollection collection of providers. +type RecoveryServicesProviderCollection struct { + autorest.Response `json:"-"` + // Value - The Servers details. + Value *[]RecoveryServicesProvider `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryServicesProviderCollectionIterator provides access to a complete listing of +// RecoveryServicesProvider values. +type RecoveryServicesProviderCollectionIterator struct { + i int + page RecoveryServicesProviderCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryServicesProviderCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryServicesProviderCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryServicesProviderCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryServicesProviderCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryServicesProviderCollectionIterator) Response() RecoveryServicesProviderCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryServicesProviderCollectionIterator) Value() RecoveryServicesProvider { + if !iter.page.NotDone() { + return RecoveryServicesProvider{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryServicesProviderCollectionIterator type. +func NewRecoveryServicesProviderCollectionIterator(page RecoveryServicesProviderCollectionPage) RecoveryServicesProviderCollectionIterator { + return RecoveryServicesProviderCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rspc RecoveryServicesProviderCollection) IsEmpty() bool { + return rspc.Value == nil || len(*rspc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rspc RecoveryServicesProviderCollection) hasNextLink() bool { + return rspc.NextLink != nil && len(*rspc.NextLink) != 0 +} + +// recoveryServicesProviderCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rspc RecoveryServicesProviderCollection) recoveryServicesProviderCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rspc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rspc.NextLink))) +} + +// RecoveryServicesProviderCollectionPage contains a page of RecoveryServicesProvider values. +type RecoveryServicesProviderCollectionPage struct { + fn func(context.Context, RecoveryServicesProviderCollection) (RecoveryServicesProviderCollection, error) + rspc RecoveryServicesProviderCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryServicesProviderCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryServicesProviderCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rspc) + if err != nil { + return err + } + page.rspc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryServicesProviderCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryServicesProviderCollectionPage) NotDone() bool { + return !page.rspc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryServicesProviderCollectionPage) Response() RecoveryServicesProviderCollection { + return page.rspc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryServicesProviderCollectionPage) Values() []RecoveryServicesProvider { + if page.rspc.IsEmpty() { + return nil + } + return *page.rspc.Value +} + +// Creates a new instance of the RecoveryServicesProviderCollectionPage type. +func NewRecoveryServicesProviderCollectionPage(cur RecoveryServicesProviderCollection, getNextPage func(context.Context, RecoveryServicesProviderCollection) (RecoveryServicesProviderCollection, error)) RecoveryServicesProviderCollectionPage { + return RecoveryServicesProviderCollectionPage{ + fn: getNextPage, + rspc: cur, + } +} + +// RecoveryServicesProviderProperties recovery services provider properties. +type RecoveryServicesProviderProperties struct { + // FabricType - Type of the site. + FabricType *string `json:"fabricType,omitempty"` + // FriendlyName - Friendly name of the DRA. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProviderVersion - The provider version. + ProviderVersion *string `json:"providerVersion,omitempty"` + // ServerVersion - The fabric provider. + ServerVersion *string `json:"serverVersion,omitempty"` + // ProviderVersionState - DRA version status. + ProviderVersionState *string `json:"providerVersionState,omitempty"` + // ProviderVersionExpiryDate - Expiry date of the version. + ProviderVersionExpiryDate *date.Time `json:"providerVersionExpiryDate,omitempty"` + // FabricFriendlyName - The fabric friendly name. + FabricFriendlyName *string `json:"fabricFriendlyName,omitempty"` + // LastHeartBeat - Time when last heartbeat was sent by the DRA. + LastHeartBeat *date.Time `json:"lastHeartBeat,omitempty"` + // ConnectionStatus - A value indicating whether DRA is responsive. + ConnectionStatus *string `json:"connectionStatus,omitempty"` + // ProtectedItemCount - Number of protected VMs currently managed by the DRA. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // AllowedScenarios - The scenarios allowed on this provider. + AllowedScenarios *[]string `json:"allowedScenarios,omitempty"` + // HealthErrorDetails - The recovery services provider health error details. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // DraIdentifier - The DRA Id. + DraIdentifier *string `json:"draIdentifier,omitempty"` + // MachineID - The machine Id. + MachineID *string `json:"machineId,omitempty"` + // MachineName - The machine name. + MachineName *string `json:"machineName,omitempty"` + // BiosID - The Bios Id. + BiosID *string `json:"biosId,omitempty"` + // AuthenticationIdentityDetails - The authentication identity details. + AuthenticationIdentityDetails *IdentityProviderDetails `json:"authenticationIdentityDetails,omitempty"` + // ResourceAccessIdentityDetails - The resource access identity details. + ResourceAccessIdentityDetails *IdentityProviderDetails `json:"resourceAccessIdentityDetails,omitempty"` + // DataPlaneAuthenticationIdentityDetails - The data plane authentication identity details. + DataPlaneAuthenticationIdentityDetails *IdentityProviderDetails `json:"dataPlaneAuthenticationIdentityDetails,omitempty"` + // ProviderVersionDetails - The provider version details. + ProviderVersionDetails *VersionDetails `json:"providerVersionDetails,omitempty"` +} + +// BasicRecoveryVirtualNetworkCustomDetails recovery Virtual network custom input. +type BasicRecoveryVirtualNetworkCustomDetails interface { + AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) + AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) + AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) +} + +// RecoveryVirtualNetworkCustomDetails recovery Virtual network custom input. +type RecoveryVirtualNetworkCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryVirtualNetworkCustomDetails(body []byte) (BasicRecoveryVirtualNetworkCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting): + var ervn ExistingRecoveryVirtualNetwork + err := json.Unmarshal(body, &ervn) + return ervn, err + case string(ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew): + var nrvn NewRecoveryVirtualNetwork + err := json.Unmarshal(body, &nrvn) + return nrvn, err + default: + var rvncd RecoveryVirtualNetworkCustomDetails + err := json.Unmarshal(body, &rvncd) + return rvncd, err + } +} +func unmarshalBasicRecoveryVirtualNetworkCustomDetailsArray(body []byte) ([]BasicRecoveryVirtualNetworkCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rvncdArray := make([]BasicRecoveryVirtualNetworkCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rvncd, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rvncdArray[index] = rvncd + } + return rvncdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) MarshalJSON() ([]byte, error) { + rvncd.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails + objectMap := make(map[string]interface{}) + if rvncd.ResourceType != "" { + objectMap["resourceType"] = rvncd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return &rvncd, true +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &rvncd, true +} + +// RemoveDisksInput input for remove disk(s) operation. +type RemoveDisksInput struct { + // Properties - Remove disk input properties. + Properties *RemoveDisksInputProperties `json:"properties,omitempty"` +} + +// RemoveDisksInputProperties remove Disk input properties. +type RemoveDisksInputProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicRemoveDisksProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RemoveDisksInputProperties struct. +func (rdip *RemoveDisksInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRemoveDisksProviderSpecificInput(*v) + if err != nil { + return err + } + rdip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicRemoveDisksProviderSpecificInput remove Disk provider specific input. +type BasicRemoveDisksProviderSpecificInput interface { + AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) + AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) +} + +// RemoveDisksProviderSpecificInput remove Disk provider specific input. +type RemoveDisksProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput', 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRemoveDisksProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRemoveDisksProviderSpecificInput(body []byte) (BasicRemoveDisksProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A): + var ardi A2ARemoveDisksInput + err := json.Unmarshal(body, &ardi) + return ardi, err + default: + var rdpsi RemoveDisksProviderSpecificInput + err := json.Unmarshal(body, &rdpsi) + return rdpsi, err + } +} +func unmarshalBasicRemoveDisksProviderSpecificInputArray(body []byte) ([]BasicRemoveDisksProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rdpsiArray := make([]BasicRemoveDisksProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rdpsi, err := unmarshalBasicRemoveDisksProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rdpsiArray[index] = rdpsi + } + return rdpsiArray, nil +} + +// MarshalJSON is the custom marshaler for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) MarshalJSON() ([]byte, error) { + rdpsi.InstanceType = InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput + objectMap := make(map[string]interface{}) + if rdpsi.InstanceType != "" { + objectMap["instanceType"] = rdpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARemoveDisksInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) { + return nil, false +} + +// AsRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) { + return &rdpsi, true +} + +// AsBasicRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsBasicRemoveDisksProviderSpecificInput() (BasicRemoveDisksProviderSpecificInput, bool) { + return &rdpsi, true +} + +// RemoveProtectionContainerMappingInput container unpairing input. +type RemoveProtectionContainerMappingInput struct { + // Properties - Configure protection input properties. + Properties *RemoveProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// RemoveProtectionContainerMappingInputProperties unpairing input properties. +type RemoveProtectionContainerMappingInputProperties struct { + // ProviderSpecificInput - Provider specific input for unpairing. + ProviderSpecificInput *ReplicationProviderContainerUnmappingInput `json:"providerSpecificInput,omitempty"` +} + +// RenewCertificateInput certificate renewal input. +type RenewCertificateInput struct { + // Properties - Renew certificate input properties. + Properties *RenewCertificateInputProperties `json:"properties,omitempty"` +} + +// RenewCertificateInputProperties renew Certificate input properties. +type RenewCertificateInputProperties struct { + // RenewCertificateType - Renew certificate type. + RenewCertificateType *string `json:"renewCertificateType,omitempty"` +} + +// ReplicationAgentDetails replication agent details. +type ReplicationAgentDetails struct { + // ID - READ-ONLY; The replication agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The replication agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The replication agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The replication agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the replication agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the replication agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationAgentDetails. +func (rad ReplicationAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ReplicationAppliance replication appliance definition. +type ReplicationAppliance struct { + // Properties - Appliance related data. + Properties *ReplicationApplianceProperties `json:"properties,omitempty"` +} + +// ReplicationApplianceProperties replication appliance properties. +type ReplicationApplianceProperties struct { + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicApplianceSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ReplicationApplianceProperties struct. +func (rap *ReplicationApplianceProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicApplianceSpecificDetails(*v) + if err != nil { + return err + } + rap.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// ReplicationEligibilityResults replication eligibility results response model. +type ReplicationEligibilityResults struct { + autorest.Response `json:"-"` + // Name - READ-ONLY; Gets the name of this object. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets the object type. + Type *string `json:"type,omitempty"` + // ID - READ-ONLY; Gets Unique ARM identifier for this object. + ID *string `json:"id,omitempty"` + // Properties - READ-ONLY; Gets properties model for replication eligibility results API. + Properties *ReplicationEligibilityResultsProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResults. +func (rer ReplicationEligibilityResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ReplicationEligibilityResultsCollection replication eligibility results collection response model. +type ReplicationEligibilityResultsCollection struct { + autorest.Response `json:"-"` + // Value - The replication eligibility results details. + Value *[]ReplicationEligibilityResults `json:"value,omitempty"` +} + +// ReplicationEligibilityResultsErrorInfo error model that can be exposed to the user. +type ReplicationEligibilityResultsErrorInfo struct { + // Code - The error code. + Code *string `json:"code,omitempty"` + // Message - The error message. + Message *string `json:"message,omitempty"` + // PossibleCauses - The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // Status - READ-ONLY; The error status. + Status *string `json:"status,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResultsErrorInfo. +func (rerei ReplicationEligibilityResultsErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rerei.Code != nil { + objectMap["code"] = rerei.Code + } + if rerei.Message != nil { + objectMap["message"] = rerei.Message + } + if rerei.PossibleCauses != nil { + objectMap["possibleCauses"] = rerei.PossibleCauses + } + if rerei.RecommendedAction != nil { + objectMap["recommendedAction"] = rerei.RecommendedAction + } + return json.Marshal(objectMap) +} + +// ReplicationEligibilityResultsProperties properties model for replication eligibility results API. +type ReplicationEligibilityResultsProperties struct { + // ClientRequestID - READ-ONLY; The client request Id. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // Errors - The error details. + Errors *[]ReplicationEligibilityResultsErrorInfo `json:"errors,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResultsProperties. +func (rerp ReplicationEligibilityResultsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rerp.Errors != nil { + objectMap["errors"] = rerp.Errors + } + return json.Marshal(objectMap) +} + +// ReplicationFabricsCheckConsistencyFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsCheckConsistencyFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsCheckConsistencyFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsCheckConsistencyFuture.Result. +func (future *ReplicationFabricsCheckConsistencyFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCheckConsistencyFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsCheckConsistencyFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.CheckConsistencyResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCheckConsistencyFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsCreateFuture.Result. +func (future *ReplicationFabricsCreateFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.CreateResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCreateFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsDeleteFuture.Result. +func (future *ReplicationFabricsDeleteFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsMigrateToAadFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsMigrateToAadFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsMigrateToAadFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsMigrateToAadFuture.Result. +func (future *ReplicationFabricsMigrateToAadFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsMigrateToAadFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsMigrateToAadFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsPurgeFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationFabricsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsPurgeFuture.Result. +func (future *ReplicationFabricsPurgeFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsReassociateGatewayFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsReassociateGatewayFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsReassociateGatewayFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsReassociateGatewayFuture.Result. +func (future *ReplicationFabricsReassociateGatewayFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsReassociateGatewayFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsReassociateGatewayFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.ReassociateGatewayResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsReassociateGatewayFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsRenewCertificateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsRenewCertificateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsRenewCertificateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsRenewCertificateFuture.Result. +func (future *ReplicationFabricsRenewCertificateFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsRenewCertificateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsRenewCertificateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.RenewCertificateResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsRenewCertificateFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationGroupDetails replication group details. This will be used in case of San. +type ReplicationGroupDetails struct { + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) MarshalJSON() ([]byte, error) { + rgd.InstanceType = InstanceTypeReplicationGroupDetails + objectMap := make(map[string]interface{}) + if rgd.InstanceType != "" { + objectMap["instanceType"] = rgd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return &rgd, true +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &rgd, true +} + +// ReplicationJobsCancelFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsCancelFuture.Result. +func (future *ReplicationJobsCancelFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.CancelResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsCancelFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsExportFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsExportFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsExportFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsExportFuture.Result. +func (future *ReplicationJobsExportFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsExportFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsExportFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.ExportResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsExportFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsRestartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsRestartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsRestartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsRestartFuture.Result. +func (future *ReplicationJobsRestartFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsRestartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsRestartFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.RestartResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsRestartFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsResumeFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsResumeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsResumeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsResumeFuture.Result. +func (future *ReplicationJobsResumeFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsResumeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsResumeFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.ResumeResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsResumeFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsCreateFuture.Result. +func (future *ReplicationMigrationItemsCreateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.CreateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsCreateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsDeleteFuture.Result. +func (future *ReplicationMigrationItemsDeleteFuture) result(client ReplicationMigrationItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationMigrationItemsMigrateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsMigrateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsMigrateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsMigrateFuture.Result. +func (future *ReplicationMigrationItemsMigrateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsMigrateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsMigrateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.MigrateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsMigrateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsResyncFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsResyncFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsResyncFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsResyncFuture.Result. +func (future *ReplicationMigrationItemsResyncFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsResyncFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsResyncFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.ResyncResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsResyncFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsTestMigrateCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationMigrationItemsTestMigrateCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsTestMigrateCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsTestMigrateCleanupFuture.Result. +func (future *ReplicationMigrationItemsTestMigrateCleanupFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.TestMigrateCleanupResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsTestMigrateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsTestMigrateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsTestMigrateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsTestMigrateFuture.Result. +func (future *ReplicationMigrationItemsTestMigrateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsTestMigrateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.TestMigrateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsUpdateFuture.Result. +func (future *ReplicationMigrationItemsUpdateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.UpdateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsUpdateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationNetworkMappingsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (NetworkMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsCreateFuture.Result. +func (future *ReplicationNetworkMappingsCreateFuture) result(client ReplicationNetworkMappingsClient) (nm NetworkMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + nm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nm.Response.Response, err = future.GetResult(sender); err == nil && nm.Response.Response.StatusCode != http.StatusNoContent { + nm, err = client.CreateResponder(nm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsCreateFuture", "Result", nm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationNetworkMappingsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsDeleteFuture.Result. +func (future *ReplicationNetworkMappingsDeleteFuture) result(client ReplicationNetworkMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationNetworkMappingsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (NetworkMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsUpdateFuture.Result. +func (future *ReplicationNetworkMappingsUpdateFuture) result(client ReplicationNetworkMappingsClient) (nm NetworkMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + nm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nm.Response.Response, err = future.GetResult(sender); err == nil && nm.Response.Response.StatusCode != http.StatusNoContent { + nm, err = client.UpdateResponder(nm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsUpdateFuture", "Result", nm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationPoliciesCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (Policy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesCreateFuture.Result. +func (future *ReplicationPoliciesCreateFuture) result(client ReplicationPoliciesClient) (p Policy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + p.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.CreateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesCreateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesDeleteFuture.Result. +func (future *ReplicationPoliciesDeleteFuture) result(client ReplicationPoliciesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationPoliciesUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (Policy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesUpdateFuture.Result. +func (future *ReplicationPoliciesUpdateFuture) result(client ReplicationPoliciesClient) (p Policy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + p.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.UpdateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesUpdateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItem replication protected item. +type ReplicationProtectedItem struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ReplicationProtectedItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectedItem. +func (rpi ReplicationProtectedItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpi.Properties != nil { + objectMap["properties"] = rpi.Properties + } + if rpi.Location != nil { + objectMap["location"] = rpi.Location + } + return json.Marshal(objectMap) +} + +// ReplicationProtectedItemCollection replication protected item collection. +type ReplicationProtectedItemCollection struct { + autorest.Response `json:"-"` + // Value - The Replication protected item details. + Value *[]ReplicationProtectedItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ReplicationProtectedItemCollectionIterator provides access to a complete listing of +// ReplicationProtectedItem values. +type ReplicationProtectedItemCollectionIterator struct { + i int + page ReplicationProtectedItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ReplicationProtectedItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ReplicationProtectedItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ReplicationProtectedItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ReplicationProtectedItemCollectionIterator) Response() ReplicationProtectedItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ReplicationProtectedItemCollectionIterator) Value() ReplicationProtectedItem { + if !iter.page.NotDone() { + return ReplicationProtectedItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ReplicationProtectedItemCollectionIterator type. +func NewReplicationProtectedItemCollectionIterator(page ReplicationProtectedItemCollectionPage) ReplicationProtectedItemCollectionIterator { + return ReplicationProtectedItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rpic ReplicationProtectedItemCollection) IsEmpty() bool { + return rpic.Value == nil || len(*rpic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rpic ReplicationProtectedItemCollection) hasNextLink() bool { + return rpic.NextLink != nil && len(*rpic.NextLink) != 0 +} + +// replicationProtectedItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rpic ReplicationProtectedItemCollection) replicationProtectedItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rpic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rpic.NextLink))) +} + +// ReplicationProtectedItemCollectionPage contains a page of ReplicationProtectedItem values. +type ReplicationProtectedItemCollectionPage struct { + fn func(context.Context, ReplicationProtectedItemCollection) (ReplicationProtectedItemCollection, error) + rpic ReplicationProtectedItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ReplicationProtectedItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rpic) + if err != nil { + return err + } + page.rpic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ReplicationProtectedItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ReplicationProtectedItemCollectionPage) NotDone() bool { + return !page.rpic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ReplicationProtectedItemCollectionPage) Response() ReplicationProtectedItemCollection { + return page.rpic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ReplicationProtectedItemCollectionPage) Values() []ReplicationProtectedItem { + if page.rpic.IsEmpty() { + return nil + } + return *page.rpic.Value +} + +// Creates a new instance of the ReplicationProtectedItemCollectionPage type. +func NewReplicationProtectedItemCollectionPage(cur ReplicationProtectedItemCollection, getNextPage func(context.Context, ReplicationProtectedItemCollection) (ReplicationProtectedItemCollection, error)) ReplicationProtectedItemCollectionPage { + return ReplicationProtectedItemCollectionPage{ + fn: getNextPage, + rpic: cur, + } +} + +// ReplicationProtectedItemProperties replication protected item custom data details. +type ReplicationProtectedItemProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectedItemType - The type of protected item type. + ProtectedItemType *string `json:"protectedItemType,omitempty"` + // ProtectableItemID - The protected item ARM Id. + ProtectableItemID *string `json:"protectableItemId,omitempty"` + // RecoveryServicesProviderID - The recovery provider ARM Id. + RecoveryServicesProviderID *string `json:"recoveryServicesProviderId,omitempty"` + // PrimaryFabricFriendlyName - The friendly name of the primary fabric. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // PrimaryFabricProvider - The fabric provider of the primary fabric. + PrimaryFabricProvider *string `json:"primaryFabricProvider,omitempty"` + // RecoveryFabricFriendlyName - The friendly name of recovery fabric. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // RecoveryFabricID - The Arm Id of recovery fabric. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // PrimaryProtectionContainerFriendlyName - The name of primary protection container friendly name. + PrimaryProtectionContainerFriendlyName *string `json:"primaryProtectionContainerFriendlyName,omitempty"` + // RecoveryProtectionContainerFriendlyName - The name of recovery container friendly name. + RecoveryProtectionContainerFriendlyName *string `json:"recoveryProtectionContainerFriendlyName,omitempty"` + // ProtectionState - The protection status. + ProtectionState *string `json:"protectionState,omitempty"` + // ProtectionStateDescription - The protection state description. + ProtectionStateDescription *string `json:"protectionStateDescription,omitempty"` + // ActiveLocation - The Current active location of the PE. + ActiveLocation *string `json:"activeLocation,omitempty"` + // TestFailoverState - The Test failover state. + TestFailoverState *string `json:"testFailoverState,omitempty"` + // TestFailoverStateDescription - The Test failover state description. + TestFailoverStateDescription *string `json:"testFailoverStateDescription,omitempty"` + // SwitchProviderState - The switch provider state. + SwitchProviderState *string `json:"switchProviderState,omitempty"` + // SwitchProviderStateDescription - The switch provider state description. + SwitchProviderStateDescription *string `json:"switchProviderStateDescription,omitempty"` + // AllowedOperations - The allowed operations on the Replication protected item. + AllowedOperations *[]string `json:"allowedOperations,omitempty"` + // ReplicationHealth - 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 `json:"replicationHealth,omitempty"` + // FailoverHealth - The consolidated failover health for the VM. + FailoverHealth *string `json:"failoverHealth,omitempty"` + // HealthErrors - List of health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // PolicyID - The ID of Policy governing this PE. + PolicyID *string `json:"policyId,omitempty"` + // PolicyFriendlyName - The name of Policy governing this PE. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` + // LastSuccessfulFailoverTime - The Last successful failover time. + LastSuccessfulFailoverTime *date.Time `json:"lastSuccessfulFailoverTime,omitempty"` + // LastSuccessfulTestFailoverTime - The Last successful test failover time. + LastSuccessfulTestFailoverTime *date.Time `json:"lastSuccessfulTestFailoverTime,omitempty"` + // CurrentScenario - The current scenario. + CurrentScenario *CurrentScenarioDetails `json:"currentScenario,omitempty"` + // FailoverRecoveryPointID - The recovery point ARM Id to which the Vm was failed over. + FailoverRecoveryPointID *string `json:"failoverRecoveryPointId,omitempty"` + // ProviderSpecificDetails - The Replication provider custom settings. + ProviderSpecificDetails BasicReplicationProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // EventCorrelationID - The correlation Id for events associated with this protected item. + EventCorrelationID *string `json:"eventCorrelationId,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ReplicationProtectedItemProperties struct. +func (rpip *ReplicationProtectedItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpip.FriendlyName = &friendlyName + } + case "protectedItemType": + if v != nil { + var protectedItemType string + err = json.Unmarshal(*v, &protectedItemType) + if err != nil { + return err + } + rpip.ProtectedItemType = &protectedItemType + } + case "protectableItemId": + if v != nil { + var protectableItemID string + err = json.Unmarshal(*v, &protectableItemID) + if err != nil { + return err + } + rpip.ProtectableItemID = &protectableItemID + } + case "recoveryServicesProviderId": + if v != nil { + var recoveryServicesProviderID string + err = json.Unmarshal(*v, &recoveryServicesProviderID) + if err != nil { + return err + } + rpip.RecoveryServicesProviderID = &recoveryServicesProviderID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + rpip.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "primaryFabricProvider": + if v != nil { + var primaryFabricProvider string + err = json.Unmarshal(*v, &primaryFabricProvider) + if err != nil { + return err + } + rpip.PrimaryFabricProvider = &primaryFabricProvider + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + rpip.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + rpip.RecoveryFabricID = &recoveryFabricID + } + case "primaryProtectionContainerFriendlyName": + if v != nil { + var primaryProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &primaryProtectionContainerFriendlyName) + if err != nil { + return err + } + rpip.PrimaryProtectionContainerFriendlyName = &primaryProtectionContainerFriendlyName + } + case "recoveryProtectionContainerFriendlyName": + if v != nil { + var recoveryProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &recoveryProtectionContainerFriendlyName) + if err != nil { + return err + } + rpip.RecoveryProtectionContainerFriendlyName = &recoveryProtectionContainerFriendlyName + } + case "protectionState": + if v != nil { + var protectionState string + err = json.Unmarshal(*v, &protectionState) + if err != nil { + return err + } + rpip.ProtectionState = &protectionState + } + case "protectionStateDescription": + if v != nil { + var protectionStateDescription string + err = json.Unmarshal(*v, &protectionStateDescription) + if err != nil { + return err + } + rpip.ProtectionStateDescription = &protectionStateDescription + } + case "activeLocation": + if v != nil { + var activeLocation string + err = json.Unmarshal(*v, &activeLocation) + if err != nil { + return err + } + rpip.ActiveLocation = &activeLocation + } + case "testFailoverState": + if v != nil { + var testFailoverState string + err = json.Unmarshal(*v, &testFailoverState) + if err != nil { + return err + } + rpip.TestFailoverState = &testFailoverState + } + case "testFailoverStateDescription": + if v != nil { + var testFailoverStateDescription string + err = json.Unmarshal(*v, &testFailoverStateDescription) + if err != nil { + return err + } + rpip.TestFailoverStateDescription = &testFailoverStateDescription + } + case "switchProviderState": + if v != nil { + var switchProviderState string + err = json.Unmarshal(*v, &switchProviderState) + if err != nil { + return err + } + rpip.SwitchProviderState = &switchProviderState + } + case "switchProviderStateDescription": + if v != nil { + var switchProviderStateDescription string + err = json.Unmarshal(*v, &switchProviderStateDescription) + if err != nil { + return err + } + rpip.SwitchProviderStateDescription = &switchProviderStateDescription + } + case "allowedOperations": + if v != nil { + var allowedOperations []string + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + rpip.AllowedOperations = &allowedOperations + } + case "replicationHealth": + if v != nil { + var replicationHealth string + err = json.Unmarshal(*v, &replicationHealth) + if err != nil { + return err + } + rpip.ReplicationHealth = &replicationHealth + } + case "failoverHealth": + if v != nil { + var failoverHealth string + err = json.Unmarshal(*v, &failoverHealth) + if err != nil { + return err + } + rpip.FailoverHealth = &failoverHealth + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + rpip.HealthErrors = &healthErrors + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + rpip.PolicyID = &policyID + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + rpip.PolicyFriendlyName = &policyFriendlyName + } + case "lastSuccessfulFailoverTime": + if v != nil { + var lastSuccessfulFailoverTime date.Time + err = json.Unmarshal(*v, &lastSuccessfulFailoverTime) + if err != nil { + return err + } + rpip.LastSuccessfulFailoverTime = &lastSuccessfulFailoverTime + } + case "lastSuccessfulTestFailoverTime": + if v != nil { + var lastSuccessfulTestFailoverTime date.Time + err = json.Unmarshal(*v, &lastSuccessfulTestFailoverTime) + if err != nil { + return err + } + rpip.LastSuccessfulTestFailoverTime = &lastSuccessfulTestFailoverTime + } + case "currentScenario": + if v != nil { + var currentScenario CurrentScenarioDetails + err = json.Unmarshal(*v, ¤tScenario) + if err != nil { + return err + } + rpip.CurrentScenario = ¤tScenario + } + case "failoverRecoveryPointId": + if v != nil { + var failoverRecoveryPointID string + err = json.Unmarshal(*v, &failoverRecoveryPointID) + if err != nil { + return err + } + rpip.FailoverRecoveryPointID = &failoverRecoveryPointID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReplicationProviderSpecificSettings(*v) + if err != nil { + return err + } + rpip.ProviderSpecificDetails = providerSpecificDetails + } + case "recoveryContainerId": + if v != nil { + var recoveryContainerID string + err = json.Unmarshal(*v, &recoveryContainerID) + if err != nil { + return err + } + rpip.RecoveryContainerID = &recoveryContainerID + } + case "eventCorrelationId": + if v != nil { + var eventCorrelationID string + err = json.Unmarshal(*v, &eventCorrelationID) + if err != nil { + return err + } + rpip.EventCorrelationID = &eventCorrelationID + } + } + } + + return nil +} + +// ReplicationProtectedItemsAddDisksFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsAddDisksFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsAddDisksFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsAddDisksFuture.Result. +func (future *ReplicationProtectedItemsAddDisksFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsAddDisksFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsAddDisksFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.AddDisksResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsAddDisksFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsApplyRecoveryPointFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsApplyRecoveryPointFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsApplyRecoveryPointFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsApplyRecoveryPointFuture.Result. +func (future *ReplicationProtectedItemsApplyRecoveryPointFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ApplyRecoveryPointResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsCreateFuture.Result. +func (future *ReplicationProtectedItemsCreateFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.CreateResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsCreateFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsDeleteFuture.Result. +func (future *ReplicationProtectedItemsDeleteFuture) result(client ReplicationProtectedItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectedItemsFailoverCancelFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsFailoverCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsFailoverCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsFailoverCancelFuture.Result. +func (future *ReplicationProtectedItemsFailoverCancelFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsFailoverCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.FailoverCancelResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCancelFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsFailoverCommitFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsFailoverCommitFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsFailoverCommitFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsFailoverCommitFuture.Result. +func (future *ReplicationProtectedItemsFailoverCommitFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCommitFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsFailoverCommitFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.FailoverCommitResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCommitFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsPlannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsPlannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsPlannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsPlannedFailoverFuture.Result. +func (future *ReplicationProtectedItemsPlannedFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPlannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsPlannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.PlannedFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPlannedFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsPurgeFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsPurgeFuture.Result. +func (future *ReplicationProtectedItemsPurgeFuture) result(client ReplicationProtectedItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectedItemsRemoveDisksFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsRemoveDisksFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsRemoveDisksFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsRemoveDisksFuture.Result. +func (future *ReplicationProtectedItemsRemoveDisksFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRemoveDisksFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsRemoveDisksFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.RemoveDisksResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRemoveDisksFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsRepairReplicationFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsRepairReplicationFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsRepairReplicationFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsRepairReplicationFuture.Result. +func (future *ReplicationProtectedItemsRepairReplicationFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRepairReplicationFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsRepairReplicationFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.RepairReplicationResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRepairReplicationFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsReprotectFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsReprotectFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsReprotectFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsReprotectFuture.Result. +func (future *ReplicationProtectedItemsReprotectFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsReprotectFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsReprotectFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ReprotectResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsReprotectFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsResolveHealthErrorsFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsResolveHealthErrorsFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsResolveHealthErrorsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsResolveHealthErrorsFuture.Result. +func (future *ReplicationProtectedItemsResolveHealthErrorsFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ResolveHealthErrorsResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsSwitchProviderFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsSwitchProviderFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsSwitchProviderFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsSwitchProviderFuture.Result. +func (future *ReplicationProtectedItemsSwitchProviderFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsSwitchProviderFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsSwitchProviderFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.SwitchProviderResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsSwitchProviderFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsTestFailoverCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsTestFailoverCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsTestFailoverCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsTestFailoverCleanupFuture.Result. +func (future *ReplicationProtectedItemsTestFailoverCleanupFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.TestFailoverCleanupResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsTestFailoverFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectedItemsTestFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsTestFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsTestFailoverFuture.Result. +func (future *ReplicationProtectedItemsTestFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsTestFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.TestFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUnplannedFailoverFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsUnplannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUnplannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUnplannedFailoverFuture.Result. +func (future *ReplicationProtectedItemsUnplannedFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UnplannedFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateApplianceFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsUpdateApplianceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateApplianceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateApplianceFuture.Result. +func (future *ReplicationProtectedItemsUpdateApplianceFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateApplianceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateApplianceFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateApplianceResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateApplianceFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateFuture.Result. +func (future *ReplicationProtectedItemsUpdateFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateMobilityServiceFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsUpdateMobilityServiceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateMobilityServiceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateMobilityServiceFuture.Result. +func (future *ReplicationProtectedItemsUpdateMobilityServiceFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateMobilityServiceResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainerMappingsCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (ProtectionContainerMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsCreateFuture.Result. +func (future *ReplicationProtectionContainerMappingsCreateFuture) result(client ReplicationProtectionContainerMappingsClient) (pcm ProtectionContainerMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pcm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pcm.Response.Response, err = future.GetResult(sender); err == nil && pcm.Response.Response.StatusCode != http.StatusNoContent { + pcm, err = client.CreateResponder(pcm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsCreateFuture", "Result", pcm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainerMappingsDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsDeleteFuture.Result. +func (future *ReplicationProtectionContainerMappingsDeleteFuture) result(client ReplicationProtectionContainerMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainerMappingsPurgeFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsPurgeFuture.Result. +func (future *ReplicationProtectionContainerMappingsPurgeFuture) result(client ReplicationProtectionContainerMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainerMappingsUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (ProtectionContainerMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsUpdateFuture.Result. +func (future *ReplicationProtectionContainerMappingsUpdateFuture) result(client ReplicationProtectionContainerMappingsClient) (pcm ProtectionContainerMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pcm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pcm.Response.Response, err = future.GetResult(sender); err == nil && pcm.Response.Response.StatusCode != http.StatusNoContent { + pcm, err = client.UpdateResponder(pcm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsUpdateFuture", "Result", pcm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersCreateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectionContainersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersCreateFuture.Result. +func (future *ReplicationProtectionContainersCreateFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.CreateResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersCreateFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersDeleteFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectionContainersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersDeleteFuture.Result. +func (future *ReplicationProtectionContainersDeleteFuture) result(client ReplicationProtectionContainersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainersDiscoverProtectableItemFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type ReplicationProtectionContainersDiscoverProtectableItemFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersDiscoverProtectableItemFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersDiscoverProtectableItemFuture.Result. +func (future *ReplicationProtectionContainersDiscoverProtectableItemFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.DiscoverProtectableItemResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersSwitchProtectionFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainersSwitchProtectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersSwitchProtectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersSwitchProtectionFuture.Result. +func (future *ReplicationProtectionContainersSwitchProtectionFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersSwitchProtectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersSwitchProtectionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.SwitchProtectionResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersSwitchProtectionFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionIntent replication protection intent. +type ReplicationProtectionIntent struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ReplicationProtectionIntentProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntent. +func (rpi ReplicationProtectionIntent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpi.Properties != nil { + objectMap["properties"] = rpi.Properties + } + if rpi.Location != nil { + objectMap["location"] = rpi.Location + } + return json.Marshal(objectMap) +} + +// ReplicationProtectionIntentCollection replication protection intent objects collection. +type ReplicationProtectionIntentCollection struct { + autorest.Response `json:"-"` + // Value - The Replication protection intent details. + Value *[]ReplicationProtectionIntent `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ReplicationProtectionIntentCollectionIterator provides access to a complete listing of +// ReplicationProtectionIntent values. +type ReplicationProtectionIntentCollectionIterator struct { + i int + page ReplicationProtectionIntentCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ReplicationProtectionIntentCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ReplicationProtectionIntentCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ReplicationProtectionIntentCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ReplicationProtectionIntentCollectionIterator) Response() ReplicationProtectionIntentCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ReplicationProtectionIntentCollectionIterator) Value() ReplicationProtectionIntent { + if !iter.page.NotDone() { + return ReplicationProtectionIntent{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ReplicationProtectionIntentCollectionIterator type. +func NewReplicationProtectionIntentCollectionIterator(page ReplicationProtectionIntentCollectionPage) ReplicationProtectionIntentCollectionIterator { + return ReplicationProtectionIntentCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rpic ReplicationProtectionIntentCollection) IsEmpty() bool { + return rpic.Value == nil || len(*rpic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rpic ReplicationProtectionIntentCollection) hasNextLink() bool { + return rpic.NextLink != nil && len(*rpic.NextLink) != 0 +} + +// replicationProtectionIntentCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rpic ReplicationProtectionIntentCollection) replicationProtectionIntentCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rpic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rpic.NextLink))) +} + +// ReplicationProtectionIntentCollectionPage contains a page of ReplicationProtectionIntent values. +type ReplicationProtectionIntentCollectionPage struct { + fn func(context.Context, ReplicationProtectionIntentCollection) (ReplicationProtectionIntentCollection, error) + rpic ReplicationProtectionIntentCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ReplicationProtectionIntentCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rpic) + if err != nil { + return err + } + page.rpic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ReplicationProtectionIntentCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ReplicationProtectionIntentCollectionPage) NotDone() bool { + return !page.rpic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ReplicationProtectionIntentCollectionPage) Response() ReplicationProtectionIntentCollection { + return page.rpic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ReplicationProtectionIntentCollectionPage) Values() []ReplicationProtectionIntent { + if page.rpic.IsEmpty() { + return nil + } + return *page.rpic.Value +} + +// Creates a new instance of the ReplicationProtectionIntentCollectionPage type. +func NewReplicationProtectionIntentCollectionPage(cur ReplicationProtectionIntentCollection, getNextPage func(context.Context, ReplicationProtectionIntentCollection) (ReplicationProtectionIntentCollection, error)) ReplicationProtectionIntentCollectionPage { + return ReplicationProtectionIntentCollectionPage{ + fn: getNextPage, + rpic: cur, + } +} + +// ReplicationProtectionIntentProperties replication protection intent custom data details. +type ReplicationProtectionIntentProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // JobID - READ-ONLY; The job Id. + JobID *string `json:"jobId,omitempty"` + // JobState - READ-ONLY; The job state. + JobState *string `json:"jobState,omitempty"` + // IsActive - READ-ONLY; A value indicating whether the intent object is active. + IsActive *bool `json:"isActive,omitempty"` + // CreationTimeUTC - READ-ONLY; The creation time in UTC. + CreationTimeUTC *string `json:"creationTimeUTC,omitempty"` + // ProviderSpecificDetails - The Replication provider custom settings. + ProviderSpecificDetails BasicReplicationProtectionIntentProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntentProperties. +func (rpip ReplicationProtectionIntentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpip.FriendlyName != nil { + objectMap["friendlyName"] = rpip.FriendlyName + } + objectMap["providerSpecificDetails"] = rpip.ProviderSpecificDetails + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ReplicationProtectionIntentProperties struct. +func (rpip *ReplicationProtectionIntentProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpip.FriendlyName = &friendlyName + } + case "jobId": + if v != nil { + var jobID string + err = json.Unmarshal(*v, &jobID) + if err != nil { + return err + } + rpip.JobID = &jobID + } + case "jobState": + if v != nil { + var jobState string + err = json.Unmarshal(*v, &jobState) + if err != nil { + return err + } + rpip.JobState = &jobState + } + case "isActive": + if v != nil { + var isActive bool + err = json.Unmarshal(*v, &isActive) + if err != nil { + return err + } + rpip.IsActive = &isActive + } + case "creationTimeUTC": + if v != nil { + var creationTimeUTC string + err = json.Unmarshal(*v, &creationTimeUTC) + if err != nil { + return err + } + rpip.CreationTimeUTC = &creationTimeUTC + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(*v) + if err != nil { + return err + } + rpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicReplicationProtectionIntentProviderSpecificSettings replication provider specific settings. +type BasicReplicationProtectionIntentProviderSpecificSettings interface { + AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) + AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) +} + +// ReplicationProtectionIntentProviderSpecificSettings replication provider specific settings. +type ReplicationProtectionIntentProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings', 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A' + InstanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(body []byte) (BasicReplicationProtectionIntentProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A): + var arid A2AReplicationIntentDetails + err := json.Unmarshal(body, &arid) + return arid, err + default: + var rpipss ReplicationProtectionIntentProviderSpecificSettings + err := json.Unmarshal(body, &rpipss) + return rpipss, err + } +} +func unmarshalBasicReplicationProtectionIntentProviderSpecificSettingsArray(body []byte) ([]BasicReplicationProtectionIntentProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpipssArray := make([]BasicReplicationProtectionIntentProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpipss, err := unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + rpipssArray[index] = rpipss + } + return rpipssArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) MarshalJSON() ([]byte, error) { + rpipss.InstanceType = InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings + objectMap := make(map[string]interface{}) + if rpipss.InstanceType != "" { + objectMap["instanceType"] = rpipss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReplicationIntentDetails is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) { + return nil, false +} + +// AsReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) { + return &rpipss, true +} + +// AsBasicReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsBasicReplicationProtectionIntentProviderSpecificSettings() (BasicReplicationProtectionIntentProviderSpecificSettings, bool) { + return &rpipss, true +} + +// ReplicationProviderContainerUnmappingInput provider specific input for unpairing operations. +type ReplicationProviderContainerUnmappingInput struct { + // InstanceType - The class type. + InstanceType *string `json:"instanceType,omitempty"` +} + +// BasicReplicationProviderSpecificContainerCreationInput provider specific input for container creation operation. +type BasicReplicationProviderSpecificContainerCreationInput interface { + AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) + AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) + AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) + AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) +} + +// ReplicationProviderSpecificContainerCreationInput provider specific input for container creation operation. +type ReplicationProviderSpecificContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificContainerCreationInput(body []byte) (BasicReplicationProviderSpecificContainerCreationInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A): + var acci A2AContainerCreationInput + err := json.Unmarshal(body, &acci) + return acci, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration): + var accmcci A2ACrossClusterMigrationContainerCreationInput + err := json.Unmarshal(body, &accmcci) + return accmcci, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt): + var vmccci VMwareCbtContainerCreationInput + err := json.Unmarshal(body, &vmccci) + return vmccci, err + default: + var rpscci ReplicationProviderSpecificContainerCreationInput + err := json.Unmarshal(body, &rpscci) + return rpscci, err + } +} +func unmarshalBasicReplicationProviderSpecificContainerCreationInputArray(body []byte) ([]BasicReplicationProviderSpecificContainerCreationInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpscciArray := make([]BasicReplicationProviderSpecificContainerCreationInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpscci, err := unmarshalBasicReplicationProviderSpecificContainerCreationInput(*rawMessage) + if err != nil { + return nil, err + } + rpscciArray[index] = rpscci + } + return rpscciArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) MarshalJSON() ([]byte, error) { + rpscci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput + objectMap := make(map[string]interface{}) + if rpscci.InstanceType != "" { + objectMap["instanceType"] = rpscci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return &rpscci, true +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &rpscci, true +} + +// BasicReplicationProviderSpecificContainerMappingInput provider specific input for pairing operations. +type BasicReplicationProviderSpecificContainerMappingInput interface { + AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) + AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) + AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) +} + +// ReplicationProviderSpecificContainerMappingInput provider specific input for pairing operations. +type ReplicationProviderSpecificContainerMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificContainerMappingInput(body []byte) (BasicReplicationProviderSpecificContainerMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A): + var acmi A2AContainerMappingInput + err := json.Unmarshal(body, &acmi) + return acmi, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt): + var vmccmi VMwareCbtContainerMappingInput + err := json.Unmarshal(body, &vmccmi) + return vmccmi, err + default: + var rpscmi ReplicationProviderSpecificContainerMappingInput + err := json.Unmarshal(body, &rpscmi) + return rpscmi, err + } +} +func unmarshalBasicReplicationProviderSpecificContainerMappingInputArray(body []byte) ([]BasicReplicationProviderSpecificContainerMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpscmiArray := make([]BasicReplicationProviderSpecificContainerMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpscmi, err := unmarshalBasicReplicationProviderSpecificContainerMappingInput(*rawMessage) + if err != nil { + return nil, err + } + rpscmiArray[index] = rpscmi + } + return rpscmiArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) MarshalJSON() ([]byte, error) { + rpscmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput + objectMap := make(map[string]interface{}) + if rpscmi.InstanceType != "" { + objectMap["instanceType"] = rpscmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return &rpscmi, true +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &rpscmi, true +} + +// BasicReplicationProviderSpecificSettings replication provider specific settings. +type BasicReplicationProviderSpecificSettings interface { + AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) + AsA2AReplicationDetails() (*A2AReplicationDetails, bool) + AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) + AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) + AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) + AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) + AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) + AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) + AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) + AsInMageReplicationDetails() (*InMageReplicationDetails, bool) + AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) +} + +// ReplicationProviderSpecificSettings replication provider specific settings. +type ReplicationProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificSettings(body []byte) (BasicReplicationProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration): + var accmrd A2ACrossClusterMigrationReplicationDetails + err := json.Unmarshal(body, &accmrd) + return accmrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A): + var ard A2AReplicationDetails + err := json.Unmarshal(body, &ard) + return ard, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure): + var hvrard HyperVReplicaAzureReplicationDetails + err := json.Unmarshal(body, &hvrard) + return hvrard, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails): + var hvrbrd HyperVReplicaBaseReplicationDetails + err := json.Unmarshal(body, &hvrbrd) + return hvrbrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2): + var hvrbrd HyperVReplicaBlueReplicationDetails + err := json.Unmarshal(body, &hvrbrd) + return hvrbrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012): + var hvrrd HyperVReplicaReplicationDetails + err := json.Unmarshal(body, &hvrrd) + return hvrrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2): + var imavrd InMageAzureV2ReplicationDetails + err := json.Unmarshal(body, &imavrd) + return imavrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback): + var imrfrd InMageRcmFailbackReplicationDetails + err := json.Unmarshal(body, &imrfrd) + return imrfrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm): + var imrrd InMageRcmReplicationDetails + err := json.Unmarshal(body, &imrrd) + return imrrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage): + var imrd InMageReplicationDetails + err := json.Unmarshal(body, &imrd) + return imrd, err + default: + var rpss ReplicationProviderSpecificSettings + err := json.Unmarshal(body, &rpss) + return rpss, err + } +} +func unmarshalBasicReplicationProviderSpecificSettingsArray(body []byte) ([]BasicReplicationProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpssArray := make([]BasicReplicationProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpss, err := unmarshalBasicReplicationProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + rpssArray[index] = rpss + } + return rpssArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) MarshalJSON() ([]byte, error) { + rpss.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings + objectMap := make(map[string]interface{}) + if rpss.InstanceType != "" { + objectMap["instanceType"] = rpss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return &rpss, true +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &rpss, true +} + +// BasicReplicationProviderSpecificUpdateContainerMappingInput provider specific input for update pairing operations. +type BasicReplicationProviderSpecificUpdateContainerMappingInput interface { + AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) + AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) + AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) +} + +// ReplicationProviderSpecificUpdateContainerMappingInput provider specific input for update pairing +// operations. +type ReplicationProviderSpecificUpdateContainerMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(body []byte) (BasicReplicationProviderSpecificUpdateContainerMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A): + var aucmi A2AUpdateContainerMappingInput + err := json.Unmarshal(body, &aucmi) + return aucmi, err + case string(InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm): + var imrucmi InMageRcmUpdateContainerMappingInput + err := json.Unmarshal(body, &imrucmi) + return imrucmi, err + default: + var rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput + err := json.Unmarshal(body, &rpsucmi) + return rpsucmi, err + } +} +func unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInputArray(body []byte) ([]BasicReplicationProviderSpecificUpdateContainerMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpsucmiArray := make([]BasicReplicationProviderSpecificUpdateContainerMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpsucmi, err := unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(*rawMessage) + if err != nil { + return nil, err + } + rpsucmiArray[index] = rpsucmi + } + return rpsucmiArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + rpsucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput + objectMap := make(map[string]interface{}) + if rpsucmi.InstanceType != "" { + objectMap["instanceType"] = rpsucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &rpsucmi, true +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &rpsucmi, true +} + +// ReplicationRecoveryPlansCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansCreateFuture.Result. +func (future *ReplicationRecoveryPlansCreateFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.CreateResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansCreateFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansDeleteFuture.Result. +func (future *ReplicationRecoveryPlansDeleteFuture) result(client ReplicationRecoveryPlansClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryPlansFailoverCancelFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationRecoveryPlansFailoverCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansFailoverCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansFailoverCancelFuture.Result. +func (future *ReplicationRecoveryPlansFailoverCancelFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansFailoverCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.FailoverCancelResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCancelFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansFailoverCommitFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationRecoveryPlansFailoverCommitFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansFailoverCommitFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansFailoverCommitFuture.Result. +func (future *ReplicationRecoveryPlansFailoverCommitFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCommitFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansFailoverCommitFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.FailoverCommitResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCommitFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansPlannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryPlansPlannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansPlannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansPlannedFailoverFuture.Result. +func (future *ReplicationRecoveryPlansPlannedFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.PlannedFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansReprotectFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansReprotectFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansReprotectFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansReprotectFuture.Result. +func (future *ReplicationRecoveryPlansReprotectFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansReprotectFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansReprotectFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.ReprotectResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansReprotectFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansTestFailoverCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryPlansTestFailoverCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansTestFailoverCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansTestFailoverCleanupFuture.Result. +func (future *ReplicationRecoveryPlansTestFailoverCleanupFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.TestFailoverCleanupResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansTestFailoverFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansTestFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansTestFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansTestFailoverFuture.Result. +func (future *ReplicationRecoveryPlansTestFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansTestFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.TestFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansUnplannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryPlansUnplannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansUnplannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansUnplannedFailoverFuture.Result. +func (future *ReplicationRecoveryPlansUnplannedFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.UnplannedFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansUpdateFuture.Result. +func (future *ReplicationRecoveryPlansUpdateFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.UpdateResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUpdateFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryServicesProvidersCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryServicesProvidersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (RecoveryServicesProvider, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersCreateFuture.Result. +func (future *ReplicationRecoveryServicesProvidersCreateFuture) result(client ReplicationRecoveryServicesProvidersClient) (rsp RecoveryServicesProvider, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rsp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rsp.Response.Response, err = future.GetResult(sender); err == nil && rsp.Response.Response.StatusCode != http.StatusNoContent { + rsp, err = client.CreateResponder(rsp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersCreateFuture", "Result", rsp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryServicesProvidersDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryServicesProvidersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersDeleteFuture.Result. +func (future *ReplicationRecoveryServicesProvidersDeleteFuture) result(client ReplicationRecoveryServicesProvidersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryServicesProvidersPurgeFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryServicesProvidersPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersPurgeFuture.Result. +func (future *ReplicationRecoveryServicesProvidersPurgeFuture) result(client ReplicationRecoveryServicesProvidersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryServicesProvidersRefreshProviderFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type ReplicationRecoveryServicesProvidersRefreshProviderFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (RecoveryServicesProvider, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersRefreshProviderFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersRefreshProviderFuture.Result. +func (future *ReplicationRecoveryServicesProvidersRefreshProviderFuture) result(client ReplicationRecoveryServicesProvidersClient) (rsp RecoveryServicesProvider, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rsp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rsp.Response.Response, err = future.GetResult(sender); err == nil && rsp.Response.Response.StatusCode != http.StatusNoContent { + rsp, err = client.RefreshProviderResponder(rsp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture", "Result", rsp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationStorageClassificationMappingsCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationStorageClassificationMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationStorageClassificationMappingsClient) (StorageClassificationMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationStorageClassificationMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationStorageClassificationMappingsCreateFuture.Result. +func (future *ReplicationStorageClassificationMappingsCreateFuture) result(client ReplicationStorageClassificationMappingsClient) (scm StorageClassificationMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + scm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationStorageClassificationMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if scm.Response.Response, err = future.GetResult(sender); err == nil && scm.Response.Response.StatusCode != http.StatusNoContent { + scm, err = client.CreateResponder(scm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsCreateFuture", "Result", scm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationStorageClassificationMappingsDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationStorageClassificationMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationStorageClassificationMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationStorageClassificationMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationStorageClassificationMappingsDeleteFuture.Result. +func (future *ReplicationStorageClassificationMappingsDeleteFuture) result(client ReplicationStorageClassificationMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationStorageClassificationMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationVaultHealthRefreshFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationVaultHealthRefreshFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationVaultHealthClient) (VaultHealthDetails, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationVaultHealthRefreshFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationVaultHealthRefreshFuture.Result. +func (future *ReplicationVaultHealthRefreshFuture) result(client ReplicationVaultHealthClient) (vhd VaultHealthDetails, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthRefreshFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vhd.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationVaultHealthRefreshFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vhd.Response.Response, err = future.GetResult(sender); err == nil && vhd.Response.Response.StatusCode != http.StatusNoContent { + vhd, err = client.RefreshResponder(vhd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthRefreshFuture", "Result", vhd.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationVaultSettingCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationVaultSettingCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationVaultSettingClient) (VaultSetting, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationVaultSettingCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationVaultSettingCreateFuture.Result. +func (future *ReplicationVaultSettingCreateFuture) result(client ReplicationVaultSettingClient) (vs VaultSetting, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vs.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationVaultSettingCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vs.Response.Response, err = future.GetResult(sender); err == nil && vs.Response.Response.StatusCode != http.StatusNoContent { + vs, err = client.CreateResponder(vs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingCreateFuture", "Result", vs.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationvCentersCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (VCenter, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersCreateFuture.Result. +func (future *ReplicationvCentersCreateFuture) result(client ReplicationvCentersClient) (vc VCenter, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent { + vc, err = client.CreateResponder(vc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersCreateFuture", "Result", vc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationvCentersDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersDeleteFuture.Result. +func (future *ReplicationvCentersDeleteFuture) result(client ReplicationvCentersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationvCentersUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (VCenter, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersUpdateFuture.Result. +func (future *ReplicationvCentersUpdateFuture) result(client ReplicationvCentersClient) (vc VCenter, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent { + vc, err = client.UpdateResponder(vc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersUpdateFuture", "Result", vc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReprotectAgentDetails reprotect agent details. +type ReprotectAgentDetails struct { + // ID - READ-ONLY; The reprotect agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The reprotect agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The reprotect agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The reprotect agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the reprotect agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the reprotect agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // ProtectedItemCount - READ-ONLY; The protected item count. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // AccessibleDatastores - READ-ONLY; The list of accessible datastores fetched from discovery. + AccessibleDatastores *[]string `json:"accessibleDatastores,omitempty"` + // VcenterID - READ-ONLY; The Vcenter Id. + VcenterID *string `json:"vcenterId,omitempty"` + // LastDiscoveryInUtc - READ-ONLY; The last time when SDS information discovered in SRS. + LastDiscoveryInUtc *date.Time `json:"lastDiscoveryInUtc,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReprotectAgentDetails. +func (rad ReprotectAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResolveHealthError resolve health errors input properties. +type ResolveHealthError struct { + // HealthErrorID - Health error id. + HealthErrorID *string `json:"healthErrorId,omitempty"` +} + +// ResolveHealthInput resolve health input. +type ResolveHealthInput struct { + // Properties - Disable resolve health input properties. + Properties *ResolveHealthInputProperties `json:"properties,omitempty"` +} + +// ResolveHealthInputProperties resolve health input properties. +type ResolveHealthInputProperties struct { + // HealthErrors - Health errors. + HealthErrors *[]ResolveHealthError `json:"healthErrors,omitempty"` +} + +// Resource azure resource. +type Resource struct { + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location + } + return json.Marshal(objectMap) +} + +// ResourceHealthSummary base class to define the health summary of the resources contained under an Arm +// resource. +type ResourceHealthSummary struct { + // ResourceCount - The count of total resources under the container. + ResourceCount *int32 `json:"resourceCount,omitempty"` + // Issues - The list of summary of health errors across the resources under the container. + Issues *[]HealthErrorSummary `json:"issues,omitempty"` + // CategorizedResourceCounts - The categorized resource counts. + CategorizedResourceCounts map[string]*int32 `json:"categorizedResourceCounts"` +} + +// MarshalJSON is the custom marshaler for ResourceHealthSummary. +func (RHS ResourceHealthSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if RHS.ResourceCount != nil { + objectMap["resourceCount"] = RHS.ResourceCount + } + if RHS.Issues != nil { + objectMap["issues"] = RHS.Issues + } + if RHS.CategorizedResourceCounts != nil { + objectMap["categorizedResourceCounts"] = RHS.CategorizedResourceCounts + } + return json.Marshal(objectMap) +} + +// ResumeJobParams resume job params. +type ResumeJobParams struct { + // Properties - Resume job properties. + Properties *ResumeJobParamsProperties `json:"properties,omitempty"` +} + +// ResumeJobParamsProperties resume job properties. +type ResumeJobParamsProperties struct { + // Comments - Resume job comments. + Comments *string `json:"comments,omitempty"` +} + +// ResyncInput resync input. +type ResyncInput struct { + // Properties - Resync input properties. + Properties *ResyncInputProperties `json:"properties,omitempty"` +} + +// ResyncInputProperties resync input properties. +type ResyncInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicResyncProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ResyncInputProperties struct. +func (rip *ResyncInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicResyncProviderSpecificInput(*v) + if err != nil { + return err + } + rip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicResyncProviderSpecificInput resync provider specific input. +type BasicResyncProviderSpecificInput interface { + AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) + AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) +} + +// ResyncProviderSpecificInput resync provider specific input. +type ResyncProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput', 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicResyncProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicResyncProviderSpecificInput(body []byte) (BasicResyncProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt): + var vmcri VMwareCbtResyncInput + err := json.Unmarshal(body, &vmcri) + return vmcri, err + default: + var rpsi ResyncProviderSpecificInput + err := json.Unmarshal(body, &rpsi) + return rpsi, err + } +} +func unmarshalBasicResyncProviderSpecificInputArray(body []byte) ([]BasicResyncProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpsiArray := make([]BasicResyncProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpsi, err := unmarshalBasicResyncProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rpsiArray[index] = rpsi + } + return rpsiArray, nil +} + +// MarshalJSON is the custom marshaler for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) MarshalJSON() ([]byte, error) { + rpsi.InstanceType = InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput + objectMap := make(map[string]interface{}) + if rpsi.InstanceType != "" { + objectMap["instanceType"] = rpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtResyncInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) { + return nil, false +} + +// AsResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) { + return &rpsi, true +} + +// AsBasicResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsBasicResyncProviderSpecificInput() (BasicResyncProviderSpecificInput, bool) { + return &rpsi, true +} + +// RetentionVolume the retention details of the MT. +type RetentionVolume struct { + // VolumeName - The volume name. + VolumeName *string `json:"volumeName,omitempty"` + // CapacityInBytes - The volume capacity. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // FreeSpaceInBytes - The free space available in this volume. + FreeSpaceInBytes *int64 `json:"freeSpaceInBytes,omitempty"` + // ThresholdPercentage - The threshold percentage. + ThresholdPercentage *int32 `json:"thresholdPercentage,omitempty"` +} + +// ReverseReplicationInput reverse replication input. +type ReverseReplicationInput struct { + // Properties - Reverse replication properties. + Properties *ReverseReplicationInputProperties `json:"properties,omitempty"` +} + +// ReverseReplicationInputProperties reverse replication input properties. +type ReverseReplicationInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - Provider specific reverse replication input. + ProviderSpecificDetails BasicReverseReplicationProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ReverseReplicationInputProperties struct. +func (rrip *ReverseReplicationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rrip.FailoverDirection = &failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReverseReplicationProviderSpecificInput(*v) + if err != nil { + return err + } + rrip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicReverseReplicationProviderSpecificInput provider specific reverse replication input. +type BasicReverseReplicationProviderSpecificInput interface { + AsA2AReprotectInput() (*A2AReprotectInput, bool) + AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) + AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) + AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) + AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) + AsInMageReprotectInput() (*InMageReprotectInput, bool) + AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) +} + +// ReverseReplicationProviderSpecificInput provider specific reverse replication input. +type ReverseReplicationProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReverseReplicationProviderSpecificInput(body []byte) (BasicReverseReplicationProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A): + var ari A2AReprotectInput + err := json.Unmarshal(body, &ari) + return ari, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvrari HyperVReplicaAzureReprotectInput + err := json.Unmarshal(body, &hvrari) + return hvrari, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2): + var imavri InMageAzureV2ReprotectInput + err := json.Unmarshal(body, &imavri) + return imavri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback): + var imrfri InMageRcmFailbackReprotectInput + err := json.Unmarshal(body, &imrfri) + return imrfri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm): + var imrri InMageRcmReprotectInput + err := json.Unmarshal(body, &imrri) + return imrri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage): + var imri InMageReprotectInput + err := json.Unmarshal(body, &imri) + return imri, err + default: + var rrpsi ReverseReplicationProviderSpecificInput + err := json.Unmarshal(body, &rrpsi) + return rrpsi, err + } +} +func unmarshalBasicReverseReplicationProviderSpecificInputArray(body []byte) ([]BasicReverseReplicationProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rrpsiArray := make([]BasicReverseReplicationProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rrpsi, err := unmarshalBasicReverseReplicationProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rrpsiArray[index] = rrpsi + } + return rrpsiArray, nil +} + +// MarshalJSON is the custom marshaler for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) MarshalJSON() ([]byte, error) { + rrpsi.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput + objectMap := make(map[string]interface{}) + if rrpsi.InstanceType != "" { + objectMap["instanceType"] = rrpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return &rrpsi, true +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &rrpsi, true +} + +// RoleAssignment azure role assignment details. +type RoleAssignment struct { + // ID - The ARM Id of the role assignment. + ID *string `json:"id,omitempty"` + // Name - The name of the role assignment. + Name *string `json:"name,omitempty"` + // Scope - Role assignment scope. + Scope *string `json:"scope,omitempty"` + // PrincipalID - Principal Id. + PrincipalID *string `json:"principalId,omitempty"` + // RoleDefinitionID - Role definition id. + RoleDefinitionID *string `json:"roleDefinitionId,omitempty"` +} + +// RunAsAccount CS Accounts Details. +type RunAsAccount struct { + // AccountID - The CS RunAs account Id. + AccountID *string `json:"accountId,omitempty"` + // AccountName - The CS RunAs account name. + AccountName *string `json:"accountName,omitempty"` +} + +// ScriptActionTaskDetails this class represents the script action task details. +type ScriptActionTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // Path - The path. + Path *string `json:"path,omitempty"` + // Output - The output. + Output *string `json:"output,omitempty"` + // IsPrimarySideScript - A value indicating whether it is a primary side script or not. + IsPrimarySideScript *bool `json:"isPrimarySideScript,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) MarshalJSON() ([]byte, error) { + satd.InstanceType = InstanceTypeScriptActionTaskDetails + objectMap := make(map[string]interface{}) + if satd.Name != nil { + objectMap["name"] = satd.Name + } + if satd.Path != nil { + objectMap["path"] = satd.Path + } + if satd.Output != nil { + objectMap["output"] = satd.Output + } + if satd.IsPrimarySideScript != nil { + objectMap["isPrimarySideScript"] = satd.IsPrimarySideScript + } + if satd.InstanceType != "" { + objectMap["instanceType"] = satd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return &satd, true +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &satd, true +} + +// ServiceError ASR error model. +type ServiceError struct { + // Code - Error code. + Code *string `json:"code,omitempty"` + // Message - Error message. + Message *string `json:"message,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ActivityID - Activity Id. + ActivityID *string `json:"activityId,omitempty"` +} + +// BasicStorageAccountCustomDetails storage account custom input. +type BasicStorageAccountCustomDetails interface { + AsExistingStorageAccount() (*ExistingStorageAccount, bool) + AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) +} + +// StorageAccountCustomDetails storage account custom input. +type StorageAccountCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails', 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicStorageAccountCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicStorageAccountCustomDetails(body []byte) (BasicStorageAccountCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting): + var esa ExistingStorageAccount + err := json.Unmarshal(body, &esa) + return esa, err + default: + var sacd StorageAccountCustomDetails + err := json.Unmarshal(body, &sacd) + return sacd, err + } +} +func unmarshalBasicStorageAccountCustomDetailsArray(body []byte) ([]BasicStorageAccountCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sacdArray := make([]BasicStorageAccountCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sacd, err := unmarshalBasicStorageAccountCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + sacdArray[index] = sacd + } + return sacdArray, nil +} + +// MarshalJSON is the custom marshaler for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) MarshalJSON() ([]byte, error) { + sacd.ResourceType = ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails + objectMap := make(map[string]interface{}) + if sacd.ResourceType != "" { + objectMap["resourceType"] = sacd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingStorageAccount is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsExistingStorageAccount() (*ExistingStorageAccount, bool) { + return nil, false +} + +// AsStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) { + return &sacd, true +} + +// AsBasicStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsBasicStorageAccountCustomDetails() (BasicStorageAccountCustomDetails, bool) { + return &sacd, true +} + +// StorageClassification storage object definition. +type StorageClassification struct { + autorest.Response `json:"-"` + // Properties - Properties of the storage object. + Properties *StorageClassificationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageClassification. +func (sc StorageClassification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sc.Properties != nil { + objectMap["properties"] = sc.Properties + } + if sc.Location != nil { + objectMap["location"] = sc.Location + } + return json.Marshal(objectMap) +} + +// StorageClassificationCollection collection of storage details. +type StorageClassificationCollection struct { + autorest.Response `json:"-"` + // Value - The storage details. + Value *[]StorageClassification `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// StorageClassificationCollectionIterator provides access to a complete listing of StorageClassification +// values. +type StorageClassificationCollectionIterator struct { + i int + page StorageClassificationCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StorageClassificationCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StorageClassificationCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StorageClassificationCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StorageClassificationCollectionIterator) Response() StorageClassificationCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StorageClassificationCollectionIterator) Value() StorageClassification { + if !iter.page.NotDone() { + return StorageClassification{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StorageClassificationCollectionIterator type. +func NewStorageClassificationCollectionIterator(page StorageClassificationCollectionPage) StorageClassificationCollectionIterator { + return StorageClassificationCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scc StorageClassificationCollection) IsEmpty() bool { + return scc.Value == nil || len(*scc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scc StorageClassificationCollection) hasNextLink() bool { + return scc.NextLink != nil && len(*scc.NextLink) != 0 +} + +// storageClassificationCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scc StorageClassificationCollection) storageClassificationCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !scc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scc.NextLink))) +} + +// StorageClassificationCollectionPage contains a page of StorageClassification values. +type StorageClassificationCollectionPage struct { + fn func(context.Context, StorageClassificationCollection) (StorageClassificationCollection, error) + scc StorageClassificationCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StorageClassificationCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.scc) + if err != nil { + return err + } + page.scc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StorageClassificationCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StorageClassificationCollectionPage) NotDone() bool { + return !page.scc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StorageClassificationCollectionPage) Response() StorageClassificationCollection { + return page.scc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StorageClassificationCollectionPage) Values() []StorageClassification { + if page.scc.IsEmpty() { + return nil + } + return *page.scc.Value +} + +// Creates a new instance of the StorageClassificationCollectionPage type. +func NewStorageClassificationCollectionPage(cur StorageClassificationCollection, getNextPage func(context.Context, StorageClassificationCollection) (StorageClassificationCollection, error)) StorageClassificationCollectionPage { + return StorageClassificationCollectionPage{ + fn: getNextPage, + scc: cur, + } +} + +// StorageClassificationMapping storage mapping object. +type StorageClassificationMapping struct { + autorest.Response `json:"-"` + // Properties - Properties of the storage mapping object. + Properties *StorageClassificationMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageClassificationMapping. +func (scm StorageClassificationMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scm.Properties != nil { + objectMap["properties"] = scm.Properties + } + if scm.Location != nil { + objectMap["location"] = scm.Location + } + return json.Marshal(objectMap) +} + +// StorageClassificationMappingCollection collection of storage mapping details. +type StorageClassificationMappingCollection struct { + autorest.Response `json:"-"` + // Value - The storage details. + Value *[]StorageClassificationMapping `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// StorageClassificationMappingCollectionIterator provides access to a complete listing of +// StorageClassificationMapping values. +type StorageClassificationMappingCollectionIterator struct { + i int + page StorageClassificationMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StorageClassificationMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StorageClassificationMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StorageClassificationMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StorageClassificationMappingCollectionIterator) Response() StorageClassificationMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StorageClassificationMappingCollectionIterator) Value() StorageClassificationMapping { + if !iter.page.NotDone() { + return StorageClassificationMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StorageClassificationMappingCollectionIterator type. +func NewStorageClassificationMappingCollectionIterator(page StorageClassificationMappingCollectionPage) StorageClassificationMappingCollectionIterator { + return StorageClassificationMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scmc StorageClassificationMappingCollection) IsEmpty() bool { + return scmc.Value == nil || len(*scmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scmc StorageClassificationMappingCollection) hasNextLink() bool { + return scmc.NextLink != nil && len(*scmc.NextLink) != 0 +} + +// storageClassificationMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scmc StorageClassificationMappingCollection) storageClassificationMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !scmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scmc.NextLink))) +} + +// StorageClassificationMappingCollectionPage contains a page of StorageClassificationMapping values. +type StorageClassificationMappingCollectionPage struct { + fn func(context.Context, StorageClassificationMappingCollection) (StorageClassificationMappingCollection, error) + scmc StorageClassificationMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StorageClassificationMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.scmc) + if err != nil { + return err + } + page.scmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StorageClassificationMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StorageClassificationMappingCollectionPage) NotDone() bool { + return !page.scmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StorageClassificationMappingCollectionPage) Response() StorageClassificationMappingCollection { + return page.scmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StorageClassificationMappingCollectionPage) Values() []StorageClassificationMapping { + if page.scmc.IsEmpty() { + return nil + } + return *page.scmc.Value +} + +// Creates a new instance of the StorageClassificationMappingCollectionPage type. +func NewStorageClassificationMappingCollectionPage(cur StorageClassificationMappingCollection, getNextPage func(context.Context, StorageClassificationMappingCollection) (StorageClassificationMappingCollection, error)) StorageClassificationMappingCollectionPage { + return StorageClassificationMappingCollectionPage{ + fn: getNextPage, + scmc: cur, + } +} + +// StorageClassificationMappingInput storage mapping input. +type StorageClassificationMappingInput struct { + // Properties - Storage mapping input properties. + Properties *StorageMappingInputProperties `json:"properties,omitempty"` +} + +// StorageClassificationMappingProperties storage mapping properties. +type StorageClassificationMappingProperties struct { + // TargetStorageClassificationID - Target storage object Id. + TargetStorageClassificationID *string `json:"targetStorageClassificationId,omitempty"` +} + +// StorageClassificationProperties storage object properties. +type StorageClassificationProperties struct { + // FriendlyName - Friendly name of the Storage classification. + FriendlyName *string `json:"friendlyName,omitempty"` +} + +// StorageMappingInputProperties storage mapping input properties. +type StorageMappingInputProperties struct { + // TargetStorageClassificationID - The ID of the storage object. + TargetStorageClassificationID *string `json:"targetStorageClassificationId,omitempty"` +} + +// Subnet subnets of the network. +type Subnet struct { + // Name - The subnet name. + Name *string `json:"name,omitempty"` + // FriendlyName - The subnet friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // AddressList - The list of addresses for the subnet. + AddressList *[]string `json:"addressList,omitempty"` +} + +// SupportedOperatingSystems supported operating systems. +type SupportedOperatingSystems struct { + autorest.Response `json:"-"` + // Properties - The supported operating systems properties. + Properties *SupportedOSProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for SupportedOperatingSystems. +func (sos SupportedOperatingSystems) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sos.Properties != nil { + objectMap["properties"] = sos.Properties + } + if sos.Location != nil { + objectMap["location"] = sos.Location + } + return json.Marshal(objectMap) +} + +// SupportedOSDetails supported operating system details. +type SupportedOSDetails struct { + // OsName - The name. + OsName *string `json:"osName,omitempty"` + // OsType - The type. + OsType *string `json:"osType,omitempty"` + // OsVersions - The list of version for operating system. + OsVersions *[]OSVersionWrapper `json:"osVersions,omitempty"` +} + +// SupportedOSProperties supported operating systems properties. +type SupportedOSProperties struct { + // SupportedOsList - The supported operating systems property list. + SupportedOsList *[]SupportedOSProperty `json:"supportedOsList,omitempty"` +} + +// SupportedOSProperty supported operating systems property. +type SupportedOSProperty struct { + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` + // SupportedOs - The list of supported operating systems. + SupportedOs *[]SupportedOSDetails `json:"supportedOs,omitempty"` +} + +// SwitchProtectionInput switch protection input. +type SwitchProtectionInput struct { + // Properties - Switch protection properties. + Properties *SwitchProtectionInputProperties `json:"properties,omitempty"` +} + +// SwitchProtectionInputProperties switch protection input properties. +type SwitchProtectionInputProperties struct { + // ReplicationProtectedItemName - The unique replication protected item name. + ReplicationProtectedItemName *string `json:"replicationProtectedItemName,omitempty"` + // ProviderSpecificDetails - Provider specific switch protection input. + ProviderSpecificDetails BasicSwitchProtectionProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SwitchProtectionInputProperties struct. +func (spip *SwitchProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "replicationProtectedItemName": + if v != nil { + var replicationProtectedItemName string + err = json.Unmarshal(*v, &replicationProtectedItemName) + if err != nil { + return err + } + spip.ReplicationProtectedItemName = &replicationProtectedItemName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicSwitchProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + spip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// SwitchProtectionJobDetails this class represents details for switch protection job. +type SwitchProtectionJobDetails struct { + // NewReplicationProtectedItemID - ARM Id of the new replication protected item. + NewReplicationProtectedItemID *string `json:"newReplicationProtectedItemId,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) MarshalJSON() ([]byte, error) { + spjd.InstanceType = InstanceTypeSwitchProtectionJobDetails + objectMap := make(map[string]interface{}) + if spjd.NewReplicationProtectedItemID != nil { + objectMap["newReplicationProtectedItemId"] = spjd.NewReplicationProtectedItemID + } + if spjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = spjd.AffectedObjectDetails + } + if spjd.InstanceType != "" { + objectMap["instanceType"] = spjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return &spjd, true +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &spjd, true +} + +// BasicSwitchProtectionProviderSpecificInput provider specific switch protection input. +type BasicSwitchProtectionProviderSpecificInput interface { + AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) + AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) +} + +// SwitchProtectionProviderSpecificInput provider specific switch protection input. +type SwitchProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput', 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicSwitchProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicSwitchProtectionProviderSpecificInput(body []byte) (BasicSwitchProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A): + var aspi A2ASwitchProtectionInput + err := json.Unmarshal(body, &aspi) + return aspi, err + default: + var sppsi SwitchProtectionProviderSpecificInput + err := json.Unmarshal(body, &sppsi) + return sppsi, err + } +} +func unmarshalBasicSwitchProtectionProviderSpecificInputArray(body []byte) ([]BasicSwitchProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sppsiArray := make([]BasicSwitchProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sppsi, err := unmarshalBasicSwitchProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + sppsiArray[index] = sppsi + } + return sppsiArray, nil +} + +// MarshalJSON is the custom marshaler for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + sppsi.InstanceType = InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if sppsi.InstanceType != "" { + objectMap["instanceType"] = sppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ASwitchProtectionInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) { + return nil, false +} + +// AsSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) { + return &sppsi, true +} + +// AsBasicSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsBasicSwitchProtectionProviderSpecificInput() (BasicSwitchProtectionProviderSpecificInput, bool) { + return &sppsi, true +} + +// SwitchProviderInput input definition for switch provider. +type SwitchProviderInput struct { + // Properties - Switch provider input properties. + Properties *SwitchProviderInputProperties `json:"properties,omitempty"` +} + +// SwitchProviderInputProperties input definition for switch provider input properties. +type SwitchProviderInputProperties struct { + // TargetInstanceType - Target provider type. + TargetInstanceType *string `json:"targetInstanceType,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicSwitchProviderProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SwitchProviderInputProperties struct. +func (spip *SwitchProviderInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetInstanceType": + if v != nil { + var targetInstanceType string + err = json.Unmarshal(*v, &targetInstanceType) + if err != nil { + return err + } + spip.TargetInstanceType = &targetInstanceType + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicSwitchProviderProviderSpecificInput(*v) + if err != nil { + return err + } + spip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicSwitchProviderProviderSpecificInput provider specific switch provider input. +type BasicSwitchProviderProviderSpecificInput interface { + AsInMageAzureV2SwitchProviderProviderInput() (*InMageAzureV2SwitchProviderProviderInput, bool) + AsSwitchProviderProviderSpecificInput() (*SwitchProviderProviderSpecificInput, bool) +} + +// SwitchProviderProviderSpecificInput provider specific switch provider input. +type SwitchProviderProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeSwitchProviderProviderSpecificInput', 'InstanceTypeInMageAzureV2' + InstanceType InstanceTypeBasicSwitchProviderProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicSwitchProviderProviderSpecificInput(body []byte) (BasicSwitchProviderProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInMageAzureV2): + var imavsppi InMageAzureV2SwitchProviderProviderInput + err := json.Unmarshal(body, &imavsppi) + return imavsppi, err + default: + var sppsi SwitchProviderProviderSpecificInput + err := json.Unmarshal(body, &sppsi) + return sppsi, err + } +} +func unmarshalBasicSwitchProviderProviderSpecificInputArray(body []byte) ([]BasicSwitchProviderProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sppsiArray := make([]BasicSwitchProviderProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sppsi, err := unmarshalBasicSwitchProviderProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + sppsiArray[index] = sppsi + } + return sppsiArray, nil +} + +// MarshalJSON is the custom marshaler for SwitchProviderProviderSpecificInput. +func (sppsi SwitchProviderProviderSpecificInput) MarshalJSON() ([]byte, error) { + sppsi.InstanceType = InstanceTypeSwitchProviderProviderSpecificInput + objectMap := make(map[string]interface{}) + if sppsi.InstanceType != "" { + objectMap["instanceType"] = sppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageAzureV2SwitchProviderProviderInput is the BasicSwitchProviderProviderSpecificInput implementation for SwitchProviderProviderSpecificInput. +func (sppsi SwitchProviderProviderSpecificInput) AsInMageAzureV2SwitchProviderProviderInput() (*InMageAzureV2SwitchProviderProviderInput, bool) { + return nil, false +} + +// AsSwitchProviderProviderSpecificInput is the BasicSwitchProviderProviderSpecificInput implementation for SwitchProviderProviderSpecificInput. +func (sppsi SwitchProviderProviderSpecificInput) AsSwitchProviderProviderSpecificInput() (*SwitchProviderProviderSpecificInput, bool) { + return &sppsi, true +} + +// AsBasicSwitchProviderProviderSpecificInput is the BasicSwitchProviderProviderSpecificInput implementation for SwitchProviderProviderSpecificInput. +func (sppsi SwitchProviderProviderSpecificInput) AsBasicSwitchProviderProviderSpecificInput() (BasicSwitchProviderProviderSpecificInput, bool) { + return &sppsi, true +} + +// TargetComputeSize represents applicable recovery vm sizes. +type TargetComputeSize struct { + // ID - The Id. + ID *string `json:"id,omitempty"` + // Name - The name. + Name *string `json:"name,omitempty"` + // Type - The Type of the object. + Type *string `json:"type,omitempty"` + // Properties - The custom data. + Properties *TargetComputeSizeProperties `json:"properties,omitempty"` +} + +// TargetComputeSizeCollection target compute size collection. +type TargetComputeSizeCollection struct { + autorest.Response `json:"-"` + // Value - The list of target compute sizes. + Value *[]TargetComputeSize `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// TargetComputeSizeCollectionIterator provides access to a complete listing of TargetComputeSize values. +type TargetComputeSizeCollectionIterator struct { + i int + page TargetComputeSizeCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *TargetComputeSizeCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizeCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *TargetComputeSizeCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TargetComputeSizeCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter TargetComputeSizeCollectionIterator) Response() TargetComputeSizeCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter TargetComputeSizeCollectionIterator) Value() TargetComputeSize { + if !iter.page.NotDone() { + return TargetComputeSize{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the TargetComputeSizeCollectionIterator type. +func NewTargetComputeSizeCollectionIterator(page TargetComputeSizeCollectionPage) TargetComputeSizeCollectionIterator { + return TargetComputeSizeCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (tcsc TargetComputeSizeCollection) IsEmpty() bool { + return tcsc.Value == nil || len(*tcsc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (tcsc TargetComputeSizeCollection) hasNextLink() bool { + return tcsc.NextLink != nil && len(*tcsc.NextLink) != 0 +} + +// targetComputeSizeCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tcsc TargetComputeSizeCollection) targetComputeSizeCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !tcsc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(tcsc.NextLink))) +} + +// TargetComputeSizeCollectionPage contains a page of TargetComputeSize values. +type TargetComputeSizeCollectionPage struct { + fn func(context.Context, TargetComputeSizeCollection) (TargetComputeSizeCollection, error) + tcsc TargetComputeSizeCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *TargetComputeSizeCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizeCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.tcsc) + if err != nil { + return err + } + page.tcsc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *TargetComputeSizeCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TargetComputeSizeCollectionPage) NotDone() bool { + return !page.tcsc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TargetComputeSizeCollectionPage) Response() TargetComputeSizeCollection { + return page.tcsc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TargetComputeSizeCollectionPage) Values() []TargetComputeSize { + if page.tcsc.IsEmpty() { + return nil + } + return *page.tcsc.Value +} + +// Creates a new instance of the TargetComputeSizeCollectionPage type. +func NewTargetComputeSizeCollectionPage(cur TargetComputeSizeCollection, getNextPage func(context.Context, TargetComputeSizeCollection) (TargetComputeSizeCollection, error)) TargetComputeSizeCollectionPage { + return TargetComputeSizeCollectionPage{ + fn: getNextPage, + tcsc: cur, + } +} + +// TargetComputeSizeProperties represents applicable recovery vm sizes properties. +type TargetComputeSizeProperties struct { + // Name - Target compute size name. + Name *string `json:"name,omitempty"` + // FriendlyName - Target compute size display name. + FriendlyName *string `json:"friendlyName,omitempty"` + // CPUCoresCount - The maximum cpu cores count supported by target compute size. + CPUCoresCount *int32 `json:"cpuCoresCount,omitempty"` + // VCPUsAvailable - READ-ONLY; The Available vCPUs supported by target compute size. + VCPUsAvailable *int32 `json:"vCPUsAvailable,omitempty"` + // MemoryInGB - The maximum memory in GB supported by target compute size. + MemoryInGB *float64 `json:"memoryInGB,omitempty"` + // MaxDataDiskCount - The maximum data disks count supported by target compute size. + MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` + // MaxNicsCount - The maximum Nics count supported by target compute size. + MaxNicsCount *int32 `json:"maxNicsCount,omitempty"` + // Errors - The reasons why the target compute size is not applicable for the protected item. + Errors *[]ComputeSizeErrorDetails `json:"errors,omitempty"` + // HighIopsSupported - The value indicating whether the target compute size supports high Iops. + HighIopsSupported *string `json:"highIopsSupported,omitempty"` + // HyperVGenerations - The supported HyperV Generations. + HyperVGenerations *[]string `json:"hyperVGenerations,omitempty"` +} + +// MarshalJSON is the custom marshaler for TargetComputeSizeProperties. +func (tcsp TargetComputeSizeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tcsp.Name != nil { + objectMap["name"] = tcsp.Name + } + if tcsp.FriendlyName != nil { + objectMap["friendlyName"] = tcsp.FriendlyName + } + if tcsp.CPUCoresCount != nil { + objectMap["cpuCoresCount"] = tcsp.CPUCoresCount + } + if tcsp.MemoryInGB != nil { + objectMap["memoryInGB"] = tcsp.MemoryInGB + } + if tcsp.MaxDataDiskCount != nil { + objectMap["maxDataDiskCount"] = tcsp.MaxDataDiskCount + } + if tcsp.MaxNicsCount != nil { + objectMap["maxNicsCount"] = tcsp.MaxNicsCount + } + if tcsp.Errors != nil { + objectMap["errors"] = tcsp.Errors + } + if tcsp.HighIopsSupported != nil { + objectMap["highIopsSupported"] = tcsp.HighIopsSupported + } + if tcsp.HyperVGenerations != nil { + objectMap["hyperVGenerations"] = tcsp.HyperVGenerations + } + return json.Marshal(objectMap) +} + +// BasicTaskTypeDetails task details based on specific task type. +type BasicTaskTypeDetails interface { + AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) + AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) + AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) + AsJobTaskDetails() (*JobTaskDetails, bool) + AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) + AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) + AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) + AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) + AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) + AsTaskTypeDetails() (*TaskTypeDetails, bool) +} + +// TaskTypeDetails task details based on specific task type. +type TaskTypeDetails struct { + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicTaskTypeDetails(body []byte) (BasicTaskTypeDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAutomationRunbookTaskDetails): + var artd AutomationRunbookTaskDetails + err := json.Unmarshal(body, &artd) + return artd, err + case string(InstanceTypeConsistencyCheckTaskDetails): + var cctd ConsistencyCheckTaskDetails + err := json.Unmarshal(body, &cctd) + return cctd, err + case string(InstanceTypeFabricReplicationGroupTaskDetails): + var frgtd FabricReplicationGroupTaskDetails + err := json.Unmarshal(body, &frgtd) + return frgtd, err + case string(InstanceTypeJobTaskDetails): + var jtd JobTaskDetails + err := json.Unmarshal(body, &jtd) + return jtd, err + case string(InstanceTypeManualActionTaskDetails): + var matd ManualActionTaskDetails + err := json.Unmarshal(body, &matd) + return matd, err + case string(InstanceTypeScriptActionTaskDetails): + var satd ScriptActionTaskDetails + err := json.Unmarshal(body, &satd) + return satd, err + case string(InstanceTypeVirtualMachineTaskDetails): + var vmtd VirtualMachineTaskDetails + err := json.Unmarshal(body, &vmtd) + return vmtd, err + case string(InstanceTypeVMNicUpdatesTaskDetails): + var vnutd VMNicUpdatesTaskDetails + err := json.Unmarshal(body, &vnutd) + return vnutd, err + default: + var ttd TaskTypeDetails + err := json.Unmarshal(body, &ttd) + return ttd, err + } +} +func unmarshalBasicTaskTypeDetailsArray(body []byte) ([]BasicTaskTypeDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ttdArray := make([]BasicTaskTypeDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ttd, err := unmarshalBasicTaskTypeDetails(*rawMessage) + if err != nil { + return nil, err + } + ttdArray[index] = ttd + } + return ttdArray, nil +} + +// MarshalJSON is the custom marshaler for TaskTypeDetails. +func (ttd TaskTypeDetails) MarshalJSON() ([]byte, error) { + ttd.InstanceType = InstanceTypeTaskTypeDetails + objectMap := make(map[string]interface{}) + if ttd.InstanceType != "" { + objectMap["instanceType"] = ttd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return &ttd, true +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &ttd, true +} + +// TestFailoverCleanupInput input definition for test failover cleanup. +type TestFailoverCleanupInput struct { + // Properties - Test failover cleanup input properties. + Properties *TestFailoverCleanupInputProperties `json:"properties,omitempty"` +} + +// TestFailoverCleanupInputProperties input definition for test failover cleanup input properties. +type TestFailoverCleanupInputProperties struct { + // Comments - Test failover cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// TestFailoverInput input definition for test failover. +type TestFailoverInput struct { + // Properties - Test failover input properties. + Properties *TestFailoverInputProperties `json:"properties,omitempty"` +} + +// TestFailoverInputProperties input definition for test failover input properties. +type TestFailoverInputProperties struct { + // FailoverDirection - Test failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // NetworkType - Network type to be used for test failover. + NetworkType *string `json:"networkType,omitempty"` + // NetworkID - The id of the network to be used for test failover. + NetworkID *string `json:"networkId,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicTestFailoverProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TestFailoverInputProperties struct. +func (tfip *TestFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + tfip.FailoverDirection = &failoverDirection + } + case "networkType": + if v != nil { + var networkType string + err = json.Unmarshal(*v, &networkType) + if err != nil { + return err + } + tfip.NetworkType = &networkType + } + case "networkId": + if v != nil { + var networkID string + err = json.Unmarshal(*v, &networkID) + if err != nil { + return err + } + tfip.NetworkID = &networkID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicTestFailoverProviderSpecificInput(*v) + if err != nil { + return err + } + tfip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// TestFailoverJobDetails this class represents the details for a test failover job. +type TestFailoverJobDetails struct { + // TestFailoverStatus - The test failover status. + TestFailoverStatus *string `json:"testFailoverStatus,omitempty"` + // Comments - The test failover comments. + Comments *string `json:"comments,omitempty"` + // NetworkName - The test network name. + NetworkName *string `json:"networkName,omitempty"` + // NetworkFriendlyName - The test network friendly name. + NetworkFriendlyName *string `json:"networkFriendlyName,omitempty"` + // NetworkType - The test network type (see TestFailoverInput enum for possible values). + NetworkType *string `json:"networkType,omitempty"` + // ProtectedItemDetails - The test VM details. + ProtectedItemDetails *[]FailoverReplicationProtectedItemDetails `json:"protectedItemDetails,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) MarshalJSON() ([]byte, error) { + tfjd.InstanceType = InstanceTypeTestFailoverJobDetails + objectMap := make(map[string]interface{}) + if tfjd.TestFailoverStatus != nil { + objectMap["testFailoverStatus"] = tfjd.TestFailoverStatus + } + if tfjd.Comments != nil { + objectMap["comments"] = tfjd.Comments + } + if tfjd.NetworkName != nil { + objectMap["networkName"] = tfjd.NetworkName + } + if tfjd.NetworkFriendlyName != nil { + objectMap["networkFriendlyName"] = tfjd.NetworkFriendlyName + } + if tfjd.NetworkType != nil { + objectMap["networkType"] = tfjd.NetworkType + } + if tfjd.ProtectedItemDetails != nil { + objectMap["protectedItemDetails"] = tfjd.ProtectedItemDetails + } + if tfjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = tfjd.AffectedObjectDetails + } + if tfjd.InstanceType != "" { + objectMap["instanceType"] = tfjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return &tfjd, true +} + +// AsJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &tfjd, true +} + +// BasicTestFailoverProviderSpecificInput provider specific test failover input. +type BasicTestFailoverProviderSpecificInput interface { + AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) + AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) + AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) + AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) + AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) + AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) +} + +// TestFailoverProviderSpecificInput provider specific test failover input. +type TestFailoverProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicTestFailoverProviderSpecificInput(body []byte) (BasicTestFailoverProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A): + var atfi A2ATestFailoverInput + err := json.Unmarshal(body, &atfi) + return atfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvratfi HyperVReplicaAzureTestFailoverInput + err := json.Unmarshal(body, &hvratfi) + return hvratfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2): + var imavtfi InMageAzureV2TestFailoverInput + err := json.Unmarshal(body, &imavtfi) + return imavtfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm): + var imrtfi InMageRcmTestFailoverInput + err := json.Unmarshal(body, &imrtfi) + return imrtfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage): + var imtfi InMageTestFailoverInput + err := json.Unmarshal(body, &imtfi) + return imtfi, err + default: + var tfpsi TestFailoverProviderSpecificInput + err := json.Unmarshal(body, &tfpsi) + return tfpsi, err + } +} +func unmarshalBasicTestFailoverProviderSpecificInputArray(body []byte) ([]BasicTestFailoverProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tfpsiArray := make([]BasicTestFailoverProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + tfpsi, err := unmarshalBasicTestFailoverProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + tfpsiArray[index] = tfpsi + } + return tfpsiArray, nil +} + +// MarshalJSON is the custom marshaler for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) MarshalJSON() ([]byte, error) { + tfpsi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput + objectMap := make(map[string]interface{}) + if tfpsi.InstanceType != "" { + objectMap["instanceType"] = tfpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return &tfpsi, true +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &tfpsi, true +} + +// TestMigrateCleanupInput input for test migrate cleanup. +type TestMigrateCleanupInput struct { + // Properties - Test migrate cleanup input properties. + Properties *TestMigrateCleanupInputProperties `json:"properties,omitempty"` +} + +// TestMigrateCleanupInputProperties test migrate cleanup input properties. +type TestMigrateCleanupInputProperties struct { + // Comments - Test migrate cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// TestMigrateInput input for test migrate. +type TestMigrateInput struct { + // Properties - Test migrate input properties. + Properties *TestMigrateInputProperties `json:"properties,omitempty"` +} + +// TestMigrateInputProperties test migrate input properties. +type TestMigrateInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicTestMigrateProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TestMigrateInputProperties struct. +func (tmip *TestMigrateInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicTestMigrateProviderSpecificInput(*v) + if err != nil { + return err + } + tmip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicTestMigrateProviderSpecificInput test migrate provider specific input. +type BasicTestMigrateProviderSpecificInput interface { + AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) + AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) +} + +// TestMigrateProviderSpecificInput test migrate provider specific input. +type TestMigrateProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput', 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicTestMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicTestMigrateProviderSpecificInput(body []byte) (BasicTestMigrateProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt): + var vmctmi VMwareCbtTestMigrateInput + err := json.Unmarshal(body, &vmctmi) + return vmctmi, err + default: + var tmpsi TestMigrateProviderSpecificInput + err := json.Unmarshal(body, &tmpsi) + return tmpsi, err + } +} +func unmarshalBasicTestMigrateProviderSpecificInputArray(body []byte) ([]BasicTestMigrateProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tmpsiArray := make([]BasicTestMigrateProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + tmpsi, err := unmarshalBasicTestMigrateProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + tmpsiArray[index] = tmpsi + } + return tmpsiArray, nil +} + +// MarshalJSON is the custom marshaler for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) MarshalJSON() ([]byte, error) { + tmpsi.InstanceType = InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput + objectMap := make(map[string]interface{}) + if tmpsi.InstanceType != "" { + objectMap["instanceType"] = tmpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtTestMigrateInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) { + return nil, false +} + +// AsTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) { + return &tmpsi, true +} + +// AsBasicTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsBasicTestMigrateProviderSpecificInput() (BasicTestMigrateProviderSpecificInput, bool) { + return &tmpsi, true +} + +// UnplannedFailoverInput input definition for unplanned failover. +type UnplannedFailoverInput struct { + // Properties - Unplanned failover input properties. + Properties *UnplannedFailoverInputProperties `json:"properties,omitempty"` +} + +// UnplannedFailoverInputProperties input definition for unplanned failover input properties. +type UnplannedFailoverInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // SourceSiteOperations - Source site operations status. + SourceSiteOperations *string `json:"sourceSiteOperations,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicUnplannedFailoverProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UnplannedFailoverInputProperties struct. +func (ufip *UnplannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + ufip.FailoverDirection = &failoverDirection + } + case "sourceSiteOperations": + if v != nil { + var sourceSiteOperations string + err = json.Unmarshal(*v, &sourceSiteOperations) + if err != nil { + return err + } + ufip.SourceSiteOperations = &sourceSiteOperations + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUnplannedFailoverProviderSpecificInput(*v) + if err != nil { + return err + } + ufip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUnplannedFailoverProviderSpecificInput provider specific unplanned failover input. +type BasicUnplannedFailoverProviderSpecificInput interface { + AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) + AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) + AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) + AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) + AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) + AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) +} + +// UnplannedFailoverProviderSpecificInput provider specific unplanned failover input. +type UnplannedFailoverProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUnplannedFailoverProviderSpecificInput(body []byte) (BasicUnplannedFailoverProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A): + var aufi A2AUnplannedFailoverInput + err := json.Unmarshal(body, &aufi) + return aufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraufi HyperVReplicaAzureUnplannedFailoverInput + err := json.Unmarshal(body, &hvraufi) + return hvraufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2): + var imavufi InMageAzureV2UnplannedFailoverInput + err := json.Unmarshal(body, &imavufi) + return imavufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm): + var imrufi InMageRcmUnplannedFailoverInput + err := json.Unmarshal(body, &imrufi) + return imrufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage): + var imufi InMageUnplannedFailoverInput + err := json.Unmarshal(body, &imufi) + return imufi, err + default: + var ufpsi UnplannedFailoverProviderSpecificInput + err := json.Unmarshal(body, &ufpsi) + return ufpsi, err + } +} +func unmarshalBasicUnplannedFailoverProviderSpecificInputArray(body []byte) ([]BasicUnplannedFailoverProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ufpsiArray := make([]BasicUnplannedFailoverProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ufpsi, err := unmarshalBasicUnplannedFailoverProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + ufpsiArray[index] = ufpsi + } + return ufpsiArray, nil +} + +// MarshalJSON is the custom marshaler for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) MarshalJSON() ([]byte, error) { + ufpsi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput + objectMap := make(map[string]interface{}) + if ufpsi.InstanceType != "" { + objectMap["instanceType"] = ufpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return &ufpsi, true +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &ufpsi, true +} + +// UpdateApplianceForReplicationProtectedItemInput update appliance for replication protected item input. +type UpdateApplianceForReplicationProtectedItemInput struct { + // Properties - Update appliance replication protected item properties. + Properties *UpdateApplianceForReplicationProtectedItemInputProperties `json:"properties,omitempty"` +} + +// UpdateApplianceForReplicationProtectedItemInputProperties update appliance for protected item input +// properties. +type UpdateApplianceForReplicationProtectedItemInputProperties struct { + // TargetApplianceID - The target appliance Id. + TargetApplianceID *string `json:"targetApplianceId,omitempty"` + // ProviderSpecificDetails - The provider specific input to update replication protected item. + ProviderSpecificDetails BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateApplianceForReplicationProtectedItemInputProperties struct. +func (uafrpiip *UpdateApplianceForReplicationProtectedItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetApplianceId": + if v != nil { + var targetApplianceID string + err = json.Unmarshal(*v, &targetApplianceID) + if err != nil { + return err + } + uafrpiip.TargetApplianceID = &targetApplianceID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput(*v) + if err != nil { + return err + } + uafrpiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput update replication protected item provider +// specific input. +type BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput interface { + AsInMageRcmUpdateApplianceForReplicationProtectedItemInput() (*InMageRcmUpdateApplianceForReplicationProtectedItemInput, bool) + AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (*UpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) +} + +// UpdateApplianceForReplicationProtectedItemProviderSpecificInput update replication protected item provider +// specific input. +type UpdateApplianceForReplicationProtectedItemProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput', 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput(body []byte) (BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm): + var imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput + err := json.Unmarshal(body, &imruafrpii) + return imruafrpii, err + default: + var uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput + err := json.Unmarshal(body, &uafrpipsi) + return uafrpipsi, err + } +} +func unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputArray(body []byte) ([]BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + uafrpipsiArray := make([]BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + uafrpipsi, err := unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + uafrpipsiArray[index] = uafrpipsi + } + return uafrpipsiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) MarshalJSON() ([]byte, error) { + uafrpipsi.InstanceType = InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput + objectMap := make(map[string]interface{}) + if uafrpipsi.InstanceType != "" { + objectMap["instanceType"] = uafrpipsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageRcmUpdateApplianceForReplicationProtectedItemInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) AsInMageRcmUpdateApplianceForReplicationProtectedItemInput() (*InMageRcmUpdateApplianceForReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (*UpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return &uafrpipsi, true +} + +// AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return &uafrpipsi, true +} + +// UpdateDiskInput disk input for update. +type UpdateDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // TargetDiskName - The target disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// UpdateMigrationItemInput update migration item input. +type UpdateMigrationItemInput struct { + // Properties - Update migration item input properties. + Properties *UpdateMigrationItemInputProperties `json:"properties,omitempty"` +} + +// UpdateMigrationItemInputProperties update migration item input properties. +type UpdateMigrationItemInputProperties struct { + // ProviderSpecificDetails - The provider specific input to update migration item. + ProviderSpecificDetails BasicUpdateMigrationItemProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateMigrationItemInputProperties struct. +func (umiip *UpdateMigrationItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateMigrationItemProviderSpecificInput(*v) + if err != nil { + return err + } + umiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateMigrationItemProviderSpecificInput update migration item provider specific input. +type BasicUpdateMigrationItemProviderSpecificInput interface { + AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) + AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) +} + +// UpdateMigrationItemProviderSpecificInput update migration item provider specific input. +type UpdateMigrationItemProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput', 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicUpdateMigrationItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateMigrationItemProviderSpecificInput(body []byte) (BasicUpdateMigrationItemProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt): + var vmcumii VMwareCbtUpdateMigrationItemInput + err := json.Unmarshal(body, &vmcumii) + return vmcumii, err + default: + var umipsi UpdateMigrationItemProviderSpecificInput + err := json.Unmarshal(body, &umipsi) + return umipsi, err + } +} +func unmarshalBasicUpdateMigrationItemProviderSpecificInputArray(body []byte) ([]BasicUpdateMigrationItemProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + umipsiArray := make([]BasicUpdateMigrationItemProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + umipsi, err := unmarshalBasicUpdateMigrationItemProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + umipsiArray[index] = umipsi + } + return umipsiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) MarshalJSON() ([]byte, error) { + umipsi.InstanceType = InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput + objectMap := make(map[string]interface{}) + if umipsi.InstanceType != "" { + objectMap["instanceType"] = umipsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtUpdateMigrationItemInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) { + return nil, false +} + +// AsUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) { + return &umipsi, true +} + +// AsBasicUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsBasicUpdateMigrationItemProviderSpecificInput() (BasicUpdateMigrationItemProviderSpecificInput, bool) { + return &umipsi, true +} + +// UpdateMobilityServiceRequest request to update the mobility service on a protected item. +type UpdateMobilityServiceRequest struct { + // Properties - The properties of the update mobility service request. + Properties *UpdateMobilityServiceRequestProperties `json:"properties,omitempty"` +} + +// UpdateMobilityServiceRequestProperties the properties of an update mobility service request. +type UpdateMobilityServiceRequestProperties struct { + // RunAsAccountID - The CS run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// UpdateNetworkMappingInput update network mapping input. +type UpdateNetworkMappingInput struct { + // Properties - The input properties needed to update network mapping. + Properties *UpdateNetworkMappingInputProperties `json:"properties,omitempty"` +} + +// UpdateNetworkMappingInputProperties common input details for network mapping operation. +type UpdateNetworkMappingInputProperties struct { + // RecoveryFabricName - Recovery fabric name. + RecoveryFabricName *string `json:"recoveryFabricName,omitempty"` + // RecoveryNetworkID - Recovery network Id. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // FabricSpecificDetails - Fabrics specific input network Id. + FabricSpecificDetails BasicFabricSpecificUpdateNetworkMappingInput `json:"fabricSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateNetworkMappingInputProperties struct. +func (unmip *UpdateNetworkMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryFabricName": + if v != nil { + var recoveryFabricName string + err = json.Unmarshal(*v, &recoveryFabricName) + if err != nil { + return err + } + unmip.RecoveryFabricName = &recoveryFabricName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + unmip.RecoveryNetworkID = &recoveryNetworkID + } + case "fabricSpecificDetails": + if v != nil { + fabricSpecificDetails, err := unmarshalBasicFabricSpecificUpdateNetworkMappingInput(*v) + if err != nil { + return err + } + unmip.FabricSpecificDetails = fabricSpecificDetails + } + } + } + + return nil +} + +// UpdatePolicyInput update policy input. +type UpdatePolicyInput struct { + // Properties - The ReplicationProviderSettings. + Properties *UpdatePolicyInputProperties `json:"properties,omitempty"` +} + +// UpdatePolicyInputProperties policy update properties. +type UpdatePolicyInputProperties struct { + // ReplicationProviderSettings - The ReplicationProviderSettings. + ReplicationProviderSettings BasicPolicyProviderSpecificInput `json:"replicationProviderSettings,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdatePolicyInputProperties struct. +func (upip *UpdatePolicyInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "replicationProviderSettings": + if v != nil { + replicationProviderSettings, err := unmarshalBasicPolicyProviderSpecificInput(*v) + if err != nil { + return err + } + upip.ReplicationProviderSettings = replicationProviderSettings + } + } + } + + return nil +} + +// UpdateProtectionContainerMappingInput container pairing update input. +type UpdateProtectionContainerMappingInput struct { + // Properties - Update protection container mapping input properties. + Properties *UpdateProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// UpdateProtectionContainerMappingInputProperties container pairing update input. +type UpdateProtectionContainerMappingInputProperties struct { + // ProviderSpecificInput - Provider specific input for updating protection container mapping. + ProviderSpecificInput BasicReplicationProviderSpecificUpdateContainerMappingInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateProtectionContainerMappingInputProperties struct. +func (upcmip *UpdateProtectionContainerMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(*v) + if err != nil { + return err + } + upcmip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// UpdateRecoveryPlanInput update recovery plan input class. +type UpdateRecoveryPlanInput struct { + // Properties - Recovery plan update properties. + Properties *UpdateRecoveryPlanInputProperties `json:"properties,omitempty"` +} + +// UpdateRecoveryPlanInputProperties recovery plan update properties. +type UpdateRecoveryPlanInputProperties struct { + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` +} + +// UpdateReplicationProtectedItemInput update replication protected item input. +type UpdateReplicationProtectedItemInput struct { + // Properties - Update replication protected item properties. + Properties *UpdateReplicationProtectedItemInputProperties `json:"properties,omitempty"` +} + +// UpdateReplicationProtectedItemInputProperties update protected item input properties. +type UpdateReplicationProtectedItemInputProperties struct { + // RecoveryAzureVMName - Target Azure VM name given by the user. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureVMSize - Target Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // SelectedRecoveryAzureNetworkID - Target Azure Network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The Azure Network Id for test failover. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // VMNics - The list of VM nic details. + VMNics *[]VMNicInputDetails `json:"vmNics,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // RecoveryAvailabilitySetID - The target availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // ProviderSpecificDetails - The provider specific input to update replication protected item. + ProviderSpecificDetails BasicUpdateReplicationProtectedItemProviderInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateReplicationProtectedItemInputProperties struct. +func (urpiip *UpdateReplicationProtectedItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryAzureVMName": + if v != nil { + var recoveryAzureVMName string + err = json.Unmarshal(*v, &recoveryAzureVMName) + if err != nil { + return err + } + urpiip.RecoveryAzureVMName = &recoveryAzureVMName + } + case "recoveryAzureVMSize": + if v != nil { + var recoveryAzureVMSize string + err = json.Unmarshal(*v, &recoveryAzureVMSize) + if err != nil { + return err + } + urpiip.RecoveryAzureVMSize = &recoveryAzureVMSize + } + case "selectedRecoveryAzureNetworkId": + if v != nil { + var selectedRecoveryAzureNetworkID string + err = json.Unmarshal(*v, &selectedRecoveryAzureNetworkID) + if err != nil { + return err + } + urpiip.SelectedRecoveryAzureNetworkID = &selectedRecoveryAzureNetworkID + } + case "selectedTfoAzureNetworkId": + if v != nil { + var selectedTfoAzureNetworkID string + err = json.Unmarshal(*v, &selectedTfoAzureNetworkID) + if err != nil { + return err + } + urpiip.SelectedTfoAzureNetworkID = &selectedTfoAzureNetworkID + } + case "selectedSourceNicId": + if v != nil { + var selectedSourceNicID string + err = json.Unmarshal(*v, &selectedSourceNicID) + if err != nil { + return err + } + urpiip.SelectedSourceNicID = &selectedSourceNicID + } + case "enableRdpOnTargetOption": + if v != nil { + var enableRdpOnTargetOption string + err = json.Unmarshal(*v, &enableRdpOnTargetOption) + if err != nil { + return err + } + urpiip.EnableRdpOnTargetOption = &enableRdpOnTargetOption + } + case "vmNics": + if v != nil { + var VMNics []VMNicInputDetails + err = json.Unmarshal(*v, &VMNics) + if err != nil { + return err + } + urpiip.VMNics = &VMNics + } + case "licenseType": + if v != nil { + var licenseType LicenseType + err = json.Unmarshal(*v, &licenseType) + if err != nil { + return err + } + urpiip.LicenseType = licenseType + } + case "recoveryAvailabilitySetId": + if v != nil { + var recoveryAvailabilitySetID string + err = json.Unmarshal(*v, &recoveryAvailabilitySetID) + if err != nil { + return err + } + urpiip.RecoveryAvailabilitySetID = &recoveryAvailabilitySetID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateReplicationProtectedItemProviderInput(*v) + if err != nil { + return err + } + urpiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateReplicationProtectedItemProviderInput update replication protected item provider specific input. +type BasicUpdateReplicationProtectedItemProviderInput interface { + AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) + AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) + AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) + AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) + AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) +} + +// UpdateReplicationProtectedItemProviderInput update replication protected item provider specific input. +type UpdateReplicationProtectedItemProviderInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateReplicationProtectedItemProviderInput(body []byte) (BasicUpdateReplicationProtectedItemProviderInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A): + var aurpii A2AUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &aurpii) + return aurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure): + var hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &hvraurpii) + return hvraurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2): + var imavurpii InMageAzureV2UpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &imavurpii) + return imavurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm): + var imrurpii InMageRcmUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &imrurpii) + return imrurpii, err + default: + var urpipi UpdateReplicationProtectedItemProviderInput + err := json.Unmarshal(body, &urpipi) + return urpipi, err + } +} +func unmarshalBasicUpdateReplicationProtectedItemProviderInputArray(body []byte) ([]BasicUpdateReplicationProtectedItemProviderInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + urpipiArray := make([]BasicUpdateReplicationProtectedItemProviderInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + urpipi, err := unmarshalBasicUpdateReplicationProtectedItemProviderInput(*rawMessage) + if err != nil { + return nil, err + } + urpipiArray[index] = urpipi + } + return urpipiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) MarshalJSON() ([]byte, error) { + urpipi.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput + objectMap := make(map[string]interface{}) + if urpipi.InstanceType != "" { + objectMap["instanceType"] = urpipi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return &urpipi, true +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &urpipi, true +} + +// UpdateVCenterRequest input required to update vCenter. +type UpdateVCenterRequest struct { + // Properties - The update VCenter Request Properties. + Properties *UpdateVCenterRequestProperties `json:"properties,omitempty"` +} + +// UpdateVCenterRequestProperties the properties of an update vCenter request. +type UpdateVCenterRequestProperties struct { + // FriendlyName - The friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the vCenter to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // ProcessServerID - The process server Id from where the update can be orchestrated. + ProcessServerID *string `json:"processServerId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The CS account Id which has privileges to update the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// VaultHealthDetails vault health details definition. +type VaultHealthDetails struct { + autorest.Response `json:"-"` + // Properties - The vault health related data. + Properties *VaultHealthProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VaultHealthDetails. +func (vhd VaultHealthDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vhd.Properties != nil { + objectMap["properties"] = vhd.Properties + } + if vhd.Location != nil { + objectMap["location"] = vhd.Location + } + return json.Marshal(objectMap) +} + +// VaultHealthProperties class to define the health summary of the Vault. +type VaultHealthProperties struct { + // VaultErrors - The list of errors on the vault. + VaultErrors *[]HealthError `json:"vaultErrors,omitempty"` + // ProtectedItemsHealth - The list of the health detail of the protected items in the vault. + ProtectedItemsHealth *ResourceHealthSummary `json:"protectedItemsHealth,omitempty"` + // FabricsHealth - The list of the health detail of the fabrics in the vault. + FabricsHealth *ResourceHealthSummary `json:"fabricsHealth,omitempty"` + // ContainersHealth - The list of the health detail of the containers in the vault. + ContainersHealth *ResourceHealthSummary `json:"containersHealth,omitempty"` +} + +// VaultSetting vault setting. +type VaultSetting struct { + autorest.Response `json:"-"` + // Properties - The vault setting properties. + Properties *VaultSettingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VaultSetting. +func (vs VaultSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vs.Properties != nil { + objectMap["properties"] = vs.Properties + } + if vs.Location != nil { + objectMap["location"] = vs.Location + } + return json.Marshal(objectMap) +} + +// VaultSettingCollection vault setting collection. +type VaultSettingCollection struct { + autorest.Response `json:"-"` + // Value - The list of vault setting. + Value *[]VaultSetting `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// VaultSettingCollectionIterator provides access to a complete listing of VaultSetting values. +type VaultSettingCollectionIterator struct { + i int + page VaultSettingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VaultSettingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VaultSettingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VaultSettingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VaultSettingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VaultSettingCollectionIterator) Response() VaultSettingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VaultSettingCollectionIterator) Value() VaultSetting { + if !iter.page.NotDone() { + return VaultSetting{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VaultSettingCollectionIterator type. +func NewVaultSettingCollectionIterator(page VaultSettingCollectionPage) VaultSettingCollectionIterator { + return VaultSettingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vsc VaultSettingCollection) IsEmpty() bool { + return vsc.Value == nil || len(*vsc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vsc VaultSettingCollection) hasNextLink() bool { + return vsc.NextLink != nil && len(*vsc.NextLink) != 0 +} + +// vaultSettingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vsc VaultSettingCollection) vaultSettingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !vsc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vsc.NextLink))) +} + +// VaultSettingCollectionPage contains a page of VaultSetting values. +type VaultSettingCollectionPage struct { + fn func(context.Context, VaultSettingCollection) (VaultSettingCollection, error) + vsc VaultSettingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VaultSettingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VaultSettingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vsc) + if err != nil { + return err + } + page.vsc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VaultSettingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VaultSettingCollectionPage) NotDone() bool { + return !page.vsc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VaultSettingCollectionPage) Response() VaultSettingCollection { + return page.vsc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VaultSettingCollectionPage) Values() []VaultSetting { + if page.vsc.IsEmpty() { + return nil + } + return *page.vsc.Value +} + +// Creates a new instance of the VaultSettingCollectionPage type. +func NewVaultSettingCollectionPage(cur VaultSettingCollection, getNextPage func(context.Context, VaultSettingCollection) (VaultSettingCollection, error)) VaultSettingCollectionPage { + return VaultSettingCollectionPage{ + fn: getNextPage, + vsc: cur, + } +} + +// VaultSettingCreationInput input to create vault setting. +type VaultSettingCreationInput struct { + // Properties - Vault setting creation input properties. + Properties *VaultSettingCreationInputProperties `json:"properties,omitempty"` +} + +// VaultSettingCreationInputProperties input to create vault setting. +type VaultSettingCreationInputProperties struct { + // MigrationSolutionID - The migration solution Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // VmwareToAzureProviderType - VMware to Azure provider type. + VmwareToAzureProviderType *string `json:"vmwareToAzureProviderType,omitempty"` +} + +// VaultSettingProperties vault setting properties. +type VaultSettingProperties struct { + // MigrationSolutionID - The migration solution ARM Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // VmwareToAzureProviderType - VMware to Azure provider type. + VmwareToAzureProviderType *string `json:"vmwareToAzureProviderType,omitempty"` +} + +// VCenter vCenter definition. +type VCenter struct { + autorest.Response `json:"-"` + // Properties - VCenter related data. + Properties *VCenterProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VCenter. +func (vc VCenter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vc.Properties != nil { + objectMap["properties"] = vc.Properties + } + if vc.Location != nil { + objectMap["location"] = vc.Location + } + return json.Marshal(objectMap) +} + +// VCenterCollection collection of vCenter details. +type VCenterCollection struct { + autorest.Response `json:"-"` + // Value - The vCenter details. + Value *[]VCenter `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// VCenterCollectionIterator provides access to a complete listing of VCenter values. +type VCenterCollectionIterator struct { + i int + page VCenterCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VCenterCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VCenterCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VCenterCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VCenterCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VCenterCollectionIterator) Response() VCenterCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VCenterCollectionIterator) Value() VCenter { + if !iter.page.NotDone() { + return VCenter{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VCenterCollectionIterator type. +func NewVCenterCollectionIterator(page VCenterCollectionPage) VCenterCollectionIterator { + return VCenterCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vcc VCenterCollection) IsEmpty() bool { + return vcc.Value == nil || len(*vcc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vcc VCenterCollection) hasNextLink() bool { + return vcc.NextLink != nil && len(*vcc.NextLink) != 0 +} + +// vCenterCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vcc VCenterCollection) vCenterCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !vcc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vcc.NextLink))) +} + +// VCenterCollectionPage contains a page of VCenter values. +type VCenterCollectionPage struct { + fn func(context.Context, VCenterCollection) (VCenterCollection, error) + vcc VCenterCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VCenterCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VCenterCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vcc) + if err != nil { + return err + } + page.vcc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VCenterCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VCenterCollectionPage) NotDone() bool { + return !page.vcc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VCenterCollectionPage) Response() VCenterCollection { + return page.vcc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VCenterCollectionPage) Values() []VCenter { + if page.vcc.IsEmpty() { + return nil + } + return *page.vcc.Value +} + +// Creates a new instance of the VCenterCollectionPage type. +func NewVCenterCollectionPage(cur VCenterCollection, getNextPage func(context.Context, VCenterCollection) (VCenterCollection, error)) VCenterCollectionPage { + return VCenterCollectionPage{ + fn: getNextPage, + vcc: cur, + } +} + +// VCenterProperties vCenter properties. +type VCenterProperties struct { + // FriendlyName - Friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // InternalID - VCenter internal ID. + InternalID *string `json:"internalId,omitempty"` + // LastHeartbeat - The time when the last heartbeat was received by vCenter. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // DiscoveryStatus - The VCenter discovery status. + DiscoveryStatus *string `json:"discoveryStatus,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // IPAddress - The IP address of the vCenter. + IPAddress *string `json:"ipAddress,omitempty"` + // InfrastructureID - The infrastructure Id of vCenter. + InfrastructureID *string `json:"infrastructureId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The account Id which has privileges to discover the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // FabricArmResourceName - The ARM resource name of the fabric containing this VCenter. + FabricArmResourceName *string `json:"fabricArmResourceName,omitempty"` + // HealthErrors - The health errors for this VCenter. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// VersionDetails version related details. +type VersionDetails struct { + // Version - The agent version. + Version *string `json:"version,omitempty"` + // ExpiryDate - Version expiry date. + ExpiryDate *date.Time `json:"expiryDate,omitempty"` + // Status - A value indicating whether security update required. Possible values include: 'Supported', 'NotSupported', 'Deprecated', 'UpdateRequired', 'SecurityUpdateRequired' + Status AgentVersionStatus `json:"status,omitempty"` +} + +// VirtualMachineTaskDetails this class represents the virtual machine task details. +type VirtualMachineTaskDetails struct { + // SkippedReason - The skipped reason. + SkippedReason *string `json:"skippedReason,omitempty"` + // SkippedReasonString - The skipped reason string. + SkippedReasonString *string `json:"skippedReasonString,omitempty"` + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) MarshalJSON() ([]byte, error) { + vmtd.InstanceType = InstanceTypeVirtualMachineTaskDetails + objectMap := make(map[string]interface{}) + if vmtd.SkippedReason != nil { + objectMap["skippedReason"] = vmtd.SkippedReason + } + if vmtd.SkippedReasonString != nil { + objectMap["skippedReasonString"] = vmtd.SkippedReasonString + } + if vmtd.JobTask != nil { + objectMap["jobTask"] = vmtd.JobTask + } + if vmtd.InstanceType != "" { + objectMap["instanceType"] = vmtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &vmtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return &vmtd, true +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &vmtd, true +} + +// VmmDetails VMM fabric specific details. +type VmmDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmDetails. +func (vd VmmDetails) MarshalJSON() ([]byte, error) { + vd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM + objectMap := make(map[string]interface{}) + if vd.InstanceType != "" { + objectMap["instanceType"] = vd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVmmDetails() (*VmmDetails, bool) { + return &vd, true +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vd, true +} + +// VmmToAzureCreateNetworkMappingInput create network mappings input properties/behavior specific to Vmm to +// Azure Network mapping. +type VmmToAzureCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtacnmi.InstanceType = InstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtacnmi.InstanceType != "" { + objectMap["instanceType"] = vtacnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return &vtacnmi, true +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &vtacnmi, true +} + +// VmmToAzureNetworkMappingSettings e2A Network Mapping fabric specific settings. +type VmmToAzureNetworkMappingSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) MarshalJSON() ([]byte, error) { + vtanms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtanms.InstanceType != "" { + objectMap["instanceType"] = vtanms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return &vtanms, true +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &vtanms, true +} + +// VmmToAzureUpdateNetworkMappingInput update network mappings input properties/behavior specific to vmm to +// azure. +type VmmToAzureUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtaunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtaunmi.InstanceType != "" { + objectMap["instanceType"] = vtaunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return &vtaunmi, true +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &vtaunmi, true +} + +// VmmToVmmCreateNetworkMappingInput create network mappings input properties/behavior specific to vmm to +// vmm Network mapping. +type VmmToVmmCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtvcnmi.InstanceType = InstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvcnmi.InstanceType != "" { + objectMap["instanceType"] = vtvcnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return &vtvcnmi, true +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &vtvcnmi, true +} + +// VmmToVmmNetworkMappingSettings e2E Network Mapping fabric specific settings. +type VmmToVmmNetworkMappingSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) MarshalJSON() ([]byte, error) { + vtvnms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvnms.InstanceType != "" { + objectMap["instanceType"] = vtvnms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return &vtvnms, true +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &vtvnms, true +} + +// VmmToVmmUpdateNetworkMappingInput update network mappings input properties/behavior specific to vmm to +// vmm. +type VmmToVmmUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtvunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvunmi.InstanceType != "" { + objectMap["instanceType"] = vtvunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return &vtvunmi, true +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &vtvunmi, true +} + +// VmmVirtualMachineDetails VMM fabric provider specific VM settings. +type VmmVirtualMachineDetails struct { + // SourceItemID - The source id of the object. + SourceItemID *string `json:"sourceItemId,omitempty"` + // Generation - The id of the object in fabric. + Generation *string `json:"generation,omitempty"` + // OsDetails - The Last replication time. + OsDetails *OSDetails `json:"osDetails,omitempty"` + // DiskDetails - The Last successful failover time. + DiskDetails *[]DiskDetails `json:"diskDetails,omitempty"` + // HasPhysicalDisk - A value indicating whether the VM has a physical disk attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasPhysicalDisk PresenceStatus `json:"hasPhysicalDisk,omitempty"` + // HasFibreChannelAdapter - A value indicating whether the VM has a fibre channel adapter attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasFibreChannelAdapter PresenceStatus `json:"hasFibreChannelAdapter,omitempty"` + // HasSharedVhd - A value indicating whether the VM has a shared VHD attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasSharedVhd PresenceStatus `json:"hasSharedVhd,omitempty"` + // HyperVHostID - The Id of the hyper-v host in fabric. + HyperVHostID *string `json:"hyperVHostId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) MarshalJSON() ([]byte, error) { + vvmd.InstanceType = InstanceTypeVmmVirtualMachine + objectMap := make(map[string]interface{}) + if vvmd.SourceItemID != nil { + objectMap["sourceItemId"] = vvmd.SourceItemID + } + if vvmd.Generation != nil { + objectMap["generation"] = vvmd.Generation + } + if vvmd.OsDetails != nil { + objectMap["osDetails"] = vvmd.OsDetails + } + if vvmd.DiskDetails != nil { + objectMap["diskDetails"] = vvmd.DiskDetails + } + if vvmd.HasPhysicalDisk != "" { + objectMap["hasPhysicalDisk"] = vvmd.HasPhysicalDisk + } + if vvmd.HasFibreChannelAdapter != "" { + objectMap["hasFibreChannelAdapter"] = vvmd.HasFibreChannelAdapter + } + if vvmd.HasSharedVhd != "" { + objectMap["hasSharedVhd"] = vvmd.HasSharedVhd + } + if vvmd.HyperVHostID != nil { + objectMap["hyperVHostId"] = vvmd.HyperVHostID + } + if vvmd.InstanceType != "" { + objectMap["instanceType"] = vvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return &vvmd, true +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return &vvmd, true +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &vvmd, true +} + +// VMNicDetails hyper V VM network details. +type VMNicDetails struct { + // NicID - The nic Id. + NicID *string `json:"nicId,omitempty"` + // ReplicaNicID - The replica nic Id. + ReplicaNicID *string `json:"replicaNicId,omitempty"` + // SourceNicArmID - The source nic ARM Id. + SourceNicArmID *string `json:"sourceNicArmId,omitempty"` + // VMNetworkName - VM network name. + VMNetworkName *string `json:"vMNetworkName,omitempty"` + // RecoveryVMNetworkID - Recovery VM network Id. + RecoveryVMNetworkID *string `json:"recoveryVMNetworkId,omitempty"` + // IPConfigs - The IP configurations of the NIC. + IPConfigs *[]IPConfigDetails `json:"ipConfigs,omitempty"` + // SelectionType - Selection type for failover. + SelectionType *string `json:"selectionType,omitempty"` + // RecoveryNetworkSecurityGroupID - The id of the NSG associated with the NIC. + RecoveryNetworkSecurityGroupID *string `json:"recoveryNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnRecovery - A value indicating whether the NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnRecovery *bool `json:"enableAcceleratedNetworkingOnRecovery,omitempty"` + // TfoVMNetworkID - The network to be used by NIC during test failover. + TfoVMNetworkID *string `json:"tfoVMNetworkId,omitempty"` + // TfoNetworkSecurityGroupID - The NSG to be used by NIC during test failover. + TfoNetworkSecurityGroupID *string `json:"tfoNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnTfo - Whether the TFO NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnTfo *bool `json:"enableAcceleratedNetworkingOnTfo,omitempty"` + // RecoveryNicName - The name of the NIC to be used when creating target NICs. + RecoveryNicName *string `json:"recoveryNicName,omitempty"` + // RecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs. + RecoveryNicResourceGroupName *string `json:"recoveryNicResourceGroupName,omitempty"` + // ReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during failover subject to availability. + ReuseExistingNic *bool `json:"reuseExistingNic,omitempty"` + // TfoRecoveryNicName - The name of the NIC to be used when creating target NICs in TFO. + TfoRecoveryNicName *string `json:"tfoRecoveryNicName,omitempty"` + // TfoRecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs in TFO. + TfoRecoveryNicResourceGroupName *string `json:"tfoRecoveryNicResourceGroupName,omitempty"` + // TfoReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during test failover subject to availability. + TfoReuseExistingNic *bool `json:"tfoReuseExistingNic,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` +} + +// VMNicInputDetails hyper V VM network input details. +type VMNicInputDetails struct { + // NicID - The nic Id. + NicID *string `json:"nicId,omitempty"` + // IPConfigs - The IP configurations to be used by NIC during test failover and failover. + IPConfigs *[]IPConfigInputDetails `json:"ipConfigs,omitempty"` + // SelectionType - Selection type for failover. + SelectionType *string `json:"selectionType,omitempty"` + // RecoveryNetworkSecurityGroupID - The id of the NSG associated with the NIC. + RecoveryNetworkSecurityGroupID *string `json:"recoveryNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnRecovery - Whether the NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnRecovery *bool `json:"enableAcceleratedNetworkingOnRecovery,omitempty"` + // TfoNetworkSecurityGroupID - The NSG to be used by NIC during test failover. + TfoNetworkSecurityGroupID *string `json:"tfoNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnTfo - Whether the test NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnTfo *bool `json:"enableAcceleratedNetworkingOnTfo,omitempty"` + // RecoveryNicName - The name of the NIC to be used when creating target NICs. + RecoveryNicName *string `json:"recoveryNicName,omitempty"` + // RecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs. + RecoveryNicResourceGroupName *string `json:"recoveryNicResourceGroupName,omitempty"` + // ReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during failover subject to availability. + ReuseExistingNic *bool `json:"reuseExistingNic,omitempty"` + // TfoNicName - The name of the NIC to be used when creating target NICs in TFO. + TfoNicName *string `json:"tfoNicName,omitempty"` + // TfoNicResourceGroupName - The resource group of the NIC to be used when creating target NICs in TFO. + TfoNicResourceGroupName *string `json:"tfoNicResourceGroupName,omitempty"` + // TfoReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during test failover subject to availability. + TfoReuseExistingNic *bool `json:"tfoReuseExistingNic,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` +} + +// VMNicUpdatesTaskDetails this class represents the vm NicUpdates task details. +type VMNicUpdatesTaskDetails struct { + // VMID - Virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // NicID - Nic Id. + NicID *string `json:"nicId,omitempty"` + // Name - Name of the Nic. + Name *string `json:"name,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) MarshalJSON() ([]byte, error) { + vnutd.InstanceType = InstanceTypeVMNicUpdatesTaskDetails + objectMap := make(map[string]interface{}) + if vnutd.VMID != nil { + objectMap["vmId"] = vnutd.VMID + } + if vnutd.NicID != nil { + objectMap["nicId"] = vnutd.NicID + } + if vnutd.Name != nil { + objectMap["name"] = vnutd.Name + } + if vnutd.InstanceType != "" { + objectMap["instanceType"] = vnutd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return &vnutd, true +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &vnutd, true +} + +// VMwareCbtContainerCreationInput vMwareCbt container creation input. +type VMwareCbtContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) MarshalJSON() ([]byte, error) { + vmccci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmccci.InstanceType != "" { + objectMap["instanceType"] = vmccci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return &vmccci, true +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &vmccci, true +} + +// VMwareCbtContainerMappingInput vMwareCbt container mapping input. +type VMwareCbtContainerMappingInput struct { + // KeyVaultID - The target key vault ARM Id. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyVaultURI - The target key vault URL. + KeyVaultURI *string `json:"keyVaultUri,omitempty"` + // StorageAccountID - The storage account ARM Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // StorageAccountSasSecretName - The secret name of the storage account. + StorageAccountSasSecretName *string `json:"storageAccountSasSecretName,omitempty"` + // ServiceBusConnectionStringSecretName - The secret name of the service bus connection string. + ServiceBusConnectionStringSecretName *string `json:"serviceBusConnectionStringSecretName,omitempty"` + // TargetLocation - The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) MarshalJSON() ([]byte, error) { + vmccmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmccmi.KeyVaultID != nil { + objectMap["keyVaultId"] = vmccmi.KeyVaultID + } + if vmccmi.KeyVaultURI != nil { + objectMap["keyVaultUri"] = vmccmi.KeyVaultURI + } + if vmccmi.StorageAccountID != nil { + objectMap["storageAccountId"] = vmccmi.StorageAccountID + } + if vmccmi.StorageAccountSasSecretName != nil { + objectMap["storageAccountSasSecretName"] = vmccmi.StorageAccountSasSecretName + } + if vmccmi.ServiceBusConnectionStringSecretName != nil { + objectMap["serviceBusConnectionStringSecretName"] = vmccmi.ServiceBusConnectionStringSecretName + } + if vmccmi.TargetLocation != nil { + objectMap["targetLocation"] = vmccmi.TargetLocation + } + if vmccmi.InstanceType != "" { + objectMap["instanceType"] = vmccmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return &vmccmi, true +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &vmccmi, true +} + +// VMwareCbtDiskInput vMwareCbt disk input. +type VMwareCbtDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // IsOSDisk - A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // LogStorageAccountSasSecretName - The key vault secret name of the log storage account. + LogStorageAccountSasSecretName *string `json:"logStorageAccountSasSecretName,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// VMwareCbtEnableMigrationInput vMwareCbt specific enable migration input. +type VMwareCbtEnableMigrationInput struct { + // VmwareMachineID - The ARM Id of the VM discovered in VMware. + VmwareMachineID *string `json:"vmwareMachineId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]VMwareCbtDiskInput `json:"disksToInclude,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // DataMoverRunAsAccountID - The data mover run as account Id. + DataMoverRunAsAccountID *string `json:"dataMoverRunAsAccountId,omitempty"` + // SnapshotRunAsAccountID - The snapshot run as account Id. + SnapshotRunAsAccountID *string `json:"snapshotRunAsAccountId,omitempty"` + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TargetSubnetName - The target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedDiskTags - The tags for the seed disks. + SeedDiskTags map[string]*string `json:"seedDiskTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeEnableMigrationProviderSpecificInput', 'InstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEnableMigrationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) MarshalJSON() ([]byte, error) { + vmcemi.InstanceType = InstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcemi.VmwareMachineID != nil { + objectMap["vmwareMachineId"] = vmcemi.VmwareMachineID + } + if vmcemi.DisksToInclude != nil { + objectMap["disksToInclude"] = vmcemi.DisksToInclude + } + if vmcemi.LicenseType != "" { + objectMap["licenseType"] = vmcemi.LicenseType + } + if vmcemi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = vmcemi.SQLServerLicenseType + } + if vmcemi.DataMoverRunAsAccountID != nil { + objectMap["dataMoverRunAsAccountId"] = vmcemi.DataMoverRunAsAccountID + } + if vmcemi.SnapshotRunAsAccountID != nil { + objectMap["snapshotRunAsAccountId"] = vmcemi.SnapshotRunAsAccountID + } + if vmcemi.TargetVMName != nil { + objectMap["targetVmName"] = vmcemi.TargetVMName + } + if vmcemi.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcemi.TargetVMSize + } + if vmcemi.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcemi.TargetResourceGroupID + } + if vmcemi.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcemi.TargetNetworkID + } + if vmcemi.TargetSubnetName != nil { + objectMap["targetSubnetName"] = vmcemi.TargetSubnetName + } + if vmcemi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcemi.TargetAvailabilitySetID + } + if vmcemi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcemi.TargetAvailabilityZone + } + if vmcemi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcemi.TargetProximityPlacementGroupID + } + if vmcemi.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcemi.TargetBootDiagnosticsStorageAccountID + } + if vmcemi.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcemi.PerformAutoResync + } + if vmcemi.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcemi.TargetVMTags + } + if vmcemi.SeedDiskTags != nil { + objectMap["seedDiskTags"] = vmcemi.SeedDiskTags + } + if vmcemi.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcemi.TargetDiskTags + } + if vmcemi.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcemi.TargetNicTags + } + if vmcemi.InstanceType != "" { + objectMap["instanceType"] = vmcemi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtEnableMigrationInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) { + return &vmcemi, true +} + +// AsEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsBasicEnableMigrationProviderSpecificInput() (BasicEnableMigrationProviderSpecificInput, bool) { + return &vmcemi, true +} + +// VMwareCbtEventDetails event details for VMwareCbt provider. +type VMwareCbtEventDetails struct { + // MigrationItemName - READ-ONLY; The migration item name. + MigrationItemName *string `json:"migrationItemName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) MarshalJSON() ([]byte, error) { + vmced.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmced.InstanceType != "" { + objectMap["instanceType"] = vmced.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return &vmced, true +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &vmced, true +} + +// VMwareCbtMigrateInput vMwareCbt specific migrate input. +type VMwareCbtMigrateInput struct { + // PerformShutdown - A value indicating whether VM is to be shutdown. + PerformShutdown *string `json:"performShutdown,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput', 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) MarshalJSON() ([]byte, error) { + vmcmi.InstanceType = InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcmi.PerformShutdown != nil { + objectMap["performShutdown"] = vmcmi.PerformShutdown + } + if vmcmi.InstanceType != "" { + objectMap["instanceType"] = vmcmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrateInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) { + return &vmcmi, true +} + +// AsMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsBasicMigrateProviderSpecificInput() (BasicMigrateProviderSpecificInput, bool) { + return &vmcmi, true +} + +// VMwareCbtMigrationDetails vMwareCbt provider specific settings. +type VMwareCbtMigrationDetails struct { + // VmwareMachineID - READ-ONLY; The ARM Id of the VM discovered in VMware. + VmwareMachineID *string `json:"vmwareMachineId,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // FirmwareType - READ-ONLY; The firmware type. + FirmwareType *string `json:"firmwareType,omitempty"` + // TargetGeneration - READ-ONLY; The target generation. + TargetGeneration *string `json:"targetGeneration,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // DataMoverRunAsAccountID - READ-ONLY; The data mover run as account Id. + DataMoverRunAsAccountID *string `json:"dataMoverRunAsAccountId,omitempty"` + // SnapshotRunAsAccountID - READ-ONLY; The snapshot run as account Id. + SnapshotRunAsAccountID *string `json:"snapshotRunAsAccountId,omitempty"` + // TargetVMName - Target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetLocation - READ-ONLY; The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // TargetResourceGroupID - The target resource group Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]VMwareCbtProtectedDiskDetails `json:"protectedDisks,omitempty"` + // TargetNetworkID - The target network Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // VMNics - The network details. + VMNics *[]VMwareCbtNicDetails `json:"vmNics,omitempty"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // MigrationRecoveryPointID - READ-ONLY; The recovery point Id to which the VM was migrated. + MigrationRecoveryPointID *string `json:"migrationRecoveryPointId,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // LastRecoveryPointID - READ-ONLY; The last recovery point Id. + LastRecoveryPointID *string `json:"lastRecoveryPointId,omitempty"` + // InitialSeedingProgressPercentage - READ-ONLY; The initial seeding progress percentage. + InitialSeedingProgressPercentage *int32 `json:"initialSeedingProgressPercentage,omitempty"` + // MigrationProgressPercentage - READ-ONLY; The migration progress percentage. + MigrationProgressPercentage *int32 `json:"migrationProgressPercentage,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // InitialSeedingRetryCount - READ-ONLY; The initial seeding retry count. + InitialSeedingRetryCount *int64 `json:"initialSeedingRetryCount,omitempty"` + // ResyncRetryCount - READ-ONLY; The resync retry count. + ResyncRetryCount *int64 `json:"resyncRetryCount,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // SeedDiskTags - The tags for the seed disks. + SeedDiskTags map[string]*string `json:"seedDiskTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings', 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) MarshalJSON() ([]byte, error) { + vmcmd.InstanceType = InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcmd.LicenseType != nil { + objectMap["licenseType"] = vmcmd.LicenseType + } + if vmcmd.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = vmcmd.SQLServerLicenseType + } + if vmcmd.TargetVMName != nil { + objectMap["targetVmName"] = vmcmd.TargetVMName + } + if vmcmd.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcmd.TargetVMSize + } + if vmcmd.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcmd.TargetResourceGroupID + } + if vmcmd.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcmd.TargetAvailabilitySetID + } + if vmcmd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcmd.TargetAvailabilityZone + } + if vmcmd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcmd.TargetProximityPlacementGroupID + } + if vmcmd.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcmd.TargetBootDiagnosticsStorageAccountID + } + if vmcmd.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcmd.TargetVMTags + } + if vmcmd.ProtectedDisks != nil { + objectMap["protectedDisks"] = vmcmd.ProtectedDisks + } + if vmcmd.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcmd.TargetNetworkID + } + if vmcmd.VMNics != nil { + objectMap["vmNics"] = vmcmd.VMNics + } + if vmcmd.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcmd.TargetNicTags + } + if vmcmd.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcmd.PerformAutoResync + } + if vmcmd.SeedDiskTags != nil { + objectMap["seedDiskTags"] = vmcmd.SeedDiskTags + } + if vmcmd.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcmd.TargetDiskTags + } + if vmcmd.InstanceType != "" { + objectMap["instanceType"] = vmcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrationDetails is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) { + return &vmcmd, true +} + +// AsMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsBasicMigrationProviderSpecificSettings() (BasicMigrationProviderSpecificSettings, bool) { + return &vmcmd, true +} + +// VMwareCbtNicDetails vMwareCbt NIC details. +type VMwareCbtNicDetails struct { + // NicID - READ-ONLY; The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // SourceIPAddress - READ-ONLY; The source IP address. + SourceIPAddress *string `json:"sourceIPAddress,omitempty"` + // SourceIPAddressType - READ-ONLY; The source IP address type. Possible values include: 'Dynamic', 'Static' + SourceIPAddressType EthernetAddressType `json:"sourceIPAddressType,omitempty"` + // SourceNetworkID - READ-ONLY; Source network Id. + SourceNetworkID *string `json:"sourceNetworkId,omitempty"` + // TargetIPAddress - The target IP address. + TargetIPAddress *string `json:"targetIPAddress,omitempty"` + // TargetIPAddressType - The target IP address type. Possible values include: 'Dynamic', 'Static' + TargetIPAddressType EthernetAddressType `json:"targetIPAddressType,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` + // IsSelectedForMigration - A value indicating whether this NIC is selected for migration. + IsSelectedForMigration *string `json:"isSelectedForMigration,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtNicDetails. +func (vmcnd VMwareCbtNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmcnd.IsPrimaryNic != nil { + objectMap["isPrimaryNic"] = vmcnd.IsPrimaryNic + } + if vmcnd.TargetIPAddress != nil { + objectMap["targetIPAddress"] = vmcnd.TargetIPAddress + } + if vmcnd.TargetIPAddressType != "" { + objectMap["targetIPAddressType"] = vmcnd.TargetIPAddressType + } + if vmcnd.TargetSubnetName != nil { + objectMap["targetSubnetName"] = vmcnd.TargetSubnetName + } + if vmcnd.TargetNicName != nil { + objectMap["targetNicName"] = vmcnd.TargetNicName + } + if vmcnd.IsSelectedForMigration != nil { + objectMap["isSelectedForMigration"] = vmcnd.IsSelectedForMigration + } + return json.Marshal(objectMap) +} + +// VMwareCbtNicInput vMwareCbt NIC input. +type VMwareCbtNicInput struct { + // NicID - The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetStaticIPAddress - The static IP address. + TargetStaticIPAddress *string `json:"targetStaticIPAddress,omitempty"` + // IsSelectedForMigration - A value indicating whether this NIC is selected for migration. + IsSelectedForMigration *string `json:"isSelectedForMigration,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` +} + +// VMwareCbtPolicyCreationInput vMware Cbt policy creation input. +type VMwareCbtPolicyCreationInput struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) MarshalJSON() ([]byte, error) { + vmcpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcpci.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = vmcpci.RecoveryPointHistoryInMinutes + } + if vmcpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = vmcpci.CrashConsistentFrequencyInMinutes + } + if vmcpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = vmcpci.AppConsistentFrequencyInMinutes + } + if vmcpci.InstanceType != "" { + objectMap["instanceType"] = vmcpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return &vmcpci, true +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &vmcpci, true +} + +// VmwareCbtPolicyDetails vMware Cbt specific policy details. +type VmwareCbtPolicyDetails struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) MarshalJSON() ([]byte, error) { + vcpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vcpd.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = vcpd.RecoveryPointHistoryInMinutes + } + if vcpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = vcpd.AppConsistentFrequencyInMinutes + } + if vcpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = vcpd.CrashConsistentFrequencyInMinutes + } + if vcpd.InstanceType != "" { + objectMap["instanceType"] = vcpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return &vcpd, true +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &vcpd, true +} + +// VMwareCbtProtectedDiskDetails vMwareCbt protected disk details. +type VMwareCbtProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskPath - READ-ONLY; The disk path. + DiskPath *string `json:"diskPath,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // LogStorageAccountSasSecretName - READ-ONLY; The key vault secret name of the log storage account. + LogStorageAccountSasSecretName *string `json:"logStorageAccountSasSecretName,omitempty"` + // DiskEncryptionSetID - READ-ONLY; The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // SeedManagedDiskID - READ-ONLY; The ARM Id of the seed managed disk. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // TargetManagedDiskID - READ-ONLY; The ARM Id of the target managed disk. + TargetManagedDiskID *string `json:"targetManagedDiskId,omitempty"` + // TargetDiskName - The name for the target managed disk. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtProtectedDiskDetails. +func (vmcpdd VMwareCbtProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmcpdd.DiskType != "" { + objectMap["diskType"] = vmcpdd.DiskType + } + if vmcpdd.TargetDiskName != nil { + objectMap["targetDiskName"] = vmcpdd.TargetDiskName + } + return json.Marshal(objectMap) +} + +// VMwareCbtProtectionContainerMappingDetails vMwareCbt provider specific container mapping details. +type VMwareCbtProtectionContainerMappingDetails struct { + // KeyVaultID - READ-ONLY; The target key vault ARM Id. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyVaultURI - READ-ONLY; The target key vault URI. + KeyVaultURI *string `json:"keyVaultUri,omitempty"` + // StorageAccountID - READ-ONLY; The storage account ARM Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // StorageAccountSasSecretName - READ-ONLY; The secret name of the storage account. + StorageAccountSasSecretName *string `json:"storageAccountSasSecretName,omitempty"` + // ServiceBusConnectionStringSecretName - READ-ONLY; The secret name of the service bus connection string. + ServiceBusConnectionStringSecretName *string `json:"serviceBusConnectionStringSecretName,omitempty"` + // TargetLocation - READ-ONLY; The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + vmcpcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcpcmd.InstanceType != "" { + objectMap["instanceType"] = vmcpcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return &vmcpcmd, true +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &vmcpcmd, true +} + +// VMwareCbtResyncInput vMwareCbt specific resync input. +type VMwareCbtResyncInput struct { + // SkipCbtReset - A value indicating whether CBT is to be reset. + SkipCbtReset *string `json:"skipCbtReset,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput', 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicResyncProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) MarshalJSON() ([]byte, error) { + vmcri.InstanceType = InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcri.SkipCbtReset != nil { + objectMap["skipCbtReset"] = vmcri.SkipCbtReset + } + if vmcri.InstanceType != "" { + objectMap["instanceType"] = vmcri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtResyncInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) { + return &vmcri, true +} + +// AsResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsBasicResyncProviderSpecificInput() (BasicResyncProviderSpecificInput, bool) { + return &vmcri, true +} + +// VMwareCbtTestMigrateInput vMwareCbt specific test migrate input. +type VMwareCbtTestMigrateInput struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // NetworkID - The test network Id. + NetworkID *string `json:"networkId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput', 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicTestMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) MarshalJSON() ([]byte, error) { + vmctmi.InstanceType = InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmctmi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = vmctmi.RecoveryPointID + } + if vmctmi.NetworkID != nil { + objectMap["networkId"] = vmctmi.NetworkID + } + if vmctmi.InstanceType != "" { + objectMap["instanceType"] = vmctmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtTestMigrateInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) { + return &vmctmi, true +} + +// AsTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsBasicTestMigrateProviderSpecificInput() (BasicTestMigrateProviderSpecificInput, bool) { + return &vmctmi, true +} + +// VMwareCbtUpdateDiskInput vMwareCbt disk input for update. +type VMwareCbtUpdateDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // TargetDiskName - The target disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// VMwareCbtUpdateMigrationItemInput vMwareCbt specific update migration item input. +type VMwareCbtUpdateMigrationItemInput struct { + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // VMNics - The list of NIC details. + VMNics *[]VMwareCbtNicInput `json:"vmNics,omitempty"` + // VMDisks - The list of disk update properties. + VMDisks *[]VMwareCbtUpdateDiskInput `json:"vmDisks,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput', 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicUpdateMigrationItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) MarshalJSON() ([]byte, error) { + vmcumii.InstanceType = InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcumii.TargetVMName != nil { + objectMap["targetVmName"] = vmcumii.TargetVMName + } + if vmcumii.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcumii.TargetVMSize + } + if vmcumii.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcumii.TargetResourceGroupID + } + if vmcumii.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcumii.TargetAvailabilitySetID + } + if vmcumii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcumii.TargetAvailabilityZone + } + if vmcumii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcumii.TargetProximityPlacementGroupID + } + if vmcumii.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcumii.TargetBootDiagnosticsStorageAccountID + } + if vmcumii.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcumii.TargetNetworkID + } + if vmcumii.VMNics != nil { + objectMap["vmNics"] = vmcumii.VMNics + } + if vmcumii.VMDisks != nil { + objectMap["vmDisks"] = vmcumii.VMDisks + } + if vmcumii.LicenseType != "" { + objectMap["licenseType"] = vmcumii.LicenseType + } + if vmcumii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = vmcumii.SQLServerLicenseType + } + if vmcumii.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcumii.PerformAutoResync + } + if vmcumii.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcumii.TargetVMTags + } + if vmcumii.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcumii.TargetDiskTags + } + if vmcumii.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcumii.TargetNicTags + } + if vmcumii.InstanceType != "" { + objectMap["instanceType"] = vmcumii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtUpdateMigrationItemInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) { + return &vmcumii, true +} + +// AsUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsBasicUpdateMigrationItemProviderSpecificInput() (BasicUpdateMigrationItemProviderSpecificInput, bool) { + return &vmcumii, true +} + +// VMwareDetails store the fabric details specific to the VMware fabric. +type VMwareDetails struct { + // ProcessServers - The list of Process Servers associated with the fabric. + ProcessServers *[]ProcessServer `json:"processServers,omitempty"` + // MasterTargetServers - The list of Master Target servers associated with the fabric. + MasterTargetServers *[]MasterTargetServer `json:"masterTargetServers,omitempty"` + // RunAsAccounts - The list of run as accounts created on the server. + RunAsAccounts *[]RunAsAccount `json:"runAsAccounts,omitempty"` + // ReplicationPairCount - The number of replication pairs configured in this CS. + ReplicationPairCount *string `json:"replicationPairCount,omitempty"` + // ProcessServerCount - The number of process servers. + ProcessServerCount *string `json:"processServerCount,omitempty"` + // AgentCount - The number of source and target servers configured to talk to this CS. + AgentCount *string `json:"agentCount,omitempty"` + // ProtectedServers - The number of protected servers. + ProtectedServers *string `json:"protectedServers,omitempty"` + // SystemLoad - The percentage of the system load. + SystemLoad *string `json:"systemLoad,omitempty"` + // SystemLoadStatus - The system load status. + SystemLoadStatus *string `json:"systemLoadStatus,omitempty"` + // CPULoad - The percentage of the CPU load. + CPULoad *string `json:"cpuLoad,omitempty"` + // CPULoadStatus - The CPU load status. + CPULoadStatus *string `json:"cpuLoadStatus,omitempty"` + // TotalMemoryInBytes - The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // MemoryUsageStatus - The memory usage status. + MemoryUsageStatus *string `json:"memoryUsageStatus,omitempty"` + // TotalSpaceInBytes - The total space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - The available space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // SpaceUsageStatus - The space usage status. + SpaceUsageStatus *string `json:"spaceUsageStatus,omitempty"` + // WebLoad - The web load. + WebLoad *string `json:"webLoad,omitempty"` + // WebLoadStatus - The web load status. + WebLoadStatus *string `json:"webLoadStatus,omitempty"` + // DatabaseServerLoad - The database server load. + DatabaseServerLoad *string `json:"databaseServerLoad,omitempty"` + // DatabaseServerLoadStatus - The database server load status. + DatabaseServerLoadStatus *string `json:"databaseServerLoadStatus,omitempty"` + // CsServiceStatus - The CS service status. + CsServiceStatus *string `json:"csServiceStatus,omitempty"` + // IPAddress - The IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // AgentVersion - The agent Version. + AgentVersion *string `json:"agentVersion,omitempty"` + // HostName - The host name. + HostName *string `json:"hostName,omitempty"` + // LastHeartbeat - The last heartbeat received from CS server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // SslCertExpiryDate - CS SSL cert expiry date. + SslCertExpiryDate *date.Time `json:"sslCertExpiryDate,omitempty"` + // SslCertExpiryRemainingDays - CS SSL cert expiry date. + SslCertExpiryRemainingDays *int32 `json:"sslCertExpiryRemainingDays,omitempty"` + // PsTemplateVersion - PS template version. + PsTemplateVersion *string `json:"psTemplateVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // AgentVersionDetails - The agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // SwitchProviderBlockingErrorDetails - The switch provider blocking error information. + SwitchProviderBlockingErrorDetails *[]InMageFabricSwitchProviderBlockingErrorDetails `json:"switchProviderBlockingErrorDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareDetails. +func (vmd VMwareDetails) MarshalJSON() ([]byte, error) { + vmd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware + objectMap := make(map[string]interface{}) + if vmd.ProcessServers != nil { + objectMap["processServers"] = vmd.ProcessServers + } + if vmd.MasterTargetServers != nil { + objectMap["masterTargetServers"] = vmd.MasterTargetServers + } + if vmd.RunAsAccounts != nil { + objectMap["runAsAccounts"] = vmd.RunAsAccounts + } + if vmd.ReplicationPairCount != nil { + objectMap["replicationPairCount"] = vmd.ReplicationPairCount + } + if vmd.ProcessServerCount != nil { + objectMap["processServerCount"] = vmd.ProcessServerCount + } + if vmd.AgentCount != nil { + objectMap["agentCount"] = vmd.AgentCount + } + if vmd.ProtectedServers != nil { + objectMap["protectedServers"] = vmd.ProtectedServers + } + if vmd.SystemLoad != nil { + objectMap["systemLoad"] = vmd.SystemLoad + } + if vmd.SystemLoadStatus != nil { + objectMap["systemLoadStatus"] = vmd.SystemLoadStatus + } + if vmd.CPULoad != nil { + objectMap["cpuLoad"] = vmd.CPULoad + } + if vmd.CPULoadStatus != nil { + objectMap["cpuLoadStatus"] = vmd.CPULoadStatus + } + if vmd.TotalMemoryInBytes != nil { + objectMap["totalMemoryInBytes"] = vmd.TotalMemoryInBytes + } + if vmd.AvailableMemoryInBytes != nil { + objectMap["availableMemoryInBytes"] = vmd.AvailableMemoryInBytes + } + if vmd.MemoryUsageStatus != nil { + objectMap["memoryUsageStatus"] = vmd.MemoryUsageStatus + } + if vmd.TotalSpaceInBytes != nil { + objectMap["totalSpaceInBytes"] = vmd.TotalSpaceInBytes + } + if vmd.AvailableSpaceInBytes != nil { + objectMap["availableSpaceInBytes"] = vmd.AvailableSpaceInBytes + } + if vmd.SpaceUsageStatus != nil { + objectMap["spaceUsageStatus"] = vmd.SpaceUsageStatus + } + if vmd.WebLoad != nil { + objectMap["webLoad"] = vmd.WebLoad + } + if vmd.WebLoadStatus != nil { + objectMap["webLoadStatus"] = vmd.WebLoadStatus + } + if vmd.DatabaseServerLoad != nil { + objectMap["databaseServerLoad"] = vmd.DatabaseServerLoad + } + if vmd.DatabaseServerLoadStatus != nil { + objectMap["databaseServerLoadStatus"] = vmd.DatabaseServerLoadStatus + } + if vmd.CsServiceStatus != nil { + objectMap["csServiceStatus"] = vmd.CsServiceStatus + } + if vmd.IPAddress != nil { + objectMap["ipAddress"] = vmd.IPAddress + } + if vmd.AgentVersion != nil { + objectMap["agentVersion"] = vmd.AgentVersion + } + if vmd.HostName != nil { + objectMap["hostName"] = vmd.HostName + } + if vmd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = vmd.LastHeartbeat + } + if vmd.VersionStatus != nil { + objectMap["versionStatus"] = vmd.VersionStatus + } + if vmd.SslCertExpiryDate != nil { + objectMap["sslCertExpiryDate"] = vmd.SslCertExpiryDate + } + if vmd.SslCertExpiryRemainingDays != nil { + objectMap["sslCertExpiryRemainingDays"] = vmd.SslCertExpiryRemainingDays + } + if vmd.PsTemplateVersion != nil { + objectMap["psTemplateVersion"] = vmd.PsTemplateVersion + } + if vmd.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = vmd.AgentExpiryDate + } + if vmd.AgentVersionDetails != nil { + objectMap["agentVersionDetails"] = vmd.AgentVersionDetails + } + if vmd.SwitchProviderBlockingErrorDetails != nil { + objectMap["switchProviderBlockingErrorDetails"] = vmd.SwitchProviderBlockingErrorDetails + } + if vmd.InstanceType != "" { + objectMap["instanceType"] = vmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return &vmd, true +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vmd, true +} + +// VMwareV2FabricCreationInput vMwareV2 fabric provider specific settings. +type VMwareV2FabricCreationInput struct { + // VmwareSiteID - The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // MigrationSolutionID - The ARM Id of the migration solution. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) MarshalJSON() ([]byte, error) { + vmvfci.InstanceType = InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2 + objectMap := make(map[string]interface{}) + if vmvfci.VmwareSiteID != nil { + objectMap["vmwareSiteId"] = vmvfci.VmwareSiteID + } + if vmvfci.PhysicalSiteID != nil { + objectMap["physicalSiteId"] = vmvfci.PhysicalSiteID + } + if vmvfci.MigrationSolutionID != nil { + objectMap["migrationSolutionId"] = vmvfci.MigrationSolutionID + } + if vmvfci.InstanceType != "" { + objectMap["instanceType"] = vmvfci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return &vmvfci, true +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &vmvfci, true +} + +// VMwareV2FabricSpecificDetails vMwareV2 fabric specific details. +type VMwareV2FabricSpecificDetails struct { + // VmwareSiteID - READ-ONLY; The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - READ-ONLY; The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // MigrationSolutionID - READ-ONLY; The Migration solution ARM Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // ServiceEndpoint - READ-ONLY; The service endpoint. + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` + // ServiceResourceID - READ-ONLY; The service resource Id. + ServiceResourceID *string `json:"serviceResourceId,omitempty"` + // ServiceContainerID - READ-ONLY; The service container Id. + ServiceContainerID *string `json:"serviceContainerId,omitempty"` + // ProcessServers - READ-ONLY; The list of process servers. + ProcessServers *[]ProcessServerDetails `json:"processServers,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) MarshalJSON() ([]byte, error) { + vmvfsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 + objectMap := make(map[string]interface{}) + if vmvfsd.InstanceType != "" { + objectMap["instanceType"] = vmvfsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return &vmvfsd, true +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vmvfsd, true +} + +// VMwareVirtualMachineDetails vMware provider specific settings. +type VMwareVirtualMachineDetails struct { + // AgentGeneratedID - The ID generated by the InMage agent after it gets installed on guest. This is the ID to be used during InMage CreateProtection. + AgentGeneratedID *string `json:"agentGeneratedId,omitempty"` + // AgentInstalled - The value indicating if InMage scout agent is installed on guest. + AgentInstalled *string `json:"agentInstalled,omitempty"` + // OsType - The OsType installed on VM. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // IPAddress - The IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // PoweredOn - The value indicating whether VM is powered on. + PoweredOn *string `json:"poweredOn,omitempty"` + // VCenterInfrastructureID - The VCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. Value can be vCenter or physical. + DiscoveryType *string `json:"discoveryType,omitempty"` + // DiskDetails - The disk details. + DiskDetails *[]InMageDiskDetails `json:"diskDetails,omitempty"` + // ValidationErrors - The validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) MarshalJSON() ([]byte, error) { + vmvmd.InstanceType = InstanceTypeVMwareVirtualMachine + objectMap := make(map[string]interface{}) + if vmvmd.AgentGeneratedID != nil { + objectMap["agentGeneratedId"] = vmvmd.AgentGeneratedID + } + if vmvmd.AgentInstalled != nil { + objectMap["agentInstalled"] = vmvmd.AgentInstalled + } + if vmvmd.OsType != nil { + objectMap["osType"] = vmvmd.OsType + } + if vmvmd.AgentVersion != nil { + objectMap["agentVersion"] = vmvmd.AgentVersion + } + if vmvmd.IPAddress != nil { + objectMap["ipAddress"] = vmvmd.IPAddress + } + if vmvmd.PoweredOn != nil { + objectMap["poweredOn"] = vmvmd.PoweredOn + } + if vmvmd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = vmvmd.VCenterInfrastructureID + } + if vmvmd.DiscoveryType != nil { + objectMap["discoveryType"] = vmvmd.DiscoveryType + } + if vmvmd.DiskDetails != nil { + objectMap["diskDetails"] = vmvmd.DiskDetails + } + if vmvmd.ValidationErrors != nil { + objectMap["validationErrors"] = vmvmd.ValidationErrors + } + if vmvmd.InstanceType != "" { + objectMap["instanceType"] = vmvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return &vmvmd, true +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &vmvmd, true +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/operations.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/operations.go new file mode 100644 index 000000000000..810d55e5c067 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/operations.go @@ -0,0 +1,145 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the client for the Operations methods of the Siterecovery service. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string, resourceGroupName string, resourceName string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// List operation to return the list of available operations. +func (client OperationsClient) List(ctx context.Context) (result OperationsDiscoveryCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.odc.Response.Response != nil { + sc = result.odc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.odc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.odc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", resp, "Failure responding to request") + return + } + if result.odc.hasNextLink() && result.odc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/operations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationsDiscoveryCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationsDiscoveryCollection) (result OperationsDiscoveryCollection, err error) { + req, err := lastResults.operationsDiscoveryCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationsDiscoveryCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/recoverypoints.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/recoverypoints.go new file mode 100644 index 000000000000..ef0d0921b775 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/recoverypoints.go @@ -0,0 +1,235 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RecoveryPointsClient is the client for the RecoveryPoints methods of the Siterecovery service. +type RecoveryPointsClient struct { + BaseClient +} + +// NewRecoveryPointsClient creates an instance of the RecoveryPointsClient client. +func NewRecoveryPointsClient(subscriptionID string, resourceGroupName string, resourceName string) RecoveryPointsClient { + return NewRecoveryPointsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewRecoveryPointsClientWithBaseURI creates an instance of the RecoveryPointsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewRecoveryPointsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) RecoveryPointsClient { + return RecoveryPointsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get get the details of specified recovery point. +// Parameters: +// fabricName - the fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replication protected item name. +// recoveryPointName - the recovery point name. +func (client RecoveryPointsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (result RecoveryPoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, recoveryPointName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client RecoveryPointsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "recoveryPointName": autorest.Encode("path", recoveryPointName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints/{recoveryPointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RecoveryPointsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RecoveryPointsClient) GetResponder(resp *http.Response) (result RecoveryPoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationProtectedItems lists the available recovery points for a replication protected item. +// Parameters: +// fabricName - the fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replication protected item name. +func (client RecoveryPointsClient) ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result RecoveryPointCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.RPCVar.Response.Response != nil { + sc = result.RPCVar.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectedItemsNextResults + req, err := client.ListByReplicationProtectedItemsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.RPCVar.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", resp, "Failure sending request") + return + } + + result.RPCVar, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", resp, "Failure responding to request") + return + } + if result.RPCVar.hasNextLink() && result.RPCVar.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectedItemsPreparer prepares the ListByReplicationProtectedItems request. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectedItemsSender sends the ListByReplicationProtectedItems request. The method will close the +// http.Response Body if it receives an error. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectedItemsResponder handles the response to the ListByReplicationProtectedItems request. The method always +// closes the http.Response Body. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsResponder(resp *http.Response) (result RecoveryPointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectedItemsNextResults retrieves the next set of results, if any. +func (client RecoveryPointsClient) listByReplicationProtectedItemsNextResults(ctx context.Context, lastResults RecoveryPointCollection) (result RecoveryPointCollection, err error) { + req, err := lastResults.recoveryPointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectedItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result RecoveryPointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectedItems(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationalertsettings.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationalertsettings.go new file mode 100644 index 000000000000..f78278c19e7e --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationalertsettings.go @@ -0,0 +1,302 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationAlertSettingsClient is the client for the ReplicationAlertSettings methods of the Siterecovery service. +type ReplicationAlertSettingsClient struct { + BaseClient +} + +// NewReplicationAlertSettingsClient creates an instance of the ReplicationAlertSettingsClient client. +func NewReplicationAlertSettingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationAlertSettingsClient { + return NewReplicationAlertSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationAlertSettingsClientWithBaseURI creates an instance of the ReplicationAlertSettingsClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationAlertSettingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationAlertSettingsClient { + return ReplicationAlertSettingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create create or update an email notification(alert) configuration. +// Parameters: +// alertSettingName - the name of the email notification(alert) configuration. +// request - the input to configure the email notification(alert). +func (client ReplicationAlertSettingsClient) Create(ctx context.Context, alertSettingName string, request ConfigureAlertRequest) (result Alert, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, alertSettingName, request) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationAlertSettingsClient) CreatePreparer(ctx context.Context, alertSettingName string, request ConfigureAlertRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertSettingName": autorest.Encode("path", alertSettingName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) CreateResponder(resp *http.Response) (result Alert, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of the specified email notification(alert) configuration. +// Parameters: +// alertSettingName - the name of the email notification configuration. +func (client ReplicationAlertSettingsClient) Get(ctx context.Context, alertSettingName string) (result Alert, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, alertSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationAlertSettingsClient) GetPreparer(ctx context.Context, alertSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertSettingName": autorest.Encode("path", alertSettingName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) GetResponder(resp *http.Response) (result Alert, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of email notification(alert) configurations for the vault. +func (client ReplicationAlertSettingsClient) List(ctx context.Context) (result AlertCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.List") + defer func() { + sc := -1 + if result.ac.Response.Response != nil { + sc = result.ac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", resp, "Failure sending request") + return + } + + result.ac, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", resp, "Failure responding to request") + return + } + if result.ac.hasNextLink() && result.ac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationAlertSettingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) ListResponder(resp *http.Response) (result AlertCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationAlertSettingsClient) listNextResults(ctx context.Context, lastResults AlertCollection) (result AlertCollection, err error) { + req, err := lastResults.alertCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationAlertSettingsClient) ListComplete(ctx context.Context) (result AlertCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationappliances.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationappliances.go new file mode 100644 index 000000000000..c10f7885fe31 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationappliances.go @@ -0,0 +1,152 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationAppliancesClient is the client for the ReplicationAppliances methods of the Siterecovery service. +type ReplicationAppliancesClient struct { + BaseClient +} + +// NewReplicationAppliancesClient creates an instance of the ReplicationAppliancesClient client. +func NewReplicationAppliancesClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationAppliancesClient { + return NewReplicationAppliancesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationAppliancesClientWithBaseURI creates an instance of the ReplicationAppliancesClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewReplicationAppliancesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationAppliancesClient { + return ReplicationAppliancesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// List gets the list of Azure Site Recovery appliances for the vault. +// Parameters: +// filter - oData filter options. +func (client ReplicationAppliancesClient) List(ctx context.Context, filter string) (result ApplianceCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAppliancesClient.List") + defer func() { + sc := -1 + if result.ac.Response.Response != nil { + sc = result.ac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "List", resp, "Failure sending request") + return + } + + result.ac, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "List", resp, "Failure responding to request") + return + } + if result.ac.hasNextLink() && result.ac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationAppliancesClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAppliances", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAppliancesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationAppliancesClient) ListResponder(resp *http.Response) (result ApplianceCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationAppliancesClient) listNextResults(ctx context.Context, lastResults ApplianceCollection) (result ApplianceCollection, err error) { + req, err := lastResults.applianceCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationAppliancesClient) ListComplete(ctx context.Context, filter string) (result ApplianceCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAppliancesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationeligibilityresults.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationeligibilityresults.go new file mode 100644 index 000000000000..2e4207accde3 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationeligibilityresults.go @@ -0,0 +1,183 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationEligibilityResultsClient is the client for the ReplicationEligibilityResults methods of the Siterecovery +// service. +type ReplicationEligibilityResultsClient struct { + BaseClient +} + +// NewReplicationEligibilityResultsClient creates an instance of the ReplicationEligibilityResultsClient client. +func NewReplicationEligibilityResultsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationEligibilityResultsClient { + return NewReplicationEligibilityResultsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationEligibilityResultsClientWithBaseURI creates an instance of the ReplicationEligibilityResultsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationEligibilityResultsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationEligibilityResultsClient { + return ReplicationEligibilityResultsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get validates whether a given VM can be protected or not in which case returns list of errors. +// Parameters: +// virtualMachineName - virtual Machine name. +func (client ReplicationEligibilityResultsClient) Get(ctx context.Context, virtualMachineName string) (result ReplicationEligibilityResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEligibilityResultsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, virtualMachineName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationEligibilityResultsClient) GetPreparer(ctx context.Context, virtualMachineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineName": autorest.Encode("path", virtualMachineName), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEligibilityResultsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationEligibilityResultsClient) GetResponder(resp *http.Response) (result ReplicationEligibilityResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List validates whether a given VM can be protected or not in which case returns list of errors. +// Parameters: +// virtualMachineName - virtual Machine name. +func (client ReplicationEligibilityResultsClient) List(ctx context.Context, virtualMachineName string) (result ReplicationEligibilityResultsCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEligibilityResultsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, virtualMachineName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationEligibilityResultsClient) ListPreparer(ctx context.Context, virtualMachineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineName": autorest.Encode("path", virtualMachineName), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEligibilityResultsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationEligibilityResultsClient) ListResponder(resp *http.Response) (result ReplicationEligibilityResultsCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationevents.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationevents.go new file mode 100644 index 000000000000..d28288faf760 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationevents.go @@ -0,0 +1,228 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationEventsClient is the client for the ReplicationEvents methods of the Siterecovery service. +type ReplicationEventsClient struct { + BaseClient +} + +// NewReplicationEventsClient creates an instance of the ReplicationEventsClient client. +func NewReplicationEventsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationEventsClient { + return NewReplicationEventsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationEventsClientWithBaseURI creates an instance of the ReplicationEventsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationEventsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationEventsClient { + return ReplicationEventsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get the operation to get the details of an Azure Site recovery event. +// Parameters: +// eventName - the name of the Azure Site Recovery event. +func (client ReplicationEventsClient) Get(ctx context.Context, eventName string) (result Event, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, eventName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationEventsClient) GetPreparer(ctx context.Context, eventName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "eventName": autorest.Encode("path", eventName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents/{eventName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEventsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationEventsClient) GetResponder(resp *http.Response) (result Event, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of Azure Site Recovery events for the vault. +// Parameters: +// filter - oData filter options. +func (client ReplicationEventsClient) List(ctx context.Context, filter string) (result EventCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.List") + defer func() { + sc := -1 + if result.ec.Response.Response != nil { + sc = result.ec.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ec.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", resp, "Failure sending request") + return + } + + result.ec, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", resp, "Failure responding to request") + return + } + if result.ec.hasNextLink() && result.ec.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationEventsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEventsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationEventsClient) ListResponder(resp *http.Response) (result EventCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationEventsClient) listNextResults(ctx context.Context, lastResults EventCollection) (result EventCollection, err error) { + req, err := lastResults.eventCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationEventsClient) ListComplete(ctx context.Context, filter string) (result EventCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationfabrics.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationfabrics.go new file mode 100644 index 000000000000..e2f4f4e6503b --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationfabrics.go @@ -0,0 +1,786 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationFabricsClient is the client for the ReplicationFabrics methods of the Siterecovery service. +type ReplicationFabricsClient struct { + BaseClient +} + +// NewReplicationFabricsClient creates an instance of the ReplicationFabricsClient client. +func NewReplicationFabricsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationFabricsClient { + return NewReplicationFabricsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationFabricsClientWithBaseURI creates an instance of the ReplicationFabricsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationFabricsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationFabricsClient { + return ReplicationFabricsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// CheckConsistency the operation to perform a consistency check on the fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationFabricsClient) CheckConsistency(ctx context.Context, fabricName string) (result ReplicationFabricsCheckConsistencyFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.CheckConsistency") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CheckConsistencyPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "CheckConsistency", nil, "Failure preparing request") + return + } + + result, err = client.CheckConsistencySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "CheckConsistency", result.Response(), "Failure sending request") + return + } + + return +} + +// CheckConsistencyPreparer prepares the CheckConsistency request. +func (client ReplicationFabricsClient) CheckConsistencyPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/checkConsistency", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckConsistencySender sends the CheckConsistency request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) CheckConsistencySender(req *http.Request) (future ReplicationFabricsCheckConsistencyFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CheckConsistencyResponder handles the response to the CheckConsistency request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) CheckConsistencyResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Create the operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). +// Parameters: +// fabricName - name of the ASR fabric. +// input - fabric creation input. +func (client ReplicationFabricsClient) Create(ctx context.Context, fabricName string, input FabricCreationInput) (result ReplicationFabricsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationFabricsClient) CreatePreparer(ctx context.Context, fabricName string, input FabricCreationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) CreateSender(req *http.Request) (future ReplicationFabricsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) CreateResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete or remove an Azure Site Recovery fabric. +// Parameters: +// fabricName - ASR fabric to delete. +func (client ReplicationFabricsClient) Delete(ctx context.Context, fabricName string) (result ReplicationFabricsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationFabricsClient) DeletePreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) DeleteSender(req *http.Request) (future ReplicationFabricsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of an Azure Site Recovery fabric. +// Parameters: +// fabricName - fabric name. +// filter - oData filter options. +func (client ReplicationFabricsClient) Get(ctx context.Context, fabricName string, filter string) (result Fabric, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationFabricsClient) GetPreparer(ctx context.Context, fabricName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) GetResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of the Azure Site Recovery fabrics in the vault. +func (client ReplicationFabricsClient) List(ctx context.Context) (result FabricCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.List") + defer func() { + sc := -1 + if result.fc.Response.Response != nil { + sc = result.fc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.fc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", resp, "Failure sending request") + return + } + + result.fc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", resp, "Failure responding to request") + return + } + if result.fc.hasNextLink() && result.fc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationFabricsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) ListResponder(resp *http.Response) (result FabricCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationFabricsClient) listNextResults(ctx context.Context, lastResults FabricCollection) (result FabricCollection, err error) { + req, err := lastResults.fabricCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationFabricsClient) ListComplete(ctx context.Context) (result FabricCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// MigrateToAad the operation to migrate an Azure Site Recovery fabric to AAD. +// Parameters: +// fabricName - ASR fabric to migrate. +func (client ReplicationFabricsClient) MigrateToAad(ctx context.Context, fabricName string) (result ReplicationFabricsMigrateToAadFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.MigrateToAad") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.MigrateToAadPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "MigrateToAad", nil, "Failure preparing request") + return + } + + result, err = client.MigrateToAadSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "MigrateToAad", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateToAadPreparer prepares the MigrateToAad request. +func (client ReplicationFabricsClient) MigrateToAadPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/migratetoaad", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateToAadSender sends the MigrateToAad request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) MigrateToAadSender(req *http.Request) (future ReplicationFabricsMigrateToAadFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateToAadResponder handles the response to the MigrateToAad request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) MigrateToAadResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Purge the operation to purge(force delete) an Azure Site Recovery fabric. +// Parameters: +// fabricName - ASR fabric to purge. +func (client ReplicationFabricsClient) Purge(ctx context.Context, fabricName string) (result ReplicationFabricsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationFabricsClient) PurgePreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) PurgeSender(req *http.Request) (future ReplicationFabricsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// ReassociateGateway the operation to move replications from a process server to another process server. +// Parameters: +// fabricName - the name of the fabric containing the process server. +// failoverProcessServerRequest - the input to the failover process server operation. +func (client ReplicationFabricsClient) ReassociateGateway(ctx context.Context, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest) (result ReplicationFabricsReassociateGatewayFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.ReassociateGateway") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReassociateGatewayPreparer(ctx, fabricName, failoverProcessServerRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "ReassociateGateway", nil, "Failure preparing request") + return + } + + result, err = client.ReassociateGatewaySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "ReassociateGateway", result.Response(), "Failure sending request") + return + } + + return +} + +// ReassociateGatewayPreparer prepares the ReassociateGateway request. +func (client ReplicationFabricsClient) ReassociateGatewayPreparer(ctx context.Context, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/reassociateGateway", pathParameters), + autorest.WithJSON(failoverProcessServerRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReassociateGatewaySender sends the ReassociateGateway request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) ReassociateGatewaySender(req *http.Request) (future ReplicationFabricsReassociateGatewayFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReassociateGatewayResponder handles the response to the ReassociateGateway request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) ReassociateGatewayResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RenewCertificate renews the connection certificate for the ASR replication fabric. +// Parameters: +// fabricName - fabric name to renew certs for. +// renewCertificate - renew certificate input. +func (client ReplicationFabricsClient) RenewCertificate(ctx context.Context, fabricName string, renewCertificate RenewCertificateInput) (result ReplicationFabricsRenewCertificateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.RenewCertificate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RenewCertificatePreparer(ctx, fabricName, renewCertificate) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "RenewCertificate", nil, "Failure preparing request") + return + } + + result, err = client.RenewCertificateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "RenewCertificate", result.Response(), "Failure sending request") + return + } + + return +} + +// RenewCertificatePreparer prepares the RenewCertificate request. +func (client ReplicationFabricsClient) RenewCertificatePreparer(ctx context.Context, fabricName string, renewCertificate RenewCertificateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/renewCertificate", pathParameters), + autorest.WithJSON(renewCertificate), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RenewCertificateSender sends the RenewCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) RenewCertificateSender(req *http.Request) (future ReplicationFabricsRenewCertificateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RenewCertificateResponder handles the response to the RenewCertificate request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) RenewCertificateResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationjobs.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationjobs.go new file mode 100644 index 000000000000..e0a1659a2269 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationjobs.go @@ -0,0 +1,547 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationJobsClient is the client for the ReplicationJobs methods of the Siterecovery service. +type ReplicationJobsClient struct { + BaseClient +} + +// NewReplicationJobsClient creates an instance of the ReplicationJobsClient client. +func NewReplicationJobsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationJobsClient { + return NewReplicationJobsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationJobsClientWithBaseURI creates an instance of the ReplicationJobsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationJobsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationJobsClient { + return ReplicationJobsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Cancel the operation to cancel an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Cancel(ctx context.Context, jobName string) (result ReplicationJobsCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Cancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CancelPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Cancel", nil, "Failure preparing request") + return + } + + result, err = client.CancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Cancel", result.Response(), "Failure sending request") + return + } + + return +} + +// CancelPreparer prepares the Cancel request. +func (client ReplicationJobsClient) CancelPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/cancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CancelSender sends the Cancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) CancelSender(req *http.Request) (future ReplicationJobsCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CancelResponder handles the response to the Cancel request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) CancelResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Export the operation to export the details of the Azure Site Recovery jobs of the vault. +// Parameters: +// jobQueryParameter - job query filter. +func (client ReplicationJobsClient) Export(ctx context.Context, jobQueryParameter JobQueryParameter) (result ReplicationJobsExportFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Export") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ExportPreparer(ctx, jobQueryParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Export", nil, "Failure preparing request") + return + } + + result, err = client.ExportSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Export", result.Response(), "Failure sending request") + return + } + + return +} + +// ExportPreparer prepares the Export request. +func (client ReplicationJobsClient) ExportPreparer(ctx context.Context, jobQueryParameter JobQueryParameter) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/export", pathParameters), + autorest.WithJSON(jobQueryParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExportSender sends the Export request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ExportSender(req *http.Request) (future ReplicationJobsExportFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ExportResponder handles the response to the Export request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ExportResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get the details of an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Get(ctx context.Context, jobName string) (result Job, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationJobsClient) GetPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) GetResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of Azure Site Recovery Jobs for the vault. +// Parameters: +// filter - oData filter options. +func (client ReplicationJobsClient) List(ctx context.Context, filter string) (result JobCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.List") + defer func() { + sc := -1 + if result.jc.Response.Response != nil { + sc = result.jc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.jc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", resp, "Failure sending request") + return + } + + result.jc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", resp, "Failure responding to request") + return + } + if result.jc.hasNextLink() && result.jc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationJobsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ListResponder(resp *http.Response) (result JobCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationJobsClient) listNextResults(ctx context.Context, lastResults JobCollection) (result JobCollection, err error) { + req, err := lastResults.jobCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationJobsClient) ListComplete(ctx context.Context, filter string) (result JobCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} + +// Restart the operation to restart an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Restart(ctx context.Context, jobName string) (result ReplicationJobsRestartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Restart") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RestartPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Restart", nil, "Failure preparing request") + return + } + + result, err = client.RestartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Restart", result.Response(), "Failure sending request") + return + } + + return +} + +// RestartPreparer prepares the Restart request. +func (client ReplicationJobsClient) RestartPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartSender sends the Restart request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) RestartSender(req *http.Request) (future ReplicationJobsRestartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestartResponder handles the response to the Restart request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) RestartResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Resume the operation to resume an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +// resumeJobParams - resume rob comments. +func (client ReplicationJobsClient) Resume(ctx context.Context, jobName string, resumeJobParams ResumeJobParams) (result ReplicationJobsResumeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Resume") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResumePreparer(ctx, jobName, resumeJobParams) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Resume", nil, "Failure preparing request") + return + } + + result, err = client.ResumeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Resume", result.Response(), "Failure sending request") + return + } + + return +} + +// ResumePreparer prepares the Resume request. +func (client ReplicationJobsClient) ResumePreparer(ctx context.Context, jobName string, resumeJobParams ResumeJobParams) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/resume", pathParameters), + autorest.WithJSON(resumeJobParams), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResumeSender sends the Resume request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ResumeSender(req *http.Request) (future ReplicationJobsResumeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResumeResponder handles the response to the Resume request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ResumeResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationlogicalnetworks.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationlogicalnetworks.go new file mode 100644 index 000000000000..0d3bbcdeb986 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationlogicalnetworks.go @@ -0,0 +1,229 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationLogicalNetworksClient is the client for the ReplicationLogicalNetworks methods of the Siterecovery +// service. +type ReplicationLogicalNetworksClient struct { + BaseClient +} + +// NewReplicationLogicalNetworksClient creates an instance of the ReplicationLogicalNetworksClient client. +func NewReplicationLogicalNetworksClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationLogicalNetworksClient { + return NewReplicationLogicalNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationLogicalNetworksClientWithBaseURI creates an instance of the ReplicationLogicalNetworksClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationLogicalNetworksClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationLogicalNetworksClient { + return ReplicationLogicalNetworksClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of a logical network. +// Parameters: +// fabricName - server Id. +// logicalNetworkName - logical network name. +func (client ReplicationLogicalNetworksClient) Get(ctx context.Context, fabricName string, logicalNetworkName string) (result LogicalNetwork, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, logicalNetworkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationLogicalNetworksClient) GetPreparer(ctx context.Context, fabricName string, logicalNetworkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "logicalNetworkName": autorest.Encode("path", logicalNetworkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks/{logicalNetworkName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationLogicalNetworksClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationLogicalNetworksClient) GetResponder(resp *http.Response) (result LogicalNetwork, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationFabrics lists all the logical networks of the Azure Site Recovery fabric. +// Parameters: +// fabricName - server Id. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result LogicalNetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.lnc.Response.Response != nil { + sc = result.lnc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.lnc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.lnc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.lnc.hasNextLink() && result.lnc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsResponder(resp *http.Response) (result LogicalNetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationLogicalNetworksClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults LogicalNetworkCollection) (result LogicalNetworkCollection, err error) { + req, err := lastResults.logicalNetworkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result LogicalNetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationmigrationitems.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationmigrationitems.go new file mode 100644 index 000000000000..0f4beb0267e8 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationmigrationitems.go @@ -0,0 +1,1009 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationMigrationItemsClient is the client for the ReplicationMigrationItems methods of the Siterecovery service. +type ReplicationMigrationItemsClient struct { + BaseClient +} + +// NewReplicationMigrationItemsClient creates an instance of the ReplicationMigrationItemsClient client. +func NewReplicationMigrationItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationMigrationItemsClient { + return NewReplicationMigrationItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationMigrationItemsClientWithBaseURI creates an instance of the ReplicationMigrationItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationMigrationItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationMigrationItemsClient { + return ReplicationMigrationItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR migration item (enable migration). +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - enable migration input. +func (client ReplicationMigrationItemsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input EnableMigrationInput) (result ReplicationMigrationItemsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.PolicyID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationMigrationItemsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input EnableMigrationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) CreateSender(req *http.Request) (future ReplicationMigrationItemsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) CreateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// deleteOption - the delete option. +func (client ReplicationMigrationItemsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (result ReplicationMigrationItemsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, migrationItemName, deleteOption) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationMigrationItemsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(deleteOption) > 0 { + queryParameters["deleteOption"] = autorest.Encode("query", deleteOption) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) DeleteSender(req *http.Request) (future ReplicationMigrationItemsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get sends the get request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +func (client ReplicationMigrationItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, migrationItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationMigrationItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) GetResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List sends the list request. +// Parameters: +// skipToken - the pagination token. +// takeToken - the page size. +// filter - oData filter options. +func (client ReplicationMigrationItemsClient) List(ctx context.Context, skipToken string, takeToken string, filter string) (result MigrationItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.List") + defer func() { + sc := -1 + if result.mic.Response.Response != nil { + sc = result.mic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, takeToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.mic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", resp, "Failure sending request") + return + } + + result.mic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", resp, "Failure responding to request") + return + } + if result.mic.hasNextLink() && result.mic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationMigrationItemsClient) ListPreparer(ctx context.Context, skipToken string, takeToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationMigrationItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ListResponder(resp *http.Response) (result MigrationItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationMigrationItemsClient) listNextResults(ctx context.Context, lastResults MigrationItemCollection) (result MigrationItemCollection, err error) { + req, err := lastResults.migrationItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationMigrationItemsClient) ListComplete(ctx context.Context, skipToken string, takeToken string, filter string) (result MigrationItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, takeToken, filter) + return +} + +// ListByReplicationProtectionContainers gets the list of ASR migration items in the protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// skipToken - the pagination token. +// takeToken - the page size. +// filter - oData filter options. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result MigrationItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.mic.Response.Response != nil { + sc = result.mic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName, skipToken, takeToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.mic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.mic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.mic.hasNextLink() && result.mic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result MigrationItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationMigrationItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults MigrationItemCollection) (result MigrationItemCollection, err error) { + req, err := lastResults.migrationItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result MigrationItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName, skipToken, takeToken, filter) + return +} + +// Migrate the operation to initiate migration of the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// migrateInput - migrate input. +func (client ReplicationMigrationItemsClient) Migrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput MigrateInput) (result ReplicationMigrationItemsMigrateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Migrate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: migrateInput, + Constraints: []validation.Constraint{{Target: "migrateInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Migrate", err.Error()) + } + + req, err := client.MigratePreparer(ctx, fabricName, protectionContainerName, migrationItemName, migrateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Migrate", nil, "Failure preparing request") + return + } + + result, err = client.MigrateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Migrate", result.Response(), "Failure sending request") + return + } + + return +} + +// MigratePreparer prepares the Migrate request. +func (client ReplicationMigrationItemsClient) MigratePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput MigrateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrate", pathParameters), + autorest.WithJSON(migrateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateSender sends the Migrate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) MigrateSender(req *http.Request) (future ReplicationMigrationItemsMigrateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateResponder handles the response to the Migrate request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) MigrateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Resync the operation to resynchronize replication of an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - resync input. +func (client ReplicationMigrationItemsClient) Resync(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input ResyncInput) (result ReplicationMigrationItemsResyncFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Resync") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Resync", err.Error()) + } + + req, err := client.ResyncPreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Resync", nil, "Failure preparing request") + return + } + + result, err = client.ResyncSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Resync", result.Response(), "Failure sending request") + return + } + + return +} + +// ResyncPreparer prepares the Resync request. +func (client ReplicationMigrationItemsClient) ResyncPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input ResyncInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/resync", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResyncSender sends the Resync request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ResyncSender(req *http.Request) (future ReplicationMigrationItemsResyncFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResyncResponder handles the response to the Resync request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ResyncResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestMigrate the operation to initiate test migration of the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// testMigrateInput - test migrate input. +func (client ReplicationMigrationItemsClient) TestMigrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput TestMigrateInput) (result ReplicationMigrationItemsTestMigrateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.TestMigrate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testMigrateInput, + Constraints: []validation.Constraint{{Target: "testMigrateInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "TestMigrate", err.Error()) + } + + req, err := client.TestMigratePreparer(ctx, fabricName, protectionContainerName, migrationItemName, testMigrateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrate", nil, "Failure preparing request") + return + } + + result, err = client.TestMigrateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrate", result.Response(), "Failure sending request") + return + } + + return +} + +// TestMigratePreparer prepares the TestMigrate request. +func (client ReplicationMigrationItemsClient) TestMigratePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput TestMigrateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrate", pathParameters), + autorest.WithJSON(testMigrateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestMigrateSender sends the TestMigrate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) TestMigrateSender(req *http.Request) (future ReplicationMigrationItemsTestMigrateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestMigrateResponder handles the response to the TestMigrate request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) TestMigrateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestMigrateCleanup the operation to initiate test migrate cleanup. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// testMigrateCleanupInput - test migrate cleanup input. +func (client ReplicationMigrationItemsClient) TestMigrateCleanup(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput TestMigrateCleanupInput) (result ReplicationMigrationItemsTestMigrateCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.TestMigrateCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testMigrateCleanupInput, + Constraints: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", err.Error()) + } + + req, err := client.TestMigrateCleanupPreparer(ctx, fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestMigrateCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestMigrateCleanupPreparer prepares the TestMigrateCleanup request. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput TestMigrateCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrateCleanup", pathParameters), + autorest.WithJSON(testMigrateCleanupInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestMigrateCleanupSender sends the TestMigrateCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupSender(req *http.Request) (future ReplicationMigrationItemsTestMigrateCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestMigrateCleanupResponder handles the response to the TestMigrateCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update the recovery settings of an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - update migration item input. +func (client ReplicationMigrationItemsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input UpdateMigrationItemInput) (result ReplicationMigrationItemsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationMigrationItemsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input UpdateMigrationItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) UpdateSender(req *http.Request) (future ReplicationMigrationItemsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) UpdateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationnetworkmappings.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationnetworkmappings.go new file mode 100644 index 000000000000..5066dcfd6ee2 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationnetworkmappings.go @@ -0,0 +1,610 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationNetworkMappingsClient is the client for the ReplicationNetworkMappings methods of the Siterecovery +// service. +type ReplicationNetworkMappingsClient struct { + BaseClient +} + +// NewReplicationNetworkMappingsClient creates an instance of the ReplicationNetworkMappingsClient client. +func NewReplicationNetworkMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworkMappingsClient { + return NewReplicationNetworkMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationNetworkMappingsClientWithBaseURI creates an instance of the ReplicationNetworkMappingsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationNetworkMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworkMappingsClient { + return ReplicationNetworkMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +// input - create network mapping input. +func (client ReplicationNetworkMappingsClient) Create(ctx context.Context, fabricName string, networkName string, networkMappingName string, input CreateNetworkMappingInput) (result ReplicationNetworkMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.RecoveryNetworkID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationNetworkMappingsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, networkName, networkMappingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationNetworkMappingsClient) CreatePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string, input CreateNetworkMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) CreateSender(req *http.Request) (future ReplicationNetworkMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) CreateResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - ARM Resource Name for network mapping. +func (client ReplicationNetworkMappingsClient) Delete(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result ReplicationNetworkMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, networkName, networkMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationNetworkMappingsClient) DeletePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) DeleteSender(req *http.Request) (future ReplicationNetworkMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +func (client ReplicationNetworkMappingsClient) Get(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result NetworkMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, networkName, networkMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationNetworkMappingsClient) GetPreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) GetResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all ASR network mappings in the vault. +func (client ReplicationNetworkMappingsClient) List(ctx context.Context) (result NetworkMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.List") + defer func() { + sc := -1 + if result.nmc.Response.Response != nil { + sc = result.nmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.nmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", resp, "Failure sending request") + return + } + + result.nmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.nmc.hasNextLink() && result.nmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationNetworkMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationNetworkMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) ListResponder(resp *http.Response) (result NetworkMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationNetworkMappingsClient) listNextResults(ctx context.Context, lastResults NetworkMappingCollection) (result NetworkMappingCollection, err error) { + req, err := lastResults.networkMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworkMappingsClient) ListComplete(ctx context.Context) (result NetworkMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationNetworks lists all ASR network mappings for the specified network. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworks(ctx context.Context, fabricName string, networkName string) (result NetworkMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.ListByReplicationNetworks") + defer func() { + sc := -1 + if result.nmc.Response.Response != nil { + sc = result.nmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationNetworksNextResults + req, err := client.ListByReplicationNetworksPreparer(ctx, fabricName, networkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationNetworksSender(req) + if err != nil { + result.nmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", resp, "Failure sending request") + return + } + + result.nmc, err = client.ListByReplicationNetworksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", resp, "Failure responding to request") + return + } + if result.nmc.hasNextLink() && result.nmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationNetworksPreparer prepares the ListByReplicationNetworks request. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksPreparer(ctx context.Context, fabricName string, networkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationNetworksSender sends the ListByReplicationNetworks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationNetworksResponder handles the response to the ListByReplicationNetworks request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksResponder(resp *http.Response) (result NetworkMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationNetworksNextResults retrieves the next set of results, if any. +func (client ReplicationNetworkMappingsClient) listByReplicationNetworksNextResults(ctx context.Context, lastResults NetworkMappingCollection) (result NetworkMappingCollection, err error) { + req, err := lastResults.networkMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationNetworksSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationNetworksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationNetworksComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksComplete(ctx context.Context, fabricName string, networkName string) (result NetworkMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.ListByReplicationNetworks") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationNetworks(ctx, fabricName, networkName) + return +} + +// Update the operation to update an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +// input - update network mapping input. +func (client ReplicationNetworkMappingsClient) Update(ctx context.Context, fabricName string, networkName string, networkMappingName string, input UpdateNetworkMappingInput) (result ReplicationNetworkMappingsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, networkName, networkMappingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationNetworkMappingsClient) UpdatePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string, input UpdateNetworkMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) UpdateSender(req *http.Request) (future ReplicationNetworkMappingsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) UpdateResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationnetworks.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationnetworks.go new file mode 100644 index 000000000000..0b0a116f52e2 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationnetworks.go @@ -0,0 +1,343 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationNetworksClient is the client for the ReplicationNetworks methods of the Siterecovery service. +type ReplicationNetworksClient struct { + BaseClient +} + +// NewReplicationNetworksClient creates an instance of the ReplicationNetworksClient client. +func NewReplicationNetworksClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworksClient { + return NewReplicationNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationNetworksClientWithBaseURI creates an instance of the ReplicationNetworksClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationNetworksClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworksClient { + return ReplicationNetworksClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of a network. +// Parameters: +// fabricName - server Id. +// networkName - primary network name. +func (client ReplicationNetworksClient) Get(ctx context.Context, fabricName string, networkName string) (result Network, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, networkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationNetworksClient) GetPreparer(ctx context.Context, fabricName string, networkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) GetResponder(resp *http.Response) (result Network, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the networks available in a vault. +func (client ReplicationNetworksClient) List(ctx context.Context) (result NetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.List") + defer func() { + sc := -1 + if result.nc.Response.Response != nil { + sc = result.nc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.nc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", resp, "Failure sending request") + return + } + + result.nc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", resp, "Failure responding to request") + return + } + if result.nc.hasNextLink() && result.nc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationNetworksClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) ListResponder(resp *http.Response) (result NetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationNetworksClient) listNextResults(ctx context.Context, lastResults NetworkCollection) (result NetworkCollection, err error) { + req, err := lastResults.networkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworksClient) ListComplete(ctx context.Context) (result NetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the networks available for a fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationNetworksClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result NetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.nc.Response.Response != nil { + sc = result.nc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.nc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.nc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.nc.hasNextLink() && result.nc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationNetworksClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) ListByReplicationFabricsResponder(resp *http.Response) (result NetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationNetworksClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults NetworkCollection) (result NetworkCollection, err error) { + req, err := lastResults.networkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworksClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result NetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationpolicies.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationpolicies.go new file mode 100644 index 000000000000..4ed4b9c10cf9 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationpolicies.go @@ -0,0 +1,465 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationPoliciesClient is the client for the ReplicationPolicies methods of the Siterecovery service. +type ReplicationPoliciesClient struct { + BaseClient +} + +// NewReplicationPoliciesClient creates an instance of the ReplicationPoliciesClient client. +func NewReplicationPoliciesClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationPoliciesClient { + return NewReplicationPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationPoliciesClientWithBaseURI creates an instance of the ReplicationPoliciesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationPoliciesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationPoliciesClient { + return ReplicationPoliciesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a replication policy. +// Parameters: +// policyName - replication policy name. +// input - create policy input. +func (client ReplicationPoliciesClient) Create(ctx context.Context, policyName string, input CreatePolicyInput) (result ReplicationPoliciesCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, policyName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationPoliciesClient) CreatePreparer(ctx context.Context, policyName string, input CreatePolicyInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) CreateSender(req *http.Request) (future ReplicationPoliciesCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) CreateResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a replication policy. +// Parameters: +// policyName - replication policy name. +func (client ReplicationPoliciesClient) Delete(ctx context.Context, policyName string) (result ReplicationPoliciesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationPoliciesClient) DeletePreparer(ctx context.Context, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) DeleteSender(req *http.Request) (future ReplicationPoliciesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a replication policy. +// Parameters: +// policyName - replication policy name. +func (client ReplicationPoliciesClient) Get(ctx context.Context, policyName string) (result Policy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationPoliciesClient) GetPreparer(ctx context.Context, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) GetResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the replication policies for a vault. +func (client ReplicationPoliciesClient) List(ctx context.Context) (result PolicyCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.List") + defer func() { + sc := -1 + if result.pc.Response.Response != nil { + sc = result.pc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", resp, "Failure sending request") + return + } + + result.pc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", resp, "Failure responding to request") + return + } + if result.pc.hasNextLink() && result.pc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationPoliciesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) ListResponder(resp *http.Response) (result PolicyCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationPoliciesClient) listNextResults(ctx context.Context, lastResults PolicyCollection) (result PolicyCollection, err error) { + req, err := lastResults.policyCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationPoliciesClient) ListComplete(ctx context.Context) (result PolicyCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// Update the operation to update a replication policy. +// Parameters: +// policyName - policy Id. +// input - update Policy Input. +func (client ReplicationPoliciesClient) Update(ctx context.Context, policyName string, input UpdatePolicyInput) (result ReplicationPoliciesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, policyName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationPoliciesClient) UpdatePreparer(ctx context.Context, policyName string, input UpdatePolicyInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) UpdateSender(req *http.Request) (future ReplicationPoliciesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) UpdateResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationprotectableitems.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationprotectableitems.go new file mode 100644 index 000000000000..0f99fe831e52 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationprotectableitems.go @@ -0,0 +1,245 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectableItemsClient is the client for the ReplicationProtectableItems methods of the Siterecovery +// service. +type ReplicationProtectableItemsClient struct { + BaseClient +} + +// NewReplicationProtectableItemsClient creates an instance of the ReplicationProtectableItemsClient client. +func NewReplicationProtectableItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectableItemsClient { + return NewReplicationProtectableItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectableItemsClientWithBaseURI creates an instance of the ReplicationProtectableItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationProtectableItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectableItemsClient { + return ReplicationProtectableItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get the operation to get the details of a protectable item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// protectableItemName - protectable item name. +func (client ReplicationProtectableItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (result ProtectableItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, protectableItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectableItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectableItemName": autorest.Encode("path", protectableItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems/{protectableItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectableItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectableItemsClient) GetResponder(resp *http.Response) (result ProtectableItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationProtectionContainers lists the protectable items in a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// filter - oData filter options. +// take - take OData query parameter. +// skipToken - skipToken OData query parameter. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result ProtectableItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.pic.Response.Response != nil { + sc = result.pic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName, filter, take, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.pic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.pic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.pic.hasNextLink() && result.pic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(take) > 0 { + queryParameters["$take"] = autorest.Encode("query", take) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ProtectableItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectableItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ProtectableItemCollection) (result ProtectableItemCollection, err error) { + req, err := lastResults.protectableItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result ProtectableItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName, filter, take, skipToken) + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationprotecteditems.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationprotecteditems.go new file mode 100644 index 000000000000..a398ac648945 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationprotecteditems.go @@ -0,0 +1,2021 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectedItemsClient is the client for the ReplicationProtectedItems methods of the Siterecovery service. +type ReplicationProtectedItemsClient struct { + BaseClient +} + +// NewReplicationProtectedItemsClient creates an instance of the ReplicationProtectedItemsClient client. +func NewReplicationProtectedItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectedItemsClient { + return NewReplicationProtectedItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectedItemsClientWithBaseURI creates an instance of the ReplicationProtectedItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationProtectedItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectedItemsClient { + return ReplicationProtectedItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// AddDisks operation to add disks(s) to the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// addDisksInput - add disks input. +func (client ReplicationProtectedItemsClient) AddDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput AddDisksInput) (result ReplicationProtectedItemsAddDisksFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.AddDisks") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddDisksPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, addDisksInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "AddDisks", nil, "Failure preparing request") + return + } + + result, err = client.AddDisksSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "AddDisks", result.Response(), "Failure sending request") + return + } + + return +} + +// AddDisksPreparer prepares the AddDisks request. +func (client ReplicationProtectedItemsClient) AddDisksPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput AddDisksInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/addDisks", pathParameters), + autorest.WithJSON(addDisksInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddDisksSender sends the AddDisks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) AddDisksSender(req *http.Request) (future ReplicationProtectedItemsAddDisksFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// AddDisksResponder handles the response to the AddDisks request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) AddDisksResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ApplyRecoveryPoint the operation to change the recovery point of a failed over replication protected item. +// Parameters: +// fabricName - the ARM fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replicated protected item name. +// applyRecoveryPointInput - the ApplyRecoveryPointInput. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPoint(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput ApplyRecoveryPointInput) (result ReplicationProtectedItemsApplyRecoveryPointFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ApplyRecoveryPoint") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: applyRecoveryPointInput, + Constraints: []validation.Constraint{{Target: "applyRecoveryPointInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", err.Error()) + } + + req, err := client.ApplyRecoveryPointPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, applyRecoveryPointInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", nil, "Failure preparing request") + return + } + + result, err = client.ApplyRecoveryPointSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", result.Response(), "Failure sending request") + return + } + + return +} + +// ApplyRecoveryPointPreparer prepares the ApplyRecoveryPoint request. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput ApplyRecoveryPointInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/applyRecoveryPoint", pathParameters), + autorest.WithJSON(applyRecoveryPointInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ApplyRecoveryPointSender sends the ApplyRecoveryPoint request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointSender(req *http.Request) (future ReplicationProtectedItemsApplyRecoveryPointFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ApplyRecoveryPointResponder handles the response to the ApplyRecoveryPoint request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Create the operation to create an ASR replication protected item (Enable replication). +// Parameters: +// fabricName - name of the fabric. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - a name for the replication protected item. +// input - enable Protection Input. +func (client ReplicationProtectedItemsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input EnableProtectionInput) (result ReplicationProtectedItemsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectedItemsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input EnableProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) CreateSender(req *http.Request) (future ReplicationProtectedItemsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) CreateResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to disable replication on a replication protected item. This will also remove the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// disableProtectionInput - disable protection input. +func (client ReplicationProtectedItemsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput DisableProtectionInput) (result ReplicationProtectedItemsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: disableProtectionInput, + Constraints: []validation.Constraint{{Target: "disableProtectionInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, disableProtectionInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectedItemsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput DisableProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/remove", pathParameters), + autorest.WithJSON(disableProtectionInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) DeleteSender(req *http.Request) (future ReplicationProtectedItemsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// FailoverCancel operation to cancel the failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) FailoverCancel(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsFailoverCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.FailoverCancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCancelPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCancel", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCancel", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCancelPreparer prepares the FailoverCancel request. +func (client ReplicationProtectedItemsClient) FailoverCancelPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCancelSender sends the FailoverCancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) FailoverCancelSender(req *http.Request) (future ReplicationProtectedItemsFailoverCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCancelResponder handles the response to the FailoverCancel request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) FailoverCancelResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// FailoverCommit operation to commit the failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) FailoverCommit(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsFailoverCommitFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.FailoverCommit") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCommitPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCommit", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCommitSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCommit", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCommitPreparer prepares the FailoverCommit request. +func (client ReplicationProtectedItemsClient) FailoverCommitPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCommit", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCommitSender sends the FailoverCommit request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) FailoverCommitSender(req *http.Request) (future ReplicationProtectedItemsFailoverCommitFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCommitResponder handles the response to the FailoverCommit request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) FailoverCommitResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of an ASR replication protected item. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectedItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) GetResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of ASR replication protected items in the vault. +// Parameters: +// skipToken - the pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. +// filter - oData filter options. +func (client ReplicationProtectedItemsClient) List(ctx context.Context, skipToken string, filter string) (result ReplicationProtectedItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.List") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectedItemsClient) ListPreparer(ctx context.Context, skipToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectedItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ListResponder(resp *http.Response) (result ReplicationProtectedItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectedItemsClient) listNextResults(ctx context.Context, lastResults ReplicationProtectedItemCollection) (result ReplicationProtectedItemCollection, err error) { + req, err := lastResults.replicationProtectedItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectedItemsClient) ListComplete(ctx context.Context, skipToken string, filter string) (result ReplicationProtectedItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, filter) + return +} + +// ListByReplicationProtectionContainers gets the list of ASR replication protected items in the protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectedItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ReplicationProtectedItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectedItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ReplicationProtectedItemCollection) (result ReplicationProtectedItemCollection, err error) { + req, err := lastResults.replicationProtectedItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectedItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName) + return +} + +// PlannedFailover operation to initiate a planned failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// failoverInput - planned failover input. +func (client ReplicationProtectedItemsClient) PlannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput PlannedFailoverInput) (result ReplicationProtectedItemsPlannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.PlannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PlannedFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "PlannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.PlannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "PlannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// PlannedFailoverPreparer prepares the PlannedFailover request. +func (client ReplicationProtectedItemsClient) PlannedFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput PlannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/plannedFailover", pathParameters), + autorest.WithJSON(failoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PlannedFailoverSender sends the PlannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) PlannedFailoverSender(req *http.Request) (future ReplicationProtectedItemsPlannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PlannedFailoverResponder handles the response to the PlannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) PlannedFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Purge the operation to delete or purge a replication protected item. This operation will force delete the +// replication protected item. Use the remove operation on replication protected item to perform a clean disable +// replication for the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) Purge(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationProtectedItemsClient) PurgePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) PurgeSender(req *http.Request) (future ReplicationProtectedItemsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RemoveDisks operation to remove disk(s) from the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// removeDisksInput - remove disks input. +func (client ReplicationProtectedItemsClient) RemoveDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput RemoveDisksInput) (result ReplicationProtectedItemsRemoveDisksFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.RemoveDisks") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RemoveDisksPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, removeDisksInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RemoveDisks", nil, "Failure preparing request") + return + } + + result, err = client.RemoveDisksSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RemoveDisks", result.Response(), "Failure sending request") + return + } + + return +} + +// RemoveDisksPreparer prepares the RemoveDisks request. +func (client ReplicationProtectedItemsClient) RemoveDisksPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput RemoveDisksInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/removeDisks", pathParameters), + autorest.WithJSON(removeDisksInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RemoveDisksSender sends the RemoveDisks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) RemoveDisksSender(req *http.Request) (future ReplicationProtectedItemsRemoveDisksFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RemoveDisksResponder handles the response to the RemoveDisks request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) RemoveDisksResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RepairReplication the operation to start resynchronize/repair replication for a replication protected item requiring +// resynchronization. +// Parameters: +// fabricName - the name of the fabric. +// protectionContainerName - the name of the container. +// replicatedProtectedItemName - the name of the replication protected item. +func (client ReplicationProtectedItemsClient) RepairReplication(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsRepairReplicationFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.RepairReplication") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RepairReplicationPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RepairReplication", nil, "Failure preparing request") + return + } + + result, err = client.RepairReplicationSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RepairReplication", result.Response(), "Failure sending request") + return + } + + return +} + +// RepairReplicationPreparer prepares the RepairReplication request. +func (client ReplicationProtectedItemsClient) RepairReplicationPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/repairReplication", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RepairReplicationSender sends the RepairReplication request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) RepairReplicationSender(req *http.Request) (future ReplicationProtectedItemsRepairReplicationFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RepairReplicationResponder handles the response to the RepairReplication request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) RepairReplicationResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Reprotect operation to reprotect or reverse replicate a failed over replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// reprotectInput - reverse replication input. +func (client ReplicationProtectedItemsClient) Reprotect(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput ReverseReplicationInput) (result ReplicationProtectedItemsReprotectFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Reprotect") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReprotectPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, reprotectInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Reprotect", nil, "Failure preparing request") + return + } + + result, err = client.ReprotectSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Reprotect", result.Response(), "Failure sending request") + return + } + + return +} + +// ReprotectPreparer prepares the Reprotect request. +func (client ReplicationProtectedItemsClient) ReprotectPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput ReverseReplicationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/reProtect", pathParameters), + autorest.WithJSON(reprotectInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReprotectSender sends the Reprotect request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ReprotectSender(req *http.Request) (future ReplicationProtectedItemsReprotectFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReprotectResponder handles the response to the Reprotect request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ReprotectResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ResolveHealthErrors operation to resolve health issues of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// resolveHealthInput - health issue input object. +func (client ReplicationProtectedItemsClient) ResolveHealthErrors(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput ResolveHealthInput) (result ReplicationProtectedItemsResolveHealthErrorsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ResolveHealthErrors") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResolveHealthErrorsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, resolveHealthInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ResolveHealthErrors", nil, "Failure preparing request") + return + } + + result, err = client.ResolveHealthErrorsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ResolveHealthErrors", result.Response(), "Failure sending request") + return + } + + return +} + +// ResolveHealthErrorsPreparer prepares the ResolveHealthErrors request. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput ResolveHealthInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/resolveHealthErrors", pathParameters), + autorest.WithJSON(resolveHealthInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResolveHealthErrorsSender sends the ResolveHealthErrors request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsSender(req *http.Request) (future ReplicationProtectedItemsResolveHealthErrorsFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResolveHealthErrorsResponder handles the response to the ResolveHealthErrors request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SwitchProvider operation to initiate a switch provider of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// switchProviderInput - switch provider input. +func (client ReplicationProtectedItemsClient) SwitchProvider(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, switchProviderInput SwitchProviderInput) (result ReplicationProtectedItemsSwitchProviderFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.SwitchProvider") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.SwitchProviderPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, switchProviderInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "SwitchProvider", nil, "Failure preparing request") + return + } + + result, err = client.SwitchProviderSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "SwitchProvider", result.Response(), "Failure sending request") + return + } + + return +} + +// SwitchProviderPreparer prepares the SwitchProvider request. +func (client ReplicationProtectedItemsClient) SwitchProviderPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, switchProviderInput SwitchProviderInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/switchProvider", pathParameters), + autorest.WithJSON(switchProviderInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SwitchProviderSender sends the SwitchProvider request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) SwitchProviderSender(req *http.Request) (future ReplicationProtectedItemsSwitchProviderFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// SwitchProviderResponder handles the response to the SwitchProvider request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) SwitchProviderResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailover operation to perform a test failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// testfailoverInput - test failover input. +func (client ReplicationProtectedItemsClient) TestFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput TestFailoverInput) (result ReplicationProtectedItemsTestFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.TestFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testfailoverInput, + Constraints: []validation.Constraint{{Target: "testfailoverInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "TestFailover", err.Error()) + } + + req, err := client.TestFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, testfailoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailover", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverPreparer prepares the TestFailover request. +func (client ReplicationProtectedItemsClient) TestFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput TestFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailover", pathParameters), + autorest.WithJSON(testfailoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverSender sends the TestFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) TestFailoverSender(req *http.Request) (future ReplicationProtectedItemsTestFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverResponder handles the response to the TestFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) TestFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailoverCleanup operation to clean up the test failover of a replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// cleanupInput - test failover cleanup input. +func (client ReplicationProtectedItemsClient) TestFailoverCleanup(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput TestFailoverCleanupInput) (result ReplicationProtectedItemsTestFailoverCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.TestFailoverCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: cleanupInput, + Constraints: []validation.Constraint{{Target: "cleanupInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "cleanupInput.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "cleanupInput.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", err.Error()) + } + + req, err := client.TestFailoverCleanupPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, cleanupInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverCleanupPreparer prepares the TestFailoverCleanup request. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput TestFailoverCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailoverCleanup", pathParameters), + autorest.WithJSON(cleanupInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverCleanupSender sends the TestFailoverCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupSender(req *http.Request) (future ReplicationProtectedItemsTestFailoverCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverCleanupResponder handles the response to the TestFailoverCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UnplannedFailover operation to initiate a failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// failoverInput - failover input. +func (client ReplicationProtectedItemsClient) UnplannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput UnplannedFailoverInput) (result ReplicationProtectedItemsUnplannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UnplannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: failoverInput, + Constraints: []validation.Constraint{{Target: "failoverInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", err.Error()) + } + + req, err := client.UnplannedFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.UnplannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// UnplannedFailoverPreparer prepares the UnplannedFailover request. +func (client ReplicationProtectedItemsClient) UnplannedFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput UnplannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/unplannedFailover", pathParameters), + autorest.WithJSON(failoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UnplannedFailoverSender sends the UnplannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UnplannedFailoverSender(req *http.Request) (future ReplicationProtectedItemsUnplannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UnplannedFailoverResponder handles the response to the UnplannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UnplannedFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update the recovery settings of an ASR replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// updateProtectionInput - update protection input. +func (client ReplicationProtectedItemsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput UpdateReplicationProtectedItemInput) (result ReplicationProtectedItemsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, updateProtectionInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationProtectedItemsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput UpdateReplicationProtectedItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithJSON(updateProtectionInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateSender(req *http.Request) (future ReplicationProtectedItemsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateAppliance the operation to update appliance of an ASR replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// applianceUpdateInput - appliance update protection input. +func (client ReplicationProtectedItemsClient) UpdateAppliance(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput UpdateApplianceForReplicationProtectedItemInput) (result ReplicationProtectedItemsUpdateApplianceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UpdateAppliance") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: applianceUpdateInput, + Constraints: []validation.Constraint{{Target: "applianceUpdateInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "applianceUpdateInput.Properties.TargetApplianceID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "UpdateAppliance", err.Error()) + } + + req, err := client.UpdateAppliancePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, applianceUpdateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateAppliance", nil, "Failure preparing request") + return + } + + result, err = client.UpdateApplianceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateAppliance", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateAppliancePreparer prepares the UpdateAppliance request. +func (client ReplicationProtectedItemsClient) UpdateAppliancePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput UpdateApplianceForReplicationProtectedItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/updateAppliance", pathParameters), + autorest.WithJSON(applianceUpdateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateApplianceSender sends the UpdateAppliance request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateApplianceSender(req *http.Request) (future ReplicationProtectedItemsUpdateApplianceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateApplianceResponder handles the response to the UpdateAppliance request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateApplianceResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateMobilityService the operation to update(push update) the installed mobility service software on a replication +// protected item to the latest available version. +// Parameters: +// fabricName - the name of the fabric containing the protected item. +// protectionContainerName - the name of the container containing the protected item. +// replicationProtectedItemName - 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. +func (client ReplicationProtectedItemsClient) UpdateMobilityService(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest UpdateMobilityServiceRequest) (result ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UpdateMobilityService") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateMobilityServicePreparer(ctx, fabricName, protectionContainerName, replicationProtectedItemName, updateMobilityServiceRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateMobilityService", nil, "Failure preparing request") + return + } + + result, err = client.UpdateMobilityServiceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateMobilityService", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateMobilityServicePreparer prepares the UpdateMobilityService request. +func (client ReplicationProtectedItemsClient) UpdateMobilityServicePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest UpdateMobilityServiceRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicationProtectedItemName": autorest.Encode("path", replicationProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicationProtectedItemName}/updateMobilityService", pathParameters), + autorest.WithJSON(updateMobilityServiceRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateMobilityServiceSender sends the UpdateMobilityService request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateMobilityServiceSender(req *http.Request) (future ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateMobilityServiceResponder handles the response to the UpdateMobilityService request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateMobilityServiceResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationprotectioncontainermappings.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationprotectioncontainermappings.go new file mode 100644 index 000000000000..1be38333bb2a --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationprotectioncontainermappings.go @@ -0,0 +1,688 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionContainerMappingsClient is the client for the ReplicationProtectionContainerMappings methods of +// the Siterecovery service. +type ReplicationProtectionContainerMappingsClient struct { + BaseClient +} + +// NewReplicationProtectionContainerMappingsClient creates an instance of the +// ReplicationProtectionContainerMappingsClient client. +func NewReplicationProtectionContainerMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainerMappingsClient { + return NewReplicationProtectionContainerMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionContainerMappingsClientWithBaseURI creates an instance of the +// ReplicationProtectionContainerMappingsClient client using a custom endpoint. Use this when interacting with an +// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationProtectionContainerMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainerMappingsClient { + return ReplicationProtectionContainerMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// creationInput - mapping creation input. +func (client ReplicationProtectionContainerMappingsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput CreateProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, mappingName, creationInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionContainerMappingsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput CreateProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithJSON(creationInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) CreateSender(req *http.Request) (future ReplicationProtectionContainerMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) CreateResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete or remove a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// removalInput - removal input. +func (client ReplicationProtectionContainerMappingsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput RemoveProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, mappingName, removalInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectionContainerMappingsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput RemoveProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}/remove", pathParameters), + autorest.WithJSON(removalInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) DeleteSender(req *http.Request) (future ReplicationProtectionContainerMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection Container mapping name. +func (client ReplicationProtectionContainerMappingsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result ProtectionContainerMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, mappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionContainerMappingsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) GetResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the protection container mappings in the vault. +func (client ReplicationProtectionContainerMappingsClient) List(ctx context.Context) (result ProtectionContainerMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.List") + defer func() { + sc := -1 + if result.pcmc.Response.Response != nil { + sc = result.pcmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pcmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", resp, "Failure sending request") + return + } + + result.pcmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.pcmc.hasNextLink() && result.pcmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionContainerMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionContainerMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) ListResponder(resp *http.Response) (result ProtectionContainerMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainerMappingsClient) listNextResults(ctx context.Context, lastResults ProtectionContainerMappingCollection) (result ProtectionContainerMappingCollection, err error) { + req, err := lastResults.protectionContainerMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainerMappingsClient) ListComplete(ctx context.Context) (result ProtectionContainerMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationProtectionContainers lists the protection container mappings for a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainerMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.pcmc.Response.Response != nil { + sc = result.pcmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.pcmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.pcmc, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.pcmc.hasNextLink() && result.pcmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ProtectionContainerMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainerMappingsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ProtectionContainerMappingCollection) (result ProtectionContainerMappingCollection, err error) { + req, err := lastResults.protectionContainerMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainerMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName) + return +} + +// Purge the operation to purge(force delete) a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +func (client ReplicationProtectionContainerMappingsClient) Purge(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result ReplicationProtectionContainerMappingsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, protectionContainerName, mappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationProtectionContainerMappingsClient) PurgePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) PurgeSender(req *http.Request) (future ReplicationProtectionContainerMappingsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update the operation to update protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// updateInput - mapping update input. +func (client ReplicationProtectionContainerMappingsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput UpdateProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, mappingName, updateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationProtectionContainerMappingsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput UpdateProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithJSON(updateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) UpdateSender(req *http.Request) (future ReplicationProtectionContainerMappingsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) UpdateResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationprotectioncontainers.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationprotectioncontainers.go new file mode 100644 index 000000000000..a91e6c068396 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationprotectioncontainers.go @@ -0,0 +1,677 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionContainersClient is the client for the ReplicationProtectionContainers methods of the +// Siterecovery service. +type ReplicationProtectionContainersClient struct { + BaseClient +} + +// NewReplicationProtectionContainersClient creates an instance of the ReplicationProtectionContainersClient client. +func NewReplicationProtectionContainersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainersClient { + return NewReplicationProtectionContainersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionContainersClientWithBaseURI creates an instance of the ReplicationProtectionContainersClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationProtectionContainersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainersClient { + return ReplicationProtectionContainersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create operation to create a protection container. +// Parameters: +// fabricName - unique fabric ARM name. +// protectionContainerName - unique protection container ARM name. +// creationInput - creation input. +func (client ReplicationProtectionContainersClient) Create(ctx context.Context, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput) (result ReplicationProtectionContainersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, creationInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionContainersClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}", pathParameters), + autorest.WithJSON(creationInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) CreateSender(req *http.Request) (future ReplicationProtectionContainersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) CreateResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete operation to remove a protection container. +// Parameters: +// fabricName - unique fabric ARM name. +// protectionContainerName - unique protection container ARM name. +func (client ReplicationProtectionContainersClient) Delete(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectionContainersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectionContainersClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) DeleteSender(req *http.Request) (future ReplicationProtectionContainersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DiscoverProtectableItem the operation to a add a protectable item to a protection container(Add physical server). +// Parameters: +// fabricName - the name of the fabric. +// protectionContainerName - the name of the protection container. +// discoverProtectableItemRequest - the request object to add a protectable item. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItem(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest) (result ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.DiscoverProtectableItem") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DiscoverProtectableItemPreparer(ctx, fabricName, protectionContainerName, discoverProtectableItemRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "DiscoverProtectableItem", nil, "Failure preparing request") + return + } + + result, err = client.DiscoverProtectableItemSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "DiscoverProtectableItem", result.Response(), "Failure sending request") + return + } + + return +} + +// DiscoverProtectableItemPreparer prepares the DiscoverProtectableItem request. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemPreparer(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/discoverProtectableItem", pathParameters), + autorest.WithJSON(discoverProtectableItemRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DiscoverProtectableItemSender sends the DiscoverProtectableItem request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemSender(req *http.Request) (future ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DiscoverProtectableItemResponder handles the response to the DiscoverProtectableItem request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectionContainersClient) Get(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainer, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionContainersClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) GetResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the protection containers in a vault. +func (client ReplicationProtectionContainersClient) List(ctx context.Context) (result ProtectionContainerCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.List") + defer func() { + sc := -1 + if result.pcc.Response.Response != nil { + sc = result.pcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", resp, "Failure sending request") + return + } + + result.pcc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", resp, "Failure responding to request") + return + } + if result.pcc.hasNextLink() && result.pcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionContainersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionContainers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) ListResponder(resp *http.Response) (result ProtectionContainerCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainersClient) listNextResults(ctx context.Context, lastResults ProtectionContainerCollection) (result ProtectionContainerCollection, err error) { + req, err := lastResults.protectionContainerCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainersClient) ListComplete(ctx context.Context) (result ProtectionContainerCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the protection containers in the specified fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationProtectionContainersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result ProtectionContainerCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.pcc.Response.Response != nil { + sc = result.pcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.pcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.pcc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.pcc.hasNextLink() && result.pcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsResponder(resp *http.Response) (result ProtectionContainerCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults ProtectionContainerCollection) (result ProtectionContainerCollection, err error) { + req, err := lastResults.protectionContainerCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result ProtectionContainerCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// SwitchProtection operation to switch protection from one container to another or one replication provider to +// another. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// switchInput - switch protection input. +func (client ReplicationProtectionContainersClient) SwitchProtection(ctx context.Context, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput) (result ReplicationProtectionContainersSwitchProtectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.SwitchProtection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.SwitchProtectionPreparer(ctx, fabricName, protectionContainerName, switchInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "SwitchProtection", nil, "Failure preparing request") + return + } + + result, err = client.SwitchProtectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "SwitchProtection", result.Response(), "Failure sending request") + return + } + + return +} + +// SwitchProtectionPreparer prepares the SwitchProtection request. +func (client ReplicationProtectionContainersClient) SwitchProtectionPreparer(ctx context.Context, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/switchprotection", pathParameters), + autorest.WithJSON(switchInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SwitchProtectionSender sends the SwitchProtection request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) SwitchProtectionSender(req *http.Request) (future ReplicationProtectionContainersSwitchProtectionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// SwitchProtectionResponder handles the response to the SwitchProtection request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) SwitchProtectionResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationprotectionintents.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationprotectionintents.go new file mode 100644 index 000000000000..66cf838e3ffc --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationprotectionintents.go @@ -0,0 +1,312 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionIntentsClient is the client for the ReplicationProtectionIntents methods of the Siterecovery +// service. +type ReplicationProtectionIntentsClient struct { + BaseClient +} + +// NewReplicationProtectionIntentsClient creates an instance of the ReplicationProtectionIntentsClient client. +func NewReplicationProtectionIntentsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionIntentsClient { + return NewReplicationProtectionIntentsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionIntentsClientWithBaseURI creates an instance of the ReplicationProtectionIntentsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationProtectionIntentsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionIntentsClient { + return ReplicationProtectionIntentsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR replication protection intent item. +// Parameters: +// intentObjectName - a name for the replication protection item. +// input - create Protection Intent Input. +func (client ReplicationProtectionIntentsClient) Create(ctx context.Context, intentObjectName string, input CreateProtectionIntentInput) (result ReplicationProtectionIntent, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, intentObjectName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionIntentsClient) CreatePreparer(ctx context.Context, intentObjectName string, input CreateProtectionIntentInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "intentObjectName": autorest.Encode("path", intentObjectName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) CreateResponder(resp *http.Response) (result ReplicationProtectionIntent, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of an ASR replication protection intent. +// Parameters: +// intentObjectName - replication protection intent name. +func (client ReplicationProtectionIntentsClient) Get(ctx context.Context, intentObjectName string) (result ReplicationProtectionIntent, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, intentObjectName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionIntentsClient) GetPreparer(ctx context.Context, intentObjectName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "intentObjectName": autorest.Encode("path", intentObjectName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) GetResponder(resp *http.Response) (result ReplicationProtectionIntent, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of ASR replication protection intent objects in the vault. +// Parameters: +// skipToken - the pagination token. +// takeToken - the page size. +func (client ReplicationProtectionIntentsClient) List(ctx context.Context, skipToken string, takeToken string) (result ReplicationProtectionIntentCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.List") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, takeToken) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionIntentsClient) ListPreparer(ctx context.Context, skipToken string, takeToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) ListResponder(resp *http.Response) (result ReplicationProtectionIntentCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionIntentsClient) listNextResults(ctx context.Context, lastResults ReplicationProtectionIntentCollection) (result ReplicationProtectionIntentCollection, err error) { + req, err := lastResults.replicationProtectionIntentCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionIntentsClient) ListComplete(ctx context.Context, skipToken string, takeToken string) (result ReplicationProtectionIntentCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, takeToken) + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationrecoveryplans.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationrecoveryplans.go new file mode 100644 index 000000000000..345cd90eef8e --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationrecoveryplans.go @@ -0,0 +1,1069 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationRecoveryPlansClient is the client for the ReplicationRecoveryPlans methods of the Siterecovery service. +type ReplicationRecoveryPlansClient struct { + BaseClient +} + +// NewReplicationRecoveryPlansClient creates an instance of the ReplicationRecoveryPlansClient client. +func NewReplicationRecoveryPlansClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryPlansClient { + return NewReplicationRecoveryPlansClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationRecoveryPlansClientWithBaseURI creates an instance of the ReplicationRecoveryPlansClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationRecoveryPlansClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryPlansClient { + return ReplicationRecoveryPlansClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery Plan creation input. +func (client ReplicationRecoveryPlansClient) Create(ctx context.Context, recoveryPlanName string, input CreateRecoveryPlanInput) (result ReplicationRecoveryPlansCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.PrimaryFabricID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "input.Properties.RecoveryFabricID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "input.Properties.Groups", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationRecoveryPlansClient) CreatePreparer(ctx context.Context, recoveryPlanName string, input CreateRecoveryPlanInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) CreateSender(req *http.Request) (future ReplicationRecoveryPlansCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) CreateResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) Delete(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationRecoveryPlansClient) DeletePreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) DeleteSender(req *http.Request) (future ReplicationRecoveryPlansDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// FailoverCancel the operation to cancel the failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) FailoverCancel(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansFailoverCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.FailoverCancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCancelPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCancel", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCancel", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCancelPreparer prepares the FailoverCancel request. +func (client ReplicationRecoveryPlansClient) FailoverCancelPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCancelSender sends the FailoverCancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) FailoverCancelSender(req *http.Request) (future ReplicationRecoveryPlansFailoverCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCancelResponder handles the response to the FailoverCancel request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) FailoverCancelResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// FailoverCommit the operation to commit the failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) FailoverCommit(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansFailoverCommitFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.FailoverCommit") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCommitPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCommit", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCommitSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCommit", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCommitPreparer prepares the FailoverCommit request. +func (client ReplicationRecoveryPlansClient) FailoverCommitPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCommit", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCommitSender sends the FailoverCommit request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) FailoverCommitSender(req *http.Request) (future ReplicationRecoveryPlansFailoverCommitFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCommitResponder handles the response to the FailoverCommit request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) FailoverCommitResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of the recovery plan. +// Parameters: +// recoveryPlanName - name of the recovery plan. +func (client ReplicationRecoveryPlansClient) Get(ctx context.Context, recoveryPlanName string) (result RecoveryPlan, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationRecoveryPlansClient) GetPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) GetResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the recovery plans in the vault. +func (client ReplicationRecoveryPlansClient) List(ctx context.Context) (result RecoveryPlanCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.List") + defer func() { + sc := -1 + if result.RPCVar.Response.Response != nil { + sc = result.RPCVar.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.RPCVar.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", resp, "Failure sending request") + return + } + + result.RPCVar, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", resp, "Failure responding to request") + return + } + if result.RPCVar.hasNextLink() && result.RPCVar.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationRecoveryPlansClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) ListResponder(resp *http.Response) (result RecoveryPlanCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryPlansClient) listNextResults(ctx context.Context, lastResults RecoveryPlanCollection) (result RecoveryPlanCollection, err error) { + req, err := lastResults.recoveryPlanCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryPlansClient) ListComplete(ctx context.Context) (result RecoveryPlanCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// PlannedFailover the operation to start the planned failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - failover input. +func (client ReplicationRecoveryPlansClient) PlannedFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput) (result ReplicationRecoveryPlansPlannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.PlannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", err.Error()) + } + + req, err := client.PlannedFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.PlannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// PlannedFailoverPreparer prepares the PlannedFailover request. +func (client ReplicationRecoveryPlansClient) PlannedFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/plannedFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PlannedFailoverSender sends the PlannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) PlannedFailoverSender(req *http.Request) (future ReplicationRecoveryPlansPlannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PlannedFailoverResponder handles the response to the PlannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) PlannedFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Reprotect the operation to reprotect(reverse replicate) a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) Reprotect(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansReprotectFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Reprotect") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReprotectPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Reprotect", nil, "Failure preparing request") + return + } + + result, err = client.ReprotectSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Reprotect", result.Response(), "Failure sending request") + return + } + + return +} + +// ReprotectPreparer prepares the Reprotect request. +func (client ReplicationRecoveryPlansClient) ReprotectPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/reProtect", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReprotectSender sends the Reprotect request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) ReprotectSender(req *http.Request) (future ReplicationRecoveryPlansReprotectFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReprotectResponder handles the response to the Reprotect request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) ReprotectResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailover the operation to start the test failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan test failover input. +func (client ReplicationRecoveryPlansClient) TestFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverInput) (result ReplicationRecoveryPlansTestFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.TestFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.NetworkType", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "TestFailover", err.Error()) + } + + req, err := client.TestFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailover", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverPreparer prepares the TestFailover request. +func (client ReplicationRecoveryPlansClient) TestFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverSender sends the TestFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) TestFailoverSender(req *http.Request) (future ReplicationRecoveryPlansTestFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverResponder handles the response to the TestFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) TestFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailoverCleanup the operation to cleanup test failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan test failover cleanup input. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanup(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput) (result ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.TestFailoverCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "input.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", err.Error()) + } + + req, err := client.TestFailoverCleanupPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverCleanupPreparer prepares the TestFailoverCleanup request. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailoverCleanup", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverCleanupSender sends the TestFailoverCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupSender(req *http.Request) (future ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverCleanupResponder handles the response to the TestFailoverCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UnplannedFailover the operation to start the unplanned failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan unplanned failover input. +func (client ReplicationRecoveryPlansClient) UnplannedFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput) (result ReplicationRecoveryPlansUnplannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.UnplannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", err.Error()) + } + + req, err := client.UnplannedFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.UnplannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// UnplannedFailoverPreparer prepares the UnplannedFailover request. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/unplannedFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UnplannedFailoverSender sends the UnplannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverSender(req *http.Request) (future ReplicationRecoveryPlansUnplannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UnplannedFailoverResponder handles the response to the UnplannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - update recovery plan input. +func (client ReplicationRecoveryPlansClient) Update(ctx context.Context, recoveryPlanName string, input UpdateRecoveryPlanInput) (result ReplicationRecoveryPlansUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationRecoveryPlansClient) UpdatePreparer(ctx context.Context, recoveryPlanName string, input UpdateRecoveryPlanInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) UpdateSender(req *http.Request) (future ReplicationRecoveryPlansUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) UpdateResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationrecoveryservicesproviders.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationrecoveryservicesproviders.go new file mode 100644 index 000000000000..e60c0c6f33e2 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationrecoveryservicesproviders.go @@ -0,0 +1,700 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationRecoveryServicesProvidersClient is the client for the ReplicationRecoveryServicesProviders methods of the +// Siterecovery service. +type ReplicationRecoveryServicesProvidersClient struct { + BaseClient +} + +// NewReplicationRecoveryServicesProvidersClient creates an instance of the ReplicationRecoveryServicesProvidersClient +// client. +func NewReplicationRecoveryServicesProvidersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryServicesProvidersClient { + return NewReplicationRecoveryServicesProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationRecoveryServicesProvidersClientWithBaseURI creates an instance of the +// ReplicationRecoveryServicesProvidersClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationRecoveryServicesProvidersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryServicesProvidersClient { + return ReplicationRecoveryServicesProvidersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to add a recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +// addProviderInput - add provider input. +func (client ReplicationRecoveryServicesProvidersClient) Create(ctx context.Context, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput) (result ReplicationRecoveryServicesProvidersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: addProviderInput, + Constraints: []validation.Constraint{{Target: "addProviderInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.MachineName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.AuthenticationIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.ResourceAccessIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, providerName, addProviderInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationRecoveryServicesProvidersClient) CreatePreparer(ctx context.Context, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithJSON(addProviderInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) CreateSender(req *http.Request) (future ReplicationRecoveryServicesProvidersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) CreateResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to removes/delete(unregister) a recovery services provider from the vault. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Delete(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationRecoveryServicesProvidersClient) DeletePreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) DeleteSender(req *http.Request) (future ReplicationRecoveryServicesProvidersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of registered recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Get(ctx context.Context, fabricName string, providerName string) (result RecoveryServicesProvider, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationRecoveryServicesProvidersClient) GetPreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) GetResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the registered recovery services providers in the vault. +func (client ReplicationRecoveryServicesProvidersClient) List(ctx context.Context) (result RecoveryServicesProviderCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.List") + defer func() { + sc := -1 + if result.rspc.Response.Response != nil { + sc = result.rspc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rspc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", resp, "Failure sending request") + return + } + + result.rspc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", resp, "Failure responding to request") + return + } + if result.rspc.hasNextLink() && result.rspc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationRecoveryServicesProvidersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryServicesProviders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) ListResponder(resp *http.Response) (result RecoveryServicesProviderCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryServicesProvidersClient) listNextResults(ctx context.Context, lastResults RecoveryServicesProviderCollection) (result RecoveryServicesProviderCollection, err error) { + req, err := lastResults.recoveryServicesProviderCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryServicesProvidersClient) ListComplete(ctx context.Context) (result RecoveryServicesProviderCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the registered recovery services providers for the specified fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result RecoveryServicesProviderCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.rspc.Response.Response != nil { + sc = result.rspc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.rspc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.rspc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.rspc.hasNextLink() && result.rspc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsResponder(resp *http.Response) (result RecoveryServicesProviderCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryServicesProvidersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults RecoveryServicesProviderCollection) (result RecoveryServicesProviderCollection, err error) { + req, err := lastResults.recoveryServicesProviderCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result RecoveryServicesProviderCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// Purge the operation to purge(force delete) a recovery services provider from the vault. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Purge(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationRecoveryServicesProvidersClient) PurgePreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) PurgeSender(req *http.Request) (future ReplicationRecoveryServicesProvidersPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RefreshProvider the operation to refresh the information from the recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProvider(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.RefreshProvider") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RefreshProviderPreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "RefreshProvider", nil, "Failure preparing request") + return + } + + result, err = client.RefreshProviderSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "RefreshProvider", result.Response(), "Failure sending request") + return + } + + return +} + +// RefreshProviderPreparer prepares the RefreshProvider request. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderPreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/refreshProvider", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RefreshProviderSender sends the RefreshProvider request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderSender(req *http.Request) (future ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RefreshProviderResponder handles the response to the RefreshProvider request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationstorageclassificationmappings.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationstorageclassificationmappings.go new file mode 100644 index 000000000000..edff0938f488 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationstorageclassificationmappings.go @@ -0,0 +1,517 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationStorageClassificationMappingsClient is the client for the ReplicationStorageClassificationMappings +// methods of the Siterecovery service. +type ReplicationStorageClassificationMappingsClient struct { + BaseClient +} + +// NewReplicationStorageClassificationMappingsClient creates an instance of the +// ReplicationStorageClassificationMappingsClient client. +func NewReplicationStorageClassificationMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationMappingsClient { + return NewReplicationStorageClassificationMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationStorageClassificationMappingsClientWithBaseURI creates an instance of the +// ReplicationStorageClassificationMappingsClient client using a custom endpoint. Use this when interacting with an +// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationStorageClassificationMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationMappingsClient { + return ReplicationStorageClassificationMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +// pairingInput - pairing input. +func (client ReplicationStorageClassificationMappingsClient) Create(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput StorageClassificationMappingInput) (result ReplicationStorageClassificationMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName, pairingInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationStorageClassificationMappingsClient) CreatePreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput StorageClassificationMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithJSON(pairingInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) CreateSender(req *http.Request) (future ReplicationStorageClassificationMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) CreateResponder(resp *http.Response) (result StorageClassificationMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +func (client ReplicationStorageClassificationMappingsClient) Delete(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result ReplicationStorageClassificationMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationStorageClassificationMappingsClient) DeletePreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) DeleteSender(req *http.Request) (future ReplicationStorageClassificationMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the specified storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +func (client ReplicationStorageClassificationMappingsClient) Get(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result StorageClassificationMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationStorageClassificationMappingsClient) GetPreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) GetResponder(resp *http.Response) (result StorageClassificationMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the storage classification mappings in the vault. +func (client ReplicationStorageClassificationMappingsClient) List(ctx context.Context) (result StorageClassificationMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.List") + defer func() { + sc := -1 + if result.scmc.Response.Response != nil { + sc = result.scmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.scmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", resp, "Failure sending request") + return + } + + result.scmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.scmc.hasNextLink() && result.scmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationStorageClassificationMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationStorageClassificationMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) ListResponder(resp *http.Response) (result StorageClassificationMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationMappingsClient) listNextResults(ctx context.Context, lastResults StorageClassificationMappingCollection) (result StorageClassificationMappingCollection, err error) { + req, err := lastResults.storageClassificationMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationMappingsClient) ListComplete(ctx context.Context) (result StorageClassificationMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationStorageClassifications lists the storage classification mappings for the fabric. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassifications(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassificationMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.ListByReplicationStorageClassifications") + defer func() { + sc := -1 + if result.scmc.Response.Response != nil { + sc = result.scmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationStorageClassificationsNextResults + req, err := client.ListByReplicationStorageClassificationsPreparer(ctx, fabricName, storageClassificationName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationStorageClassificationsSender(req) + if err != nil { + result.scmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", resp, "Failure sending request") + return + } + + result.scmc, err = client.ListByReplicationStorageClassificationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", resp, "Failure responding to request") + return + } + if result.scmc.hasNextLink() && result.scmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationStorageClassificationsPreparer prepares the ListByReplicationStorageClassifications request. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsPreparer(ctx context.Context, fabricName string, storageClassificationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationStorageClassificationsSender sends the ListByReplicationStorageClassifications request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationStorageClassificationsResponder handles the response to the ListByReplicationStorageClassifications request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsResponder(resp *http.Response) (result StorageClassificationMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationStorageClassificationsNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationMappingsClient) listByReplicationStorageClassificationsNextResults(ctx context.Context, lastResults StorageClassificationMappingCollection) (result StorageClassificationMappingCollection, err error) { + req, err := lastResults.storageClassificationMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationStorageClassificationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationStorageClassificationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationStorageClassificationsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsComplete(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassificationMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.ListByReplicationStorageClassifications") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationStorageClassifications(ctx, fabricName, storageClassificationName) + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationstorageclassifications.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationstorageclassifications.go new file mode 100644 index 000000000000..36406dacdbf8 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationstorageclassifications.go @@ -0,0 +1,345 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationStorageClassificationsClient is the client for the ReplicationStorageClassifications methods of the +// Siterecovery service. +type ReplicationStorageClassificationsClient struct { + BaseClient +} + +// NewReplicationStorageClassificationsClient creates an instance of the ReplicationStorageClassificationsClient +// client. +func NewReplicationStorageClassificationsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationsClient { + return NewReplicationStorageClassificationsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationStorageClassificationsClientWithBaseURI creates an instance of the +// ReplicationStorageClassificationsClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationStorageClassificationsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationsClient { + return ReplicationStorageClassificationsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of the specified storage classification. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +func (client ReplicationStorageClassificationsClient) Get(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassification, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, storageClassificationName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationStorageClassificationsClient) GetPreparer(ctx context.Context, fabricName string, storageClassificationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) GetResponder(resp *http.Response) (result StorageClassification, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the storage classifications in the vault. +func (client ReplicationStorageClassificationsClient) List(ctx context.Context) (result StorageClassificationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.List") + defer func() { + sc := -1 + if result.scc.Response.Response != nil { + sc = result.scc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.scc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", resp, "Failure sending request") + return + } + + result.scc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", resp, "Failure responding to request") + return + } + if result.scc.hasNextLink() && result.scc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationStorageClassificationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationStorageClassifications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) ListResponder(resp *http.Response) (result StorageClassificationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationsClient) listNextResults(ctx context.Context, lastResults StorageClassificationCollection) (result StorageClassificationCollection, err error) { + req, err := lastResults.storageClassificationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationsClient) ListComplete(ctx context.Context) (result StorageClassificationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the storage classifications available in the specified fabric. +// Parameters: +// fabricName - site name of interest. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result StorageClassificationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.scc.Response.Response != nil { + sc = result.scc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.scc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.scc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.scc.hasNextLink() && result.scc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsResponder(resp *http.Response) (result StorageClassificationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationsClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults StorageClassificationCollection) (result StorageClassificationCollection, err error) { + req, err := lastResults.storageClassificationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result StorageClassificationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationvaulthealth.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationvaulthealth.go new file mode 100644 index 000000000000..5df6c67316fe --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationvaulthealth.go @@ -0,0 +1,181 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationVaultHealthClient is the client for the ReplicationVaultHealth methods of the Siterecovery service. +type ReplicationVaultHealthClient struct { + BaseClient +} + +// NewReplicationVaultHealthClient creates an instance of the ReplicationVaultHealthClient client. +func NewReplicationVaultHealthClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultHealthClient { + return NewReplicationVaultHealthClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationVaultHealthClientWithBaseURI creates an instance of the ReplicationVaultHealthClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewReplicationVaultHealthClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultHealthClient { + return ReplicationVaultHealthClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the health details of the vault. +func (client ReplicationVaultHealthClient) Get(ctx context.Context) (result VaultHealthDetails, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultHealthClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationVaultHealthClient) GetPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultHealthClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationVaultHealthClient) GetResponder(resp *http.Response) (result VaultHealthDetails, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Refresh sends the refresh request. +func (client ReplicationVaultHealthClient) Refresh(ctx context.Context) (result ReplicationVaultHealthRefreshFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultHealthClient.Refresh") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RefreshPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Refresh", nil, "Failure preparing request") + return + } + + result, err = client.RefreshSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Refresh", result.Response(), "Failure sending request") + return + } + + return +} + +// RefreshPreparer prepares the Refresh request. +func (client ReplicationVaultHealthClient) RefreshPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth/default/refresh", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RefreshSender sends the Refresh request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultHealthClient) RefreshSender(req *http.Request) (future ReplicationVaultHealthRefreshFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RefreshResponder handles the response to the Refresh request. The method always +// closes the http.Response Body. +func (client ReplicationVaultHealthClient) RefreshResponder(resp *http.Response) (result VaultHealthDetails, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationvaultsetting.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationvaultsetting.go new file mode 100644 index 000000000000..9c5567eec517 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationvaultsetting.go @@ -0,0 +1,312 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationVaultSettingClient is the client for the ReplicationVaultSetting methods of the Siterecovery service. +type ReplicationVaultSettingClient struct { + BaseClient +} + +// NewReplicationVaultSettingClient creates an instance of the ReplicationVaultSettingClient client. +func NewReplicationVaultSettingClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultSettingClient { + return NewReplicationVaultSettingClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationVaultSettingClientWithBaseURI creates an instance of the ReplicationVaultSettingClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewReplicationVaultSettingClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultSettingClient { + return ReplicationVaultSettingClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to configure vault setting. +// Parameters: +// vaultSettingName - vault setting name. +// input - vault setting creation input. +func (client ReplicationVaultSettingClient) Create(ctx context.Context, vaultSettingName string, input VaultSettingCreationInput) (result ReplicationVaultSettingCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationVaultSettingClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, vaultSettingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationVaultSettingClient) CreatePreparer(ctx context.Context, vaultSettingName string, input VaultSettingCreationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultSettingName": autorest.Encode("path", vaultSettingName), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) CreateSender(req *http.Request) (future ReplicationVaultSettingCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) CreateResponder(resp *http.Response) (result VaultSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the vault setting. This includes the Migration Hub connection settings. +// Parameters: +// vaultSettingName - vault setting name. +func (client ReplicationVaultSettingClient) Get(ctx context.Context, vaultSettingName string) (result VaultSetting, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, vaultSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationVaultSettingClient) GetPreparer(ctx context.Context, vaultSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultSettingName": autorest.Encode("path", vaultSettingName), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) GetResponder(resp *http.Response) (result VaultSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of vault setting. This includes the Migration Hub connection settings. +func (client ReplicationVaultSettingClient) List(ctx context.Context) (result VaultSettingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.List") + defer func() { + sc := -1 + if result.vsc.Response.Response != nil { + sc = result.vsc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vsc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", resp, "Failure sending request") + return + } + + result.vsc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", resp, "Failure responding to request") + return + } + if result.vsc.hasNextLink() && result.vsc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationVaultSettingClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) ListResponder(resp *http.Response) (result VaultSettingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationVaultSettingClient) listNextResults(ctx context.Context, lastResults VaultSettingCollection) (result VaultSettingCollection, err error) { + req, err := lastResults.vaultSettingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationVaultSettingClient) ListComplete(ctx context.Context) (result VaultSettingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationvcenters.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationvcenters.go new file mode 100644 index 000000000000..b3167d5a8202 --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/replicationvcenters.go @@ -0,0 +1,591 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationvCentersClient is the client for the ReplicationvCenters methods of the Siterecovery service. +type ReplicationvCentersClient struct { + BaseClient +} + +// NewReplicationvCentersClient creates an instance of the ReplicationvCentersClient client. +func NewReplicationvCentersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationvCentersClient { + return NewReplicationvCentersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationvCentersClientWithBaseURI creates an instance of the ReplicationvCentersClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationvCentersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationvCentersClient { + return ReplicationvCentersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a vCenter object.. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +// addVCenterRequest - the input to the add vCenter operation. +func (client ReplicationvCentersClient) Create(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest) (result ReplicationvCentersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, vcenterName, addVCenterRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationvCentersClient) CreatePreparer(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithJSON(addVCenterRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) CreateSender(req *http.Request) (future ReplicationvCentersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) CreateResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to remove(unregister) a registered vCenter server from the vault. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +func (client ReplicationvCentersClient) Delete(ctx context.Context, fabricName string, vcenterName string) (result ReplicationvCentersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, vcenterName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationvCentersClient) DeletePreparer(ctx context.Context, fabricName string, vcenterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) DeleteSender(req *http.Request) (future ReplicationvCentersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a registered vCenter server(Add vCenter server). +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +func (client ReplicationvCentersClient) Get(ctx context.Context, fabricName string, vcenterName string) (result VCenter, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, vcenterName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationvCentersClient) GetPreparer(ctx context.Context, fabricName string, vcenterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) GetResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the vCenter servers registered in the vault. +func (client ReplicationvCentersClient) List(ctx context.Context) (result VCenterCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.List") + defer func() { + sc := -1 + if result.vcc.Response.Response != nil { + sc = result.vcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", resp, "Failure sending request") + return + } + + result.vcc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", resp, "Failure responding to request") + return + } + if result.vcc.hasNextLink() && result.vcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationvCentersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationvCenters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) ListResponder(resp *http.Response) (result VCenterCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationvCentersClient) listNextResults(ctx context.Context, lastResults VCenterCollection) (result VCenterCollection, err error) { + req, err := lastResults.vCenterCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationvCentersClient) ListComplete(ctx context.Context) (result VCenterCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the vCenter servers registered in a fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationvCentersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result VCenterCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.vcc.Response.Response != nil { + sc = result.vcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.vcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.vcc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.vcc.hasNextLink() && result.vcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationvCentersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) ListByReplicationFabricsResponder(resp *http.Response) (result VCenterCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationvCentersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults VCenterCollection) (result VCenterCollection, err error) { + req, err := lastResults.vCenterCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationvCentersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result VCenterCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// Update the operation to update a registered vCenter. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +// updateVCenterRequest - the input to the update vCenter operation. +func (client ReplicationvCentersClient) Update(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest) (result ReplicationvCentersUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, vcenterName, updateVCenterRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationvCentersClient) UpdatePreparer(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithJSON(updateVCenterRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) UpdateSender(req *http.Request) (future ReplicationvCentersUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) UpdateResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/siterecoveryapi/interfaces.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/siterecoveryapi/interfaces.go new file mode 100644 index 000000000000..3ee976b297df --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/siterecoveryapi/interfaces.go @@ -0,0 +1,350 @@ +package siterecoveryapi + +// 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. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/siterecovery" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result siterecovery.OperationsDiscoveryCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.OperationsDiscoveryCollectionIterator, err error) +} + +var _ OperationsClientAPI = (*siterecovery.OperationsClient)(nil) + +// ReplicationAlertSettingsClientAPI contains the set of methods on the ReplicationAlertSettingsClient type. +type ReplicationAlertSettingsClientAPI interface { + Create(ctx context.Context, alertSettingName string, request siterecovery.ConfigureAlertRequest) (result siterecovery.Alert, err error) + Get(ctx context.Context, alertSettingName string) (result siterecovery.Alert, err error) + List(ctx context.Context) (result siterecovery.AlertCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.AlertCollectionIterator, err error) +} + +var _ ReplicationAlertSettingsClientAPI = (*siterecovery.ReplicationAlertSettingsClient)(nil) + +// ReplicationAppliancesClientAPI contains the set of methods on the ReplicationAppliancesClient type. +type ReplicationAppliancesClientAPI interface { + List(ctx context.Context, filter string) (result siterecovery.ApplianceCollectionPage, err error) + ListComplete(ctx context.Context, filter string) (result siterecovery.ApplianceCollectionIterator, err error) +} + +var _ ReplicationAppliancesClientAPI = (*siterecovery.ReplicationAppliancesClient)(nil) + +// ReplicationEligibilityResultsClientAPI contains the set of methods on the ReplicationEligibilityResultsClient type. +type ReplicationEligibilityResultsClientAPI interface { + Get(ctx context.Context, virtualMachineName string) (result siterecovery.ReplicationEligibilityResults, err error) + List(ctx context.Context, virtualMachineName string) (result siterecovery.ReplicationEligibilityResultsCollection, err error) +} + +var _ ReplicationEligibilityResultsClientAPI = (*siterecovery.ReplicationEligibilityResultsClient)(nil) + +// ReplicationEventsClientAPI contains the set of methods on the ReplicationEventsClient type. +type ReplicationEventsClientAPI interface { + Get(ctx context.Context, eventName string) (result siterecovery.Event, err error) + List(ctx context.Context, filter string) (result siterecovery.EventCollectionPage, err error) + ListComplete(ctx context.Context, filter string) (result siterecovery.EventCollectionIterator, err error) +} + +var _ ReplicationEventsClientAPI = (*siterecovery.ReplicationEventsClient)(nil) + +// ReplicationFabricsClientAPI contains the set of methods on the ReplicationFabricsClient type. +type ReplicationFabricsClientAPI interface { + CheckConsistency(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsCheckConsistencyFuture, err error) + Create(ctx context.Context, fabricName string, input siterecovery.FabricCreationInput) (result siterecovery.ReplicationFabricsCreateFuture, err error) + Delete(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, filter string) (result siterecovery.Fabric, err error) + List(ctx context.Context) (result siterecovery.FabricCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.FabricCollectionIterator, err error) + MigrateToAad(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsMigrateToAadFuture, err error) + Purge(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsPurgeFuture, err error) + ReassociateGateway(ctx context.Context, fabricName string, failoverProcessServerRequest siterecovery.FailoverProcessServerRequest) (result siterecovery.ReplicationFabricsReassociateGatewayFuture, err error) + RenewCertificate(ctx context.Context, fabricName string, renewCertificate siterecovery.RenewCertificateInput) (result siterecovery.ReplicationFabricsRenewCertificateFuture, err error) +} + +var _ ReplicationFabricsClientAPI = (*siterecovery.ReplicationFabricsClient)(nil) + +// ReplicationLogicalNetworksClientAPI contains the set of methods on the ReplicationLogicalNetworksClient type. +type ReplicationLogicalNetworksClientAPI interface { + Get(ctx context.Context, fabricName string, logicalNetworkName string) (result siterecovery.LogicalNetwork, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.LogicalNetworkCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.LogicalNetworkCollectionIterator, err error) +} + +var _ ReplicationLogicalNetworksClientAPI = (*siterecovery.ReplicationLogicalNetworksClient)(nil) + +// ReplicationNetworksClientAPI contains the set of methods on the ReplicationNetworksClient type. +type ReplicationNetworksClientAPI interface { + Get(ctx context.Context, fabricName string, networkName string) (result siterecovery.Network, err error) + List(ctx context.Context) (result siterecovery.NetworkCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.NetworkCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.NetworkCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.NetworkCollectionIterator, err error) +} + +var _ ReplicationNetworksClientAPI = (*siterecovery.ReplicationNetworksClient)(nil) + +// ReplicationNetworkMappingsClientAPI contains the set of methods on the ReplicationNetworkMappingsClient type. +type ReplicationNetworkMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, networkName string, networkMappingName string, input siterecovery.CreateNetworkMappingInput) (result siterecovery.ReplicationNetworkMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result siterecovery.ReplicationNetworkMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result siterecovery.NetworkMapping, err error) + List(ctx context.Context) (result siterecovery.NetworkMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.NetworkMappingCollectionIterator, err error) + ListByReplicationNetworks(ctx context.Context, fabricName string, networkName string) (result siterecovery.NetworkMappingCollectionPage, err error) + ListByReplicationNetworksComplete(ctx context.Context, fabricName string, networkName string) (result siterecovery.NetworkMappingCollectionIterator, err error) + Update(ctx context.Context, fabricName string, networkName string, networkMappingName string, input siterecovery.UpdateNetworkMappingInput) (result siterecovery.ReplicationNetworkMappingsUpdateFuture, err error) +} + +var _ ReplicationNetworkMappingsClientAPI = (*siterecovery.ReplicationNetworkMappingsClient)(nil) + +// ReplicationProtectionContainersClientAPI contains the set of methods on the ReplicationProtectionContainersClient type. +type ReplicationProtectionContainersClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, creationInput siterecovery.CreateProtectionContainerInput) (result siterecovery.ReplicationProtectionContainersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectionContainersDeleteFuture, err error) + DiscoverProtectableItem(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest siterecovery.DiscoverProtectableItemRequest) (result siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainer, err error) + List(ctx context.Context) (result siterecovery.ProtectionContainerCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.ProtectionContainerCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.ProtectionContainerCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.ProtectionContainerCollectionIterator, err error) + SwitchProtection(ctx context.Context, fabricName string, protectionContainerName string, switchInput siterecovery.SwitchProtectionInput) (result siterecovery.ReplicationProtectionContainersSwitchProtectionFuture, err error) +} + +var _ ReplicationProtectionContainersClientAPI = (*siterecovery.ReplicationProtectionContainersClient)(nil) + +// ReplicationMigrationItemsClientAPI contains the set of methods on the ReplicationMigrationItemsClient type. +type ReplicationMigrationItemsClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.EnableMigrationInput) (result siterecovery.ReplicationMigrationItemsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (result siterecovery.ReplicationMigrationItemsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationItem, err error) + List(ctx context.Context, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionIterator, err error) + Migrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput siterecovery.MigrateInput) (result siterecovery.ReplicationMigrationItemsMigrateFuture, err error) + Resync(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.ResyncInput) (result siterecovery.ReplicationMigrationItemsResyncFuture, err error) + TestMigrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput siterecovery.TestMigrateInput) (result siterecovery.ReplicationMigrationItemsTestMigrateFuture, err error) + TestMigrateCleanup(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput siterecovery.TestMigrateCleanupInput) (result siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.UpdateMigrationItemInput) (result siterecovery.ReplicationMigrationItemsUpdateFuture, err error) +} + +var _ ReplicationMigrationItemsClientAPI = (*siterecovery.ReplicationMigrationItemsClient)(nil) + +// MigrationRecoveryPointsClientAPI contains the set of methods on the MigrationRecoveryPointsClient type. +type MigrationRecoveryPointsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (result siterecovery.MigrationRecoveryPoint, err error) + ListByReplicationMigrationItems(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationRecoveryPointCollectionPage, err error) + ListByReplicationMigrationItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationRecoveryPointCollectionIterator, err error) +} + +var _ MigrationRecoveryPointsClientAPI = (*siterecovery.MigrationRecoveryPointsClient)(nil) + +// ReplicationProtectableItemsClientAPI contains the set of methods on the ReplicationProtectableItemsClient type. +type ReplicationProtectableItemsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (result siterecovery.ProtectableItem, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result siterecovery.ProtectableItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result siterecovery.ProtectableItemCollectionIterator, err error) +} + +var _ ReplicationProtectableItemsClientAPI = (*siterecovery.ReplicationProtectableItemsClient)(nil) + +// ReplicationProtectedItemsClientAPI contains the set of methods on the ReplicationProtectedItemsClient type. +type ReplicationProtectedItemsClientAPI interface { + AddDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput siterecovery.AddDisksInput) (result siterecovery.ReplicationProtectedItemsAddDisksFuture, err error) + ApplyRecoveryPoint(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput siterecovery.ApplyRecoveryPointInput) (result siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture, err error) + Create(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input siterecovery.EnableProtectionInput) (result siterecovery.ReplicationProtectedItemsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput siterecovery.DisableProtectionInput) (result siterecovery.ReplicationProtectedItemsDeleteFuture, err error) + FailoverCancel(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsFailoverCancelFuture, err error) + FailoverCommit(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsFailoverCommitFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItem, err error) + List(ctx context.Context, skipToken string, filter string) (result siterecovery.ReplicationProtectedItemCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, filter string) (result siterecovery.ReplicationProtectedItemCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectedItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectedItemCollectionIterator, err error) + PlannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput siterecovery.PlannedFailoverInput) (result siterecovery.ReplicationProtectedItemsPlannedFailoverFuture, err error) + Purge(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsPurgeFuture, err error) + RemoveDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput siterecovery.RemoveDisksInput) (result siterecovery.ReplicationProtectedItemsRemoveDisksFuture, err error) + RepairReplication(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsRepairReplicationFuture, err error) + Reprotect(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput siterecovery.ReverseReplicationInput) (result siterecovery.ReplicationProtectedItemsReprotectFuture, err error) + ResolveHealthErrors(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput siterecovery.ResolveHealthInput) (result siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture, err error) + SwitchProvider(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, switchProviderInput siterecovery.SwitchProviderInput) (result siterecovery.ReplicationProtectedItemsSwitchProviderFuture, err error) + TestFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput siterecovery.TestFailoverInput) (result siterecovery.ReplicationProtectedItemsTestFailoverFuture, err error) + TestFailoverCleanup(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput siterecovery.TestFailoverCleanupInput) (result siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture, err error) + UnplannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput siterecovery.UnplannedFailoverInput) (result siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput siterecovery.UpdateReplicationProtectedItemInput) (result siterecovery.ReplicationProtectedItemsUpdateFuture, err error) + UpdateAppliance(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput siterecovery.UpdateApplianceForReplicationProtectedItemInput) (result siterecovery.ReplicationProtectedItemsUpdateApplianceFuture, err error) + UpdateMobilityService(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest siterecovery.UpdateMobilityServiceRequest) (result siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) +} + +var _ ReplicationProtectedItemsClientAPI = (*siterecovery.ReplicationProtectedItemsClient)(nil) + +// RecoveryPointsClientAPI contains the set of methods on the RecoveryPointsClient type. +type RecoveryPointsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (result siterecovery.RecoveryPoint, err error) + ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.RecoveryPointCollectionPage, err error) + ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.RecoveryPointCollectionIterator, err error) +} + +var _ RecoveryPointsClientAPI = (*siterecovery.RecoveryPointsClient)(nil) + +// TargetComputeSizesClientAPI contains the set of methods on the TargetComputeSizesClient type. +type TargetComputeSizesClientAPI interface { + ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.TargetComputeSizeCollectionPage, err error) + ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.TargetComputeSizeCollectionIterator, err error) +} + +var _ TargetComputeSizesClientAPI = (*siterecovery.TargetComputeSizesClient)(nil) + +// ReplicationProtectionContainerMappingsClientAPI contains the set of methods on the ReplicationProtectionContainerMappingsClient type. +type ReplicationProtectionContainerMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput siterecovery.CreateProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput siterecovery.RemoveProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result siterecovery.ProtectionContainerMapping, err error) + List(ctx context.Context) (result siterecovery.ProtectionContainerMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.ProtectionContainerMappingCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainerMappingCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainerMappingCollectionIterator, err error) + Purge(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result siterecovery.ReplicationProtectionContainerMappingsPurgeFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput siterecovery.UpdateProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsUpdateFuture, err error) +} + +var _ ReplicationProtectionContainerMappingsClientAPI = (*siterecovery.ReplicationProtectionContainerMappingsClient)(nil) + +// ReplicationRecoveryServicesProvidersClientAPI contains the set of methods on the ReplicationRecoveryServicesProvidersClient type. +type ReplicationRecoveryServicesProvidersClientAPI interface { + Create(ctx context.Context, fabricName string, providerName string, addProviderInput siterecovery.AddRecoveryServicesProviderInput) (result siterecovery.ReplicationRecoveryServicesProvidersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture, err error) + Get(ctx context.Context, fabricName string, providerName string) (result siterecovery.RecoveryServicesProvider, err error) + List(ctx context.Context) (result siterecovery.RecoveryServicesProviderCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.RecoveryServicesProviderCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.RecoveryServicesProviderCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.RecoveryServicesProviderCollectionIterator, err error) + Purge(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture, err error) + RefreshProvider(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) +} + +var _ ReplicationRecoveryServicesProvidersClientAPI = (*siterecovery.ReplicationRecoveryServicesProvidersClient)(nil) + +// ReplicationStorageClassificationsClientAPI contains the set of methods on the ReplicationStorageClassificationsClient type. +type ReplicationStorageClassificationsClientAPI interface { + Get(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassification, err error) + List(ctx context.Context) (result siterecovery.StorageClassificationCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.StorageClassificationCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.StorageClassificationCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.StorageClassificationCollectionIterator, err error) +} + +var _ ReplicationStorageClassificationsClientAPI = (*siterecovery.ReplicationStorageClassificationsClient)(nil) + +// ReplicationStorageClassificationMappingsClientAPI contains the set of methods on the ReplicationStorageClassificationMappingsClient type. +type ReplicationStorageClassificationMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput siterecovery.StorageClassificationMappingInput) (result siterecovery.ReplicationStorageClassificationMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result siterecovery.ReplicationStorageClassificationMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result siterecovery.StorageClassificationMapping, err error) + List(ctx context.Context) (result siterecovery.StorageClassificationMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.StorageClassificationMappingCollectionIterator, err error) + ListByReplicationStorageClassifications(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassificationMappingCollectionPage, err error) + ListByReplicationStorageClassificationsComplete(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassificationMappingCollectionIterator, err error) +} + +var _ ReplicationStorageClassificationMappingsClientAPI = (*siterecovery.ReplicationStorageClassificationMappingsClient)(nil) + +// ReplicationvCentersClientAPI contains the set of methods on the ReplicationvCentersClient type. +type ReplicationvCentersClientAPI interface { + Create(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest siterecovery.AddVCenterRequest) (result siterecovery.ReplicationvCentersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, vcenterName string) (result siterecovery.ReplicationvCentersDeleteFuture, err error) + Get(ctx context.Context, fabricName string, vcenterName string) (result siterecovery.VCenter, err error) + List(ctx context.Context) (result siterecovery.VCenterCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.VCenterCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.VCenterCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.VCenterCollectionIterator, err error) + Update(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest siterecovery.UpdateVCenterRequest) (result siterecovery.ReplicationvCentersUpdateFuture, err error) +} + +var _ ReplicationvCentersClientAPI = (*siterecovery.ReplicationvCentersClient)(nil) + +// ReplicationJobsClientAPI contains the set of methods on the ReplicationJobsClient type. +type ReplicationJobsClientAPI interface { + Cancel(ctx context.Context, jobName string) (result siterecovery.ReplicationJobsCancelFuture, err error) + Export(ctx context.Context, jobQueryParameter siterecovery.JobQueryParameter) (result siterecovery.ReplicationJobsExportFuture, err error) + Get(ctx context.Context, jobName string) (result siterecovery.Job, err error) + List(ctx context.Context, filter string) (result siterecovery.JobCollectionPage, err error) + ListComplete(ctx context.Context, filter string) (result siterecovery.JobCollectionIterator, err error) + Restart(ctx context.Context, jobName string) (result siterecovery.ReplicationJobsRestartFuture, err error) + Resume(ctx context.Context, jobName string, resumeJobParams siterecovery.ResumeJobParams) (result siterecovery.ReplicationJobsResumeFuture, err error) +} + +var _ ReplicationJobsClientAPI = (*siterecovery.ReplicationJobsClient)(nil) + +// ReplicationPoliciesClientAPI contains the set of methods on the ReplicationPoliciesClient type. +type ReplicationPoliciesClientAPI interface { + Create(ctx context.Context, policyName string, input siterecovery.CreatePolicyInput) (result siterecovery.ReplicationPoliciesCreateFuture, err error) + Delete(ctx context.Context, policyName string) (result siterecovery.ReplicationPoliciesDeleteFuture, err error) + Get(ctx context.Context, policyName string) (result siterecovery.Policy, err error) + List(ctx context.Context) (result siterecovery.PolicyCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.PolicyCollectionIterator, err error) + Update(ctx context.Context, policyName string, input siterecovery.UpdatePolicyInput) (result siterecovery.ReplicationPoliciesUpdateFuture, err error) +} + +var _ ReplicationPoliciesClientAPI = (*siterecovery.ReplicationPoliciesClient)(nil) + +// ReplicationProtectionIntentsClientAPI contains the set of methods on the ReplicationProtectionIntentsClient type. +type ReplicationProtectionIntentsClientAPI interface { + Create(ctx context.Context, intentObjectName string, input siterecovery.CreateProtectionIntentInput) (result siterecovery.ReplicationProtectionIntent, err error) + Get(ctx context.Context, intentObjectName string) (result siterecovery.ReplicationProtectionIntent, err error) + List(ctx context.Context, skipToken string, takeToken string) (result siterecovery.ReplicationProtectionIntentCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, takeToken string) (result siterecovery.ReplicationProtectionIntentCollectionIterator, err error) +} + +var _ ReplicationProtectionIntentsClientAPI = (*siterecovery.ReplicationProtectionIntentsClient)(nil) + +// ReplicationRecoveryPlansClientAPI contains the set of methods on the ReplicationRecoveryPlansClient type. +type ReplicationRecoveryPlansClientAPI interface { + Create(ctx context.Context, recoveryPlanName string, input siterecovery.CreateRecoveryPlanInput) (result siterecovery.ReplicationRecoveryPlansCreateFuture, err error) + Delete(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansDeleteFuture, err error) + FailoverCancel(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansFailoverCancelFuture, err error) + FailoverCommit(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansFailoverCommitFuture, err error) + Get(ctx context.Context, recoveryPlanName string) (result siterecovery.RecoveryPlan, err error) + List(ctx context.Context) (result siterecovery.RecoveryPlanCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.RecoveryPlanCollectionIterator, err error) + PlannedFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanPlannedFailoverInput) (result siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture, err error) + Reprotect(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansReprotectFuture, err error) + TestFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanTestFailoverInput) (result siterecovery.ReplicationRecoveryPlansTestFailoverFuture, err error) + TestFailoverCleanup(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanTestFailoverCleanupInput) (result siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) + UnplannedFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanUnplannedFailoverInput) (result siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture, err error) + Update(ctx context.Context, recoveryPlanName string, input siterecovery.UpdateRecoveryPlanInput) (result siterecovery.ReplicationRecoveryPlansUpdateFuture, err error) +} + +var _ ReplicationRecoveryPlansClientAPI = (*siterecovery.ReplicationRecoveryPlansClient)(nil) + +// SupportedOperatingSystemsClientAPI contains the set of methods on the SupportedOperatingSystemsClient type. +type SupportedOperatingSystemsClientAPI interface { + Get(ctx context.Context, instanceType string) (result siterecovery.SupportedOperatingSystems, err error) +} + +var _ SupportedOperatingSystemsClientAPI = (*siterecovery.SupportedOperatingSystemsClient)(nil) + +// ReplicationVaultHealthClientAPI contains the set of methods on the ReplicationVaultHealthClient type. +type ReplicationVaultHealthClientAPI interface { + Get(ctx context.Context) (result siterecovery.VaultHealthDetails, err error) + Refresh(ctx context.Context) (result siterecovery.ReplicationVaultHealthRefreshFuture, err error) +} + +var _ ReplicationVaultHealthClientAPI = (*siterecovery.ReplicationVaultHealthClient)(nil) + +// ReplicationVaultSettingClientAPI contains the set of methods on the ReplicationVaultSettingClient type. +type ReplicationVaultSettingClientAPI interface { + Create(ctx context.Context, vaultSettingName string, input siterecovery.VaultSettingCreationInput) (result siterecovery.ReplicationVaultSettingCreateFuture, err error) + Get(ctx context.Context, vaultSettingName string) (result siterecovery.VaultSetting, err error) + List(ctx context.Context) (result siterecovery.VaultSettingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.VaultSettingCollectionIterator, err error) +} + +var _ ReplicationVaultSettingClientAPI = (*siterecovery.ReplicationVaultSettingClient)(nil) diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/supportedoperatingsystems.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/supportedoperatingsystems.go new file mode 100644 index 000000000000..e81baab27c2e --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/supportedoperatingsystems.go @@ -0,0 +1,110 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SupportedOperatingSystemsClient is the client for the SupportedOperatingSystems methods of the Siterecovery service. +type SupportedOperatingSystemsClient struct { + BaseClient +} + +// NewSupportedOperatingSystemsClient creates an instance of the SupportedOperatingSystemsClient client. +func NewSupportedOperatingSystemsClient(subscriptionID string, resourceGroupName string, resourceName string) SupportedOperatingSystemsClient { + return NewSupportedOperatingSystemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewSupportedOperatingSystemsClientWithBaseURI creates an instance of the SupportedOperatingSystemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewSupportedOperatingSystemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) SupportedOperatingSystemsClient { + return SupportedOperatingSystemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get sends the get request. +// Parameters: +// instanceType - the instance type. +func (client SupportedOperatingSystemsClient) Get(ctx context.Context, instanceType string) (result SupportedOperatingSystems, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SupportedOperatingSystemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, instanceType) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SupportedOperatingSystemsClient) GetPreparer(ctx context.Context, instanceType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(instanceType) > 0 { + queryParameters["instanceType"] = autorest.Encode("query", instanceType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationSupportedOperatingSystems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SupportedOperatingSystemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SupportedOperatingSystemsClient) GetResponder(resp *http.Response) (result SupportedOperatingSystems, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/targetcomputesizes.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/targetcomputesizes.go new file mode 100644 index 000000000000..a047e119790a --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/targetcomputesizes.go @@ -0,0 +1,154 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// TargetComputeSizesClient is the client for the TargetComputeSizes methods of the Siterecovery service. +type TargetComputeSizesClient struct { + BaseClient +} + +// NewTargetComputeSizesClient creates an instance of the TargetComputeSizesClient client. +func NewTargetComputeSizesClient(subscriptionID string, resourceGroupName string, resourceName string) TargetComputeSizesClient { + return NewTargetComputeSizesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewTargetComputeSizesClientWithBaseURI creates an instance of the TargetComputeSizesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewTargetComputeSizesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) TargetComputeSizesClient { + return TargetComputeSizesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// ListByReplicationProtectedItems lists the available target compute sizes for a replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client TargetComputeSizesClient) ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result TargetComputeSizeCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizesClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.tcsc.Response.Response != nil { + sc = result.tcsc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectedItemsNextResults + req, err := client.ListByReplicationProtectedItemsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.tcsc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", resp, "Failure sending request") + return + } + + result.tcsc, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", resp, "Failure responding to request") + return + } + if result.tcsc.hasNextLink() && result.tcsc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectedItemsPreparer prepares the ListByReplicationProtectedItems request. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/targetComputeSizes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectedItemsSender sends the ListByReplicationProtectedItems request. The method will close the +// http.Response Body if it receives an error. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectedItemsResponder handles the response to the ListByReplicationProtectedItems request. The method always +// closes the http.Response Body. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsResponder(resp *http.Response) (result TargetComputeSizeCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectedItemsNextResults retrieves the next set of results, if any. +func (client TargetComputeSizesClient) listByReplicationProtectedItemsNextResults(ctx context.Context, lastResults TargetComputeSizeCollection) (result TargetComputeSizeCollection, err error) { + req, err := lastResults.targetComputeSizeCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectedItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result TargetComputeSizeCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizesClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectedItems(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + return +} diff --git a/services/recoveryservices/mgmt/2021-12-01/siterecovery/version.go b/services/recoveryservices/mgmt/2021-12-01/siterecovery/version.go new file mode 100644 index 000000000000..88dcb3d9736e --- /dev/null +++ b/services/recoveryservices/mgmt/2021-12-01/siterecovery/version.go @@ -0,0 +1,19 @@ +package siterecovery + +import "github.com/Azure/azure-sdk-for-go/version" + +// 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. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " siterecovery/2021-12-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/CHANGELOG.md b/services/recoveryservices/mgmt/2022-01-01/siterecovery/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/_meta.json b/services/recoveryservices/mgmt/2022-01-01/siterecovery/_meta.json new file mode 100644 index 000000000000..4291bdb1a0d7 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "16f5f98c30852b877949ea63418f609233470bf7", + "readme": "/_/azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.md", + "tag": "package-2022-01", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2022-01 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/client.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/client.go new file mode 100644 index 000000000000..c54c3361f354 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/client.go @@ -0,0 +1,45 @@ +// Package siterecovery implements the Azure ARM Siterecovery service API version 2022-01-01. +// +// +package siterecovery + +// 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. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Siterecovery + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Siterecovery. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string + ResourceGroupName string + ResourceName string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string, resourceGroupName string, resourceName string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + ResourceGroupName: resourceGroupName, + ResourceName: resourceName, + } +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/enums.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/enums.go new file mode 100644 index 000000000000..80944d8b57f4 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/enums.go @@ -0,0 +1,1916 @@ +package siterecovery + +// 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. + +// A2ARecoveryAvailabilityType enumerates the values for a2a recovery availability type. +type A2ARecoveryAvailabilityType string + +const ( + // AvailabilitySet ... + AvailabilitySet A2ARecoveryAvailabilityType = "AvailabilitySet" + // AvailabilityZone ... + AvailabilityZone A2ARecoveryAvailabilityType = "AvailabilityZone" + // Single ... + Single A2ARecoveryAvailabilityType = "Single" +) + +// PossibleA2ARecoveryAvailabilityTypeValues returns an array of possible values for the A2ARecoveryAvailabilityType const type. +func PossibleA2ARecoveryAvailabilityTypeValues() []A2ARecoveryAvailabilityType { + return []A2ARecoveryAvailabilityType{AvailabilitySet, AvailabilityZone, Single} +} + +// A2ARpRecoveryPointType enumerates the values for a2a rp recovery point type. +type A2ARpRecoveryPointType string + +const ( + // Latest ... + Latest A2ARpRecoveryPointType = "Latest" + // LatestApplicationConsistent ... + LatestApplicationConsistent A2ARpRecoveryPointType = "LatestApplicationConsistent" + // LatestCrashConsistent ... + LatestCrashConsistent A2ARpRecoveryPointType = "LatestCrashConsistent" + // LatestProcessed ... + LatestProcessed A2ARpRecoveryPointType = "LatestProcessed" +) + +// PossibleA2ARpRecoveryPointTypeValues returns an array of possible values for the A2ARpRecoveryPointType const type. +func PossibleA2ARpRecoveryPointTypeValues() []A2ARpRecoveryPointType { + return []A2ARpRecoveryPointType{Latest, LatestApplicationConsistent, LatestCrashConsistent, LatestProcessed} +} + +// AgentAutoUpdateStatus enumerates the values for agent auto update status. +type AgentAutoUpdateStatus string + +const ( + // Disabled ... + Disabled AgentAutoUpdateStatus = "Disabled" + // Enabled ... + Enabled AgentAutoUpdateStatus = "Enabled" +) + +// PossibleAgentAutoUpdateStatusValues returns an array of possible values for the AgentAutoUpdateStatus const type. +func PossibleAgentAutoUpdateStatusValues() []AgentAutoUpdateStatus { + return []AgentAutoUpdateStatus{Disabled, Enabled} +} + +// AgentUpgradeBlockedReason enumerates the values for agent upgrade blocked reason. +type AgentUpgradeBlockedReason string + +const ( + // AgentNoHeartbeat ... + AgentNoHeartbeat AgentUpgradeBlockedReason = "AgentNoHeartbeat" + // AlreadyOnLatestVersion ... + AlreadyOnLatestVersion AgentUpgradeBlockedReason = "AlreadyOnLatestVersion" + // DistroIsNotReported ... + DistroIsNotReported AgentUpgradeBlockedReason = "DistroIsNotReported" + // DistroNotSupportedForUpgrade ... + DistroNotSupportedForUpgrade AgentUpgradeBlockedReason = "DistroNotSupportedForUpgrade" + // IncompatibleApplianceVersion ... + IncompatibleApplianceVersion AgentUpgradeBlockedReason = "IncompatibleApplianceVersion" + // InvalidAgentVersion ... + InvalidAgentVersion AgentUpgradeBlockedReason = "InvalidAgentVersion" + // InvalidDriverVersion ... + InvalidDriverVersion AgentUpgradeBlockedReason = "InvalidDriverVersion" + // MissingUpgradePath ... + MissingUpgradePath AgentUpgradeBlockedReason = "MissingUpgradePath" + // NotProtected ... + NotProtected AgentUpgradeBlockedReason = "NotProtected" + // ProcessServerNoHeartbeat ... + ProcessServerNoHeartbeat AgentUpgradeBlockedReason = "ProcessServerNoHeartbeat" + // RcmProxyNoHeartbeat ... + RcmProxyNoHeartbeat AgentUpgradeBlockedReason = "RcmProxyNoHeartbeat" + // RebootRequired ... + RebootRequired AgentUpgradeBlockedReason = "RebootRequired" + // Unknown ... + Unknown AgentUpgradeBlockedReason = "Unknown" + // UnsupportedProtectionScenario ... + UnsupportedProtectionScenario AgentUpgradeBlockedReason = "UnsupportedProtectionScenario" +) + +// PossibleAgentUpgradeBlockedReasonValues returns an array of possible values for the AgentUpgradeBlockedReason const type. +func PossibleAgentUpgradeBlockedReasonValues() []AgentUpgradeBlockedReason { + return []AgentUpgradeBlockedReason{AgentNoHeartbeat, AlreadyOnLatestVersion, DistroIsNotReported, DistroNotSupportedForUpgrade, IncompatibleApplianceVersion, InvalidAgentVersion, InvalidDriverVersion, MissingUpgradePath, NotProtected, ProcessServerNoHeartbeat, RcmProxyNoHeartbeat, RebootRequired, Unknown, UnsupportedProtectionScenario} +} + +// AgentVersionStatus enumerates the values for agent version status. +type AgentVersionStatus string + +const ( + // Deprecated ... + Deprecated AgentVersionStatus = "Deprecated" + // NotSupported ... + NotSupported AgentVersionStatus = "NotSupported" + // SecurityUpdateRequired ... + SecurityUpdateRequired AgentVersionStatus = "SecurityUpdateRequired" + // Supported ... + Supported AgentVersionStatus = "Supported" + // UpdateRequired ... + UpdateRequired AgentVersionStatus = "UpdateRequired" +) + +// PossibleAgentVersionStatusValues returns an array of possible values for the AgentVersionStatus const type. +func PossibleAgentVersionStatusValues() []AgentVersionStatus { + return []AgentVersionStatus{Deprecated, NotSupported, SecurityUpdateRequired, Supported, UpdateRequired} +} + +// AlternateLocationRecoveryOption enumerates the values for alternate location recovery option. +type AlternateLocationRecoveryOption string + +const ( + // CreateVMIfNotFound ... + CreateVMIfNotFound AlternateLocationRecoveryOption = "CreateVmIfNotFound" + // NoAction ... + NoAction AlternateLocationRecoveryOption = "NoAction" +) + +// PossibleAlternateLocationRecoveryOptionValues returns an array of possible values for the AlternateLocationRecoveryOption const type. +func PossibleAlternateLocationRecoveryOptionValues() []AlternateLocationRecoveryOption { + return []AlternateLocationRecoveryOption{CreateVMIfNotFound, NoAction} +} + +// AutomationAccountAuthenticationType enumerates the values for automation account authentication type. +type AutomationAccountAuthenticationType string + +const ( + // AutomationAccountAuthenticationTypeRunAsAccount ... + AutomationAccountAuthenticationTypeRunAsAccount AutomationAccountAuthenticationType = "RunAsAccount" + // AutomationAccountAuthenticationTypeSystemAssignedIdentity ... + AutomationAccountAuthenticationTypeSystemAssignedIdentity AutomationAccountAuthenticationType = "SystemAssignedIdentity" +) + +// PossibleAutomationAccountAuthenticationTypeValues returns an array of possible values for the AutomationAccountAuthenticationType const type. +func PossibleAutomationAccountAuthenticationTypeValues() []AutomationAccountAuthenticationType { + return []AutomationAccountAuthenticationType{AutomationAccountAuthenticationTypeRunAsAccount, AutomationAccountAuthenticationTypeSystemAssignedIdentity} +} + +// AutoProtectionOfDataDisk enumerates the values for auto protection of data disk. +type AutoProtectionOfDataDisk string + +const ( + // AutoProtectionOfDataDiskDisabled ... + AutoProtectionOfDataDiskDisabled AutoProtectionOfDataDisk = "Disabled" + // AutoProtectionOfDataDiskEnabled ... + AutoProtectionOfDataDiskEnabled AutoProtectionOfDataDisk = "Enabled" +) + +// PossibleAutoProtectionOfDataDiskValues returns an array of possible values for the AutoProtectionOfDataDisk const type. +func PossibleAutoProtectionOfDataDiskValues() []AutoProtectionOfDataDisk { + return []AutoProtectionOfDataDisk{AutoProtectionOfDataDiskDisabled, AutoProtectionOfDataDiskEnabled} +} + +// DataSyncStatus enumerates the values for data sync status. +type DataSyncStatus string + +const ( + // ForDownTime ... + ForDownTime DataSyncStatus = "ForDownTime" + // ForSynchronization ... + ForSynchronization DataSyncStatus = "ForSynchronization" +) + +// PossibleDataSyncStatusValues returns an array of possible values for the DataSyncStatus const type. +func PossibleDataSyncStatusValues() []DataSyncStatus { + return []DataSyncStatus{ForDownTime, ForSynchronization} +} + +// DisableProtectionReason enumerates the values for disable protection reason. +type DisableProtectionReason string + +const ( + // MigrationComplete ... + MigrationComplete DisableProtectionReason = "MigrationComplete" + // NotSpecified ... + NotSpecified DisableProtectionReason = "NotSpecified" +) + +// PossibleDisableProtectionReasonValues returns an array of possible values for the DisableProtectionReason const type. +func PossibleDisableProtectionReasonValues() []DisableProtectionReason { + return []DisableProtectionReason{MigrationComplete, NotSpecified} +} + +// DiskAccountType enumerates the values for disk account type. +type DiskAccountType string + +const ( + // PremiumLRS ... + PremiumLRS DiskAccountType = "Premium_LRS" + // StandardLRS ... + StandardLRS DiskAccountType = "Standard_LRS" + // StandardSSDLRS ... + StandardSSDLRS DiskAccountType = "StandardSSD_LRS" +) + +// PossibleDiskAccountTypeValues returns an array of possible values for the DiskAccountType const type. +func PossibleDiskAccountTypeValues() []DiskAccountType { + return []DiskAccountType{PremiumLRS, StandardLRS, StandardSSDLRS} +} + +// DiskReplicationProgressHealth enumerates the values for disk replication progress health. +type DiskReplicationProgressHealth string + +const ( + // InProgress ... + InProgress DiskReplicationProgressHealth = "InProgress" + // None ... + None DiskReplicationProgressHealth = "None" + // NoProgress ... + NoProgress DiskReplicationProgressHealth = "NoProgress" + // Queued ... + Queued DiskReplicationProgressHealth = "Queued" + // SlowProgress ... + SlowProgress DiskReplicationProgressHealth = "SlowProgress" +) + +// PossibleDiskReplicationProgressHealthValues returns an array of possible values for the DiskReplicationProgressHealth const type. +func PossibleDiskReplicationProgressHealthValues() []DiskReplicationProgressHealth { + return []DiskReplicationProgressHealth{InProgress, None, NoProgress, Queued, SlowProgress} +} + +// EthernetAddressType enumerates the values for ethernet address type. +type EthernetAddressType string + +const ( + // Dynamic ... + Dynamic EthernetAddressType = "Dynamic" + // Static ... + Static EthernetAddressType = "Static" +) + +// PossibleEthernetAddressTypeValues returns an array of possible values for the EthernetAddressType const type. +func PossibleEthernetAddressTypeValues() []EthernetAddressType { + return []EthernetAddressType{Dynamic, Static} +} + +// ExportJobOutputSerializationType enumerates the values for export job output serialization type. +type ExportJobOutputSerializationType string + +const ( + // Excel ... + Excel ExportJobOutputSerializationType = "Excel" + // JSON ... + JSON ExportJobOutputSerializationType = "Json" + // XML ... + XML ExportJobOutputSerializationType = "Xml" +) + +// PossibleExportJobOutputSerializationTypeValues returns an array of possible values for the ExportJobOutputSerializationType const type. +func PossibleExportJobOutputSerializationTypeValues() []ExportJobOutputSerializationType { + return []ExportJobOutputSerializationType{Excel, JSON, XML} +} + +// FailoverDeploymentModel enumerates the values for failover deployment model. +type FailoverDeploymentModel string + +const ( + // Classic ... + Classic FailoverDeploymentModel = "Classic" + // NotApplicable ... + NotApplicable FailoverDeploymentModel = "NotApplicable" + // ResourceManager ... + ResourceManager FailoverDeploymentModel = "ResourceManager" +) + +// PossibleFailoverDeploymentModelValues returns an array of possible values for the FailoverDeploymentModel const type. +func PossibleFailoverDeploymentModelValues() []FailoverDeploymentModel { + return []FailoverDeploymentModel{Classic, NotApplicable, ResourceManager} +} + +// HealthErrorCategory enumerates the values for health error category. +type HealthErrorCategory string + +const ( + // HealthErrorCategoryAgentAutoUpdateArtifactDeleted ... + HealthErrorCategoryAgentAutoUpdateArtifactDeleted HealthErrorCategory = "AgentAutoUpdateArtifactDeleted" + // HealthErrorCategoryAgentAutoUpdateInfra ... + HealthErrorCategoryAgentAutoUpdateInfra HealthErrorCategory = "AgentAutoUpdateInfra" + // HealthErrorCategoryAgentAutoUpdateRunAsAccount ... + HealthErrorCategoryAgentAutoUpdateRunAsAccount HealthErrorCategory = "AgentAutoUpdateRunAsAccount" + // HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired ... + HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired HealthErrorCategory = "AgentAutoUpdateRunAsAccountExpired" + // HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry ... + HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry HealthErrorCategory = "AgentAutoUpdateRunAsAccountExpiry" + // HealthErrorCategoryConfiguration ... + HealthErrorCategoryConfiguration HealthErrorCategory = "Configuration" + // HealthErrorCategoryFabricInfrastructure ... + HealthErrorCategoryFabricInfrastructure HealthErrorCategory = "FabricInfrastructure" + // HealthErrorCategoryNone ... + HealthErrorCategoryNone HealthErrorCategory = "None" + // HealthErrorCategoryReplication ... + HealthErrorCategoryReplication HealthErrorCategory = "Replication" + // HealthErrorCategoryTestFailover ... + HealthErrorCategoryTestFailover HealthErrorCategory = "TestFailover" + // HealthErrorCategoryVersionExpiry ... + HealthErrorCategoryVersionExpiry HealthErrorCategory = "VersionExpiry" +) + +// PossibleHealthErrorCategoryValues returns an array of possible values for the HealthErrorCategory const type. +func PossibleHealthErrorCategoryValues() []HealthErrorCategory { + return []HealthErrorCategory{HealthErrorCategoryAgentAutoUpdateArtifactDeleted, HealthErrorCategoryAgentAutoUpdateInfra, HealthErrorCategoryAgentAutoUpdateRunAsAccount, HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired, HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry, HealthErrorCategoryConfiguration, HealthErrorCategoryFabricInfrastructure, HealthErrorCategoryNone, HealthErrorCategoryReplication, HealthErrorCategoryTestFailover, HealthErrorCategoryVersionExpiry} +} + +// HealthErrorCustomerResolvability enumerates the values for health error customer resolvability. +type HealthErrorCustomerResolvability string + +const ( + // Allowed ... + Allowed HealthErrorCustomerResolvability = "Allowed" + // NotAllowed ... + NotAllowed HealthErrorCustomerResolvability = "NotAllowed" +) + +// PossibleHealthErrorCustomerResolvabilityValues returns an array of possible values for the HealthErrorCustomerResolvability const type. +func PossibleHealthErrorCustomerResolvabilityValues() []HealthErrorCustomerResolvability { + return []HealthErrorCustomerResolvability{Allowed, NotAllowed} +} + +// HyperVReplicaAzureRpRecoveryPointType enumerates the values for hyper v replica azure rp recovery point +// type. +type HyperVReplicaAzureRpRecoveryPointType string + +const ( + // HyperVReplicaAzureRpRecoveryPointTypeLatest ... + HyperVReplicaAzureRpRecoveryPointTypeLatest HyperVReplicaAzureRpRecoveryPointType = "Latest" + // HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent ... + HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent HyperVReplicaAzureRpRecoveryPointType = "LatestApplicationConsistent" + // HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed ... + HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed HyperVReplicaAzureRpRecoveryPointType = "LatestProcessed" +) + +// PossibleHyperVReplicaAzureRpRecoveryPointTypeValues returns an array of possible values for the HyperVReplicaAzureRpRecoveryPointType const type. +func PossibleHyperVReplicaAzureRpRecoveryPointTypeValues() []HyperVReplicaAzureRpRecoveryPointType { + return []HyperVReplicaAzureRpRecoveryPointType{HyperVReplicaAzureRpRecoveryPointTypeLatest, HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent, HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed} +} + +// InMageRcmFailbackRecoveryPointType enumerates the values for in mage rcm failback recovery point type. +type InMageRcmFailbackRecoveryPointType string + +const ( + // ApplicationConsistent ... + ApplicationConsistent InMageRcmFailbackRecoveryPointType = "ApplicationConsistent" + // CrashConsistent ... + CrashConsistent InMageRcmFailbackRecoveryPointType = "CrashConsistent" +) + +// PossibleInMageRcmFailbackRecoveryPointTypeValues returns an array of possible values for the InMageRcmFailbackRecoveryPointType const type. +func PossibleInMageRcmFailbackRecoveryPointTypeValues() []InMageRcmFailbackRecoveryPointType { + return []InMageRcmFailbackRecoveryPointType{ApplicationConsistent, CrashConsistent} +} + +// InMageV2RpRecoveryPointType enumerates the values for in mage v2 rp recovery point type. +type InMageV2RpRecoveryPointType string + +const ( + // InMageV2RpRecoveryPointTypeLatest ... + InMageV2RpRecoveryPointTypeLatest InMageV2RpRecoveryPointType = "Latest" + // InMageV2RpRecoveryPointTypeLatestApplicationConsistent ... + InMageV2RpRecoveryPointTypeLatestApplicationConsistent InMageV2RpRecoveryPointType = "LatestApplicationConsistent" + // InMageV2RpRecoveryPointTypeLatestCrashConsistent ... + InMageV2RpRecoveryPointTypeLatestCrashConsistent InMageV2RpRecoveryPointType = "LatestCrashConsistent" + // InMageV2RpRecoveryPointTypeLatestProcessed ... + InMageV2RpRecoveryPointTypeLatestProcessed InMageV2RpRecoveryPointType = "LatestProcessed" +) + +// PossibleInMageV2RpRecoveryPointTypeValues returns an array of possible values for the InMageV2RpRecoveryPointType const type. +func PossibleInMageV2RpRecoveryPointTypeValues() []InMageV2RpRecoveryPointType { + return []InMageV2RpRecoveryPointType{InMageV2RpRecoveryPointTypeLatest, InMageV2RpRecoveryPointTypeLatestApplicationConsistent, InMageV2RpRecoveryPointTypeLatestCrashConsistent, InMageV2RpRecoveryPointTypeLatestProcessed} +} + +// InstanceType enumerates the values for instance type. +type InstanceType string + +const ( + // InstanceTypeA2A ... + InstanceTypeA2A InstanceType = "A2A" + // InstanceTypeAddDisksProviderSpecificInput ... + InstanceTypeAddDisksProviderSpecificInput InstanceType = "AddDisksProviderSpecificInput" +) + +// PossibleInstanceTypeValues returns an array of possible values for the InstanceType const type. +func PossibleInstanceTypeValues() []InstanceType { + return []InstanceType{InstanceTypeA2A, InstanceTypeAddDisksProviderSpecificInput} +} + +// InstanceTypeBasicApplianceSpecificDetails enumerates the values for instance type basic appliance specific +// details. +type InstanceTypeBasicApplianceSpecificDetails string + +const ( + // InstanceTypeApplianceSpecificDetails ... + InstanceTypeApplianceSpecificDetails InstanceTypeBasicApplianceSpecificDetails = "ApplianceSpecificDetails" + // InstanceTypeInMageRcm ... + InstanceTypeInMageRcm InstanceTypeBasicApplianceSpecificDetails = "InMageRcm" +) + +// PossibleInstanceTypeBasicApplianceSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicApplianceSpecificDetails const type. +func PossibleInstanceTypeBasicApplianceSpecificDetailsValues() []InstanceTypeBasicApplianceSpecificDetails { + return []InstanceTypeBasicApplianceSpecificDetails{InstanceTypeApplianceSpecificDetails, InstanceTypeInMageRcm} +} + +// InstanceTypeBasicApplyRecoveryPointProviderSpecificInput enumerates the values for instance type basic apply +// recovery point provider specific input. +type InstanceTypeBasicApplyRecoveryPointProviderSpecificInput string + +const ( + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "A2A" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "ApplyRecoveryPointProviderSpecificInput" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "InMageRcm" +) + +// PossibleInstanceTypeBasicApplyRecoveryPointProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicApplyRecoveryPointProviderSpecificInput const type. +func PossibleInstanceTypeBasicApplyRecoveryPointProviderSpecificInputValues() []InstanceTypeBasicApplyRecoveryPointProviderSpecificInput { + return []InstanceTypeBasicApplyRecoveryPointProviderSpecificInput{InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm} +} + +// InstanceTypeBasicConfigurationSettings enumerates the values for instance type basic configuration settings. +type InstanceTypeBasicConfigurationSettings string + +const ( + // InstanceTypeConfigurationSettings ... + InstanceTypeConfigurationSettings InstanceTypeBasicConfigurationSettings = "ConfigurationSettings" + // InstanceTypeHyperVVirtualMachine ... + InstanceTypeHyperVVirtualMachine InstanceTypeBasicConfigurationSettings = "HyperVVirtualMachine" + // InstanceTypeReplicationGroupDetails ... + InstanceTypeReplicationGroupDetails InstanceTypeBasicConfigurationSettings = "ReplicationGroupDetails" + // InstanceTypeVmmVirtualMachine ... + InstanceTypeVmmVirtualMachine InstanceTypeBasicConfigurationSettings = "VmmVirtualMachine" + // InstanceTypeVMwareVirtualMachine ... + InstanceTypeVMwareVirtualMachine InstanceTypeBasicConfigurationSettings = "VMwareVirtualMachine" +) + +// PossibleInstanceTypeBasicConfigurationSettingsValues returns an array of possible values for the InstanceTypeBasicConfigurationSettings const type. +func PossibleInstanceTypeBasicConfigurationSettingsValues() []InstanceTypeBasicConfigurationSettings { + return []InstanceTypeBasicConfigurationSettings{InstanceTypeConfigurationSettings, InstanceTypeHyperVVirtualMachine, InstanceTypeReplicationGroupDetails, InstanceTypeVmmVirtualMachine, InstanceTypeVMwareVirtualMachine} +} + +// InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails enumerates the values for instance type basic +// create protection intent provider specific details. +type InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails string + +const ( + // InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails = "A2A" + // InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails ... + InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails = "CreateProtectionIntentProviderSpecificDetails" +) + +// PossibleInstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails const type. +func PossibleInstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsValues() []InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails { + return []InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails{InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails} +} + +// InstanceTypeBasicDisableProtectionProviderSpecificInput enumerates the values for instance type basic +// disable protection provider specific input. +type InstanceTypeBasicDisableProtectionProviderSpecificInput string + +const ( + // InstanceTypeDisableProtectionProviderSpecificInput ... + InstanceTypeDisableProtectionProviderSpecificInput InstanceTypeBasicDisableProtectionProviderSpecificInput = "DisableProtectionProviderSpecificInput" + // InstanceTypeInMage ... + InstanceTypeInMage InstanceTypeBasicDisableProtectionProviderSpecificInput = "InMage" +) + +// PossibleInstanceTypeBasicDisableProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicDisableProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicDisableProtectionProviderSpecificInputValues() []InstanceTypeBasicDisableProtectionProviderSpecificInput { + return []InstanceTypeBasicDisableProtectionProviderSpecificInput{InstanceTypeDisableProtectionProviderSpecificInput, InstanceTypeInMage} +} + +// InstanceTypeBasicEnableMigrationProviderSpecificInput enumerates the values for instance type basic enable +// migration provider specific input. +type InstanceTypeBasicEnableMigrationProviderSpecificInput string + +const ( + // InstanceTypeEnableMigrationProviderSpecificInput ... + InstanceTypeEnableMigrationProviderSpecificInput InstanceTypeBasicEnableMigrationProviderSpecificInput = "EnableMigrationProviderSpecificInput" + // InstanceTypeVMwareCbt ... + InstanceTypeVMwareCbt InstanceTypeBasicEnableMigrationProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicEnableMigrationProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicEnableMigrationProviderSpecificInput const type. +func PossibleInstanceTypeBasicEnableMigrationProviderSpecificInputValues() []InstanceTypeBasicEnableMigrationProviderSpecificInput { + return []InstanceTypeBasicEnableMigrationProviderSpecificInput{InstanceTypeEnableMigrationProviderSpecificInput, InstanceTypeVMwareCbt} +} + +// InstanceTypeBasicEnableProtectionProviderSpecificInput enumerates the values for instance type basic enable +// protection provider specific input. +type InstanceTypeBasicEnableProtectionProviderSpecificInput string + +const ( + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A InstanceTypeBasicEnableProtectionProviderSpecificInput = "A2A" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicEnableProtectionProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput InstanceTypeBasicEnableProtectionProviderSpecificInput = "EnableProtectionProviderSpecificInput" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicEnableProtectionProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMage" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMageRcm" +) + +// PossibleInstanceTypeBasicEnableProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicEnableProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicEnableProtectionProviderSpecificInputValues() []InstanceTypeBasicEnableProtectionProviderSpecificInput { + return []InstanceTypeBasicEnableProtectionProviderSpecificInput{InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm} +} + +// InstanceTypeBasicEventProviderSpecificDetails enumerates the values for instance type basic event provider +// specific details. +type InstanceTypeBasicEventProviderSpecificDetails string + +const ( + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicEventProviderSpecificDetails = "A2A" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails InstanceTypeBasicEventProviderSpecificDetails = "EventProviderSpecificDetails" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplica2012" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplica2012R2" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplicaAzure" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplicaBaseEventDetails" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicEventProviderSpecificDetails = "InMageAzureV2" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicEventProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback InstanceTypeBasicEventProviderSpecificDetails = "InMageRcmFailback" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicEventProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicEventProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicEventProviderSpecificDetails const type. +func PossibleInstanceTypeBasicEventProviderSpecificDetailsValues() []InstanceTypeBasicEventProviderSpecificDetails { + return []InstanceTypeBasicEventProviderSpecificDetails{InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicEventSpecificDetails enumerates the values for instance type basic event specific details. +type InstanceTypeBasicEventSpecificDetails string + +const ( + // InstanceTypeEventSpecificDetails ... + InstanceTypeEventSpecificDetails InstanceTypeBasicEventSpecificDetails = "EventSpecificDetails" + // InstanceTypeJobStatus ... + InstanceTypeJobStatus InstanceTypeBasicEventSpecificDetails = "JobStatus" +) + +// PossibleInstanceTypeBasicEventSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicEventSpecificDetails const type. +func PossibleInstanceTypeBasicEventSpecificDetailsValues() []InstanceTypeBasicEventSpecificDetails { + return []InstanceTypeBasicEventSpecificDetails{InstanceTypeEventSpecificDetails, InstanceTypeJobStatus} +} + +// InstanceTypeBasicFabricSpecificCreateNetworkMappingInput enumerates the values for instance type basic +// fabric specific create network mapping input. +type InstanceTypeBasicFabricSpecificCreateNetworkMappingInput string + +const ( + // InstanceTypeAzureToAzure ... + InstanceTypeAzureToAzure InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "AzureToAzure" + // InstanceTypeFabricSpecificCreateNetworkMappingInput ... + InstanceTypeFabricSpecificCreateNetworkMappingInput InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "FabricSpecificCreateNetworkMappingInput" + // InstanceTypeVmmToAzure ... + InstanceTypeVmmToAzure InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "VmmToAzure" + // InstanceTypeVmmToVmm ... + InstanceTypeVmmToVmm InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "VmmToVmm" +) + +// PossibleInstanceTypeBasicFabricSpecificCreateNetworkMappingInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificCreateNetworkMappingInput const type. +func PossibleInstanceTypeBasicFabricSpecificCreateNetworkMappingInputValues() []InstanceTypeBasicFabricSpecificCreateNetworkMappingInput { + return []InstanceTypeBasicFabricSpecificCreateNetworkMappingInput{InstanceTypeAzureToAzure, InstanceTypeFabricSpecificCreateNetworkMappingInput, InstanceTypeVmmToAzure, InstanceTypeVmmToVmm} +} + +// InstanceTypeBasicFabricSpecificCreationInput enumerates the values for instance type basic fabric specific +// creation input. +type InstanceTypeBasicFabricSpecificCreationInput string + +const ( + // InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure ... + InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure InstanceTypeBasicFabricSpecificCreationInput = "Azure" + // InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput ... + InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput InstanceTypeBasicFabricSpecificCreationInput = "FabricSpecificCreationInput" + // InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm ... + InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm InstanceTypeBasicFabricSpecificCreationInput = "InMageRcm" + // InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2 ... + InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2 InstanceTypeBasicFabricSpecificCreationInput = "VMwareV2" +) + +// PossibleInstanceTypeBasicFabricSpecificCreationInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificCreationInput const type. +func PossibleInstanceTypeBasicFabricSpecificCreationInputValues() []InstanceTypeBasicFabricSpecificCreationInput { + return []InstanceTypeBasicFabricSpecificCreationInput{InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure, InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput, InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm, InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2} +} + +// InstanceTypeBasicFabricSpecificDetails enumerates the values for instance type basic fabric specific +// details. +type InstanceTypeBasicFabricSpecificDetails string + +const ( + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure InstanceTypeBasicFabricSpecificDetails = "Azure" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails InstanceTypeBasicFabricSpecificDetails = "FabricSpecificDetails" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite InstanceTypeBasicFabricSpecificDetails = "HyperVSite" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicFabricSpecificDetails = "InMageRcm" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM InstanceTypeBasicFabricSpecificDetails = "VMM" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware InstanceTypeBasicFabricSpecificDetails = "VMware" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 InstanceTypeBasicFabricSpecificDetails = "VMwareV2" +) + +// PossibleInstanceTypeBasicFabricSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicFabricSpecificDetails const type. +func PossibleInstanceTypeBasicFabricSpecificDetailsValues() []InstanceTypeBasicFabricSpecificDetails { + return []InstanceTypeBasicFabricSpecificDetails{InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure, InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails, InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite, InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2} +} + +// InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput enumerates the values for instance type basic +// fabric specific update network mapping input. +type InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput string + +const ( + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "AzureToAzure" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "FabricSpecificUpdateNetworkMappingInput" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "VmmToAzure" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "VmmToVmm" +) + +// PossibleInstanceTypeBasicFabricSpecificUpdateNetworkMappingInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput const type. +func PossibleInstanceTypeBasicFabricSpecificUpdateNetworkMappingInputValues() []InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput { + return []InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput{InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm} +} + +// InstanceTypeBasicGroupTaskDetails enumerates the values for instance type basic group task details. +type InstanceTypeBasicGroupTaskDetails string + +const ( + // InstanceTypeGroupTaskDetails ... + InstanceTypeGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "GroupTaskDetails" + // InstanceTypeInlineWorkflowTaskDetails ... + InstanceTypeInlineWorkflowTaskDetails InstanceTypeBasicGroupTaskDetails = "InlineWorkflowTaskDetails" + // InstanceTypeRecoveryPlanGroupTaskDetails ... + InstanceTypeRecoveryPlanGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "RecoveryPlanGroupTaskDetails" + // InstanceTypeRecoveryPlanShutdownGroupTaskDetails ... + InstanceTypeRecoveryPlanShutdownGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "RecoveryPlanShutdownGroupTaskDetails" +) + +// PossibleInstanceTypeBasicGroupTaskDetailsValues returns an array of possible values for the InstanceTypeBasicGroupTaskDetails const type. +func PossibleInstanceTypeBasicGroupTaskDetailsValues() []InstanceTypeBasicGroupTaskDetails { + return []InstanceTypeBasicGroupTaskDetails{InstanceTypeGroupTaskDetails, InstanceTypeInlineWorkflowTaskDetails, InstanceTypeRecoveryPlanGroupTaskDetails, InstanceTypeRecoveryPlanShutdownGroupTaskDetails} +} + +// InstanceTypeBasicJobDetails enumerates the values for instance type basic job details. +type InstanceTypeBasicJobDetails string + +const ( + // InstanceTypeAsrJobDetails ... + InstanceTypeAsrJobDetails InstanceTypeBasicJobDetails = "AsrJobDetails" + // InstanceTypeExportJobDetails ... + InstanceTypeExportJobDetails InstanceTypeBasicJobDetails = "ExportJobDetails" + // InstanceTypeFailoverJobDetails ... + InstanceTypeFailoverJobDetails InstanceTypeBasicJobDetails = "FailoverJobDetails" + // InstanceTypeJobDetails ... + InstanceTypeJobDetails InstanceTypeBasicJobDetails = "JobDetails" + // InstanceTypeSwitchProtectionJobDetails ... + InstanceTypeSwitchProtectionJobDetails InstanceTypeBasicJobDetails = "SwitchProtectionJobDetails" + // InstanceTypeTestFailoverJobDetails ... + InstanceTypeTestFailoverJobDetails InstanceTypeBasicJobDetails = "TestFailoverJobDetails" +) + +// PossibleInstanceTypeBasicJobDetailsValues returns an array of possible values for the InstanceTypeBasicJobDetails const type. +func PossibleInstanceTypeBasicJobDetailsValues() []InstanceTypeBasicJobDetails { + return []InstanceTypeBasicJobDetails{InstanceTypeAsrJobDetails, InstanceTypeExportJobDetails, InstanceTypeFailoverJobDetails, InstanceTypeJobDetails, InstanceTypeSwitchProtectionJobDetails, InstanceTypeTestFailoverJobDetails} +} + +// InstanceTypeBasicMigrateProviderSpecificInput enumerates the values for instance type basic migrate provider +// specific input. +type InstanceTypeBasicMigrateProviderSpecificInput string + +const ( + // InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput ... + InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput InstanceTypeBasicMigrateProviderSpecificInput = "MigrateProviderSpecificInput" + // InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicMigrateProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicMigrateProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicMigrateProviderSpecificInput const type. +func PossibleInstanceTypeBasicMigrateProviderSpecificInputValues() []InstanceTypeBasicMigrateProviderSpecificInput { + return []InstanceTypeBasicMigrateProviderSpecificInput{InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput, InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicMigrationProviderSpecificSettings enumerates the values for instance type basic migration +// provider specific settings. +type InstanceTypeBasicMigrationProviderSpecificSettings string + +const ( + // InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings ... + InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings InstanceTypeBasicMigrationProviderSpecificSettings = "MigrationProviderSpecificSettings" + // InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt ... + InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt InstanceTypeBasicMigrationProviderSpecificSettings = "VMwareCbt" +) + +// PossibleInstanceTypeBasicMigrationProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicMigrationProviderSpecificSettings const type. +func PossibleInstanceTypeBasicMigrationProviderSpecificSettingsValues() []InstanceTypeBasicMigrationProviderSpecificSettings { + return []InstanceTypeBasicMigrationProviderSpecificSettings{InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings, InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicNetworkMappingFabricSpecificSettings enumerates the values for instance type basic network +// mapping fabric specific settings. +type InstanceTypeBasicNetworkMappingFabricSpecificSettings string + +const ( + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure InstanceTypeBasicNetworkMappingFabricSpecificSettings = "AzureToAzure" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings InstanceTypeBasicNetworkMappingFabricSpecificSettings = "NetworkMappingFabricSpecificSettings" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure InstanceTypeBasicNetworkMappingFabricSpecificSettings = "VmmToAzure" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm InstanceTypeBasicNetworkMappingFabricSpecificSettings = "VmmToVmm" +) + +// PossibleInstanceTypeBasicNetworkMappingFabricSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicNetworkMappingFabricSpecificSettings const type. +func PossibleInstanceTypeBasicNetworkMappingFabricSpecificSettingsValues() []InstanceTypeBasicNetworkMappingFabricSpecificSettings { + return []InstanceTypeBasicNetworkMappingFabricSpecificSettings{InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm} +} + +// InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput enumerates the values for instance type basic +// planned failover provider specific failover input. +type InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput string + +const ( + // InstanceTypeHyperVReplicaAzure ... + InstanceTypeHyperVReplicaAzure InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "HyperVReplicaAzure" + // InstanceTypeHyperVReplicaAzureFailback ... + InstanceTypeHyperVReplicaAzureFailback InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "HyperVReplicaAzureFailback" + // InstanceTypeInMageRcmFailback ... + InstanceTypeInMageRcmFailback InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "InMageRcmFailback" + // InstanceTypePlannedFailoverProviderSpecificFailoverInput ... + InstanceTypePlannedFailoverProviderSpecificFailoverInput InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "PlannedFailoverProviderSpecificFailoverInput" +) + +// PossibleInstanceTypeBasicPlannedFailoverProviderSpecificFailoverInputValues returns an array of possible values for the InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput const type. +func PossibleInstanceTypeBasicPlannedFailoverProviderSpecificFailoverInputValues() []InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput { + return []InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput{InstanceTypeHyperVReplicaAzure, InstanceTypeHyperVReplicaAzureFailback, InstanceTypeInMageRcmFailback, InstanceTypePlannedFailoverProviderSpecificFailoverInput} +} + +// InstanceTypeBasicPolicyProviderSpecificDetails enumerates the values for instance type basic policy provider +// specific details. +type InstanceTypeBasicPolicyProviderSpecificDetails string + +const ( + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicPolicyProviderSpecificDetails = "A2A" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplica2012" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplica2012R2" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplicaAzure" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplicaBasePolicyDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage InstanceTypeBasicPolicyProviderSpecificDetails = "InMage" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicPolicyProviderSpecificDetails = "InMageAzureV2" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails InstanceTypeBasicPolicyProviderSpecificDetails = "InMageBasePolicyDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicPolicyProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback InstanceTypeBasicPolicyProviderSpecificDetails = "InMageRcmFailback" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails InstanceTypeBasicPolicyProviderSpecificDetails = "PolicyProviderSpecificDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicPolicyProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicPolicyProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicPolicyProviderSpecificDetails const type. +func PossibleInstanceTypeBasicPolicyProviderSpecificDetailsValues() []InstanceTypeBasicPolicyProviderSpecificDetails { + return []InstanceTypeBasicPolicyProviderSpecificDetails{InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicPolicyProviderSpecificInput enumerates the values for instance type basic policy provider +// specific input. +type InstanceTypeBasicPolicyProviderSpecificInput string + +const ( + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A InstanceTypeBasicPolicyProviderSpecificInput = "A2A" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicPolicyProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplica2012" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplica2012R2" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage InstanceTypeBasicPolicyProviderSpecificInput = "InMage" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicPolicyProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicPolicyProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback InstanceTypeBasicPolicyProviderSpecificInput = "InMageRcmFailback" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput InstanceTypeBasicPolicyProviderSpecificInput = "PolicyProviderSpecificInput" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicPolicyProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicPolicyProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicPolicyProviderSpecificInput const type. +func PossibleInstanceTypeBasicPolicyProviderSpecificInputValues() []InstanceTypeBasicPolicyProviderSpecificInput { + return []InstanceTypeBasicPolicyProviderSpecificInput{InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails enumerates the values for instance type +// basic protection container mapping provider specific details. +type InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails string + +const ( + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "A2A" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "ProtectionContainerMappingProviderSpecificDetails" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails const type. +func PossibleInstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsValues() []InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails { + return []InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails{InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicProviderSpecificRecoveryPointDetails enumerates the values for instance type basic provider +// specific recovery point details. +type InstanceTypeBasicProviderSpecificRecoveryPointDetails string + +const ( + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A InstanceTypeBasicProviderSpecificRecoveryPointDetails = "A2A" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicProviderSpecificRecoveryPointDetails = "InMageAzureV2" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm InstanceTypeBasicProviderSpecificRecoveryPointDetails = "InMageRcm" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails InstanceTypeBasicProviderSpecificRecoveryPointDetails = "ProviderSpecificRecoveryPointDetails" +) + +// PossibleInstanceTypeBasicProviderSpecificRecoveryPointDetailsValues returns an array of possible values for the InstanceTypeBasicProviderSpecificRecoveryPointDetails const type. +func PossibleInstanceTypeBasicProviderSpecificRecoveryPointDetailsValues() []InstanceTypeBasicProviderSpecificRecoveryPointDetails { + return []InstanceTypeBasicProviderSpecificRecoveryPointDetails{InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails} +} + +// InstanceTypeBasicRecoveryPlanActionDetails enumerates the values for instance type basic recovery plan +// action details. +type InstanceTypeBasicRecoveryPlanActionDetails string + +const ( + // InstanceTypeAutomationRunbookActionDetails ... + InstanceTypeAutomationRunbookActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "AutomationRunbookActionDetails" + // InstanceTypeManualActionDetails ... + InstanceTypeManualActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "ManualActionDetails" + // InstanceTypeRecoveryPlanActionDetails ... + InstanceTypeRecoveryPlanActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "RecoveryPlanActionDetails" + // InstanceTypeScriptActionDetails ... + InstanceTypeScriptActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "ScriptActionDetails" +) + +// PossibleInstanceTypeBasicRecoveryPlanActionDetailsValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanActionDetails const type. +func PossibleInstanceTypeBasicRecoveryPlanActionDetailsValues() []InstanceTypeBasicRecoveryPlanActionDetails { + return []InstanceTypeBasicRecoveryPlanActionDetails{InstanceTypeAutomationRunbookActionDetails, InstanceTypeManualActionDetails, InstanceTypeRecoveryPlanActionDetails, InstanceTypeScriptActionDetails} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificDetails enumerates the values for instance type basic recovery +// plan provider specific details. +type InstanceTypeBasicRecoveryPlanProviderSpecificDetails string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificDetails = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails ... + InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails InstanceTypeBasicRecoveryPlanProviderSpecificDetails = "RecoveryPlanProviderSpecificDetails" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificDetails const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificDetailsValues() []InstanceTypeBasicRecoveryPlanProviderSpecificDetails { + return []InstanceTypeBasicRecoveryPlanProviderSpecificDetails{InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput enumerates the values for instance type basic +// recovery plan provider specific failover input. +type InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "HyperVReplicaAzure" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "HyperVReplicaAzureFailback" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMage" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageAzureV2" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageRcm" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageRcmFailback" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "RecoveryPlanProviderSpecificFailoverInput" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputValues() []InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput { + return []InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput{InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificInput enumerates the values for instance type basic recovery +// plan provider specific input. +type InstanceTypeBasicRecoveryPlanProviderSpecificInput string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificInput = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput ... + InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput InstanceTypeBasicRecoveryPlanProviderSpecificInput = "RecoveryPlanProviderSpecificInput" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificInput const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificInputValues() []InstanceTypeBasicRecoveryPlanProviderSpecificInput { + return []InstanceTypeBasicRecoveryPlanProviderSpecificInput{InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput} +} + +// InstanceTypeBasicRemoveDisksProviderSpecificInput enumerates the values for instance type basic remove disks +// provider specific input. +type InstanceTypeBasicRemoveDisksProviderSpecificInput string + +const ( + // InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A InstanceTypeBasicRemoveDisksProviderSpecificInput = "A2A" + // InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput ... + InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput InstanceTypeBasicRemoveDisksProviderSpecificInput = "RemoveDisksProviderSpecificInput" +) + +// PossibleInstanceTypeBasicRemoveDisksProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicRemoveDisksProviderSpecificInput const type. +func PossibleInstanceTypeBasicRemoveDisksProviderSpecificInputValues() []InstanceTypeBasicRemoveDisksProviderSpecificInput { + return []InstanceTypeBasicRemoveDisksProviderSpecificInput{InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput} +} + +// InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings enumerates the values for instance type +// basic replication protection intent provider specific settings. +type InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings string + +const ( + // InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A ... + InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings = "A2A" + // InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings ... + InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings = "ReplicationProtectionIntentProviderSpecificSettings" +) + +// PossibleInstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings const type. +func PossibleInstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsValues() []InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings { + return []InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings{InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A, InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings} +} + +// InstanceTypeBasicReplicationProviderSpecificContainerCreationInput enumerates the values for instance type +// basic replication provider specific container creation input. +type InstanceTypeBasicReplicationProviderSpecificContainerCreationInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "A2ACrossClusterMigration" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "ReplicationProviderSpecificContainerCreationInput" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificContainerCreationInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificContainerCreationInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificContainerCreationInputValues() []InstanceTypeBasicReplicationProviderSpecificContainerCreationInput { + return []InstanceTypeBasicReplicationProviderSpecificContainerCreationInput{InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReplicationProviderSpecificContainerMappingInput enumerates the values for instance type +// basic replication provider specific container mapping input. +type InstanceTypeBasicReplicationProviderSpecificContainerMappingInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "ReplicationProviderSpecificContainerMappingInput" + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificContainerMappingInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificContainerMappingInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificContainerMappingInputValues() []InstanceTypeBasicReplicationProviderSpecificContainerMappingInput { + return []InstanceTypeBasicReplicationProviderSpecificContainerMappingInput{InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput, InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReplicationProviderSpecificSettings enumerates the values for instance type basic +// replication provider specific settings. +type InstanceTypeBasicReplicationProviderSpecificSettings string + +const ( + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificSettings = "A2A" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration InstanceTypeBasicReplicationProviderSpecificSettings = "A2ACrossClusterMigration" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplica2012" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplica2012R2" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplicaAzure" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplicaBaseReplicationDetails" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage InstanceTypeBasicReplicationProviderSpecificSettings = "InMage" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 InstanceTypeBasicReplicationProviderSpecificSettings = "InMageAzureV2" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm InstanceTypeBasicReplicationProviderSpecificSettings = "InMageRcm" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback InstanceTypeBasicReplicationProviderSpecificSettings = "InMageRcmFailback" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings InstanceTypeBasicReplicationProviderSpecificSettings = "ReplicationProviderSpecificSettings" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificSettings const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificSettingsValues() []InstanceTypeBasicReplicationProviderSpecificSettings { + return []InstanceTypeBasicReplicationProviderSpecificSettings{InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings} +} + +// InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput enumerates the values for instance +// type basic replication provider specific update container mapping input. +type InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "InMageRcm" + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "ReplicationProviderSpecificUpdateContainerMappingInput" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputValues() []InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput { + return []InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput{InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm, InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput} +} + +// InstanceTypeBasicResyncProviderSpecificInput enumerates the values for instance type basic resync provider +// specific input. +type InstanceTypeBasicResyncProviderSpecificInput string + +const ( + // InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput ... + InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput InstanceTypeBasicResyncProviderSpecificInput = "ResyncProviderSpecificInput" + // InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicResyncProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicResyncProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicResyncProviderSpecificInput const type. +func PossibleInstanceTypeBasicResyncProviderSpecificInputValues() []InstanceTypeBasicResyncProviderSpecificInput { + return []InstanceTypeBasicResyncProviderSpecificInput{InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput, InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReverseReplicationProviderSpecificInput enumerates the values for instance type basic +// reverse replication provider specific input. +type InstanceTypeBasicReverseReplicationProviderSpecificInput string + +const ( + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A InstanceTypeBasicReverseReplicationProviderSpecificInput = "A2A" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicReverseReplicationProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMage" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageRcmFailback" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput InstanceTypeBasicReverseReplicationProviderSpecificInput = "ReverseReplicationProviderSpecificInput" +) + +// PossibleInstanceTypeBasicReverseReplicationProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicReverseReplicationProviderSpecificInput const type. +func PossibleInstanceTypeBasicReverseReplicationProviderSpecificInputValues() []InstanceTypeBasicReverseReplicationProviderSpecificInput { + return []InstanceTypeBasicReverseReplicationProviderSpecificInput{InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput} +} + +// InstanceTypeBasicSwitchProtectionProviderSpecificInput enumerates the values for instance type basic switch +// protection provider specific input. +type InstanceTypeBasicSwitchProtectionProviderSpecificInput string + +const ( + // InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A InstanceTypeBasicSwitchProtectionProviderSpecificInput = "A2A" + // InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput ... + InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput InstanceTypeBasicSwitchProtectionProviderSpecificInput = "SwitchProtectionProviderSpecificInput" +) + +// PossibleInstanceTypeBasicSwitchProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicSwitchProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicSwitchProtectionProviderSpecificInputValues() []InstanceTypeBasicSwitchProtectionProviderSpecificInput { + return []InstanceTypeBasicSwitchProtectionProviderSpecificInput{InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput} +} + +// InstanceTypeBasicSwitchProviderProviderSpecificInput enumerates the values for instance type basic switch +// provider provider specific input. +type InstanceTypeBasicSwitchProviderProviderSpecificInput string + +const ( + // InstanceTypeInMageAzureV2 ... + InstanceTypeInMageAzureV2 InstanceTypeBasicSwitchProviderProviderSpecificInput = "InMageAzureV2" + // InstanceTypeSwitchProviderProviderSpecificInput ... + InstanceTypeSwitchProviderProviderSpecificInput InstanceTypeBasicSwitchProviderProviderSpecificInput = "SwitchProviderProviderSpecificInput" +) + +// PossibleInstanceTypeBasicSwitchProviderProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicSwitchProviderProviderSpecificInput const type. +func PossibleInstanceTypeBasicSwitchProviderProviderSpecificInputValues() []InstanceTypeBasicSwitchProviderProviderSpecificInput { + return []InstanceTypeBasicSwitchProviderProviderSpecificInput{InstanceTypeInMageAzureV2, InstanceTypeSwitchProviderProviderSpecificInput} +} + +// InstanceTypeBasicTaskTypeDetails enumerates the values for instance type basic task type details. +type InstanceTypeBasicTaskTypeDetails string + +const ( + // InstanceTypeAutomationRunbookTaskDetails ... + InstanceTypeAutomationRunbookTaskDetails InstanceTypeBasicTaskTypeDetails = "AutomationRunbookTaskDetails" + // InstanceTypeConsistencyCheckTaskDetails ... + InstanceTypeConsistencyCheckTaskDetails InstanceTypeBasicTaskTypeDetails = "ConsistencyCheckTaskDetails" + // InstanceTypeFabricReplicationGroupTaskDetails ... + InstanceTypeFabricReplicationGroupTaskDetails InstanceTypeBasicTaskTypeDetails = "FabricReplicationGroupTaskDetails" + // InstanceTypeJobTaskDetails ... + InstanceTypeJobTaskDetails InstanceTypeBasicTaskTypeDetails = "JobTaskDetails" + // InstanceTypeManualActionTaskDetails ... + InstanceTypeManualActionTaskDetails InstanceTypeBasicTaskTypeDetails = "ManualActionTaskDetails" + // InstanceTypeScriptActionTaskDetails ... + InstanceTypeScriptActionTaskDetails InstanceTypeBasicTaskTypeDetails = "ScriptActionTaskDetails" + // InstanceTypeTaskTypeDetails ... + InstanceTypeTaskTypeDetails InstanceTypeBasicTaskTypeDetails = "TaskTypeDetails" + // InstanceTypeVirtualMachineTaskDetails ... + InstanceTypeVirtualMachineTaskDetails InstanceTypeBasicTaskTypeDetails = "VirtualMachineTaskDetails" + // InstanceTypeVMNicUpdatesTaskDetails ... + InstanceTypeVMNicUpdatesTaskDetails InstanceTypeBasicTaskTypeDetails = "VmNicUpdatesTaskDetails" +) + +// PossibleInstanceTypeBasicTaskTypeDetailsValues returns an array of possible values for the InstanceTypeBasicTaskTypeDetails const type. +func PossibleInstanceTypeBasicTaskTypeDetailsValues() []InstanceTypeBasicTaskTypeDetails { + return []InstanceTypeBasicTaskTypeDetails{InstanceTypeAutomationRunbookTaskDetails, InstanceTypeConsistencyCheckTaskDetails, InstanceTypeFabricReplicationGroupTaskDetails, InstanceTypeJobTaskDetails, InstanceTypeManualActionTaskDetails, InstanceTypeScriptActionTaskDetails, InstanceTypeTaskTypeDetails, InstanceTypeVirtualMachineTaskDetails, InstanceTypeVMNicUpdatesTaskDetails} +} + +// InstanceTypeBasicTestFailoverProviderSpecificInput enumerates the values for instance type basic test +// failover provider specific input. +type InstanceTypeBasicTestFailoverProviderSpecificInput string + +const ( + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A InstanceTypeBasicTestFailoverProviderSpecificInput = "A2A" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicTestFailoverProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage InstanceTypeBasicTestFailoverProviderSpecificInput = "InMage" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicTestFailoverProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicTestFailoverProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput InstanceTypeBasicTestFailoverProviderSpecificInput = "TestFailoverProviderSpecificInput" +) + +// PossibleInstanceTypeBasicTestFailoverProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicTestFailoverProviderSpecificInput const type. +func PossibleInstanceTypeBasicTestFailoverProviderSpecificInputValues() []InstanceTypeBasicTestFailoverProviderSpecificInput { + return []InstanceTypeBasicTestFailoverProviderSpecificInput{InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput} +} + +// InstanceTypeBasicTestMigrateProviderSpecificInput enumerates the values for instance type basic test migrate +// provider specific input. +type InstanceTypeBasicTestMigrateProviderSpecificInput string + +const ( + // InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput ... + InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput InstanceTypeBasicTestMigrateProviderSpecificInput = "TestMigrateProviderSpecificInput" + // InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicTestMigrateProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicTestMigrateProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicTestMigrateProviderSpecificInput const type. +func PossibleInstanceTypeBasicTestMigrateProviderSpecificInputValues() []InstanceTypeBasicTestMigrateProviderSpecificInput { + return []InstanceTypeBasicTestMigrateProviderSpecificInput{InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput, InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicUnplannedFailoverProviderSpecificInput enumerates the values for instance type basic +// unplanned failover provider specific input. +type InstanceTypeBasicUnplannedFailoverProviderSpecificInput string + +const ( + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "A2A" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMage" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "UnplannedFailoverProviderSpecificInput" +) + +// PossibleInstanceTypeBasicUnplannedFailoverProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUnplannedFailoverProviderSpecificInput const type. +func PossibleInstanceTypeBasicUnplannedFailoverProviderSpecificInputValues() []InstanceTypeBasicUnplannedFailoverProviderSpecificInput { + return []InstanceTypeBasicUnplannedFailoverProviderSpecificInput{InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput} +} + +// InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput enumerates the values for +// instance type basic update appliance for replication protected item provider specific input. +type InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput string + +const ( + // InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput ... + InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput = "UpdateApplianceForReplicationProtectedItemProviderSpecificInput" +) + +// PossibleInstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput const type. +func PossibleInstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputValues() []InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput { + return []InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput{InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput} +} + +// InstanceTypeBasicUpdateMigrationItemProviderSpecificInput enumerates the values for instance type basic +// update migration item provider specific input. +type InstanceTypeBasicUpdateMigrationItemProviderSpecificInput string + +const ( + // InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput ... + InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput InstanceTypeBasicUpdateMigrationItemProviderSpecificInput = "UpdateMigrationItemProviderSpecificInput" + // InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicUpdateMigrationItemProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicUpdateMigrationItemProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUpdateMigrationItemProviderSpecificInput const type. +func PossibleInstanceTypeBasicUpdateMigrationItemProviderSpecificInputValues() []InstanceTypeBasicUpdateMigrationItemProviderSpecificInput { + return []InstanceTypeBasicUpdateMigrationItemProviderSpecificInput{InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput, InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicUpdateReplicationProtectedItemProviderInput enumerates the values for instance type basic +// update replication protected item provider input. +type InstanceTypeBasicUpdateReplicationProtectedItemProviderInput string + +const ( + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "A2A" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "HyperVReplicaAzure" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "InMageAzureV2" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "InMageRcm" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "UpdateReplicationProtectedItemProviderInput" +) + +// PossibleInstanceTypeBasicUpdateReplicationProtectedItemProviderInputValues returns an array of possible values for the InstanceTypeBasicUpdateReplicationProtectedItemProviderInput const type. +func PossibleInstanceTypeBasicUpdateReplicationProtectedItemProviderInputValues() []InstanceTypeBasicUpdateReplicationProtectedItemProviderInput { + return []InstanceTypeBasicUpdateReplicationProtectedItemProviderInput{InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput} +} + +// LicenseType enumerates the values for license type. +type LicenseType string + +const ( + // LicenseTypeNoLicenseType ... + LicenseTypeNoLicenseType LicenseType = "NoLicenseType" + // LicenseTypeNotSpecified ... + LicenseTypeNotSpecified LicenseType = "NotSpecified" + // LicenseTypeWindowsServer ... + LicenseTypeWindowsServer LicenseType = "WindowsServer" +) + +// PossibleLicenseTypeValues returns an array of possible values for the LicenseType const type. +func PossibleLicenseTypeValues() []LicenseType { + return []LicenseType{LicenseTypeNoLicenseType, LicenseTypeNotSpecified, LicenseTypeWindowsServer} +} + +// MigrationItemOperation enumerates the values for migration item operation. +type MigrationItemOperation string + +const ( + // DisableMigration ... + DisableMigration MigrationItemOperation = "DisableMigration" + // Migrate ... + Migrate MigrationItemOperation = "Migrate" + // StartResync ... + StartResync MigrationItemOperation = "StartResync" + // TestMigrate ... + TestMigrate MigrationItemOperation = "TestMigrate" + // TestMigrateCleanup ... + TestMigrateCleanup MigrationItemOperation = "TestMigrateCleanup" +) + +// PossibleMigrationItemOperationValues returns an array of possible values for the MigrationItemOperation const type. +func PossibleMigrationItemOperationValues() []MigrationItemOperation { + return []MigrationItemOperation{DisableMigration, Migrate, StartResync, TestMigrate, TestMigrateCleanup} +} + +// MigrationRecoveryPointType enumerates the values for migration recovery point type. +type MigrationRecoveryPointType string + +const ( + // MigrationRecoveryPointTypeApplicationConsistent ... + MigrationRecoveryPointTypeApplicationConsistent MigrationRecoveryPointType = "ApplicationConsistent" + // MigrationRecoveryPointTypeCrashConsistent ... + MigrationRecoveryPointTypeCrashConsistent MigrationRecoveryPointType = "CrashConsistent" + // MigrationRecoveryPointTypeNotSpecified ... + MigrationRecoveryPointTypeNotSpecified MigrationRecoveryPointType = "NotSpecified" +) + +// PossibleMigrationRecoveryPointTypeValues returns an array of possible values for the MigrationRecoveryPointType const type. +func PossibleMigrationRecoveryPointTypeValues() []MigrationRecoveryPointType { + return []MigrationRecoveryPointType{MigrationRecoveryPointTypeApplicationConsistent, MigrationRecoveryPointTypeCrashConsistent, MigrationRecoveryPointTypeNotSpecified} +} + +// MigrationState enumerates the values for migration state. +type MigrationState string + +const ( + // MigrationStateDisableMigrationFailed ... + MigrationStateDisableMigrationFailed MigrationState = "DisableMigrationFailed" + // MigrationStateDisableMigrationInProgress ... + MigrationStateDisableMigrationInProgress MigrationState = "DisableMigrationInProgress" + // MigrationStateEnableMigrationFailed ... + MigrationStateEnableMigrationFailed MigrationState = "EnableMigrationFailed" + // MigrationStateEnableMigrationInProgress ... + MigrationStateEnableMigrationInProgress MigrationState = "EnableMigrationInProgress" + // MigrationStateInitialSeedingFailed ... + MigrationStateInitialSeedingFailed MigrationState = "InitialSeedingFailed" + // MigrationStateInitialSeedingInProgress ... + MigrationStateInitialSeedingInProgress MigrationState = "InitialSeedingInProgress" + // MigrationStateMigrationFailed ... + MigrationStateMigrationFailed MigrationState = "MigrationFailed" + // MigrationStateMigrationInProgress ... + MigrationStateMigrationInProgress MigrationState = "MigrationInProgress" + // MigrationStateMigrationSucceeded ... + MigrationStateMigrationSucceeded MigrationState = "MigrationSucceeded" + // MigrationStateNone ... + MigrationStateNone MigrationState = "None" + // MigrationStateReplicating ... + MigrationStateReplicating MigrationState = "Replicating" +) + +// PossibleMigrationStateValues returns an array of possible values for the MigrationState const type. +func PossibleMigrationStateValues() []MigrationState { + return []MigrationState{MigrationStateDisableMigrationFailed, MigrationStateDisableMigrationInProgress, MigrationStateEnableMigrationFailed, MigrationStateEnableMigrationInProgress, MigrationStateInitialSeedingFailed, MigrationStateInitialSeedingInProgress, MigrationStateMigrationFailed, MigrationStateMigrationInProgress, MigrationStateMigrationSucceeded, MigrationStateNone, MigrationStateReplicating} +} + +// MobilityAgentUpgradeState enumerates the values for mobility agent upgrade state. +type MobilityAgentUpgradeState string + +const ( + // MobilityAgentUpgradeStateCommit ... + MobilityAgentUpgradeStateCommit MobilityAgentUpgradeState = "Commit" + // MobilityAgentUpgradeStateCompleted ... + MobilityAgentUpgradeStateCompleted MobilityAgentUpgradeState = "Completed" + // MobilityAgentUpgradeStateNone ... + MobilityAgentUpgradeStateNone MobilityAgentUpgradeState = "None" + // MobilityAgentUpgradeStateStarted ... + MobilityAgentUpgradeStateStarted MobilityAgentUpgradeState = "Started" +) + +// PossibleMobilityAgentUpgradeStateValues returns an array of possible values for the MobilityAgentUpgradeState const type. +func PossibleMobilityAgentUpgradeStateValues() []MobilityAgentUpgradeState { + return []MobilityAgentUpgradeState{MobilityAgentUpgradeStateCommit, MobilityAgentUpgradeStateCompleted, MobilityAgentUpgradeStateNone, MobilityAgentUpgradeStateStarted} +} + +// MultiVMGroupCreateOption enumerates the values for multi vm group create option. +type MultiVMGroupCreateOption string + +const ( + // AutoCreated ... + AutoCreated MultiVMGroupCreateOption = "AutoCreated" + // UserSpecified ... + UserSpecified MultiVMGroupCreateOption = "UserSpecified" +) + +// PossibleMultiVMGroupCreateOptionValues returns an array of possible values for the MultiVMGroupCreateOption const type. +func PossibleMultiVMGroupCreateOptionValues() []MultiVMGroupCreateOption { + return []MultiVMGroupCreateOption{AutoCreated, UserSpecified} +} + +// MultiVMSyncPointOption enumerates the values for multi vm sync point option. +type MultiVMSyncPointOption string + +const ( + // UseMultiVMSyncRecoveryPoint ... + UseMultiVMSyncRecoveryPoint MultiVMSyncPointOption = "UseMultiVmSyncRecoveryPoint" + // UsePerVMRecoveryPoint ... + UsePerVMRecoveryPoint MultiVMSyncPointOption = "UsePerVmRecoveryPoint" +) + +// PossibleMultiVMSyncPointOptionValues returns an array of possible values for the MultiVMSyncPointOption const type. +func PossibleMultiVMSyncPointOptionValues() []MultiVMSyncPointOption { + return []MultiVMSyncPointOption{UseMultiVMSyncRecoveryPoint, UsePerVMRecoveryPoint} +} + +// PlannedFailoverStatus enumerates the values for planned failover status. +type PlannedFailoverStatus string + +const ( + // PlannedFailoverStatusCancelled ... + PlannedFailoverStatusCancelled PlannedFailoverStatus = "Cancelled" + // PlannedFailoverStatusFailed ... + PlannedFailoverStatusFailed PlannedFailoverStatus = "Failed" + // PlannedFailoverStatusSucceeded ... + PlannedFailoverStatusSucceeded PlannedFailoverStatus = "Succeeded" + // PlannedFailoverStatusUnknown ... + PlannedFailoverStatusUnknown PlannedFailoverStatus = "Unknown" +) + +// PossiblePlannedFailoverStatusValues returns an array of possible values for the PlannedFailoverStatus const type. +func PossiblePlannedFailoverStatusValues() []PlannedFailoverStatus { + return []PlannedFailoverStatus{PlannedFailoverStatusCancelled, PlannedFailoverStatusFailed, PlannedFailoverStatusSucceeded, PlannedFailoverStatusUnknown} +} + +// PossibleOperationsDirections enumerates the values for possible operations directions. +type PossibleOperationsDirections string + +const ( + // PrimaryToRecovery ... + PrimaryToRecovery PossibleOperationsDirections = "PrimaryToRecovery" + // RecoveryToPrimary ... + RecoveryToPrimary PossibleOperationsDirections = "RecoveryToPrimary" +) + +// PossiblePossibleOperationsDirectionsValues returns an array of possible values for the PossibleOperationsDirections const type. +func PossiblePossibleOperationsDirectionsValues() []PossibleOperationsDirections { + return []PossibleOperationsDirections{PrimaryToRecovery, RecoveryToPrimary} +} + +// PresenceStatus enumerates the values for presence status. +type PresenceStatus string + +const ( + // PresenceStatusNotPresent ... + PresenceStatusNotPresent PresenceStatus = "NotPresent" + // PresenceStatusPresent ... + PresenceStatusPresent PresenceStatus = "Present" + // PresenceStatusUnknown ... + PresenceStatusUnknown PresenceStatus = "Unknown" +) + +// PossiblePresenceStatusValues returns an array of possible values for the PresenceStatus const type. +func PossiblePresenceStatusValues() []PresenceStatus { + return []PresenceStatus{PresenceStatusNotPresent, PresenceStatusPresent, PresenceStatusUnknown} +} + +// ProtectionHealth enumerates the values for protection health. +type ProtectionHealth string + +const ( + // ProtectionHealthCritical ... + ProtectionHealthCritical ProtectionHealth = "Critical" + // ProtectionHealthNone ... + ProtectionHealthNone ProtectionHealth = "None" + // ProtectionHealthNormal ... + ProtectionHealthNormal ProtectionHealth = "Normal" + // ProtectionHealthWarning ... + ProtectionHealthWarning ProtectionHealth = "Warning" +) + +// PossibleProtectionHealthValues returns an array of possible values for the ProtectionHealth const type. +func PossibleProtectionHealthValues() []ProtectionHealth { + return []ProtectionHealth{ProtectionHealthCritical, ProtectionHealthNone, ProtectionHealthNormal, ProtectionHealthWarning} +} + +// RcmComponentStatus enumerates the values for rcm component status. +type RcmComponentStatus string + +const ( + // RcmComponentStatusCritical ... + RcmComponentStatusCritical RcmComponentStatus = "Critical" + // RcmComponentStatusHealthy ... + RcmComponentStatusHealthy RcmComponentStatus = "Healthy" + // RcmComponentStatusUnknown ... + RcmComponentStatusUnknown RcmComponentStatus = "Unknown" + // RcmComponentStatusWarning ... + RcmComponentStatusWarning RcmComponentStatus = "Warning" +) + +// PossibleRcmComponentStatusValues returns an array of possible values for the RcmComponentStatus const type. +func PossibleRcmComponentStatusValues() []RcmComponentStatus { + return []RcmComponentStatus{RcmComponentStatusCritical, RcmComponentStatusHealthy, RcmComponentStatusUnknown, RcmComponentStatusWarning} +} + +// RecoveryPlanActionLocation enumerates the values for recovery plan action location. +type RecoveryPlanActionLocation string + +const ( + // Primary ... + Primary RecoveryPlanActionLocation = "Primary" + // Recovery ... + Recovery RecoveryPlanActionLocation = "Recovery" +) + +// PossibleRecoveryPlanActionLocationValues returns an array of possible values for the RecoveryPlanActionLocation const type. +func PossibleRecoveryPlanActionLocationValues() []RecoveryPlanActionLocation { + return []RecoveryPlanActionLocation{Primary, Recovery} +} + +// RecoveryPlanGroupType enumerates the values for recovery plan group type. +type RecoveryPlanGroupType string + +const ( + // Boot ... + Boot RecoveryPlanGroupType = "Boot" + // Failover ... + Failover RecoveryPlanGroupType = "Failover" + // Shutdown ... + Shutdown RecoveryPlanGroupType = "Shutdown" +) + +// PossibleRecoveryPlanGroupTypeValues returns an array of possible values for the RecoveryPlanGroupType const type. +func PossibleRecoveryPlanGroupTypeValues() []RecoveryPlanGroupType { + return []RecoveryPlanGroupType{Boot, Failover, Shutdown} +} + +// RecoveryPlanPointType enumerates the values for recovery plan point type. +type RecoveryPlanPointType string + +const ( + // RecoveryPlanPointTypeLatest ... + RecoveryPlanPointTypeLatest RecoveryPlanPointType = "Latest" + // RecoveryPlanPointTypeLatestApplicationConsistent ... + RecoveryPlanPointTypeLatestApplicationConsistent RecoveryPlanPointType = "LatestApplicationConsistent" + // RecoveryPlanPointTypeLatestCrashConsistent ... + RecoveryPlanPointTypeLatestCrashConsistent RecoveryPlanPointType = "LatestCrashConsistent" + // RecoveryPlanPointTypeLatestProcessed ... + RecoveryPlanPointTypeLatestProcessed RecoveryPlanPointType = "LatestProcessed" +) + +// PossibleRecoveryPlanPointTypeValues returns an array of possible values for the RecoveryPlanPointType const type. +func PossibleRecoveryPlanPointTypeValues() []RecoveryPlanPointType { + return []RecoveryPlanPointType{RecoveryPlanPointTypeLatest, RecoveryPlanPointTypeLatestApplicationConsistent, RecoveryPlanPointTypeLatestCrashConsistent, RecoveryPlanPointTypeLatestProcessed} +} + +// RecoveryPointSyncType enumerates the values for recovery point sync type. +type RecoveryPointSyncType string + +const ( + // MultiVMSyncRecoveryPoint ... + MultiVMSyncRecoveryPoint RecoveryPointSyncType = "MultiVmSyncRecoveryPoint" + // PerVMRecoveryPoint ... + PerVMRecoveryPoint RecoveryPointSyncType = "PerVmRecoveryPoint" +) + +// PossibleRecoveryPointSyncTypeValues returns an array of possible values for the RecoveryPointSyncType const type. +func PossibleRecoveryPointSyncTypeValues() []RecoveryPointSyncType { + return []RecoveryPointSyncType{MultiVMSyncRecoveryPoint, PerVMRecoveryPoint} +} + +// RecoveryPointType enumerates the values for recovery point type. +type RecoveryPointType string + +const ( + // Custom ... + Custom RecoveryPointType = "Custom" + // LatestTag ... + LatestTag RecoveryPointType = "LatestTag" + // LatestTime ... + LatestTime RecoveryPointType = "LatestTime" +) + +// PossibleRecoveryPointTypeValues returns an array of possible values for the RecoveryPointType const type. +func PossibleRecoveryPointTypeValues() []RecoveryPointType { + return []RecoveryPointType{Custom, LatestTag, LatestTime} +} + +// ReplicationProtectedItemOperation enumerates the values for replication protected item operation. +type ReplicationProtectedItemOperation string + +const ( + // CancelFailover ... + CancelFailover ReplicationProtectedItemOperation = "CancelFailover" + // ChangePit ... + ChangePit ReplicationProtectedItemOperation = "ChangePit" + // Commit ... + Commit ReplicationProtectedItemOperation = "Commit" + // CompleteMigration ... + CompleteMigration ReplicationProtectedItemOperation = "CompleteMigration" + // DisableProtection ... + DisableProtection ReplicationProtectedItemOperation = "DisableProtection" + // Failback ... + Failback ReplicationProtectedItemOperation = "Failback" + // FinalizeFailback ... + FinalizeFailback ReplicationProtectedItemOperation = "FinalizeFailback" + // PlannedFailover ... + PlannedFailover ReplicationProtectedItemOperation = "PlannedFailover" + // RepairReplication ... + RepairReplication ReplicationProtectedItemOperation = "RepairReplication" + // ReverseReplicate ... + ReverseReplicate ReplicationProtectedItemOperation = "ReverseReplicate" + // SwitchProtection ... + SwitchProtection ReplicationProtectedItemOperation = "SwitchProtection" + // TestFailover ... + TestFailover ReplicationProtectedItemOperation = "TestFailover" + // TestFailoverCleanup ... + TestFailoverCleanup ReplicationProtectedItemOperation = "TestFailoverCleanup" + // UnplannedFailover ... + UnplannedFailover ReplicationProtectedItemOperation = "UnplannedFailover" +) + +// PossibleReplicationProtectedItemOperationValues returns an array of possible values for the ReplicationProtectedItemOperation const type. +func PossibleReplicationProtectedItemOperationValues() []ReplicationProtectedItemOperation { + return []ReplicationProtectedItemOperation{CancelFailover, ChangePit, Commit, CompleteMigration, DisableProtection, Failback, FinalizeFailback, PlannedFailover, RepairReplication, ReverseReplicate, SwitchProtection, TestFailover, TestFailoverCleanup, UnplannedFailover} +} + +// ResourceType enumerates the values for resource type. +type ResourceType string + +const ( + // ResourceTypeExisting ... + ResourceTypeExisting ResourceType = "Existing" + // ResourceTypeNew ... + ResourceTypeNew ResourceType = "New" + // ResourceTypeProtectionProfileCustomDetails ... + ResourceTypeProtectionProfileCustomDetails ResourceType = "ProtectionProfileCustomDetails" +) + +// PossibleResourceTypeValues returns an array of possible values for the ResourceType const type. +func PossibleResourceTypeValues() []ResourceType { + return []ResourceType{ResourceTypeExisting, ResourceTypeNew, ResourceTypeProtectionProfileCustomDetails} +} + +// ResourceTypeBasicRecoveryAvailabilitySetCustomDetails enumerates the values for resource type basic recovery +// availability set custom details. +type ResourceTypeBasicRecoveryAvailabilitySetCustomDetails string + +const ( + // ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryAvailabilitySetCustomDetails = "Existing" + // ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails ... + ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails ResourceTypeBasicRecoveryAvailabilitySetCustomDetails = "RecoveryAvailabilitySetCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryAvailabilitySetCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryAvailabilitySetCustomDetails const type. +func PossibleResourceTypeBasicRecoveryAvailabilitySetCustomDetailsValues() []ResourceTypeBasicRecoveryAvailabilitySetCustomDetails { + return []ResourceTypeBasicRecoveryAvailabilitySetCustomDetails{ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails} +} + +// ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails enumerates the values for resource type basic +// recovery proximity placement group custom details. +type ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails string + +const ( + // ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails = "Existing" + // ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails ... + ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails = "RecoveryProximityPlacementGroupCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails const type. +func PossibleResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsValues() []ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails { + return []ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails{ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails} +} + +// ResourceTypeBasicRecoveryResourceGroupCustomDetails enumerates the values for resource type basic recovery +// resource group custom details. +type ResourceTypeBasicRecoveryResourceGroupCustomDetails string + +const ( + // ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryResourceGroupCustomDetails = "Existing" + // ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails ... + ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails ResourceTypeBasicRecoveryResourceGroupCustomDetails = "RecoveryResourceGroupCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryResourceGroupCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryResourceGroupCustomDetails const type. +func PossibleResourceTypeBasicRecoveryResourceGroupCustomDetailsValues() []ResourceTypeBasicRecoveryResourceGroupCustomDetails { + return []ResourceTypeBasicRecoveryResourceGroupCustomDetails{ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails} +} + +// ResourceTypeBasicRecoveryVirtualNetworkCustomDetails enumerates the values for resource type basic recovery +// virtual network custom details. +type ResourceTypeBasicRecoveryVirtualNetworkCustomDetails string + +const ( + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "Existing" + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "New" + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "RecoveryVirtualNetworkCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryVirtualNetworkCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryVirtualNetworkCustomDetails const type. +func PossibleResourceTypeBasicRecoveryVirtualNetworkCustomDetailsValues() []ResourceTypeBasicRecoveryVirtualNetworkCustomDetails { + return []ResourceTypeBasicRecoveryVirtualNetworkCustomDetails{ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew, ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails} +} + +// ResourceTypeBasicStorageAccountCustomDetails enumerates the values for resource type basic storage account +// custom details. +type ResourceTypeBasicStorageAccountCustomDetails string + +const ( + // ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting ... + ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting ResourceTypeBasicStorageAccountCustomDetails = "Existing" + // ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails ... + ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails ResourceTypeBasicStorageAccountCustomDetails = "StorageAccountCustomDetails" +) + +// PossibleResourceTypeBasicStorageAccountCustomDetailsValues returns an array of possible values for the ResourceTypeBasicStorageAccountCustomDetails const type. +func PossibleResourceTypeBasicStorageAccountCustomDetailsValues() []ResourceTypeBasicStorageAccountCustomDetails { + return []ResourceTypeBasicStorageAccountCustomDetails{ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting, ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails} +} + +// ResyncState enumerates the values for resync state. +type ResyncState string + +const ( + // ResyncStateNone ... + ResyncStateNone ResyncState = "None" + // ResyncStatePreparedForResynchronization ... + ResyncStatePreparedForResynchronization ResyncState = "PreparedForResynchronization" + // ResyncStateStartedResynchronization ... + ResyncStateStartedResynchronization ResyncState = "StartedResynchronization" +) + +// PossibleResyncStateValues returns an array of possible values for the ResyncState const type. +func PossibleResyncStateValues() []ResyncState { + return []ResyncState{ResyncStateNone, ResyncStatePreparedForResynchronization, ResyncStateStartedResynchronization} +} + +// RpInMageRecoveryPointType enumerates the values for rp in mage recovery point type. +type RpInMageRecoveryPointType string + +const ( + // RpInMageRecoveryPointTypeCustom ... + RpInMageRecoveryPointTypeCustom RpInMageRecoveryPointType = "Custom" + // RpInMageRecoveryPointTypeLatestTag ... + RpInMageRecoveryPointTypeLatestTag RpInMageRecoveryPointType = "LatestTag" + // RpInMageRecoveryPointTypeLatestTime ... + RpInMageRecoveryPointTypeLatestTime RpInMageRecoveryPointType = "LatestTime" +) + +// PossibleRpInMageRecoveryPointTypeValues returns an array of possible values for the RpInMageRecoveryPointType const type. +func PossibleRpInMageRecoveryPointTypeValues() []RpInMageRecoveryPointType { + return []RpInMageRecoveryPointType{RpInMageRecoveryPointTypeCustom, RpInMageRecoveryPointTypeLatestTag, RpInMageRecoveryPointTypeLatestTime} +} + +// SetMultiVMSyncStatus enumerates the values for set multi vm sync status. +type SetMultiVMSyncStatus string + +const ( + // Disable ... + Disable SetMultiVMSyncStatus = "Disable" + // Enable ... + Enable SetMultiVMSyncStatus = "Enable" +) + +// PossibleSetMultiVMSyncStatusValues returns an array of possible values for the SetMultiVMSyncStatus const type. +func PossibleSetMultiVMSyncStatusValues() []SetMultiVMSyncStatus { + return []SetMultiVMSyncStatus{Disable, Enable} +} + +// Severity enumerates the values for severity. +type Severity string + +const ( + // Error ... + Error Severity = "Error" + // Info ... + Info Severity = "Info" + // NONE ... + NONE Severity = "NONE" + // Warning ... + Warning Severity = "Warning" +) + +// PossibleSeverityValues returns an array of possible values for the Severity const type. +func PossibleSeverityValues() []Severity { + return []Severity{Error, Info, NONE, Warning} +} + +// SourceSiteOperations enumerates the values for source site operations. +type SourceSiteOperations string + +const ( + // NotRequired ... + NotRequired SourceSiteOperations = "NotRequired" + // Required ... + Required SourceSiteOperations = "Required" +) + +// PossibleSourceSiteOperationsValues returns an array of possible values for the SourceSiteOperations const type. +func PossibleSourceSiteOperationsValues() []SourceSiteOperations { + return []SourceSiteOperations{NotRequired, Required} +} + +// SQLServerLicenseType enumerates the values for sql server license type. +type SQLServerLicenseType string + +const ( + // SQLServerLicenseTypeAHUB ... + SQLServerLicenseTypeAHUB SQLServerLicenseType = "AHUB" + // SQLServerLicenseTypeNoLicenseType ... + SQLServerLicenseTypeNoLicenseType SQLServerLicenseType = "NoLicenseType" + // SQLServerLicenseTypeNotSpecified ... + SQLServerLicenseTypeNotSpecified SQLServerLicenseType = "NotSpecified" + // SQLServerLicenseTypePAYG ... + SQLServerLicenseTypePAYG SQLServerLicenseType = "PAYG" +) + +// PossibleSQLServerLicenseTypeValues returns an array of possible values for the SQLServerLicenseType const type. +func PossibleSQLServerLicenseTypeValues() []SQLServerLicenseType { + return []SQLServerLicenseType{SQLServerLicenseTypeAHUB, SQLServerLicenseTypeNoLicenseType, SQLServerLicenseTypeNotSpecified, SQLServerLicenseTypePAYG} +} + +// TestMigrationState enumerates the values for test migration state. +type TestMigrationState string + +const ( + // TestMigrationStateNone ... + TestMigrationStateNone TestMigrationState = "None" + // TestMigrationStateTestMigrationCleanupInProgress ... + TestMigrationStateTestMigrationCleanupInProgress TestMigrationState = "TestMigrationCleanupInProgress" + // TestMigrationStateTestMigrationFailed ... + TestMigrationStateTestMigrationFailed TestMigrationState = "TestMigrationFailed" + // TestMigrationStateTestMigrationInProgress ... + TestMigrationStateTestMigrationInProgress TestMigrationState = "TestMigrationInProgress" + // TestMigrationStateTestMigrationSucceeded ... + TestMigrationStateTestMigrationSucceeded TestMigrationState = "TestMigrationSucceeded" +) + +// PossibleTestMigrationStateValues returns an array of possible values for the TestMigrationState const type. +func PossibleTestMigrationStateValues() []TestMigrationState { + return []TestMigrationState{TestMigrationStateNone, TestMigrationStateTestMigrationCleanupInProgress, TestMigrationStateTestMigrationFailed, TestMigrationStateTestMigrationInProgress, TestMigrationStateTestMigrationSucceeded} +} + +// VMEncryptionType enumerates the values for vm encryption type. +type VMEncryptionType string + +const ( + // NotEncrypted ... + NotEncrypted VMEncryptionType = "NotEncrypted" + // OnePassEncrypted ... + OnePassEncrypted VMEncryptionType = "OnePassEncrypted" + // TwoPassEncrypted ... + TwoPassEncrypted VMEncryptionType = "TwoPassEncrypted" +) + +// PossibleVMEncryptionTypeValues returns an array of possible values for the VMEncryptionType const type. +func PossibleVMEncryptionTypeValues() []VMEncryptionType { + return []VMEncryptionType{NotEncrypted, OnePassEncrypted, TwoPassEncrypted} +} + +// VMReplicationProgressHealth enumerates the values for vm replication progress health. +type VMReplicationProgressHealth string + +const ( + // VMReplicationProgressHealthInProgress ... + VMReplicationProgressHealthInProgress VMReplicationProgressHealth = "InProgress" + // VMReplicationProgressHealthNone ... + VMReplicationProgressHealthNone VMReplicationProgressHealth = "None" + // VMReplicationProgressHealthNoProgress ... + VMReplicationProgressHealthNoProgress VMReplicationProgressHealth = "NoProgress" + // VMReplicationProgressHealthSlowProgress ... + VMReplicationProgressHealthSlowProgress VMReplicationProgressHealth = "SlowProgress" +) + +// PossibleVMReplicationProgressHealthValues returns an array of possible values for the VMReplicationProgressHealth const type. +func PossibleVMReplicationProgressHealthValues() []VMReplicationProgressHealth { + return []VMReplicationProgressHealth{VMReplicationProgressHealthInProgress, VMReplicationProgressHealthNone, VMReplicationProgressHealthNoProgress, VMReplicationProgressHealthSlowProgress} +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/migrationrecoverypoints.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/migrationrecoverypoints.go new file mode 100644 index 000000000000..2f30b5f209a4 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/migrationrecoverypoints.go @@ -0,0 +1,236 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// MigrationRecoveryPointsClient is the client for the MigrationRecoveryPoints methods of the Siterecovery service. +type MigrationRecoveryPointsClient struct { + BaseClient +} + +// NewMigrationRecoveryPointsClient creates an instance of the MigrationRecoveryPointsClient client. +func NewMigrationRecoveryPointsClient(subscriptionID string, resourceGroupName string, resourceName string) MigrationRecoveryPointsClient { + return NewMigrationRecoveryPointsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewMigrationRecoveryPointsClientWithBaseURI creates an instance of the MigrationRecoveryPointsClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewMigrationRecoveryPointsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) MigrationRecoveryPointsClient { + return MigrationRecoveryPointsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get sends the get request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// migrationRecoveryPointName - the migration recovery point name. +func (client MigrationRecoveryPointsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (result MigrationRecoveryPoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, migrationItemName, migrationRecoveryPointName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client MigrationRecoveryPointsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "migrationRecoveryPointName": autorest.Encode("path", migrationRecoveryPointName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints/{migrationRecoveryPointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client MigrationRecoveryPointsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client MigrationRecoveryPointsClient) GetResponder(resp *http.Response) (result MigrationRecoveryPoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationMigrationItems sends the list by replication migration items request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItems(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationRecoveryPointCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.ListByReplicationMigrationItems") + defer func() { + sc := -1 + if result.mrpc.Response.Response != nil { + sc = result.mrpc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationMigrationItemsNextResults + req, err := client.ListByReplicationMigrationItemsPreparer(ctx, fabricName, protectionContainerName, migrationItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationMigrationItemsSender(req) + if err != nil { + result.mrpc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", resp, "Failure sending request") + return + } + + result.mrpc, err = client.ListByReplicationMigrationItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", resp, "Failure responding to request") + return + } + if result.mrpc.hasNextLink() && result.mrpc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationMigrationItemsPreparer prepares the ListByReplicationMigrationItems request. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationMigrationItemsSender sends the ListByReplicationMigrationItems request. The method will close the +// http.Response Body if it receives an error. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationMigrationItemsResponder handles the response to the ListByReplicationMigrationItems request. The method always +// closes the http.Response Body. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsResponder(resp *http.Response) (result MigrationRecoveryPointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationMigrationItemsNextResults retrieves the next set of results, if any. +func (client MigrationRecoveryPointsClient) listByReplicationMigrationItemsNextResults(ctx context.Context, lastResults MigrationRecoveryPointCollection) (result MigrationRecoveryPointCollection, err error) { + req, err := lastResults.migrationRecoveryPointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationMigrationItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationMigrationItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationMigrationItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationRecoveryPointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.ListByReplicationMigrationItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationMigrationItems(ctx, fabricName, protectionContainerName, migrationItemName) + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/models.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/models.go new file mode 100644 index 000000000000..2cd271404e23 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/models.go @@ -0,0 +1,33225 @@ +package siterecovery + +// 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. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2022-01-01/siterecovery" + +// A2AAddDisksInput a2A add disk(s) input. +type A2AAddDisksInput struct { + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeAddDisksProviderSpecificInput', 'InstanceTypeA2A' + InstanceType InstanceType `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AAddDisksInput. +func (aadi A2AAddDisksInput) MarshalJSON() ([]byte, error) { + aadi.InstanceType = InstanceTypeA2A + objectMap := make(map[string]interface{}) + if aadi.VMDisks != nil { + objectMap["vmDisks"] = aadi.VMDisks + } + if aadi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aadi.VMManagedDisks + } + if aadi.InstanceType != "" { + objectMap["instanceType"] = aadi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AAddDisksInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsA2AAddDisksInput() (*A2AAddDisksInput, bool) { + return &aadi, true +} + +// AsAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsBasicAddDisksProviderSpecificInput() (BasicAddDisksProviderSpecificInput, bool) { + return &aadi, true +} + +// A2AApplyRecoveryPointInput applyRecoveryPoint input specific to A2A provider. +type A2AApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + aarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aarpi.InstanceType != "" { + objectMap["instanceType"] = aarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return &aarpi, true +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &aarpi, true +} + +// A2AContainerCreationInput a2A cloud creation input. +type A2AContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) MarshalJSON() ([]byte, error) { + acci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acci.InstanceType != "" { + objectMap["instanceType"] = acci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return &acci, true +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &acci, true +} + +// A2AContainerMappingInput a2A container mapping input. +type A2AContainerMappingInput struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) MarshalJSON() ([]byte, error) { + acmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acmi.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = acmi.AgentAutoUpdateStatus + } + if acmi.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = acmi.AutomationAccountArmID + } + if acmi.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = acmi.AutomationAccountAuthenticationType + } + if acmi.InstanceType != "" { + objectMap["instanceType"] = acmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return &acmi, true +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &acmi, true +} + +// A2ACreateProtectionIntentInput a2A create protection intent input. +type A2ACreateProtectionIntentInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryLocation - The primary location for the virtual machine. + PrimaryLocation *string `json:"primaryLocation,omitempty"` + // RecoveryLocation - The recovery location for the virtual machine. + RecoveryLocation *string `json:"recoveryLocation,omitempty"` + // RecoverySubscriptionID - The recovery subscription Id of the virtual machine. + RecoverySubscriptionID *string `json:"recoverySubscriptionId,omitempty"` + // RecoveryAvailabilityType - The recovery availability type of the virtual machine. Possible values include: 'Single', 'AvailabilitySet', 'AvailabilityZone' + RecoveryAvailabilityType A2ARecoveryAvailabilityType `json:"recoveryAvailabilityType,omitempty"` + // ProtectionProfileCustomInput - The protection profile custom inputs. + ProtectionProfileCustomInput BasicProtectionProfileCustomDetails `json:"protectionProfileCustomInput,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` + // RecoveryAvailabilitySetCustomInput - The recovery availability set input. + RecoveryAvailabilitySetCustomInput BasicRecoveryAvailabilitySetCustomDetails `json:"recoveryAvailabilitySetCustomInput,omitempty"` + // RecoveryVirtualNetworkCustomInput - The recovery virtual network input. + RecoveryVirtualNetworkCustomInput BasicRecoveryVirtualNetworkCustomDetails `json:"recoveryVirtualNetworkCustomInput,omitempty"` + // RecoveryProximityPlacementGroupCustomInput - The recovery proximity placement group custom input. + RecoveryProximityPlacementGroupCustomInput BasicRecoveryProximityPlacementGroupCustomDetails `json:"recoveryProximityPlacementGroupCustomInput,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // VMDisks - The list of vm disk inputs. + VMDisks *[]A2AProtectionIntentDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk inputs. + VMManagedDisks *[]A2AProtectionIntentManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccount - The boot diagnostic storage account. + RecoveryBootDiagStorageAccount BasicStorageAccountCustomDetails `json:"recoveryBootDiagStorageAccount,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the authentication type for automation account. The default value is "RunAsAccount". Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails', 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) MarshalJSON() ([]byte, error) { + acpii.InstanceType = InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acpii.FabricObjectID != nil { + objectMap["fabricObjectId"] = acpii.FabricObjectID + } + if acpii.PrimaryLocation != nil { + objectMap["primaryLocation"] = acpii.PrimaryLocation + } + if acpii.RecoveryLocation != nil { + objectMap["recoveryLocation"] = acpii.RecoveryLocation + } + if acpii.RecoverySubscriptionID != nil { + objectMap["recoverySubscriptionId"] = acpii.RecoverySubscriptionID + } + if acpii.RecoveryAvailabilityType != "" { + objectMap["recoveryAvailabilityType"] = acpii.RecoveryAvailabilityType + } + objectMap["protectionProfileCustomInput"] = acpii.ProtectionProfileCustomInput + if acpii.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = acpii.RecoveryResourceGroupID + } + objectMap["primaryStagingStorageAccountCustomInput"] = acpii.PrimaryStagingStorageAccountCustomInput + objectMap["recoveryAvailabilitySetCustomInput"] = acpii.RecoveryAvailabilitySetCustomInput + objectMap["recoveryVirtualNetworkCustomInput"] = acpii.RecoveryVirtualNetworkCustomInput + objectMap["recoveryProximityPlacementGroupCustomInput"] = acpii.RecoveryProximityPlacementGroupCustomInput + if acpii.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = acpii.AutoProtectionOfDataDisk + } + if acpii.VMDisks != nil { + objectMap["vmDisks"] = acpii.VMDisks + } + if acpii.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = acpii.VMManagedDisks + } + if acpii.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = acpii.MultiVMGroupName + } + if acpii.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = acpii.MultiVMGroupID + } + objectMap["recoveryBootDiagStorageAccount"] = acpii.RecoveryBootDiagStorageAccount + if acpii.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = acpii.DiskEncryptionInfo + } + if acpii.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = acpii.RecoveryAvailabilityZone + } + if acpii.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = acpii.AgentAutoUpdateStatus + } + if acpii.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = acpii.AutomationAccountAuthenticationType + } + if acpii.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = acpii.AutomationAccountArmID + } + if acpii.InstanceType != "" { + objectMap["instanceType"] = acpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACreateProtectionIntentInput is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) { + return &acpii, true +} + +// AsCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsBasicCreateProtectionIntentProviderSpecificDetails() (BasicCreateProtectionIntentProviderSpecificDetails, bool) { + return &acpii, true +} + +// UnmarshalJSON is the custom unmarshaler for A2ACreateProtectionIntentInput struct. +func (acpii *A2ACreateProtectionIntentInput) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "fabricObjectId": + if v != nil { + var fabricObjectID string + err = json.Unmarshal(*v, &fabricObjectID) + if err != nil { + return err + } + acpii.FabricObjectID = &fabricObjectID + } + case "primaryLocation": + if v != nil { + var primaryLocation string + err = json.Unmarshal(*v, &primaryLocation) + if err != nil { + return err + } + acpii.PrimaryLocation = &primaryLocation + } + case "recoveryLocation": + if v != nil { + var recoveryLocation string + err = json.Unmarshal(*v, &recoveryLocation) + if err != nil { + return err + } + acpii.RecoveryLocation = &recoveryLocation + } + case "recoverySubscriptionId": + if v != nil { + var recoverySubscriptionID string + err = json.Unmarshal(*v, &recoverySubscriptionID) + if err != nil { + return err + } + acpii.RecoverySubscriptionID = &recoverySubscriptionID + } + case "recoveryAvailabilityType": + if v != nil { + var recoveryAvailabilityType A2ARecoveryAvailabilityType + err = json.Unmarshal(*v, &recoveryAvailabilityType) + if err != nil { + return err + } + acpii.RecoveryAvailabilityType = recoveryAvailabilityType + } + case "protectionProfileCustomInput": + if v != nil { + protectionProfileCustomInput, err := unmarshalBasicProtectionProfileCustomDetails(*v) + if err != nil { + return err + } + acpii.ProtectionProfileCustomInput = protectionProfileCustomInput + } + case "recoveryResourceGroupId": + if v != nil { + var recoveryResourceGroupID string + err = json.Unmarshal(*v, &recoveryResourceGroupID) + if err != nil { + return err + } + acpii.RecoveryResourceGroupID = &recoveryResourceGroupID + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + acpii.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + case "recoveryAvailabilitySetCustomInput": + if v != nil { + recoveryAvailabilitySetCustomInput, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryAvailabilitySetCustomInput = recoveryAvailabilitySetCustomInput + } + case "recoveryVirtualNetworkCustomInput": + if v != nil { + recoveryVirtualNetworkCustomInput, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryVirtualNetworkCustomInput = recoveryVirtualNetworkCustomInput + } + case "recoveryProximityPlacementGroupCustomInput": + if v != nil { + recoveryProximityPlacementGroupCustomInput, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryProximityPlacementGroupCustomInput = recoveryProximityPlacementGroupCustomInput + } + case "autoProtectionOfDataDisk": + if v != nil { + var autoProtectionOfDataDisk AutoProtectionOfDataDisk + err = json.Unmarshal(*v, &autoProtectionOfDataDisk) + if err != nil { + return err + } + acpii.AutoProtectionOfDataDisk = autoProtectionOfDataDisk + } + case "vmDisks": + if v != nil { + var VMDisks []A2AProtectionIntentDiskInputDetails + err = json.Unmarshal(*v, &VMDisks) + if err != nil { + return err + } + acpii.VMDisks = &VMDisks + } + case "vmManagedDisks": + if v != nil { + var VMManagedDisks []A2AProtectionIntentManagedDiskInputDetails + err = json.Unmarshal(*v, &VMManagedDisks) + if err != nil { + return err + } + acpii.VMManagedDisks = &VMManagedDisks + } + case "multiVmGroupName": + if v != nil { + var multiVMGroupName string + err = json.Unmarshal(*v, &multiVMGroupName) + if err != nil { + return err + } + acpii.MultiVMGroupName = &multiVMGroupName + } + case "multiVmGroupId": + if v != nil { + var multiVMGroupID string + err = json.Unmarshal(*v, &multiVMGroupID) + if err != nil { + return err + } + acpii.MultiVMGroupID = &multiVMGroupID + } + case "recoveryBootDiagStorageAccount": + if v != nil { + recoveryBootDiagStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryBootDiagStorageAccount = recoveryBootDiagStorageAccount + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + acpii.DiskEncryptionInfo = &diskEncryptionInfo + } + case "recoveryAvailabilityZone": + if v != nil { + var recoveryAvailabilityZone string + err = json.Unmarshal(*v, &recoveryAvailabilityZone) + if err != nil { + return err + } + acpii.RecoveryAvailabilityZone = &recoveryAvailabilityZone + } + case "agentAutoUpdateStatus": + if v != nil { + var agentAutoUpdateStatus AgentAutoUpdateStatus + err = json.Unmarshal(*v, &agentAutoUpdateStatus) + if err != nil { + return err + } + acpii.AgentAutoUpdateStatus = agentAutoUpdateStatus + } + case "automationAccountAuthenticationType": + if v != nil { + var automationAccountAuthenticationType AutomationAccountAuthenticationType + err = json.Unmarshal(*v, &automationAccountAuthenticationType) + if err != nil { + return err + } + acpii.AutomationAccountAuthenticationType = automationAccountAuthenticationType + } + case "automationAccountArmId": + if v != nil { + var automationAccountArmID string + err = json.Unmarshal(*v, &automationAccountArmID) + if err != nil { + return err + } + acpii.AutomationAccountArmID = &automationAccountArmID + } + case "instanceType": + if v != nil { + var instanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails + err = json.Unmarshal(*v, &instanceType) + if err != nil { + return err + } + acpii.InstanceType = instanceType + } + } + } + + return nil +} + +// A2ACrossClusterMigrationApplyRecoveryPointInput applyRecoveryPoint input specific to +// A2ACrossClusterMigration provider. +type A2ACrossClusterMigrationApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + accmarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmarpi.InstanceType != "" { + objectMap["instanceType"] = accmarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return &accmarpi, true +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &accmarpi, true +} + +// A2ACrossClusterMigrationContainerCreationInput a2ACrossClusterMigration cloud creation input. +type A2ACrossClusterMigrationContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) MarshalJSON() ([]byte, error) { + accmcci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmcci.InstanceType != "" { + objectMap["instanceType"] = accmcci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return &accmcci, true +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &accmcci, true +} + +// A2ACrossClusterMigrationEnableProtectionInput a2A Cross-Cluster Migration enable protection input. +type A2ACrossClusterMigrationEnableProtectionInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) MarshalJSON() ([]byte, error) { + accmepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmepi.FabricObjectID != nil { + objectMap["fabricObjectId"] = accmepi.FabricObjectID + } + if accmepi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = accmepi.RecoveryContainerID + } + if accmepi.InstanceType != "" { + objectMap["instanceType"] = accmepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return &accmepi, true +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &accmepi, true +} + +// A2ACrossClusterMigrationPolicyCreationInput a2A Cross-Cluster Migration Policy creation input. +type A2ACrossClusterMigrationPolicyCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) MarshalJSON() ([]byte, error) { + accmpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmpci.InstanceType != "" { + objectMap["instanceType"] = accmpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return &accmpci, true +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &accmpci, true +} + +// A2ACrossClusterMigrationReplicationDetails a2A provider specific settings. +type A2ACrossClusterMigrationReplicationDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryFabricLocation - Primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // OsType - The type of operating system. + OsType *string `json:"osType,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // LifecycleID - An id associated with the PE 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 item even though other internal Ids/ARM Id might be changing. + LifecycleID *string `json:"lifecycleId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) MarshalJSON() ([]byte, error) { + accmrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmrd.FabricObjectID != nil { + objectMap["fabricObjectId"] = accmrd.FabricObjectID + } + if accmrd.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = accmrd.PrimaryFabricLocation + } + if accmrd.OsType != nil { + objectMap["osType"] = accmrd.OsType + } + if accmrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = accmrd.VMProtectionState + } + if accmrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = accmrd.VMProtectionStateDescription + } + if accmrd.LifecycleID != nil { + objectMap["lifecycleId"] = accmrd.LifecycleID + } + if accmrd.InstanceType != "" { + objectMap["instanceType"] = accmrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return &accmrd, true +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &accmrd, true +} + +// A2AEnableProtectionInput a2A enable protection input. +type A2AEnableProtectionInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryExtendedLocation - The recovery extended location. + RecoveryExtendedLocation *ExtendedLocation `json:"recoveryExtendedLocation,omitempty"` + // RecoveryAzureNetworkID - The recovery Azure virtual network ARM id. + RecoveryAzureNetworkID *string `json:"recoveryAzureNetworkId,omitempty"` + // RecoverySubnetName - The recovery subnet name. + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + // RecoveryVirtualMachineScaleSetID - The virtual machine scale set Id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) MarshalJSON() ([]byte, error) { + aepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aepi.FabricObjectID != nil { + objectMap["fabricObjectId"] = aepi.FabricObjectID + } + if aepi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = aepi.RecoveryContainerID + } + if aepi.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aepi.RecoveryResourceGroupID + } + if aepi.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aepi.RecoveryCloudServiceID + } + if aepi.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = aepi.RecoveryAvailabilitySetID + } + if aepi.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aepi.RecoveryProximityPlacementGroupID + } + if aepi.VMDisks != nil { + objectMap["vmDisks"] = aepi.VMDisks + } + if aepi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aepi.VMManagedDisks + } + if aepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = aepi.MultiVMGroupName + } + if aepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = aepi.MultiVMGroupID + } + if aepi.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aepi.RecoveryBootDiagStorageAccountID + } + if aepi.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aepi.DiskEncryptionInfo + } + if aepi.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = aepi.RecoveryAvailabilityZone + } + if aepi.RecoveryExtendedLocation != nil { + objectMap["recoveryExtendedLocation"] = aepi.RecoveryExtendedLocation + } + if aepi.RecoveryAzureNetworkID != nil { + objectMap["recoveryAzureNetworkId"] = aepi.RecoveryAzureNetworkID + } + if aepi.RecoverySubnetName != nil { + objectMap["recoverySubnetName"] = aepi.RecoverySubnetName + } + if aepi.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aepi.RecoveryVirtualMachineScaleSetID + } + if aepi.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = aepi.RecoveryCapacityReservationGroupID + } + if aepi.InstanceType != "" { + objectMap["instanceType"] = aepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return &aepi, true +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &aepi, true +} + +// A2AEventDetails model class for event details of a A2A event. +type A2AEventDetails struct { + // ProtectedItemName - The protected item arm name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // FabricObjectID - The azure vm arm id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // FabricName - Fabric arm name. + FabricName *string `json:"fabricName,omitempty"` + // FabricLocation - The fabric location. + FabricLocation *string `json:"fabricLocation,omitempty"` + // RemoteFabricName - Remote fabric arm name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // RemoteFabricLocation - Remote fabric location. + RemoteFabricLocation *string `json:"remoteFabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AEventDetails. +func (aed A2AEventDetails) MarshalJSON() ([]byte, error) { + aed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aed.ProtectedItemName != nil { + objectMap["protectedItemName"] = aed.ProtectedItemName + } + if aed.FabricObjectID != nil { + objectMap["fabricObjectId"] = aed.FabricObjectID + } + if aed.FabricName != nil { + objectMap["fabricName"] = aed.FabricName + } + if aed.FabricLocation != nil { + objectMap["fabricLocation"] = aed.FabricLocation + } + if aed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = aed.RemoteFabricName + } + if aed.RemoteFabricLocation != nil { + objectMap["remoteFabricLocation"] = aed.RemoteFabricLocation + } + if aed.InstanceType != "" { + objectMap["instanceType"] = aed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return &aed, true +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &aed, true +} + +// A2APolicyCreationInput a2A Policy creation input. +type A2APolicyCreationInput struct { + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) MarshalJSON() ([]byte, error) { + apci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apci.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = apci.RecoveryPointHistory + } + if apci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = apci.CrashConsistentFrequencyInMinutes + } + if apci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = apci.AppConsistentFrequencyInMinutes + } + if apci.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = apci.MultiVMSyncStatus + } + if apci.InstanceType != "" { + objectMap["instanceType"] = apci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return &apci, true +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &apci, true +} + +// A2APolicyDetails a2A specific policy details. +type A2APolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2APolicyDetails. +func (apd A2APolicyDetails) MarshalJSON() ([]byte, error) { + apd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = apd.RecoveryPointThresholdInMinutes + } + if apd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = apd.RecoveryPointHistory + } + if apd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = apd.AppConsistentFrequencyInMinutes + } + if apd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = apd.MultiVMSyncStatus + } + if apd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = apd.CrashConsistentFrequencyInMinutes + } + if apd.InstanceType != "" { + objectMap["instanceType"] = apd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return &apd, true +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &apd, true +} + +// A2AProtectedDiskDetails a2A protected disk details. +type A2AProtectedDiskDetails struct { + // DiskURI - The disk uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountID - The recovery disk storage account. + RecoveryAzureStorageAccountID *string `json:"recoveryAzureStorageAccountId,omitempty"` + // PrimaryDiskAzureStorageAccountID - The primary disk storage account. + PrimaryDiskAzureStorageAccountID *string `json:"primaryDiskAzureStorageAccountId,omitempty"` + // RecoveryDiskURI - Recovery disk uri. + RecoveryDiskURI *string `json:"recoveryDiskUri,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // DiskType - The type of disk. + DiskType *string `json:"diskType,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *bool `json:"resyncRequired,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // DataPendingInStagingStorageAccountInMB - The data pending for replication in MB at staging account. + DataPendingInStagingStorageAccountInMB *float64 `json:"dataPendingInStagingStorageAccountInMB,omitempty"` + // DataPendingAtSourceAgentInMB - The data pending at source virtual machine in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // DiskState - The disk state. + DiskState *string `json:"diskState,omitempty"` + // AllowedDiskLevelOperation - The disk level operations list. + AllowedDiskLevelOperation *[]string `json:"allowedDiskLevelOperation,omitempty"` + // IsDiskEncrypted - A value indicating whether vm has encrypted os disk or not. + IsDiskEncrypted *bool `json:"isDiskEncrypted,omitempty"` + // SecretIdentifier - The secret URL / identifier (BEK). + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // DekKeyVaultArmID - The KeyVault resource id for secret (BEK). + DekKeyVaultArmID *string `json:"dekKeyVaultArmId,omitempty"` + // IsDiskKeyEncrypted - A value indicating whether disk key got encrypted or not. + IsDiskKeyEncrypted *bool `json:"isDiskKeyEncrypted,omitempty"` + // KeyIdentifier - The key URL / identifier (KEK). + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KekKeyVaultArmID - The KeyVault resource id for key (KEK). + KekKeyVaultArmID *string `json:"kekKeyVaultArmId,omitempty"` + // FailoverDiskName - The failover name for the managed disk. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The test failover name for the managed disk. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AProtectedManagedDiskDetails a2A protected managed disk details. +type A2AProtectedManagedDiskDetails struct { + // DiskID - The managed disk Arm id. + DiskID *string `json:"diskId,omitempty"` + // RecoveryResourceGroupID - The recovery disk resource group Arm Id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryTargetDiskID - Recovery target disk Arm Id. + RecoveryTargetDiskID *string `json:"recoveryTargetDiskId,omitempty"` + // RecoveryReplicaDiskID - Recovery replica disk Arm Id. + RecoveryReplicaDiskID *string `json:"recoveryReplicaDiskId,omitempty"` + // RecoveryOrignalTargetDiskID - Recovery original target disk Arm Id. + RecoveryOrignalTargetDiskID *string `json:"recoveryOrignalTargetDiskId,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // PrimaryDiskEncryptionSetID - The primary disk encryption set Id. + PrimaryDiskEncryptionSetID *string `json:"primaryDiskEncryptionSetId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // DiskType - The type of disk. + DiskType *string `json:"diskType,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *bool `json:"resyncRequired,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // DataPendingInStagingStorageAccountInMB - The data pending for replication in MB at staging account. + DataPendingInStagingStorageAccountInMB *float64 `json:"dataPendingInStagingStorageAccountInMB,omitempty"` + // DataPendingAtSourceAgentInMB - The data pending at source virtual machine in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // DiskState - The disk state. + DiskState *string `json:"diskState,omitempty"` + // AllowedDiskLevelOperation - The disk level operations list. + AllowedDiskLevelOperation *[]string `json:"allowedDiskLevelOperation,omitempty"` + // IsDiskEncrypted - A value indicating whether vm has encrypted os disk or not. + IsDiskEncrypted *bool `json:"isDiskEncrypted,omitempty"` + // SecretIdentifier - The secret URL / identifier (BEK). + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // DekKeyVaultArmID - The KeyVault resource id for secret (BEK). + DekKeyVaultArmID *string `json:"dekKeyVaultArmId,omitempty"` + // IsDiskKeyEncrypted - A value indicating whether disk key got encrypted or not. + IsDiskKeyEncrypted *bool `json:"isDiskKeyEncrypted,omitempty"` + // KeyIdentifier - The key URL / identifier (KEK). + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KekKeyVaultArmID - The KeyVault resource id for key (KEK). + KekKeyVaultArmID *string `json:"kekKeyVaultArmId,omitempty"` + // FailoverDiskName - The failover name for the managed disk. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The test failover name for the managed disk. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AProtectionContainerMappingDetails a2A provider specific settings. +type A2AProtectionContainerMappingDetails struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // ScheduleName - The schedule arm name. + ScheduleName *string `json:"scheduleName,omitempty"` + // JobScheduleName - The job schedule arm name. + JobScheduleName *string `json:"jobScheduleName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + apcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apcmd.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = apcmd.AgentAutoUpdateStatus + } + if apcmd.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = apcmd.AutomationAccountArmID + } + if apcmd.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = apcmd.AutomationAccountAuthenticationType + } + if apcmd.ScheduleName != nil { + objectMap["scheduleName"] = apcmd.ScheduleName + } + if apcmd.JobScheduleName != nil { + objectMap["jobScheduleName"] = apcmd.JobScheduleName + } + if apcmd.InstanceType != "" { + objectMap["instanceType"] = apcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return &apcmd, true +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &apcmd, true +} + +// A2AProtectionIntentDiskInputDetails azure VM unmanaged disk input details. +type A2AProtectionIntentDiskInputDetails struct { + // DiskURI - The disk Uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountCustomInput - The recovery VHD storage account input. + RecoveryAzureStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"recoveryAzureStorageAccountCustomInput,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for A2AProtectionIntentDiskInputDetails struct. +func (apidid *A2AProtectionIntentDiskInputDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "diskUri": + if v != nil { + var diskURI string + err = json.Unmarshal(*v, &diskURI) + if err != nil { + return err + } + apidid.DiskURI = &diskURI + } + case "recoveryAzureStorageAccountCustomInput": + if v != nil { + recoveryAzureStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apidid.RecoveryAzureStorageAccountCustomInput = recoveryAzureStorageAccountCustomInput + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apidid.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + } + } + + return nil +} + +// A2AProtectionIntentManagedDiskInputDetails azure VM managed disk input details. +type A2AProtectionIntentManagedDiskInputDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` + // RecoveryResourceGroupCustomInput - The recovery resource group input. + RecoveryResourceGroupCustomInput BasicRecoveryResourceGroupCustomDetails `json:"recoveryResourceGroupCustomInput,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for one / single pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for A2AProtectionIntentManagedDiskInputDetails struct. +func (apimdid *A2AProtectionIntentManagedDiskInputDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "diskId": + if v != nil { + var diskID string + err = json.Unmarshal(*v, &diskID) + if err != nil { + return err + } + apimdid.DiskID = &diskID + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apimdid.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + case "recoveryResourceGroupCustomInput": + if v != nil { + recoveryResourceGroupCustomInput, err := unmarshalBasicRecoveryResourceGroupCustomDetails(*v) + if err != nil { + return err + } + apimdid.RecoveryResourceGroupCustomInput = recoveryResourceGroupCustomInput + } + case "recoveryReplicaDiskAccountType": + if v != nil { + var recoveryReplicaDiskAccountType string + err = json.Unmarshal(*v, &recoveryReplicaDiskAccountType) + if err != nil { + return err + } + apimdid.RecoveryReplicaDiskAccountType = &recoveryReplicaDiskAccountType + } + case "recoveryTargetDiskAccountType": + if v != nil { + var recoveryTargetDiskAccountType string + err = json.Unmarshal(*v, &recoveryTargetDiskAccountType) + if err != nil { + return err + } + apimdid.RecoveryTargetDiskAccountType = &recoveryTargetDiskAccountType + } + case "recoveryDiskEncryptionSetId": + if v != nil { + var recoveryDiskEncryptionSetID string + err = json.Unmarshal(*v, &recoveryDiskEncryptionSetID) + if err != nil { + return err + } + apimdid.RecoveryDiskEncryptionSetID = &recoveryDiskEncryptionSetID + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + apimdid.DiskEncryptionInfo = &diskEncryptionInfo + } + } + } + + return nil +} + +// A2ARecoveryPointDetails a2A provider specific recovery point details. +type A2ARecoveryPointDetails struct { + // RecoveryPointSyncType - A value indicating whether the recovery point is multi VM consistent. Possible values include: 'MultiVMSyncRecoveryPoint', 'PerVMRecoveryPoint' + RecoveryPointSyncType RecoveryPointSyncType `json:"recoveryPointSyncType,omitempty"` + // Disks - List of disk ids representing a recovery point. + Disks *[]string `json:"disks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) MarshalJSON() ([]byte, error) { + arpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if arpd.RecoveryPointSyncType != "" { + objectMap["recoveryPointSyncType"] = arpd.RecoveryPointSyncType + } + if arpd.Disks != nil { + objectMap["disks"] = arpd.Disks + } + if arpd.InstanceType != "" { + objectMap["instanceType"] = arpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return &arpd, true +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &arpd, true +} + +// A2ARemoveDisksInput a2A remove disk(s) input. +type A2ARemoveDisksInput struct { + // VMDisksUris - The list of vm disk vhd URIs. + VMDisksUris *[]string `json:"vmDisksUris,omitempty"` + // VMManagedDisksIds - The list of vm managed disk Ids. + VMManagedDisksIds *[]string `json:"vmManagedDisksIds,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput', 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRemoveDisksProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) MarshalJSON() ([]byte, error) { + ardi.InstanceType = InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ardi.VMDisksUris != nil { + objectMap["vmDisksUris"] = ardi.VMDisksUris + } + if ardi.VMManagedDisksIds != nil { + objectMap["vmManagedDisksIds"] = ardi.VMManagedDisksIds + } + if ardi.InstanceType != "" { + objectMap["instanceType"] = ardi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARemoveDisksInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) { + return &ardi, true +} + +// AsRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsBasicRemoveDisksProviderSpecificInput() (BasicRemoveDisksProviderSpecificInput, bool) { + return &ardi, true +} + +// A2AReplicationDetails a2A provider specific settings. +type A2AReplicationDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // InitialPrimaryZone - READ-ONLY; The initial primary availability zone. + InitialPrimaryZone *string `json:"initialPrimaryZone,omitempty"` + // InitialPrimaryFabricLocation - READ-ONLY; The initial primary fabric location. + InitialPrimaryFabricLocation *string `json:"initialPrimaryFabricLocation,omitempty"` + // InitialRecoveryZone - READ-ONLY; The initial recovery availability zone. + InitialRecoveryZone *string `json:"initialRecoveryZone,omitempty"` + // InitialPrimaryExtendedLocation - The initial primary extended location. + InitialPrimaryExtendedLocation *ExtendedLocation `json:"initialPrimaryExtendedLocation,omitempty"` + // InitialRecoveryExtendedLocation - The initial recovery extended location. + InitialRecoveryExtendedLocation *ExtendedLocation `json:"initialRecoveryExtendedLocation,omitempty"` + // InitialRecoveryFabricLocation - READ-ONLY; The initial recovery fabric location. + InitialRecoveryFabricLocation *string `json:"initialRecoveryFabricLocation,omitempty"` + // MultiVMGroupID - The multi vm group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupCreateOption - Whether Multi VM group is auto created or specified by user. Possible values include: 'AutoCreated', 'UserSpecified' + MultiVMGroupCreateOption MultiVMGroupCreateOption `json:"multiVmGroupCreateOption,omitempty"` + // ManagementID - The management Id. + ManagementID *string `json:"managementId,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]A2AProtectedDiskDetails `json:"protectedDisks,omitempty"` + // UnprotectedDisks - The list of unprotected disks. + UnprotectedDisks *[]A2AUnprotectedDiskDetails `json:"unprotectedDisks,omitempty"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]A2AProtectedManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // RecoveryBootDiagStorageAccountID - The recovery boot diagnostic storage account Arm Id. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // PrimaryFabricLocation - Primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // RecoveryFabricLocation - The recovery fabric location. + RecoveryFabricLocation *string `json:"recoveryFabricLocation,omitempty"` + // OsType - The type of operating system. + OsType *string `json:"osType,omitempty"` + // RecoveryAzureVMSize - The size of recovery virtual machine. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureVMName - The name of recovery virtual machine. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureResourceGroupID - The recovery resource group. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryCloudService - The recovery cloud service. + RecoveryCloudService *string `json:"recoveryCloudService,omitempty"` + // RecoveryAvailabilitySet - The recovery availability set. + RecoveryAvailabilitySet *string `json:"recoveryAvailabilitySet,omitempty"` + // SelectedRecoveryAzureNetworkID - The recovery virtual network. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The test failover virtual network. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // VMNics - The virtual machine nic details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMSyncedConfigDetails - The synced configuration details. + VMSyncedConfigDetails *AzureToAzureVMSyncedConfigDetails `json:"vmSyncedConfigDetails,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // IsReplicationAgentUpdateRequired - A value indicating whether replication agent update is required. + IsReplicationAgentUpdateRequired *bool `json:"isReplicationAgentUpdateRequired,omitempty"` + // AgentCertificateExpiryDate - READ-ONLY; Agent certificate expiry date. + AgentCertificateExpiryDate *date.Time `json:"agentCertificateExpiryDate,omitempty"` + // IsReplicationAgentCertificateUpdateRequired - A value indicating whether agent certificate update is required. + IsReplicationAgentCertificateUpdateRequired *bool `json:"isReplicationAgentCertificateUpdateRequired,omitempty"` + // RecoveryFabricObjectID - The recovery fabric object Id. + RecoveryFabricObjectID *string `json:"recoveryFabricObjectId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // LifecycleID - An id associated with the PE 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 item even though other internal Ids/ARM Id might be changing. + LifecycleID *string `json:"lifecycleId,omitempty"` + // TestFailoverRecoveryFabricObjectID - The test failover fabric object Id. + TestFailoverRecoveryFabricObjectID *string `json:"testFailoverRecoveryFabricObjectId,omitempty"` + // RpoInSeconds - The last RPO value in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // LastRpoCalculatedTime - The time (in UTC) when the last RPO value was calculated by Protection Service. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // PrimaryAvailabilityZone - The primary availability zone. + PrimaryAvailabilityZone *string `json:"primaryAvailabilityZone,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // PrimaryExtendedLocation - The primary Extended Location. + PrimaryExtendedLocation *ExtendedLocation `json:"primaryExtendedLocation,omitempty"` + // RecoveryExtendedLocation - The recovery Extended Location. + RecoveryExtendedLocation *ExtendedLocation `json:"recoveryExtendedLocation,omitempty"` + // VMEncryptionType - READ-ONLY; The encryption type of the VM. Possible values include: 'NotEncrypted', 'OnePassEncrypted', 'TwoPassEncrypted' + VMEncryptionType VMEncryptionType `json:"vmEncryptionType,omitempty"` + // TfoAzureVMName - The test failover vm name. + TfoAzureVMName *string `json:"tfoAzureVMName,omitempty"` + // RecoveryAzureGeneration - READ-ONLY; The recovery azure generation. + RecoveryAzureGeneration *string `json:"recoveryAzureGeneration,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // RecoveryVirtualMachineScaleSetID - The recovery virtual machine scale set id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReplicationDetails. +func (ard A2AReplicationDetails) MarshalJSON() ([]byte, error) { + ard.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ard.FabricObjectID != nil { + objectMap["fabricObjectId"] = ard.FabricObjectID + } + if ard.InitialPrimaryExtendedLocation != nil { + objectMap["initialPrimaryExtendedLocation"] = ard.InitialPrimaryExtendedLocation + } + if ard.InitialRecoveryExtendedLocation != nil { + objectMap["initialRecoveryExtendedLocation"] = ard.InitialRecoveryExtendedLocation + } + if ard.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = ard.MultiVMGroupID + } + if ard.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = ard.MultiVMGroupName + } + if ard.MultiVMGroupCreateOption != "" { + objectMap["multiVmGroupCreateOption"] = ard.MultiVMGroupCreateOption + } + if ard.ManagementID != nil { + objectMap["managementId"] = ard.ManagementID + } + if ard.ProtectedDisks != nil { + objectMap["protectedDisks"] = ard.ProtectedDisks + } + if ard.UnprotectedDisks != nil { + objectMap["unprotectedDisks"] = ard.UnprotectedDisks + } + if ard.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = ard.ProtectedManagedDisks + } + if ard.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = ard.RecoveryBootDiagStorageAccountID + } + if ard.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = ard.PrimaryFabricLocation + } + if ard.RecoveryFabricLocation != nil { + objectMap["recoveryFabricLocation"] = ard.RecoveryFabricLocation + } + if ard.OsType != nil { + objectMap["osType"] = ard.OsType + } + if ard.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = ard.RecoveryAzureVMSize + } + if ard.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVMName"] = ard.RecoveryAzureVMName + } + if ard.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = ard.RecoveryAzureResourceGroupID + } + if ard.RecoveryCloudService != nil { + objectMap["recoveryCloudService"] = ard.RecoveryCloudService + } + if ard.RecoveryAvailabilitySet != nil { + objectMap["recoveryAvailabilitySet"] = ard.RecoveryAvailabilitySet + } + if ard.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = ard.SelectedRecoveryAzureNetworkID + } + if ard.SelectedTfoAzureNetworkID != nil { + objectMap["selectedTfoAzureNetworkId"] = ard.SelectedTfoAzureNetworkID + } + if ard.VMNics != nil { + objectMap["vmNics"] = ard.VMNics + } + if ard.VMSyncedConfigDetails != nil { + objectMap["vmSyncedConfigDetails"] = ard.VMSyncedConfigDetails + } + if ard.MonitoringPercentageCompletion != nil { + objectMap["monitoringPercentageCompletion"] = ard.MonitoringPercentageCompletion + } + if ard.MonitoringJobType != nil { + objectMap["monitoringJobType"] = ard.MonitoringJobType + } + if ard.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = ard.LastHeartbeat + } + if ard.AgentVersion != nil { + objectMap["agentVersion"] = ard.AgentVersion + } + if ard.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = ard.AgentExpiryDate + } + if ard.IsReplicationAgentUpdateRequired != nil { + objectMap["isReplicationAgentUpdateRequired"] = ard.IsReplicationAgentUpdateRequired + } + if ard.IsReplicationAgentCertificateUpdateRequired != nil { + objectMap["isReplicationAgentCertificateUpdateRequired"] = ard.IsReplicationAgentCertificateUpdateRequired + } + if ard.RecoveryFabricObjectID != nil { + objectMap["recoveryFabricObjectId"] = ard.RecoveryFabricObjectID + } + if ard.VMProtectionState != nil { + objectMap["vmProtectionState"] = ard.VMProtectionState + } + if ard.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = ard.VMProtectionStateDescription + } + if ard.LifecycleID != nil { + objectMap["lifecycleId"] = ard.LifecycleID + } + if ard.TestFailoverRecoveryFabricObjectID != nil { + objectMap["testFailoverRecoveryFabricObjectId"] = ard.TestFailoverRecoveryFabricObjectID + } + if ard.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = ard.RpoInSeconds + } + if ard.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = ard.LastRpoCalculatedTime + } + if ard.PrimaryAvailabilityZone != nil { + objectMap["primaryAvailabilityZone"] = ard.PrimaryAvailabilityZone + } + if ard.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = ard.RecoveryAvailabilityZone + } + if ard.PrimaryExtendedLocation != nil { + objectMap["primaryExtendedLocation"] = ard.PrimaryExtendedLocation + } + if ard.RecoveryExtendedLocation != nil { + objectMap["recoveryExtendedLocation"] = ard.RecoveryExtendedLocation + } + if ard.TfoAzureVMName != nil { + objectMap["tfoAzureVMName"] = ard.TfoAzureVMName + } + if ard.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = ard.RecoveryProximityPlacementGroupID + } + if ard.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = ard.AutoProtectionOfDataDisk + } + if ard.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = ard.RecoveryVirtualMachineScaleSetID + } + if ard.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = ard.RecoveryCapacityReservationGroupID + } + if ard.InstanceType != "" { + objectMap["instanceType"] = ard.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return &ard, true +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &ard, true +} + +// A2AReplicationIntentDetails a2A provider specific settings. +type A2AReplicationIntentDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryLocation - The primary location for the virtual machine. + PrimaryLocation *string `json:"primaryLocation,omitempty"` + // RecoveryLocation - The recovery location for the virtual machine. + RecoveryLocation *string `json:"recoveryLocation,omitempty"` + // RecoverySubscriptionID - The recovery subscription Id of the virtual machine. + RecoverySubscriptionID *string `json:"recoverySubscriptionId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AProtectionIntentDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AProtectionIntentManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ProtectionProfile - The protection profile custom details. + ProtectionProfile BasicProtectionProfileCustomDetails `json:"protectionProfile,omitempty"` + // PrimaryStagingStorageAccount - The primary staging storage account details. + PrimaryStagingStorageAccount BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccount,omitempty"` + // RecoveryAvailabilitySet - The recovery availability set details. + RecoveryAvailabilitySet BasicRecoveryAvailabilitySetCustomDetails `json:"recoveryAvailabilitySet,omitempty"` + // RecoveryVirtualNetwork - The recovery virtual network details. + RecoveryVirtualNetwork BasicRecoveryVirtualNetworkCustomDetails `json:"recoveryVirtualNetwork,omitempty"` + // RecoveryProximityPlacementGroup - The recovery proximity placement group custom details. + RecoveryProximityPlacementGroup BasicRecoveryProximityPlacementGroupCustomDetails `json:"recoveryProximityPlacementGroup,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccount - The boot diagnostic storage account. + RecoveryBootDiagStorageAccount BasicStorageAccountCustomDetails `json:"recoveryBootDiagStorageAccount,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryAvailabilityType - The recovery availability type of the virtual machine. + RecoveryAvailabilityType *string `json:"recoveryAvailabilityType,omitempty"` + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings', 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A' + InstanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) MarshalJSON() ([]byte, error) { + arid.InstanceType = InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if arid.FabricObjectID != nil { + objectMap["fabricObjectId"] = arid.FabricObjectID + } + if arid.PrimaryLocation != nil { + objectMap["primaryLocation"] = arid.PrimaryLocation + } + if arid.RecoveryLocation != nil { + objectMap["recoveryLocation"] = arid.RecoveryLocation + } + if arid.RecoverySubscriptionID != nil { + objectMap["recoverySubscriptionId"] = arid.RecoverySubscriptionID + } + if arid.VMDisks != nil { + objectMap["vmDisks"] = arid.VMDisks + } + if arid.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = arid.VMManagedDisks + } + if arid.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = arid.RecoveryResourceGroupID + } + objectMap["protectionProfile"] = arid.ProtectionProfile + objectMap["primaryStagingStorageAccount"] = arid.PrimaryStagingStorageAccount + objectMap["recoveryAvailabilitySet"] = arid.RecoveryAvailabilitySet + objectMap["recoveryVirtualNetwork"] = arid.RecoveryVirtualNetwork + objectMap["recoveryProximityPlacementGroup"] = arid.RecoveryProximityPlacementGroup + if arid.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = arid.AutoProtectionOfDataDisk + } + if arid.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = arid.MultiVMGroupName + } + if arid.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = arid.MultiVMGroupID + } + objectMap["recoveryBootDiagStorageAccount"] = arid.RecoveryBootDiagStorageAccount + if arid.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = arid.DiskEncryptionInfo + } + if arid.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = arid.RecoveryAvailabilityZone + } + if arid.RecoveryAvailabilityType != nil { + objectMap["recoveryAvailabilityType"] = arid.RecoveryAvailabilityType + } + if arid.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = arid.AgentAutoUpdateStatus + } + if arid.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = arid.AutomationAccountArmID + } + if arid.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = arid.AutomationAccountAuthenticationType + } + if arid.InstanceType != "" { + objectMap["instanceType"] = arid.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReplicationIntentDetails is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) { + return &arid, true +} + +// AsReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsBasicReplicationProtectionIntentProviderSpecificSettings() (BasicReplicationProtectionIntentProviderSpecificSettings, bool) { + return &arid, true +} + +// UnmarshalJSON is the custom unmarshaler for A2AReplicationIntentDetails struct. +func (arid *A2AReplicationIntentDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "fabricObjectId": + if v != nil { + var fabricObjectID string + err = json.Unmarshal(*v, &fabricObjectID) + if err != nil { + return err + } + arid.FabricObjectID = &fabricObjectID + } + case "primaryLocation": + if v != nil { + var primaryLocation string + err = json.Unmarshal(*v, &primaryLocation) + if err != nil { + return err + } + arid.PrimaryLocation = &primaryLocation + } + case "recoveryLocation": + if v != nil { + var recoveryLocation string + err = json.Unmarshal(*v, &recoveryLocation) + if err != nil { + return err + } + arid.RecoveryLocation = &recoveryLocation + } + case "recoverySubscriptionId": + if v != nil { + var recoverySubscriptionID string + err = json.Unmarshal(*v, &recoverySubscriptionID) + if err != nil { + return err + } + arid.RecoverySubscriptionID = &recoverySubscriptionID + } + case "vmDisks": + if v != nil { + var VMDisks []A2AProtectionIntentDiskInputDetails + err = json.Unmarshal(*v, &VMDisks) + if err != nil { + return err + } + arid.VMDisks = &VMDisks + } + case "vmManagedDisks": + if v != nil { + var VMManagedDisks []A2AProtectionIntentManagedDiskInputDetails + err = json.Unmarshal(*v, &VMManagedDisks) + if err != nil { + return err + } + arid.VMManagedDisks = &VMManagedDisks + } + case "recoveryResourceGroupId": + if v != nil { + var recoveryResourceGroupID string + err = json.Unmarshal(*v, &recoveryResourceGroupID) + if err != nil { + return err + } + arid.RecoveryResourceGroupID = &recoveryResourceGroupID + } + case "protectionProfile": + if v != nil { + protectionProfile, err := unmarshalBasicProtectionProfileCustomDetails(*v) + if err != nil { + return err + } + arid.ProtectionProfile = protectionProfile + } + case "primaryStagingStorageAccount": + if v != nil { + primaryStagingStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + arid.PrimaryStagingStorageAccount = primaryStagingStorageAccount + } + case "recoveryAvailabilitySet": + if v != nil { + recoveryAvailabilitySet, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryAvailabilitySet = recoveryAvailabilitySet + } + case "recoveryVirtualNetwork": + if v != nil { + recoveryVirtualNetwork, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryVirtualNetwork = recoveryVirtualNetwork + } + case "recoveryProximityPlacementGroup": + if v != nil { + recoveryProximityPlacementGroup, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryProximityPlacementGroup = recoveryProximityPlacementGroup + } + case "autoProtectionOfDataDisk": + if v != nil { + var autoProtectionOfDataDisk AutoProtectionOfDataDisk + err = json.Unmarshal(*v, &autoProtectionOfDataDisk) + if err != nil { + return err + } + arid.AutoProtectionOfDataDisk = autoProtectionOfDataDisk + } + case "multiVmGroupName": + if v != nil { + var multiVMGroupName string + err = json.Unmarshal(*v, &multiVMGroupName) + if err != nil { + return err + } + arid.MultiVMGroupName = &multiVMGroupName + } + case "multiVmGroupId": + if v != nil { + var multiVMGroupID string + err = json.Unmarshal(*v, &multiVMGroupID) + if err != nil { + return err + } + arid.MultiVMGroupID = &multiVMGroupID + } + case "recoveryBootDiagStorageAccount": + if v != nil { + recoveryBootDiagStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryBootDiagStorageAccount = recoveryBootDiagStorageAccount + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + arid.DiskEncryptionInfo = &diskEncryptionInfo + } + case "recoveryAvailabilityZone": + if v != nil { + var recoveryAvailabilityZone string + err = json.Unmarshal(*v, &recoveryAvailabilityZone) + if err != nil { + return err + } + arid.RecoveryAvailabilityZone = &recoveryAvailabilityZone + } + case "recoveryAvailabilityType": + if v != nil { + var recoveryAvailabilityType string + err = json.Unmarshal(*v, &recoveryAvailabilityType) + if err != nil { + return err + } + arid.RecoveryAvailabilityType = &recoveryAvailabilityType + } + case "agentAutoUpdateStatus": + if v != nil { + var agentAutoUpdateStatus AgentAutoUpdateStatus + err = json.Unmarshal(*v, &agentAutoUpdateStatus) + if err != nil { + return err + } + arid.AgentAutoUpdateStatus = agentAutoUpdateStatus + } + case "automationAccountArmId": + if v != nil { + var automationAccountArmID string + err = json.Unmarshal(*v, &automationAccountArmID) + if err != nil { + return err + } + arid.AutomationAccountArmID = &automationAccountArmID + } + case "automationAccountAuthenticationType": + if v != nil { + var automationAccountAuthenticationType AutomationAccountAuthenticationType + err = json.Unmarshal(*v, &automationAccountAuthenticationType) + if err != nil { + return err + } + arid.AutomationAccountAuthenticationType = automationAccountAuthenticationType + } + case "instanceType": + if v != nil { + var instanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings + err = json.Unmarshal(*v, &instanceType) + if err != nil { + return err + } + arid.InstanceType = instanceType + } + } + } + + return nil +} + +// A2AReprotectInput azure specific reprotect input. +type A2AReprotectInput struct { + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReprotectInput. +func (ari A2AReprotectInput) MarshalJSON() ([]byte, error) { + ari.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ari.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = ari.RecoveryContainerID + } + if ari.VMDisks != nil { + objectMap["vmDisks"] = ari.VMDisks + } + if ari.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = ari.RecoveryResourceGroupID + } + if ari.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = ari.RecoveryCloudServiceID + } + if ari.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = ari.RecoveryAvailabilitySetID + } + if ari.PolicyID != nil { + objectMap["policyId"] = ari.PolicyID + } + if ari.InstanceType != "" { + objectMap["instanceType"] = ari.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return &ari, true +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &ari, true +} + +// A2ASwitchProtectionInput a2A specific switch protection input. +type A2ASwitchProtectionInput struct { + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // RecoveryVirtualMachineScaleSetID - The virtual machine scale set id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput', 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicSwitchProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) MarshalJSON() ([]byte, error) { + aspi.InstanceType = InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aspi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = aspi.RecoveryContainerID + } + if aspi.VMDisks != nil { + objectMap["vmDisks"] = aspi.VMDisks + } + if aspi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aspi.VMManagedDisks + } + if aspi.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aspi.RecoveryResourceGroupID + } + if aspi.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aspi.RecoveryCloudServiceID + } + if aspi.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = aspi.RecoveryAvailabilitySetID + } + if aspi.PolicyID != nil { + objectMap["policyId"] = aspi.PolicyID + } + if aspi.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aspi.RecoveryBootDiagStorageAccountID + } + if aspi.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = aspi.RecoveryAvailabilityZone + } + if aspi.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aspi.RecoveryProximityPlacementGroupID + } + if aspi.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aspi.RecoveryVirtualMachineScaleSetID + } + if aspi.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = aspi.RecoveryCapacityReservationGroupID + } + if aspi.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aspi.DiskEncryptionInfo + } + if aspi.InstanceType != "" { + objectMap["instanceType"] = aspi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ASwitchProtectionInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) { + return &aspi, true +} + +// AsSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsBasicSwitchProtectionProviderSpecificInput() (BasicSwitchProtectionProviderSpecificInput, bool) { + return &aspi, true +} + +// A2ATestFailoverInput a2A provider specific input for test failover. +type A2ATestFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for TFO or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) MarshalJSON() ([]byte, error) { + atfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if atfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = atfi.RecoveryPointID + } + if atfi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = atfi.CloudServiceCreationOption + } + if atfi.InstanceType != "" { + objectMap["instanceType"] = atfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return &atfi, true +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &atfi, true +} + +// A2AUnplannedFailoverInput a2A provider specific input for unplanned failover. +type A2AUnplannedFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for failover or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + aufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = aufi.RecoveryPointID + } + if aufi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = aufi.CloudServiceCreationOption + } + if aufi.InstanceType != "" { + objectMap["instanceType"] = aufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return &aufi, true +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &aufi, true +} + +// A2AUnprotectedDiskDetails a2A unprotected disk details. +type A2AUnprotectedDiskDetails struct { + // DiskLunID - The source lun Id for the data disk. + DiskLunID *int32 `json:"diskLunId,omitempty"` + // DiskAutoProtectionStatus - A value indicating whether the disk auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + DiskAutoProtectionStatus AutoProtectionOfDataDisk `json:"diskAutoProtectionStatus,omitempty"` +} + +// A2AUpdateContainerMappingInput a2A update protection container mapping. +type A2AUpdateContainerMappingInput struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + aucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aucmi.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = aucmi.AgentAutoUpdateStatus + } + if aucmi.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = aucmi.AutomationAccountArmID + } + if aucmi.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = aucmi.AutomationAccountAuthenticationType + } + if aucmi.InstanceType != "" { + objectMap["instanceType"] = aucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return &aucmi, true +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &aucmi, true +} + +// A2AUpdateReplicationProtectedItemInput inMage Azure V2 input to update replication protected item. +type A2AUpdateReplicationProtectedItemInput struct { + // RecoveryCloudServiceID - The target cloud service ARM Id (for V1). + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryResourceGroupID - The target resource group ARM Id (for V2). + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ManagedDiskUpdateDetails - Managed disk update details. + ManagedDiskUpdateDetails *[]A2AVMManagedDiskUpdateDetails `json:"managedDiskUpdateDetails,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // DiskEncryptionInfo - The recovery os disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // TfoAzureVMName - The user given name for Test Failover VM. + TfoAzureVMName *string `json:"tfoAzureVMName,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // RecoveryVirtualMachineScaleSetID - The recovery virtual machine scale set Id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + aurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aurpii.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aurpii.RecoveryCloudServiceID + } + if aurpii.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aurpii.RecoveryResourceGroupID + } + if aurpii.ManagedDiskUpdateDetails != nil { + objectMap["managedDiskUpdateDetails"] = aurpii.ManagedDiskUpdateDetails + } + if aurpii.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aurpii.RecoveryBootDiagStorageAccountID + } + if aurpii.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aurpii.DiskEncryptionInfo + } + if aurpii.TfoAzureVMName != nil { + objectMap["tfoAzureVMName"] = aurpii.TfoAzureVMName + } + if aurpii.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aurpii.RecoveryProximityPlacementGroupID + } + if aurpii.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aurpii.RecoveryVirtualMachineScaleSetID + } + if aurpii.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = aurpii.RecoveryCapacityReservationGroupID + } + if aurpii.InstanceType != "" { + objectMap["instanceType"] = aurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return &aurpii, true +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &aurpii, true +} + +// A2AVMDiskInputDetails a2A disk input details. +type A2AVMDiskInputDetails struct { + // DiskURI - The disk Uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountID - The recovery VHD storage account Id. + RecoveryAzureStorageAccountID *string `json:"recoveryAzureStorageAccountId,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account Id. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` +} + +// A2AVMManagedDiskInputDetails a2A managed disk input details. +type A2AVMManagedDiskInputDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account Arm Id. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // RecoveryResourceGroupID - The target resource group Arm Id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for one / single pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` +} + +// A2AVMManagedDiskUpdateDetails a2A Vm managed disk update details. +type A2AVMManagedDiskUpdateDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type before failover. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type before failover. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // DiskEncryptionInfo - The recovery os disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // FailoverDiskName - The target disk name for unplanned failover operation. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The target disk name for test failover operation. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AZoneDetails zone details data. +type A2AZoneDetails struct { + // Source - Source zone info. + Source *string `json:"source,omitempty"` + // Target - The target zone info. + Target *string `json:"target,omitempty"` +} + +// AddDisksInput input for add disk(s) operation. +type AddDisksInput struct { + // Properties - Add disks input properties. + Properties *AddDisksInputProperties `json:"properties,omitempty"` +} + +// AddDisksInputProperties add Disks input properties. +type AddDisksInputProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicAddDisksProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AddDisksInputProperties struct. +func (adip *AddDisksInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicAddDisksProviderSpecificInput(*v) + if err != nil { + return err + } + adip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicAddDisksProviderSpecificInput add Disks provider specific input. +type BasicAddDisksProviderSpecificInput interface { + AsA2AAddDisksInput() (*A2AAddDisksInput, bool) + AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) +} + +// AddDisksProviderSpecificInput add Disks provider specific input. +type AddDisksProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeAddDisksProviderSpecificInput', 'InstanceTypeA2A' + InstanceType InstanceType `json:"instanceType,omitempty"` +} + +func unmarshalBasicAddDisksProviderSpecificInput(body []byte) (BasicAddDisksProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeA2A): + var aadi A2AAddDisksInput + err := json.Unmarshal(body, &aadi) + return aadi, err + default: + var adpsi AddDisksProviderSpecificInput + err := json.Unmarshal(body, &adpsi) + return adpsi, err + } +} +func unmarshalBasicAddDisksProviderSpecificInputArray(body []byte) ([]BasicAddDisksProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + adpsiArray := make([]BasicAddDisksProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + adpsi, err := unmarshalBasicAddDisksProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + adpsiArray[index] = adpsi + } + return adpsiArray, nil +} + +// MarshalJSON is the custom marshaler for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) MarshalJSON() ([]byte, error) { + adpsi.InstanceType = InstanceTypeAddDisksProviderSpecificInput + objectMap := make(map[string]interface{}) + if adpsi.InstanceType != "" { + objectMap["instanceType"] = adpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AAddDisksInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsA2AAddDisksInput() (*A2AAddDisksInput, bool) { + return nil, false +} + +// AsAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) { + return &adpsi, true +} + +// AsBasicAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsBasicAddDisksProviderSpecificInput() (BasicAddDisksProviderSpecificInput, bool) { + return &adpsi, true +} + +// AddRecoveryServicesProviderInput input required to add a provider. +type AddRecoveryServicesProviderInput struct { + // Properties - The properties of an add provider request. + Properties *AddRecoveryServicesProviderInputProperties `json:"properties,omitempty"` +} + +// AddRecoveryServicesProviderInputProperties the properties of an add provider request. +type AddRecoveryServicesProviderInputProperties struct { + // MachineName - The name of the machine where the provider is getting added. + MachineName *string `json:"machineName,omitempty"` + // MachineID - The Id of the machine where the provider is getting added. + MachineID *string `json:"machineId,omitempty"` + // BiosID - The Bios Id of the machine. + BiosID *string `json:"biosId,omitempty"` + // AuthenticationIdentityInput - The identity provider input for DRA authentication. + AuthenticationIdentityInput *IdentityProviderInput `json:"authenticationIdentityInput,omitempty"` + // ResourceAccessIdentityInput - The identity provider input for resource access. + ResourceAccessIdentityInput *IdentityProviderInput `json:"resourceAccessIdentityInput,omitempty"` + // DataPlaneAuthenticationIdentityInput - The identity provider input for data plane authentication. + DataPlaneAuthenticationIdentityInput *IdentityProviderInput `json:"dataPlaneAuthenticationIdentityInput,omitempty"` +} + +// AddVCenterRequest input required to add vCenter. +type AddVCenterRequest struct { + // Properties - The properties of an add vCenter request. + Properties *AddVCenterRequestProperties `json:"properties,omitempty"` +} + +// AddVCenterRequestProperties the properties of an add vCenter request. +type AddVCenterRequestProperties struct { + // FriendlyName - The friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the vCenter to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // ProcessServerID - The process server Id from where the discovery is orchestrated. + ProcessServerID *string `json:"processServerId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The account Id which has privileges to discover the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// AgentDetails agent details. +type AgentDetails struct { + // AgentID - READ-ONLY; The Id of the agent running on the server. + AgentID *string `json:"agentId,omitempty"` + // MachineID - READ-ONLY; The Id of the machine to which the agent is registered. + MachineID *string `json:"machineId,omitempty"` + // BiosID - READ-ONLY; The machine BIOS Id. + BiosID *string `json:"biosId,omitempty"` + // Fqdn - READ-ONLY; The machine FQDN. + Fqdn *string `json:"fqdn,omitempty"` + // Disks - READ-ONLY; The disks. + Disks *[]AgentDiskDetails `json:"disks,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentDetails. +func (ad AgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AgentDiskDetails agent disk details. +type AgentDiskDetails struct { + // DiskID - READ-ONLY; The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LunID - READ-ONLY; The lun of disk. + LunID *int32 `json:"lunId,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentDiskDetails. +func (add AgentDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Alert implements the Alert class. +type Alert struct { + autorest.Response `json:"-"` + // Properties - Alert related data. + Properties *AlertProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Alert. +func (a Alert) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.Properties != nil { + objectMap["properties"] = a.Properties + } + if a.Location != nil { + objectMap["location"] = a.Location + } + return json.Marshal(objectMap) +} + +// AlertCollection collection of alerts. +type AlertCollection struct { + autorest.Response `json:"-"` + // Value - The list of alerts. + Value *[]Alert `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// AlertCollectionIterator provides access to a complete listing of Alert values. +type AlertCollectionIterator struct { + i int + page AlertCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AlertCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AlertCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AlertCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AlertCollectionIterator) Response() AlertCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AlertCollectionIterator) Value() Alert { + if !iter.page.NotDone() { + return Alert{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AlertCollectionIterator type. +func NewAlertCollectionIterator(page AlertCollectionPage) AlertCollectionIterator { + return AlertCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ac AlertCollection) IsEmpty() bool { + return ac.Value == nil || len(*ac.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ac AlertCollection) hasNextLink() bool { + return ac.NextLink != nil && len(*ac.NextLink) != 0 +} + +// alertCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ac AlertCollection) alertCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ac.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ac.NextLink))) +} + +// AlertCollectionPage contains a page of Alert values. +type AlertCollectionPage struct { + fn func(context.Context, AlertCollection) (AlertCollection, error) + ac AlertCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AlertCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ac) + if err != nil { + return err + } + page.ac = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AlertCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AlertCollectionPage) NotDone() bool { + return !page.ac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AlertCollectionPage) Response() AlertCollection { + return page.ac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AlertCollectionPage) Values() []Alert { + if page.ac.IsEmpty() { + return nil + } + return *page.ac.Value +} + +// Creates a new instance of the AlertCollectionPage type. +func NewAlertCollectionPage(cur AlertCollection, getNextPage func(context.Context, AlertCollection) (AlertCollection, error)) AlertCollectionPage { + return AlertCollectionPage{ + fn: getNextPage, + ac: cur, + } +} + +// AlertProperties the properties of an alert. +type AlertProperties struct { + // SendToOwners - A value indicating whether to send email to subscription administrator. + SendToOwners *string `json:"sendToOwners,omitempty"` + // CustomEmailAddresses - The custom email address for sending emails. + CustomEmailAddresses *[]string `json:"customEmailAddresses,omitempty"` + // Locale - The locale for the email notification. + Locale *string `json:"locale,omitempty"` +} + +// ApplianceCollection collection of appliance details. +type ApplianceCollection struct { + autorest.Response `json:"-"` + // Value - The appliance details. + Value *[]ReplicationAppliance `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ApplianceCollectionIterator provides access to a complete listing of ReplicationAppliance values. +type ApplianceCollectionIterator struct { + i int + page ApplianceCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ApplianceCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplianceCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ApplianceCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ApplianceCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ApplianceCollectionIterator) Response() ApplianceCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ApplianceCollectionIterator) Value() ReplicationAppliance { + if !iter.page.NotDone() { + return ReplicationAppliance{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ApplianceCollectionIterator type. +func NewApplianceCollectionIterator(page ApplianceCollectionPage) ApplianceCollectionIterator { + return ApplianceCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ac ApplianceCollection) IsEmpty() bool { + return ac.Value == nil || len(*ac.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ac ApplianceCollection) hasNextLink() bool { + return ac.NextLink != nil && len(*ac.NextLink) != 0 +} + +// applianceCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ac ApplianceCollection) applianceCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ac.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ac.NextLink))) +} + +// ApplianceCollectionPage contains a page of ReplicationAppliance values. +type ApplianceCollectionPage struct { + fn func(context.Context, ApplianceCollection) (ApplianceCollection, error) + ac ApplianceCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ApplianceCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplianceCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ac) + if err != nil { + return err + } + page.ac = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ApplianceCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ApplianceCollectionPage) NotDone() bool { + return !page.ac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ApplianceCollectionPage) Response() ApplianceCollection { + return page.ac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ApplianceCollectionPage) Values() []ReplicationAppliance { + if page.ac.IsEmpty() { + return nil + } + return *page.ac.Value +} + +// Creates a new instance of the ApplianceCollectionPage type. +func NewApplianceCollectionPage(cur ApplianceCollection, getNextPage func(context.Context, ApplianceCollection) (ApplianceCollection, error)) ApplianceCollectionPage { + return ApplianceCollectionPage{ + fn: getNextPage, + ac: cur, + } +} + +// ApplianceQueryParameter query parameter to get appliance. +type ApplianceQueryParameter struct { + // ProviderType - The providerType to be used for fetching appliance details. + ProviderType *string `json:"providerType,omitempty"` +} + +// BasicApplianceSpecificDetails appliance specific details. +type BasicApplianceSpecificDetails interface { + AsInMageRcmApplianceSpecificDetails() (*InMageRcmApplianceSpecificDetails, bool) + AsApplianceSpecificDetails() (*ApplianceSpecificDetails, bool) +} + +// ApplianceSpecificDetails appliance specific details. +type ApplianceSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeApplianceSpecificDetails', 'InstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplianceSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicApplianceSpecificDetails(body []byte) (BasicApplianceSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInMageRcm): + var imrasd InMageRcmApplianceSpecificDetails + err := json.Unmarshal(body, &imrasd) + return imrasd, err + default: + var asd ApplianceSpecificDetails + err := json.Unmarshal(body, &asd) + return asd, err + } +} +func unmarshalBasicApplianceSpecificDetailsArray(body []byte) ([]BasicApplianceSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + asdArray := make([]BasicApplianceSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + asd, err := unmarshalBasicApplianceSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + asdArray[index] = asd + } + return asdArray, nil +} + +// MarshalJSON is the custom marshaler for ApplianceSpecificDetails. +func (asd ApplianceSpecificDetails) MarshalJSON() ([]byte, error) { + asd.InstanceType = InstanceTypeApplianceSpecificDetails + objectMap := make(map[string]interface{}) + if asd.InstanceType != "" { + objectMap["instanceType"] = asd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageRcmApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for ApplianceSpecificDetails. +func (asd ApplianceSpecificDetails) AsInMageRcmApplianceSpecificDetails() (*InMageRcmApplianceSpecificDetails, bool) { + return nil, false +} + +// AsApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for ApplianceSpecificDetails. +func (asd ApplianceSpecificDetails) AsApplianceSpecificDetails() (*ApplianceSpecificDetails, bool) { + return &asd, true +} + +// AsBasicApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for ApplianceSpecificDetails. +func (asd ApplianceSpecificDetails) AsBasicApplianceSpecificDetails() (BasicApplianceSpecificDetails, bool) { + return &asd, true +} + +// ApplyRecoveryPointInput input to apply recovery point. +type ApplyRecoveryPointInput struct { + // Properties - The input properties to apply recovery point. + Properties *ApplyRecoveryPointInputProperties `json:"properties,omitempty"` +} + +// ApplyRecoveryPointInputProperties input properties to apply recovery point. +type ApplyRecoveryPointInputProperties struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // ProviderSpecificDetails - Provider specific input for applying recovery point. + ProviderSpecificDetails BasicApplyRecoveryPointProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ApplyRecoveryPointInputProperties struct. +func (arpip *ApplyRecoveryPointInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryPointId": + if v != nil { + var recoveryPointID string + err = json.Unmarshal(*v, &recoveryPointID) + if err != nil { + return err + } + arpip.RecoveryPointID = &recoveryPointID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicApplyRecoveryPointProviderSpecificInput(*v) + if err != nil { + return err + } + arpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicApplyRecoveryPointProviderSpecificInput provider specific input for apply recovery point. +type BasicApplyRecoveryPointProviderSpecificInput interface { + AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) + AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) + AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) + AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) + AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) + AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) +} + +// ApplyRecoveryPointProviderSpecificInput provider specific input for apply recovery point. +type ApplyRecoveryPointProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicApplyRecoveryPointProviderSpecificInput(body []byte) (BasicApplyRecoveryPointProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A): + var aarpi A2AApplyRecoveryPointInput + err := json.Unmarshal(body, &aarpi) + return aarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput + err := json.Unmarshal(body, &accmarpi) + return accmarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraarpi HyperVReplicaAzureApplyRecoveryPointInput + err := json.Unmarshal(body, &hvraarpi) + return hvraarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2): + var imavarpi InMageAzureV2ApplyRecoveryPointInput + err := json.Unmarshal(body, &imavarpi) + return imavarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm): + var imrarpi InMageRcmApplyRecoveryPointInput + err := json.Unmarshal(body, &imrarpi) + return imrarpi, err + default: + var arppsi ApplyRecoveryPointProviderSpecificInput + err := json.Unmarshal(body, &arppsi) + return arppsi, err + } +} +func unmarshalBasicApplyRecoveryPointProviderSpecificInputArray(body []byte) ([]BasicApplyRecoveryPointProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + arppsiArray := make([]BasicApplyRecoveryPointProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + arppsi, err := unmarshalBasicApplyRecoveryPointProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + arppsiArray[index] = arppsi + } + return arppsiArray, nil +} + +// MarshalJSON is the custom marshaler for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) MarshalJSON() ([]byte, error) { + arppsi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput + objectMap := make(map[string]interface{}) + if arppsi.InstanceType != "" { + objectMap["instanceType"] = arppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return &arppsi, true +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &arppsi, true +} + +// AsrJobDetails this class represents job details based on specific job type. +type AsrJobDetails struct { + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AsrJobDetails. +func (ajd AsrJobDetails) MarshalJSON() ([]byte, error) { + ajd.InstanceType = InstanceTypeAsrJobDetails + objectMap := make(map[string]interface{}) + if ajd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = ajd.AffectedObjectDetails + } + if ajd.InstanceType != "" { + objectMap["instanceType"] = ajd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return &ajd, true +} + +// AsExportJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &ajd, true +} + +// ASRTask task of the Job. +type ASRTask struct { + // TaskID - The Id. + TaskID *string `json:"taskId,omitempty"` + // Name - The unique Task name. + Name *string `json:"name,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // AllowedActions - The state/actions applicable on this task. + AllowedActions *[]string `json:"allowedActions,omitempty"` + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // State - The State. It is one of these values - NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or Other. + State *string `json:"state,omitempty"` + // StateDescription - The description of the task state. For example - For Succeeded state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. + StateDescription *string `json:"stateDescription,omitempty"` + // TaskType - The type of task. Details in CustomDetails property depend on this type. + TaskType *string `json:"taskType,omitempty"` + // CustomDetails - The custom task details based on the task type. + CustomDetails BasicTaskTypeDetails `json:"customDetails,omitempty"` + // GroupTaskCustomDetails - The custom task details based on the task type, if the task type is GroupTaskDetails or one of the types derived from it. + GroupTaskCustomDetails BasicGroupTaskDetails `json:"groupTaskCustomDetails,omitempty"` + // Errors - The task error details. + Errors *[]JobErrorDetails `json:"errors,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ASRTask struct. +func (at *ASRTask) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "taskId": + if v != nil { + var taskID string + err = json.Unmarshal(*v, &taskID) + if err != nil { + return err + } + at.TaskID = &taskID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + at.Name = &name + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + at.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + at.EndTime = &endTime + } + case "allowedActions": + if v != nil { + var allowedActions []string + err = json.Unmarshal(*v, &allowedActions) + if err != nil { + return err + } + at.AllowedActions = &allowedActions + } + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + at.FriendlyName = &friendlyName + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + at.State = &state + } + case "stateDescription": + if v != nil { + var stateDescription string + err = json.Unmarshal(*v, &stateDescription) + if err != nil { + return err + } + at.StateDescription = &stateDescription + } + case "taskType": + if v != nil { + var taskType string + err = json.Unmarshal(*v, &taskType) + if err != nil { + return err + } + at.TaskType = &taskType + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicTaskTypeDetails(*v) + if err != nil { + return err + } + at.CustomDetails = customDetails + } + case "groupTaskCustomDetails": + if v != nil { + groupTaskCustomDetails, err := unmarshalBasicGroupTaskDetails(*v) + if err != nil { + return err + } + at.GroupTaskCustomDetails = groupTaskCustomDetails + } + case "errors": + if v != nil { + var errorsVar []JobErrorDetails + err = json.Unmarshal(*v, &errorsVar) + if err != nil { + return err + } + at.Errors = &errorsVar + } + } + } + + return nil +} + +// AutomationRunbookTaskDetails this class represents the task details for an automation runbook. +type AutomationRunbookTaskDetails struct { + // Name - The recovery plan task name. + Name *string `json:"name,omitempty"` + // CloudServiceName - The cloud service of the automation runbook account. + CloudServiceName *string `json:"cloudServiceName,omitempty"` + // SubscriptionID - The subscription Id of the automation runbook account. + SubscriptionID *string `json:"subscriptionId,omitempty"` + // AccountName - The automation account name of the runbook. + AccountName *string `json:"accountName,omitempty"` + // RunbookID - The runbook Id. + RunbookID *string `json:"runbookId,omitempty"` + // RunbookName - The runbook name. + RunbookName *string `json:"runbookName,omitempty"` + // JobID - The job Id of the runbook execution. + JobID *string `json:"jobId,omitempty"` + // JobOutput - The execution output of the runbook. + JobOutput *string `json:"jobOutput,omitempty"` + // IsPrimarySideScript - A value indicating whether it is a primary side script or not. + IsPrimarySideScript *bool `json:"isPrimarySideScript,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) MarshalJSON() ([]byte, error) { + artd.InstanceType = InstanceTypeAutomationRunbookTaskDetails + objectMap := make(map[string]interface{}) + if artd.Name != nil { + objectMap["name"] = artd.Name + } + if artd.CloudServiceName != nil { + objectMap["cloudServiceName"] = artd.CloudServiceName + } + if artd.SubscriptionID != nil { + objectMap["subscriptionId"] = artd.SubscriptionID + } + if artd.AccountName != nil { + objectMap["accountName"] = artd.AccountName + } + if artd.RunbookID != nil { + objectMap["runbookId"] = artd.RunbookID + } + if artd.RunbookName != nil { + objectMap["runbookName"] = artd.RunbookName + } + if artd.JobID != nil { + objectMap["jobId"] = artd.JobID + } + if artd.JobOutput != nil { + objectMap["jobOutput"] = artd.JobOutput + } + if artd.IsPrimarySideScript != nil { + objectMap["isPrimarySideScript"] = artd.IsPrimarySideScript + } + if artd.InstanceType != "" { + objectMap["instanceType"] = artd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return &artd, true +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &artd, true +} + +// AzureFabricCreationInput fabric provider specific settings. +type AzureFabricCreationInput struct { + // Location - The Location. + Location *string `json:"location,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) MarshalJSON() ([]byte, error) { + afci.InstanceType = InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure + objectMap := make(map[string]interface{}) + if afci.Location != nil { + objectMap["location"] = afci.Location + } + if afci.InstanceType != "" { + objectMap["instanceType"] = afci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return &afci, true +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &afci, true +} + +// AzureFabricSpecificDetails azure Fabric Specific Details. +type AzureFabricSpecificDetails struct { + // Location - The Location for the Azure fabric. + Location *string `json:"location,omitempty"` + // ContainerIds - The container Ids for the Azure fabric. + ContainerIds *[]string `json:"containerIds,omitempty"` + // Zones - The zones. + Zones *[]A2AZoneDetails `json:"zones,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) MarshalJSON() ([]byte, error) { + afsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure + objectMap := make(map[string]interface{}) + if afsd.Location != nil { + objectMap["location"] = afsd.Location + } + if afsd.ContainerIds != nil { + objectMap["containerIds"] = afsd.ContainerIds + } + if afsd.Zones != nil { + objectMap["zones"] = afsd.Zones + } + if afsd.InstanceType != "" { + objectMap["instanceType"] = afsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return &afsd, true +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &afsd, true +} + +// AzureToAzureCreateNetworkMappingInput create network mappings input properties/behavior specific to +// Azure to Azure Network mapping. +type AzureToAzureCreateNetworkMappingInput struct { + // PrimaryNetworkID - The primary azure vnet Id. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + atacnmi.InstanceType = InstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if atacnmi.PrimaryNetworkID != nil { + objectMap["primaryNetworkId"] = atacnmi.PrimaryNetworkID + } + if atacnmi.InstanceType != "" { + objectMap["instanceType"] = atacnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return &atacnmi, true +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &atacnmi, true +} + +// AzureToAzureNetworkMappingSettings a2A Network Mapping fabric specific settings. +type AzureToAzureNetworkMappingSettings struct { + // PrimaryFabricLocation - The primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // RecoveryFabricLocation - The recovery fabric location. + RecoveryFabricLocation *string `json:"recoveryFabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) MarshalJSON() ([]byte, error) { + atanms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if atanms.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = atanms.PrimaryFabricLocation + } + if atanms.RecoveryFabricLocation != nil { + objectMap["recoveryFabricLocation"] = atanms.RecoveryFabricLocation + } + if atanms.InstanceType != "" { + objectMap["instanceType"] = atanms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return &atanms, true +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &atanms, true +} + +// AzureToAzureUpdateNetworkMappingInput updates network mappings input. +type AzureToAzureUpdateNetworkMappingInput struct { + // PrimaryNetworkID - The primary azure vnet Id. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + ataunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if ataunmi.PrimaryNetworkID != nil { + objectMap["primaryNetworkId"] = ataunmi.PrimaryNetworkID + } + if ataunmi.InstanceType != "" { + objectMap["instanceType"] = ataunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return &ataunmi, true +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &ataunmi, true +} + +// AzureToAzureVMSyncedConfigDetails azure to Azure VM synced configuration details. +type AzureToAzureVMSyncedConfigDetails struct { + // Tags - The Azure VM tags. + Tags map[string]*string `json:"tags"` + // InputEndpoints - The Azure VM input endpoints. + InputEndpoints *[]InputEndpoint `json:"inputEndpoints,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureVMSyncedConfigDetails. +func (atavscd AzureToAzureVMSyncedConfigDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if atavscd.Tags != nil { + objectMap["tags"] = atavscd.Tags + } + if atavscd.InputEndpoints != nil { + objectMap["inputEndpoints"] = atavscd.InputEndpoints + } + return json.Marshal(objectMap) +} + +// AzureVMDiskDetails disk details for E2A provider. +type AzureVMDiskDetails struct { + // VhdType - VHD type. + VhdType *string `json:"vhdType,omitempty"` + // VhdID - The VHD id. + VhdID *string `json:"vhdId,omitempty"` + // DiskID - The disk resource id. + DiskID *string `json:"diskId,omitempty"` + // VhdName - VHD name. + VhdName *string `json:"vhdName,omitempty"` + // MaxSizeMB - Max side in MB. + MaxSizeMB *string `json:"maxSizeMB,omitempty"` + // TargetDiskLocation - Blob uri of the Azure disk. + TargetDiskLocation *string `json:"targetDiskLocation,omitempty"` + // TargetDiskName - The target Azure disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` + // LunID - Ordinal\LunId of the disk for the Azure VM. + LunID *string `json:"lunId,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // CustomTargetDiskName - The custom target Azure disk name. + CustomTargetDiskName *string `json:"customTargetDiskName,omitempty"` +} + +// ComputeSizeErrorDetails represents the error used to indicate why the target compute size is not +// applicable. +type ComputeSizeErrorDetails struct { + // Message - The error message. + Message *string `json:"message,omitempty"` + // Severity - The severity of the error. + Severity *string `json:"severity,omitempty"` +} + +// BasicConfigurationSettings replication provider specific settings. +type BasicConfigurationSettings interface { + AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) + AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) + AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) + AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) + AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) + AsConfigurationSettings() (*ConfigurationSettings, bool) +} + +// ConfigurationSettings replication provider specific settings. +type ConfigurationSettings struct { + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicConfigurationSettings(body []byte) (BasicConfigurationSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeHyperVVirtualMachine): + var hvvmd HyperVVirtualMachineDetails + err := json.Unmarshal(body, &hvvmd) + return hvvmd, err + case string(InstanceTypeReplicationGroupDetails): + var rgd ReplicationGroupDetails + err := json.Unmarshal(body, &rgd) + return rgd, err + case string(InstanceTypeVmmVirtualMachine): + var vvmd VmmVirtualMachineDetails + err := json.Unmarshal(body, &vvmd) + return vvmd, err + case string(InstanceTypeVMwareVirtualMachine): + var vmvmd VMwareVirtualMachineDetails + err := json.Unmarshal(body, &vmvmd) + return vmvmd, err + default: + var cs ConfigurationSettings + err := json.Unmarshal(body, &cs) + return cs, err + } +} +func unmarshalBasicConfigurationSettingsArray(body []byte) ([]BasicConfigurationSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + csArray := make([]BasicConfigurationSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cs, err := unmarshalBasicConfigurationSettings(*rawMessage) + if err != nil { + return nil, err + } + csArray[index] = cs + } + return csArray, nil +} + +// MarshalJSON is the custom marshaler for ConfigurationSettings. +func (cs ConfigurationSettings) MarshalJSON() ([]byte, error) { + cs.InstanceType = InstanceTypeConfigurationSettings + objectMap := make(map[string]interface{}) + if cs.InstanceType != "" { + objectMap["instanceType"] = cs.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return &cs, true +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &cs, true +} + +// ConfigureAlertRequest request to configure alerts for the system. +type ConfigureAlertRequest struct { + // Properties - The properties of a configure alert request. + Properties *ConfigureAlertRequestProperties `json:"properties,omitempty"` +} + +// ConfigureAlertRequestProperties properties of a configure alert request. +type ConfigureAlertRequestProperties struct { + // SendToOwners - A value indicating whether to send email to subscription administrator. + SendToOwners *string `json:"sendToOwners,omitempty"` + // CustomEmailAddresses - The custom email address for sending emails. + CustomEmailAddresses *[]string `json:"customEmailAddresses,omitempty"` + // Locale - The locale for the email notification. + Locale *string `json:"locale,omitempty"` +} + +// ConsistencyCheckTaskDetails this class contains monitoring details of all the inconsistent Protected +// Entities in Vmm. +type ConsistencyCheckTaskDetails struct { + // VMDetails - The list of inconsistent Vm details. + VMDetails *[]InconsistentVMDetails `json:"vmDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) MarshalJSON() ([]byte, error) { + cctd.InstanceType = InstanceTypeConsistencyCheckTaskDetails + objectMap := make(map[string]interface{}) + if cctd.VMDetails != nil { + objectMap["vmDetails"] = cctd.VMDetails + } + if cctd.InstanceType != "" { + objectMap["instanceType"] = cctd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return &cctd, true +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &cctd, true +} + +// CreateNetworkMappingInput create network mappings input. +type CreateNetworkMappingInput struct { + // Properties - Input properties for creating network mapping. + Properties *CreateNetworkMappingInputProperties `json:"properties,omitempty"` +} + +// CreateNetworkMappingInputProperties common input details for network mapping operation. +type CreateNetworkMappingInputProperties struct { + // RecoveryFabricName - Recovery fabric Name. + RecoveryFabricName *string `json:"recoveryFabricName,omitempty"` + // RecoveryNetworkID - Recovery network Id. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // FabricSpecificDetails - Fabric specific input properties. + FabricSpecificDetails BasicFabricSpecificCreateNetworkMappingInput `json:"fabricSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateNetworkMappingInputProperties struct. +func (cnmip *CreateNetworkMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryFabricName": + if v != nil { + var recoveryFabricName string + err = json.Unmarshal(*v, &recoveryFabricName) + if err != nil { + return err + } + cnmip.RecoveryFabricName = &recoveryFabricName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + cnmip.RecoveryNetworkID = &recoveryNetworkID + } + case "fabricSpecificDetails": + if v != nil { + fabricSpecificDetails, err := unmarshalBasicFabricSpecificCreateNetworkMappingInput(*v) + if err != nil { + return err + } + cnmip.FabricSpecificDetails = fabricSpecificDetails + } + } + } + + return nil +} + +// CreatePolicyInput protection Policy input. +type CreatePolicyInput struct { + // Properties - Policy creation properties. + Properties *CreatePolicyInputProperties `json:"properties,omitempty"` +} + +// CreatePolicyInputProperties policy creation properties. +type CreatePolicyInputProperties struct { + // ProviderSpecificInput - The ReplicationProviderSettings. + ProviderSpecificInput BasicPolicyProviderSpecificInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreatePolicyInputProperties struct. +func (cpip *CreatePolicyInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicPolicyProviderSpecificInput(*v) + if err != nil { + return err + } + cpip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionContainerInput create protection container input. +type CreateProtectionContainerInput struct { + // Properties - Create protection container input properties. + Properties *CreateProtectionContainerInputProperties `json:"properties,omitempty"` +} + +// CreateProtectionContainerInputProperties create protection container input properties. +type CreateProtectionContainerInputProperties struct { + // ProviderSpecificInput - Provider specific inputs for container creation. + ProviderSpecificInput *[]BasicReplicationProviderSpecificContainerCreationInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionContainerInputProperties struct. +func (cpcip *CreateProtectionContainerInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificContainerCreationInputArray(*v) + if err != nil { + return err + } + cpcip.ProviderSpecificInput = &providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionContainerMappingInput configure pairing input. +type CreateProtectionContainerMappingInput struct { + // Properties - Configure protection input properties. + Properties *CreateProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// CreateProtectionContainerMappingInputProperties configure pairing input properties. +type CreateProtectionContainerMappingInputProperties struct { + // TargetProtectionContainerID - The target unique protection container name. + TargetProtectionContainerID *string `json:"targetProtectionContainerId,omitempty"` + // PolicyID - Applicable policy. + PolicyID *string `json:"policyId,omitempty"` + // ProviderSpecificInput - Provider specific input for pairing. + ProviderSpecificInput BasicReplicationProviderSpecificContainerMappingInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionContainerMappingInputProperties struct. +func (cpcmip *CreateProtectionContainerMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetProtectionContainerId": + if v != nil { + var targetProtectionContainerID string + err = json.Unmarshal(*v, &targetProtectionContainerID) + if err != nil { + return err + } + cpcmip.TargetProtectionContainerID = &targetProtectionContainerID + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + cpcmip.PolicyID = &policyID + } + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificContainerMappingInput(*v) + if err != nil { + return err + } + cpcmip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionIntentInput create protection intent input. +type CreateProtectionIntentInput struct { + // Properties - Create protection intent input properties. + Properties *CreateProtectionIntentProperties `json:"properties,omitempty"` +} + +// CreateProtectionIntentProperties create protection intent input properties. +type CreateProtectionIntentProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For A2A provider, it will be A2ACreateProtectionIntentInput object. + ProviderSpecificDetails BasicCreateProtectionIntentProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionIntentProperties struct. +func (cpip *CreateProtectionIntentProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicCreateProtectionIntentProviderSpecificDetails(*v) + if err != nil { + return err + } + cpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicCreateProtectionIntentProviderSpecificDetails create protection intent provider specific input. +type BasicCreateProtectionIntentProviderSpecificDetails interface { + AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) + AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) +} + +// CreateProtectionIntentProviderSpecificDetails create protection intent provider specific input. +type CreateProtectionIntentProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails', 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicCreateProtectionIntentProviderSpecificDetails(body []byte) (BasicCreateProtectionIntentProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A): + var acpii A2ACreateProtectionIntentInput + err := json.Unmarshal(body, &acpii) + return acpii, err + default: + var cpipsd CreateProtectionIntentProviderSpecificDetails + err := json.Unmarshal(body, &cpipsd) + return cpipsd, err + } +} +func unmarshalBasicCreateProtectionIntentProviderSpecificDetailsArray(body []byte) ([]BasicCreateProtectionIntentProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + cpipsdArray := make([]BasicCreateProtectionIntentProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cpipsd, err := unmarshalBasicCreateProtectionIntentProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + cpipsdArray[index] = cpipsd + } + return cpipsdArray, nil +} + +// MarshalJSON is the custom marshaler for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) MarshalJSON() ([]byte, error) { + cpipsd.InstanceType = InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails + objectMap := make(map[string]interface{}) + if cpipsd.InstanceType != "" { + objectMap["instanceType"] = cpipsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACreateProtectionIntentInput is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) { + return nil, false +} + +// AsCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) { + return &cpipsd, true +} + +// AsBasicCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsBasicCreateProtectionIntentProviderSpecificDetails() (BasicCreateProtectionIntentProviderSpecificDetails, bool) { + return &cpipsd, true +} + +// CreateRecoveryPlanInput create recovery plan input class. +type CreateRecoveryPlanInput struct { + // Properties - Recovery plan creation properties. + Properties *CreateRecoveryPlanInputProperties `json:"properties,omitempty"` +} + +// CreateRecoveryPlanInputProperties recovery plan creation properties. +type CreateRecoveryPlanInputProperties struct { + // PrimaryFabricID - The primary fabric Id. + PrimaryFabricID *string `json:"primaryFabricId,omitempty"` + // RecoveryFabricID - The recovery fabric Id. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // FailoverDeploymentModel - The failover deployment model. Possible values include: 'NotApplicable', 'Classic', 'ResourceManager' + FailoverDeploymentModel FailoverDeploymentModel `json:"failoverDeploymentModel,omitempty"` + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` + // ProviderSpecificInput - The provider specific input. + ProviderSpecificInput *[]BasicRecoveryPlanProviderSpecificInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateRecoveryPlanInputProperties struct. +func (crpip *CreateRecoveryPlanInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "primaryFabricId": + if v != nil { + var primaryFabricID string + err = json.Unmarshal(*v, &primaryFabricID) + if err != nil { + return err + } + crpip.PrimaryFabricID = &primaryFabricID + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + crpip.RecoveryFabricID = &recoveryFabricID + } + case "failoverDeploymentModel": + if v != nil { + var failoverDeploymentModel FailoverDeploymentModel + err = json.Unmarshal(*v, &failoverDeploymentModel) + if err != nil { + return err + } + crpip.FailoverDeploymentModel = failoverDeploymentModel + } + case "groups": + if v != nil { + var groups []RecoveryPlanGroup + err = json.Unmarshal(*v, &groups) + if err != nil { + return err + } + crpip.Groups = &groups + } + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicRecoveryPlanProviderSpecificInputArray(*v) + if err != nil { + return err + } + crpip.ProviderSpecificInput = &providerSpecificInput + } + } + } + + return nil +} + +// CurrentJobDetails current job details of the migration item. +type CurrentJobDetails struct { + // JobName - READ-ONLY; The job name. + JobName *string `json:"jobName,omitempty"` + // JobID - READ-ONLY; The ARM Id of the job being executed. + JobID *string `json:"jobId,omitempty"` + // StartTime - READ-ONLY; The start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for CurrentJobDetails. +func (cjd CurrentJobDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CurrentScenarioDetails current scenario details of the protected entity. +type CurrentScenarioDetails struct { + // ScenarioName - Scenario name. + ScenarioName *string `json:"scenarioName,omitempty"` + // JobID - ARM Id of the job being executed. + JobID *string `json:"jobId,omitempty"` + // StartTime - Start time of the workflow. + StartTime *date.Time `json:"startTime,omitempty"` +} + +// DataStore the datastore details of the MT. +type DataStore struct { + // SymbolicName - The symbolic name of data store. + SymbolicName *string `json:"symbolicName,omitempty"` + // UUID - The uuid of data store. + UUID *string `json:"uuid,omitempty"` + // Capacity - The capacity of data store in GBs. + Capacity *string `json:"capacity,omitempty"` + // FreeSpace - The free space of data store in GBs. + FreeSpace *string `json:"freeSpace,omitempty"` + // Type - The type of data store. + Type *string `json:"type,omitempty"` +} + +// DisableProtectionInput disable protection input. +type DisableProtectionInput struct { + // Properties - Disable protection input properties. + Properties *DisableProtectionInputProperties `json:"properties,omitempty"` +} + +// DisableProtectionInputProperties disable protection input properties. +type DisableProtectionInputProperties struct { + // DisableProtectionReason - Disable protection reason. It can have values NotSpecified/MigrationComplete. Possible values include: 'NotSpecified', 'MigrationComplete' + DisableProtectionReason DisableProtectionReason `json:"disableProtectionReason,omitempty"` + // ReplicationProviderInput - Replication provider specific input. + ReplicationProviderInput BasicDisableProtectionProviderSpecificInput `json:"replicationProviderInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DisableProtectionInputProperties struct. +func (dpip *DisableProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "disableProtectionReason": + if v != nil { + var disableProtectionReason DisableProtectionReason + err = json.Unmarshal(*v, &disableProtectionReason) + if err != nil { + return err + } + dpip.DisableProtectionReason = disableProtectionReason + } + case "replicationProviderInput": + if v != nil { + replicationProviderInput, err := unmarshalBasicDisableProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + dpip.ReplicationProviderInput = replicationProviderInput + } + } + } + + return nil +} + +// BasicDisableProtectionProviderSpecificInput disable protection provider specific input. +type BasicDisableProtectionProviderSpecificInput interface { + AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) + AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) +} + +// DisableProtectionProviderSpecificInput disable protection provider specific input. +type DisableProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeDisableProtectionProviderSpecificInput', 'InstanceTypeInMage' + InstanceType InstanceTypeBasicDisableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicDisableProtectionProviderSpecificInput(body []byte) (BasicDisableProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInMage): + var imdppsi InMageDisableProtectionProviderSpecificInput + err := json.Unmarshal(body, &imdppsi) + return imdppsi, err + default: + var dppsi DisableProtectionProviderSpecificInput + err := json.Unmarshal(body, &dppsi) + return dppsi, err + } +} +func unmarshalBasicDisableProtectionProviderSpecificInputArray(body []byte) ([]BasicDisableProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dppsiArray := make([]BasicDisableProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + dppsi, err := unmarshalBasicDisableProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + dppsiArray[index] = dppsi + } + return dppsiArray, nil +} + +// MarshalJSON is the custom marshaler for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + dppsi.InstanceType = InstanceTypeDisableProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if dppsi.InstanceType != "" { + objectMap["instanceType"] = dppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) { + return &dppsi, true +} + +// AsBasicDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsBasicDisableProtectionProviderSpecificInput() (BasicDisableProtectionProviderSpecificInput, bool) { + return &dppsi, true +} + +// DiscoverProtectableItemRequest request to add a physical machine as a protectable item in a container. +type DiscoverProtectableItemRequest struct { + // Properties - The properties of a discover protectable item request. + Properties *DiscoverProtectableItemRequestProperties `json:"properties,omitempty"` +} + +// DiscoverProtectableItemRequestProperties discover protectable item properties. +type DiscoverProtectableItemRequestProperties struct { + // FriendlyName - The friendly name of the physical machine. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the physical machine to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // OsType - The OS type on the physical machine. + OsType *string `json:"osType,omitempty"` +} + +// DiskDetails onprem disk details data. +type DiskDetails struct { + // MaxSizeMB - The hard disk max size in MB. + MaxSizeMB *int64 `json:"maxSizeMB,omitempty"` + // VhdType - The type of the volume. + VhdType *string `json:"vhdType,omitempty"` + // VhdID - The VHD Id. + VhdID *string `json:"vhdId,omitempty"` + // VhdName - The VHD name. + VhdName *string `json:"vhdName,omitempty"` +} + +// DiskEncryptionInfo recovery disk encryption info (BEK and KEK). +type DiskEncryptionInfo struct { + // DiskEncryptionKeyInfo - The recovery KeyVault reference for secret. + DiskEncryptionKeyInfo *DiskEncryptionKeyInfo `json:"diskEncryptionKeyInfo,omitempty"` + // KeyEncryptionKeyInfo - The recovery KeyVault reference for key. + KeyEncryptionKeyInfo *KeyEncryptionKeyInfo `json:"keyEncryptionKeyInfo,omitempty"` +} + +// DiskEncryptionKeyInfo disk Encryption Key Information (BitLocker Encryption Key (BEK) on Windows). +type DiskEncryptionKeyInfo struct { + // SecretIdentifier - The secret url / identifier. + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // KeyVaultResourceArmID - The KeyVault resource ARM id for secret. + KeyVaultResourceArmID *string `json:"keyVaultResourceArmId,omitempty"` +} + +// DiskVolumeDetails volume details. +type DiskVolumeDetails struct { + // Label - The volume label. + Label *string `json:"label,omitempty"` + // Name - The volume name. + Name *string `json:"name,omitempty"` +} + +// Display contains the localized display information for this particular operation / action. These value +// will be used by several clients for (1) custom role definitions for RBAC; (2) complex query filters for +// the event service; and (3) audit history / records for management operations. +type Display struct { + // Provider - The provider. The localized friendly form of the resource provider name - it is expected to also include the publisher/company responsible. It should use Title Casing and begin with "Microsoft" for 1st party services. e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". + Provider *string `json:"provider,omitempty"` + // Resource - The resource. The localized friendly form of the resource related to this action/operation - it should match the public documentation for the resource provider. It should use Title Casing. This value should be unique for a particular URL type (e.g. nested types should *not* reuse their parent's display.resource field). e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual Machine VM Sizes" or "Scheduler Jobs". + Resource *string `json:"resource,omitempty"` + // Operation - The operation. The localized friendly name for the operation, as it should be shown to the user. It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use Title Casing. Prescriptive guidance: Read Create or Update Delete 'ActionName'. + Operation *string `json:"operation,omitempty"` + // Description - The description. The localized friendly description for the operation, as it should be shown to the user. It should be thorough, yet concise - it will be used in tool tips and detailed views. Prescriptive guidance for namespaces: Read any 'display.provider' resource Create or Update any 'display.provider' resource Delete any 'display.provider' resource Perform any other action on any 'display.provider' resource Prescriptive guidance for namespaces: Read any 'display.resource' Create or Update any 'display.resource' Delete any 'display.resource' 'ActionName' any 'display.resources'. + Description *string `json:"description,omitempty"` +} + +// DraDetails DRA details. +type DraDetails struct { + // ID - READ-ONLY; The DRA Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The DRA name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The DRA Bios Id. + BiosID *string `json:"biosId,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the DRA. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // ForwardProtectedItemCount - READ-ONLY; The count of protected items which are protected in forward direction. + ForwardProtectedItemCount *int32 `json:"forwardProtectedItemCount,omitempty"` + // ReverseProtectedItemCount - READ-ONLY; The count of protected items which are protected in reverse direction. + ReverseProtectedItemCount *int32 `json:"reverseProtectedItemCount,omitempty"` +} + +// MarshalJSON is the custom marshaler for DraDetails. +func (dd DraDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// EnableMigrationInput enable migration input. +type EnableMigrationInput struct { + // Properties - Enable migration input properties. + Properties *EnableMigrationInputProperties `json:"properties,omitempty"` +} + +// EnableMigrationInputProperties enable migration input properties. +type EnableMigrationInputProperties struct { + // PolicyID - The policy Id. + PolicyID *string `json:"policyId,omitempty"` + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicEnableMigrationProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EnableMigrationInputProperties struct. +func (emip *EnableMigrationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + emip.PolicyID = &policyID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEnableMigrationProviderSpecificInput(*v) + if err != nil { + return err + } + emip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicEnableMigrationProviderSpecificInput enable migration provider specific input. +type BasicEnableMigrationProviderSpecificInput interface { + AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) + AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) +} + +// EnableMigrationProviderSpecificInput enable migration provider specific input. +type EnableMigrationProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeEnableMigrationProviderSpecificInput', 'InstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEnableMigrationProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicEnableMigrationProviderSpecificInput(body []byte) (BasicEnableMigrationProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeVMwareCbt): + var vmcemi VMwareCbtEnableMigrationInput + err := json.Unmarshal(body, &vmcemi) + return vmcemi, err + default: + var empsi EnableMigrationProviderSpecificInput + err := json.Unmarshal(body, &empsi) + return empsi, err + } +} +func unmarshalBasicEnableMigrationProviderSpecificInputArray(body []byte) ([]BasicEnableMigrationProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + empsiArray := make([]BasicEnableMigrationProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + empsi, err := unmarshalBasicEnableMigrationProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + empsiArray[index] = empsi + } + return empsiArray, nil +} + +// MarshalJSON is the custom marshaler for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) MarshalJSON() ([]byte, error) { + empsi.InstanceType = InstanceTypeEnableMigrationProviderSpecificInput + objectMap := make(map[string]interface{}) + if empsi.InstanceType != "" { + objectMap["instanceType"] = empsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtEnableMigrationInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) { + return nil, false +} + +// AsEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) { + return &empsi, true +} + +// AsBasicEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsBasicEnableMigrationProviderSpecificInput() (BasicEnableMigrationProviderSpecificInput, bool) { + return &empsi, true +} + +// EnableProtectionInput enable protection input. +type EnableProtectionInput struct { + // Properties - Enable protection input properties. + Properties *EnableProtectionInputProperties `json:"properties,omitempty"` +} + +// EnableProtectionInputProperties enable protection input properties. +type EnableProtectionInputProperties struct { + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // ProtectableItemID - The protectable item Id. + ProtectableItemID *string `json:"protectableItemId,omitempty"` + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicEnableProtectionProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EnableProtectionInputProperties struct. +func (epip *EnableProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + epip.PolicyID = &policyID + } + case "protectableItemId": + if v != nil { + var protectableItemID string + err = json.Unmarshal(*v, &protectableItemID) + if err != nil { + return err + } + epip.ProtectableItemID = &protectableItemID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEnableProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + epip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicEnableProtectionProviderSpecificInput enable protection provider specific input. +type BasicEnableProtectionProviderSpecificInput interface { + AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) + AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) + AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) + AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) + AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) + AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) + AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) +} + +// EnableProtectionProviderSpecificInput enable protection provider specific input. +type EnableProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicEnableProtectionProviderSpecificInput(body []byte) (BasicEnableProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmepi A2ACrossClusterMigrationEnableProtectionInput + err := json.Unmarshal(body, &accmepi) + return accmepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A): + var aepi A2AEnableProtectionInput + err := json.Unmarshal(body, &aepi) + return aepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraepi HyperVReplicaAzureEnableProtectionInput + err := json.Unmarshal(body, &hvraepi) + return hvraepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2): + var imavepi InMageAzureV2EnableProtectionInput + err := json.Unmarshal(body, &imavepi) + return imavepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage): + var imepi InMageEnableProtectionInput + err := json.Unmarshal(body, &imepi) + return imepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm): + var imrepi InMageRcmEnableProtectionInput + err := json.Unmarshal(body, &imrepi) + return imrepi, err + default: + var eppsi EnableProtectionProviderSpecificInput + err := json.Unmarshal(body, &eppsi) + return eppsi, err + } +} +func unmarshalBasicEnableProtectionProviderSpecificInputArray(body []byte) ([]BasicEnableProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + eppsiArray := make([]BasicEnableProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + eppsi, err := unmarshalBasicEnableProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + eppsiArray[index] = eppsi + } + return eppsiArray, nil +} + +// MarshalJSON is the custom marshaler for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + eppsi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if eppsi.InstanceType != "" { + objectMap["instanceType"] = eppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return &eppsi, true +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &eppsi, true +} + +// EncryptionDetails encryption details for the fabric. +type EncryptionDetails struct { + // KekState - The key encryption key state for the Vmm. + KekState *string `json:"kekState,omitempty"` + // KekCertThumbprint - The key encryption key certificate thumbprint. + KekCertThumbprint *string `json:"kekCertThumbprint,omitempty"` + // KekCertExpiryDate - The key encryption key certificate expiry date. + KekCertExpiryDate *date.Time `json:"kekCertExpiryDate,omitempty"` +} + +// Event implements the Event class. +type Event struct { + autorest.Response `json:"-"` + // Properties - Event related data. + Properties *EventProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Event. +func (e Event) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if e.Properties != nil { + objectMap["properties"] = e.Properties + } + if e.Location != nil { + objectMap["location"] = e.Location + } + return json.Marshal(objectMap) +} + +// EventCollection collection of fabric details. +type EventCollection struct { + autorest.Response `json:"-"` + // Value - The list of events. + Value *[]Event `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// EventCollectionIterator provides access to a complete listing of Event values. +type EventCollectionIterator struct { + i int + page EventCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *EventCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EventCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *EventCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EventCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter EventCollectionIterator) Response() EventCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter EventCollectionIterator) Value() Event { + if !iter.page.NotDone() { + return Event{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the EventCollectionIterator type. +func NewEventCollectionIterator(page EventCollectionPage) EventCollectionIterator { + return EventCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ec EventCollection) IsEmpty() bool { + return ec.Value == nil || len(*ec.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ec EventCollection) hasNextLink() bool { + return ec.NextLink != nil && len(*ec.NextLink) != 0 +} + +// eventCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ec EventCollection) eventCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ec.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ec.NextLink))) +} + +// EventCollectionPage contains a page of Event values. +type EventCollectionPage struct { + fn func(context.Context, EventCollection) (EventCollection, error) + ec EventCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *EventCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EventCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ec) + if err != nil { + return err + } + page.ec = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *EventCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EventCollectionPage) NotDone() bool { + return !page.ec.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EventCollectionPage) Response() EventCollection { + return page.ec +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EventCollectionPage) Values() []Event { + if page.ec.IsEmpty() { + return nil + } + return *page.ec.Value +} + +// Creates a new instance of the EventCollectionPage type. +func NewEventCollectionPage(cur EventCollection, getNextPage func(context.Context, EventCollection) (EventCollection, error)) EventCollectionPage { + return EventCollectionPage{ + fn: getNextPage, + ec: cur, + } +} + +// EventProperties the properties of a monitoring event. +type EventProperties struct { + // EventCode - The Id of the monitoring event. + EventCode *string `json:"eventCode,omitempty"` + // Description - The event name. + Description *string `json:"description,omitempty"` + // EventType - The type of the event. for example: VM Health, Server Health, Job Failure etc. + EventType *string `json:"eventType,omitempty"` + // AffectedObjectFriendlyName - The friendly name of the source of the event on which it is raised (for example, VM, VMM etc). + AffectedObjectFriendlyName *string `json:"affectedObjectFriendlyName,omitempty"` + // AffectedObjectCorrelationID - The affected object correlationId for the event. + AffectedObjectCorrelationID *string `json:"affectedObjectCorrelationId,omitempty"` + // Severity - The severity of the event. + Severity *string `json:"severity,omitempty"` + // TimeOfOccurrence - The time of occurrence of the event. + TimeOfOccurrence *date.Time `json:"timeOfOccurrence,omitempty"` + // FabricID - The ARM ID of the fabric. + FabricID *string `json:"fabricId,omitempty"` + // ProviderSpecificDetails - The provider specific settings. + ProviderSpecificDetails BasicEventProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` + // EventSpecificDetails - The event specific settings. + EventSpecificDetails BasicEventSpecificDetails `json:"eventSpecificDetails,omitempty"` + // HealthErrors - The list of errors / warnings capturing details associated with the issue(s). + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EventProperties struct. +func (ep *EventProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "eventCode": + if v != nil { + var eventCode string + err = json.Unmarshal(*v, &eventCode) + if err != nil { + return err + } + ep.EventCode = &eventCode + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ep.Description = &description + } + case "eventType": + if v != nil { + var eventType string + err = json.Unmarshal(*v, &eventType) + if err != nil { + return err + } + ep.EventType = &eventType + } + case "affectedObjectFriendlyName": + if v != nil { + var affectedObjectFriendlyName string + err = json.Unmarshal(*v, &affectedObjectFriendlyName) + if err != nil { + return err + } + ep.AffectedObjectFriendlyName = &affectedObjectFriendlyName + } + case "affectedObjectCorrelationId": + if v != nil { + var affectedObjectCorrelationID string + err = json.Unmarshal(*v, &affectedObjectCorrelationID) + if err != nil { + return err + } + ep.AffectedObjectCorrelationID = &affectedObjectCorrelationID + } + case "severity": + if v != nil { + var severity string + err = json.Unmarshal(*v, &severity) + if err != nil { + return err + } + ep.Severity = &severity + } + case "timeOfOccurrence": + if v != nil { + var timeOfOccurrence date.Time + err = json.Unmarshal(*v, &timeOfOccurrence) + if err != nil { + return err + } + ep.TimeOfOccurrence = &timeOfOccurrence + } + case "fabricId": + if v != nil { + var fabricID string + err = json.Unmarshal(*v, &fabricID) + if err != nil { + return err + } + ep.FabricID = &fabricID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEventProviderSpecificDetails(*v) + if err != nil { + return err + } + ep.ProviderSpecificDetails = providerSpecificDetails + } + case "eventSpecificDetails": + if v != nil { + eventSpecificDetails, err := unmarshalBasicEventSpecificDetails(*v) + if err != nil { + return err + } + ep.EventSpecificDetails = eventSpecificDetails + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + ep.HealthErrors = &healthErrors + } + } + } + + return nil +} + +// BasicEventProviderSpecificDetails model class for provider specific details for an event. +type BasicEventProviderSpecificDetails interface { + AsA2AEventDetails() (*A2AEventDetails, bool) + AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) + AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) + AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) + AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) + AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) + AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) + AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) + AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) + AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) +} + +// EventProviderSpecificDetails model class for provider specific details for an event. +type EventProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicEventProviderSpecificDetails(body []byte) (BasicEventProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A): + var aed A2AEventDetails + err := json.Unmarshal(body, &aed) + return aed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012): + var hvr2ed HyperVReplica2012EventDetails + err := json.Unmarshal(body, &hvr2ed) + return hvr2ed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2): + var hvr2ed HyperVReplica2012R2EventDetails + err := json.Unmarshal(body, &hvr2ed) + return hvr2ed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure): + var hvraed HyperVReplicaAzureEventDetails + err := json.Unmarshal(body, &hvraed) + return hvraed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails): + var hvrbed HyperVReplicaBaseEventDetails + err := json.Unmarshal(body, &hvrbed) + return hvrbed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2): + var imaved InMageAzureV2EventDetails + err := json.Unmarshal(body, &imaved) + return imaved, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm): + var imred InMageRcmEventDetails + err := json.Unmarshal(body, &imred) + return imred, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback): + var imrfed InMageRcmFailbackEventDetails + err := json.Unmarshal(body, &imrfed) + return imrfed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt): + var vmced VMwareCbtEventDetails + err := json.Unmarshal(body, &vmced) + return vmced, err + default: + var epsd EventProviderSpecificDetails + err := json.Unmarshal(body, &epsd) + return epsd, err + } +} +func unmarshalBasicEventProviderSpecificDetailsArray(body []byte) ([]BasicEventProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + epsdArray := make([]BasicEventProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + epsd, err := unmarshalBasicEventProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + epsdArray[index] = epsd + } + return epsdArray, nil +} + +// MarshalJSON is the custom marshaler for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) MarshalJSON() ([]byte, error) { + epsd.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails + objectMap := make(map[string]interface{}) + if epsd.InstanceType != "" { + objectMap["instanceType"] = epsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return &epsd, true +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &epsd, true +} + +// EventQueryParameter implements the event query parameter. +type EventQueryParameter struct { + // EventCode - The source id of the events to be queried. + EventCode *string `json:"eventCode,omitempty"` + // Severity - The severity of the events to be queried. + Severity *string `json:"severity,omitempty"` + // EventType - The type of the events to be queried. + EventType *string `json:"eventType,omitempty"` + // FabricName - The affected object server id of the events to be queried. + FabricName *string `json:"fabricName,omitempty"` + // AffectedObjectFriendlyName - The affected object name of the events to be queried. + AffectedObjectFriendlyName *string `json:"affectedObjectFriendlyName,omitempty"` + // AffectedObjectCorrelationID - The affected object correlationId for the events to be queried. + AffectedObjectCorrelationID *string `json:"affectedObjectCorrelationId,omitempty"` + // StartTime - The start time of the time range within which the events are to be queried. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time of the time range within which the events are to be queried. + EndTime *date.Time `json:"endTime,omitempty"` +} + +// BasicEventSpecificDetails model class for event specific details for an event. +type BasicEventSpecificDetails interface { + AsJobStatusEventDetails() (*JobStatusEventDetails, bool) + AsEventSpecificDetails() (*EventSpecificDetails, bool) +} + +// EventSpecificDetails model class for event specific details for an event. +type EventSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeEventSpecificDetails', 'InstanceTypeJobStatus' + InstanceType InstanceTypeBasicEventSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicEventSpecificDetails(body []byte) (BasicEventSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeJobStatus): + var jsed JobStatusEventDetails + err := json.Unmarshal(body, &jsed) + return jsed, err + default: + var esd EventSpecificDetails + err := json.Unmarshal(body, &esd) + return esd, err + } +} +func unmarshalBasicEventSpecificDetailsArray(body []byte) ([]BasicEventSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + esdArray := make([]BasicEventSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + esd, err := unmarshalBasicEventSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + esdArray[index] = esd + } + return esdArray, nil +} + +// MarshalJSON is the custom marshaler for EventSpecificDetails. +func (esd EventSpecificDetails) MarshalJSON() ([]byte, error) { + esd.InstanceType = InstanceTypeEventSpecificDetails + objectMap := make(map[string]interface{}) + if esd.InstanceType != "" { + objectMap["instanceType"] = esd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsJobStatusEventDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsJobStatusEventDetails() (*JobStatusEventDetails, bool) { + return nil, false +} + +// AsEventSpecificDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsEventSpecificDetails() (*EventSpecificDetails, bool) { + return &esd, true +} + +// AsBasicEventSpecificDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsBasicEventSpecificDetails() (BasicEventSpecificDetails, bool) { + return &esd, true +} + +// ExistingProtectionProfile existing storage account input. +type ExistingProtectionProfile struct { + // ProtectionProfileID - The protection profile Arm Id. Throw error, if resource does not exists. + ProtectionProfileID *string `json:"protectionProfileId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) MarshalJSON() ([]byte, error) { + epp.ResourceType = ResourceTypeExisting + objectMap := make(map[string]interface{}) + if epp.ProtectionProfileID != nil { + objectMap["protectionProfileId"] = epp.ProtectionProfileID + } + if epp.ResourceType != "" { + objectMap["resourceType"] = epp.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return &epp, true +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return nil, false +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return nil, false +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &epp, true +} + +// ExistingRecoveryAvailabilitySet existing recovery availability set input. +type ExistingRecoveryAvailabilitySet struct { + // RecoveryAvailabilitySetID - The recovery availability set Id. Will throw error, if resource does not exist. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails', 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryAvailabilitySetCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) MarshalJSON() ([]byte, error) { + eras.ResourceType = ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if eras.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = eras.RecoveryAvailabilitySetID + } + if eras.ResourceType != "" { + objectMap["resourceType"] = eras.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryAvailabilitySet is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) { + return &eras, true +} + +// AsRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsBasicRecoveryAvailabilitySetCustomDetails() (BasicRecoveryAvailabilitySetCustomDetails, bool) { + return &eras, true +} + +// ExistingRecoveryProximityPlacementGroup existing recovery proximity placement group input. +type ExistingRecoveryProximityPlacementGroup struct { + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. Will throw error, if resource does not exist. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails', 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) MarshalJSON() ([]byte, error) { + erppg.ResourceType = ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if erppg.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = erppg.RecoveryProximityPlacementGroupID + } + if erppg.ResourceType != "" { + objectMap["resourceType"] = erppg.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryProximityPlacementGroup is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) { + return &erppg, true +} + +// AsRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsBasicRecoveryProximityPlacementGroupCustomDetails() (BasicRecoveryProximityPlacementGroupCustomDetails, bool) { + return &erppg, true +} + +// ExistingRecoveryRecoveryResourceGroup existing recovery resource group input. +type ExistingRecoveryRecoveryResourceGroup struct { + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails', 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryResourceGroupCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) MarshalJSON() ([]byte, error) { + errrg.ResourceType = ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if errrg.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = errrg.RecoveryResourceGroupID + } + if errrg.ResourceType != "" { + objectMap["resourceType"] = errrg.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryRecoveryResourceGroup is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) { + return &errrg, true +} + +// AsRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsBasicRecoveryResourceGroupCustomDetails() (BasicRecoveryResourceGroupCustomDetails, bool) { + return &errrg, true +} + +// ExistingRecoveryVirtualNetwork existing recovery virtual network input. +type ExistingRecoveryVirtualNetwork struct { + // RecoveryVirtualNetworkID - The recovery virtual network Id. Will throw error, if resource does not exist. + RecoveryVirtualNetworkID *string `json:"recoveryVirtualNetworkId,omitempty"` + // RecoverySubnetName - The recovery subnet name. + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) MarshalJSON() ([]byte, error) { + ervn.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if ervn.RecoveryVirtualNetworkID != nil { + objectMap["recoveryVirtualNetworkId"] = ervn.RecoveryVirtualNetworkID + } + if ervn.RecoverySubnetName != nil { + objectMap["recoverySubnetName"] = ervn.RecoverySubnetName + } + if ervn.ResourceType != "" { + objectMap["resourceType"] = ervn.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return &ervn, true +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &ervn, true +} + +// ExistingStorageAccount existing storage account input. +type ExistingStorageAccount struct { + // AzureStorageAccountID - The storage account Arm Id. Throw error, if resource does not exists. + AzureStorageAccountID *string `json:"azureStorageAccountId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails', 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicStorageAccountCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingStorageAccount. +func (esa ExistingStorageAccount) MarshalJSON() ([]byte, error) { + esa.ResourceType = ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if esa.AzureStorageAccountID != nil { + objectMap["azureStorageAccountId"] = esa.AzureStorageAccountID + } + if esa.ResourceType != "" { + objectMap["resourceType"] = esa.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingStorageAccount is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsExistingStorageAccount() (*ExistingStorageAccount, bool) { + return &esa, true +} + +// AsStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) { + return nil, false +} + +// AsBasicStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsBasicStorageAccountCustomDetails() (BasicStorageAccountCustomDetails, bool) { + return &esa, true +} + +// ExportJobDetails this class represents details for export jobs workflow. +type ExportJobDetails struct { + // BlobURI - BlobUri of the exported jobs. + BlobURI *string `json:"blobUri,omitempty"` + // SasToken - The sas token to access blob. + SasToken *string `json:"sasToken,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExportJobDetails. +func (ejd ExportJobDetails) MarshalJSON() ([]byte, error) { + ejd.InstanceType = InstanceTypeExportJobDetails + objectMap := make(map[string]interface{}) + if ejd.BlobURI != nil { + objectMap["blobUri"] = ejd.BlobURI + } + if ejd.SasToken != nil { + objectMap["sasToken"] = ejd.SasToken + } + if ejd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = ejd.AffectedObjectDetails + } + if ejd.InstanceType != "" { + objectMap["instanceType"] = ejd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return &ejd, true +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &ejd, true +} + +// ExtendedLocation extended location of the resource. +type ExtendedLocation struct { + // Name - The name of the extended location. + Name *string `json:"name,omitempty"` + // Type - The extended location type. + Type *string `json:"type,omitempty"` +} + +// Fabric fabric definition. +type Fabric struct { + autorest.Response `json:"-"` + // Properties - Fabric related data. + Properties *FabricProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Fabric. +func (f Fabric) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if f.Properties != nil { + objectMap["properties"] = f.Properties + } + if f.Location != nil { + objectMap["location"] = f.Location + } + return json.Marshal(objectMap) +} + +// FabricCollection collection of fabric details. +type FabricCollection struct { + autorest.Response `json:"-"` + // Value - The fabric details. + Value *[]Fabric `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// FabricCollectionIterator provides access to a complete listing of Fabric values. +type FabricCollectionIterator struct { + i int + page FabricCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *FabricCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FabricCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *FabricCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter FabricCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter FabricCollectionIterator) Response() FabricCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter FabricCollectionIterator) Value() Fabric { + if !iter.page.NotDone() { + return Fabric{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the FabricCollectionIterator type. +func NewFabricCollectionIterator(page FabricCollectionPage) FabricCollectionIterator { + return FabricCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (fc FabricCollection) IsEmpty() bool { + return fc.Value == nil || len(*fc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (fc FabricCollection) hasNextLink() bool { + return fc.NextLink != nil && len(*fc.NextLink) != 0 +} + +// fabricCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (fc FabricCollection) fabricCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !fc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(fc.NextLink))) +} + +// FabricCollectionPage contains a page of Fabric values. +type FabricCollectionPage struct { + fn func(context.Context, FabricCollection) (FabricCollection, error) + fc FabricCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *FabricCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FabricCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.fc) + if err != nil { + return err + } + page.fc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *FabricCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page FabricCollectionPage) NotDone() bool { + return !page.fc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page FabricCollectionPage) Response() FabricCollection { + return page.fc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page FabricCollectionPage) Values() []Fabric { + if page.fc.IsEmpty() { + return nil + } + return *page.fc.Value +} + +// Creates a new instance of the FabricCollectionPage type. +func NewFabricCollectionPage(cur FabricCollection, getNextPage func(context.Context, FabricCollection) (FabricCollection, error)) FabricCollectionPage { + return FabricCollectionPage{ + fn: getNextPage, + fc: cur, + } +} + +// FabricCreationInput site details provided during the time of site creation. +type FabricCreationInput struct { + // Properties - Fabric creation input. + Properties *FabricCreationInputProperties `json:"properties,omitempty"` +} + +// FabricCreationInputProperties properties of site details provided during the time of site creation. +type FabricCreationInputProperties struct { + // CustomDetails - Fabric provider specific creation input. + CustomDetails BasicFabricSpecificCreationInput `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for FabricCreationInputProperties struct. +func (fcip *FabricCreationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicFabricSpecificCreationInput(*v) + if err != nil { + return err + } + fcip.CustomDetails = customDetails + } + } + } + + return nil +} + +// FabricProperties fabric properties. +type FabricProperties struct { + // FriendlyName - Friendly name of the fabric. + FriendlyName *string `json:"friendlyName,omitempty"` + // EncryptionDetails - Encryption details for the fabric. + EncryptionDetails *EncryptionDetails `json:"encryptionDetails,omitempty"` + // RolloverEncryptionDetails - Rollover encryption details for the fabric. + RolloverEncryptionDetails *EncryptionDetails `json:"rolloverEncryptionDetails,omitempty"` + // InternalIdentifier - Dra Registration Id. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // BcdrState - BCDR state of the fabric. + BcdrState *string `json:"bcdrState,omitempty"` + // CustomDetails - Fabric specific settings. + CustomDetails BasicFabricSpecificDetails `json:"customDetails,omitempty"` + // HealthErrorDetails - Fabric health error details. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // Health - Health of fabric. + Health *string `json:"health,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for FabricProperties struct. +func (fp *FabricProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + fp.FriendlyName = &friendlyName + } + case "encryptionDetails": + if v != nil { + var encryptionDetails EncryptionDetails + err = json.Unmarshal(*v, &encryptionDetails) + if err != nil { + return err + } + fp.EncryptionDetails = &encryptionDetails + } + case "rolloverEncryptionDetails": + if v != nil { + var rolloverEncryptionDetails EncryptionDetails + err = json.Unmarshal(*v, &rolloverEncryptionDetails) + if err != nil { + return err + } + fp.RolloverEncryptionDetails = &rolloverEncryptionDetails + } + case "internalIdentifier": + if v != nil { + var internalIdentifier string + err = json.Unmarshal(*v, &internalIdentifier) + if err != nil { + return err + } + fp.InternalIdentifier = &internalIdentifier + } + case "bcdrState": + if v != nil { + var bcdrState string + err = json.Unmarshal(*v, &bcdrState) + if err != nil { + return err + } + fp.BcdrState = &bcdrState + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicFabricSpecificDetails(*v) + if err != nil { + return err + } + fp.CustomDetails = customDetails + } + case "healthErrorDetails": + if v != nil { + var healthErrorDetails []HealthError + err = json.Unmarshal(*v, &healthErrorDetails) + if err != nil { + return err + } + fp.HealthErrorDetails = &healthErrorDetails + } + case "health": + if v != nil { + var health string + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + fp.Health = &health + } + } + } + + return nil +} + +// FabricQueryParameter query parameter to get fabric. +type FabricQueryParameter struct { + // ZoneToZoneMappings - A value indicating whether the zone to zone mappings are to be returned. + ZoneToZoneMappings *string `json:"zoneToZoneMappings,omitempty"` + // FetchAgentDetails - A value indicating whether the agent details are to be fetched. + FetchAgentDetails *string `json:"fetchAgentDetails,omitempty"` + // BiosID - The BIOS Id to be used for fetching agent details. + BiosID *string `json:"biosId,omitempty"` + // Fqdn - The FQDN to be used for fetching agent details. + Fqdn *string `json:"fqdn,omitempty"` + // DiscoveryType - The type of the discovered machine to be used for fetching agent details. + DiscoveryType *string `json:"discoveryType,omitempty"` + // OsType - The OS type to be used for fetching agent details. + OsType *string `json:"osType,omitempty"` +} + +// FabricReplicationGroupTaskDetails this class represents the fabric replication group task details. +type FabricReplicationGroupTaskDetails struct { + // SkippedReason - The skipped reason. + SkippedReason *string `json:"skippedReason,omitempty"` + // SkippedReasonString - The skipped reason string. + SkippedReasonString *string `json:"skippedReasonString,omitempty"` + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) MarshalJSON() ([]byte, error) { + frgtd.InstanceType = InstanceTypeFabricReplicationGroupTaskDetails + objectMap := make(map[string]interface{}) + if frgtd.SkippedReason != nil { + objectMap["skippedReason"] = frgtd.SkippedReason + } + if frgtd.SkippedReasonString != nil { + objectMap["skippedReasonString"] = frgtd.SkippedReasonString + } + if frgtd.JobTask != nil { + objectMap["jobTask"] = frgtd.JobTask + } + if frgtd.InstanceType != "" { + objectMap["instanceType"] = frgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return &frgtd, true +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &frgtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &frgtd, true +} + +// BasicFabricSpecificCreateNetworkMappingInput input details specific to fabrics during Network Mapping. +type BasicFabricSpecificCreateNetworkMappingInput interface { + AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) + AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) + AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) + AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) +} + +// FabricSpecificCreateNetworkMappingInput input details specific to fabrics during Network Mapping. +type FabricSpecificCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificCreateNetworkMappingInput(body []byte) (BasicFabricSpecificCreateNetworkMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAzureToAzure): + var atacnmi AzureToAzureCreateNetworkMappingInput + err := json.Unmarshal(body, &atacnmi) + return atacnmi, err + case string(InstanceTypeVmmToAzure): + var vtacnmi VmmToAzureCreateNetworkMappingInput + err := json.Unmarshal(body, &vtacnmi) + return vtacnmi, err + case string(InstanceTypeVmmToVmm): + var vtvcnmi VmmToVmmCreateNetworkMappingInput + err := json.Unmarshal(body, &vtvcnmi) + return vtvcnmi, err + default: + var fscnmi FabricSpecificCreateNetworkMappingInput + err := json.Unmarshal(body, &fscnmi) + return fscnmi, err + } +} +func unmarshalBasicFabricSpecificCreateNetworkMappingInputArray(body []byte) ([]BasicFabricSpecificCreateNetworkMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fscnmiArray := make([]BasicFabricSpecificCreateNetworkMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fscnmi, err := unmarshalBasicFabricSpecificCreateNetworkMappingInput(*rawMessage) + if err != nil { + return nil, err + } + fscnmiArray[index] = fscnmi + } + return fscnmiArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + fscnmi.InstanceType = InstanceTypeFabricSpecificCreateNetworkMappingInput + objectMap := make(map[string]interface{}) + if fscnmi.InstanceType != "" { + objectMap["instanceType"] = fscnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return &fscnmi, true +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &fscnmi, true +} + +// BasicFabricSpecificCreationInput fabric provider specific settings. +type BasicFabricSpecificCreationInput interface { + AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) + AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) + AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) + AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) +} + +// FabricSpecificCreationInput fabric provider specific settings. +type FabricSpecificCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificCreationInput(body []byte) (BasicFabricSpecificCreationInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure): + var afci AzureFabricCreationInput + err := json.Unmarshal(body, &afci) + return afci, err + case string(InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm): + var imrfci InMageRcmFabricCreationInput + err := json.Unmarshal(body, &imrfci) + return imrfci, err + case string(InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2): + var vmvfci VMwareV2FabricCreationInput + err := json.Unmarshal(body, &vmvfci) + return vmvfci, err + default: + var fsci FabricSpecificCreationInput + err := json.Unmarshal(body, &fsci) + return fsci, err + } +} +func unmarshalBasicFabricSpecificCreationInputArray(body []byte) ([]BasicFabricSpecificCreationInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsciArray := make([]BasicFabricSpecificCreationInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsci, err := unmarshalBasicFabricSpecificCreationInput(*rawMessage) + if err != nil { + return nil, err + } + fsciArray[index] = fsci + } + return fsciArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) MarshalJSON() ([]byte, error) { + fsci.InstanceType = InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput + objectMap := make(map[string]interface{}) + if fsci.InstanceType != "" { + objectMap["instanceType"] = fsci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return &fsci, true +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &fsci, true +} + +// BasicFabricSpecificDetails fabric specific details. +type BasicFabricSpecificDetails interface { + AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) + AsHyperVSiteDetails() (*HyperVSiteDetails, bool) + AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) + AsVmmDetails() (*VmmDetails, bool) + AsVMwareDetails() (*VMwareDetails, bool) + AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) + AsFabricSpecificDetails() (*FabricSpecificDetails, bool) +} + +// FabricSpecificDetails fabric specific details. +type FabricSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificDetails(body []byte) (BasicFabricSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure): + var afsd AzureFabricSpecificDetails + err := json.Unmarshal(body, &afsd) + return afsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite): + var hvsd HyperVSiteDetails + err := json.Unmarshal(body, &hvsd) + return hvsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm): + var imrfsd InMageRcmFabricSpecificDetails + err := json.Unmarshal(body, &imrfsd) + return imrfsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM): + var vd VmmDetails + err := json.Unmarshal(body, &vd) + return vd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware): + var vmd VMwareDetails + err := json.Unmarshal(body, &vmd) + return vmd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2): + var vmvfsd VMwareV2FabricSpecificDetails + err := json.Unmarshal(body, &vmvfsd) + return vmvfsd, err + default: + var fsd FabricSpecificDetails + err := json.Unmarshal(body, &fsd) + return fsd, err + } +} +func unmarshalBasicFabricSpecificDetailsArray(body []byte) ([]BasicFabricSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsdArray := make([]BasicFabricSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsd, err := unmarshalBasicFabricSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + fsdArray[index] = fsd + } + return fsdArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificDetails. +func (fsd FabricSpecificDetails) MarshalJSON() ([]byte, error) { + fsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails + objectMap := make(map[string]interface{}) + if fsd.InstanceType != "" { + objectMap["instanceType"] = fsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return &fsd, true +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &fsd, true +} + +// BasicFabricSpecificUpdateNetworkMappingInput input details specific to fabrics during Network Mapping. +type BasicFabricSpecificUpdateNetworkMappingInput interface { + AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) + AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) + AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) + AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) +} + +// FabricSpecificUpdateNetworkMappingInput input details specific to fabrics during Network Mapping. +type FabricSpecificUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificUpdateNetworkMappingInput(body []byte) (BasicFabricSpecificUpdateNetworkMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure): + var ataunmi AzureToAzureUpdateNetworkMappingInput + err := json.Unmarshal(body, &ataunmi) + return ataunmi, err + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure): + var vtaunmi VmmToAzureUpdateNetworkMappingInput + err := json.Unmarshal(body, &vtaunmi) + return vtaunmi, err + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm): + var vtvunmi VmmToVmmUpdateNetworkMappingInput + err := json.Unmarshal(body, &vtvunmi) + return vtvunmi, err + default: + var fsunmi FabricSpecificUpdateNetworkMappingInput + err := json.Unmarshal(body, &fsunmi) + return fsunmi, err + } +} +func unmarshalBasicFabricSpecificUpdateNetworkMappingInputArray(body []byte) ([]BasicFabricSpecificUpdateNetworkMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsunmiArray := make([]BasicFabricSpecificUpdateNetworkMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsunmi, err := unmarshalBasicFabricSpecificUpdateNetworkMappingInput(*rawMessage) + if err != nil { + return nil, err + } + fsunmiArray[index] = fsunmi + } + return fsunmiArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + fsunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput + objectMap := make(map[string]interface{}) + if fsunmi.InstanceType != "" { + objectMap["instanceType"] = fsunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return &fsunmi, true +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &fsunmi, true +} + +// FailoverJobDetails this class represents the details for a failover job. +type FailoverJobDetails struct { + // ProtectedItemDetails - The test VM details. + ProtectedItemDetails *[]FailoverReplicationProtectedItemDetails `json:"protectedItemDetails,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for FailoverJobDetails. +func (fjd FailoverJobDetails) MarshalJSON() ([]byte, error) { + fjd.InstanceType = InstanceTypeFailoverJobDetails + objectMap := make(map[string]interface{}) + if fjd.ProtectedItemDetails != nil { + objectMap["protectedItemDetails"] = fjd.ProtectedItemDetails + } + if fjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = fjd.AffectedObjectDetails + } + if fjd.InstanceType != "" { + objectMap["instanceType"] = fjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return &fjd, true +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &fjd, true +} + +// FailoverProcessServerRequest request to failover a process server. +type FailoverProcessServerRequest struct { + // Properties - The properties of the PS Failover request. + Properties *FailoverProcessServerRequestProperties `json:"properties,omitempty"` +} + +// FailoverProcessServerRequestProperties the properties of the Failover Process Server request. +type FailoverProcessServerRequestProperties struct { + // ContainerName - The container identifier. + ContainerName *string `json:"containerName,omitempty"` + // SourceProcessServerID - The source process server. + SourceProcessServerID *string `json:"sourceProcessServerId,omitempty"` + // TargetProcessServerID - The new process server. + TargetProcessServerID *string `json:"targetProcessServerId,omitempty"` + // VmsToMigrate - The VMS to migrate. + VmsToMigrate *[]string `json:"vmsToMigrate,omitempty"` + // UpdateType - A value for failover type. It can be systemlevel/serverlevel. + UpdateType *string `json:"updateType,omitempty"` +} + +// FailoverReplicationProtectedItemDetails failover details for a replication protected item. +type FailoverReplicationProtectedItemDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // FriendlyName - The friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // TestVMName - The test Vm name. + TestVMName *string `json:"testVmName,omitempty"` + // TestVMFriendlyName - The test Vm friendly name. + TestVMFriendlyName *string `json:"testVmFriendlyName,omitempty"` + // NetworkConnectionStatus - The network connection status. + NetworkConnectionStatus *string `json:"networkConnectionStatus,omitempty"` + // NetworkFriendlyName - The network friendly name. + NetworkFriendlyName *string `json:"networkFriendlyName,omitempty"` + // Subnet - The network subnet. + Subnet *string `json:"subnet,omitempty"` + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // RecoveryPointTime - The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` +} + +// BasicGroupTaskDetails this class represents the group task details when parent child relationship exists in the +// drill down. +type BasicGroupTaskDetails interface { + AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) + AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) + AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) + AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) + AsGroupTaskDetails() (*GroupTaskDetails, bool) +} + +// GroupTaskDetails this class represents the group task details when parent child relationship exists in the +// drill down. +type GroupTaskDetails struct { + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicGroupTaskDetails(body []byte) (BasicGroupTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInlineWorkflowTaskDetails): + var iwtd InlineWorkflowTaskDetails + err := json.Unmarshal(body, &iwtd) + return iwtd, err + case string(InstanceTypeRecoveryPlanGroupTaskDetails): + var rpgtd RecoveryPlanGroupTaskDetails + err := json.Unmarshal(body, &rpgtd) + return rpgtd, err + case string(InstanceTypeRecoveryPlanShutdownGroupTaskDetails): + var rpsgtd RecoveryPlanShutdownGroupTaskDetails + err := json.Unmarshal(body, &rpsgtd) + return rpsgtd, err + default: + var gtd GroupTaskDetails + err := json.Unmarshal(body, >d) + return gtd, err + } +} +func unmarshalBasicGroupTaskDetailsArray(body []byte) ([]BasicGroupTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + gtdArray := make([]BasicGroupTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + gtd, err := unmarshalBasicGroupTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + gtdArray[index] = gtd + } + return gtdArray, nil +} + +// MarshalJSON is the custom marshaler for GroupTaskDetails. +func (gtd GroupTaskDetails) MarshalJSON() ([]byte, error) { + gtd.InstanceType = InstanceTypeGroupTaskDetails + objectMap := make(map[string]interface{}) + if gtd.ChildTasks != nil { + objectMap["childTasks"] = gtd.ChildTasks + } + if gtd.InstanceType != "" { + objectMap["instanceType"] = gtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return >d, true +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return >d, true +} + +// HealthError health Error. +type HealthError struct { + // InnerHealthErrors - The inner health errors. HealthError having a list of HealthError as child errors is problematic. InnerHealthError is used because this will prevent an infinite loop of structures when Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health errors and all API consumers can utilize this in the same fashion as Exception -> InnerException. + InnerHealthErrors *[]InnerHealthError `json:"innerHealthErrors,omitempty"` + // ErrorSource - Source of error. + ErrorSource *string `json:"errorSource,omitempty"` + // ErrorType - Type of error. + ErrorType *string `json:"errorType,omitempty"` + // ErrorLevel - Level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // ErrorCategory - Category of error. + ErrorCategory *string `json:"errorCategory,omitempty"` + // ErrorCode - Error code. + ErrorCode *string `json:"errorCode,omitempty"` + // SummaryMessage - Summary message of the entity. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // ErrorMessage - Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // CreationTimeUtc - Error creation time (UTC). + CreationTimeUtc *date.Time `json:"creationTimeUtc,omitempty"` + // RecoveryProviderErrorMessage - DRA error message. + RecoveryProviderErrorMessage *string `json:"recoveryProviderErrorMessage,omitempty"` + // EntityID - ID of the entity. + EntityID *string `json:"entityId,omitempty"` + // ErrorID - The health error unique id. + ErrorID *string `json:"errorId,omitempty"` + // CustomerResolvability - Value indicating whether the health error is customer resolvable. Possible values include: 'Allowed', 'NotAllowed' + CustomerResolvability HealthErrorCustomerResolvability `json:"customerResolvability,omitempty"` +} + +// HealthErrorSummary class to define the summary of the health error details. +type HealthErrorSummary struct { + // SummaryCode - The code of the health error. + SummaryCode *string `json:"summaryCode,omitempty"` + // Category - The category of the health error. Possible values include: 'HealthErrorCategoryNone', 'HealthErrorCategoryReplication', 'HealthErrorCategoryTestFailover', 'HealthErrorCategoryConfiguration', 'HealthErrorCategoryFabricInfrastructure', 'HealthErrorCategoryVersionExpiry', 'HealthErrorCategoryAgentAutoUpdateInfra', 'HealthErrorCategoryAgentAutoUpdateArtifactDeleted', 'HealthErrorCategoryAgentAutoUpdateRunAsAccount', 'HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry', 'HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired' + Category HealthErrorCategory `json:"category,omitempty"` + // Severity - Severity of error. Possible values include: 'NONE', 'Warning', 'Error', 'Info' + Severity Severity `json:"severity,omitempty"` + // SummaryMessage - The summary message of the health error. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // AffectedResourceType - The type of affected ARM resource. + AffectedResourceType *string `json:"affectedResourceType,omitempty"` + // AffectedResourceSubtype - The sub type of any subcomponent within the ARM resource that this might be applicable. Value remains null if not applicable. + AffectedResourceSubtype *string `json:"affectedResourceSubtype,omitempty"` + // AffectedResourceCorrelationIds - The list of affected resource correlation Ids. This can be used to uniquely identify the count of items affected by a specific category and severity as well as count of item affected by an specific issue. + AffectedResourceCorrelationIds *[]string `json:"affectedResourceCorrelationIds,omitempty"` +} + +// HyperVHostDetails hyper-V host details. +type HyperVHostDetails struct { + // ID - READ-ONLY; The Hyper-V host Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The Hyper-V host name. + Name *string `json:"name,omitempty"` + // MarsAgentVersion - READ-ONLY; The Mars agent version. + MarsAgentVersion *string `json:"marsAgentVersion,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVHostDetails. +func (hvhd HyperVHostDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// HyperVReplica2012EventDetails model class for event details of a HyperVReplica E2E event. +type HyperVReplica2012EventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) MarshalJSON() ([]byte, error) { + hvr2ed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvr2ed.ContainerName != nil { + objectMap["containerName"] = hvr2ed.ContainerName + } + if hvr2ed.FabricName != nil { + objectMap["fabricName"] = hvr2ed.FabricName + } + if hvr2ed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvr2ed.RemoteContainerName + } + if hvr2ed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvr2ed.RemoteFabricName + } + if hvr2ed.InstanceType != "" { + objectMap["instanceType"] = hvr2ed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return &hvr2ed, true +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvr2ed, true +} + +// HyperVReplica2012R2EventDetails model class for event details of a HyperVReplica blue E2E event. +type HyperVReplica2012R2EventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) MarshalJSON() ([]byte, error) { + hvr2ed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvr2ed.ContainerName != nil { + objectMap["containerName"] = hvr2ed.ContainerName + } + if hvr2ed.FabricName != nil { + objectMap["fabricName"] = hvr2ed.FabricName + } + if hvr2ed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvr2ed.RemoteContainerName + } + if hvr2ed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvr2ed.RemoteFabricName + } + if hvr2ed.InstanceType != "" { + objectMap["instanceType"] = hvr2ed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return &hvr2ed, true +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvr2ed, true +} + +// HyperVReplicaAzureApplyRecoveryPointInput applyRecoveryPoint input specific to HyperVReplicaAzure +// provider. +type HyperVReplicaAzureApplyRecoveryPointInput struct { + // PrimaryKekCertificatePfx - The primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - The secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + hvraarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraarpi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvraarpi.PrimaryKekCertificatePfx + } + if hvraarpi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvraarpi.SecondaryKekCertificatePfx + } + if hvraarpi.InstanceType != "" { + objectMap["instanceType"] = hvraarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return &hvraarpi, true +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &hvraarpi, true +} + +// HyperVReplicaAzureDiskInputDetails disk input details. +type HyperVReplicaAzureDiskInputDetails struct { + // DiskID - The DiskId. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The LogStorageAccountId. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// HyperVReplicaAzureEnableProtectionInput hyperVReplicaAzure specific enable protection input. +type HyperVReplicaAzureEnableProtectionInput struct { + // HvHostVMID - The Hyper-V host VM Id. + HvHostVMID *string `json:"hvHostVmId,omitempty"` + // VMName - The VM Name. + VMName *string `json:"vmName,omitempty"` + // OsType - The OS type associated with VM. + OsType *string `json:"osType,omitempty"` + // VhdID - The OS disk VHD id associated with VM. + VhdID *string `json:"vhdId,omitempty"` + // TargetStorageAccountID - The storage account Id. + TargetStorageAccountID *string `json:"targetStorageAccountId,omitempty"` + // TargetAzureNetworkID - The selected target Azure network Id. + TargetAzureNetworkID *string `json:"targetAzureNetworkId,omitempty"` + // TargetAzureSubnetID - The selected target Azure subnet Id. + TargetAzureSubnetID *string `json:"targetAzureSubnetId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // TargetAzureVMName - The target azure VM Name. + TargetAzureVMName *string `json:"targetAzureVmName,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DisksToInclude - The list of VHD Ids of disks to be protected. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // TargetAzureV1ResourceGroupID - The Id of the target resource group (for classic deployment) in which the failover VM is to be created. + TargetAzureV1ResourceGroupID *string `json:"targetAzureV1ResourceGroupId,omitempty"` + // TargetAzureV2ResourceGroupID - The Id of the target resource group (for resource manager deployment) in which the failover VM is to be created. + TargetAzureV2ResourceGroupID *string `json:"targetAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id for resource manager deployment. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetProximityPlacementGroupID - The proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisksForReplication - A value indicating whether managed disks should be used during replication. + UseManagedDisksForReplication *string `json:"useManagedDisksForReplication,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DisksToIncludeForManagedDisks - The disks to include list for managed disks. + DisksToIncludeForManagedDisks *[]HyperVReplicaAzureDiskInputDetails `json:"disksToIncludeForManagedDisks,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) MarshalJSON() ([]byte, error) { + hvraepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraepi.HvHostVMID != nil { + objectMap["hvHostVmId"] = hvraepi.HvHostVMID + } + if hvraepi.VMName != nil { + objectMap["vmName"] = hvraepi.VMName + } + if hvraepi.OsType != nil { + objectMap["osType"] = hvraepi.OsType + } + if hvraepi.VhdID != nil { + objectMap["vhdId"] = hvraepi.VhdID + } + if hvraepi.TargetStorageAccountID != nil { + objectMap["targetStorageAccountId"] = hvraepi.TargetStorageAccountID + } + if hvraepi.TargetAzureNetworkID != nil { + objectMap["targetAzureNetworkId"] = hvraepi.TargetAzureNetworkID + } + if hvraepi.TargetAzureSubnetID != nil { + objectMap["targetAzureSubnetId"] = hvraepi.TargetAzureSubnetID + } + if hvraepi.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = hvraepi.EnableRdpOnTargetOption + } + if hvraepi.TargetAzureVMName != nil { + objectMap["targetAzureVmName"] = hvraepi.TargetAzureVMName + } + if hvraepi.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = hvraepi.LogStorageAccountID + } + if hvraepi.DisksToInclude != nil { + objectMap["disksToInclude"] = hvraepi.DisksToInclude + } + if hvraepi.TargetAzureV1ResourceGroupID != nil { + objectMap["targetAzureV1ResourceGroupId"] = hvraepi.TargetAzureV1ResourceGroupID + } + if hvraepi.TargetAzureV2ResourceGroupID != nil { + objectMap["targetAzureV2ResourceGroupId"] = hvraepi.TargetAzureV2ResourceGroupID + } + if hvraepi.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvraepi.UseManagedDisks + } + if hvraepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = hvraepi.TargetAvailabilitySetID + } + if hvraepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvraepi.TargetAvailabilityZone + } + if hvraepi.LicenseType != "" { + objectMap["licenseType"] = hvraepi.LicenseType + } + if hvraepi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = hvraepi.SQLServerLicenseType + } + if hvraepi.TargetVMSize != nil { + objectMap["targetVmSize"] = hvraepi.TargetVMSize + } + if hvraepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvraepi.TargetProximityPlacementGroupID + } + if hvraepi.UseManagedDisksForReplication != nil { + objectMap["useManagedDisksForReplication"] = hvraepi.UseManagedDisksForReplication + } + if hvraepi.DiskType != "" { + objectMap["diskType"] = hvraepi.DiskType + } + if hvraepi.DisksToIncludeForManagedDisks != nil { + objectMap["disksToIncludeForManagedDisks"] = hvraepi.DisksToIncludeForManagedDisks + } + if hvraepi.DiskEncryptionSetID != nil { + objectMap["diskEncryptionSetId"] = hvraepi.DiskEncryptionSetID + } + if hvraepi.TargetVMTags != nil { + objectMap["targetVmTags"] = hvraepi.TargetVMTags + } + if hvraepi.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = hvraepi.SeedManagedDiskTags + } + if hvraepi.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvraepi.TargetManagedDiskTags + } + if hvraepi.TargetNicTags != nil { + objectMap["targetNicTags"] = hvraepi.TargetNicTags + } + if hvraepi.InstanceType != "" { + objectMap["instanceType"] = hvraepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return &hvraepi, true +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &hvraepi, true +} + +// HyperVReplicaAzureEventDetails model class for event details of a HyperVReplica E2A event. +type HyperVReplicaAzureEventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) MarshalJSON() ([]byte, error) { + hvraed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraed.ContainerName != nil { + objectMap["containerName"] = hvraed.ContainerName + } + if hvraed.FabricName != nil { + objectMap["fabricName"] = hvraed.FabricName + } + if hvraed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvraed.RemoteContainerName + } + if hvraed.InstanceType != "" { + objectMap["instanceType"] = hvraed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return &hvraed, true +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvraed, true +} + +// HyperVReplicaAzureFailbackProviderInput hyperVReplicaAzureFailback specific planned failover input. +type HyperVReplicaAzureFailbackProviderInput struct { + // DataSyncOption - Data sync option. + DataSyncOption *string `json:"dataSyncOption,omitempty"` + // RecoveryVMCreationOption - ALR options to create alternate recovery. + RecoveryVMCreationOption *string `json:"recoveryVmCreationOption,omitempty"` + // ProviderIDForAlternateRecovery - Provider Id for alternate location. + ProviderIDForAlternateRecovery *string `json:"providerIdForAlternateRecovery,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) MarshalJSON() ([]byte, error) { + hvrafpi.InstanceType = InstanceTypeHyperVReplicaAzureFailback + objectMap := make(map[string]interface{}) + if hvrafpi.DataSyncOption != nil { + objectMap["dataSyncOption"] = hvrafpi.DataSyncOption + } + if hvrafpi.RecoveryVMCreationOption != nil { + objectMap["recoveryVmCreationOption"] = hvrafpi.RecoveryVMCreationOption + } + if hvrafpi.ProviderIDForAlternateRecovery != nil { + objectMap["providerIdForAlternateRecovery"] = hvrafpi.ProviderIDForAlternateRecovery + } + if hvrafpi.InstanceType != "" { + objectMap["instanceType"] = hvrafpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return &hvrafpi, true +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &hvrafpi, true +} + +// HyperVReplicaAzureManagedDiskDetails hyper-V Managed disk details. +type HyperVReplicaAzureManagedDiskDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // SeedManagedDiskID - Seed managed disk Id. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // ReplicaDiskType - The replica disk type. + ReplicaDiskType *string `json:"replicaDiskType,omitempty"` + // DiskEncryptionSetID - The disk encryption set ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// HyperVReplicaAzurePlannedFailoverProviderInput hyperVReplicaAzure specific planned failover input. +type HyperVReplicaAzurePlannedFailoverProviderInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) MarshalJSON() ([]byte, error) { + hvrapfpi.InstanceType = InstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapfpi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvrapfpi.PrimaryKekCertificatePfx + } + if hvrapfpi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvrapfpi.SecondaryKekCertificatePfx + } + if hvrapfpi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvrapfpi.RecoveryPointID + } + if hvrapfpi.InstanceType != "" { + objectMap["instanceType"] = hvrapfpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return &hvrapfpi, true +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &hvrapfpi, true +} + +// HyperVReplicaAzurePolicyDetails hyper-V Replica Azure specific protection profile details. +type HyperVReplicaAzurePolicyDetails struct { + // RecoveryPointHistoryDurationInHours - The duration (in hours) to which point the recovery history needs to be maintained. + RecoveryPointHistoryDurationInHours *int32 `json:"recoveryPointHistoryDurationInHours,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - The interval (in hours) at which Hyper-V Replica should create an application consistent snapshot within the VM. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // ReplicationInterval - The replication interval. + ReplicationInterval *int32 `json:"replicationInterval,omitempty"` + // OnlineReplicationStartTime - The scheduled start time for the initial replication. If this parameter is Null, the initial replication starts immediately. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // Encryption - A value indicating whether encryption is enabled for virtual machines in this cloud. + Encryption *string `json:"encryption,omitempty"` + // ActiveStorageAccountID - The active storage account Id. + ActiveStorageAccountID *string `json:"activeStorageAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) MarshalJSON() ([]byte, error) { + hvrapd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapd.RecoveryPointHistoryDurationInHours != nil { + objectMap["recoveryPointHistoryDurationInHours"] = hvrapd.RecoveryPointHistoryDurationInHours + } + if hvrapd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrapd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrapd.ReplicationInterval != nil { + objectMap["replicationInterval"] = hvrapd.ReplicationInterval + } + if hvrapd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrapd.OnlineReplicationStartTime + } + if hvrapd.Encryption != nil { + objectMap["encryption"] = hvrapd.Encryption + } + if hvrapd.ActiveStorageAccountID != nil { + objectMap["activeStorageAccountId"] = hvrapd.ActiveStorageAccountID + } + if hvrapd.InstanceType != "" { + objectMap["instanceType"] = hvrapd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return &hvrapd, true +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrapd, true +} + +// HyperVReplicaAzurePolicyInput hyper-V Replica Azure specific input for creating a protection profile. +type HyperVReplicaAzurePolicyInput struct { + // RecoveryPointHistoryDuration - The duration (in hours) to which point the recovery history needs to be maintained. + RecoveryPointHistoryDuration *int32 `json:"recoveryPointHistoryDuration,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - The interval (in hours) at which Hyper-V Replica should create an application consistent snapshot within the VM. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // ReplicationInterval - The replication interval. + ReplicationInterval *int32 `json:"replicationInterval,omitempty"` + // OnlineReplicationStartTime - The scheduled start time for the initial replication. If this parameter is Null, the initial replication starts immediately. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // StorageAccounts - The list of storage accounts to which the VMs in the primary cloud can replicate to. + StorageAccounts *[]string `json:"storageAccounts,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) MarshalJSON() ([]byte, error) { + hvrapi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapi.RecoveryPointHistoryDuration != nil { + objectMap["recoveryPointHistoryDuration"] = hvrapi.RecoveryPointHistoryDuration + } + if hvrapi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrapi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrapi.ReplicationInterval != nil { + objectMap["replicationInterval"] = hvrapi.ReplicationInterval + } + if hvrapi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrapi.OnlineReplicationStartTime + } + if hvrapi.StorageAccounts != nil { + objectMap["storageAccounts"] = hvrapi.StorageAccounts + } + if hvrapi.InstanceType != "" { + objectMap["instanceType"] = hvrapi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return &hvrapi, true +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrapi, true +} + +// HyperVReplicaAzureReplicationDetails hyper V Replica Azure provider specific settings. +type HyperVReplicaAzureReplicationDetails struct { + // AzureVMDiskDetails - Azure VM Disk details. + AzureVMDiskDetails *[]AzureVMDiskDetails `json:"azureVmDiskDetails,omitempty"` + // RecoveryAzureVMName - Recovery Azure given name. + RecoveryAzureVMName *string `json:"recoveryAzureVmName,omitempty"` + // RecoveryAzureVMSize - The Recovery Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureStorageAccount - The recovery Azure storage account. + RecoveryAzureStorageAccount *string `json:"recoveryAzureStorageAccount,omitempty"` + // RecoveryAzureLogStorageAccountID - The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. + RecoveryAzureLogStorageAccountID *string `json:"recoveryAzureLogStorageAccountId,omitempty"` + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // RpoInSeconds - Last RPO value. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // SelectedRecoveryAzureNetworkID - The selected recovery azure network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // Encryption - The encryption info. + Encryption *string `json:"encryption,omitempty"` + // OSDetails - The operating system info. + OSDetails *OSDetails `json:"oSDetails,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // RecoveryAzureResourceGroupID - The target resource group Id. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]HyperVReplicaAzureManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) MarshalJSON() ([]byte, error) { + hvrard.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrard.AzureVMDiskDetails != nil { + objectMap["azureVmDiskDetails"] = hvrard.AzureVMDiskDetails + } + if hvrard.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVmName"] = hvrard.RecoveryAzureVMName + } + if hvrard.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = hvrard.RecoveryAzureVMSize + } + if hvrard.RecoveryAzureStorageAccount != nil { + objectMap["recoveryAzureStorageAccount"] = hvrard.RecoveryAzureStorageAccount + } + if hvrard.RecoveryAzureLogStorageAccountID != nil { + objectMap["recoveryAzureLogStorageAccountId"] = hvrard.RecoveryAzureLogStorageAccountID + } + if hvrard.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrard.LastReplicatedTime + } + if hvrard.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = hvrard.RpoInSeconds + } + if hvrard.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = hvrard.LastRpoCalculatedTime + } + if hvrard.VMID != nil { + objectMap["vmId"] = hvrard.VMID + } + if hvrard.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrard.VMProtectionState + } + if hvrard.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrard.VMProtectionStateDescription + } + if hvrard.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrard.InitialReplicationDetails + } + if hvrard.VMNics != nil { + objectMap["vmNics"] = hvrard.VMNics + } + if hvrard.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = hvrard.SelectedRecoveryAzureNetworkID + } + if hvrard.SelectedSourceNicID != nil { + objectMap["selectedSourceNicId"] = hvrard.SelectedSourceNicID + } + if hvrard.Encryption != nil { + objectMap["encryption"] = hvrard.Encryption + } + if hvrard.OSDetails != nil { + objectMap["oSDetails"] = hvrard.OSDetails + } + if hvrard.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = hvrard.SourceVMRAMSizeInMB + } + if hvrard.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = hvrard.SourceVMCPUCount + } + if hvrard.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = hvrard.EnableRdpOnTargetOption + } + if hvrard.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = hvrard.RecoveryAzureResourceGroupID + } + if hvrard.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = hvrard.RecoveryAvailabilitySetID + } + if hvrard.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvrard.TargetAvailabilityZone + } + if hvrard.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvrard.TargetProximityPlacementGroupID + } + if hvrard.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvrard.UseManagedDisks + } + if hvrard.LicenseType != nil { + objectMap["licenseType"] = hvrard.LicenseType + } + if hvrard.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = hvrard.SQLServerLicenseType + } + if hvrard.TargetVMTags != nil { + objectMap["targetVmTags"] = hvrard.TargetVMTags + } + if hvrard.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = hvrard.SeedManagedDiskTags + } + if hvrard.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvrard.TargetManagedDiskTags + } + if hvrard.TargetNicTags != nil { + objectMap["targetNicTags"] = hvrard.TargetNicTags + } + if hvrard.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = hvrard.ProtectedManagedDisks + } + if hvrard.InstanceType != "" { + objectMap["instanceType"] = hvrard.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return &hvrard, true +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrard, true +} + +// HyperVReplicaAzureReprotectInput azure specific reprotect input. +type HyperVReplicaAzureReprotectInput struct { + // HvHostVMID - The Hyper-V host Vm Id. + HvHostVMID *string `json:"hvHostVmId,omitempty"` + // VMName - The Vm Name. + VMName *string `json:"vmName,omitempty"` + // OsType - The OS type associated with vm. + OsType *string `json:"osType,omitempty"` + // VHDID - The OS disk VHD id associated with vm. + VHDID *string `json:"vHDId,omitempty"` + // StorageAccountID - The storage account name. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) MarshalJSON() ([]byte, error) { + hvrari.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrari.HvHostVMID != nil { + objectMap["hvHostVmId"] = hvrari.HvHostVMID + } + if hvrari.VMName != nil { + objectMap["vmName"] = hvrari.VMName + } + if hvrari.OsType != nil { + objectMap["osType"] = hvrari.OsType + } + if hvrari.VHDID != nil { + objectMap["vHDId"] = hvrari.VHDID + } + if hvrari.StorageAccountID != nil { + objectMap["storageAccountId"] = hvrari.StorageAccountID + } + if hvrari.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = hvrari.LogStorageAccountID + } + if hvrari.InstanceType != "" { + objectMap["instanceType"] = hvrari.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return &hvrari, true +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &hvrari, true +} + +// HyperVReplicaAzureTestFailoverInput hvrA provider specific input for test failover. +type HyperVReplicaAzureTestFailoverInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) MarshalJSON() ([]byte, error) { + hvratfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvratfi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvratfi.PrimaryKekCertificatePfx + } + if hvratfi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvratfi.SecondaryKekCertificatePfx + } + if hvratfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvratfi.RecoveryPointID + } + if hvratfi.InstanceType != "" { + objectMap["instanceType"] = hvratfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return &hvratfi, true +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &hvratfi, true +} + +// HyperVReplicaAzureUnplannedFailoverInput hvrA provider specific input for unplanned failover. +type HyperVReplicaAzureUnplannedFailoverInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + hvraufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraufi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvraufi.PrimaryKekCertificatePfx + } + if hvraufi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvraufi.SecondaryKekCertificatePfx + } + if hvraufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvraufi.RecoveryPointID + } + if hvraufi.InstanceType != "" { + objectMap["instanceType"] = hvraufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return &hvraufi, true +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &hvraufi, true +} + +// HyperVReplicaAzureUpdateReplicationProtectedItemInput hyperV replica Azure input to update replication +// protected item. +type HyperVReplicaAzureUpdateReplicationProtectedItemInput struct { + // RecoveryAzureV1ResourceGroupID - The recovery Azure resource group Id for classic deployment. + RecoveryAzureV1ResourceGroupID *string `json:"recoveryAzureV1ResourceGroupId,omitempty"` + // RecoveryAzureV2ResourceGroupID - The recovery Azure resource group Id for resource manager deployment. + RecoveryAzureV2ResourceGroupID *string `json:"recoveryAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // DiskIDToDiskEncryptionMap - The dictionary of disk resource Id to disk encryption set ARM Id. + DiskIDToDiskEncryptionMap map[string]*string `json:"diskIdToDiskEncryptionMap"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // VMDisks - The list of disk update properties. + VMDisks *[]UpdateDiskInput `json:"vmDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + hvraurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraurpii.RecoveryAzureV1ResourceGroupID != nil { + objectMap["recoveryAzureV1ResourceGroupId"] = hvraurpii.RecoveryAzureV1ResourceGroupID + } + if hvraurpii.RecoveryAzureV2ResourceGroupID != nil { + objectMap["recoveryAzureV2ResourceGroupId"] = hvraurpii.RecoveryAzureV2ResourceGroupID + } + if hvraurpii.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvraurpii.UseManagedDisks + } + if hvraurpii.DiskIDToDiskEncryptionMap != nil { + objectMap["diskIdToDiskEncryptionMap"] = hvraurpii.DiskIDToDiskEncryptionMap + } + if hvraurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvraurpii.TargetProximityPlacementGroupID + } + if hvraurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvraurpii.TargetAvailabilityZone + } + if hvraurpii.TargetVMTags != nil { + objectMap["targetVmTags"] = hvraurpii.TargetVMTags + } + if hvraurpii.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvraurpii.TargetManagedDiskTags + } + if hvraurpii.TargetNicTags != nil { + objectMap["targetNicTags"] = hvraurpii.TargetNicTags + } + if hvraurpii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = hvraurpii.SQLServerLicenseType + } + if hvraurpii.VMDisks != nil { + objectMap["vmDisks"] = hvraurpii.VMDisks + } + if hvraurpii.InstanceType != "" { + objectMap["instanceType"] = hvraurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return &hvraurpii, true +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &hvraurpii, true +} + +// HyperVReplicaBaseEventDetails abstract model class for event details of a HyperVReplica E2E event. +type HyperVReplicaBaseEventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) MarshalJSON() ([]byte, error) { + hvrbed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails + objectMap := make(map[string]interface{}) + if hvrbed.ContainerName != nil { + objectMap["containerName"] = hvrbed.ContainerName + } + if hvrbed.FabricName != nil { + objectMap["fabricName"] = hvrbed.FabricName + } + if hvrbed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvrbed.RemoteContainerName + } + if hvrbed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvrbed.RemoteFabricName + } + if hvrbed.InstanceType != "" { + objectMap["instanceType"] = hvrbed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return &hvrbed, true +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvrbed, true +} + +// HyperVReplicaBasePolicyDetails base class for HyperVReplica policy details. +type HyperVReplicaBasePolicyDetails struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud. + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) MarshalJSON() ([]byte, error) { + hvrbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails + objectMap := make(map[string]interface{}) + if hvrbpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpd.RecoveryPoints + } + if hvrbpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpd.Compression != nil { + objectMap["compression"] = hvrbpd.Compression + } + if hvrbpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpd.InitialReplicationMethod + } + if hvrbpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpd.OnlineReplicationStartTime + } + if hvrbpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpd.OfflineReplicationImportPath + } + if hvrbpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpd.OfflineReplicationExportPath + } + if hvrbpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpd.ReplicationPort + } + if hvrbpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpd.AllowedAuthenticationType + } + if hvrbpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrbpd.ReplicaDeletionOption + } + if hvrbpd.InstanceType != "" { + objectMap["instanceType"] = hvrbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return &hvrbpd, true +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrbpd, true +} + +// HyperVReplicaBaseReplicationDetails hyper V replica provider specific settings base class. +type HyperVReplicaBaseReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) MarshalJSON() ([]byte, error) { + hvrbrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails + objectMap := make(map[string]interface{}) + if hvrbrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrbrd.LastReplicatedTime + } + if hvrbrd.VMNics != nil { + objectMap["vmNics"] = hvrbrd.VMNics + } + if hvrbrd.VMID != nil { + objectMap["vmId"] = hvrbrd.VMID + } + if hvrbrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrbrd.VMProtectionState + } + if hvrbrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrbrd.VMProtectionStateDescription + } + if hvrbrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrbrd.InitialReplicationDetails + } + if hvrbrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrbrd.VMDiskDetails + } + if hvrbrd.InstanceType != "" { + objectMap["instanceType"] = hvrbrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return &hvrbrd, true +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrbrd, true +} + +// HyperVReplicaBluePolicyDetails hyper-V Replica Blue specific protection profile details. +type HyperVReplicaBluePolicyDetails struct { + // ReplicationFrequencyInSeconds - A value indicating the replication interval. + ReplicationFrequencyInSeconds *int32 `json:"replicationFrequencyInSeconds,omitempty"` + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) MarshalJSON() ([]byte, error) { + hvrbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbpd.ReplicationFrequencyInSeconds != nil { + objectMap["replicationFrequencyInSeconds"] = hvrbpd.ReplicationFrequencyInSeconds + } + if hvrbpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpd.RecoveryPoints + } + if hvrbpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpd.Compression != nil { + objectMap["compression"] = hvrbpd.Compression + } + if hvrbpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpd.InitialReplicationMethod + } + if hvrbpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpd.OnlineReplicationStartTime + } + if hvrbpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpd.OfflineReplicationImportPath + } + if hvrbpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpd.OfflineReplicationExportPath + } + if hvrbpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpd.ReplicationPort + } + if hvrbpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpd.AllowedAuthenticationType + } + if hvrbpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrbpd.ReplicaDeletionOption + } + if hvrbpd.InstanceType != "" { + objectMap["instanceType"] = hvrbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return &hvrbpd, true +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrbpd, true +} + +// HyperVReplicaBluePolicyInput hyperV Replica Blue policy input. +type HyperVReplicaBluePolicyInput struct { + // ReplicationFrequencyInSeconds - A value indicating the replication interval. + ReplicationFrequencyInSeconds *int32 `json:"replicationFrequencyInSeconds,omitempty"` + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletion - A value indicating whether the VM has to be auto deleted. + ReplicaDeletion *string `json:"replicaDeletion,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) MarshalJSON() ([]byte, error) { + hvrbpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbpi.ReplicationFrequencyInSeconds != nil { + objectMap["replicationFrequencyInSeconds"] = hvrbpi.ReplicationFrequencyInSeconds + } + if hvrbpi.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpi.RecoveryPoints + } + if hvrbpi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpi.Compression != nil { + objectMap["compression"] = hvrbpi.Compression + } + if hvrbpi.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpi.InitialReplicationMethod + } + if hvrbpi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpi.OnlineReplicationStartTime + } + if hvrbpi.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpi.OfflineReplicationImportPath + } + if hvrbpi.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpi.OfflineReplicationExportPath + } + if hvrbpi.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpi.ReplicationPort + } + if hvrbpi.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpi.AllowedAuthenticationType + } + if hvrbpi.ReplicaDeletion != nil { + objectMap["replicaDeletion"] = hvrbpi.ReplicaDeletion + } + if hvrbpi.InstanceType != "" { + objectMap["instanceType"] = hvrbpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return &hvrbpi, true +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return &hvrbpi, true +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrbpi, true +} + +// HyperVReplicaBlueReplicationDetails hyperV replica 2012 R2 (Blue) replication details. +type HyperVReplicaBlueReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) MarshalJSON() ([]byte, error) { + hvrbrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrbrd.LastReplicatedTime + } + if hvrbrd.VMNics != nil { + objectMap["vmNics"] = hvrbrd.VMNics + } + if hvrbrd.VMID != nil { + objectMap["vmId"] = hvrbrd.VMID + } + if hvrbrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrbrd.VMProtectionState + } + if hvrbrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrbrd.VMProtectionStateDescription + } + if hvrbrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrbrd.InitialReplicationDetails + } + if hvrbrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrbrd.VMDiskDetails + } + if hvrbrd.InstanceType != "" { + objectMap["instanceType"] = hvrbrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return &hvrbrd, true +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrbrd, true +} + +// HyperVReplicaPolicyDetails hyper-V Replica Blue specific protection profile details. +type HyperVReplicaPolicyDetails struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) MarshalJSON() ([]byte, error) { + hvrpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrpd.RecoveryPoints + } + if hvrpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrpd.Compression != nil { + objectMap["compression"] = hvrpd.Compression + } + if hvrpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrpd.InitialReplicationMethod + } + if hvrpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrpd.OnlineReplicationStartTime + } + if hvrpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrpd.OfflineReplicationImportPath + } + if hvrpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrpd.OfflineReplicationExportPath + } + if hvrpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrpd.ReplicationPort + } + if hvrpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrpd.AllowedAuthenticationType + } + if hvrpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrpd.ReplicaDeletionOption + } + if hvrpd.InstanceType != "" { + objectMap["instanceType"] = hvrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return &hvrpd, true +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrpd, true +} + +// BasicHyperVReplicaPolicyInput hyper-V Replica specific policy Input. +type BasicHyperVReplicaPolicyInput interface { + AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) + AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) +} + +// HyperVReplicaPolicyInput hyper-V Replica specific policy Input. +type HyperVReplicaPolicyInput struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletion - A value indicating whether the VM has to be auto deleted. + ReplicaDeletion *string `json:"replicaDeletion,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicHyperVReplicaPolicyInput(body []byte) (BasicHyperVReplicaPolicyInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2): + var hvrbpi HyperVReplicaBluePolicyInput + err := json.Unmarshal(body, &hvrbpi) + return hvrbpi, err + default: + var hvrpi HyperVReplicaPolicyInput + err := json.Unmarshal(body, &hvrpi) + return hvrpi, err + } +} +func unmarshalBasicHyperVReplicaPolicyInputArray(body []byte) ([]BasicHyperVReplicaPolicyInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + hvrpiArray := make([]BasicHyperVReplicaPolicyInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + hvrpi, err := unmarshalBasicHyperVReplicaPolicyInput(*rawMessage) + if err != nil { + return nil, err + } + hvrpiArray[index] = hvrpi + } + return hvrpiArray, nil +} + +// MarshalJSON is the custom marshaler for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) MarshalJSON() ([]byte, error) { + hvrpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrpi.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrpi.RecoveryPoints + } + if hvrpi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrpi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrpi.Compression != nil { + objectMap["compression"] = hvrpi.Compression + } + if hvrpi.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrpi.InitialReplicationMethod + } + if hvrpi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrpi.OnlineReplicationStartTime + } + if hvrpi.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrpi.OfflineReplicationImportPath + } + if hvrpi.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrpi.OfflineReplicationExportPath + } + if hvrpi.ReplicationPort != nil { + objectMap["replicationPort"] = hvrpi.ReplicationPort + } + if hvrpi.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrpi.AllowedAuthenticationType + } + if hvrpi.ReplicaDeletion != nil { + objectMap["replicaDeletion"] = hvrpi.ReplicaDeletion + } + if hvrpi.InstanceType != "" { + objectMap["instanceType"] = hvrpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return &hvrpi, true +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return &hvrpi, true +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrpi, true +} + +// HyperVReplicaReplicationDetails hyperV replica 2012 replication details. +type HyperVReplicaReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) MarshalJSON() ([]byte, error) { + hvrrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrrd.LastReplicatedTime + } + if hvrrd.VMNics != nil { + objectMap["vmNics"] = hvrrd.VMNics + } + if hvrrd.VMID != nil { + objectMap["vmId"] = hvrrd.VMID + } + if hvrrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrrd.VMProtectionState + } + if hvrrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrrd.VMProtectionStateDescription + } + if hvrrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrrd.InitialReplicationDetails + } + if hvrrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrrd.VMDiskDetails + } + if hvrrd.InstanceType != "" { + objectMap["instanceType"] = hvrrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return &hvrrd, true +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrrd, true +} + +// HyperVSiteDetails hyperVSite fabric specific details. +type HyperVSiteDetails struct { + // HyperVHosts - The list of Hyper-V hosts associated with the fabric. + HyperVHosts *[]HyperVHostDetails `json:"hyperVHosts,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) MarshalJSON() ([]byte, error) { + hvsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite + objectMap := make(map[string]interface{}) + if hvsd.HyperVHosts != nil { + objectMap["hyperVHosts"] = hvsd.HyperVHosts + } + if hvsd.InstanceType != "" { + objectMap["instanceType"] = hvsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return &hvsd, true +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &hvsd, true +} + +// BasicHyperVVirtualMachineDetails single Host fabric provider specific VM settings. +type BasicHyperVVirtualMachineDetails interface { + AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) + AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) +} + +// HyperVVirtualMachineDetails single Host fabric provider specific VM settings. +type HyperVVirtualMachineDetails struct { + // SourceItemID - The source id of the object. + SourceItemID *string `json:"sourceItemId,omitempty"` + // Generation - The id of the object in fabric. + Generation *string `json:"generation,omitempty"` + // OsDetails - The Last replication time. + OsDetails *OSDetails `json:"osDetails,omitempty"` + // DiskDetails - The Last successful failover time. + DiskDetails *[]DiskDetails `json:"diskDetails,omitempty"` + // HasPhysicalDisk - A value indicating whether the VM has a physical disk attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasPhysicalDisk PresenceStatus `json:"hasPhysicalDisk,omitempty"` + // HasFibreChannelAdapter - A value indicating whether the VM has a fibre channel adapter attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasFibreChannelAdapter PresenceStatus `json:"hasFibreChannelAdapter,omitempty"` + // HasSharedVhd - A value indicating whether the VM has a shared VHD attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasSharedVhd PresenceStatus `json:"hasSharedVhd,omitempty"` + // HyperVHostID - The Id of the hyper-v host in fabric. + HyperVHostID *string `json:"hyperVHostId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicHyperVVirtualMachineDetails(body []byte) (BasicHyperVVirtualMachineDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeVmmVirtualMachine): + var vvmd VmmVirtualMachineDetails + err := json.Unmarshal(body, &vvmd) + return vvmd, err + default: + var hvvmd HyperVVirtualMachineDetails + err := json.Unmarshal(body, &hvvmd) + return hvvmd, err + } +} +func unmarshalBasicHyperVVirtualMachineDetailsArray(body []byte) ([]BasicHyperVVirtualMachineDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + hvvmdArray := make([]BasicHyperVVirtualMachineDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + hvvmd, err := unmarshalBasicHyperVVirtualMachineDetails(*rawMessage) + if err != nil { + return nil, err + } + hvvmdArray[index] = hvvmd + } + return hvvmdArray, nil +} + +// MarshalJSON is the custom marshaler for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) MarshalJSON() ([]byte, error) { + hvvmd.InstanceType = InstanceTypeHyperVVirtualMachine + objectMap := make(map[string]interface{}) + if hvvmd.SourceItemID != nil { + objectMap["sourceItemId"] = hvvmd.SourceItemID + } + if hvvmd.Generation != nil { + objectMap["generation"] = hvvmd.Generation + } + if hvvmd.OsDetails != nil { + objectMap["osDetails"] = hvvmd.OsDetails + } + if hvvmd.DiskDetails != nil { + objectMap["diskDetails"] = hvvmd.DiskDetails + } + if hvvmd.HasPhysicalDisk != "" { + objectMap["hasPhysicalDisk"] = hvvmd.HasPhysicalDisk + } + if hvvmd.HasFibreChannelAdapter != "" { + objectMap["hasFibreChannelAdapter"] = hvvmd.HasFibreChannelAdapter + } + if hvvmd.HasSharedVhd != "" { + objectMap["hasSharedVhd"] = hvvmd.HasSharedVhd + } + if hvvmd.HyperVHostID != nil { + objectMap["hyperVHostId"] = hvvmd.HyperVHostID + } + if hvvmd.InstanceType != "" { + objectMap["instanceType"] = hvvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return &hvvmd, true +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return &hvvmd, true +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &hvvmd, true +} + +// IdentityProviderDetails identity provider details. +type IdentityProviderDetails struct { + // TenantID - The tenant Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + TenantID *string `json:"tenantId,omitempty"` + // ApplicationID - The application/client Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ApplicationID *string `json:"applicationId,omitempty"` + // ObjectID - The object Id of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ObjectID *string `json:"objectId,omitempty"` + // Audience - The intended Audience of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + Audience *string `json:"audience,omitempty"` + // AadAuthority - The base authority for Azure Active Directory authentication. + AadAuthority *string `json:"aadAuthority,omitempty"` +} + +// IdentityProviderInput identity provider input. +type IdentityProviderInput struct { + // TenantID - The tenant Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + TenantID *string `json:"tenantId,omitempty"` + // ApplicationID - The application/client Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ApplicationID *string `json:"applicationId,omitempty"` + // ObjectID - The object Id of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ObjectID *string `json:"objectId,omitempty"` + // Audience - The intended Audience of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + Audience *string `json:"audience,omitempty"` + // AadAuthority - The base authority for Azure Active Directory authentication. + AadAuthority *string `json:"aadAuthority,omitempty"` +} + +// InconsistentVMDetails this class stores the monitoring details for consistency check of inconsistent +// Protected Entity. +type InconsistentVMDetails struct { + // VMName - The Vm name. + VMName *string `json:"vmName,omitempty"` + // CloudName - The Cloud name. + CloudName *string `json:"cloudName,omitempty"` + // Details - The list of details regarding state of the Protected Entity in SRS and On prem. + Details *[]string `json:"details,omitempty"` + // ErrorIds - The list of error ids. + ErrorIds *[]string `json:"errorIds,omitempty"` +} + +// InitialReplicationDetails initial replication details. +type InitialReplicationDetails struct { + // InitialReplicationType - Initial replication type. + InitialReplicationType *string `json:"initialReplicationType,omitempty"` + // InitialReplicationProgressPercentage - The initial replication progress percentage. + InitialReplicationProgressPercentage *string `json:"initialReplicationProgressPercentage,omitempty"` +} + +// InlineWorkflowTaskDetails this class represents the inline workflow task details. +type InlineWorkflowTaskDetails struct { + // WorkflowIds - The list of child workflow ids. + WorkflowIds *[]string `json:"workflowIds,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) MarshalJSON() ([]byte, error) { + iwtd.InstanceType = InstanceTypeInlineWorkflowTaskDetails + objectMap := make(map[string]interface{}) + if iwtd.WorkflowIds != nil { + objectMap["workflowIds"] = iwtd.WorkflowIds + } + if iwtd.ChildTasks != nil { + objectMap["childTasks"] = iwtd.ChildTasks + } + if iwtd.InstanceType != "" { + objectMap["instanceType"] = iwtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return &iwtd, true +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &iwtd, true +} + +// InMageAgentDetails the details of the InMage agent. +type InMageAgentDetails struct { + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentUpdateStatus - A value indicating whether installed agent needs to be updated. + AgentUpdateStatus *string `json:"agentUpdateStatus,omitempty"` + // PostUpdateRebootStatus - A value indicating whether reboot is required after update is applied. + PostUpdateRebootStatus *string `json:"postUpdateRebootStatus,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` +} + +// InMageAzureV2ApplyRecoveryPointInput applyRecoveryPoint input specific to InMageAzureV2 provider. +type InMageAzureV2ApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + imavarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavarpi.InstanceType != "" { + objectMap["instanceType"] = imavarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return &imavarpi, true +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &imavarpi, true +} + +// InMageAzureV2DiskInputDetails disk input details. +type InMageAzureV2DiskInputDetails struct { + // DiskID - The DiskId. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The LogStorageAccountId. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageAzureV2EnableProtectionInput vMware Azure specific enable protection input. +type InMageAzureV2EnableProtectionInput struct { + // MasterTargetID - The Master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // StorageAccountID - The storage account Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // MultiVMGroupID - The multi VM group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]InMageAzureV2DiskInputDetails `json:"disksToInclude,omitempty"` + // TargetAzureNetworkID - The selected target Azure network Id. + TargetAzureNetworkID *string `json:"targetAzureNetworkId,omitempty"` + // TargetAzureSubnetID - The selected target Azure subnet Id. + TargetAzureSubnetID *string `json:"targetAzureSubnetId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target VM after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // TargetAzureVMName - The target azure VM Name. + TargetAzureVMName *string `json:"targetAzureVmName,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // TargetAzureV1ResourceGroupID - The Id of the target resource group (for classic deployment) in which the failover VM is to be created. + TargetAzureV1ResourceGroupID *string `json:"targetAzureV1ResourceGroupId,omitempty"` + // TargetAzureV2ResourceGroupID - The Id of the target resource group (for resource manager deployment) in which the failover VM is to be created. + TargetAzureV2ResourceGroupID *string `json:"targetAzureV2ResourceGroupId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id for resource manager deployment. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) MarshalJSON() ([]byte, error) { + imavepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavepi.MasterTargetID != nil { + objectMap["masterTargetId"] = imavepi.MasterTargetID + } + if imavepi.ProcessServerID != nil { + objectMap["processServerId"] = imavepi.ProcessServerID + } + if imavepi.StorageAccountID != nil { + objectMap["storageAccountId"] = imavepi.StorageAccountID + } + if imavepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imavepi.RunAsAccountID + } + if imavepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imavepi.MultiVMGroupID + } + if imavepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imavepi.MultiVMGroupName + } + if imavepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imavepi.DisksToInclude + } + if imavepi.TargetAzureNetworkID != nil { + objectMap["targetAzureNetworkId"] = imavepi.TargetAzureNetworkID + } + if imavepi.TargetAzureSubnetID != nil { + objectMap["targetAzureSubnetId"] = imavepi.TargetAzureSubnetID + } + if imavepi.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = imavepi.EnableRdpOnTargetOption + } + if imavepi.TargetAzureVMName != nil { + objectMap["targetAzureVmName"] = imavepi.TargetAzureVMName + } + if imavepi.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imavepi.LogStorageAccountID + } + if imavepi.TargetAzureV1ResourceGroupID != nil { + objectMap["targetAzureV1ResourceGroupId"] = imavepi.TargetAzureV1ResourceGroupID + } + if imavepi.TargetAzureV2ResourceGroupID != nil { + objectMap["targetAzureV2ResourceGroupId"] = imavepi.TargetAzureV2ResourceGroupID + } + if imavepi.DiskType != "" { + objectMap["diskType"] = imavepi.DiskType + } + if imavepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imavepi.TargetAvailabilitySetID + } + if imavepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavepi.TargetAvailabilityZone + } + if imavepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavepi.TargetProximityPlacementGroupID + } + if imavepi.LicenseType != "" { + objectMap["licenseType"] = imavepi.LicenseType + } + if imavepi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = imavepi.SQLServerLicenseType + } + if imavepi.TargetVMSize != nil { + objectMap["targetVmSize"] = imavepi.TargetVMSize + } + if imavepi.DiskEncryptionSetID != nil { + objectMap["diskEncryptionSetId"] = imavepi.DiskEncryptionSetID + } + if imavepi.TargetVMTags != nil { + objectMap["targetVmTags"] = imavepi.TargetVMTags + } + if imavepi.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = imavepi.SeedManagedDiskTags + } + if imavepi.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavepi.TargetManagedDiskTags + } + if imavepi.TargetNicTags != nil { + objectMap["targetNicTags"] = imavepi.TargetNicTags + } + if imavepi.InstanceType != "" { + objectMap["instanceType"] = imavepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return &imavepi, true +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imavepi, true +} + +// InMageAzureV2EventDetails model class for event details of a VMwareAzureV2 event. +type InMageAzureV2EventDetails struct { + // EventType - InMage Event type. Takes one of the values of InMageDataContract.InMageMonitoringEventType. + EventType *string `json:"eventType,omitempty"` + // Category - InMage Event Category. + Category *string `json:"category,omitempty"` + // Component - InMage Event Component. + Component *string `json:"component,omitempty"` + // CorrectiveAction - Corrective Action string for the event. + CorrectiveAction *string `json:"correctiveAction,omitempty"` + // Details - InMage Event Details. + Details *string `json:"details,omitempty"` + // Summary - InMage Event Summary. + Summary *string `json:"summary,omitempty"` + // SiteName - VMware Site name. + SiteName *string `json:"siteName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) MarshalJSON() ([]byte, error) { + imaved.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imaved.EventType != nil { + objectMap["eventType"] = imaved.EventType + } + if imaved.Category != nil { + objectMap["category"] = imaved.Category + } + if imaved.Component != nil { + objectMap["component"] = imaved.Component + } + if imaved.CorrectiveAction != nil { + objectMap["correctiveAction"] = imaved.CorrectiveAction + } + if imaved.Details != nil { + objectMap["details"] = imaved.Details + } + if imaved.Summary != nil { + objectMap["summary"] = imaved.Summary + } + if imaved.SiteName != nil { + objectMap["siteName"] = imaved.SiteName + } + if imaved.InstanceType != "" { + objectMap["instanceType"] = imaved.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return &imaved, true +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imaved, true +} + +// InMageAzureV2ManagedDiskDetails inMageAzureV2 Managed disk details. +type InMageAzureV2ManagedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // SeedManagedDiskID - Seed managed disk Id. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // ReplicaDiskType - The replica disk type. + ReplicaDiskType *string `json:"replicaDiskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetDiskName - The target disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// InMageAzureV2PolicyDetails inMage Azure v2 specific protection profile details. +type InMageAzureV2PolicyDetails struct { + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) MarshalJSON() ([]byte, error) { + imavpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imavpd.CrashConsistentFrequencyInMinutes + } + if imavpd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imavpd.RecoveryPointThresholdInMinutes + } + if imavpd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imavpd.RecoveryPointHistory + } + if imavpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imavpd.AppConsistentFrequencyInMinutes + } + if imavpd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imavpd.MultiVMSyncStatus + } + if imavpd.InstanceType != "" { + objectMap["instanceType"] = imavpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return &imavpd, true +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imavpd, true +} + +// InMageAzureV2PolicyInput vMWare Azure specific policy Input. +type InMageAzureV2PolicyInput struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) MarshalJSON() ([]byte, error) { + imavpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavpi.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imavpi.RecoveryPointThresholdInMinutes + } + if imavpi.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imavpi.RecoveryPointHistory + } + if imavpi.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imavpi.CrashConsistentFrequencyInMinutes + } + if imavpi.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imavpi.AppConsistentFrequencyInMinutes + } + if imavpi.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = imavpi.MultiVMSyncStatus + } + if imavpi.InstanceType != "" { + objectMap["instanceType"] = imavpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return &imavpi, true +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imavpi, true +} + +// InMageAzureV2ProtectedDiskDetails inMageAzureV2 protected disk details. +type InMageAzureV2ProtectedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // HealthErrorCode - The health error code for the disk. + HealthErrorCode *string `json:"healthErrorCode,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncDurationInSeconds - The resync duration in seconds. + ResyncDurationInSeconds *int64 `json:"resyncDurationInSeconds,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // FileSystemCapacityInBytes - The disk file system capacity in bytes. + FileSystemCapacityInBytes *int64 `json:"fileSystemCapacityInBytes,omitempty"` + // SourceDataInMegaBytes - The source data transit in MB. + SourceDataInMegaBytes *float64 `json:"sourceDataInMegaBytes,omitempty"` + // PsDataInMegaBytes - The PS data transit in MB. + PsDataInMegaBytes *float64 `json:"psDataInMegaBytes,omitempty"` + // TargetDataInMegaBytes - The target data transit in MB. + TargetDataInMegaBytes *float64 `json:"targetDataInMegaBytes,omitempty"` + // DiskResized - A value indicating whether disk is resized. + DiskResized *string `json:"diskResized,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // ResyncProcessedBytes - The resync processed bytes. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTotalTransferredBytes - The resync total transferred bytes. + ResyncTotalTransferredBytes *int64 `json:"resyncTotalTransferredBytes,omitempty"` + // ResyncLast15MinutesTransferredBytes - The resync last 15 minutes transferred bytes. + ResyncLast15MinutesTransferredBytes *int64 `json:"resyncLast15MinutesTransferredBytes,omitempty"` + // ResyncLastDataTransferTimeUTC - The last data transfer time in UTC. + ResyncLastDataTransferTimeUTC *date.Time `json:"resyncLastDataTransferTimeUTC,omitempty"` + // ResyncStartTime - The resync start time. + ResyncStartTime *date.Time `json:"resyncStartTime,omitempty"` + // ProgressHealth - The Progress Health. + ProgressHealth *string `json:"progressHealth,omitempty"` + // ProgressStatus - The Progress Status. + ProgressStatus *string `json:"progressStatus,omitempty"` + // SecondsToTakeSwitchProvider - The seconds to take for switch provider. + SecondsToTakeSwitchProvider *int64 `json:"secondsToTakeSwitchProvider,omitempty"` +} + +// InMageAzureV2RecoveryPointDetails inMage Azure V2 provider specific recovery point details. +type InMageAzureV2RecoveryPointDetails struct { + // IsMultiVMSyncPoint - A value indicating whether the recovery point is multi VM consistent. + IsMultiVMSyncPoint *string `json:"isMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) MarshalJSON() ([]byte, error) { + imavrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavrpd.IsMultiVMSyncPoint != nil { + objectMap["isMultiVmSyncPoint"] = imavrpd.IsMultiVMSyncPoint + } + if imavrpd.InstanceType != "" { + objectMap["instanceType"] = imavrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return &imavrpd, true +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &imavrpd, true +} + +// InMageAzureV2ReplicationDetails inMageAzureV2 provider specific settings. +type InMageAzureV2ReplicationDetails struct { + // InfrastructureVMID - The infrastructure VM Id. + InfrastructureVMID *string `json:"infrastructureVmId,omitempty"` + // VCenterInfrastructureID - The vCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // CompressedDataRateInMB - The compressed data change rate in MB. + CompressedDataRateInMB *float64 `json:"compressedDataRateInMB,omitempty"` + // UncompressedDataRateInMB - The uncompressed data change rate in MB. + UncompressedDataRateInMB *float64 `json:"uncompressedDataRateInMB,omitempty"` + // IPAddress - The source IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // IsAgentUpdateRequired - A value indicating whether installed agent needs to be updated. + IsAgentUpdateRequired *string `json:"isAgentUpdateRequired,omitempty"` + // IsRebootAfterUpdateRequired - A value indicating whether the source server requires a restart after update. + IsRebootAfterUpdateRequired *string `json:"isRebootAfterUpdateRequired,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // ProcessServerName - The process server name. + ProcessServerName *string `json:"processServerName,omitempty"` + // MultiVMGroupID - The multi vm group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi vm sync is enabled or disabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageAzureV2ProtectedDiskDetails `json:"protectedDisks,omitempty"` + // DiskResized - A value indicating whether any disk is resized for this VM. + DiskResized *string `json:"diskResized,omitempty"` + // MasterTargetID - The master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // OsType - The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // VhdName - The OS disk VHD name. + VhdName *string `json:"vhdName,omitempty"` + // OsDiskID - The id of the disk containing the OS. + OsDiskID *string `json:"osDiskId,omitempty"` + // AzureVMDiskDetails - Azure VM Disk details. + AzureVMDiskDetails *[]AzureVMDiskDetails `json:"azureVMDiskDetails,omitempty"` + // RecoveryAzureVMName - Recovery Azure given name. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureVMSize - The Recovery Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureStorageAccount - The recovery Azure storage account. + RecoveryAzureStorageAccount *string `json:"recoveryAzureStorageAccount,omitempty"` + // RecoveryAzureLogStorageAccountID - The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. + RecoveryAzureLogStorageAccountID *string `json:"recoveryAzureLogStorageAccountId,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // SelectedRecoveryAzureNetworkID - The selected recovery azure network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The test failover virtual network. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. Value can be vCenter or physical. + DiscoveryType *string `json:"discoveryType,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // Datastores - The datastores of the on-premise machine. Value can be list of strings that contain datastore names. + Datastores *[]string `json:"datastores,omitempty"` + // TargetVMID - The ARM Id of the target Azure VM. This value will be null until the VM is failed over. Only after failure it will be populated with the ARM Id of the Azure VM. + TargetVMID *string `json:"targetVmId,omitempty"` + // RecoveryAzureResourceGroupID - The target resource group Id. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // ValidationErrors - The validation errors of the on-premise machine Value can be list of validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastUpdateReceivedTime - The last update time received from on-prem components. + LastUpdateReceivedTime *date.Time `json:"lastUpdateReceivedTime,omitempty"` + // ReplicaID - The replica id of the protected item. + ReplicaID *string `json:"replicaId,omitempty"` + // OsVersion - The OS Version of the protected item. + OsVersion *string `json:"osVersion,omitempty"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]InMageAzureV2ManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // FirmwareType - The firmware type of this protected item. + FirmwareType *string `json:"firmwareType,omitempty"` + // AzureVMGeneration - The target generation for this protected item. + AzureVMGeneration *string `json:"azureVmGeneration,omitempty"` + // IsAdditionalStatsAvailable - A value indicating whether additional IR stats are available or not. + IsAdditionalStatsAvailable *bool `json:"isAdditionalStatsAvailable,omitempty"` + // TotalDataTransferred - The total transferred data in bytes. + TotalDataTransferred *int64 `json:"totalDataTransferred,omitempty"` + // TotalProgressHealth - The progress health. + TotalProgressHealth *string `json:"totalProgressHealth,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // SwitchProviderBlockingErrorDetails - The switch provider blocking error information. + SwitchProviderBlockingErrorDetails *[]InMageAzureV2SwitchProviderBlockingErrorDetails `json:"switchProviderBlockingErrorDetails,omitempty"` + // SwitchProviderDetails - The switch provider blocking error information. + SwitchProviderDetails *InMageAzureV2SwitchProviderDetails `json:"switchProviderDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) MarshalJSON() ([]byte, error) { + imavrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavrd.InfrastructureVMID != nil { + objectMap["infrastructureVmId"] = imavrd.InfrastructureVMID + } + if imavrd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = imavrd.VCenterInfrastructureID + } + if imavrd.ProtectionStage != nil { + objectMap["protectionStage"] = imavrd.ProtectionStage + } + if imavrd.VMID != nil { + objectMap["vmId"] = imavrd.VMID + } + if imavrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = imavrd.VMProtectionState + } + if imavrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = imavrd.VMProtectionStateDescription + } + if imavrd.ResyncProgressPercentage != nil { + objectMap["resyncProgressPercentage"] = imavrd.ResyncProgressPercentage + } + if imavrd.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = imavrd.RpoInSeconds + } + if imavrd.CompressedDataRateInMB != nil { + objectMap["compressedDataRateInMB"] = imavrd.CompressedDataRateInMB + } + if imavrd.UncompressedDataRateInMB != nil { + objectMap["uncompressedDataRateInMB"] = imavrd.UncompressedDataRateInMB + } + if imavrd.IPAddress != nil { + objectMap["ipAddress"] = imavrd.IPAddress + } + if imavrd.AgentVersion != nil { + objectMap["agentVersion"] = imavrd.AgentVersion + } + if imavrd.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = imavrd.AgentExpiryDate + } + if imavrd.IsAgentUpdateRequired != nil { + objectMap["isAgentUpdateRequired"] = imavrd.IsAgentUpdateRequired + } + if imavrd.IsRebootAfterUpdateRequired != nil { + objectMap["isRebootAfterUpdateRequired"] = imavrd.IsRebootAfterUpdateRequired + } + if imavrd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = imavrd.LastHeartbeat + } + if imavrd.ProcessServerID != nil { + objectMap["processServerId"] = imavrd.ProcessServerID + } + if imavrd.ProcessServerName != nil { + objectMap["processServerName"] = imavrd.ProcessServerName + } + if imavrd.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imavrd.MultiVMGroupID + } + if imavrd.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imavrd.MultiVMGroupName + } + if imavrd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imavrd.MultiVMSyncStatus + } + if imavrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imavrd.ProtectedDisks + } + if imavrd.DiskResized != nil { + objectMap["diskResized"] = imavrd.DiskResized + } + if imavrd.MasterTargetID != nil { + objectMap["masterTargetId"] = imavrd.MasterTargetID + } + if imavrd.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = imavrd.SourceVMCPUCount + } + if imavrd.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = imavrd.SourceVMRAMSizeInMB + } + if imavrd.OsType != nil { + objectMap["osType"] = imavrd.OsType + } + if imavrd.VhdName != nil { + objectMap["vhdName"] = imavrd.VhdName + } + if imavrd.OsDiskID != nil { + objectMap["osDiskId"] = imavrd.OsDiskID + } + if imavrd.AzureVMDiskDetails != nil { + objectMap["azureVMDiskDetails"] = imavrd.AzureVMDiskDetails + } + if imavrd.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVMName"] = imavrd.RecoveryAzureVMName + } + if imavrd.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = imavrd.RecoveryAzureVMSize + } + if imavrd.RecoveryAzureStorageAccount != nil { + objectMap["recoveryAzureStorageAccount"] = imavrd.RecoveryAzureStorageAccount + } + if imavrd.RecoveryAzureLogStorageAccountID != nil { + objectMap["recoveryAzureLogStorageAccountId"] = imavrd.RecoveryAzureLogStorageAccountID + } + if imavrd.VMNics != nil { + objectMap["vmNics"] = imavrd.VMNics + } + if imavrd.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = imavrd.SelectedRecoveryAzureNetworkID + } + if imavrd.SelectedTfoAzureNetworkID != nil { + objectMap["selectedTfoAzureNetworkId"] = imavrd.SelectedTfoAzureNetworkID + } + if imavrd.SelectedSourceNicID != nil { + objectMap["selectedSourceNicId"] = imavrd.SelectedSourceNicID + } + if imavrd.DiscoveryType != nil { + objectMap["discoveryType"] = imavrd.DiscoveryType + } + if imavrd.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = imavrd.EnableRdpOnTargetOption + } + if imavrd.Datastores != nil { + objectMap["datastores"] = imavrd.Datastores + } + if imavrd.TargetVMID != nil { + objectMap["targetVmId"] = imavrd.TargetVMID + } + if imavrd.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = imavrd.RecoveryAzureResourceGroupID + } + if imavrd.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = imavrd.RecoveryAvailabilitySetID + } + if imavrd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavrd.TargetAvailabilityZone + } + if imavrd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavrd.TargetProximityPlacementGroupID + } + if imavrd.UseManagedDisks != nil { + objectMap["useManagedDisks"] = imavrd.UseManagedDisks + } + if imavrd.LicenseType != nil { + objectMap["licenseType"] = imavrd.LicenseType + } + if imavrd.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = imavrd.SQLServerLicenseType + } + if imavrd.ValidationErrors != nil { + objectMap["validationErrors"] = imavrd.ValidationErrors + } + if imavrd.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = imavrd.LastRpoCalculatedTime + } + if imavrd.LastUpdateReceivedTime != nil { + objectMap["lastUpdateReceivedTime"] = imavrd.LastUpdateReceivedTime + } + if imavrd.ReplicaID != nil { + objectMap["replicaId"] = imavrd.ReplicaID + } + if imavrd.OsVersion != nil { + objectMap["osVersion"] = imavrd.OsVersion + } + if imavrd.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = imavrd.ProtectedManagedDisks + } + if imavrd.FirmwareType != nil { + objectMap["firmwareType"] = imavrd.FirmwareType + } + if imavrd.AzureVMGeneration != nil { + objectMap["azureVmGeneration"] = imavrd.AzureVMGeneration + } + if imavrd.IsAdditionalStatsAvailable != nil { + objectMap["isAdditionalStatsAvailable"] = imavrd.IsAdditionalStatsAvailable + } + if imavrd.TotalDataTransferred != nil { + objectMap["totalDataTransferred"] = imavrd.TotalDataTransferred + } + if imavrd.TotalProgressHealth != nil { + objectMap["totalProgressHealth"] = imavrd.TotalProgressHealth + } + if imavrd.TargetVMTags != nil { + objectMap["targetVmTags"] = imavrd.TargetVMTags + } + if imavrd.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = imavrd.SeedManagedDiskTags + } + if imavrd.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavrd.TargetManagedDiskTags + } + if imavrd.TargetNicTags != nil { + objectMap["targetNicTags"] = imavrd.TargetNicTags + } + if imavrd.SwitchProviderBlockingErrorDetails != nil { + objectMap["switchProviderBlockingErrorDetails"] = imavrd.SwitchProviderBlockingErrorDetails + } + if imavrd.SwitchProviderDetails != nil { + objectMap["switchProviderDetails"] = imavrd.SwitchProviderDetails + } + if imavrd.InstanceType != "" { + objectMap["instanceType"] = imavrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return &imavrd, true +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imavrd, true +} + +// InMageAzureV2ReprotectInput inMageAzureV2 specific provider input. +type InMageAzureV2ReprotectInput struct { + // MasterTargetID - The Master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // StorageAccountID - The storage account id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) MarshalJSON() ([]byte, error) { + imavri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavri.MasterTargetID != nil { + objectMap["masterTargetId"] = imavri.MasterTargetID + } + if imavri.ProcessServerID != nil { + objectMap["processServerId"] = imavri.ProcessServerID + } + if imavri.StorageAccountID != nil { + objectMap["storageAccountId"] = imavri.StorageAccountID + } + if imavri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imavri.RunAsAccountID + } + if imavri.PolicyID != nil { + objectMap["policyId"] = imavri.PolicyID + } + if imavri.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imavri.LogStorageAccountID + } + if imavri.DisksToInclude != nil { + objectMap["disksToInclude"] = imavri.DisksToInclude + } + if imavri.InstanceType != "" { + objectMap["instanceType"] = imavri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return &imavri, true +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imavri, true +} + +// InMageAzureV2SwitchProviderBlockingErrorDetails inMageAzureV2 switch provider blocking error details. +type InMageAzureV2SwitchProviderBlockingErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2SwitchProviderBlockingErrorDetails. +func (imavspbed InMageAzureV2SwitchProviderBlockingErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageAzureV2SwitchProviderDetails inMageAzureV2 switch provider details. +type InMageAzureV2SwitchProviderDetails struct { + // TargetVaultID - READ-ONLY; The target vault Id. + TargetVaultID *string `json:"targetVaultId,omitempty"` + // TargetResourceID - READ-ONLY; The target resource Id. + TargetResourceID *string `json:"targetResourceId,omitempty"` + // TargetFabricID - READ-ONLY; The target fabric Id. + TargetFabricID *string `json:"targetFabricId,omitempty"` + // TargetApplianceID - READ-ONLY; The target appliance Id. + TargetApplianceID *string `json:"targetApplianceId,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2SwitchProviderDetails. +func (imavspd InMageAzureV2SwitchProviderDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageAzureV2SwitchProviderProviderInput provider specific input for InMageAzureV2 switch provider. +type InMageAzureV2SwitchProviderProviderInput struct { + // TargetVaultID - The target vault Id. + TargetVaultID *string `json:"targetVaultID,omitempty"` + // TargetFabricID - The target fabric Id. + TargetFabricID *string `json:"targetFabricID,omitempty"` + // TargetApplianceID - The target appliance Id. + TargetApplianceID *string `json:"targetApplianceID,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeSwitchProviderProviderSpecificInput', 'InstanceTypeInMageAzureV2' + InstanceType InstanceTypeBasicSwitchProviderProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2SwitchProviderProviderInput. +func (imavsppi InMageAzureV2SwitchProviderProviderInput) MarshalJSON() ([]byte, error) { + imavsppi.InstanceType = InstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavsppi.TargetVaultID != nil { + objectMap["targetVaultID"] = imavsppi.TargetVaultID + } + if imavsppi.TargetFabricID != nil { + objectMap["targetFabricID"] = imavsppi.TargetFabricID + } + if imavsppi.TargetApplianceID != nil { + objectMap["targetApplianceID"] = imavsppi.TargetApplianceID + } + if imavsppi.InstanceType != "" { + objectMap["instanceType"] = imavsppi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageAzureV2SwitchProviderProviderInput is the BasicSwitchProviderProviderSpecificInput implementation for InMageAzureV2SwitchProviderProviderInput. +func (imavsppi InMageAzureV2SwitchProviderProviderInput) AsInMageAzureV2SwitchProviderProviderInput() (*InMageAzureV2SwitchProviderProviderInput, bool) { + return &imavsppi, true +} + +// AsSwitchProviderProviderSpecificInput is the BasicSwitchProviderProviderSpecificInput implementation for InMageAzureV2SwitchProviderProviderInput. +func (imavsppi InMageAzureV2SwitchProviderProviderInput) AsSwitchProviderProviderSpecificInput() (*SwitchProviderProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicSwitchProviderProviderSpecificInput is the BasicSwitchProviderProviderSpecificInput implementation for InMageAzureV2SwitchProviderProviderInput. +func (imavsppi InMageAzureV2SwitchProviderProviderInput) AsBasicSwitchProviderProviderSpecificInput() (BasicSwitchProviderProviderSpecificInput, bool) { + return &imavsppi, true +} + +// InMageAzureV2TestFailoverInput inMageAzureV2 provider specific input for test failover. +type InMageAzureV2TestFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) MarshalJSON() ([]byte, error) { + imavtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imavtfi.RecoveryPointID + } + if imavtfi.InstanceType != "" { + objectMap["instanceType"] = imavtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return &imavtfi, true +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imavtfi, true +} + +// InMageAzureV2UnplannedFailoverInput inMageAzureV2 provider specific input for unplanned failover. +type InMageAzureV2UnplannedFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imavufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imavufi.RecoveryPointID + } + if imavufi.InstanceType != "" { + objectMap["instanceType"] = imavufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return &imavufi, true +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imavufi, true +} + +// InMageAzureV2UpdateReplicationProtectedItemInput inMage Azure V2 input to update replication protected +// item. +type InMageAzureV2UpdateReplicationProtectedItemInput struct { + // RecoveryAzureV1ResourceGroupID - The recovery Azure resource group Id for classic deployment. + RecoveryAzureV1ResourceGroupID *string `json:"recoveryAzureV1ResourceGroupId,omitempty"` + // RecoveryAzureV2ResourceGroupID - The recovery Azure resource group Id for resource manager deployment. + RecoveryAzureV2ResourceGroupID *string `json:"recoveryAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // VMDisks - The list of disk update properties. + VMDisks *[]UpdateDiskInput `json:"vmDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imavurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavurpii.RecoveryAzureV1ResourceGroupID != nil { + objectMap["recoveryAzureV1ResourceGroupId"] = imavurpii.RecoveryAzureV1ResourceGroupID + } + if imavurpii.RecoveryAzureV2ResourceGroupID != nil { + objectMap["recoveryAzureV2ResourceGroupId"] = imavurpii.RecoveryAzureV2ResourceGroupID + } + if imavurpii.UseManagedDisks != nil { + objectMap["useManagedDisks"] = imavurpii.UseManagedDisks + } + if imavurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavurpii.TargetProximityPlacementGroupID + } + if imavurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavurpii.TargetAvailabilityZone + } + if imavurpii.TargetVMTags != nil { + objectMap["targetVmTags"] = imavurpii.TargetVMTags + } + if imavurpii.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavurpii.TargetManagedDiskTags + } + if imavurpii.TargetNicTags != nil { + objectMap["targetNicTags"] = imavurpii.TargetNicTags + } + if imavurpii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = imavurpii.SQLServerLicenseType + } + if imavurpii.VMDisks != nil { + objectMap["vmDisks"] = imavurpii.VMDisks + } + if imavurpii.InstanceType != "" { + objectMap["instanceType"] = imavurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return &imavurpii, true +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &imavurpii, true +} + +// InMageBasePolicyDetails base class for the policies of providers using InMage replication. +type InMageBasePolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) MarshalJSON() ([]byte, error) { + imbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails + objectMap := make(map[string]interface{}) + if imbpd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imbpd.RecoveryPointThresholdInMinutes + } + if imbpd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imbpd.RecoveryPointHistory + } + if imbpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imbpd.AppConsistentFrequencyInMinutes + } + if imbpd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imbpd.MultiVMSyncStatus + } + if imbpd.InstanceType != "" { + objectMap["instanceType"] = imbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return &imbpd, true +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imbpd, true +} + +// InMageDisableProtectionProviderSpecificInput inMage disable protection provider specific input. +type InMageDisableProtectionProviderSpecificInput struct { + // ReplicaVMDeletionStatus - A value indicating whether the replica VM should be destroyed or retained. Values from Delete and Retain. + ReplicaVMDeletionStatus *string `json:"replicaVmDeletionStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeDisableProtectionProviderSpecificInput', 'InstanceTypeInMage' + InstanceType InstanceTypeBasicDisableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + imdppsi.InstanceType = InstanceTypeInMage + objectMap := make(map[string]interface{}) + if imdppsi.ReplicaVMDeletionStatus != nil { + objectMap["replicaVmDeletionStatus"] = imdppsi.ReplicaVMDeletionStatus + } + if imdppsi.InstanceType != "" { + objectMap["instanceType"] = imdppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) { + return &imdppsi, true +} + +// AsDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsBasicDisableProtectionProviderSpecificInput() (BasicDisableProtectionProviderSpecificInput, bool) { + return &imdppsi, true +} + +// InMageDiskDetails vMware/Physical specific Disk Details. +type InMageDiskDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskSizeInMB - The disk size in MB. + DiskSizeInMB *string `json:"diskSizeInMB,omitempty"` + // DiskType - Whether disk is system disk or data disk. + DiskType *string `json:"diskType,omitempty"` + // DiskConfiguration - Whether disk is dynamic disk or basic disk. + DiskConfiguration *string `json:"diskConfiguration,omitempty"` + // VolumeList - Volumes of the disk. + VolumeList *[]DiskVolumeDetails `json:"volumeList,omitempty"` +} + +// InMageDiskExclusionInput diskExclusionInput when doing enable protection of virtual machine in InMage +// provider. +type InMageDiskExclusionInput struct { + // VolumeOptions - The volume label based option for disk exclusion. + VolumeOptions *[]InMageVolumeExclusionOptions `json:"volumeOptions,omitempty"` + // DiskSignatureOptions - The guest disk signature based option for disk exclusion. + DiskSignatureOptions *[]InMageDiskSignatureExclusionOptions `json:"diskSignatureOptions,omitempty"` +} + +// InMageDiskSignatureExclusionOptions guest disk signature based disk exclusion option when doing enable +// protection of virtual machine in InMage provider. +type InMageDiskSignatureExclusionOptions struct { + // DiskSignature - The guest signature of disk to be excluded from replication. + DiskSignature *string `json:"diskSignature,omitempty"` +} + +// InMageEnableProtectionInput vMware Azure specific enable protection input. +type InMageEnableProtectionInput struct { + // VMFriendlyName - The VM Name. + VMFriendlyName *string `json:"vmFriendlyName,omitempty"` + // MasterTargetID - The Master Target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RetentionDrive - The retention drive to use on the MT. + RetentionDrive *string `json:"retentionDrive,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // MultiVMGroupID - The multi VM group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // DiskExclusionInput - The enable disk exclusion input. + DiskExclusionInput *InMageDiskExclusionInput `json:"diskExclusionInput,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) MarshalJSON() ([]byte, error) { + imepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imepi.VMFriendlyName != nil { + objectMap["vmFriendlyName"] = imepi.VMFriendlyName + } + if imepi.MasterTargetID != nil { + objectMap["masterTargetId"] = imepi.MasterTargetID + } + if imepi.ProcessServerID != nil { + objectMap["processServerId"] = imepi.ProcessServerID + } + if imepi.RetentionDrive != nil { + objectMap["retentionDrive"] = imepi.RetentionDrive + } + if imepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imepi.RunAsAccountID + } + if imepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imepi.MultiVMGroupID + } + if imepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imepi.MultiVMGroupName + } + if imepi.DatastoreName != nil { + objectMap["datastoreName"] = imepi.DatastoreName + } + if imepi.DiskExclusionInput != nil { + objectMap["diskExclusionInput"] = imepi.DiskExclusionInput + } + if imepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imepi.DisksToInclude + } + if imepi.InstanceType != "" { + objectMap["instanceType"] = imepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return &imepi, true +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imepi, true +} + +// InMageFabricSwitchProviderBlockingErrorDetails inMageFabric switch provider blocking error details. +type InMageFabricSwitchProviderBlockingErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageFabricSwitchProviderBlockingErrorDetails. +func (imfspbed InMageFabricSwitchProviderBlockingErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMagePolicyDetails inMage specific protection profile details. +type InMagePolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMagePolicyDetails. +func (impd InMagePolicyDetails) MarshalJSON() ([]byte, error) { + impd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage + objectMap := make(map[string]interface{}) + if impd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = impd.RecoveryPointThresholdInMinutes + } + if impd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = impd.RecoveryPointHistory + } + if impd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = impd.AppConsistentFrequencyInMinutes + } + if impd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = impd.MultiVMSyncStatus + } + if impd.InstanceType != "" { + objectMap["instanceType"] = impd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return &impd, true +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &impd, true +} + +// InMagePolicyInput vMWare Azure specific protection profile Input. +type InMagePolicyInput struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMagePolicyInput. +func (impi InMagePolicyInput) MarshalJSON() ([]byte, error) { + impi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if impi.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = impi.RecoveryPointThresholdInMinutes + } + if impi.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = impi.RecoveryPointHistory + } + if impi.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = impi.AppConsistentFrequencyInMinutes + } + if impi.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = impi.MultiVMSyncStatus + } + if impi.InstanceType != "" { + objectMap["instanceType"] = impi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return &impi, true +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &impi, true +} + +// InMageProtectedDiskDetails inMage protected disk details. +type InMageProtectedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // HealthErrorCode - The health error code for the disk. + HealthErrorCode *string `json:"healthErrorCode,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncDurationInSeconds - The resync duration in seconds. + ResyncDurationInSeconds *int64 `json:"resyncDurationInSeconds,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // FileSystemCapacityInBytes - The file system capacity in bytes. + FileSystemCapacityInBytes *int64 `json:"fileSystemCapacityInBytes,omitempty"` + // SourceDataInMB - The source data transit in MB. + SourceDataInMB *float64 `json:"sourceDataInMB,omitempty"` + // PsDataInMB - The PS data transit in MB. + PsDataInMB *float64 `json:"psDataInMB,omitempty"` + // TargetDataInMB - The target data transit in MB. + TargetDataInMB *float64 `json:"targetDataInMB,omitempty"` + // DiskResized - A value indicating whether disk is resized. + DiskResized *string `json:"diskResized,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // ResyncProcessedBytes - The resync processed bytes. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTotalTransferredBytes - The resync total transferred bytes. + ResyncTotalTransferredBytes *int64 `json:"resyncTotalTransferredBytes,omitempty"` + // ResyncLast15MinutesTransferredBytes - The resync last 15 minutes transferred bytes. + ResyncLast15MinutesTransferredBytes *int64 `json:"resyncLast15MinutesTransferredBytes,omitempty"` + // ResyncLastDataTransferTimeUTC - The last data transfer time in UTC. + ResyncLastDataTransferTimeUTC *date.Time `json:"resyncLastDataTransferTimeUTC,omitempty"` + // ResyncStartTime - The resync start time. + ResyncStartTime *date.Time `json:"resyncStartTime,omitempty"` + // ProgressHealth - The Progress Health. + ProgressHealth *string `json:"progressHealth,omitempty"` + // ProgressStatus - The Progress Status. + ProgressStatus *string `json:"progressStatus,omitempty"` +} + +// InMageRcmAgentUpgradeBlockingErrorDetails inMageRcm source agent upgrade blocking error details. +type InMageRcmAgentUpgradeBlockingErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageRcmAgentUpgradeBlockingErrorDetails. +func (imraubed InMageRcmAgentUpgradeBlockingErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmApplianceDetails inMageRcm appliance details. +type InMageRcmApplianceDetails struct { + // ID - READ-ONLY; The appliance Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The appliance name. + Name *string `json:"name,omitempty"` + // FabricArmID - READ-ONLY; The fabric ARM Id. + FabricArmID *string `json:"fabricArmId,omitempty"` + // ProcessServer - READ-ONLY; The process server. + ProcessServer *ProcessServerDetails `json:"processServer,omitempty"` + // RcmProxy - READ-ONLY; The of RCM proxy. + RcmProxy *RcmProxyDetails `json:"rcmProxy,omitempty"` + // PushInstaller - READ-ONLY; The push installer. + PushInstaller *PushInstallerDetails `json:"pushInstaller,omitempty"` + // ReplicationAgent - READ-ONLY; The replication agent. + ReplicationAgent *ReplicationAgentDetails `json:"replicationAgent,omitempty"` + // ReprotectAgent - READ-ONLY; The reprotect agent. + ReprotectAgent *ReprotectAgentDetails `json:"reprotectAgent,omitempty"` + // MarsAgent - READ-ONLY; The Mars agent. + MarsAgent *MarsAgentDetails `json:"marsAgent,omitempty"` + // Dra - READ-ONLY; The DRA. + Dra *DraDetails `json:"dra,omitempty"` + // SwitchProviderBlockingErrorDetails - READ-ONLY; The switch provider blocking error information. + SwitchProviderBlockingErrorDetails *[]InMageRcmFabricSwitchProviderBlockingErrorDetails `json:"switchProviderBlockingErrorDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmApplianceDetails. +func (imrad InMageRcmApplianceDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmApplianceSpecificDetails inMageRcm appliance specific details. +type InMageRcmApplianceSpecificDetails struct { + // Appliances - READ-ONLY; The list of appliances. + Appliances *[]InMageRcmApplianceDetails `json:"appliances,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeApplianceSpecificDetails', 'InstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplianceSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmApplianceSpecificDetails. +func (imrasd InMageRcmApplianceSpecificDetails) MarshalJSON() ([]byte, error) { + imrasd.InstanceType = InstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrasd.InstanceType != "" { + objectMap["instanceType"] = imrasd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageRcmApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for InMageRcmApplianceSpecificDetails. +func (imrasd InMageRcmApplianceSpecificDetails) AsInMageRcmApplianceSpecificDetails() (*InMageRcmApplianceSpecificDetails, bool) { + return &imrasd, true +} + +// AsApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for InMageRcmApplianceSpecificDetails. +func (imrasd InMageRcmApplianceSpecificDetails) AsApplianceSpecificDetails() (*ApplianceSpecificDetails, bool) { + return nil, false +} + +// AsBasicApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for InMageRcmApplianceSpecificDetails. +func (imrasd InMageRcmApplianceSpecificDetails) AsBasicApplianceSpecificDetails() (BasicApplianceSpecificDetails, bool) { + return &imrasd, true +} + +// InMageRcmApplyRecoveryPointInput applyRecoveryPoint input specific to InMageRcm provider. +type InMageRcmApplyRecoveryPointInput struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + imrarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrarpi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrarpi.RecoveryPointID + } + if imrarpi.InstanceType != "" { + objectMap["instanceType"] = imrarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return &imrarpi, true +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &imrarpi, true +} + +// InMageRcmDiscoveredProtectedVMDetails inMageRcm discovered protected VM details. +type InMageRcmDiscoveredProtectedVMDetails struct { + // VCenterID - READ-ONLY; The VCenter Id. + VCenterID *string `json:"vCenterId,omitempty"` + // VCenterFqdn - READ-ONLY; The VCenter fqdn. + VCenterFqdn *string `json:"vCenterFqdn,omitempty"` + // Datastores - READ-ONLY; The list of datastores. + Datastores *[]string `json:"datastores,omitempty"` + // IPAddresses - READ-ONLY; The list of IP addresses. + IPAddresses *[]string `json:"ipAddresses,omitempty"` + // VmwareToolsStatus - READ-ONLY; The VMware tools status. + VmwareToolsStatus *string `json:"vmwareToolsStatus,omitempty"` + // PowerStatus - READ-ONLY; The VM power status. + PowerStatus *string `json:"powerStatus,omitempty"` + // VMFqdn - READ-ONLY; The VM fqdn. + VMFqdn *string `json:"vmFqdn,omitempty"` + // OsName - READ-ONLY; The VM's OS name. + OsName *string `json:"osName,omitempty"` + // CreatedTimestamp - READ-ONLY; The SDS created timestamp. + CreatedTimestamp *date.Time `json:"createdTimestamp,omitempty"` + // UpdatedTimestamp - READ-ONLY; The SDS updated timestamp. + UpdatedTimestamp *date.Time `json:"updatedTimestamp,omitempty"` + // IsDeleted - READ-ONLY; A value indicating whether the VM is deleted. + IsDeleted *bool `json:"isDeleted,omitempty"` + // LastDiscoveryTimeInUtc - READ-ONLY; The last time when SDS information discovered in SRS. + LastDiscoveryTimeInUtc *date.Time `json:"lastDiscoveryTimeInUtc,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmDiscoveredProtectedVMDetails. +func (imrdpvd InMageRcmDiscoveredProtectedVMDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmDiskInput inMageRcm disk input. +type InMageRcmDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageRcmDisksDefaultInput inMageRcm disk input. +type InMageRcmDisksDefaultInput struct { + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageRcmEnableProtectionInput inMageRcm specific enable protection input. +type InMageRcmEnableProtectionInput struct { + // FabricDiscoveryMachineID - The ARM Id of discovered machine. + FabricDiscoveryMachineID *string `json:"fabricDiscoveryMachineId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]InMageRcmDiskInput `json:"disksToInclude,omitempty"` + // DisksDefault - The default disk input. + DisksDefault *InMageRcmDisksDefaultInput `json:"disksDefault,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetNetworkID - The selected target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The selected test network ARM Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // TargetSubnetName - The selected target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TestSubnetName - The selected test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // RunAsAccountID - The run-as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) MarshalJSON() ([]byte, error) { + imrepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrepi.FabricDiscoveryMachineID != nil { + objectMap["fabricDiscoveryMachineId"] = imrepi.FabricDiscoveryMachineID + } + if imrepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imrepi.DisksToInclude + } + if imrepi.DisksDefault != nil { + objectMap["disksDefault"] = imrepi.DisksDefault + } + if imrepi.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrepi.TargetResourceGroupID + } + if imrepi.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrepi.TargetNetworkID + } + if imrepi.TestNetworkID != nil { + objectMap["testNetworkId"] = imrepi.TestNetworkID + } + if imrepi.TargetSubnetName != nil { + objectMap["targetSubnetName"] = imrepi.TargetSubnetName + } + if imrepi.TestSubnetName != nil { + objectMap["testSubnetName"] = imrepi.TestSubnetName + } + if imrepi.TargetVMName != nil { + objectMap["targetVmName"] = imrepi.TargetVMName + } + if imrepi.TargetVMSize != nil { + objectMap["targetVmSize"] = imrepi.TargetVMSize + } + if imrepi.LicenseType != "" { + objectMap["licenseType"] = imrepi.LicenseType + } + if imrepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrepi.TargetAvailabilitySetID + } + if imrepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrepi.TargetAvailabilityZone + } + if imrepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrepi.TargetProximityPlacementGroupID + } + if imrepi.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrepi.TargetBootDiagnosticsStorageAccountID + } + if imrepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imrepi.RunAsAccountID + } + if imrepi.ProcessServerID != nil { + objectMap["processServerId"] = imrepi.ProcessServerID + } + if imrepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imrepi.MultiVMGroupName + } + if imrepi.InstanceType != "" { + objectMap["instanceType"] = imrepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return &imrepi, true +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imrepi, true +} + +// InMageRcmEventDetails event details for InMageRcm provider. +type InMageRcmEventDetails struct { + // ProtectedItemName - READ-ONLY; The protected item name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // VMName - READ-ONLY; The protected item name. + VMName *string `json:"vmName,omitempty"` + // LatestAgentVersion - READ-ONLY; The latest agent version. + LatestAgentVersion *string `json:"latestAgentVersion,omitempty"` + // JobID - READ-ONLY; The job Id. + JobID *string `json:"jobId,omitempty"` + // FabricName - READ-ONLY; The fabric name. + FabricName *string `json:"fabricName,omitempty"` + // ApplianceName - READ-ONLY; The appliance name. + ApplianceName *string `json:"applianceName,omitempty"` + // ServerType - READ-ONLY; The server type. + ServerType *string `json:"serverType,omitempty"` + // ComponentDisplayName - READ-ONLY; The component display name. + ComponentDisplayName *string `json:"componentDisplayName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) MarshalJSON() ([]byte, error) { + imred.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imred.InstanceType != "" { + objectMap["instanceType"] = imred.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return &imred, true +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imred, true +} + +// InMageRcmFabricCreationInput inMageRcm fabric provider specific settings. +type InMageRcmFabricCreationInput struct { + // VmwareSiteID - The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // SourceAgentIdentity - The identity provider input for source agent authentication. + SourceAgentIdentity *IdentityProviderInput `json:"sourceAgentIdentity,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) MarshalJSON() ([]byte, error) { + imrfci.InstanceType = InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrfci.VmwareSiteID != nil { + objectMap["vmwareSiteId"] = imrfci.VmwareSiteID + } + if imrfci.PhysicalSiteID != nil { + objectMap["physicalSiteId"] = imrfci.PhysicalSiteID + } + if imrfci.SourceAgentIdentity != nil { + objectMap["sourceAgentIdentity"] = imrfci.SourceAgentIdentity + } + if imrfci.InstanceType != "" { + objectMap["instanceType"] = imrfci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return &imrfci, true +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &imrfci, true +} + +// InMageRcmFabricSpecificDetails inMageRcm fabric specific details. +type InMageRcmFabricSpecificDetails struct { + // VmwareSiteID - READ-ONLY; The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - READ-ONLY; The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // ServiceEndpoint - READ-ONLY; The service endpoint. + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` + // ServiceResourceID - READ-ONLY; The service resource Id. + ServiceResourceID *string `json:"serviceResourceId,omitempty"` + // ServiceContainerID - READ-ONLY; The service container Id. + ServiceContainerID *string `json:"serviceContainerId,omitempty"` + // DataPlaneURI - READ-ONLY; The data plane Uri. + DataPlaneURI *string `json:"dataPlaneUri,omitempty"` + // ControlPlaneURI - READ-ONLY; The control plane Uri. + ControlPlaneURI *string `json:"controlPlaneUri,omitempty"` + // SourceAgentIdentityDetails - The source agent identity details. + SourceAgentIdentityDetails *IdentityProviderDetails `json:"sourceAgentIdentityDetails,omitempty"` + // ProcessServers - READ-ONLY; The list of process servers. + ProcessServers *[]ProcessServerDetails `json:"processServers,omitempty"` + // RcmProxies - READ-ONLY; The list of RCM proxies. + RcmProxies *[]RcmProxyDetails `json:"rcmProxies,omitempty"` + // PushInstallers - READ-ONLY; The list of push installers. + PushInstallers *[]PushInstallerDetails `json:"pushInstallers,omitempty"` + // ReplicationAgents - READ-ONLY; The list of replication agents. + ReplicationAgents *[]ReplicationAgentDetails `json:"replicationAgents,omitempty"` + // ReprotectAgents - READ-ONLY; The list of reprotect agents. + ReprotectAgents *[]ReprotectAgentDetails `json:"reprotectAgents,omitempty"` + // MarsAgents - READ-ONLY; The list of Mars agents. + MarsAgents *[]MarsAgentDetails `json:"marsAgents,omitempty"` + // Dras - READ-ONLY; The list of DRAs. + Dras *[]DraDetails `json:"dras,omitempty"` + // AgentDetails - READ-ONLY; The list of agent details. + AgentDetails *[]AgentDetails `json:"agentDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) MarshalJSON() ([]byte, error) { + imrfsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrfsd.SourceAgentIdentityDetails != nil { + objectMap["sourceAgentIdentityDetails"] = imrfsd.SourceAgentIdentityDetails + } + if imrfsd.InstanceType != "" { + objectMap["instanceType"] = imrfsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return &imrfsd, true +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &imrfsd, true +} + +// InMageRcmFabricSwitchProviderBlockingErrorDetails inMageRcmFabric switch provider blocking error +// details. +type InMageRcmFabricSwitchProviderBlockingErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFabricSwitchProviderBlockingErrorDetails. +func (imrfspbed InMageRcmFabricSwitchProviderBlockingErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackDiscoveredProtectedVMDetails inMageRcmFailback discovered VM details. +type InMageRcmFailbackDiscoveredProtectedVMDetails struct { + // VCenterID - READ-ONLY; The VCenter Id. + VCenterID *string `json:"vCenterId,omitempty"` + // VCenterFqdn - READ-ONLY; The VCenter fqdn. + VCenterFqdn *string `json:"vCenterFqdn,omitempty"` + // Datastores - READ-ONLY; The list of datastores. + Datastores *[]string `json:"datastores,omitempty"` + // IPAddresses - READ-ONLY; The list of IP addresses. + IPAddresses *[]string `json:"ipAddresses,omitempty"` + // VmwareToolsStatus - READ-ONLY; The VMware tools status. + VmwareToolsStatus *string `json:"vmwareToolsStatus,omitempty"` + // PowerStatus - READ-ONLY; The VM power status. + PowerStatus *string `json:"powerStatus,omitempty"` + // VMFqdn - READ-ONLY; The VM fqdn. + VMFqdn *string `json:"vmFqdn,omitempty"` + // OsName - READ-ONLY; The VM's OS name. + OsName *string `json:"osName,omitempty"` + // CreatedTimestamp - READ-ONLY; The SDS created timestamp. + CreatedTimestamp *date.Time `json:"createdTimestamp,omitempty"` + // UpdatedTimestamp - READ-ONLY; The SDS updated timestamp. + UpdatedTimestamp *date.Time `json:"updatedTimestamp,omitempty"` + // IsDeleted - READ-ONLY; A value indicating whether the VM is deleted. + IsDeleted *bool `json:"isDeleted,omitempty"` + // LastDiscoveryTimeInUtc - READ-ONLY; The last time when SDS information discovered in SRS. + LastDiscoveryTimeInUtc *date.Time `json:"lastDiscoveryTimeInUtc,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackDiscoveredProtectedVMDetails. +func (imrfdpvd InMageRcmFailbackDiscoveredProtectedVMDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackEventDetails event details for InMageRcmFailback provider. +type InMageRcmFailbackEventDetails struct { + // ProtectedItemName - READ-ONLY; The protected item name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // VMName - READ-ONLY; The protected item name. + VMName *string `json:"vmName,omitempty"` + // ApplianceName - READ-ONLY; The appliance name. + ApplianceName *string `json:"applianceName,omitempty"` + // ServerType - READ-ONLY; The server type. + ServerType *string `json:"serverType,omitempty"` + // ComponentDisplayName - READ-ONLY; The component display name. + ComponentDisplayName *string `json:"componentDisplayName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) MarshalJSON() ([]byte, error) { + imrfed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfed.InstanceType != "" { + objectMap["instanceType"] = imrfed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return &imrfed, true +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imrfed, true +} + +// InMageRcmFailbackMobilityAgentDetails inMageRcmFailback mobility agent details. +type InMageRcmFailbackMobilityAgentDetails struct { + // Version - READ-ONLY; The agent version. + Version *string `json:"version,omitempty"` + // LatestVersion - READ-ONLY; The latest agent version available. + LatestVersion *string `json:"latestVersion,omitempty"` + // DriverVersion - READ-ONLY; The driver version. + DriverVersion *string `json:"driverVersion,omitempty"` + // LatestUpgradableVersionWithoutReboot - READ-ONLY; The latest upgradeable version available without reboot. + LatestUpgradableVersionWithoutReboot *string `json:"latestUpgradableVersionWithoutReboot,omitempty"` + // AgentVersionExpiryDate - READ-ONLY; The agent version expiry date. + AgentVersionExpiryDate *date.Time `json:"agentVersionExpiryDate,omitempty"` + // DriverVersionExpiryDate - READ-ONLY; The driver version expiry date. + DriverVersionExpiryDate *date.Time `json:"driverVersionExpiryDate,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The time of the last heartbeat received from the agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // ReasonsBlockingUpgrade - READ-ONLY; The whether update is possible or not. + ReasonsBlockingUpgrade *[]AgentUpgradeBlockedReason `json:"reasonsBlockingUpgrade,omitempty"` + // IsUpgradeable - READ-ONLY; A value indicating whether agent is upgradeable or not. + IsUpgradeable *string `json:"isUpgradeable,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackMobilityAgentDetails. +func (imrfmad InMageRcmFailbackMobilityAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackNicDetails inMageRcmFailback NIC details. +type InMageRcmFailbackNicDetails struct { + // MacAddress - READ-ONLY; The mac address. + MacAddress *string `json:"macAddress,omitempty"` + // NetworkName - READ-ONLY; The network name. + NetworkName *string `json:"networkName,omitempty"` + // AdapterType - READ-ONLY; The adapter type. + AdapterType *string `json:"adapterType,omitempty"` + // SourceIPAddress - READ-ONLY; The IP address. + SourceIPAddress *string `json:"sourceIpAddress,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackNicDetails. +func (imrfnd InMageRcmFailbackNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackPlannedFailoverProviderInput provider specific input for InMageRcmFailback failover. +type InMageRcmFailbackPlannedFailoverProviderInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'ApplicationConsistent', 'CrashConsistent' + RecoveryPointType InMageRcmFailbackRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) MarshalJSON() ([]byte, error) { + imrfpfpi.InstanceType = InstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpfpi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imrfpfpi.RecoveryPointType + } + if imrfpfpi.InstanceType != "" { + objectMap["instanceType"] = imrfpfpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return &imrfpfpi, true +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &imrfpfpi, true +} + +// InMageRcmFailbackPolicyCreationInput inMageRcmFailback policy creation input. +type InMageRcmFailbackPolicyCreationInput struct { + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) MarshalJSON() ([]byte, error) { + imrfpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrfpci.CrashConsistentFrequencyInMinutes + } + if imrfpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrfpci.AppConsistentFrequencyInMinutes + } + if imrfpci.InstanceType != "" { + objectMap["instanceType"] = imrfpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return &imrfpci, true +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imrfpci, true +} + +// InMageRcmFailbackPolicyDetails inMageRcm failback specific policy details. +type InMageRcmFailbackPolicyDetails struct { + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) MarshalJSON() ([]byte, error) { + imrfpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrfpd.AppConsistentFrequencyInMinutes + } + if imrfpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrfpd.CrashConsistentFrequencyInMinutes + } + if imrfpd.InstanceType != "" { + objectMap["instanceType"] = imrfpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return &imrfpd, true +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imrfpd, true +} + +// InMageRcmFailbackProtectedDiskDetails inMageRcmFailback protected disk details. +type InMageRcmFailbackProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk Id (reported by source agent). + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // DiskUUID - READ-ONLY; The disk Uuid (reported by vCenter). + DiskUUID *string `json:"diskUuid,omitempty"` + // DataPendingInLogDataStoreInMB - READ-ONLY; The data pending in log data store in MB. + DataPendingInLogDataStoreInMB *float64 `json:"dataPendingInLogDataStoreInMB,omitempty"` + // DataPendingAtSourceAgentInMB - READ-ONLY; The data pending at source agent in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // IsInitialReplicationComplete - READ-ONLY; A value indicating whether initial replication is complete or not. + IsInitialReplicationComplete *string `json:"isInitialReplicationComplete,omitempty"` + // IrDetails - The initial replication details. + IrDetails *InMageRcmFailbackSyncDetails `json:"irDetails,omitempty"` + // ResyncDetails - The resync details. + ResyncDetails *InMageRcmFailbackSyncDetails `json:"resyncDetails,omitempty"` + // LastSyncTime - READ-ONLY; The last sync time. + LastSyncTime *date.Time `json:"lastSyncTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackProtectedDiskDetails. +func (imrfpdd InMageRcmFailbackProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrfpdd.IrDetails != nil { + objectMap["irDetails"] = imrfpdd.IrDetails + } + if imrfpdd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrfpdd.ResyncDetails + } + return json.Marshal(objectMap) +} + +// InMageRcmFailbackReplicationDetails inMageRcmFailback provider specific details. +type InMageRcmFailbackReplicationDetails struct { + // InternalIdentifier - READ-ONLY; The virtual machine internal identifier. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // AzureVirtualMachineID - READ-ONLY; The ARM Id of the azure VM. + AzureVirtualMachineID *string `json:"azureVirtualMachineId,omitempty"` + // MultiVMGroupName - READ-ONLY; The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // ReprotectAgentID - READ-ONLY; The reprotect agent Id. + ReprotectAgentID *string `json:"reprotectAgentId,omitempty"` + // ReprotectAgentName - READ-ONLY; The reprotect agent name. + ReprotectAgentName *string `json:"reprotectAgentName,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // TargetvCenterID - READ-ONLY; The target vCenter Id. + TargetvCenterID *string `json:"targetvCenterId,omitempty"` + // TargetDataStoreName - READ-ONLY; The target datastore name. + TargetDataStoreName *string `json:"targetDataStoreName,omitempty"` + // TargetVMName - READ-ONLY; The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // InitialReplicationProgressPercentage - READ-ONLY; The initial replication progress percentage. + InitialReplicationProgressPercentage *int32 `json:"initialReplicationProgressPercentage,omitempty"` + // InitialReplicationProcessedBytes - READ-ONLY; The initial replication processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + InitialReplicationProcessedBytes *int64 `json:"initialReplicationProcessedBytes,omitempty"` + // InitialReplicationTransferredBytes - READ-ONLY; The initial replication transferred bytes from source VM to target for all selected disks on source VM. + InitialReplicationTransferredBytes *int64 `json:"initialReplicationTransferredBytes,omitempty"` + // InitialReplicationProgressHealth - READ-ONLY; The initial replication progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + InitialReplicationProgressHealth VMReplicationProgressHealth `json:"initialReplicationProgressHealth,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncProcessedBytes - READ-ONLY; The resync processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTransferredBytes - READ-ONLY; The resync transferred bytes from source VM to target for all selected disks on source VM. + ResyncTransferredBytes *int64 `json:"resyncTransferredBytes,omitempty"` + // ResyncProgressHealth - READ-ONLY; The resync progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + ResyncProgressHealth VMReplicationProgressHealth `json:"resyncProgressHealth,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageRcmFailbackProtectedDiskDetails `json:"protectedDisks,omitempty"` + // MobilityAgentDetails - The mobility agent information. + MobilityAgentDetails *InMageRcmFailbackMobilityAgentDetails `json:"mobilityAgentDetails,omitempty"` + // VMNics - The network details. + VMNics *[]InMageRcmFailbackNicDetails `json:"vmNics,omitempty"` + // LastPlannedFailoverStartTime - READ-ONLY; The last planned failover start time. + LastPlannedFailoverStartTime *date.Time `json:"lastPlannedFailoverStartTime,omitempty"` + // LastPlannedFailoverStatus - READ-ONLY; The last planned failover status. Possible values include: 'PlannedFailoverStatusSucceeded', 'PlannedFailoverStatusFailed', 'PlannedFailoverStatusCancelled', 'PlannedFailoverStatusUnknown' + LastPlannedFailoverStatus PlannedFailoverStatus `json:"lastPlannedFailoverStatus,omitempty"` + // DiscoveredVMDetails - The discovered VM information. + DiscoveredVMDetails *InMageRcmFailbackDiscoveredProtectedVMDetails `json:"discoveredVmDetails,omitempty"` + // LastUsedPolicyID - READ-ONLY; The policy Id used by the forward replication. + LastUsedPolicyID *string `json:"lastUsedPolicyId,omitempty"` + // LastUsedPolicyFriendlyName - READ-ONLY; The policy friendly name used by the forward replication. + LastUsedPolicyFriendlyName *string `json:"lastUsedPolicyFriendlyName,omitempty"` + // IsAgentRegistrationSuccessfulAfterFailover - READ-ONLY; A value indicating whether agent registration was successful after failover. + IsAgentRegistrationSuccessfulAfterFailover *bool `json:"isAgentRegistrationSuccessfulAfterFailover,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) MarshalJSON() ([]byte, error) { + imrfrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrfrd.ProtectedDisks + } + if imrfrd.MobilityAgentDetails != nil { + objectMap["mobilityAgentDetails"] = imrfrd.MobilityAgentDetails + } + if imrfrd.VMNics != nil { + objectMap["vmNics"] = imrfrd.VMNics + } + if imrfrd.DiscoveredVMDetails != nil { + objectMap["discoveredVmDetails"] = imrfrd.DiscoveredVMDetails + } + if imrfrd.InstanceType != "" { + objectMap["instanceType"] = imrfrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return &imrfrd, true +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrfrd, true +} + +// InMageRcmFailbackReprotectInput inMageRcmFailback specific provider input. +type InMageRcmFailbackReprotectInput struct { + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RunAsAccountID - The run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) MarshalJSON() ([]byte, error) { + imrfri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfri.ProcessServerID != nil { + objectMap["processServerId"] = imrfri.ProcessServerID + } + if imrfri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imrfri.RunAsAccountID + } + if imrfri.PolicyID != nil { + objectMap["policyId"] = imrfri.PolicyID + } + if imrfri.InstanceType != "" { + objectMap["instanceType"] = imrfri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return &imrfri, true +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imrfri, true +} + +// InMageRcmFailbackSyncDetails inMageRcmFailback disk level sync details. +type InMageRcmFailbackSyncDetails struct { + // ProgressHealth - READ-ONLY; The progress health. Possible values include: 'None', 'InProgress', 'SlowProgress', 'NoProgress', 'Queued' + ProgressHealth DiskReplicationProgressHealth `json:"progressHealth,omitempty"` + // TransferredBytes - READ-ONLY; The transferred bytes from source VM to azure for the disk. + TransferredBytes *int64 `json:"transferredBytes,omitempty"` + // Last15MinutesTransferredBytes - READ-ONLY; The bytes transferred in last 15 minutes from source VM to target. + Last15MinutesTransferredBytes *int64 `json:"last15MinutesTransferredBytes,omitempty"` + // LastDataTransferTimeUtc - READ-ONLY; The time of the last data transfer from source VM to target. + LastDataTransferTimeUtc *string `json:"lastDataTransferTimeUtc,omitempty"` + // ProcessedBytes - READ-ONLY; The total processed bytes. This includes bytes that are transferred from source VM to target and matched bytes. + ProcessedBytes *int64 `json:"processedBytes,omitempty"` + // StartTime - READ-ONLY; The start time. + StartTime *string `json:"startTime,omitempty"` + // LastRefreshTime - READ-ONLY; The last refresh time. + LastRefreshTime *string `json:"lastRefreshTime,omitempty"` + // ProgressPercentage - READ-ONLY; Progress in percentage. Progress percentage is calculated based on processed bytes. + ProgressPercentage *int32 `json:"progressPercentage,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackSyncDetails. +func (imrfsd InMageRcmFailbackSyncDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmLastAgentUpgradeErrorDetails inMageRcm last source agent upgrade error details. +type InMageRcmLastAgentUpgradeErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageRcmLastAgentUpgradeErrorDetails. +func (imrlaued InMageRcmLastAgentUpgradeErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmMobilityAgentDetails inMageRcm mobility agent details. +type InMageRcmMobilityAgentDetails struct { + // Version - READ-ONLY; The agent version. + Version *string `json:"version,omitempty"` + // LatestVersion - READ-ONLY; The latest agent version available. + LatestVersion *string `json:"latestVersion,omitempty"` + // LatestAgentReleaseDate - READ-ONLY; The latest agent version release date. + LatestAgentReleaseDate *string `json:"latestAgentReleaseDate,omitempty"` + // DriverVersion - READ-ONLY; The driver version. + DriverVersion *string `json:"driverVersion,omitempty"` + // LatestUpgradableVersionWithoutReboot - READ-ONLY; The latest upgradeable version available without reboot. + LatestUpgradableVersionWithoutReboot *string `json:"latestUpgradableVersionWithoutReboot,omitempty"` + // AgentVersionExpiryDate - READ-ONLY; The agent version expiry date. + AgentVersionExpiryDate *date.Time `json:"agentVersionExpiryDate,omitempty"` + // DriverVersionExpiryDate - READ-ONLY; The driver version expiry date. + DriverVersionExpiryDate *date.Time `json:"driverVersionExpiryDate,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The time of the last heartbeat received from the agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // ReasonsBlockingUpgrade - READ-ONLY; The whether update is possible or not. + ReasonsBlockingUpgrade *[]AgentUpgradeBlockedReason `json:"reasonsBlockingUpgrade,omitempty"` + // IsUpgradeable - READ-ONLY; A value indicating whether agent is upgradeable or not. + IsUpgradeable *string `json:"isUpgradeable,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmMobilityAgentDetails. +func (imrmad InMageRcmMobilityAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmNicDetails inMageRcm NIC details. +type InMageRcmNicDetails struct { + // NicID - READ-ONLY; The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // IsSelectedForFailover - A value indicating whether this NIC is selected for failover. + IsSelectedForFailover *string `json:"isSelectedForFailover,omitempty"` + // SourceIPAddress - READ-ONLY; The source IP address. + SourceIPAddress *string `json:"sourceIPAddress,omitempty"` + // SourceIPAddressType - READ-ONLY; The source IP address type. Possible values include: 'Dynamic', 'Static' + SourceIPAddressType EthernetAddressType `json:"sourceIPAddressType,omitempty"` + // SourceNetworkID - READ-ONLY; Source network Id. + SourceNetworkID *string `json:"sourceNetworkId,omitempty"` + // SourceSubnetName - READ-ONLY; Source subnet name. + SourceSubnetName *string `json:"sourceSubnetName,omitempty"` + // TargetIPAddress - The target IP address. + TargetIPAddress *string `json:"targetIPAddress,omitempty"` + // TargetIPAddressType - The target IP address type. Possible values include: 'Dynamic', 'Static' + TargetIPAddressType EthernetAddressType `json:"targetIPAddressType,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TestSubnetName - Test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TestIPAddress - The test IP address. + TestIPAddress *string `json:"testIPAddress,omitempty"` + // TestIPAddressType - The test IP address type. Possible values include: 'Dynamic', 'Static' + TestIPAddressType EthernetAddressType `json:"testIPAddressType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmNicDetails. +func (imrnd InMageRcmNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrnd.IsPrimaryNic != nil { + objectMap["isPrimaryNic"] = imrnd.IsPrimaryNic + } + if imrnd.IsSelectedForFailover != nil { + objectMap["isSelectedForFailover"] = imrnd.IsSelectedForFailover + } + if imrnd.TargetIPAddress != nil { + objectMap["targetIPAddress"] = imrnd.TargetIPAddress + } + if imrnd.TargetIPAddressType != "" { + objectMap["targetIPAddressType"] = imrnd.TargetIPAddressType + } + if imrnd.TargetSubnetName != nil { + objectMap["targetSubnetName"] = imrnd.TargetSubnetName + } + if imrnd.TestSubnetName != nil { + objectMap["testSubnetName"] = imrnd.TestSubnetName + } + if imrnd.TestIPAddress != nil { + objectMap["testIPAddress"] = imrnd.TestIPAddress + } + if imrnd.TestIPAddressType != "" { + objectMap["testIPAddressType"] = imrnd.TestIPAddressType + } + return json.Marshal(objectMap) +} + +// InMageRcmNicInput inMageRcm NIC input. +type InMageRcmNicInput struct { + // NicID - The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // IsSelectedForFailover - A value indicating whether this NIC is selected for failover. + IsSelectedForFailover *string `json:"isSelectedForFailover,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetStaticIPAddress - The target static IP address. + TargetStaticIPAddress *string `json:"targetStaticIPAddress,omitempty"` + // TestSubnetName - The test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TestStaticIPAddress - The test static IP address. + TestStaticIPAddress *string `json:"testStaticIPAddress,omitempty"` +} + +// InMageRcmPolicyCreationInput inMageRcm policy creation input. +type InMageRcmPolicyCreationInput struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // EnableMultiVMSync - A value indicating whether multi-VM sync has to be enabled. + EnableMultiVMSync *string `json:"enableMultiVmSync,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) MarshalJSON() ([]byte, error) { + imrpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpci.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = imrpci.RecoveryPointHistoryInMinutes + } + if imrpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrpci.CrashConsistentFrequencyInMinutes + } + if imrpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrpci.AppConsistentFrequencyInMinutes + } + if imrpci.EnableMultiVMSync != nil { + objectMap["enableMultiVmSync"] = imrpci.EnableMultiVMSync + } + if imrpci.InstanceType != "" { + objectMap["instanceType"] = imrpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return &imrpci, true +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imrpci, true +} + +// InMageRcmPolicyDetails inMageRcm specific policy details. +type InMageRcmPolicyDetails struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // EnableMultiVMSync - A value indicating whether multi-VM sync has to be enabled. + EnableMultiVMSync *string `json:"enableMultiVmSync,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) MarshalJSON() ([]byte, error) { + imrpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpd.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = imrpd.RecoveryPointHistoryInMinutes + } + if imrpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrpd.AppConsistentFrequencyInMinutes + } + if imrpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrpd.CrashConsistentFrequencyInMinutes + } + if imrpd.EnableMultiVMSync != nil { + objectMap["enableMultiVmSync"] = imrpd.EnableMultiVMSync + } + if imrpd.InstanceType != "" { + objectMap["instanceType"] = imrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return &imrpd, true +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imrpd, true +} + +// InMageRcmProtectedDiskDetails inMageRcm protected disk details. +type InMageRcmProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskEncryptionSetID - READ-ONLY; The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // SeedManagedDiskID - READ-ONLY; The ARM Id of the seed managed disk. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // TargetManagedDiskID - READ-ONLY; The ARM Id of the target managed disk. + TargetManagedDiskID *string `json:"targetManagedDiskId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DataPendingInLogDataStoreInMB - READ-ONLY; The data pending in log data store in MB. + DataPendingInLogDataStoreInMB *float64 `json:"dataPendingInLogDataStoreInMB,omitempty"` + // DataPendingAtSourceAgentInMB - READ-ONLY; The data pending at source agent in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // IsInitialReplicationComplete - READ-ONLY; A value indicating whether initial replication is complete or not. + IsInitialReplicationComplete *string `json:"isInitialReplicationComplete,omitempty"` + // IrDetails - The initial replication details. + IrDetails *InMageRcmSyncDetails `json:"irDetails,omitempty"` + // ResyncDetails - The resync details. + ResyncDetails *InMageRcmSyncDetails `json:"resyncDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmProtectedDiskDetails. +func (imrpdd InMageRcmProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrpdd.DiskType != "" { + objectMap["diskType"] = imrpdd.DiskType + } + if imrpdd.IrDetails != nil { + objectMap["irDetails"] = imrpdd.IrDetails + } + if imrpdd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrpdd.ResyncDetails + } + return json.Marshal(objectMap) +} + +// InMageRcmProtectionContainerMappingDetails inMageRcm provider specific container mapping details. +type InMageRcmProtectionContainerMappingDetails struct { + // EnableAgentAutoUpgrade - READ-ONLY; A value indicating whether the flag for enable agent auto upgrade. + EnableAgentAutoUpgrade *string `json:"enableAgentAutoUpgrade,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + imrpcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpcmd.InstanceType != "" { + objectMap["instanceType"] = imrpcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return &imrpcmd, true +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &imrpcmd, true +} + +// InMageRcmRecoveryPointDetails inMageRcm provider specific recovery point details. +type InMageRcmRecoveryPointDetails struct { + // IsMultiVMSyncPoint - READ-ONLY; A value indicating whether the recovery point is multi VM consistent. + IsMultiVMSyncPoint *string `json:"isMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) MarshalJSON() ([]byte, error) { + imrrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrrpd.InstanceType != "" { + objectMap["instanceType"] = imrrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return &imrrpd, true +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &imrrpd, true +} + +// InMageRcmReplicationDetails inMageRcm provider specific details. +type InMageRcmReplicationDetails struct { + // InternalIdentifier - READ-ONLY; The virtual machine internal identifier. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // FabricDiscoveryMachineID - READ-ONLY; The ARM Id of the discovered VM. + FabricDiscoveryMachineID *string `json:"fabricDiscoveryMachineId,omitempty"` + // MultiVMGroupName - READ-ONLY; The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DiscoveryType - READ-ONLY; The type of the discovered VM. + DiscoveryType *string `json:"discoveryType,omitempty"` + // ProcessServerID - READ-ONLY; The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // ProcessorCoreCount - READ-ONLY; The processor core count. + ProcessorCoreCount *int32 `json:"processorCoreCount,omitempty"` + // AllocatedMemoryInMB - READ-ONLY; The allocated memory in MB. + AllocatedMemoryInMB *float64 `json:"allocatedMemoryInMB,omitempty"` + // ProcessServerName - READ-ONLY; The process server name. + ProcessServerName *string `json:"processServerName,omitempty"` + // RunAsAccountID - READ-ONLY; The run-as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // FirmwareType - READ-ONLY; The firmware type. + FirmwareType *string `json:"firmwareType,omitempty"` + // PrimaryNicIPAddress - READ-ONLY; The IP address of the primary network interface. + PrimaryNicIPAddress *string `json:"primaryNicIpAddress,omitempty"` + // TargetGeneration - READ-ONLY; The target generation. + TargetGeneration *string `json:"targetGeneration,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // TargetVMName - Target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetLocation - The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // TargetAvailabilitySetID - The target availability set Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The test network Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // FailoverRecoveryPointID - READ-ONLY; The recovery point Id to which the VM was failed over. + FailoverRecoveryPointID *string `json:"failoverRecoveryPointId,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // LastRpoInSeconds - READ-ONLY; The last recovery point objective value. + LastRpoInSeconds *int64 `json:"lastRpoInSeconds,omitempty"` + // LastRpoCalculatedTime - READ-ONLY; The last recovery point objective calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastRecoveryPointID - READ-ONLY; The last recovery point Id. + LastRecoveryPointID *string `json:"lastRecoveryPointId,omitempty"` + // InitialReplicationProgressPercentage - READ-ONLY; The initial replication progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + InitialReplicationProgressPercentage *int32 `json:"initialReplicationProgressPercentage,omitempty"` + // InitialReplicationProcessedBytes - READ-ONLY; The initial replication processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + InitialReplicationProcessedBytes *int64 `json:"initialReplicationProcessedBytes,omitempty"` + // InitialReplicationTransferredBytes - READ-ONLY; The initial replication transferred bytes from source VM to azure for all selected disks on source VM. + InitialReplicationTransferredBytes *int64 `json:"initialReplicationTransferredBytes,omitempty"` + // InitialReplicationProgressHealth - READ-ONLY; The initial replication progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + InitialReplicationProgressHealth VMReplicationProgressHealth `json:"initialReplicationProgressHealth,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncProcessedBytes - READ-ONLY; The resync processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTransferredBytes - READ-ONLY; The resync transferred bytes from source VM to azure for all selected disks on source VM. + ResyncTransferredBytes *int64 `json:"resyncTransferredBytes,omitempty"` + // ResyncProgressHealth - READ-ONLY; The resync progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + ResyncProgressHealth VMReplicationProgressHealth `json:"resyncProgressHealth,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // AgentUpgradeState - READ-ONLY; The agent auto upgrade state. Possible values include: 'MobilityAgentUpgradeStateNone', 'MobilityAgentUpgradeStateStarted', 'MobilityAgentUpgradeStateCompleted', 'MobilityAgentUpgradeStateCommit' + AgentUpgradeState MobilityAgentUpgradeState `json:"agentUpgradeState,omitempty"` + // LastAgentUpgradeType - READ-ONLY; The last agent upgrade type. + LastAgentUpgradeType *string `json:"lastAgentUpgradeType,omitempty"` + // AgentUpgradeJobID - READ-ONLY; The agent upgrade job Id. + AgentUpgradeJobID *string `json:"agentUpgradeJobId,omitempty"` + // AgentUpgradeAttemptToVersion - READ-ONLY; The agent version to which last agent upgrade was attempted. + AgentUpgradeAttemptToVersion *string `json:"agentUpgradeAttemptToVersion,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageRcmProtectedDiskDetails `json:"protectedDisks,omitempty"` + // IsLastUpgradeSuccessful - READ-ONLY; A value indicating whether last agent upgrade was successful or not. + IsLastUpgradeSuccessful *string `json:"isLastUpgradeSuccessful,omitempty"` + // IsAgentRegistrationSuccessfulAfterFailover - READ-ONLY; A value indicating whether agent registration was successful after failover. + IsAgentRegistrationSuccessfulAfterFailover *bool `json:"isAgentRegistrationSuccessfulAfterFailover,omitempty"` + // MobilityAgentDetails - The mobility agent information. + MobilityAgentDetails *InMageRcmMobilityAgentDetails `json:"mobilityAgentDetails,omitempty"` + // LastAgentUpgradeErrorDetails - The last agent upgrade error information. + LastAgentUpgradeErrorDetails *[]InMageRcmLastAgentUpgradeErrorDetails `json:"lastAgentUpgradeErrorDetails,omitempty"` + // AgentUpgradeBlockingErrorDetails - The agent upgrade blocking error information. + AgentUpgradeBlockingErrorDetails *[]InMageRcmAgentUpgradeBlockingErrorDetails `json:"agentUpgradeBlockingErrorDetails,omitempty"` + // VMNics - The network details. + VMNics *[]InMageRcmNicDetails `json:"vmNics,omitempty"` + // DiscoveredVMDetails - The discovered VM details. + DiscoveredVMDetails *InMageRcmDiscoveredProtectedVMDetails `json:"discoveredVmDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) MarshalJSON() ([]byte, error) { + imrrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrrd.LicenseType != nil { + objectMap["licenseType"] = imrrd.LicenseType + } + if imrrd.TargetVMName != nil { + objectMap["targetVmName"] = imrrd.TargetVMName + } + if imrrd.TargetVMSize != nil { + objectMap["targetVmSize"] = imrrd.TargetVMSize + } + if imrrd.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrrd.TargetResourceGroupID + } + if imrrd.TargetLocation != nil { + objectMap["targetLocation"] = imrrd.TargetLocation + } + if imrrd.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrrd.TargetAvailabilitySetID + } + if imrrd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrrd.TargetAvailabilityZone + } + if imrrd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrrd.TargetProximityPlacementGroupID + } + if imrrd.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrrd.TargetBootDiagnosticsStorageAccountID + } + if imrrd.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrrd.TargetNetworkID + } + if imrrd.TestNetworkID != nil { + objectMap["testNetworkId"] = imrrd.TestNetworkID + } + if imrrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrrd.ProtectedDisks + } + if imrrd.MobilityAgentDetails != nil { + objectMap["mobilityAgentDetails"] = imrrd.MobilityAgentDetails + } + if imrrd.LastAgentUpgradeErrorDetails != nil { + objectMap["lastAgentUpgradeErrorDetails"] = imrrd.LastAgentUpgradeErrorDetails + } + if imrrd.AgentUpgradeBlockingErrorDetails != nil { + objectMap["agentUpgradeBlockingErrorDetails"] = imrrd.AgentUpgradeBlockingErrorDetails + } + if imrrd.VMNics != nil { + objectMap["vmNics"] = imrrd.VMNics + } + if imrrd.DiscoveredVMDetails != nil { + objectMap["discoveredVmDetails"] = imrrd.DiscoveredVMDetails + } + if imrrd.InstanceType != "" { + objectMap["instanceType"] = imrrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return &imrrd, true +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrrd, true +} + +// InMageRcmReprotectInput inMageRcm specific provider input. +type InMageRcmReprotectInput struct { + // ReprotectAgentID - The reprotect agent Id. + ReprotectAgentID *string `json:"reprotectAgentId,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) MarshalJSON() ([]byte, error) { + imrri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrri.ReprotectAgentID != nil { + objectMap["reprotectAgentId"] = imrri.ReprotectAgentID + } + if imrri.DatastoreName != nil { + objectMap["datastoreName"] = imrri.DatastoreName + } + if imrri.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imrri.LogStorageAccountID + } + if imrri.PolicyID != nil { + objectMap["policyId"] = imrri.PolicyID + } + if imrri.InstanceType != "" { + objectMap["instanceType"] = imrri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return &imrri, true +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imrri, true +} + +// InMageRcmSyncDetails inMageRcm disk level sync details. +type InMageRcmSyncDetails struct { + // ProgressHealth - READ-ONLY; The progress health. Possible values include: 'None', 'InProgress', 'SlowProgress', 'NoProgress', 'Queued' + ProgressHealth DiskReplicationProgressHealth `json:"progressHealth,omitempty"` + // TransferredBytes - READ-ONLY; The transferred bytes from source VM to azure for the disk. + TransferredBytes *int64 `json:"transferredBytes,omitempty"` + // Last15MinutesTransferredBytes - READ-ONLY; The bytes transferred in last 15 minutes from source VM to azure. + Last15MinutesTransferredBytes *int64 `json:"last15MinutesTransferredBytes,omitempty"` + // LastDataTransferTimeUtc - READ-ONLY; The time of the last data transfer from source VM to azure. + LastDataTransferTimeUtc *string `json:"lastDataTransferTimeUtc,omitempty"` + // ProcessedBytes - READ-ONLY; The total processed bytes. This includes bytes that are transferred from source VM to azure and matched bytes. + ProcessedBytes *int64 `json:"processedBytes,omitempty"` + // StartTime - READ-ONLY; The start time. + StartTime *string `json:"startTime,omitempty"` + // LastRefreshTime - READ-ONLY; The last refresh time. + LastRefreshTime *string `json:"lastRefreshTime,omitempty"` + // ProgressPercentage - READ-ONLY; Progress in percentage. Progress percentage is calculated based on processed bytes. + ProgressPercentage *int32 `json:"progressPercentage,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmSyncDetails. +func (imrsd InMageRcmSyncDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmTestFailoverInput inMageRcm provider specific input for test failover. +type InMageRcmTestFailoverInput struct { + // NetworkID - The test network Id. + NetworkID *string `json:"networkId,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) MarshalJSON() ([]byte, error) { + imrtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrtfi.NetworkID != nil { + objectMap["networkId"] = imrtfi.NetworkID + } + if imrtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrtfi.RecoveryPointID + } + if imrtfi.InstanceType != "" { + objectMap["instanceType"] = imrtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return &imrtfi, true +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imrtfi, true +} + +// InMageRcmUnplannedFailoverInput inMageRcm provider specific input for unplanned failover. +type InMageRcmUnplannedFailoverInput struct { + // PerformShutdown - A value indicating whether VM is to be shutdown. + PerformShutdown *string `json:"performShutdown,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imrufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrufi.PerformShutdown != nil { + objectMap["performShutdown"] = imrufi.PerformShutdown + } + if imrufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrufi.RecoveryPointID + } + if imrufi.InstanceType != "" { + objectMap["instanceType"] = imrufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return &imrufi, true +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imrufi, true +} + +// InMageRcmUpdateApplianceForReplicationProtectedItemInput inMageRcm provider specific input to update +// appliance for replication protected item. +type InMageRcmUpdateApplianceForReplicationProtectedItemInput struct { + // RunAsAccountID - The run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput', 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imruafrpii.InstanceType = InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imruafrpii.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imruafrpii.RunAsAccountID + } + if imruafrpii.InstanceType != "" { + objectMap["instanceType"] = imruafrpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageRcmUpdateApplianceForReplicationProtectedItemInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) AsInMageRcmUpdateApplianceForReplicationProtectedItemInput() (*InMageRcmUpdateApplianceForReplicationProtectedItemInput, bool) { + return &imruafrpii, true +} + +// AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (*UpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return &imruafrpii, true +} + +// InMageRcmUpdateContainerMappingInput inMageRcm update protection container mapping. +type InMageRcmUpdateContainerMappingInput struct { + // EnableAgentAutoUpgrade - A value indicating whether agent auto upgrade has to be enabled. + EnableAgentAutoUpgrade *string `json:"enableAgentAutoUpgrade,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + imrucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrucmi.EnableAgentAutoUpgrade != nil { + objectMap["enableAgentAutoUpgrade"] = imrucmi.EnableAgentAutoUpgrade + } + if imrucmi.InstanceType != "" { + objectMap["instanceType"] = imrucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return &imrucmi, true +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &imrucmi, true +} + +// InMageRcmUpdateReplicationProtectedItemInput inMageRcm provider specific input to update replication +// protected item. +type InMageRcmUpdateReplicationProtectedItemInput struct { + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The test network ARM Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // VMNics - The list of NIC details. + VMNics *[]InMageRcmNicInput `json:"vmNics,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imrurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrurpii.TargetVMName != nil { + objectMap["targetVmName"] = imrurpii.TargetVMName + } + if imrurpii.TargetVMSize != nil { + objectMap["targetVmSize"] = imrurpii.TargetVMSize + } + if imrurpii.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrurpii.TargetResourceGroupID + } + if imrurpii.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrurpii.TargetAvailabilitySetID + } + if imrurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrurpii.TargetAvailabilityZone + } + if imrurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrurpii.TargetProximityPlacementGroupID + } + if imrurpii.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrurpii.TargetBootDiagnosticsStorageAccountID + } + if imrurpii.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrurpii.TargetNetworkID + } + if imrurpii.TestNetworkID != nil { + objectMap["testNetworkId"] = imrurpii.TestNetworkID + } + if imrurpii.VMNics != nil { + objectMap["vmNics"] = imrurpii.VMNics + } + if imrurpii.LicenseType != "" { + objectMap["licenseType"] = imrurpii.LicenseType + } + if imrurpii.InstanceType != "" { + objectMap["instanceType"] = imrurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return &imrurpii, true +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &imrurpii, true +} + +// InMageReplicationDetails inMage provider specific settings. +type InMageReplicationDetails struct { + // ActiveSiteType - The active location of the VM. If the VM is being protected from Azure, this field will take values from { Azure, OnPrem }. If the VM is being protected between two data-centers, this field will be OnPrem always. + ActiveSiteType *string `json:"activeSiteType,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // OsDetails - The OS details. + OsDetails *OSDiskDetails `json:"osDetails,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // ResyncDetails - The resync details of the machine. + ResyncDetails *InitialReplicationDetails `json:"resyncDetails,omitempty"` + // RetentionWindowStart - The retention window start time. + RetentionWindowStart *date.Time `json:"retentionWindowStart,omitempty"` + // RetentionWindowEnd - The retention window end time. + RetentionWindowEnd *date.Time `json:"retentionWindowEnd,omitempty"` + // CompressedDataRateInMB - The compressed data change rate in MB. + CompressedDataRateInMB *float64 `json:"compressedDataRateInMB,omitempty"` + // UncompressedDataRateInMB - The uncompressed data change rate in MB. + UncompressedDataRateInMB *float64 `json:"uncompressedDataRateInMB,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageProtectedDiskDetails `json:"protectedDisks,omitempty"` + // IPAddress - The source IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // MasterTargetID - The master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ConsistencyPoints - The collection of Consistency points. + ConsistencyPoints map[string]*date.Time `json:"consistencyPoints"` + // DiskResized - A value indicating whether any disk is resized for this VM. + DiskResized *string `json:"diskResized,omitempty"` + // RebootAfterUpdateStatus - A value indicating whether the source server requires a restart after update. + RebootAfterUpdateStatus *string `json:"rebootAfterUpdateStatus,omitempty"` + // MultiVMGroupID - The multi vm group Id, if any. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name, if any. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMSyncStatus - A value indicating whether the multi vm sync is enabled or disabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // AgentDetails - The agent details. + AgentDetails *InMageAgentDetails `json:"agentDetails,omitempty"` + // VCenterInfrastructureID - The vCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // InfrastructureVMID - The infrastructure VM Id. + InfrastructureVMID *string `json:"infrastructureVmId,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. + DiscoveryType *string `json:"discoveryType,omitempty"` + // AzureStorageAccountID - A value indicating the underlying Azure storage account. If the VM is not running in Azure, this value shall be set to null. + AzureStorageAccountID *string `json:"azureStorageAccountId,omitempty"` + // Datastores - The datastores of the on-premise machine Value can be list of strings that contain datastore names. + Datastores *[]string `json:"datastores,omitempty"` + // ValidationErrors - The validation errors of the on-premise machine Value can be list of validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastUpdateReceivedTime - The last update time received from on-prem components. + LastUpdateReceivedTime *date.Time `json:"lastUpdateReceivedTime,omitempty"` + // ReplicaID - The replica id of the protected item. + ReplicaID *string `json:"replicaId,omitempty"` + // OsVersion - The OS Version of the protected item. + OsVersion *string `json:"osVersion,omitempty"` + // IsAdditionalStatsAvailable - A value indicating whether additional IR stats are available or not. + IsAdditionalStatsAvailable *bool `json:"isAdditionalStatsAvailable,omitempty"` + // TotalDataTransferred - The total transferred data in bytes. + TotalDataTransferred *int64 `json:"totalDataTransferred,omitempty"` + // TotalProgressHealth - The progress health. + TotalProgressHealth *string `json:"totalProgressHealth,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageReplicationDetails. +func (imrd InMageReplicationDetails) MarshalJSON() ([]byte, error) { + imrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imrd.ActiveSiteType != nil { + objectMap["activeSiteType"] = imrd.ActiveSiteType + } + if imrd.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = imrd.SourceVMCPUCount + } + if imrd.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = imrd.SourceVMRAMSizeInMB + } + if imrd.OsDetails != nil { + objectMap["osDetails"] = imrd.OsDetails + } + if imrd.ProtectionStage != nil { + objectMap["protectionStage"] = imrd.ProtectionStage + } + if imrd.VMID != nil { + objectMap["vmId"] = imrd.VMID + } + if imrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = imrd.VMProtectionState + } + if imrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = imrd.VMProtectionStateDescription + } + if imrd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrd.ResyncDetails + } + if imrd.RetentionWindowStart != nil { + objectMap["retentionWindowStart"] = imrd.RetentionWindowStart + } + if imrd.RetentionWindowEnd != nil { + objectMap["retentionWindowEnd"] = imrd.RetentionWindowEnd + } + if imrd.CompressedDataRateInMB != nil { + objectMap["compressedDataRateInMB"] = imrd.CompressedDataRateInMB + } + if imrd.UncompressedDataRateInMB != nil { + objectMap["uncompressedDataRateInMB"] = imrd.UncompressedDataRateInMB + } + if imrd.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = imrd.RpoInSeconds + } + if imrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrd.ProtectedDisks + } + if imrd.IPAddress != nil { + objectMap["ipAddress"] = imrd.IPAddress + } + if imrd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = imrd.LastHeartbeat + } + if imrd.ProcessServerID != nil { + objectMap["processServerId"] = imrd.ProcessServerID + } + if imrd.MasterTargetID != nil { + objectMap["masterTargetId"] = imrd.MasterTargetID + } + if imrd.ConsistencyPoints != nil { + objectMap["consistencyPoints"] = imrd.ConsistencyPoints + } + if imrd.DiskResized != nil { + objectMap["diskResized"] = imrd.DiskResized + } + if imrd.RebootAfterUpdateStatus != nil { + objectMap["rebootAfterUpdateStatus"] = imrd.RebootAfterUpdateStatus + } + if imrd.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imrd.MultiVMGroupID + } + if imrd.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imrd.MultiVMGroupName + } + if imrd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imrd.MultiVMSyncStatus + } + if imrd.AgentDetails != nil { + objectMap["agentDetails"] = imrd.AgentDetails + } + if imrd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = imrd.VCenterInfrastructureID + } + if imrd.InfrastructureVMID != nil { + objectMap["infrastructureVmId"] = imrd.InfrastructureVMID + } + if imrd.VMNics != nil { + objectMap["vmNics"] = imrd.VMNics + } + if imrd.DiscoveryType != nil { + objectMap["discoveryType"] = imrd.DiscoveryType + } + if imrd.AzureStorageAccountID != nil { + objectMap["azureStorageAccountId"] = imrd.AzureStorageAccountID + } + if imrd.Datastores != nil { + objectMap["datastores"] = imrd.Datastores + } + if imrd.ValidationErrors != nil { + objectMap["validationErrors"] = imrd.ValidationErrors + } + if imrd.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = imrd.LastRpoCalculatedTime + } + if imrd.LastUpdateReceivedTime != nil { + objectMap["lastUpdateReceivedTime"] = imrd.LastUpdateReceivedTime + } + if imrd.ReplicaID != nil { + objectMap["replicaId"] = imrd.ReplicaID + } + if imrd.OsVersion != nil { + objectMap["osVersion"] = imrd.OsVersion + } + if imrd.IsAdditionalStatsAvailable != nil { + objectMap["isAdditionalStatsAvailable"] = imrd.IsAdditionalStatsAvailable + } + if imrd.TotalDataTransferred != nil { + objectMap["totalDataTransferred"] = imrd.TotalDataTransferred + } + if imrd.TotalProgressHealth != nil { + objectMap["totalProgressHealth"] = imrd.TotalProgressHealth + } + if imrd.InstanceType != "" { + objectMap["instanceType"] = imrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return &imrd, true +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrd, true +} + +// InMageReprotectInput inMageAzureV2 specific provider input. +type InMageReprotectInput struct { + // MasterTargetID - The Master Target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RetentionDrive - The retention drive to use on the MT. + RetentionDrive *string `json:"retentionDrive,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // DiskExclusionInput - The enable disk exclusion input. + DiskExclusionInput *InMageDiskExclusionInput `json:"diskExclusionInput,omitempty"` + // ProfileID - The Policy Id. + ProfileID *string `json:"profileId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageReprotectInput. +func (imri InMageReprotectInput) MarshalJSON() ([]byte, error) { + imri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imri.MasterTargetID != nil { + objectMap["masterTargetId"] = imri.MasterTargetID + } + if imri.ProcessServerID != nil { + objectMap["processServerId"] = imri.ProcessServerID + } + if imri.RetentionDrive != nil { + objectMap["retentionDrive"] = imri.RetentionDrive + } + if imri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imri.RunAsAccountID + } + if imri.DatastoreName != nil { + objectMap["datastoreName"] = imri.DatastoreName + } + if imri.DiskExclusionInput != nil { + objectMap["diskExclusionInput"] = imri.DiskExclusionInput + } + if imri.ProfileID != nil { + objectMap["profileId"] = imri.ProfileID + } + if imri.DisksToInclude != nil { + objectMap["disksToInclude"] = imri.DisksToInclude + } + if imri.InstanceType != "" { + objectMap["instanceType"] = imri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return &imri, true +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imri, true +} + +// InMageTestFailoverInput provider specific input for InMage test failover. +type InMageTestFailoverInput struct { + // RecoveryPointType - The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. Possible values include: 'LatestTime', 'LatestTag', 'Custom' + RecoveryPointType RecoveryPointType `json:"recoveryPointType,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) MarshalJSON() ([]byte, error) { + imtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imtfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imtfi.RecoveryPointType + } + if imtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imtfi.RecoveryPointID + } + if imtfi.InstanceType != "" { + objectMap["instanceType"] = imtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return &imtfi, true +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imtfi, true +} + +// InMageUnplannedFailoverInput provider specific input for InMage unplanned failover. +type InMageUnplannedFailoverInput struct { + // RecoveryPointType - The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. Possible values include: 'LatestTime', 'LatestTag', 'Custom' + RecoveryPointType RecoveryPointType `json:"recoveryPointType,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imufi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imufi.RecoveryPointType + } + if imufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imufi.RecoveryPointID + } + if imufi.InstanceType != "" { + objectMap["instanceType"] = imufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return &imufi, true +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imufi, true +} + +// InMageVolumeExclusionOptions guest disk signature based disk exclusion option when doing enable +// protection of virtual machine in InMage provider. +type InMageVolumeExclusionOptions struct { + // VolumeLabel - The volume label. The disk having any volume with this label will be excluded from replication. + VolumeLabel *string `json:"volumeLabel,omitempty"` + // OnlyExcludeIfSingleVolume - The value indicating whether to exclude multi volume disk or not. If a disk has multiple volumes and one of the volume has label matching with VolumeLabel this disk will be excluded from replication if OnlyExcludeIfSingleVolume is false. + OnlyExcludeIfSingleVolume *string `json:"onlyExcludeIfSingleVolume,omitempty"` +} + +// InnerHealthError implements InnerHealthError class. HealthError object has a list of InnerHealthErrors +// as child errors. InnerHealthError is used because this will prevent an infinite loop of structures when +// Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health +// errors and all API consumers can utilize this in the same fashion as Exception -> InnerException. +type InnerHealthError struct { + // ErrorSource - Source of error. + ErrorSource *string `json:"errorSource,omitempty"` + // ErrorType - Type of error. + ErrorType *string `json:"errorType,omitempty"` + // ErrorLevel - Level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // ErrorCategory - Category of error. + ErrorCategory *string `json:"errorCategory,omitempty"` + // ErrorCode - Error code. + ErrorCode *string `json:"errorCode,omitempty"` + // SummaryMessage - Summary message of the entity. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // ErrorMessage - Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // CreationTimeUtc - Error creation time (UTC). + CreationTimeUtc *date.Time `json:"creationTimeUtc,omitempty"` + // RecoveryProviderErrorMessage - DRA error message. + RecoveryProviderErrorMessage *string `json:"recoveryProviderErrorMessage,omitempty"` + // EntityID - ID of the entity. + EntityID *string `json:"entityId,omitempty"` + // ErrorID - The health error unique id. + ErrorID *string `json:"errorId,omitempty"` + // CustomerResolvability - Value indicating whether the health error is customer resolvable. Possible values include: 'Allowed', 'NotAllowed' + CustomerResolvability HealthErrorCustomerResolvability `json:"customerResolvability,omitempty"` +} + +// InputEndpoint ... +type InputEndpoint struct { + EndpointName *string `json:"endpointName,omitempty"` + PrivatePort *int32 `json:"privatePort,omitempty"` + PublicPort *int32 `json:"publicPort,omitempty"` + Protocol *string `json:"protocol,omitempty"` +} + +// IPConfigDetails ... +type IPConfigDetails struct { + Name *string `json:"name,omitempty"` + IsPrimary *bool `json:"isPrimary,omitempty"` + SubnetName *string `json:"subnetName,omitempty"` + StaticIPAddress *string `json:"staticIPAddress,omitempty"` + IPAddressType *string `json:"ipAddressType,omitempty"` + IsSeletedForFailover *bool `json:"isSeletedForFailover,omitempty"` + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + RecoveryStaticIPAddress *string `json:"recoveryStaticIPAddress,omitempty"` + RecoveryIPAddressType *string `json:"recoveryIPAddressType,omitempty"` + RecoveryPublicIPAddressID *string `json:"recoveryPublicIPAddressId,omitempty"` + RecoveryLBBackendAddressPoolIds *[]string `json:"recoveryLBBackendAddressPoolIds,omitempty"` + TfoSubnetName *string `json:"tfoSubnetName,omitempty"` + TfoStaticIPAddress *string `json:"tfoStaticIPAddress,omitempty"` + TfoPublicIPAddressID *string `json:"tfoPublicIPAddressId,omitempty"` + TfoLBBackendAddressPoolIds *[]string `json:"tfoLBBackendAddressPoolIds,omitempty"` +} + +// IPConfigInputDetails ... +type IPConfigInputDetails struct { + IPConfigName *string `json:"ipConfigName,omitempty"` + IsPrimary *bool `json:"isPrimary,omitempty"` + IsSeletedForFailover *bool `json:"isSeletedForFailover,omitempty"` + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + RecoveryStaticIPAddress *string `json:"recoveryStaticIPAddress,omitempty"` + RecoveryPublicIPAddressID *string `json:"recoveryPublicIPAddressId,omitempty"` + RecoveryLBBackendAddressPoolIds *[]string `json:"recoveryLBBackendAddressPoolIds,omitempty"` + TfoSubnetName *string `json:"tfoSubnetName,omitempty"` + TfoStaticIPAddress *string `json:"tfoStaticIPAddress,omitempty"` + TfoPublicIPAddressID *string `json:"tfoPublicIPAddressId,omitempty"` + TfoLBBackendAddressPoolIds *[]string `json:"tfoLBBackendAddressPoolIds,omitempty"` +} + +// Job job details. +type Job struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *JobProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if j.Properties != nil { + objectMap["properties"] = j.Properties + } + if j.Location != nil { + objectMap["location"] = j.Location + } + return json.Marshal(objectMap) +} + +// JobCollection collection of jobs. +type JobCollection struct { + autorest.Response `json:"-"` + // Value - The list of jobs. + Value *[]Job `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// JobCollectionIterator provides access to a complete listing of Job values. +type JobCollectionIterator struct { + i int + page JobCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *JobCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *JobCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter JobCollectionIterator) Response() JobCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter JobCollectionIterator) Value() Job { + if !iter.page.NotDone() { + return Job{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the JobCollectionIterator type. +func NewJobCollectionIterator(page JobCollectionPage) JobCollectionIterator { + return JobCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (jc JobCollection) IsEmpty() bool { + return jc.Value == nil || len(*jc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (jc JobCollection) hasNextLink() bool { + return jc.NextLink != nil && len(*jc.NextLink) != 0 +} + +// jobCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jc JobCollection) jobCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !jc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jc.NextLink))) +} + +// JobCollectionPage contains a page of Job values. +type JobCollectionPage struct { + fn func(context.Context, JobCollection) (JobCollection, error) + jc JobCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *JobCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.jc) + if err != nil { + return err + } + page.jc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *JobCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobCollectionPage) NotDone() bool { + return !page.jc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobCollectionPage) Response() JobCollection { + return page.jc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobCollectionPage) Values() []Job { + if page.jc.IsEmpty() { + return nil + } + return *page.jc.Value +} + +// Creates a new instance of the JobCollectionPage type. +func NewJobCollectionPage(cur JobCollection, getNextPage func(context.Context, JobCollection) (JobCollection, error)) JobCollectionPage { + return JobCollectionPage{ + fn: getNextPage, + jc: cur, + } +} + +// BasicJobDetails job details based on specific job type. +type BasicJobDetails interface { + AsAsrJobDetails() (*AsrJobDetails, bool) + AsExportJobDetails() (*ExportJobDetails, bool) + AsFailoverJobDetails() (*FailoverJobDetails, bool) + AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) + AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) + AsJobDetails() (*JobDetails, bool) +} + +// JobDetails job details based on specific job type. +type JobDetails struct { + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicJobDetails(body []byte) (BasicJobDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAsrJobDetails): + var ajd AsrJobDetails + err := json.Unmarshal(body, &ajd) + return ajd, err + case string(InstanceTypeExportJobDetails): + var ejd ExportJobDetails + err := json.Unmarshal(body, &ejd) + return ejd, err + case string(InstanceTypeFailoverJobDetails): + var fjd FailoverJobDetails + err := json.Unmarshal(body, &fjd) + return fjd, err + case string(InstanceTypeSwitchProtectionJobDetails): + var spjd SwitchProtectionJobDetails + err := json.Unmarshal(body, &spjd) + return spjd, err + case string(InstanceTypeTestFailoverJobDetails): + var tfjd TestFailoverJobDetails + err := json.Unmarshal(body, &tfjd) + return tfjd, err + default: + var jd JobDetails + err := json.Unmarshal(body, &jd) + return jd, err + } +} +func unmarshalBasicJobDetailsArray(body []byte) ([]BasicJobDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jdArray := make([]BasicJobDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + jd, err := unmarshalBasicJobDetails(*rawMessage) + if err != nil { + return nil, err + } + jdArray[index] = jd + } + return jdArray, nil +} + +// MarshalJSON is the custom marshaler for JobDetails. +func (jd JobDetails) MarshalJSON() ([]byte, error) { + jd.InstanceType = InstanceTypeJobDetails + objectMap := make(map[string]interface{}) + if jd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = jd.AffectedObjectDetails + } + if jd.InstanceType != "" { + objectMap["instanceType"] = jd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsJobDetails() (*JobDetails, bool) { + return &jd, true +} + +// AsBasicJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &jd, true +} + +// JobEntity this class contains the minimal job details required to navigate to the desired drill down. +type JobEntity struct { + // JobID - The job id. + JobID *string `json:"jobId,omitempty"` + // JobFriendlyName - The job display name. + JobFriendlyName *string `json:"jobFriendlyName,omitempty"` + // TargetObjectID - The object id. + TargetObjectID *string `json:"targetObjectId,omitempty"` + // TargetObjectName - The object name. + TargetObjectName *string `json:"targetObjectName,omitempty"` + // TargetInstanceType - The workflow affected object type. + TargetInstanceType *string `json:"targetInstanceType,omitempty"` + // JobScenarioName - The job name. Enum type ScenarioName. + JobScenarioName *string `json:"jobScenarioName,omitempty"` +} + +// JobErrorDetails this class contains the error details per object. +type JobErrorDetails struct { + // ServiceErrorDetails - The Service error details. + ServiceErrorDetails *ServiceError `json:"serviceErrorDetails,omitempty"` + // ProviderErrorDetails - The Provider error details. + ProviderErrorDetails *ProviderError `json:"providerErrorDetails,omitempty"` + // ErrorLevel - Error level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // CreationTime - The creation time of job error. + CreationTime *date.Time `json:"creationTime,omitempty"` + // TaskID - The Id of the task. + TaskID *string `json:"taskId,omitempty"` +} + +// JobProperties job custom data details. +type JobProperties struct { + // ActivityID - The activity id. + ActivityID *string `json:"activityId,omitempty"` + // ScenarioName - The ScenarioName. + ScenarioName *string `json:"scenarioName,omitempty"` + // FriendlyName - The DisplayName. + FriendlyName *string `json:"friendlyName,omitempty"` + // State - The status of the Job. It is one of these values - NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or Other. + State *string `json:"state,omitempty"` + // StateDescription - The description of the state of the Job. For e.g. - For Succeeded state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. + StateDescription *string `json:"stateDescription,omitempty"` + // Tasks - The tasks. + Tasks *[]ASRTask `json:"tasks,omitempty"` + // Errors - The errors. + Errors *[]JobErrorDetails `json:"errors,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // AllowedActions - The Allowed action the job. + AllowedActions *[]string `json:"allowedActions,omitempty"` + // TargetObjectID - The affected Object Id. + TargetObjectID *string `json:"targetObjectId,omitempty"` + // TargetObjectName - The name of the affected object. + TargetObjectName *string `json:"targetObjectName,omitempty"` + // TargetInstanceType - The type of the affected object which is of Microsoft.Azure.SiteRecovery.V2015_11_10.AffectedObjectType class. + TargetInstanceType *string `json:"targetInstanceType,omitempty"` + // CustomDetails - The custom job details like test failover job details. + CustomDetails BasicJobDetails `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for JobProperties struct. +func (jp *JobProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "activityId": + if v != nil { + var activityID string + err = json.Unmarshal(*v, &activityID) + if err != nil { + return err + } + jp.ActivityID = &activityID + } + case "scenarioName": + if v != nil { + var scenarioName string + err = json.Unmarshal(*v, &scenarioName) + if err != nil { + return err + } + jp.ScenarioName = &scenarioName + } + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + jp.FriendlyName = &friendlyName + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + jp.State = &state + } + case "stateDescription": + if v != nil { + var stateDescription string + err = json.Unmarshal(*v, &stateDescription) + if err != nil { + return err + } + jp.StateDescription = &stateDescription + } + case "tasks": + if v != nil { + var tasks []ASRTask + err = json.Unmarshal(*v, &tasks) + if err != nil { + return err + } + jp.Tasks = &tasks + } + case "errors": + if v != nil { + var errorsVar []JobErrorDetails + err = json.Unmarshal(*v, &errorsVar) + if err != nil { + return err + } + jp.Errors = &errorsVar + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + jp.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + jp.EndTime = &endTime + } + case "allowedActions": + if v != nil { + var allowedActions []string + err = json.Unmarshal(*v, &allowedActions) + if err != nil { + return err + } + jp.AllowedActions = &allowedActions + } + case "targetObjectId": + if v != nil { + var targetObjectID string + err = json.Unmarshal(*v, &targetObjectID) + if err != nil { + return err + } + jp.TargetObjectID = &targetObjectID + } + case "targetObjectName": + if v != nil { + var targetObjectName string + err = json.Unmarshal(*v, &targetObjectName) + if err != nil { + return err + } + jp.TargetObjectName = &targetObjectName + } + case "targetInstanceType": + if v != nil { + var targetInstanceType string + err = json.Unmarshal(*v, &targetInstanceType) + if err != nil { + return err + } + jp.TargetInstanceType = &targetInstanceType + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicJobDetails(*v) + if err != nil { + return err + } + jp.CustomDetails = customDetails + } + } + } + + return nil +} + +// JobQueryParameter query parameter to enumerate jobs. +type JobQueryParameter struct { + // StartTime - Date time to get jobs from. + StartTime *string `json:"startTime,omitempty"` + // EndTime - Date time to get jobs upto. + EndTime *string `json:"endTime,omitempty"` + // FabricID - The Id of the fabric to search jobs under. + FabricID *string `json:"fabricId,omitempty"` + // AffectedObjectTypes - The type of objects. + AffectedObjectTypes *string `json:"affectedObjectTypes,omitempty"` + // JobStatus - The states of the job to be filtered can be in. + JobStatus *string `json:"jobStatus,omitempty"` + // JobOutputType - The output type of the jobs. Possible values include: 'JSON', 'XML', 'Excel' + JobOutputType ExportJobOutputSerializationType `json:"jobOutputType,omitempty"` + // JobName - The job Name. + JobName *string `json:"jobName,omitempty"` + // TimezoneOffset - The timezone offset for the location of the request (in minutes). + TimezoneOffset *float64 `json:"timezoneOffset,omitempty"` +} + +// JobStatusEventDetails model class for event details of a job status event. +type JobStatusEventDetails struct { + // JobID - Job arm id for the event. + JobID *string `json:"jobId,omitempty"` + // JobFriendlyName - JobName for the Event. + JobFriendlyName *string `json:"jobFriendlyName,omitempty"` + // JobStatus - JobStatus for the Event. + JobStatus *string `json:"jobStatus,omitempty"` + // AffectedObjectType - AffectedObjectType for the event. + AffectedObjectType *string `json:"affectedObjectType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeEventSpecificDetails', 'InstanceTypeJobStatus' + InstanceType InstanceTypeBasicEventSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobStatusEventDetails. +func (jsed JobStatusEventDetails) MarshalJSON() ([]byte, error) { + jsed.InstanceType = InstanceTypeJobStatus + objectMap := make(map[string]interface{}) + if jsed.JobID != nil { + objectMap["jobId"] = jsed.JobID + } + if jsed.JobFriendlyName != nil { + objectMap["jobFriendlyName"] = jsed.JobFriendlyName + } + if jsed.JobStatus != nil { + objectMap["jobStatus"] = jsed.JobStatus + } + if jsed.AffectedObjectType != nil { + objectMap["affectedObjectType"] = jsed.AffectedObjectType + } + if jsed.InstanceType != "" { + objectMap["instanceType"] = jsed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsJobStatusEventDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsJobStatusEventDetails() (*JobStatusEventDetails, bool) { + return &jsed, true +} + +// AsEventSpecificDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsEventSpecificDetails() (*EventSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventSpecificDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsBasicEventSpecificDetails() (BasicEventSpecificDetails, bool) { + return &jsed, true +} + +// BasicJobTaskDetails this class represents a task which is actually a workflow so that one can navigate to its +// individual drill down. +type BasicJobTaskDetails interface { + AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) + AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) + AsJobTaskDetails() (*JobTaskDetails, bool) +} + +// JobTaskDetails this class represents a task which is actually a workflow so that one can navigate to its +// individual drill down. +type JobTaskDetails struct { + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicJobTaskDetails(body []byte) (BasicJobTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeFabricReplicationGroupTaskDetails): + var frgtd FabricReplicationGroupTaskDetails + err := json.Unmarshal(body, &frgtd) + return frgtd, err + case string(InstanceTypeVirtualMachineTaskDetails): + var vmtd VirtualMachineTaskDetails + err := json.Unmarshal(body, &vmtd) + return vmtd, err + default: + var jtd JobTaskDetails + err := json.Unmarshal(body, &jtd) + return jtd, err + } +} +func unmarshalBasicJobTaskDetailsArray(body []byte) ([]BasicJobTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jtdArray := make([]BasicJobTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + jtd, err := unmarshalBasicJobTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + jtdArray[index] = jtd + } + return jtdArray, nil +} + +// MarshalJSON is the custom marshaler for JobTaskDetails. +func (jtd JobTaskDetails) MarshalJSON() ([]byte, error) { + jtd.InstanceType = InstanceTypeJobTaskDetails + objectMap := make(map[string]interface{}) + if jtd.JobTask != nil { + objectMap["jobTask"] = jtd.JobTask + } + if jtd.InstanceType != "" { + objectMap["instanceType"] = jtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return &jtd, true +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &jtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &jtd, true +} + +// KeyEncryptionKeyInfo key Encryption Key (KEK) information. +type KeyEncryptionKeyInfo struct { + // KeyIdentifier - The key URL / identifier. + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KeyVaultResourceArmID - The KeyVault resource ARM Id for key. + KeyVaultResourceArmID *string `json:"keyVaultResourceArmId,omitempty"` +} + +// LogicalNetwork logical network data model. +type LogicalNetwork struct { + autorest.Response `json:"-"` + // Properties - The Logical Network Properties. + Properties *LogicalNetworkProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for LogicalNetwork. +func (ln LogicalNetwork) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ln.Properties != nil { + objectMap["properties"] = ln.Properties + } + if ln.Location != nil { + objectMap["location"] = ln.Location + } + return json.Marshal(objectMap) +} + +// LogicalNetworkCollection list of logical networks. +type LogicalNetworkCollection struct { + autorest.Response `json:"-"` + // Value - The Logical Networks list details. + Value *[]LogicalNetwork `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// LogicalNetworkCollectionIterator provides access to a complete listing of LogicalNetwork values. +type LogicalNetworkCollectionIterator struct { + i int + page LogicalNetworkCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *LogicalNetworkCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LogicalNetworkCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *LogicalNetworkCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter LogicalNetworkCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter LogicalNetworkCollectionIterator) Response() LogicalNetworkCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter LogicalNetworkCollectionIterator) Value() LogicalNetwork { + if !iter.page.NotDone() { + return LogicalNetwork{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the LogicalNetworkCollectionIterator type. +func NewLogicalNetworkCollectionIterator(page LogicalNetworkCollectionPage) LogicalNetworkCollectionIterator { + return LogicalNetworkCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lnc LogicalNetworkCollection) IsEmpty() bool { + return lnc.Value == nil || len(*lnc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (lnc LogicalNetworkCollection) hasNextLink() bool { + return lnc.NextLink != nil && len(*lnc.NextLink) != 0 +} + +// logicalNetworkCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lnc LogicalNetworkCollection) logicalNetworkCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !lnc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lnc.NextLink))) +} + +// LogicalNetworkCollectionPage contains a page of LogicalNetwork values. +type LogicalNetworkCollectionPage struct { + fn func(context.Context, LogicalNetworkCollection) (LogicalNetworkCollection, error) + lnc LogicalNetworkCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *LogicalNetworkCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LogicalNetworkCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.lnc) + if err != nil { + return err + } + page.lnc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *LogicalNetworkCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page LogicalNetworkCollectionPage) NotDone() bool { + return !page.lnc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page LogicalNetworkCollectionPage) Response() LogicalNetworkCollection { + return page.lnc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page LogicalNetworkCollectionPage) Values() []LogicalNetwork { + if page.lnc.IsEmpty() { + return nil + } + return *page.lnc.Value +} + +// Creates a new instance of the LogicalNetworkCollectionPage type. +func NewLogicalNetworkCollectionPage(cur LogicalNetworkCollection, getNextPage func(context.Context, LogicalNetworkCollection) (LogicalNetworkCollection, error)) LogicalNetworkCollectionPage { + return LogicalNetworkCollectionPage{ + fn: getNextPage, + lnc: cur, + } +} + +// LogicalNetworkProperties logical Network Properties. +type LogicalNetworkProperties struct { + // FriendlyName - The Friendly Name. + FriendlyName *string `json:"friendlyName,omitempty"` + // NetworkVirtualizationStatus - A value indicating whether Network Virtualization is enabled for the logical network. + NetworkVirtualizationStatus *string `json:"networkVirtualizationStatus,omitempty"` + // LogicalNetworkUsage - A value indicating whether logical network is used as private test network by test failover. + LogicalNetworkUsage *string `json:"logicalNetworkUsage,omitempty"` + // LogicalNetworkDefinitionsStatus - A value indicating whether logical network definitions are isolated. + LogicalNetworkDefinitionsStatus *string `json:"logicalNetworkDefinitionsStatus,omitempty"` +} + +// ManualActionTaskDetails this class represents the manual action task details. +type ManualActionTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // Instructions - The instructions. + Instructions *string `json:"instructions,omitempty"` + // Observation - The observation. + Observation *string `json:"observation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) MarshalJSON() ([]byte, error) { + matd.InstanceType = InstanceTypeManualActionTaskDetails + objectMap := make(map[string]interface{}) + if matd.Name != nil { + objectMap["name"] = matd.Name + } + if matd.Instructions != nil { + objectMap["instructions"] = matd.Instructions + } + if matd.Observation != nil { + objectMap["observation"] = matd.Observation + } + if matd.InstanceType != "" { + objectMap["instanceType"] = matd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return &matd, true +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &matd, true +} + +// MarsAgentDetails mars agent details. +type MarsAgentDetails struct { + // ID - READ-ONLY; The Mars agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The Mars agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The Mars agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The Mars agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the Mars agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the Mars agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for MarsAgentDetails. +func (mad MarsAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MasterTargetServer details of a Master Target Server. +type MasterTargetServer struct { + // ID - The server Id. + ID *string `json:"id,omitempty"` + // IPAddress - The IP address of the server. + IPAddress *string `json:"ipAddress,omitempty"` + // Name - The server name. + Name *string `json:"name,omitempty"` + // OsType - The OS type of the server. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The version of the scout component on the server. + AgentVersion *string `json:"agentVersion,omitempty"` + // LastHeartbeat - The last heartbeat received from the server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // RetentionVolumes - The retention volumes of Master target Server. + RetentionVolumes *[]RetentionVolume `json:"retentionVolumes,omitempty"` + // DataStores - The list of data stores in the fabric. + DataStores *[]DataStore `json:"dataStores,omitempty"` + // ValidationErrors - Validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // HealthErrors - Health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // DiskCount - Disk count of the master target. + DiskCount *int32 `json:"diskCount,omitempty"` + // OsVersion - OS Version of the master target. + OsVersion *string `json:"osVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // MarsAgentVersion - MARS agent version. + MarsAgentVersion *string `json:"marsAgentVersion,omitempty"` + // MarsAgentExpiryDate - MARS agent expiry date. + MarsAgentExpiryDate *date.Time `json:"marsAgentExpiryDate,omitempty"` + // AgentVersionDetails - Agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // MarsAgentVersionDetails - Mars agent version details. + MarsAgentVersionDetails *VersionDetails `json:"marsAgentVersionDetails,omitempty"` +} + +// MigrateInput input for migrate. +type MigrateInput struct { + // Properties - Migrate input properties. + Properties *MigrateInputProperties `json:"properties,omitempty"` +} + +// MigrateInputProperties migrate input properties. +type MigrateInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicMigrateProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for MigrateInputProperties struct. +func (mip *MigrateInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicMigrateProviderSpecificInput(*v) + if err != nil { + return err + } + mip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicMigrateProviderSpecificInput migrate provider specific input. +type BasicMigrateProviderSpecificInput interface { + AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) + AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) +} + +// MigrateProviderSpecificInput migrate provider specific input. +type MigrateProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput', 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicMigrateProviderSpecificInput(body []byte) (BasicMigrateProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt): + var vmcmi VMwareCbtMigrateInput + err := json.Unmarshal(body, &vmcmi) + return vmcmi, err + default: + var mpsi MigrateProviderSpecificInput + err := json.Unmarshal(body, &mpsi) + return mpsi, err + } +} +func unmarshalBasicMigrateProviderSpecificInputArray(body []byte) ([]BasicMigrateProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + mpsiArray := make([]BasicMigrateProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + mpsi, err := unmarshalBasicMigrateProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + mpsiArray[index] = mpsi + } + return mpsiArray, nil +} + +// MarshalJSON is the custom marshaler for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) MarshalJSON() ([]byte, error) { + mpsi.InstanceType = InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput + objectMap := make(map[string]interface{}) + if mpsi.InstanceType != "" { + objectMap["instanceType"] = mpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrateInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) { + return nil, false +} + +// AsMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) { + return &mpsi, true +} + +// AsBasicMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsBasicMigrateProviderSpecificInput() (BasicMigrateProviderSpecificInput, bool) { + return &mpsi, true +} + +// MigrationItem migration item. +type MigrationItem struct { + autorest.Response `json:"-"` + // Properties - The migration item properties. + Properties *MigrationItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationItem. +func (mi MigrationItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mi.Properties != nil { + objectMap["properties"] = mi.Properties + } + if mi.Location != nil { + objectMap["location"] = mi.Location + } + return json.Marshal(objectMap) +} + +// MigrationItemCollection migration item collection. +type MigrationItemCollection struct { + autorest.Response `json:"-"` + // Value - The list of migration items. + Value *[]MigrationItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MigrationItemCollectionIterator provides access to a complete listing of MigrationItem values. +type MigrationItemCollectionIterator struct { + i int + page MigrationItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *MigrationItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *MigrationItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MigrationItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter MigrationItemCollectionIterator) Response() MigrationItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter MigrationItemCollectionIterator) Value() MigrationItem { + if !iter.page.NotDone() { + return MigrationItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the MigrationItemCollectionIterator type. +func NewMigrationItemCollectionIterator(page MigrationItemCollectionPage) MigrationItemCollectionIterator { + return MigrationItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mic MigrationItemCollection) IsEmpty() bool { + return mic.Value == nil || len(*mic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mic MigrationItemCollection) hasNextLink() bool { + return mic.NextLink != nil && len(*mic.NextLink) != 0 +} + +// migrationItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mic MigrationItemCollection) migrationItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !mic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mic.NextLink))) +} + +// MigrationItemCollectionPage contains a page of MigrationItem values. +type MigrationItemCollectionPage struct { + fn func(context.Context, MigrationItemCollection) (MigrationItemCollection, error) + mic MigrationItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *MigrationItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.mic) + if err != nil { + return err + } + page.mic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *MigrationItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MigrationItemCollectionPage) NotDone() bool { + return !page.mic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MigrationItemCollectionPage) Response() MigrationItemCollection { + return page.mic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MigrationItemCollectionPage) Values() []MigrationItem { + if page.mic.IsEmpty() { + return nil + } + return *page.mic.Value +} + +// Creates a new instance of the MigrationItemCollectionPage type. +func NewMigrationItemCollectionPage(cur MigrationItemCollection, getNextPage func(context.Context, MigrationItemCollection) (MigrationItemCollection, error)) MigrationItemCollectionPage { + return MigrationItemCollectionPage{ + fn: getNextPage, + mic: cur, + } +} + +// MigrationItemProperties migration item properties. +type MigrationItemProperties struct { + // MachineName - READ-ONLY; The on-premise virtual machine name. + MachineName *string `json:"machineName,omitempty"` + // PolicyID - READ-ONLY; The ARM Id of policy governing this item. + PolicyID *string `json:"policyId,omitempty"` + // PolicyFriendlyName - READ-ONLY; The name of policy governing this item. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` + // MigrationState - READ-ONLY; The migration status. Possible values include: 'MigrationStateNone', 'MigrationStateEnableMigrationInProgress', 'MigrationStateEnableMigrationFailed', 'MigrationStateDisableMigrationInProgress', 'MigrationStateDisableMigrationFailed', 'MigrationStateInitialSeedingInProgress', 'MigrationStateInitialSeedingFailed', 'MigrationStateReplicating', 'MigrationStateMigrationInProgress', 'MigrationStateMigrationSucceeded', 'MigrationStateMigrationFailed' + MigrationState MigrationState `json:"migrationState,omitempty"` + // MigrationStateDescription - READ-ONLY; The migration state description. + MigrationStateDescription *string `json:"migrationStateDescription,omitempty"` + // LastTestMigrationTime - READ-ONLY; The last test migration time. + LastTestMigrationTime *date.Time `json:"lastTestMigrationTime,omitempty"` + // LastTestMigrationStatus - READ-ONLY; The status of the last test migration. + LastTestMigrationStatus *string `json:"lastTestMigrationStatus,omitempty"` + // TestMigrateState - READ-ONLY; The test migrate state. Possible values include: 'TestMigrationStateNone', 'TestMigrationStateTestMigrationInProgress', 'TestMigrationStateTestMigrationSucceeded', 'TestMigrationStateTestMigrationFailed', 'TestMigrationStateTestMigrationCleanupInProgress' + TestMigrateState TestMigrationState `json:"testMigrateState,omitempty"` + // TestMigrateStateDescription - READ-ONLY; The test migrate state description. + TestMigrateStateDescription *string `json:"testMigrateStateDescription,omitempty"` + // Health - READ-ONLY; The consolidated health. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The list of health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // AllowedOperations - READ-ONLY; The allowed operations on the migration item based on the current migration state of the item. + AllowedOperations *[]MigrationItemOperation `json:"allowedOperations,omitempty"` + // CurrentJob - READ-ONLY; The current job details. + CurrentJob *CurrentJobDetails `json:"currentJob,omitempty"` + // EventCorrelationID - READ-ONLY; The correlation Id for events associated with this migration item. + EventCorrelationID *string `json:"eventCorrelationId,omitempty"` + // ProviderSpecificDetails - The migration provider custom settings. + ProviderSpecificDetails BasicMigrationProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationItemProperties. +func (mip MigrationItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["providerSpecificDetails"] = mip.ProviderSpecificDetails + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MigrationItemProperties struct. +func (mip *MigrationItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "machineName": + if v != nil { + var machineName string + err = json.Unmarshal(*v, &machineName) + if err != nil { + return err + } + mip.MachineName = &machineName + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + mip.PolicyID = &policyID + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + mip.PolicyFriendlyName = &policyFriendlyName + } + case "migrationState": + if v != nil { + var migrationState MigrationState + err = json.Unmarshal(*v, &migrationState) + if err != nil { + return err + } + mip.MigrationState = migrationState + } + case "migrationStateDescription": + if v != nil { + var migrationStateDescription string + err = json.Unmarshal(*v, &migrationStateDescription) + if err != nil { + return err + } + mip.MigrationStateDescription = &migrationStateDescription + } + case "lastTestMigrationTime": + if v != nil { + var lastTestMigrationTime date.Time + err = json.Unmarshal(*v, &lastTestMigrationTime) + if err != nil { + return err + } + mip.LastTestMigrationTime = &lastTestMigrationTime + } + case "lastTestMigrationStatus": + if v != nil { + var lastTestMigrationStatus string + err = json.Unmarshal(*v, &lastTestMigrationStatus) + if err != nil { + return err + } + mip.LastTestMigrationStatus = &lastTestMigrationStatus + } + case "testMigrateState": + if v != nil { + var testMigrateState TestMigrationState + err = json.Unmarshal(*v, &testMigrateState) + if err != nil { + return err + } + mip.TestMigrateState = testMigrateState + } + case "testMigrateStateDescription": + if v != nil { + var testMigrateStateDescription string + err = json.Unmarshal(*v, &testMigrateStateDescription) + if err != nil { + return err + } + mip.TestMigrateStateDescription = &testMigrateStateDescription + } + case "health": + if v != nil { + var health ProtectionHealth + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + mip.Health = health + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + mip.HealthErrors = &healthErrors + } + case "allowedOperations": + if v != nil { + var allowedOperations []MigrationItemOperation + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + mip.AllowedOperations = &allowedOperations + } + case "currentJob": + if v != nil { + var currentJob CurrentJobDetails + err = json.Unmarshal(*v, ¤tJob) + if err != nil { + return err + } + mip.CurrentJob = ¤tJob + } + case "eventCorrelationId": + if v != nil { + var eventCorrelationID string + err = json.Unmarshal(*v, &eventCorrelationID) + if err != nil { + return err + } + mip.EventCorrelationID = &eventCorrelationID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicMigrationProviderSpecificSettings(*v) + if err != nil { + return err + } + mip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// MigrationItemsQueryParameter query parameter to enumerate migration items. +type MigrationItemsQueryParameter struct { + // SourceFabricName - The source fabric name filter. + SourceFabricName *string `json:"sourceFabricName,omitempty"` + // SourceContainerName - The source container name filter. + SourceContainerName *string `json:"sourceContainerName,omitempty"` + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` +} + +// BasicMigrationProviderSpecificSettings migration provider specific settings. +type BasicMigrationProviderSpecificSettings interface { + AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) + AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) +} + +// MigrationProviderSpecificSettings migration provider specific settings. +type MigrationProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings', 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicMigrationProviderSpecificSettings(body []byte) (BasicMigrationProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt): + var vmcmd VMwareCbtMigrationDetails + err := json.Unmarshal(body, &vmcmd) + return vmcmd, err + default: + var mpss MigrationProviderSpecificSettings + err := json.Unmarshal(body, &mpss) + return mpss, err + } +} +func unmarshalBasicMigrationProviderSpecificSettingsArray(body []byte) ([]BasicMigrationProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + mpssArray := make([]BasicMigrationProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + mpss, err := unmarshalBasicMigrationProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + mpssArray[index] = mpss + } + return mpssArray, nil +} + +// MarshalJSON is the custom marshaler for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) MarshalJSON() ([]byte, error) { + mpss.InstanceType = InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings + objectMap := make(map[string]interface{}) + if mpss.InstanceType != "" { + objectMap["instanceType"] = mpss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrationDetails is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) { + return nil, false +} + +// AsMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) { + return &mpss, true +} + +// AsBasicMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsBasicMigrationProviderSpecificSettings() (BasicMigrationProviderSpecificSettings, bool) { + return &mpss, true +} + +// MigrationRecoveryPoint recovery point for a migration item. +type MigrationRecoveryPoint struct { + autorest.Response `json:"-"` + // Properties - Recovery point properties. + Properties *MigrationRecoveryPointProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationRecoveryPoint. +func (mrp MigrationRecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mrp.Properties != nil { + objectMap["properties"] = mrp.Properties + } + if mrp.Location != nil { + objectMap["location"] = mrp.Location + } + return json.Marshal(objectMap) +} + +// MigrationRecoveryPointCollection collection of migration recovery points. +type MigrationRecoveryPointCollection struct { + autorest.Response `json:"-"` + // Value - The migration recovery point details. + Value *[]MigrationRecoveryPoint `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MigrationRecoveryPointCollectionIterator provides access to a complete listing of MigrationRecoveryPoint +// values. +type MigrationRecoveryPointCollectionIterator struct { + i int + page MigrationRecoveryPointCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *MigrationRecoveryPointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *MigrationRecoveryPointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MigrationRecoveryPointCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter MigrationRecoveryPointCollectionIterator) Response() MigrationRecoveryPointCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter MigrationRecoveryPointCollectionIterator) Value() MigrationRecoveryPoint { + if !iter.page.NotDone() { + return MigrationRecoveryPoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the MigrationRecoveryPointCollectionIterator type. +func NewMigrationRecoveryPointCollectionIterator(page MigrationRecoveryPointCollectionPage) MigrationRecoveryPointCollectionIterator { + return MigrationRecoveryPointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mrpc MigrationRecoveryPointCollection) IsEmpty() bool { + return mrpc.Value == nil || len(*mrpc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mrpc MigrationRecoveryPointCollection) hasNextLink() bool { + return mrpc.NextLink != nil && len(*mrpc.NextLink) != 0 +} + +// migrationRecoveryPointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mrpc MigrationRecoveryPointCollection) migrationRecoveryPointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !mrpc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mrpc.NextLink))) +} + +// MigrationRecoveryPointCollectionPage contains a page of MigrationRecoveryPoint values. +type MigrationRecoveryPointCollectionPage struct { + fn func(context.Context, MigrationRecoveryPointCollection) (MigrationRecoveryPointCollection, error) + mrpc MigrationRecoveryPointCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *MigrationRecoveryPointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.mrpc) + if err != nil { + return err + } + page.mrpc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *MigrationRecoveryPointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MigrationRecoveryPointCollectionPage) NotDone() bool { + return !page.mrpc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MigrationRecoveryPointCollectionPage) Response() MigrationRecoveryPointCollection { + return page.mrpc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MigrationRecoveryPointCollectionPage) Values() []MigrationRecoveryPoint { + if page.mrpc.IsEmpty() { + return nil + } + return *page.mrpc.Value +} + +// Creates a new instance of the MigrationRecoveryPointCollectionPage type. +func NewMigrationRecoveryPointCollectionPage(cur MigrationRecoveryPointCollection, getNextPage func(context.Context, MigrationRecoveryPointCollection) (MigrationRecoveryPointCollection, error)) MigrationRecoveryPointCollectionPage { + return MigrationRecoveryPointCollectionPage{ + fn: getNextPage, + mrpc: cur, + } +} + +// MigrationRecoveryPointProperties migration item recovery point properties. +type MigrationRecoveryPointProperties struct { + // RecoveryPointTime - READ-ONLY; The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointType - READ-ONLY; The recovery point type. Possible values include: 'MigrationRecoveryPointTypeNotSpecified', 'MigrationRecoveryPointTypeApplicationConsistent', 'MigrationRecoveryPointTypeCrashConsistent' + RecoveryPointType MigrationRecoveryPointType `json:"recoveryPointType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationRecoveryPointProperties. +func (mrpp MigrationRecoveryPointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MobilityServiceUpdate the Mobility Service update details. +type MobilityServiceUpdate struct { + // Version - The version of the latest update. + Version *string `json:"version,omitempty"` + // RebootStatus - The reboot status of the update - whether it is required or not. + RebootStatus *string `json:"rebootStatus,omitempty"` + // OsType - The OS type. + OsType *string `json:"osType,omitempty"` +} + +// Network network model. +type Network struct { + autorest.Response `json:"-"` + // Properties - The Network Properties. + Properties *NetworkProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Network. +func (n Network) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if n.Properties != nil { + objectMap["properties"] = n.Properties + } + if n.Location != nil { + objectMap["location"] = n.Location + } + return json.Marshal(objectMap) +} + +// NetworkCollection list of networks. +type NetworkCollection struct { + autorest.Response `json:"-"` + // Value - The Networks list details. + Value *[]Network `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// NetworkCollectionIterator provides access to a complete listing of Network values. +type NetworkCollectionIterator struct { + i int + page NetworkCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *NetworkCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *NetworkCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter NetworkCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter NetworkCollectionIterator) Response() NetworkCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter NetworkCollectionIterator) Value() Network { + if !iter.page.NotDone() { + return Network{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the NetworkCollectionIterator type. +func NewNetworkCollectionIterator(page NetworkCollectionPage) NetworkCollectionIterator { + return NetworkCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (nc NetworkCollection) IsEmpty() bool { + return nc.Value == nil || len(*nc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (nc NetworkCollection) hasNextLink() bool { + return nc.NextLink != nil && len(*nc.NextLink) != 0 +} + +// networkCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (nc NetworkCollection) networkCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !nc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(nc.NextLink))) +} + +// NetworkCollectionPage contains a page of Network values. +type NetworkCollectionPage struct { + fn func(context.Context, NetworkCollection) (NetworkCollection, error) + nc NetworkCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *NetworkCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.nc) + if err != nil { + return err + } + page.nc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *NetworkCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page NetworkCollectionPage) NotDone() bool { + return !page.nc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page NetworkCollectionPage) Response() NetworkCollection { + return page.nc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page NetworkCollectionPage) Values() []Network { + if page.nc.IsEmpty() { + return nil + } + return *page.nc.Value +} + +// Creates a new instance of the NetworkCollectionPage type. +func NewNetworkCollectionPage(cur NetworkCollection, getNextPage func(context.Context, NetworkCollection) (NetworkCollection, error)) NetworkCollectionPage { + return NetworkCollectionPage{ + fn: getNextPage, + nc: cur, + } +} + +// NetworkMapping network Mapping model. Ideally it should have been possible to inherit this class from +// prev version in InheritedModels as long as there is no difference in structure or method signature. +// Since there were no base Models for certain fields and methods viz NetworkMappingProperties and Load +// with required return type, the class has been introduced in its entirety with references to base models +// to facilitate extensions in subsequent versions. +type NetworkMapping struct { + autorest.Response `json:"-"` + // Properties - The Network Mapping Properties. + Properties *NetworkMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for NetworkMapping. +func (nm NetworkMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if nm.Properties != nil { + objectMap["properties"] = nm.Properties + } + if nm.Location != nil { + objectMap["location"] = nm.Location + } + return json.Marshal(objectMap) +} + +// NetworkMappingCollection list of network mappings. As with NetworkMapping, it should be possible to +// reuse a prev version of this class. It doesn't seem likely this class could be anything more than a +// slightly bespoke collection of NetworkMapping. Hence it makes sense to override Load with +// Base.NetworkMapping instead of existing CurrentVersion.NetworkMapping. +type NetworkMappingCollection struct { + autorest.Response `json:"-"` + // Value - The Network Mappings list. + Value *[]NetworkMapping `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// NetworkMappingCollectionIterator provides access to a complete listing of NetworkMapping values. +type NetworkMappingCollectionIterator struct { + i int + page NetworkMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *NetworkMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *NetworkMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter NetworkMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter NetworkMappingCollectionIterator) Response() NetworkMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter NetworkMappingCollectionIterator) Value() NetworkMapping { + if !iter.page.NotDone() { + return NetworkMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the NetworkMappingCollectionIterator type. +func NewNetworkMappingCollectionIterator(page NetworkMappingCollectionPage) NetworkMappingCollectionIterator { + return NetworkMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (nmc NetworkMappingCollection) IsEmpty() bool { + return nmc.Value == nil || len(*nmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (nmc NetworkMappingCollection) hasNextLink() bool { + return nmc.NextLink != nil && len(*nmc.NextLink) != 0 +} + +// networkMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (nmc NetworkMappingCollection) networkMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !nmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(nmc.NextLink))) +} + +// NetworkMappingCollectionPage contains a page of NetworkMapping values. +type NetworkMappingCollectionPage struct { + fn func(context.Context, NetworkMappingCollection) (NetworkMappingCollection, error) + nmc NetworkMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *NetworkMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.nmc) + if err != nil { + return err + } + page.nmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *NetworkMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page NetworkMappingCollectionPage) NotDone() bool { + return !page.nmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page NetworkMappingCollectionPage) Response() NetworkMappingCollection { + return page.nmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page NetworkMappingCollectionPage) Values() []NetworkMapping { + if page.nmc.IsEmpty() { + return nil + } + return *page.nmc.Value +} + +// Creates a new instance of the NetworkMappingCollectionPage type. +func NewNetworkMappingCollectionPage(cur NetworkMappingCollection, getNextPage func(context.Context, NetworkMappingCollection) (NetworkMappingCollection, error)) NetworkMappingCollectionPage { + return NetworkMappingCollectionPage{ + fn: getNextPage, + nmc: cur, + } +} + +// BasicNetworkMappingFabricSpecificSettings network Mapping fabric specific settings. +type BasicNetworkMappingFabricSpecificSettings interface { + AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) + AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) + AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) + AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) +} + +// NetworkMappingFabricSpecificSettings network Mapping fabric specific settings. +type NetworkMappingFabricSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicNetworkMappingFabricSpecificSettings(body []byte) (BasicNetworkMappingFabricSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure): + var atanms AzureToAzureNetworkMappingSettings + err := json.Unmarshal(body, &atanms) + return atanms, err + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure): + var vtanms VmmToAzureNetworkMappingSettings + err := json.Unmarshal(body, &vtanms) + return vtanms, err + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm): + var vtvnms VmmToVmmNetworkMappingSettings + err := json.Unmarshal(body, &vtvnms) + return vtvnms, err + default: + var nmfss NetworkMappingFabricSpecificSettings + err := json.Unmarshal(body, &nmfss) + return nmfss, err + } +} +func unmarshalBasicNetworkMappingFabricSpecificSettingsArray(body []byte) ([]BasicNetworkMappingFabricSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + nmfssArray := make([]BasicNetworkMappingFabricSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + nmfss, err := unmarshalBasicNetworkMappingFabricSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + nmfssArray[index] = nmfss + } + return nmfssArray, nil +} + +// MarshalJSON is the custom marshaler for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) MarshalJSON() ([]byte, error) { + nmfss.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings + objectMap := make(map[string]interface{}) + if nmfss.InstanceType != "" { + objectMap["instanceType"] = nmfss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return &nmfss, true +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &nmfss, true +} + +// NetworkMappingProperties network Mapping Properties. +type NetworkMappingProperties struct { + // State - The pairing state for network mapping. + State *string `json:"state,omitempty"` + // PrimaryNetworkFriendlyName - The primary network friendly name. + PrimaryNetworkFriendlyName *string `json:"primaryNetworkFriendlyName,omitempty"` + // PrimaryNetworkID - The primary network id for network mapping. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // PrimaryFabricFriendlyName - The primary fabric friendly name. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // RecoveryNetworkFriendlyName - The recovery network friendly name. + RecoveryNetworkFriendlyName *string `json:"recoveryNetworkFriendlyName,omitempty"` + // RecoveryNetworkID - The recovery network id for network mapping. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // RecoveryFabricArmID - The recovery fabric ARM id. + RecoveryFabricArmID *string `json:"recoveryFabricArmId,omitempty"` + // RecoveryFabricFriendlyName - The recovery fabric friendly name. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // FabricSpecificSettings - The fabric specific settings. + FabricSpecificSettings BasicNetworkMappingFabricSpecificSettings `json:"fabricSpecificSettings,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for NetworkMappingProperties struct. +func (nmp *NetworkMappingProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + nmp.State = &state + } + case "primaryNetworkFriendlyName": + if v != nil { + var primaryNetworkFriendlyName string + err = json.Unmarshal(*v, &primaryNetworkFriendlyName) + if err != nil { + return err + } + nmp.PrimaryNetworkFriendlyName = &primaryNetworkFriendlyName + } + case "primaryNetworkId": + if v != nil { + var primaryNetworkID string + err = json.Unmarshal(*v, &primaryNetworkID) + if err != nil { + return err + } + nmp.PrimaryNetworkID = &primaryNetworkID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + nmp.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "recoveryNetworkFriendlyName": + if v != nil { + var recoveryNetworkFriendlyName string + err = json.Unmarshal(*v, &recoveryNetworkFriendlyName) + if err != nil { + return err + } + nmp.RecoveryNetworkFriendlyName = &recoveryNetworkFriendlyName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + nmp.RecoveryNetworkID = &recoveryNetworkID + } + case "recoveryFabricArmId": + if v != nil { + var recoveryFabricArmID string + err = json.Unmarshal(*v, &recoveryFabricArmID) + if err != nil { + return err + } + nmp.RecoveryFabricArmID = &recoveryFabricArmID + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + nmp.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "fabricSpecificSettings": + if v != nil { + fabricSpecificSettings, err := unmarshalBasicNetworkMappingFabricSpecificSettings(*v) + if err != nil { + return err + } + nmp.FabricSpecificSettings = fabricSpecificSettings + } + } + } + + return nil +} + +// NetworkProperties network Properties. +type NetworkProperties struct { + // FabricType - The Fabric Type. + FabricType *string `json:"fabricType,omitempty"` + // Subnets - The List of subnets. + Subnets *[]Subnet `json:"subnets,omitempty"` + // FriendlyName - The Friendly Name. + FriendlyName *string `json:"friendlyName,omitempty"` + // NetworkType - The Network Type. + NetworkType *string `json:"networkType,omitempty"` +} + +// NewProtectionProfile new Protection profile input. +type NewProtectionProfile struct { + // PolicyName - The protection profile input. + PolicyName *string `json:"policyName,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for NewProtectionProfile. +func (npp NewProtectionProfile) MarshalJSON() ([]byte, error) { + npp.ResourceType = ResourceTypeNew + objectMap := make(map[string]interface{}) + if npp.PolicyName != nil { + objectMap["policyName"] = npp.PolicyName + } + if npp.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = npp.RecoveryPointHistory + } + if npp.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = npp.CrashConsistentFrequencyInMinutes + } + if npp.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = npp.AppConsistentFrequencyInMinutes + } + if npp.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = npp.MultiVMSyncStatus + } + if npp.ResourceType != "" { + objectMap["resourceType"] = npp.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return nil, false +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return &npp, true +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return nil, false +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &npp, true +} + +// NewRecoveryVirtualNetwork recovery virtual network input to create new virtual network from given source +// network. +type NewRecoveryVirtualNetwork struct { + // RecoveryVirtualNetworkResourceGroupName - The name of the resource group to be used to create the recovery virtual network. If absent, target network would be created in the same resource group as target VM. + RecoveryVirtualNetworkResourceGroupName *string `json:"recoveryVirtualNetworkResourceGroupName,omitempty"` + // RecoveryVirtualNetworkName - The recovery virtual network name. + RecoveryVirtualNetworkName *string `json:"recoveryVirtualNetworkName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) MarshalJSON() ([]byte, error) { + nrvn.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew + objectMap := make(map[string]interface{}) + if nrvn.RecoveryVirtualNetworkResourceGroupName != nil { + objectMap["recoveryVirtualNetworkResourceGroupName"] = nrvn.RecoveryVirtualNetworkResourceGroupName + } + if nrvn.RecoveryVirtualNetworkName != nil { + objectMap["recoveryVirtualNetworkName"] = nrvn.RecoveryVirtualNetworkName + } + if nrvn.ResourceType != "" { + objectMap["resourceType"] = nrvn.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return &nrvn, true +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &nrvn, true +} + +// OperationsDiscovery operations discovery class. +type OperationsDiscovery struct { + // Name - Name of the API. The name of the operation being performed on this particular object. It should match the action name that appears in RBAC / the event service. Examples of operations include: * Microsoft.Compute/virtualMachine/capture/action * Microsoft.Compute/virtualMachine/restart/action * Microsoft.Compute/virtualMachine/write * Microsoft.Compute/virtualMachine/read * Microsoft.Compute/virtualMachine/delete Each action should include, in order: (1) Resource Provider Namespace (2) Type hierarchy for which the action applies (e.g. server/databases for a SQL Azure database) (3) Read, Write, Action or Delete indicating which type applies. If it is a PUT/PATCH on a collection or named value, Write should be used. If it is a GET, Read should be used. If it is a DELETE, Delete should be used. If it is a POST, Action should be used. As a note: all resource providers would need to include the "{Resource Provider Namespace}/register/action" operation in their response. This API is used to register for their service, and should include details about the operation (e.g. a localized name for the resource provider + any special considerations like PII release). + Name *string `json:"name,omitempty"` + // Display - Object type. + Display *Display `json:"display,omitempty"` + // Origin - Origin. The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. Default value is "user,system". + Origin *string `json:"origin,omitempty"` + // Properties - Properties. Reserved for future use. + Properties interface{} `json:"properties,omitempty"` +} + +// OperationsDiscoveryCollection collection of ClientDiscovery details. +type OperationsDiscoveryCollection struct { + autorest.Response `json:"-"` + // Value - The ClientDiscovery details. + Value *[]OperationsDiscovery `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationsDiscoveryCollectionIterator provides access to a complete listing of OperationsDiscovery +// values. +type OperationsDiscoveryCollectionIterator struct { + i int + page OperationsDiscoveryCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationsDiscoveryCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsDiscoveryCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationsDiscoveryCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationsDiscoveryCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationsDiscoveryCollectionIterator) Response() OperationsDiscoveryCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationsDiscoveryCollectionIterator) Value() OperationsDiscovery { + if !iter.page.NotDone() { + return OperationsDiscovery{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationsDiscoveryCollectionIterator type. +func NewOperationsDiscoveryCollectionIterator(page OperationsDiscoveryCollectionPage) OperationsDiscoveryCollectionIterator { + return OperationsDiscoveryCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (odc OperationsDiscoveryCollection) IsEmpty() bool { + return odc.Value == nil || len(*odc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (odc OperationsDiscoveryCollection) hasNextLink() bool { + return odc.NextLink != nil && len(*odc.NextLink) != 0 +} + +// operationsDiscoveryCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (odc OperationsDiscoveryCollection) operationsDiscoveryCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !odc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(odc.NextLink))) +} + +// OperationsDiscoveryCollectionPage contains a page of OperationsDiscovery values. +type OperationsDiscoveryCollectionPage struct { + fn func(context.Context, OperationsDiscoveryCollection) (OperationsDiscoveryCollection, error) + odc OperationsDiscoveryCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationsDiscoveryCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsDiscoveryCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.odc) + if err != nil { + return err + } + page.odc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationsDiscoveryCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationsDiscoveryCollectionPage) NotDone() bool { + return !page.odc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationsDiscoveryCollectionPage) Response() OperationsDiscoveryCollection { + return page.odc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationsDiscoveryCollectionPage) Values() []OperationsDiscovery { + if page.odc.IsEmpty() { + return nil + } + return *page.odc.Value +} + +// Creates a new instance of the OperationsDiscoveryCollectionPage type. +func NewOperationsDiscoveryCollectionPage(cur OperationsDiscoveryCollection, getNextPage func(context.Context, OperationsDiscoveryCollection) (OperationsDiscoveryCollection, error)) OperationsDiscoveryCollectionPage { + return OperationsDiscoveryCollectionPage{ + fn: getNextPage, + odc: cur, + } +} + +// OSDetails disk Details. +type OSDetails struct { + // OsType - VM Disk details. + OsType *string `json:"osType,omitempty"` + // ProductType - Product type. + ProductType *string `json:"productType,omitempty"` + // OsEdition - The OSEdition. + OsEdition *string `json:"osEdition,omitempty"` + // OSVersion - The OS Version. + OSVersion *string `json:"oSVersion,omitempty"` + // OSMajorVersion - The OS Major Version. + OSMajorVersion *string `json:"oSMajorVersion,omitempty"` + // OSMinorVersion - The OS Minor Version. + OSMinorVersion *string `json:"oSMinorVersion,omitempty"` +} + +// OSDiskDetails details of the OS Disk. +type OSDiskDetails struct { + // OsVhdID - The id of the disk containing the OS. + OsVhdID *string `json:"osVhdId,omitempty"` + // OsType - The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // VhdName - The OS disk VHD name. + VhdName *string `json:"vhdName,omitempty"` +} + +// OSVersionWrapper wrapper model for OSVersion to include version and service pack info. +type OSVersionWrapper struct { + // Version - The version. + Version *string `json:"version,omitempty"` + // ServicePack - The service pack. + ServicePack *string `json:"servicePack,omitempty"` +} + +// PlannedFailoverInput input definition for planned failover. +type PlannedFailoverInput struct { + // Properties - Planned failover input properties. + Properties *PlannedFailoverInputProperties `json:"properties,omitempty"` +} + +// PlannedFailoverInputProperties input definition for planned failover input properties. +type PlannedFailoverInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicPlannedFailoverProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for PlannedFailoverInputProperties struct. +func (pfip *PlannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + pfip.FailoverDirection = &failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(*v) + if err != nil { + return err + } + pfip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicPlannedFailoverProviderSpecificFailoverInput provider specific failover input. +type BasicPlannedFailoverProviderSpecificFailoverInput interface { + AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) + AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) + AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) + AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) +} + +// PlannedFailoverProviderSpecificFailoverInput provider specific failover input. +type PlannedFailoverProviderSpecificFailoverInput struct { + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(body []byte) (BasicPlannedFailoverProviderSpecificFailoverInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeHyperVReplicaAzureFailback): + var hvrafpi HyperVReplicaAzureFailbackProviderInput + err := json.Unmarshal(body, &hvrafpi) + return hvrafpi, err + case string(InstanceTypeHyperVReplicaAzure): + var hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput + err := json.Unmarshal(body, &hvrapfpi) + return hvrapfpi, err + case string(InstanceTypeInMageRcmFailback): + var imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput + err := json.Unmarshal(body, &imrfpfpi) + return imrfpfpi, err + default: + var pfpsfi PlannedFailoverProviderSpecificFailoverInput + err := json.Unmarshal(body, &pfpsfi) + return pfpsfi, err + } +} +func unmarshalBasicPlannedFailoverProviderSpecificFailoverInputArray(body []byte) ([]BasicPlannedFailoverProviderSpecificFailoverInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pfpsfiArray := make([]BasicPlannedFailoverProviderSpecificFailoverInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pfpsfi, err := unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(*rawMessage) + if err != nil { + return nil, err + } + pfpsfiArray[index] = pfpsfi + } + return pfpsfiArray, nil +} + +// MarshalJSON is the custom marshaler for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) MarshalJSON() ([]byte, error) { + pfpsfi.InstanceType = InstanceTypePlannedFailoverProviderSpecificFailoverInput + objectMap := make(map[string]interface{}) + if pfpsfi.InstanceType != "" { + objectMap["instanceType"] = pfpsfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return &pfpsfi, true +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &pfpsfi, true +} + +// Policy protection profile details. +type Policy struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *PolicyProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Policy. +func (p Policy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.Properties != nil { + objectMap["properties"] = p.Properties + } + if p.Location != nil { + objectMap["location"] = p.Location + } + return json.Marshal(objectMap) +} + +// PolicyCollection protection Profile Collection details. +type PolicyCollection struct { + autorest.Response `json:"-"` + // Value - The policy details. + Value *[]Policy `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// PolicyCollectionIterator provides access to a complete listing of Policy values. +type PolicyCollectionIterator struct { + i int + page PolicyCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PolicyCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PolicyCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PolicyCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PolicyCollectionIterator) Response() PolicyCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PolicyCollectionIterator) Value() Policy { + if !iter.page.NotDone() { + return Policy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PolicyCollectionIterator type. +func NewPolicyCollectionIterator(page PolicyCollectionPage) PolicyCollectionIterator { + return PolicyCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pc PolicyCollection) IsEmpty() bool { + return pc.Value == nil || len(*pc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pc PolicyCollection) hasNextLink() bool { + return pc.NextLink != nil && len(*pc.NextLink) != 0 +} + +// policyCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pc PolicyCollection) policyCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pc.NextLink))) +} + +// PolicyCollectionPage contains a page of Policy values. +type PolicyCollectionPage struct { + fn func(context.Context, PolicyCollection) (PolicyCollection, error) + pc PolicyCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PolicyCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pc) + if err != nil { + return err + } + page.pc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PolicyCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PolicyCollectionPage) NotDone() bool { + return !page.pc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PolicyCollectionPage) Response() PolicyCollection { + return page.pc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PolicyCollectionPage) Values() []Policy { + if page.pc.IsEmpty() { + return nil + } + return *page.pc.Value +} + +// Creates a new instance of the PolicyCollectionPage type. +func NewPolicyCollectionPage(cur PolicyCollection, getNextPage func(context.Context, PolicyCollection) (PolicyCollection, error)) PolicyCollectionPage { + return PolicyCollectionPage{ + fn: getNextPage, + pc: cur, + } +} + +// PolicyProperties protection profile custom data details. +type PolicyProperties struct { + // FriendlyName - The FriendlyName. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProviderSpecificDetails - The ReplicationChannelSetting. + ProviderSpecificDetails BasicPolicyProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for PolicyProperties struct. +func (pp *PolicyProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + pp.FriendlyName = &friendlyName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicPolicyProviderSpecificDetails(*v) + if err != nil { + return err + } + pp.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicPolicyProviderSpecificDetails base class for Provider specific details for policies. +type BasicPolicyProviderSpecificDetails interface { + AsA2APolicyDetails() (*A2APolicyDetails, bool) + AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) + AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) + AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) + AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) + AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) + AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) + AsInMagePolicyDetails() (*InMagePolicyDetails, bool) + AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) + AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) + AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) + AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) +} + +// PolicyProviderSpecificDetails base class for Provider specific details for policies. +type PolicyProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicPolicyProviderSpecificDetails(body []byte) (BasicPolicyProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A): + var apd A2APolicyDetails + err := json.Unmarshal(body, &apd) + return apd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure): + var hvrapd HyperVReplicaAzurePolicyDetails + err := json.Unmarshal(body, &hvrapd) + return hvrapd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails): + var hvrbpd HyperVReplicaBasePolicyDetails + err := json.Unmarshal(body, &hvrbpd) + return hvrbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2): + var hvrbpd HyperVReplicaBluePolicyDetails + err := json.Unmarshal(body, &hvrbpd) + return hvrbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012): + var hvrpd HyperVReplicaPolicyDetails + err := json.Unmarshal(body, &hvrpd) + return hvrpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2): + var imavpd InMageAzureV2PolicyDetails + err := json.Unmarshal(body, &imavpd) + return imavpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails): + var imbpd InMageBasePolicyDetails + err := json.Unmarshal(body, &imbpd) + return imbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage): + var impd InMagePolicyDetails + err := json.Unmarshal(body, &impd) + return impd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback): + var imrfpd InMageRcmFailbackPolicyDetails + err := json.Unmarshal(body, &imrfpd) + return imrfpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm): + var imrpd InMageRcmPolicyDetails + err := json.Unmarshal(body, &imrpd) + return imrpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt): + var vcpd VmwareCbtPolicyDetails + err := json.Unmarshal(body, &vcpd) + return vcpd, err + default: + var ppsd PolicyProviderSpecificDetails + err := json.Unmarshal(body, &ppsd) + return ppsd, err + } +} +func unmarshalBasicPolicyProviderSpecificDetailsArray(body []byte) ([]BasicPolicyProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppsdArray := make([]BasicPolicyProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppsd, err := unmarshalBasicPolicyProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + ppsdArray[index] = ppsd + } + return ppsdArray, nil +} + +// MarshalJSON is the custom marshaler for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) MarshalJSON() ([]byte, error) { + ppsd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails + objectMap := make(map[string]interface{}) + if ppsd.InstanceType != "" { + objectMap["instanceType"] = ppsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return &ppsd, true +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &ppsd, true +} + +// BasicPolicyProviderSpecificInput base class for provider specific input. +type BasicPolicyProviderSpecificInput interface { + AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) + AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) + AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) + AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) + AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) + AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) + AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) + AsInMagePolicyInput() (*InMagePolicyInput, bool) + AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) + AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) + AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) + AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) +} + +// PolicyProviderSpecificInput base class for provider specific input. +type PolicyProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicPolicyProviderSpecificInput(body []byte) (BasicPolicyProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmpci A2ACrossClusterMigrationPolicyCreationInput + err := json.Unmarshal(body, &accmpci) + return accmpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A): + var apci A2APolicyCreationInput + err := json.Unmarshal(body, &apci) + return apci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvrapi HyperVReplicaAzurePolicyInput + err := json.Unmarshal(body, &hvrapi) + return hvrapi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2): + var hvrbpi HyperVReplicaBluePolicyInput + err := json.Unmarshal(body, &hvrbpi) + return hvrbpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012): + var hvrpi HyperVReplicaPolicyInput + err := json.Unmarshal(body, &hvrpi) + return hvrpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2): + var imavpi InMageAzureV2PolicyInput + err := json.Unmarshal(body, &imavpi) + return imavpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage): + var impi InMagePolicyInput + err := json.Unmarshal(body, &impi) + return impi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback): + var imrfpci InMageRcmFailbackPolicyCreationInput + err := json.Unmarshal(body, &imrfpci) + return imrfpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm): + var imrpci InMageRcmPolicyCreationInput + err := json.Unmarshal(body, &imrpci) + return imrpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt): + var vmcpci VMwareCbtPolicyCreationInput + err := json.Unmarshal(body, &vmcpci) + return vmcpci, err + default: + var ppsi PolicyProviderSpecificInput + err := json.Unmarshal(body, &ppsi) + return ppsi, err + } +} +func unmarshalBasicPolicyProviderSpecificInputArray(body []byte) ([]BasicPolicyProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppsiArray := make([]BasicPolicyProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppsi, err := unmarshalBasicPolicyProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + ppsiArray[index] = ppsi + } + return ppsiArray, nil +} + +// MarshalJSON is the custom marshaler for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) MarshalJSON() ([]byte, error) { + ppsi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput + objectMap := make(map[string]interface{}) + if ppsi.InstanceType != "" { + objectMap["instanceType"] = ppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return &ppsi, true +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &ppsi, true +} + +// ProcessServer details of the Process Server. +type ProcessServer struct { + // FriendlyName - The Process Server's friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ID - The Process Server Id. + ID *string `json:"id,omitempty"` + // IPAddress - The IP address of the server. + IPAddress *string `json:"ipAddress,omitempty"` + // OsType - The OS type of the server. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The version of the scout component on the server. + AgentVersion *string `json:"agentVersion,omitempty"` + // LastHeartbeat - The last heartbeat received from the server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // MobilityServiceUpdates - The list of the mobility service updates available on the Process Server. + MobilityServiceUpdates *[]MobilityServiceUpdate `json:"mobilityServiceUpdates,omitempty"` + // HostID - The agent generated Id. + HostID *string `json:"hostId,omitempty"` + // MachineCount - The servers configured with this PS. + MachineCount *string `json:"machineCount,omitempty"` + // ReplicationPairCount - The number of replication pairs configured in this PS. + ReplicationPairCount *string `json:"replicationPairCount,omitempty"` + // SystemLoad - The percentage of the system load. + SystemLoad *string `json:"systemLoad,omitempty"` + // SystemLoadStatus - The system load status. + SystemLoadStatus *string `json:"systemLoadStatus,omitempty"` + // CPULoad - The percentage of the CPU load. + CPULoad *string `json:"cpuLoad,omitempty"` + // CPULoadStatus - The CPU load status. + CPULoadStatus *string `json:"cpuLoadStatus,omitempty"` + // TotalMemoryInBytes - The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // MemoryUsageStatus - The memory usage status. + MemoryUsageStatus *string `json:"memoryUsageStatus,omitempty"` + // TotalSpaceInBytes - The total space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - The available space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // SpaceUsageStatus - The space usage status. + SpaceUsageStatus *string `json:"spaceUsageStatus,omitempty"` + // PsServiceStatus - The PS service status. + PsServiceStatus *string `json:"psServiceStatus,omitempty"` + // SslCertExpiryDate - The PS SSL cert expiry date. + SslCertExpiryDate *date.Time `json:"sslCertExpiryDate,omitempty"` + // SslCertExpiryRemainingDays - CS SSL cert expiry date. + SslCertExpiryRemainingDays *int32 `json:"sslCertExpiryRemainingDays,omitempty"` + // OsVersion - OS Version of the process server. Note: This will get populated if user has CS version greater than 9.12.0.0. + OsVersion *string `json:"osVersion,omitempty"` + // HealthErrors - Health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // AgentVersionDetails - The agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // Health - READ-ONLY; The health of Process Server. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // PsStatsRefreshTime - READ-ONLY; The process server stats refresh time. + PsStatsRefreshTime *date.Time `json:"psStatsRefreshTime,omitempty"` + // ThroughputUploadPendingDataInBytes - READ-ONLY; The uploading pending data in bytes. + ThroughputUploadPendingDataInBytes *int64 `json:"throughputUploadPendingDataInBytes,omitempty"` + // ThroughputInMBps - READ-ONLY; The throughput in MBps. + ThroughputInMBps *int64 `json:"throughputInMBps,omitempty"` + // ThroughputInBytes - READ-ONLY; The throughput in bytes. + ThroughputInBytes *int64 `json:"throughputInBytes,omitempty"` + // ThroughputStatus - READ-ONLY; The throughput status. + ThroughputStatus *string `json:"throughputStatus,omitempty"` + // MarsCommunicationStatus - READ-ONLY; The MARS communication status. + MarsCommunicationStatus *string `json:"marsCommunicationStatus,omitempty"` + // MarsRegistrationStatus - READ-ONLY; The MARS registration status. + MarsRegistrationStatus *string `json:"marsRegistrationStatus,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessServer. +func (ps ProcessServer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ps.FriendlyName != nil { + objectMap["friendlyName"] = ps.FriendlyName + } + if ps.ID != nil { + objectMap["id"] = ps.ID + } + if ps.IPAddress != nil { + objectMap["ipAddress"] = ps.IPAddress + } + if ps.OsType != nil { + objectMap["osType"] = ps.OsType + } + if ps.AgentVersion != nil { + objectMap["agentVersion"] = ps.AgentVersion + } + if ps.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = ps.LastHeartbeat + } + if ps.VersionStatus != nil { + objectMap["versionStatus"] = ps.VersionStatus + } + if ps.MobilityServiceUpdates != nil { + objectMap["mobilityServiceUpdates"] = ps.MobilityServiceUpdates + } + if ps.HostID != nil { + objectMap["hostId"] = ps.HostID + } + if ps.MachineCount != nil { + objectMap["machineCount"] = ps.MachineCount + } + if ps.ReplicationPairCount != nil { + objectMap["replicationPairCount"] = ps.ReplicationPairCount + } + if ps.SystemLoad != nil { + objectMap["systemLoad"] = ps.SystemLoad + } + if ps.SystemLoadStatus != nil { + objectMap["systemLoadStatus"] = ps.SystemLoadStatus + } + if ps.CPULoad != nil { + objectMap["cpuLoad"] = ps.CPULoad + } + if ps.CPULoadStatus != nil { + objectMap["cpuLoadStatus"] = ps.CPULoadStatus + } + if ps.TotalMemoryInBytes != nil { + objectMap["totalMemoryInBytes"] = ps.TotalMemoryInBytes + } + if ps.AvailableMemoryInBytes != nil { + objectMap["availableMemoryInBytes"] = ps.AvailableMemoryInBytes + } + if ps.MemoryUsageStatus != nil { + objectMap["memoryUsageStatus"] = ps.MemoryUsageStatus + } + if ps.TotalSpaceInBytes != nil { + objectMap["totalSpaceInBytes"] = ps.TotalSpaceInBytes + } + if ps.AvailableSpaceInBytes != nil { + objectMap["availableSpaceInBytes"] = ps.AvailableSpaceInBytes + } + if ps.SpaceUsageStatus != nil { + objectMap["spaceUsageStatus"] = ps.SpaceUsageStatus + } + if ps.PsServiceStatus != nil { + objectMap["psServiceStatus"] = ps.PsServiceStatus + } + if ps.SslCertExpiryDate != nil { + objectMap["sslCertExpiryDate"] = ps.SslCertExpiryDate + } + if ps.SslCertExpiryRemainingDays != nil { + objectMap["sslCertExpiryRemainingDays"] = ps.SslCertExpiryRemainingDays + } + if ps.OsVersion != nil { + objectMap["osVersion"] = ps.OsVersion + } + if ps.HealthErrors != nil { + objectMap["healthErrors"] = ps.HealthErrors + } + if ps.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = ps.AgentExpiryDate + } + if ps.AgentVersionDetails != nil { + objectMap["agentVersionDetails"] = ps.AgentVersionDetails + } + return json.Marshal(objectMap) +} + +// ProcessServerDetails process server details. +type ProcessServerDetails struct { + // ID - READ-ONLY; The process server Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The process server name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The process server Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The process server Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // IPAddresses - READ-ONLY; The list of IP addresses for communicating with the RCM component. + IPAddresses *[]string `json:"ipAddresses,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the process server. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // TotalMemoryInBytes - READ-ONLY; The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - READ-ONLY; The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // UsedMemoryInBytes - READ-ONLY; The used memory. + UsedMemoryInBytes *int64 `json:"usedMemoryInBytes,omitempty"` + // MemoryUsagePercentage - READ-ONLY; The memory usage percentage. + MemoryUsagePercentage *float64 `json:"memoryUsagePercentage,omitempty"` + // TotalSpaceInBytes - READ-ONLY; The total disk space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - READ-ONLY; The available disk space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // UsedSpaceInBytes - READ-ONLY; The used disk space. + UsedSpaceInBytes *int64 `json:"usedSpaceInBytes,omitempty"` + // FreeSpacePercentage - READ-ONLY; The free disk space percentage. + FreeSpacePercentage *float64 `json:"freeSpacePercentage,omitempty"` + // ThroughputUploadPendingDataInBytes - READ-ONLY; The uploading pending data in bytes. + ThroughputUploadPendingDataInBytes *int64 `json:"throughputUploadPendingDataInBytes,omitempty"` + // ThroughputInBytes - READ-ONLY; The throughput in bytes. + ThroughputInBytes *int64 `json:"throughputInBytes,omitempty"` + // ProcessorUsagePercentage - READ-ONLY; The processor usage percentage. + ProcessorUsagePercentage *float64 `json:"processorUsagePercentage,omitempty"` + // ThroughputStatus - READ-ONLY; The throughput status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + ThroughputStatus RcmComponentStatus `json:"throughputStatus,omitempty"` + // SystemLoad - READ-ONLY; The system load. + SystemLoad *int64 `json:"systemLoad,omitempty"` + // SystemLoadStatus - READ-ONLY; The system load status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + SystemLoadStatus RcmComponentStatus `json:"systemLoadStatus,omitempty"` + // DiskUsageStatus - READ-ONLY; The disk usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + DiskUsageStatus RcmComponentStatus `json:"diskUsageStatus,omitempty"` + // MemoryUsageStatus - READ-ONLY; The memory usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + MemoryUsageStatus RcmComponentStatus `json:"memoryUsageStatus,omitempty"` + // ProcessorUsageStatus - READ-ONLY; The processor usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + ProcessorUsageStatus RcmComponentStatus `json:"processorUsageStatus,omitempty"` + // Health - READ-ONLY; The health of the process server. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // ProtectedItemCount - READ-ONLY; The protected item count. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // HistoricHealth - READ-ONLY; The historic health of the process server based on the health in last 24 hours. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + HistoricHealth ProtectionHealth `json:"historicHealth,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessServerDetails. +func (psd ProcessServerDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ProtectableItem replication protected item. +type ProtectableItem struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectableItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectableItem. +func (pi ProtectableItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pi.Properties != nil { + objectMap["properties"] = pi.Properties + } + if pi.Location != nil { + objectMap["location"] = pi.Location + } + return json.Marshal(objectMap) +} + +// ProtectableItemCollection protectable item collection. +type ProtectableItemCollection struct { + autorest.Response `json:"-"` + // Value - The Protectable item details. + Value *[]ProtectableItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectableItemCollectionIterator provides access to a complete listing of ProtectableItem values. +type ProtectableItemCollectionIterator struct { + i int + page ProtectableItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectableItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectableItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectableItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectableItemCollectionIterator) Response() ProtectableItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectableItemCollectionIterator) Value() ProtectableItem { + if !iter.page.NotDone() { + return ProtectableItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectableItemCollectionIterator type. +func NewProtectableItemCollectionIterator(page ProtectableItemCollectionPage) ProtectableItemCollectionIterator { + return ProtectableItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pic ProtectableItemCollection) IsEmpty() bool { + return pic.Value == nil || len(*pic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pic ProtectableItemCollection) hasNextLink() bool { + return pic.NextLink != nil && len(*pic.NextLink) != 0 +} + +// protectableItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pic ProtectableItemCollection) protectableItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pic.NextLink))) +} + +// ProtectableItemCollectionPage contains a page of ProtectableItem values. +type ProtectableItemCollectionPage struct { + fn func(context.Context, ProtectableItemCollection) (ProtectableItemCollection, error) + pic ProtectableItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectableItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pic) + if err != nil { + return err + } + page.pic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectableItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectableItemCollectionPage) NotDone() bool { + return !page.pic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectableItemCollectionPage) Response() ProtectableItemCollection { + return page.pic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectableItemCollectionPage) Values() []ProtectableItem { + if page.pic.IsEmpty() { + return nil + } + return *page.pic.Value +} + +// Creates a new instance of the ProtectableItemCollectionPage type. +func NewProtectableItemCollectionPage(cur ProtectableItemCollection, getNextPage func(context.Context, ProtectableItemCollection) (ProtectableItemCollection, error)) ProtectableItemCollectionPage { + return ProtectableItemCollectionPage{ + fn: getNextPage, + pic: cur, + } +} + +// ProtectableItemProperties replication protected item custom data details. +type ProtectableItemProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionStatus - The protection status. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ReplicationProtectedItemID - The ARM resource of protected items. + ReplicationProtectedItemID *string `json:"replicationProtectedItemId,omitempty"` + // RecoveryServicesProviderID - The recovery provider ARM Id. + RecoveryServicesProviderID *string `json:"recoveryServicesProviderId,omitempty"` + // ProtectionReadinessErrors - The Current protection readiness errors. + ProtectionReadinessErrors *[]string `json:"protectionReadinessErrors,omitempty"` + // SupportedReplicationProviders - The list of replication providers supported for the protectable item. + SupportedReplicationProviders *[]string `json:"supportedReplicationProviders,omitempty"` + // CustomDetails - The Replication provider custom settings. + CustomDetails BasicConfigurationSettings `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ProtectableItemProperties struct. +func (pip *ProtectableItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + pip.FriendlyName = &friendlyName + } + case "protectionStatus": + if v != nil { + var protectionStatus string + err = json.Unmarshal(*v, &protectionStatus) + if err != nil { + return err + } + pip.ProtectionStatus = &protectionStatus + } + case "replicationProtectedItemId": + if v != nil { + var replicationProtectedItemID string + err = json.Unmarshal(*v, &replicationProtectedItemID) + if err != nil { + return err + } + pip.ReplicationProtectedItemID = &replicationProtectedItemID + } + case "recoveryServicesProviderId": + if v != nil { + var recoveryServicesProviderID string + err = json.Unmarshal(*v, &recoveryServicesProviderID) + if err != nil { + return err + } + pip.RecoveryServicesProviderID = &recoveryServicesProviderID + } + case "protectionReadinessErrors": + if v != nil { + var protectionReadinessErrors []string + err = json.Unmarshal(*v, &protectionReadinessErrors) + if err != nil { + return err + } + pip.ProtectionReadinessErrors = &protectionReadinessErrors + } + case "supportedReplicationProviders": + if v != nil { + var supportedReplicationProviders []string + err = json.Unmarshal(*v, &supportedReplicationProviders) + if err != nil { + return err + } + pip.SupportedReplicationProviders = &supportedReplicationProviders + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicConfigurationSettings(*v) + if err != nil { + return err + } + pip.CustomDetails = customDetails + } + } + } + + return nil +} + +// ProtectableItemQueryParameter query parameter to enumerate Protectable items. +type ProtectableItemQueryParameter struct { + // State - State of the Protectable item query filter. + State *string `json:"state,omitempty"` +} + +// ProtectedItemsQueryParameter query parameter to enumerate protected items. +type ProtectedItemsQueryParameter struct { + // SourceFabricName - The source fabric name filter. + SourceFabricName *string `json:"sourceFabricName,omitempty"` + // RecoveryPlanName - The recovery plan filter. + RecoveryPlanName *string `json:"recoveryPlanName,omitempty"` + // SourceFabricLocation - The source fabric location filter. + SourceFabricLocation *string `json:"sourceFabricLocation,omitempty"` + // FabricObjectID - The fabric object Id filter. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // VCenterName - The vCenter name filter. + VCenterName *string `json:"vCenterName,omitempty"` + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` + // MultiVMGroupCreateOption - Whether Multi VM group is auto created or specified by user. Possible values include: 'AutoCreated', 'UserSpecified' + MultiVMGroupCreateOption MultiVMGroupCreateOption `json:"multiVmGroupCreateOption,omitempty"` + // ProcessServerID - The process server Id filter. + ProcessServerID *string `json:"processServerId,omitempty"` +} + +// ProtectionContainer protection container details. +type ProtectionContainer struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectionContainerProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainer. +func (pc ProtectionContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pc.Properties != nil { + objectMap["properties"] = pc.Properties + } + if pc.Location != nil { + objectMap["location"] = pc.Location + } + return json.Marshal(objectMap) +} + +// ProtectionContainerCollection protection Container collection. +type ProtectionContainerCollection struct { + autorest.Response `json:"-"` + // Value - The Protection Container details. + Value *[]ProtectionContainer `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectionContainerCollectionIterator provides access to a complete listing of ProtectionContainer +// values. +type ProtectionContainerCollectionIterator struct { + i int + page ProtectionContainerCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectionContainerCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionContainerCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionContainerCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectionContainerCollectionIterator) Response() ProtectionContainerCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectionContainerCollectionIterator) Value() ProtectionContainer { + if !iter.page.NotDone() { + return ProtectionContainer{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectionContainerCollectionIterator type. +func NewProtectionContainerCollectionIterator(page ProtectionContainerCollectionPage) ProtectionContainerCollectionIterator { + return ProtectionContainerCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcc ProtectionContainerCollection) IsEmpty() bool { + return pcc.Value == nil || len(*pcc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pcc ProtectionContainerCollection) hasNextLink() bool { + return pcc.NextLink != nil && len(*pcc.NextLink) != 0 +} + +// protectionContainerCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcc ProtectionContainerCollection) protectionContainerCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pcc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcc.NextLink))) +} + +// ProtectionContainerCollectionPage contains a page of ProtectionContainer values. +type ProtectionContainerCollectionPage struct { + fn func(context.Context, ProtectionContainerCollection) (ProtectionContainerCollection, error) + pcc ProtectionContainerCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectionContainerCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pcc) + if err != nil { + return err + } + page.pcc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionContainerCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionContainerCollectionPage) NotDone() bool { + return !page.pcc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionContainerCollectionPage) Response() ProtectionContainerCollection { + return page.pcc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionContainerCollectionPage) Values() []ProtectionContainer { + if page.pcc.IsEmpty() { + return nil + } + return *page.pcc.Value +} + +// Creates a new instance of the ProtectionContainerCollectionPage type. +func NewProtectionContainerCollectionPage(cur ProtectionContainerCollection, getNextPage func(context.Context, ProtectionContainerCollection) (ProtectionContainerCollection, error)) ProtectionContainerCollectionPage { + return ProtectionContainerCollectionPage{ + fn: getNextPage, + pcc: cur, + } +} + +// ProtectionContainerFabricSpecificDetails base class for fabric specific details of container. +type ProtectionContainerFabricSpecificDetails struct { + // InstanceType - READ-ONLY; Gets the class type. Overridden in derived classes. + InstanceType *string `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainerFabricSpecificDetails. +func (pcfsd ProtectionContainerFabricSpecificDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ProtectionContainerMapping protection container mapping object. +type ProtectionContainerMapping struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectionContainerMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainerMapping. +func (pcm ProtectionContainerMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pcm.Properties != nil { + objectMap["properties"] = pcm.Properties + } + if pcm.Location != nil { + objectMap["location"] = pcm.Location + } + return json.Marshal(objectMap) +} + +// ProtectionContainerMappingCollection protection container mapping collection class. +type ProtectionContainerMappingCollection struct { + autorest.Response `json:"-"` + // Value - List of container mappings. + Value *[]ProtectionContainerMapping `json:"value,omitempty"` + // NextLink - Link to fetch rest of the data. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectionContainerMappingCollectionIterator provides access to a complete listing of +// ProtectionContainerMapping values. +type ProtectionContainerMappingCollectionIterator struct { + i int + page ProtectionContainerMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectionContainerMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionContainerMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionContainerMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectionContainerMappingCollectionIterator) Response() ProtectionContainerMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectionContainerMappingCollectionIterator) Value() ProtectionContainerMapping { + if !iter.page.NotDone() { + return ProtectionContainerMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectionContainerMappingCollectionIterator type. +func NewProtectionContainerMappingCollectionIterator(page ProtectionContainerMappingCollectionPage) ProtectionContainerMappingCollectionIterator { + return ProtectionContainerMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcmc ProtectionContainerMappingCollection) IsEmpty() bool { + return pcmc.Value == nil || len(*pcmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pcmc ProtectionContainerMappingCollection) hasNextLink() bool { + return pcmc.NextLink != nil && len(*pcmc.NextLink) != 0 +} + +// protectionContainerMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcmc ProtectionContainerMappingCollection) protectionContainerMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pcmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcmc.NextLink))) +} + +// ProtectionContainerMappingCollectionPage contains a page of ProtectionContainerMapping values. +type ProtectionContainerMappingCollectionPage struct { + fn func(context.Context, ProtectionContainerMappingCollection) (ProtectionContainerMappingCollection, error) + pcmc ProtectionContainerMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectionContainerMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pcmc) + if err != nil { + return err + } + page.pcmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionContainerMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionContainerMappingCollectionPage) NotDone() bool { + return !page.pcmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionContainerMappingCollectionPage) Response() ProtectionContainerMappingCollection { + return page.pcmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionContainerMappingCollectionPage) Values() []ProtectionContainerMapping { + if page.pcmc.IsEmpty() { + return nil + } + return *page.pcmc.Value +} + +// Creates a new instance of the ProtectionContainerMappingCollectionPage type. +func NewProtectionContainerMappingCollectionPage(cur ProtectionContainerMappingCollection, getNextPage func(context.Context, ProtectionContainerMappingCollection) (ProtectionContainerMappingCollection, error)) ProtectionContainerMappingCollectionPage { + return ProtectionContainerMappingCollectionPage{ + fn: getNextPage, + pcmc: cur, + } +} + +// ProtectionContainerMappingProperties protection container mapping properties. +type ProtectionContainerMappingProperties struct { + // TargetProtectionContainerID - Paired protection container ARM ID. + TargetProtectionContainerID *string `json:"targetProtectionContainerId,omitempty"` + // TargetProtectionContainerFriendlyName - Friendly name of paired container. + TargetProtectionContainerFriendlyName *string `json:"targetProtectionContainerFriendlyName,omitempty"` + // ProviderSpecificDetails - Provider specific provider details. + ProviderSpecificDetails BasicProtectionContainerMappingProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` + // Health - Health of pairing. + Health *string `json:"health,omitempty"` + // HealthErrorDetails - Health error. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // PolicyID - Policy ARM Id. + PolicyID *string `json:"policyId,omitempty"` + // State - Association Status. + State *string `json:"state,omitempty"` + // SourceProtectionContainerFriendlyName - Friendly name of source protection container. + SourceProtectionContainerFriendlyName *string `json:"sourceProtectionContainerFriendlyName,omitempty"` + // SourceFabricFriendlyName - Friendly name of source fabric. + SourceFabricFriendlyName *string `json:"sourceFabricFriendlyName,omitempty"` + // TargetFabricFriendlyName - Friendly name of target fabric. + TargetFabricFriendlyName *string `json:"targetFabricFriendlyName,omitempty"` + // PolicyFriendlyName - Friendly name of replication policy. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ProtectionContainerMappingProperties struct. +func (pcmp *ProtectionContainerMappingProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetProtectionContainerId": + if v != nil { + var targetProtectionContainerID string + err = json.Unmarshal(*v, &targetProtectionContainerID) + if err != nil { + return err + } + pcmp.TargetProtectionContainerID = &targetProtectionContainerID + } + case "targetProtectionContainerFriendlyName": + if v != nil { + var targetProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &targetProtectionContainerFriendlyName) + if err != nil { + return err + } + pcmp.TargetProtectionContainerFriendlyName = &targetProtectionContainerFriendlyName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicProtectionContainerMappingProviderSpecificDetails(*v) + if err != nil { + return err + } + pcmp.ProviderSpecificDetails = providerSpecificDetails + } + case "health": + if v != nil { + var health string + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + pcmp.Health = &health + } + case "healthErrorDetails": + if v != nil { + var healthErrorDetails []HealthError + err = json.Unmarshal(*v, &healthErrorDetails) + if err != nil { + return err + } + pcmp.HealthErrorDetails = &healthErrorDetails + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + pcmp.PolicyID = &policyID + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + pcmp.State = &state + } + case "sourceProtectionContainerFriendlyName": + if v != nil { + var sourceProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &sourceProtectionContainerFriendlyName) + if err != nil { + return err + } + pcmp.SourceProtectionContainerFriendlyName = &sourceProtectionContainerFriendlyName + } + case "sourceFabricFriendlyName": + if v != nil { + var sourceFabricFriendlyName string + err = json.Unmarshal(*v, &sourceFabricFriendlyName) + if err != nil { + return err + } + pcmp.SourceFabricFriendlyName = &sourceFabricFriendlyName + } + case "targetFabricFriendlyName": + if v != nil { + var targetFabricFriendlyName string + err = json.Unmarshal(*v, &targetFabricFriendlyName) + if err != nil { + return err + } + pcmp.TargetFabricFriendlyName = &targetFabricFriendlyName + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + pcmp.PolicyFriendlyName = &policyFriendlyName + } + } + } + + return nil +} + +// BasicProtectionContainerMappingProviderSpecificDetails container mapping provider specific details. +type BasicProtectionContainerMappingProviderSpecificDetails interface { + AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) + AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) + AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) + AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) +} + +// ProtectionContainerMappingProviderSpecificDetails container mapping provider specific details. +type ProtectionContainerMappingProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicProtectionContainerMappingProviderSpecificDetails(body []byte) (BasicProtectionContainerMappingProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A): + var apcmd A2AProtectionContainerMappingDetails + err := json.Unmarshal(body, &apcmd) + return apcmd, err + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm): + var imrpcmd InMageRcmProtectionContainerMappingDetails + err := json.Unmarshal(body, &imrpcmd) + return imrpcmd, err + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt): + var vmcpcmd VMwareCbtProtectionContainerMappingDetails + err := json.Unmarshal(body, &vmcpcmd) + return vmcpcmd, err + default: + var pcmpsd ProtectionContainerMappingProviderSpecificDetails + err := json.Unmarshal(body, &pcmpsd) + return pcmpsd, err + } +} +func unmarshalBasicProtectionContainerMappingProviderSpecificDetailsArray(body []byte) ([]BasicProtectionContainerMappingProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pcmpsdArray := make([]BasicProtectionContainerMappingProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pcmpsd, err := unmarshalBasicProtectionContainerMappingProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + pcmpsdArray[index] = pcmpsd + } + return pcmpsdArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) MarshalJSON() ([]byte, error) { + pcmpsd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails + objectMap := make(map[string]interface{}) + if pcmpsd.InstanceType != "" { + objectMap["instanceType"] = pcmpsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return &pcmpsd, true +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &pcmpsd, true +} + +// ProtectionContainerProperties protection profile custom data details. +type ProtectionContainerProperties struct { + // FabricFriendlyName - Fabric friendly name. + FabricFriendlyName *string `json:"fabricFriendlyName,omitempty"` + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // FabricType - The fabric type. + FabricType *string `json:"fabricType,omitempty"` + // ProtectedItemCount - Number of protected PEs. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // PairingStatus - The pairing status of this cloud. + PairingStatus *string `json:"pairingStatus,omitempty"` + // Role - The role of this cloud. + Role *string `json:"role,omitempty"` + // FabricSpecificDetails - Fabric specific details. + FabricSpecificDetails *ProtectionContainerFabricSpecificDetails `json:"fabricSpecificDetails,omitempty"` +} + +// BasicProtectionProfileCustomDetails protection Profile custom input. +type BasicProtectionProfileCustomDetails interface { + AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) + AsNewProtectionProfile() (*NewProtectionProfile, bool) + AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) +} + +// ProtectionProfileCustomDetails protection Profile custom input. +type ProtectionProfileCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +func unmarshalBasicProtectionProfileCustomDetails(body []byte) (BasicProtectionProfileCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeExisting): + var epp ExistingProtectionProfile + err := json.Unmarshal(body, &epp) + return epp, err + case string(ResourceTypeNew): + var npp NewProtectionProfile + err := json.Unmarshal(body, &npp) + return npp, err + default: + var ppcd ProtectionProfileCustomDetails + err := json.Unmarshal(body, &ppcd) + return ppcd, err + } +} +func unmarshalBasicProtectionProfileCustomDetailsArray(body []byte) ([]BasicProtectionProfileCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppcdArray := make([]BasicProtectionProfileCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppcd, err := unmarshalBasicProtectionProfileCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + ppcdArray[index] = ppcd + } + return ppcdArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) MarshalJSON() ([]byte, error) { + ppcd.ResourceType = ResourceTypeProtectionProfileCustomDetails + objectMap := make(map[string]interface{}) + if ppcd.ResourceType != "" { + objectMap["resourceType"] = ppcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return nil, false +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return nil, false +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return &ppcd, true +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &ppcd, true +} + +// ProviderError this class contains the error details per object. +type ProviderError struct { + // ErrorCode - The Error code. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorMessage - The Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // ErrorID - The Provider error Id. + ErrorID *string `json:"errorId,omitempty"` + // PossibleCauses - The possible causes for the error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - The recommended action to resolve the error. + RecommendedAction *string `json:"recommendedAction,omitempty"` +} + +// BasicProviderSpecificRecoveryPointDetails replication provider specific recovery point details. +type BasicProviderSpecificRecoveryPointDetails interface { + AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) + AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) + AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) + AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) +} + +// ProviderSpecificRecoveryPointDetails replication provider specific recovery point details. +type ProviderSpecificRecoveryPointDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicProviderSpecificRecoveryPointDetails(body []byte) (BasicProviderSpecificRecoveryPointDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A): + var arpd A2ARecoveryPointDetails + err := json.Unmarshal(body, &arpd) + return arpd, err + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2): + var imavrpd InMageAzureV2RecoveryPointDetails + err := json.Unmarshal(body, &imavrpd) + return imavrpd, err + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm): + var imrrpd InMageRcmRecoveryPointDetails + err := json.Unmarshal(body, &imrrpd) + return imrrpd, err + default: + var psrpd ProviderSpecificRecoveryPointDetails + err := json.Unmarshal(body, &psrpd) + return psrpd, err + } +} +func unmarshalBasicProviderSpecificRecoveryPointDetailsArray(body []byte) ([]BasicProviderSpecificRecoveryPointDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + psrpdArray := make([]BasicProviderSpecificRecoveryPointDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + psrpd, err := unmarshalBasicProviderSpecificRecoveryPointDetails(*rawMessage) + if err != nil { + return nil, err + } + psrpdArray[index] = psrpd + } + return psrpdArray, nil +} + +// MarshalJSON is the custom marshaler for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) MarshalJSON() ([]byte, error) { + psrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails + objectMap := make(map[string]interface{}) + if psrpd.InstanceType != "" { + objectMap["instanceType"] = psrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return &psrpd, true +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &psrpd, true +} + +// PushInstallerDetails push installer details. +type PushInstallerDetails struct { + // ID - READ-ONLY; The push installer Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The push installer name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The push installer Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The push installer Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the push installer. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the push installer. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for PushInstallerDetails. +func (pid PushInstallerDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RcmProxyDetails RCM proxy details. +type RcmProxyDetails struct { + // ID - READ-ONLY; The RCM proxy Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The RCM proxy name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The RCM proxy Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The RCM proxy Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // ClientAuthenticationType - READ-ONLY; The client authentication type. + ClientAuthenticationType *string `json:"clientAuthenticationType,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the RCM proxy. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the RCM proxy. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for RcmProxyDetails. +func (rpd RcmProxyDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// BasicRecoveryAvailabilitySetCustomDetails recovery Availability Set custom input. +type BasicRecoveryAvailabilitySetCustomDetails interface { + AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) + AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) +} + +// RecoveryAvailabilitySetCustomDetails recovery Availability Set custom input. +type RecoveryAvailabilitySetCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails', 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryAvailabilitySetCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryAvailabilitySetCustomDetails(body []byte) (BasicRecoveryAvailabilitySetCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting): + var eras ExistingRecoveryAvailabilitySet + err := json.Unmarshal(body, &eras) + return eras, err + default: + var rascd RecoveryAvailabilitySetCustomDetails + err := json.Unmarshal(body, &rascd) + return rascd, err + } +} +func unmarshalBasicRecoveryAvailabilitySetCustomDetailsArray(body []byte) ([]BasicRecoveryAvailabilitySetCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rascdArray := make([]BasicRecoveryAvailabilitySetCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rascd, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rascdArray[index] = rascd + } + return rascdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) MarshalJSON() ([]byte, error) { + rascd.ResourceType = ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails + objectMap := make(map[string]interface{}) + if rascd.ResourceType != "" { + objectMap["resourceType"] = rascd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryAvailabilitySet is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) { + return nil, false +} + +// AsRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) { + return &rascd, true +} + +// AsBasicRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsBasicRecoveryAvailabilitySetCustomDetails() (BasicRecoveryAvailabilitySetCustomDetails, bool) { + return &rascd, true +} + +// RecoveryPlan recovery plan details. +type RecoveryPlan struct { + autorest.Response `json:"-"` + // Properties - The custom details. + Properties *RecoveryPlanProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlan. +func (rp RecoveryPlan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.Properties != nil { + objectMap["properties"] = rp.Properties + } + if rp.Location != nil { + objectMap["location"] = rp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryPlanA2ADetails recovery plan A2A specific details. +type RecoveryPlanA2ADetails struct { + // PrimaryZone - The primary zone. + PrimaryZone *string `json:"primaryZone,omitempty"` + // RecoveryZone - The recovery zone. + RecoveryZone *string `json:"recoveryZone,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails', 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) MarshalJSON() ([]byte, error) { + rpad.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpad.PrimaryZone != nil { + objectMap["primaryZone"] = rpad.PrimaryZone + } + if rpad.RecoveryZone != nil { + objectMap["recoveryZone"] = rpad.RecoveryZone + } + if rpad.InstanceType != "" { + objectMap["instanceType"] = rpad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2ADetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) { + return &rpad, true +} + +// AsRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsBasicRecoveryPlanProviderSpecificDetails() (BasicRecoveryPlanProviderSpecificDetails, bool) { + return &rpad, true +} + +// RecoveryPlanA2AFailoverInput recovery plan A2A failover input. +type RecoveryPlanA2AFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'Latest', 'LatestApplicationConsistent', 'LatestCrashConsistent', 'LatestProcessed' + RecoveryPointType A2ARpRecoveryPointType `json:"recoveryPointType,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for TFO or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // MultiVMSyncPointOption - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. Possible values include: 'UseMultiVMSyncRecoveryPoint', 'UsePerVMRecoveryPoint' + MultiVMSyncPointOption MultiVMSyncPointOption `json:"multiVmSyncPointOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) MarshalJSON() ([]byte, error) { + rpafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpafi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpafi.RecoveryPointType + } + if rpafi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = rpafi.CloudServiceCreationOption + } + if rpafi.MultiVMSyncPointOption != "" { + objectMap["multiVmSyncPointOption"] = rpafi.MultiVMSyncPointOption + } + if rpafi.InstanceType != "" { + objectMap["instanceType"] = rpafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return &rpafi, true +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpafi, true +} + +// RecoveryPlanA2AInput recovery plan A2A input. +type RecoveryPlanA2AInput struct { + // PrimaryZone - The primary zone. + PrimaryZone *string `json:"primaryZone,omitempty"` + // RecoveryZone - The recovery zone. + RecoveryZone *string `json:"recoveryZone,omitempty"` + // PrimaryExtendedLocation - The primary extended location. + PrimaryExtendedLocation *ExtendedLocation `json:"primaryExtendedLocation,omitempty"` + // RecoveryExtendedLocation - The recovery extended location. + RecoveryExtendedLocation *ExtendedLocation `json:"recoveryExtendedLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) MarshalJSON() ([]byte, error) { + rpai.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpai.PrimaryZone != nil { + objectMap["primaryZone"] = rpai.PrimaryZone + } + if rpai.RecoveryZone != nil { + objectMap["recoveryZone"] = rpai.RecoveryZone + } + if rpai.PrimaryExtendedLocation != nil { + objectMap["primaryExtendedLocation"] = rpai.PrimaryExtendedLocation + } + if rpai.RecoveryExtendedLocation != nil { + objectMap["recoveryExtendedLocation"] = rpai.RecoveryExtendedLocation + } + if rpai.InstanceType != "" { + objectMap["instanceType"] = rpai.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) { + return &rpai, true +} + +// AsRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsBasicRecoveryPlanProviderSpecificInput() (BasicRecoveryPlanProviderSpecificInput, bool) { + return &rpai, true +} + +// RecoveryPlanAction recovery plan action details. +type RecoveryPlanAction struct { + // ActionName - The action name. + ActionName *string `json:"actionName,omitempty"` + // FailoverTypes - The list of failover types. + FailoverTypes *[]ReplicationProtectedItemOperation `json:"failoverTypes,omitempty"` + // FailoverDirections - The list of failover directions. + FailoverDirections *[]PossibleOperationsDirections `json:"failoverDirections,omitempty"` + // CustomDetails - The custom details. + CustomDetails BasicRecoveryPlanActionDetails `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanAction struct. +func (rpa *RecoveryPlanAction) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "actionName": + if v != nil { + var actionName string + err = json.Unmarshal(*v, &actionName) + if err != nil { + return err + } + rpa.ActionName = &actionName + } + case "failoverTypes": + if v != nil { + var failoverTypes []ReplicationProtectedItemOperation + err = json.Unmarshal(*v, &failoverTypes) + if err != nil { + return err + } + rpa.FailoverTypes = &failoverTypes + } + case "failoverDirections": + if v != nil { + var failoverDirections []PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirections) + if err != nil { + return err + } + rpa.FailoverDirections = &failoverDirections + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicRecoveryPlanActionDetails(*v) + if err != nil { + return err + } + rpa.CustomDetails = customDetails + } + } + } + + return nil +} + +// BasicRecoveryPlanActionDetails recovery plan action custom details. +type BasicRecoveryPlanActionDetails interface { + AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) + AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) + AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) + AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) +} + +// RecoveryPlanActionDetails recovery plan action custom details. +type RecoveryPlanActionDetails struct { + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanActionDetails(body []byte) (BasicRecoveryPlanActionDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAutomationRunbookActionDetails): + var rparad RecoveryPlanAutomationRunbookActionDetails + err := json.Unmarshal(body, &rparad) + return rparad, err + case string(InstanceTypeManualActionDetails): + var rpmad RecoveryPlanManualActionDetails + err := json.Unmarshal(body, &rpmad) + return rpmad, err + case string(InstanceTypeScriptActionDetails): + var rpsad RecoveryPlanScriptActionDetails + err := json.Unmarshal(body, &rpsad) + return rpsad, err + default: + var rpad RecoveryPlanActionDetails + err := json.Unmarshal(body, &rpad) + return rpad, err + } +} +func unmarshalBasicRecoveryPlanActionDetailsArray(body []byte) ([]BasicRecoveryPlanActionDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpadArray := make([]BasicRecoveryPlanActionDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpad, err := unmarshalBasicRecoveryPlanActionDetails(*rawMessage) + if err != nil { + return nil, err + } + rpadArray[index] = rpad + } + return rpadArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) MarshalJSON() ([]byte, error) { + rpad.InstanceType = InstanceTypeRecoveryPlanActionDetails + objectMap := make(map[string]interface{}) + if rpad.InstanceType != "" { + objectMap["instanceType"] = rpad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return &rpad, true +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpad, true +} + +// RecoveryPlanAutomationRunbookActionDetails recovery plan Automation runbook action details. +type RecoveryPlanAutomationRunbookActionDetails struct { + // RunbookID - The runbook ARM Id. + RunbookID *string `json:"runbookId,omitempty"` + // Timeout - The runbook timeout. + Timeout *string `json:"timeout,omitempty"` + // FabricLocation - The fabric location. Possible values include: 'Primary', 'Recovery' + FabricLocation RecoveryPlanActionLocation `json:"fabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) MarshalJSON() ([]byte, error) { + rparad.InstanceType = InstanceTypeAutomationRunbookActionDetails + objectMap := make(map[string]interface{}) + if rparad.RunbookID != nil { + objectMap["runbookId"] = rparad.RunbookID + } + if rparad.Timeout != nil { + objectMap["timeout"] = rparad.Timeout + } + if rparad.FabricLocation != "" { + objectMap["fabricLocation"] = rparad.FabricLocation + } + if rparad.InstanceType != "" { + objectMap["instanceType"] = rparad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return &rparad, true +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rparad, true +} + +// RecoveryPlanCollection recovery plan collection details. +type RecoveryPlanCollection struct { + autorest.Response `json:"-"` + // Value - The list of recovery plans. + Value *[]RecoveryPlan `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryPlanCollectionIterator provides access to a complete listing of RecoveryPlan values. +type RecoveryPlanCollectionIterator struct { + i int + page RecoveryPlanCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryPlanCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPlanCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryPlanCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryPlanCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryPlanCollectionIterator) Response() RecoveryPlanCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryPlanCollectionIterator) Value() RecoveryPlan { + if !iter.page.NotDone() { + return RecoveryPlan{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryPlanCollectionIterator type. +func NewRecoveryPlanCollectionIterator(page RecoveryPlanCollectionPage) RecoveryPlanCollectionIterator { + return RecoveryPlanCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (RPCVar RecoveryPlanCollection) IsEmpty() bool { + return RPCVar.Value == nil || len(*RPCVar.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (RPCVar RecoveryPlanCollection) hasNextLink() bool { + return RPCVar.NextLink != nil && len(*RPCVar.NextLink) != 0 +} + +// recoveryPlanCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (RPCVar RecoveryPlanCollection) recoveryPlanCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !RPCVar.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(RPCVar.NextLink))) +} + +// RecoveryPlanCollectionPage contains a page of RecoveryPlan values. +type RecoveryPlanCollectionPage struct { + fn func(context.Context, RecoveryPlanCollection) (RecoveryPlanCollection, error) + RPCVar RecoveryPlanCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryPlanCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPlanCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.RPCVar) + if err != nil { + return err + } + page.RPCVar = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryPlanCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryPlanCollectionPage) NotDone() bool { + return !page.RPCVar.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryPlanCollectionPage) Response() RecoveryPlanCollection { + return page.RPCVar +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryPlanCollectionPage) Values() []RecoveryPlan { + if page.RPCVar.IsEmpty() { + return nil + } + return *page.RPCVar.Value +} + +// Creates a new instance of the RecoveryPlanCollectionPage type. +func NewRecoveryPlanCollectionPage(cur RecoveryPlanCollection, getNextPage func(context.Context, RecoveryPlanCollection) (RecoveryPlanCollection, error)) RecoveryPlanCollectionPage { + return RecoveryPlanCollectionPage{ + fn: getNextPage, + RPCVar: cur, + } +} + +// RecoveryPlanGroup recovery plan group details. +type RecoveryPlanGroup struct { + // GroupType - The group type. Possible values include: 'Shutdown', 'Boot', 'Failover' + GroupType RecoveryPlanGroupType `json:"groupType,omitempty"` + // ReplicationProtectedItems - The list of protected items. + ReplicationProtectedItems *[]RecoveryPlanProtectedItem `json:"replicationProtectedItems,omitempty"` + // StartGroupActions - The start group actions. + StartGroupActions *[]RecoveryPlanAction `json:"startGroupActions,omitempty"` + // EndGroupActions - The end group actions. + EndGroupActions *[]RecoveryPlanAction `json:"endGroupActions,omitempty"` +} + +// BasicRecoveryPlanGroupTaskDetails this class represents the recovery plan group task. +type BasicRecoveryPlanGroupTaskDetails interface { + AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) + AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) +} + +// RecoveryPlanGroupTaskDetails this class represents the recovery plan group task. +type RecoveryPlanGroupTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // GroupID - The group identifier. + GroupID *string `json:"groupId,omitempty"` + // RpGroupType - The group type. + RpGroupType *string `json:"rpGroupType,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanGroupTaskDetails(body []byte) (BasicRecoveryPlanGroupTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeRecoveryPlanShutdownGroupTaskDetails): + var rpsgtd RecoveryPlanShutdownGroupTaskDetails + err := json.Unmarshal(body, &rpsgtd) + return rpsgtd, err + default: + var rpgtd RecoveryPlanGroupTaskDetails + err := json.Unmarshal(body, &rpgtd) + return rpgtd, err + } +} +func unmarshalBasicRecoveryPlanGroupTaskDetailsArray(body []byte) ([]BasicRecoveryPlanGroupTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpgtdArray := make([]BasicRecoveryPlanGroupTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpgtd, err := unmarshalBasicRecoveryPlanGroupTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + rpgtdArray[index] = rpgtd + } + return rpgtdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) MarshalJSON() ([]byte, error) { + rpgtd.InstanceType = InstanceTypeRecoveryPlanGroupTaskDetails + objectMap := make(map[string]interface{}) + if rpgtd.Name != nil { + objectMap["name"] = rpgtd.Name + } + if rpgtd.GroupID != nil { + objectMap["groupId"] = rpgtd.GroupID + } + if rpgtd.RpGroupType != nil { + objectMap["rpGroupType"] = rpgtd.RpGroupType + } + if rpgtd.ChildTasks != nil { + objectMap["childTasks"] = rpgtd.ChildTasks + } + if rpgtd.InstanceType != "" { + objectMap["instanceType"] = rpgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return &rpgtd, true +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return &rpgtd, true +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &rpgtd, true +} + +// RecoveryPlanHyperVReplicaAzureFailbackInput recovery plan HVR Azure failback input. +type RecoveryPlanHyperVReplicaAzureFailbackInput struct { + // DataSyncOption - The data sync option. Possible values include: 'ForDownTime', 'ForSynchronization' + DataSyncOption DataSyncStatus `json:"dataSyncOption,omitempty"` + // RecoveryVMCreationOption - The ALR option. Possible values include: 'CreateVMIfNotFound', 'NoAction' + RecoveryVMCreationOption AlternateLocationRecoveryOption `json:"recoveryVmCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) MarshalJSON() ([]byte, error) { + rphvrafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback + objectMap := make(map[string]interface{}) + if rphvrafi.DataSyncOption != "" { + objectMap["dataSyncOption"] = rphvrafi.DataSyncOption + } + if rphvrafi.RecoveryVMCreationOption != "" { + objectMap["recoveryVmCreationOption"] = rphvrafi.RecoveryVMCreationOption + } + if rphvrafi.InstanceType != "" { + objectMap["instanceType"] = rphvrafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return &rphvrafi, true +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rphvrafi, true +} + +// RecoveryPlanHyperVReplicaAzureFailoverInput recovery plan HVR Azure failover input. +type RecoveryPlanHyperVReplicaAzureFailoverInput struct { + // PrimaryKekCertificatePfx - The primary KEK certificate PFX. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - The secondary KEK certificate PFX. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointType - The recovery point type. Possible values include: 'HyperVReplicaAzureRpRecoveryPointTypeLatest', 'HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent', 'HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed' + RecoveryPointType HyperVReplicaAzureRpRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) MarshalJSON() ([]byte, error) { + rphvrafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if rphvrafi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = rphvrafi.PrimaryKekCertificatePfx + } + if rphvrafi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = rphvrafi.SecondaryKekCertificatePfx + } + if rphvrafi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rphvrafi.RecoveryPointType + } + if rphvrafi.InstanceType != "" { + objectMap["instanceType"] = rphvrafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return &rphvrafi, true +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rphvrafi, true +} + +// RecoveryPlanInMageAzureV2FailoverInput recovery plan InMageAzureV2 failover input. +type RecoveryPlanInMageAzureV2FailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'InMageV2RpRecoveryPointTypeLatest', 'InMageV2RpRecoveryPointTypeLatestApplicationConsistent', 'InMageV2RpRecoveryPointTypeLatestCrashConsistent', 'InMageV2RpRecoveryPointTypeLatestProcessed' + RecoveryPointType InMageV2RpRecoveryPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) MarshalJSON() ([]byte, error) { + rpimavfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if rpimavfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimavfi.RecoveryPointType + } + if rpimavfi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimavfi.UseMultiVMSyncPoint + } + if rpimavfi.InstanceType != "" { + objectMap["instanceType"] = rpimavfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return &rpimavfi, true +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimavfi, true +} + +// RecoveryPlanInMageFailoverInput recovery plan InMage failover input. +type RecoveryPlanInMageFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'RpInMageRecoveryPointTypeLatestTime', 'RpInMageRecoveryPointTypeLatestTag', 'RpInMageRecoveryPointTypeCustom' + RecoveryPointType RpInMageRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) MarshalJSON() ([]byte, error) { + rpimfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if rpimfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimfi.RecoveryPointType + } + if rpimfi.InstanceType != "" { + objectMap["instanceType"] = rpimfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return &rpimfi, true +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimfi, true +} + +// RecoveryPlanInMageRcmFailbackFailoverInput recovery plan InMageRcmFailback failover input. +type RecoveryPlanInMageRcmFailbackFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'ApplicationConsistent', 'CrashConsistent' + RecoveryPointType InMageRcmFailbackRecoveryPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) MarshalJSON() ([]byte, error) { + rpimrffi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if rpimrffi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimrffi.RecoveryPointType + } + if rpimrffi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimrffi.UseMultiVMSyncPoint + } + if rpimrffi.InstanceType != "" { + objectMap["instanceType"] = rpimrffi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return &rpimrffi, true +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimrffi, true +} + +// RecoveryPlanInMageRcmFailoverInput recovery plan InMageRcm failover input. +type RecoveryPlanInMageRcmFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'RecoveryPlanPointTypeLatest', 'RecoveryPlanPointTypeLatestApplicationConsistent', 'RecoveryPlanPointTypeLatestCrashConsistent', 'RecoveryPlanPointTypeLatestProcessed' + RecoveryPointType RecoveryPlanPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) MarshalJSON() ([]byte, error) { + rpimrfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if rpimrfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimrfi.RecoveryPointType + } + if rpimrfi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimrfi.UseMultiVMSyncPoint + } + if rpimrfi.InstanceType != "" { + objectMap["instanceType"] = rpimrfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return &rpimrfi, true +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimrfi, true +} + +// RecoveryPlanManualActionDetails recovery plan manual action details. +type RecoveryPlanManualActionDetails struct { + // Description - The manual action description. + Description *string `json:"description,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) MarshalJSON() ([]byte, error) { + rpmad.InstanceType = InstanceTypeManualActionDetails + objectMap := make(map[string]interface{}) + if rpmad.Description != nil { + objectMap["description"] = rpmad.Description + } + if rpmad.InstanceType != "" { + objectMap["instanceType"] = rpmad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return &rpmad, true +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpmad, true +} + +// RecoveryPlanPlannedFailoverInput recovery plan planned failover input. +type RecoveryPlanPlannedFailoverInput struct { + // Properties - The recovery plan planned failover input properties. + Properties *RecoveryPlanPlannedFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanPlannedFailoverInputProperties recovery plan planned failover input properties. +type RecoveryPlanPlannedFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanPlannedFailoverInputProperties struct. +func (rppfip *RecoveryPlanPlannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rppfip.FailoverDirection = failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rppfip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanProperties recovery plan properties. +type RecoveryPlanProperties struct { + // FriendlyName - The friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // PrimaryFabricID - The primary fabric Id. + PrimaryFabricID *string `json:"primaryFabricId,omitempty"` + // PrimaryFabricFriendlyName - The primary fabric friendly name. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // RecoveryFabricID - The recovery fabric Id. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // RecoveryFabricFriendlyName - The recovery fabric friendly name. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // FailoverDeploymentModel - The failover deployment model. + FailoverDeploymentModel *string `json:"failoverDeploymentModel,omitempty"` + // ReplicationProviders - The list of replication providers. + ReplicationProviders *[]string `json:"replicationProviders,omitempty"` + // AllowedOperations - The list of allowed operations. + AllowedOperations *[]string `json:"allowedOperations,omitempty"` + // LastPlannedFailoverTime - The start time of the last planned failover. + LastPlannedFailoverTime *date.Time `json:"lastPlannedFailoverTime,omitempty"` + // LastUnplannedFailoverTime - The start time of the last unplanned failover. + LastUnplannedFailoverTime *date.Time `json:"lastUnplannedFailoverTime,omitempty"` + // LastTestFailoverTime - The start time of the last test failover. + LastTestFailoverTime *date.Time `json:"lastTestFailoverTime,omitempty"` + // CurrentScenario - The current scenario details. + CurrentScenario *CurrentScenarioDetails `json:"currentScenario,omitempty"` + // CurrentScenarioStatus - The recovery plan status. + CurrentScenarioStatus *string `json:"currentScenarioStatus,omitempty"` + // CurrentScenarioStatusDescription - The recovery plan status description. + CurrentScenarioStatusDescription *string `json:"currentScenarioStatusDescription,omitempty"` + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` + // ProviderSpecificDetails - The provider id and provider specific details. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanProperties struct. +func (rpp *RecoveryPlanProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpp.FriendlyName = &friendlyName + } + case "primaryFabricId": + if v != nil { + var primaryFabricID string + err = json.Unmarshal(*v, &primaryFabricID) + if err != nil { + return err + } + rpp.PrimaryFabricID = &primaryFabricID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + rpp.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + rpp.RecoveryFabricID = &recoveryFabricID + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + rpp.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "failoverDeploymentModel": + if v != nil { + var failoverDeploymentModel string + err = json.Unmarshal(*v, &failoverDeploymentModel) + if err != nil { + return err + } + rpp.FailoverDeploymentModel = &failoverDeploymentModel + } + case "replicationProviders": + if v != nil { + var replicationProviders []string + err = json.Unmarshal(*v, &replicationProviders) + if err != nil { + return err + } + rpp.ReplicationProviders = &replicationProviders + } + case "allowedOperations": + if v != nil { + var allowedOperations []string + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + rpp.AllowedOperations = &allowedOperations + } + case "lastPlannedFailoverTime": + if v != nil { + var lastPlannedFailoverTime date.Time + err = json.Unmarshal(*v, &lastPlannedFailoverTime) + if err != nil { + return err + } + rpp.LastPlannedFailoverTime = &lastPlannedFailoverTime + } + case "lastUnplannedFailoverTime": + if v != nil { + var lastUnplannedFailoverTime date.Time + err = json.Unmarshal(*v, &lastUnplannedFailoverTime) + if err != nil { + return err + } + rpp.LastUnplannedFailoverTime = &lastUnplannedFailoverTime + } + case "lastTestFailoverTime": + if v != nil { + var lastTestFailoverTime date.Time + err = json.Unmarshal(*v, &lastTestFailoverTime) + if err != nil { + return err + } + rpp.LastTestFailoverTime = &lastTestFailoverTime + } + case "currentScenario": + if v != nil { + var currentScenario CurrentScenarioDetails + err = json.Unmarshal(*v, ¤tScenario) + if err != nil { + return err + } + rpp.CurrentScenario = ¤tScenario + } + case "currentScenarioStatus": + if v != nil { + var currentScenarioStatus string + err = json.Unmarshal(*v, ¤tScenarioStatus) + if err != nil { + return err + } + rpp.CurrentScenarioStatus = ¤tScenarioStatus + } + case "currentScenarioStatusDescription": + if v != nil { + var currentScenarioStatusDescription string + err = json.Unmarshal(*v, ¤tScenarioStatusDescription) + if err != nil { + return err + } + rpp.CurrentScenarioStatusDescription = ¤tScenarioStatusDescription + } + case "groups": + if v != nil { + var groups []RecoveryPlanGroup + err = json.Unmarshal(*v, &groups) + if err != nil { + return err + } + rpp.Groups = &groups + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificDetailsArray(*v) + if err != nil { + return err + } + rpp.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanProtectedItem recovery plan protected item. +type RecoveryPlanProtectedItem struct { + // ID - The ARM Id of the recovery plan protected item. + ID *string `json:"id,omitempty"` + // VirtualMachineID - The virtual machine Id. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` +} + +// BasicRecoveryPlanProviderSpecificDetails recovery plan provider specific details. +type BasicRecoveryPlanProviderSpecificDetails interface { + AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) + AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) +} + +// RecoveryPlanProviderSpecificDetails recovery plan provider specific details. +type RecoveryPlanProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails', 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificDetails(body []byte) (BasicRecoveryPlanProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A): + var rpad RecoveryPlanA2ADetails + err := json.Unmarshal(body, &rpad) + return rpad, err + default: + var rppsd RecoveryPlanProviderSpecificDetails + err := json.Unmarshal(body, &rppsd) + return rppsd, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificDetailsArray(body []byte) ([]BasicRecoveryPlanProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsdArray := make([]BasicRecoveryPlanProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsd, err := unmarshalBasicRecoveryPlanProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + rppsdArray[index] = rppsd + } + return rppsdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) MarshalJSON() ([]byte, error) { + rppsd.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails + objectMap := make(map[string]interface{}) + if rppsd.InstanceType != "" { + objectMap["instanceType"] = rppsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2ADetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) { + return &rppsd, true +} + +// AsBasicRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsBasicRecoveryPlanProviderSpecificDetails() (BasicRecoveryPlanProviderSpecificDetails, bool) { + return &rppsd, true +} + +// BasicRecoveryPlanProviderSpecificFailoverInput recovery plan provider specific failover input. +type BasicRecoveryPlanProviderSpecificFailoverInput interface { + AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) + AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) + AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) + AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) + AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) + AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) + AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) + AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) +} + +// RecoveryPlanProviderSpecificFailoverInput recovery plan provider specific failover input. +type RecoveryPlanProviderSpecificFailoverInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificFailoverInput(body []byte) (BasicRecoveryPlanProviderSpecificFailoverInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A): + var rpafi RecoveryPlanA2AFailoverInput + err := json.Unmarshal(body, &rpafi) + return rpafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback): + var rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput + err := json.Unmarshal(body, &rphvrafi) + return rphvrafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure): + var rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput + err := json.Unmarshal(body, &rphvrafi) + return rphvrafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2): + var rpimavfi RecoveryPlanInMageAzureV2FailoverInput + err := json.Unmarshal(body, &rpimavfi) + return rpimavfi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage): + var rpimfi RecoveryPlanInMageFailoverInput + err := json.Unmarshal(body, &rpimfi) + return rpimfi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback): + var rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput + err := json.Unmarshal(body, &rpimrffi) + return rpimrffi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm): + var rpimrfi RecoveryPlanInMageRcmFailoverInput + err := json.Unmarshal(body, &rpimrfi) + return rpimrfi, err + default: + var rppsfi RecoveryPlanProviderSpecificFailoverInput + err := json.Unmarshal(body, &rppsfi) + return rppsfi, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(body []byte) ([]BasicRecoveryPlanProviderSpecificFailoverInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsfiArray := make([]BasicRecoveryPlanProviderSpecificFailoverInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsfi, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInput(*rawMessage) + if err != nil { + return nil, err + } + rppsfiArray[index] = rppsfi + } + return rppsfiArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) MarshalJSON() ([]byte, error) { + rppsfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput + objectMap := make(map[string]interface{}) + if rppsfi.InstanceType != "" { + objectMap["instanceType"] = rppsfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return &rppsfi, true +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rppsfi, true +} + +// BasicRecoveryPlanProviderSpecificInput recovery plan provider specific input base class. +type BasicRecoveryPlanProviderSpecificInput interface { + AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) + AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) +} + +// RecoveryPlanProviderSpecificInput recovery plan provider specific input base class. +type RecoveryPlanProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificInput(body []byte) (BasicRecoveryPlanProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A): + var rpai RecoveryPlanA2AInput + err := json.Unmarshal(body, &rpai) + return rpai, err + default: + var rppsi RecoveryPlanProviderSpecificInput + err := json.Unmarshal(body, &rppsi) + return rppsi, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificInputArray(body []byte) ([]BasicRecoveryPlanProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsiArray := make([]BasicRecoveryPlanProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsi, err := unmarshalBasicRecoveryPlanProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rppsiArray[index] = rppsi + } + return rppsiArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) MarshalJSON() ([]byte, error) { + rppsi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput + objectMap := make(map[string]interface{}) + if rppsi.InstanceType != "" { + objectMap["instanceType"] = rppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) { + return &rppsi, true +} + +// AsBasicRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsBasicRecoveryPlanProviderSpecificInput() (BasicRecoveryPlanProviderSpecificInput, bool) { + return &rppsi, true +} + +// RecoveryPlanScriptActionDetails recovery plan script action details. +type RecoveryPlanScriptActionDetails struct { + // Path - The script path. + Path *string `json:"path,omitempty"` + // Timeout - The script timeout. + Timeout *string `json:"timeout,omitempty"` + // FabricLocation - The fabric location. Possible values include: 'Primary', 'Recovery' + FabricLocation RecoveryPlanActionLocation `json:"fabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) MarshalJSON() ([]byte, error) { + rpsad.InstanceType = InstanceTypeScriptActionDetails + objectMap := make(map[string]interface{}) + if rpsad.Path != nil { + objectMap["path"] = rpsad.Path + } + if rpsad.Timeout != nil { + objectMap["timeout"] = rpsad.Timeout + } + if rpsad.FabricLocation != "" { + objectMap["fabricLocation"] = rpsad.FabricLocation + } + if rpsad.InstanceType != "" { + objectMap["instanceType"] = rpsad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return &rpsad, true +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpsad, true +} + +// RecoveryPlanShutdownGroupTaskDetails this class represents the recovery plan shutdown group task +// details. +type RecoveryPlanShutdownGroupTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // GroupID - The group identifier. + GroupID *string `json:"groupId,omitempty"` + // RpGroupType - The group type. + RpGroupType *string `json:"rpGroupType,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) MarshalJSON() ([]byte, error) { + rpsgtd.InstanceType = InstanceTypeRecoveryPlanShutdownGroupTaskDetails + objectMap := make(map[string]interface{}) + if rpsgtd.Name != nil { + objectMap["name"] = rpsgtd.Name + } + if rpsgtd.GroupID != nil { + objectMap["groupId"] = rpsgtd.GroupID + } + if rpsgtd.RpGroupType != nil { + objectMap["rpGroupType"] = rpsgtd.RpGroupType + } + if rpsgtd.ChildTasks != nil { + objectMap["childTasks"] = rpsgtd.ChildTasks + } + if rpsgtd.InstanceType != "" { + objectMap["instanceType"] = rpsgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// RecoveryPlanTestFailoverCleanupInput recovery plan test failover cleanup input. +type RecoveryPlanTestFailoverCleanupInput struct { + // Properties - The recovery plan test failover cleanup input properties. + Properties *RecoveryPlanTestFailoverCleanupInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanTestFailoverCleanupInputProperties recovery plan test failover cleanup input properties. +type RecoveryPlanTestFailoverCleanupInputProperties struct { + // Comments - The test failover cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// RecoveryPlanTestFailoverInput recovery plan test failover input. +type RecoveryPlanTestFailoverInput struct { + // Properties - The recovery plan test failover input properties. + Properties *RecoveryPlanTestFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanTestFailoverInputProperties recovery plan test failover input properties. +type RecoveryPlanTestFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // NetworkType - The network type to be used for test failover. + NetworkType *string `json:"networkType,omitempty"` + // NetworkID - The Id of the network to be used for test failover. + NetworkID *string `json:"networkId,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanTestFailoverInputProperties struct. +func (rptfip *RecoveryPlanTestFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rptfip.FailoverDirection = failoverDirection + } + case "networkType": + if v != nil { + var networkType string + err = json.Unmarshal(*v, &networkType) + if err != nil { + return err + } + rptfip.NetworkType = &networkType + } + case "networkId": + if v != nil { + var networkID string + err = json.Unmarshal(*v, &networkID) + if err != nil { + return err + } + rptfip.NetworkID = &networkID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rptfip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanUnplannedFailoverInput recovery plan unplanned failover input. +type RecoveryPlanUnplannedFailoverInput struct { + // Properties - The recovery plan unplanned failover input properties. + Properties *RecoveryPlanUnplannedFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanUnplannedFailoverInputProperties recovery plan unplanned failover input properties. +type RecoveryPlanUnplannedFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // SourceSiteOperations - A value indicating whether source site operations are required. Possible values include: 'Required', 'NotRequired' + SourceSiteOperations SourceSiteOperations `json:"sourceSiteOperations,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanUnplannedFailoverInputProperties struct. +func (rpufip *RecoveryPlanUnplannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rpufip.FailoverDirection = failoverDirection + } + case "sourceSiteOperations": + if v != nil { + var sourceSiteOperations SourceSiteOperations + err = json.Unmarshal(*v, &sourceSiteOperations) + if err != nil { + return err + } + rpufip.SourceSiteOperations = sourceSiteOperations + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rpufip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPoint recovery point. +type RecoveryPoint struct { + autorest.Response `json:"-"` + // Properties - The recovery point properties. + Properties *RecoveryPointProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPoint. +func (rp RecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.Properties != nil { + objectMap["properties"] = rp.Properties + } + if rp.Location != nil { + objectMap["location"] = rp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryPointCollection collection of recovery point details. +type RecoveryPointCollection struct { + autorest.Response `json:"-"` + // Value - The recovery point details. + Value *[]RecoveryPoint `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryPointCollectionIterator provides access to a complete listing of RecoveryPoint values. +type RecoveryPointCollectionIterator struct { + i int + page RecoveryPointCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryPointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryPointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryPointCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryPointCollectionIterator) Response() RecoveryPointCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryPointCollectionIterator) Value() RecoveryPoint { + if !iter.page.NotDone() { + return RecoveryPoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryPointCollectionIterator type. +func NewRecoveryPointCollectionIterator(page RecoveryPointCollectionPage) RecoveryPointCollectionIterator { + return RecoveryPointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (RPCVar RecoveryPointCollection) IsEmpty() bool { + return RPCVar.Value == nil || len(*RPCVar.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (RPCVar RecoveryPointCollection) hasNextLink() bool { + return RPCVar.NextLink != nil && len(*RPCVar.NextLink) != 0 +} + +// recoveryPointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (RPCVar RecoveryPointCollection) recoveryPointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !RPCVar.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(RPCVar.NextLink))) +} + +// RecoveryPointCollectionPage contains a page of RecoveryPoint values. +type RecoveryPointCollectionPage struct { + fn func(context.Context, RecoveryPointCollection) (RecoveryPointCollection, error) + RPCVar RecoveryPointCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryPointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.RPCVar) + if err != nil { + return err + } + page.RPCVar = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryPointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryPointCollectionPage) NotDone() bool { + return !page.RPCVar.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryPointCollectionPage) Response() RecoveryPointCollection { + return page.RPCVar +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryPointCollectionPage) Values() []RecoveryPoint { + if page.RPCVar.IsEmpty() { + return nil + } + return *page.RPCVar.Value +} + +// Creates a new instance of the RecoveryPointCollectionPage type. +func NewRecoveryPointCollectionPage(cur RecoveryPointCollection, getNextPage func(context.Context, RecoveryPointCollection) (RecoveryPointCollection, error)) RecoveryPointCollectionPage { + return RecoveryPointCollectionPage{ + fn: getNextPage, + RPCVar: cur, + } +} + +// RecoveryPointProperties recovery point properties. +type RecoveryPointProperties struct { + // RecoveryPointTime - The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointType - The recovery point type: ApplicationConsistent, CrashConsistent. + RecoveryPointType *string `json:"recoveryPointType,omitempty"` + // ProviderSpecificDetails - The provider specific details for the recovery point. + ProviderSpecificDetails BasicProviderSpecificRecoveryPointDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPointProperties struct. +func (rpp *RecoveryPointProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryPointTime": + if v != nil { + var recoveryPointTime date.Time + err = json.Unmarshal(*v, &recoveryPointTime) + if err != nil { + return err + } + rpp.RecoveryPointTime = &recoveryPointTime + } + case "recoveryPointType": + if v != nil { + var recoveryPointType string + err = json.Unmarshal(*v, &recoveryPointType) + if err != nil { + return err + } + rpp.RecoveryPointType = &recoveryPointType + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicProviderSpecificRecoveryPointDetails(*v) + if err != nil { + return err + } + rpp.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicRecoveryProximityPlacementGroupCustomDetails recovery Proximity placement group custom input. +type BasicRecoveryProximityPlacementGroupCustomDetails interface { + AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) + AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) +} + +// RecoveryProximityPlacementGroupCustomDetails recovery Proximity placement group custom input. +type RecoveryProximityPlacementGroupCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails', 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(body []byte) (BasicRecoveryProximityPlacementGroupCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting): + var erppg ExistingRecoveryProximityPlacementGroup + err := json.Unmarshal(body, &erppg) + return erppg, err + default: + var rppgcd RecoveryProximityPlacementGroupCustomDetails + err := json.Unmarshal(body, &rppgcd) + return rppgcd, err + } +} +func unmarshalBasicRecoveryProximityPlacementGroupCustomDetailsArray(body []byte) ([]BasicRecoveryProximityPlacementGroupCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppgcdArray := make([]BasicRecoveryProximityPlacementGroupCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppgcd, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rppgcdArray[index] = rppgcd + } + return rppgcdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) MarshalJSON() ([]byte, error) { + rppgcd.ResourceType = ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails + objectMap := make(map[string]interface{}) + if rppgcd.ResourceType != "" { + objectMap["resourceType"] = rppgcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryProximityPlacementGroup is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) { + return nil, false +} + +// AsRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) { + return &rppgcd, true +} + +// AsBasicRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsBasicRecoveryProximityPlacementGroupCustomDetails() (BasicRecoveryProximityPlacementGroupCustomDetails, bool) { + return &rppgcd, true +} + +// BasicRecoveryResourceGroupCustomDetails recovery Resource Group custom input. +type BasicRecoveryResourceGroupCustomDetails interface { + AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) + AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) +} + +// RecoveryResourceGroupCustomDetails recovery Resource Group custom input. +type RecoveryResourceGroupCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails', 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryResourceGroupCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryResourceGroupCustomDetails(body []byte) (BasicRecoveryResourceGroupCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting): + var errrg ExistingRecoveryRecoveryResourceGroup + err := json.Unmarshal(body, &errrg) + return errrg, err + default: + var rrgcd RecoveryResourceGroupCustomDetails + err := json.Unmarshal(body, &rrgcd) + return rrgcd, err + } +} +func unmarshalBasicRecoveryResourceGroupCustomDetailsArray(body []byte) ([]BasicRecoveryResourceGroupCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rrgcdArray := make([]BasicRecoveryResourceGroupCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rrgcd, err := unmarshalBasicRecoveryResourceGroupCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rrgcdArray[index] = rrgcd + } + return rrgcdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) MarshalJSON() ([]byte, error) { + rrgcd.ResourceType = ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails + objectMap := make(map[string]interface{}) + if rrgcd.ResourceType != "" { + objectMap["resourceType"] = rrgcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryRecoveryResourceGroup is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) { + return nil, false +} + +// AsRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) { + return &rrgcd, true +} + +// AsBasicRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsBasicRecoveryResourceGroupCustomDetails() (BasicRecoveryResourceGroupCustomDetails, bool) { + return &rrgcd, true +} + +// RecoveryServicesProvider provider details. +type RecoveryServicesProvider struct { + autorest.Response `json:"-"` + // Properties - Provider properties. + Properties *RecoveryServicesProviderProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryServicesProvider. +func (rsp RecoveryServicesProvider) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rsp.Properties != nil { + objectMap["properties"] = rsp.Properties + } + if rsp.Location != nil { + objectMap["location"] = rsp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryServicesProviderCollection collection of providers. +type RecoveryServicesProviderCollection struct { + autorest.Response `json:"-"` + // Value - The Servers details. + Value *[]RecoveryServicesProvider `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryServicesProviderCollectionIterator provides access to a complete listing of +// RecoveryServicesProvider values. +type RecoveryServicesProviderCollectionIterator struct { + i int + page RecoveryServicesProviderCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryServicesProviderCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryServicesProviderCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryServicesProviderCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryServicesProviderCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryServicesProviderCollectionIterator) Response() RecoveryServicesProviderCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryServicesProviderCollectionIterator) Value() RecoveryServicesProvider { + if !iter.page.NotDone() { + return RecoveryServicesProvider{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryServicesProviderCollectionIterator type. +func NewRecoveryServicesProviderCollectionIterator(page RecoveryServicesProviderCollectionPage) RecoveryServicesProviderCollectionIterator { + return RecoveryServicesProviderCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rspc RecoveryServicesProviderCollection) IsEmpty() bool { + return rspc.Value == nil || len(*rspc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rspc RecoveryServicesProviderCollection) hasNextLink() bool { + return rspc.NextLink != nil && len(*rspc.NextLink) != 0 +} + +// recoveryServicesProviderCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rspc RecoveryServicesProviderCollection) recoveryServicesProviderCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rspc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rspc.NextLink))) +} + +// RecoveryServicesProviderCollectionPage contains a page of RecoveryServicesProvider values. +type RecoveryServicesProviderCollectionPage struct { + fn func(context.Context, RecoveryServicesProviderCollection) (RecoveryServicesProviderCollection, error) + rspc RecoveryServicesProviderCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryServicesProviderCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryServicesProviderCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rspc) + if err != nil { + return err + } + page.rspc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryServicesProviderCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryServicesProviderCollectionPage) NotDone() bool { + return !page.rspc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryServicesProviderCollectionPage) Response() RecoveryServicesProviderCollection { + return page.rspc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryServicesProviderCollectionPage) Values() []RecoveryServicesProvider { + if page.rspc.IsEmpty() { + return nil + } + return *page.rspc.Value +} + +// Creates a new instance of the RecoveryServicesProviderCollectionPage type. +func NewRecoveryServicesProviderCollectionPage(cur RecoveryServicesProviderCollection, getNextPage func(context.Context, RecoveryServicesProviderCollection) (RecoveryServicesProviderCollection, error)) RecoveryServicesProviderCollectionPage { + return RecoveryServicesProviderCollectionPage{ + fn: getNextPage, + rspc: cur, + } +} + +// RecoveryServicesProviderProperties recovery services provider properties. +type RecoveryServicesProviderProperties struct { + // FabricType - Type of the site. + FabricType *string `json:"fabricType,omitempty"` + // FriendlyName - Friendly name of the DRA. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProviderVersion - The provider version. + ProviderVersion *string `json:"providerVersion,omitempty"` + // ServerVersion - The fabric provider. + ServerVersion *string `json:"serverVersion,omitempty"` + // ProviderVersionState - DRA version status. + ProviderVersionState *string `json:"providerVersionState,omitempty"` + // ProviderVersionExpiryDate - Expiry date of the version. + ProviderVersionExpiryDate *date.Time `json:"providerVersionExpiryDate,omitempty"` + // FabricFriendlyName - The fabric friendly name. + FabricFriendlyName *string `json:"fabricFriendlyName,omitempty"` + // LastHeartBeat - Time when last heartbeat was sent by the DRA. + LastHeartBeat *date.Time `json:"lastHeartBeat,omitempty"` + // ConnectionStatus - A value indicating whether DRA is responsive. + ConnectionStatus *string `json:"connectionStatus,omitempty"` + // ProtectedItemCount - Number of protected VMs currently managed by the DRA. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // AllowedScenarios - The scenarios allowed on this provider. + AllowedScenarios *[]string `json:"allowedScenarios,omitempty"` + // HealthErrorDetails - The recovery services provider health error details. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // DraIdentifier - The DRA Id. + DraIdentifier *string `json:"draIdentifier,omitempty"` + // MachineID - The machine Id. + MachineID *string `json:"machineId,omitempty"` + // MachineName - The machine name. + MachineName *string `json:"machineName,omitempty"` + // BiosID - The Bios Id. + BiosID *string `json:"biosId,omitempty"` + // AuthenticationIdentityDetails - The authentication identity details. + AuthenticationIdentityDetails *IdentityProviderDetails `json:"authenticationIdentityDetails,omitempty"` + // ResourceAccessIdentityDetails - The resource access identity details. + ResourceAccessIdentityDetails *IdentityProviderDetails `json:"resourceAccessIdentityDetails,omitempty"` + // DataPlaneAuthenticationIdentityDetails - The data plane authentication identity details. + DataPlaneAuthenticationIdentityDetails *IdentityProviderDetails `json:"dataPlaneAuthenticationIdentityDetails,omitempty"` + // ProviderVersionDetails - The provider version details. + ProviderVersionDetails *VersionDetails `json:"providerVersionDetails,omitempty"` +} + +// BasicRecoveryVirtualNetworkCustomDetails recovery Virtual network custom input. +type BasicRecoveryVirtualNetworkCustomDetails interface { + AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) + AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) + AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) +} + +// RecoveryVirtualNetworkCustomDetails recovery Virtual network custom input. +type RecoveryVirtualNetworkCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryVirtualNetworkCustomDetails(body []byte) (BasicRecoveryVirtualNetworkCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting): + var ervn ExistingRecoveryVirtualNetwork + err := json.Unmarshal(body, &ervn) + return ervn, err + case string(ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew): + var nrvn NewRecoveryVirtualNetwork + err := json.Unmarshal(body, &nrvn) + return nrvn, err + default: + var rvncd RecoveryVirtualNetworkCustomDetails + err := json.Unmarshal(body, &rvncd) + return rvncd, err + } +} +func unmarshalBasicRecoveryVirtualNetworkCustomDetailsArray(body []byte) ([]BasicRecoveryVirtualNetworkCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rvncdArray := make([]BasicRecoveryVirtualNetworkCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rvncd, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rvncdArray[index] = rvncd + } + return rvncdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) MarshalJSON() ([]byte, error) { + rvncd.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails + objectMap := make(map[string]interface{}) + if rvncd.ResourceType != "" { + objectMap["resourceType"] = rvncd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return &rvncd, true +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &rvncd, true +} + +// RemoveDisksInput input for remove disk(s) operation. +type RemoveDisksInput struct { + // Properties - Remove disk input properties. + Properties *RemoveDisksInputProperties `json:"properties,omitempty"` +} + +// RemoveDisksInputProperties remove Disk input properties. +type RemoveDisksInputProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicRemoveDisksProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RemoveDisksInputProperties struct. +func (rdip *RemoveDisksInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRemoveDisksProviderSpecificInput(*v) + if err != nil { + return err + } + rdip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicRemoveDisksProviderSpecificInput remove Disk provider specific input. +type BasicRemoveDisksProviderSpecificInput interface { + AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) + AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) +} + +// RemoveDisksProviderSpecificInput remove Disk provider specific input. +type RemoveDisksProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput', 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRemoveDisksProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRemoveDisksProviderSpecificInput(body []byte) (BasicRemoveDisksProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A): + var ardi A2ARemoveDisksInput + err := json.Unmarshal(body, &ardi) + return ardi, err + default: + var rdpsi RemoveDisksProviderSpecificInput + err := json.Unmarshal(body, &rdpsi) + return rdpsi, err + } +} +func unmarshalBasicRemoveDisksProviderSpecificInputArray(body []byte) ([]BasicRemoveDisksProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rdpsiArray := make([]BasicRemoveDisksProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rdpsi, err := unmarshalBasicRemoveDisksProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rdpsiArray[index] = rdpsi + } + return rdpsiArray, nil +} + +// MarshalJSON is the custom marshaler for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) MarshalJSON() ([]byte, error) { + rdpsi.InstanceType = InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput + objectMap := make(map[string]interface{}) + if rdpsi.InstanceType != "" { + objectMap["instanceType"] = rdpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARemoveDisksInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) { + return nil, false +} + +// AsRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) { + return &rdpsi, true +} + +// AsBasicRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsBasicRemoveDisksProviderSpecificInput() (BasicRemoveDisksProviderSpecificInput, bool) { + return &rdpsi, true +} + +// RemoveProtectionContainerMappingInput container unpairing input. +type RemoveProtectionContainerMappingInput struct { + // Properties - Configure protection input properties. + Properties *RemoveProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// RemoveProtectionContainerMappingInputProperties unpairing input properties. +type RemoveProtectionContainerMappingInputProperties struct { + // ProviderSpecificInput - Provider specific input for unpairing. + ProviderSpecificInput *ReplicationProviderContainerUnmappingInput `json:"providerSpecificInput,omitempty"` +} + +// RenewCertificateInput certificate renewal input. +type RenewCertificateInput struct { + // Properties - Renew certificate input properties. + Properties *RenewCertificateInputProperties `json:"properties,omitempty"` +} + +// RenewCertificateInputProperties renew Certificate input properties. +type RenewCertificateInputProperties struct { + // RenewCertificateType - Renew certificate type. + RenewCertificateType *string `json:"renewCertificateType,omitempty"` +} + +// ReplicationAgentDetails replication agent details. +type ReplicationAgentDetails struct { + // ID - READ-ONLY; The replication agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The replication agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The replication agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The replication agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the replication agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the replication agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationAgentDetails. +func (rad ReplicationAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ReplicationAppliance replication appliance definition. +type ReplicationAppliance struct { + // Properties - Appliance related data. + Properties *ReplicationApplianceProperties `json:"properties,omitempty"` +} + +// ReplicationApplianceProperties replication appliance properties. +type ReplicationApplianceProperties struct { + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicApplianceSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ReplicationApplianceProperties struct. +func (rap *ReplicationApplianceProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicApplianceSpecificDetails(*v) + if err != nil { + return err + } + rap.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// ReplicationEligibilityResults replication eligibility results response model. +type ReplicationEligibilityResults struct { + autorest.Response `json:"-"` + // Name - READ-ONLY; Gets the name of this object. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets the object type. + Type *string `json:"type,omitempty"` + // ID - READ-ONLY; Gets Unique ARM identifier for this object. + ID *string `json:"id,omitempty"` + // Properties - READ-ONLY; Gets properties model for replication eligibility results API. + Properties *ReplicationEligibilityResultsProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResults. +func (rer ReplicationEligibilityResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ReplicationEligibilityResultsCollection replication eligibility results collection response model. +type ReplicationEligibilityResultsCollection struct { + autorest.Response `json:"-"` + // Value - The replication eligibility results details. + Value *[]ReplicationEligibilityResults `json:"value,omitempty"` +} + +// ReplicationEligibilityResultsErrorInfo error model that can be exposed to the user. +type ReplicationEligibilityResultsErrorInfo struct { + // Code - The error code. + Code *string `json:"code,omitempty"` + // Message - The error message. + Message *string `json:"message,omitempty"` + // PossibleCauses - The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // Status - READ-ONLY; The error status. + Status *string `json:"status,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResultsErrorInfo. +func (rerei ReplicationEligibilityResultsErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rerei.Code != nil { + objectMap["code"] = rerei.Code + } + if rerei.Message != nil { + objectMap["message"] = rerei.Message + } + if rerei.PossibleCauses != nil { + objectMap["possibleCauses"] = rerei.PossibleCauses + } + if rerei.RecommendedAction != nil { + objectMap["recommendedAction"] = rerei.RecommendedAction + } + return json.Marshal(objectMap) +} + +// ReplicationEligibilityResultsProperties properties model for replication eligibility results API. +type ReplicationEligibilityResultsProperties struct { + // ClientRequestID - READ-ONLY; The client request Id. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // Errors - The error details. + Errors *[]ReplicationEligibilityResultsErrorInfo `json:"errors,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResultsProperties. +func (rerp ReplicationEligibilityResultsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rerp.Errors != nil { + objectMap["errors"] = rerp.Errors + } + return json.Marshal(objectMap) +} + +// ReplicationFabricsCheckConsistencyFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsCheckConsistencyFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsCheckConsistencyFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsCheckConsistencyFuture.Result. +func (future *ReplicationFabricsCheckConsistencyFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCheckConsistencyFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsCheckConsistencyFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.CheckConsistencyResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCheckConsistencyFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsCreateFuture.Result. +func (future *ReplicationFabricsCreateFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.CreateResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCreateFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsDeleteFuture.Result. +func (future *ReplicationFabricsDeleteFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsMigrateToAadFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsMigrateToAadFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsMigrateToAadFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsMigrateToAadFuture.Result. +func (future *ReplicationFabricsMigrateToAadFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsMigrateToAadFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsMigrateToAadFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsPurgeFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationFabricsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsPurgeFuture.Result. +func (future *ReplicationFabricsPurgeFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsReassociateGatewayFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsReassociateGatewayFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsReassociateGatewayFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsReassociateGatewayFuture.Result. +func (future *ReplicationFabricsReassociateGatewayFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsReassociateGatewayFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsReassociateGatewayFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.ReassociateGatewayResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsReassociateGatewayFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsRenewCertificateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsRenewCertificateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsRenewCertificateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsRenewCertificateFuture.Result. +func (future *ReplicationFabricsRenewCertificateFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsRenewCertificateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsRenewCertificateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.RenewCertificateResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsRenewCertificateFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationGroupDetails replication group details. This will be used in case of San. +type ReplicationGroupDetails struct { + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) MarshalJSON() ([]byte, error) { + rgd.InstanceType = InstanceTypeReplicationGroupDetails + objectMap := make(map[string]interface{}) + if rgd.InstanceType != "" { + objectMap["instanceType"] = rgd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return &rgd, true +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &rgd, true +} + +// ReplicationJobsCancelFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsCancelFuture.Result. +func (future *ReplicationJobsCancelFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.CancelResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsCancelFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsExportFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsExportFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsExportFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsExportFuture.Result. +func (future *ReplicationJobsExportFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsExportFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsExportFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.ExportResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsExportFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsRestartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsRestartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsRestartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsRestartFuture.Result. +func (future *ReplicationJobsRestartFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsRestartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsRestartFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.RestartResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsRestartFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsResumeFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsResumeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsResumeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsResumeFuture.Result. +func (future *ReplicationJobsResumeFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsResumeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsResumeFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.ResumeResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsResumeFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsCreateFuture.Result. +func (future *ReplicationMigrationItemsCreateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.CreateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsCreateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsDeleteFuture.Result. +func (future *ReplicationMigrationItemsDeleteFuture) result(client ReplicationMigrationItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationMigrationItemsMigrateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsMigrateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsMigrateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsMigrateFuture.Result. +func (future *ReplicationMigrationItemsMigrateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsMigrateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsMigrateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.MigrateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsMigrateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsResyncFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsResyncFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsResyncFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsResyncFuture.Result. +func (future *ReplicationMigrationItemsResyncFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsResyncFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsResyncFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.ResyncResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsResyncFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsTestMigrateCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationMigrationItemsTestMigrateCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsTestMigrateCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsTestMigrateCleanupFuture.Result. +func (future *ReplicationMigrationItemsTestMigrateCleanupFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.TestMigrateCleanupResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsTestMigrateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsTestMigrateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsTestMigrateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsTestMigrateFuture.Result. +func (future *ReplicationMigrationItemsTestMigrateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsTestMigrateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.TestMigrateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsUpdateFuture.Result. +func (future *ReplicationMigrationItemsUpdateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.UpdateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsUpdateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationNetworkMappingsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (NetworkMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsCreateFuture.Result. +func (future *ReplicationNetworkMappingsCreateFuture) result(client ReplicationNetworkMappingsClient) (nm NetworkMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + nm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nm.Response.Response, err = future.GetResult(sender); err == nil && nm.Response.Response.StatusCode != http.StatusNoContent { + nm, err = client.CreateResponder(nm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsCreateFuture", "Result", nm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationNetworkMappingsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsDeleteFuture.Result. +func (future *ReplicationNetworkMappingsDeleteFuture) result(client ReplicationNetworkMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationNetworkMappingsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (NetworkMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsUpdateFuture.Result. +func (future *ReplicationNetworkMappingsUpdateFuture) result(client ReplicationNetworkMappingsClient) (nm NetworkMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + nm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nm.Response.Response, err = future.GetResult(sender); err == nil && nm.Response.Response.StatusCode != http.StatusNoContent { + nm, err = client.UpdateResponder(nm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsUpdateFuture", "Result", nm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationPoliciesCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (Policy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesCreateFuture.Result. +func (future *ReplicationPoliciesCreateFuture) result(client ReplicationPoliciesClient) (p Policy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + p.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.CreateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesCreateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesDeleteFuture.Result. +func (future *ReplicationPoliciesDeleteFuture) result(client ReplicationPoliciesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationPoliciesUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (Policy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesUpdateFuture.Result. +func (future *ReplicationPoliciesUpdateFuture) result(client ReplicationPoliciesClient) (p Policy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + p.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.UpdateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesUpdateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItem replication protected item. +type ReplicationProtectedItem struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ReplicationProtectedItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectedItem. +func (rpi ReplicationProtectedItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpi.Properties != nil { + objectMap["properties"] = rpi.Properties + } + if rpi.Location != nil { + objectMap["location"] = rpi.Location + } + return json.Marshal(objectMap) +} + +// ReplicationProtectedItemCollection replication protected item collection. +type ReplicationProtectedItemCollection struct { + autorest.Response `json:"-"` + // Value - The Replication protected item details. + Value *[]ReplicationProtectedItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ReplicationProtectedItemCollectionIterator provides access to a complete listing of +// ReplicationProtectedItem values. +type ReplicationProtectedItemCollectionIterator struct { + i int + page ReplicationProtectedItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ReplicationProtectedItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ReplicationProtectedItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ReplicationProtectedItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ReplicationProtectedItemCollectionIterator) Response() ReplicationProtectedItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ReplicationProtectedItemCollectionIterator) Value() ReplicationProtectedItem { + if !iter.page.NotDone() { + return ReplicationProtectedItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ReplicationProtectedItemCollectionIterator type. +func NewReplicationProtectedItemCollectionIterator(page ReplicationProtectedItemCollectionPage) ReplicationProtectedItemCollectionIterator { + return ReplicationProtectedItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rpic ReplicationProtectedItemCollection) IsEmpty() bool { + return rpic.Value == nil || len(*rpic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rpic ReplicationProtectedItemCollection) hasNextLink() bool { + return rpic.NextLink != nil && len(*rpic.NextLink) != 0 +} + +// replicationProtectedItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rpic ReplicationProtectedItemCollection) replicationProtectedItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rpic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rpic.NextLink))) +} + +// ReplicationProtectedItemCollectionPage contains a page of ReplicationProtectedItem values. +type ReplicationProtectedItemCollectionPage struct { + fn func(context.Context, ReplicationProtectedItemCollection) (ReplicationProtectedItemCollection, error) + rpic ReplicationProtectedItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ReplicationProtectedItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rpic) + if err != nil { + return err + } + page.rpic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ReplicationProtectedItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ReplicationProtectedItemCollectionPage) NotDone() bool { + return !page.rpic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ReplicationProtectedItemCollectionPage) Response() ReplicationProtectedItemCollection { + return page.rpic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ReplicationProtectedItemCollectionPage) Values() []ReplicationProtectedItem { + if page.rpic.IsEmpty() { + return nil + } + return *page.rpic.Value +} + +// Creates a new instance of the ReplicationProtectedItemCollectionPage type. +func NewReplicationProtectedItemCollectionPage(cur ReplicationProtectedItemCollection, getNextPage func(context.Context, ReplicationProtectedItemCollection) (ReplicationProtectedItemCollection, error)) ReplicationProtectedItemCollectionPage { + return ReplicationProtectedItemCollectionPage{ + fn: getNextPage, + rpic: cur, + } +} + +// ReplicationProtectedItemProperties replication protected item custom data details. +type ReplicationProtectedItemProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectedItemType - The type of protected item type. + ProtectedItemType *string `json:"protectedItemType,omitempty"` + // ProtectableItemID - The protected item ARM Id. + ProtectableItemID *string `json:"protectableItemId,omitempty"` + // RecoveryServicesProviderID - The recovery provider ARM Id. + RecoveryServicesProviderID *string `json:"recoveryServicesProviderId,omitempty"` + // PrimaryFabricFriendlyName - The friendly name of the primary fabric. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // PrimaryFabricProvider - The fabric provider of the primary fabric. + PrimaryFabricProvider *string `json:"primaryFabricProvider,omitempty"` + // RecoveryFabricFriendlyName - The friendly name of recovery fabric. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // RecoveryFabricID - The Arm Id of recovery fabric. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // PrimaryProtectionContainerFriendlyName - The name of primary protection container friendly name. + PrimaryProtectionContainerFriendlyName *string `json:"primaryProtectionContainerFriendlyName,omitempty"` + // RecoveryProtectionContainerFriendlyName - The name of recovery container friendly name. + RecoveryProtectionContainerFriendlyName *string `json:"recoveryProtectionContainerFriendlyName,omitempty"` + // ProtectionState - The protection status. + ProtectionState *string `json:"protectionState,omitempty"` + // ProtectionStateDescription - The protection state description. + ProtectionStateDescription *string `json:"protectionStateDescription,omitempty"` + // ActiveLocation - The Current active location of the PE. + ActiveLocation *string `json:"activeLocation,omitempty"` + // TestFailoverState - The Test failover state. + TestFailoverState *string `json:"testFailoverState,omitempty"` + // TestFailoverStateDescription - The Test failover state description. + TestFailoverStateDescription *string `json:"testFailoverStateDescription,omitempty"` + // SwitchProviderState - The switch provider state. + SwitchProviderState *string `json:"switchProviderState,omitempty"` + // SwitchProviderStateDescription - The switch provider state description. + SwitchProviderStateDescription *string `json:"switchProviderStateDescription,omitempty"` + // AllowedOperations - The allowed operations on the Replication protected item. + AllowedOperations *[]string `json:"allowedOperations,omitempty"` + // ReplicationHealth - 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 `json:"replicationHealth,omitempty"` + // FailoverHealth - The consolidated failover health for the VM. + FailoverHealth *string `json:"failoverHealth,omitempty"` + // HealthErrors - List of health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // PolicyID - The ID of Policy governing this PE. + PolicyID *string `json:"policyId,omitempty"` + // PolicyFriendlyName - The name of Policy governing this PE. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` + // LastSuccessfulFailoverTime - The Last successful failover time. + LastSuccessfulFailoverTime *date.Time `json:"lastSuccessfulFailoverTime,omitempty"` + // LastSuccessfulTestFailoverTime - The Last successful test failover time. + LastSuccessfulTestFailoverTime *date.Time `json:"lastSuccessfulTestFailoverTime,omitempty"` + // CurrentScenario - The current scenario. + CurrentScenario *CurrentScenarioDetails `json:"currentScenario,omitempty"` + // FailoverRecoveryPointID - The recovery point ARM Id to which the Vm was failed over. + FailoverRecoveryPointID *string `json:"failoverRecoveryPointId,omitempty"` + // ProviderSpecificDetails - The Replication provider custom settings. + ProviderSpecificDetails BasicReplicationProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // EventCorrelationID - The correlation Id for events associated with this protected item. + EventCorrelationID *string `json:"eventCorrelationId,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ReplicationProtectedItemProperties struct. +func (rpip *ReplicationProtectedItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpip.FriendlyName = &friendlyName + } + case "protectedItemType": + if v != nil { + var protectedItemType string + err = json.Unmarshal(*v, &protectedItemType) + if err != nil { + return err + } + rpip.ProtectedItemType = &protectedItemType + } + case "protectableItemId": + if v != nil { + var protectableItemID string + err = json.Unmarshal(*v, &protectableItemID) + if err != nil { + return err + } + rpip.ProtectableItemID = &protectableItemID + } + case "recoveryServicesProviderId": + if v != nil { + var recoveryServicesProviderID string + err = json.Unmarshal(*v, &recoveryServicesProviderID) + if err != nil { + return err + } + rpip.RecoveryServicesProviderID = &recoveryServicesProviderID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + rpip.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "primaryFabricProvider": + if v != nil { + var primaryFabricProvider string + err = json.Unmarshal(*v, &primaryFabricProvider) + if err != nil { + return err + } + rpip.PrimaryFabricProvider = &primaryFabricProvider + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + rpip.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + rpip.RecoveryFabricID = &recoveryFabricID + } + case "primaryProtectionContainerFriendlyName": + if v != nil { + var primaryProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &primaryProtectionContainerFriendlyName) + if err != nil { + return err + } + rpip.PrimaryProtectionContainerFriendlyName = &primaryProtectionContainerFriendlyName + } + case "recoveryProtectionContainerFriendlyName": + if v != nil { + var recoveryProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &recoveryProtectionContainerFriendlyName) + if err != nil { + return err + } + rpip.RecoveryProtectionContainerFriendlyName = &recoveryProtectionContainerFriendlyName + } + case "protectionState": + if v != nil { + var protectionState string + err = json.Unmarshal(*v, &protectionState) + if err != nil { + return err + } + rpip.ProtectionState = &protectionState + } + case "protectionStateDescription": + if v != nil { + var protectionStateDescription string + err = json.Unmarshal(*v, &protectionStateDescription) + if err != nil { + return err + } + rpip.ProtectionStateDescription = &protectionStateDescription + } + case "activeLocation": + if v != nil { + var activeLocation string + err = json.Unmarshal(*v, &activeLocation) + if err != nil { + return err + } + rpip.ActiveLocation = &activeLocation + } + case "testFailoverState": + if v != nil { + var testFailoverState string + err = json.Unmarshal(*v, &testFailoverState) + if err != nil { + return err + } + rpip.TestFailoverState = &testFailoverState + } + case "testFailoverStateDescription": + if v != nil { + var testFailoverStateDescription string + err = json.Unmarshal(*v, &testFailoverStateDescription) + if err != nil { + return err + } + rpip.TestFailoverStateDescription = &testFailoverStateDescription + } + case "switchProviderState": + if v != nil { + var switchProviderState string + err = json.Unmarshal(*v, &switchProviderState) + if err != nil { + return err + } + rpip.SwitchProviderState = &switchProviderState + } + case "switchProviderStateDescription": + if v != nil { + var switchProviderStateDescription string + err = json.Unmarshal(*v, &switchProviderStateDescription) + if err != nil { + return err + } + rpip.SwitchProviderStateDescription = &switchProviderStateDescription + } + case "allowedOperations": + if v != nil { + var allowedOperations []string + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + rpip.AllowedOperations = &allowedOperations + } + case "replicationHealth": + if v != nil { + var replicationHealth string + err = json.Unmarshal(*v, &replicationHealth) + if err != nil { + return err + } + rpip.ReplicationHealth = &replicationHealth + } + case "failoverHealth": + if v != nil { + var failoverHealth string + err = json.Unmarshal(*v, &failoverHealth) + if err != nil { + return err + } + rpip.FailoverHealth = &failoverHealth + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + rpip.HealthErrors = &healthErrors + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + rpip.PolicyID = &policyID + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + rpip.PolicyFriendlyName = &policyFriendlyName + } + case "lastSuccessfulFailoverTime": + if v != nil { + var lastSuccessfulFailoverTime date.Time + err = json.Unmarshal(*v, &lastSuccessfulFailoverTime) + if err != nil { + return err + } + rpip.LastSuccessfulFailoverTime = &lastSuccessfulFailoverTime + } + case "lastSuccessfulTestFailoverTime": + if v != nil { + var lastSuccessfulTestFailoverTime date.Time + err = json.Unmarshal(*v, &lastSuccessfulTestFailoverTime) + if err != nil { + return err + } + rpip.LastSuccessfulTestFailoverTime = &lastSuccessfulTestFailoverTime + } + case "currentScenario": + if v != nil { + var currentScenario CurrentScenarioDetails + err = json.Unmarshal(*v, ¤tScenario) + if err != nil { + return err + } + rpip.CurrentScenario = ¤tScenario + } + case "failoverRecoveryPointId": + if v != nil { + var failoverRecoveryPointID string + err = json.Unmarshal(*v, &failoverRecoveryPointID) + if err != nil { + return err + } + rpip.FailoverRecoveryPointID = &failoverRecoveryPointID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReplicationProviderSpecificSettings(*v) + if err != nil { + return err + } + rpip.ProviderSpecificDetails = providerSpecificDetails + } + case "recoveryContainerId": + if v != nil { + var recoveryContainerID string + err = json.Unmarshal(*v, &recoveryContainerID) + if err != nil { + return err + } + rpip.RecoveryContainerID = &recoveryContainerID + } + case "eventCorrelationId": + if v != nil { + var eventCorrelationID string + err = json.Unmarshal(*v, &eventCorrelationID) + if err != nil { + return err + } + rpip.EventCorrelationID = &eventCorrelationID + } + } + } + + return nil +} + +// ReplicationProtectedItemsAddDisksFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsAddDisksFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsAddDisksFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsAddDisksFuture.Result. +func (future *ReplicationProtectedItemsAddDisksFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsAddDisksFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsAddDisksFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.AddDisksResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsAddDisksFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsApplyRecoveryPointFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsApplyRecoveryPointFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsApplyRecoveryPointFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsApplyRecoveryPointFuture.Result. +func (future *ReplicationProtectedItemsApplyRecoveryPointFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ApplyRecoveryPointResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsCreateFuture.Result. +func (future *ReplicationProtectedItemsCreateFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.CreateResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsCreateFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsDeleteFuture.Result. +func (future *ReplicationProtectedItemsDeleteFuture) result(client ReplicationProtectedItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectedItemsFailoverCancelFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsFailoverCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsFailoverCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsFailoverCancelFuture.Result. +func (future *ReplicationProtectedItemsFailoverCancelFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsFailoverCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.FailoverCancelResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCancelFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsFailoverCommitFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsFailoverCommitFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsFailoverCommitFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsFailoverCommitFuture.Result. +func (future *ReplicationProtectedItemsFailoverCommitFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCommitFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsFailoverCommitFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.FailoverCommitResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCommitFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsPlannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsPlannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsPlannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsPlannedFailoverFuture.Result. +func (future *ReplicationProtectedItemsPlannedFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPlannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsPlannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.PlannedFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPlannedFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsPurgeFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsPurgeFuture.Result. +func (future *ReplicationProtectedItemsPurgeFuture) result(client ReplicationProtectedItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectedItemsRemoveDisksFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsRemoveDisksFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsRemoveDisksFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsRemoveDisksFuture.Result. +func (future *ReplicationProtectedItemsRemoveDisksFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRemoveDisksFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsRemoveDisksFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.RemoveDisksResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRemoveDisksFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsRepairReplicationFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsRepairReplicationFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsRepairReplicationFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsRepairReplicationFuture.Result. +func (future *ReplicationProtectedItemsRepairReplicationFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRepairReplicationFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsRepairReplicationFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.RepairReplicationResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRepairReplicationFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsReprotectFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsReprotectFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsReprotectFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsReprotectFuture.Result. +func (future *ReplicationProtectedItemsReprotectFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsReprotectFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsReprotectFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ReprotectResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsReprotectFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsResolveHealthErrorsFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsResolveHealthErrorsFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsResolveHealthErrorsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsResolveHealthErrorsFuture.Result. +func (future *ReplicationProtectedItemsResolveHealthErrorsFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ResolveHealthErrorsResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsSwitchProviderFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsSwitchProviderFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsSwitchProviderFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsSwitchProviderFuture.Result. +func (future *ReplicationProtectedItemsSwitchProviderFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsSwitchProviderFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsSwitchProviderFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.SwitchProviderResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsSwitchProviderFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsTestFailoverCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsTestFailoverCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsTestFailoverCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsTestFailoverCleanupFuture.Result. +func (future *ReplicationProtectedItemsTestFailoverCleanupFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.TestFailoverCleanupResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsTestFailoverFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectedItemsTestFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsTestFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsTestFailoverFuture.Result. +func (future *ReplicationProtectedItemsTestFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsTestFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.TestFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUnplannedFailoverFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsUnplannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUnplannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUnplannedFailoverFuture.Result. +func (future *ReplicationProtectedItemsUnplannedFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UnplannedFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateApplianceFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsUpdateApplianceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateApplianceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateApplianceFuture.Result. +func (future *ReplicationProtectedItemsUpdateApplianceFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateApplianceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateApplianceFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateApplianceResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateApplianceFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateFuture.Result. +func (future *ReplicationProtectedItemsUpdateFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateMobilityServiceFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsUpdateMobilityServiceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateMobilityServiceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateMobilityServiceFuture.Result. +func (future *ReplicationProtectedItemsUpdateMobilityServiceFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateMobilityServiceResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainerMappingsCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (ProtectionContainerMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsCreateFuture.Result. +func (future *ReplicationProtectionContainerMappingsCreateFuture) result(client ReplicationProtectionContainerMappingsClient) (pcm ProtectionContainerMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pcm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pcm.Response.Response, err = future.GetResult(sender); err == nil && pcm.Response.Response.StatusCode != http.StatusNoContent { + pcm, err = client.CreateResponder(pcm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsCreateFuture", "Result", pcm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainerMappingsDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsDeleteFuture.Result. +func (future *ReplicationProtectionContainerMappingsDeleteFuture) result(client ReplicationProtectionContainerMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainerMappingsPurgeFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsPurgeFuture.Result. +func (future *ReplicationProtectionContainerMappingsPurgeFuture) result(client ReplicationProtectionContainerMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainerMappingsUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (ProtectionContainerMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsUpdateFuture.Result. +func (future *ReplicationProtectionContainerMappingsUpdateFuture) result(client ReplicationProtectionContainerMappingsClient) (pcm ProtectionContainerMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pcm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pcm.Response.Response, err = future.GetResult(sender); err == nil && pcm.Response.Response.StatusCode != http.StatusNoContent { + pcm, err = client.UpdateResponder(pcm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsUpdateFuture", "Result", pcm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersCreateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectionContainersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersCreateFuture.Result. +func (future *ReplicationProtectionContainersCreateFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.CreateResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersCreateFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersDeleteFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectionContainersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersDeleteFuture.Result. +func (future *ReplicationProtectionContainersDeleteFuture) result(client ReplicationProtectionContainersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainersDiscoverProtectableItemFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type ReplicationProtectionContainersDiscoverProtectableItemFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersDiscoverProtectableItemFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersDiscoverProtectableItemFuture.Result. +func (future *ReplicationProtectionContainersDiscoverProtectableItemFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.DiscoverProtectableItemResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersSwitchProtectionFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainersSwitchProtectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersSwitchProtectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersSwitchProtectionFuture.Result. +func (future *ReplicationProtectionContainersSwitchProtectionFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersSwitchProtectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersSwitchProtectionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.SwitchProtectionResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersSwitchProtectionFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionIntent replication protection intent. +type ReplicationProtectionIntent struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ReplicationProtectionIntentProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntent. +func (rpi ReplicationProtectionIntent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpi.Properties != nil { + objectMap["properties"] = rpi.Properties + } + if rpi.Location != nil { + objectMap["location"] = rpi.Location + } + return json.Marshal(objectMap) +} + +// ReplicationProtectionIntentCollection replication protection intent objects collection. +type ReplicationProtectionIntentCollection struct { + autorest.Response `json:"-"` + // Value - The Replication protection intent details. + Value *[]ReplicationProtectionIntent `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ReplicationProtectionIntentCollectionIterator provides access to a complete listing of +// ReplicationProtectionIntent values. +type ReplicationProtectionIntentCollectionIterator struct { + i int + page ReplicationProtectionIntentCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ReplicationProtectionIntentCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ReplicationProtectionIntentCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ReplicationProtectionIntentCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ReplicationProtectionIntentCollectionIterator) Response() ReplicationProtectionIntentCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ReplicationProtectionIntentCollectionIterator) Value() ReplicationProtectionIntent { + if !iter.page.NotDone() { + return ReplicationProtectionIntent{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ReplicationProtectionIntentCollectionIterator type. +func NewReplicationProtectionIntentCollectionIterator(page ReplicationProtectionIntentCollectionPage) ReplicationProtectionIntentCollectionIterator { + return ReplicationProtectionIntentCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rpic ReplicationProtectionIntentCollection) IsEmpty() bool { + return rpic.Value == nil || len(*rpic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rpic ReplicationProtectionIntentCollection) hasNextLink() bool { + return rpic.NextLink != nil && len(*rpic.NextLink) != 0 +} + +// replicationProtectionIntentCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rpic ReplicationProtectionIntentCollection) replicationProtectionIntentCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rpic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rpic.NextLink))) +} + +// ReplicationProtectionIntentCollectionPage contains a page of ReplicationProtectionIntent values. +type ReplicationProtectionIntentCollectionPage struct { + fn func(context.Context, ReplicationProtectionIntentCollection) (ReplicationProtectionIntentCollection, error) + rpic ReplicationProtectionIntentCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ReplicationProtectionIntentCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rpic) + if err != nil { + return err + } + page.rpic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ReplicationProtectionIntentCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ReplicationProtectionIntentCollectionPage) NotDone() bool { + return !page.rpic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ReplicationProtectionIntentCollectionPage) Response() ReplicationProtectionIntentCollection { + return page.rpic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ReplicationProtectionIntentCollectionPage) Values() []ReplicationProtectionIntent { + if page.rpic.IsEmpty() { + return nil + } + return *page.rpic.Value +} + +// Creates a new instance of the ReplicationProtectionIntentCollectionPage type. +func NewReplicationProtectionIntentCollectionPage(cur ReplicationProtectionIntentCollection, getNextPage func(context.Context, ReplicationProtectionIntentCollection) (ReplicationProtectionIntentCollection, error)) ReplicationProtectionIntentCollectionPage { + return ReplicationProtectionIntentCollectionPage{ + fn: getNextPage, + rpic: cur, + } +} + +// ReplicationProtectionIntentProperties replication protection intent custom data details. +type ReplicationProtectionIntentProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // JobID - READ-ONLY; The job Id. + JobID *string `json:"jobId,omitempty"` + // JobState - READ-ONLY; The job state. + JobState *string `json:"jobState,omitempty"` + // IsActive - READ-ONLY; A value indicating whether the intent object is active. + IsActive *bool `json:"isActive,omitempty"` + // CreationTimeUTC - READ-ONLY; The creation time in UTC. + CreationTimeUTC *string `json:"creationTimeUTC,omitempty"` + // ProviderSpecificDetails - The Replication provider custom settings. + ProviderSpecificDetails BasicReplicationProtectionIntentProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntentProperties. +func (rpip ReplicationProtectionIntentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpip.FriendlyName != nil { + objectMap["friendlyName"] = rpip.FriendlyName + } + objectMap["providerSpecificDetails"] = rpip.ProviderSpecificDetails + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ReplicationProtectionIntentProperties struct. +func (rpip *ReplicationProtectionIntentProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpip.FriendlyName = &friendlyName + } + case "jobId": + if v != nil { + var jobID string + err = json.Unmarshal(*v, &jobID) + if err != nil { + return err + } + rpip.JobID = &jobID + } + case "jobState": + if v != nil { + var jobState string + err = json.Unmarshal(*v, &jobState) + if err != nil { + return err + } + rpip.JobState = &jobState + } + case "isActive": + if v != nil { + var isActive bool + err = json.Unmarshal(*v, &isActive) + if err != nil { + return err + } + rpip.IsActive = &isActive + } + case "creationTimeUTC": + if v != nil { + var creationTimeUTC string + err = json.Unmarshal(*v, &creationTimeUTC) + if err != nil { + return err + } + rpip.CreationTimeUTC = &creationTimeUTC + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(*v) + if err != nil { + return err + } + rpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicReplicationProtectionIntentProviderSpecificSettings replication provider specific settings. +type BasicReplicationProtectionIntentProviderSpecificSettings interface { + AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) + AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) +} + +// ReplicationProtectionIntentProviderSpecificSettings replication provider specific settings. +type ReplicationProtectionIntentProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings', 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A' + InstanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(body []byte) (BasicReplicationProtectionIntentProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A): + var arid A2AReplicationIntentDetails + err := json.Unmarshal(body, &arid) + return arid, err + default: + var rpipss ReplicationProtectionIntentProviderSpecificSettings + err := json.Unmarshal(body, &rpipss) + return rpipss, err + } +} +func unmarshalBasicReplicationProtectionIntentProviderSpecificSettingsArray(body []byte) ([]BasicReplicationProtectionIntentProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpipssArray := make([]BasicReplicationProtectionIntentProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpipss, err := unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + rpipssArray[index] = rpipss + } + return rpipssArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) MarshalJSON() ([]byte, error) { + rpipss.InstanceType = InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings + objectMap := make(map[string]interface{}) + if rpipss.InstanceType != "" { + objectMap["instanceType"] = rpipss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReplicationIntentDetails is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) { + return nil, false +} + +// AsReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) { + return &rpipss, true +} + +// AsBasicReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsBasicReplicationProtectionIntentProviderSpecificSettings() (BasicReplicationProtectionIntentProviderSpecificSettings, bool) { + return &rpipss, true +} + +// ReplicationProviderContainerUnmappingInput provider specific input for unpairing operations. +type ReplicationProviderContainerUnmappingInput struct { + // InstanceType - The class type. + InstanceType *string `json:"instanceType,omitempty"` +} + +// BasicReplicationProviderSpecificContainerCreationInput provider specific input for container creation operation. +type BasicReplicationProviderSpecificContainerCreationInput interface { + AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) + AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) + AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) + AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) +} + +// ReplicationProviderSpecificContainerCreationInput provider specific input for container creation operation. +type ReplicationProviderSpecificContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificContainerCreationInput(body []byte) (BasicReplicationProviderSpecificContainerCreationInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A): + var acci A2AContainerCreationInput + err := json.Unmarshal(body, &acci) + return acci, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration): + var accmcci A2ACrossClusterMigrationContainerCreationInput + err := json.Unmarshal(body, &accmcci) + return accmcci, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt): + var vmccci VMwareCbtContainerCreationInput + err := json.Unmarshal(body, &vmccci) + return vmccci, err + default: + var rpscci ReplicationProviderSpecificContainerCreationInput + err := json.Unmarshal(body, &rpscci) + return rpscci, err + } +} +func unmarshalBasicReplicationProviderSpecificContainerCreationInputArray(body []byte) ([]BasicReplicationProviderSpecificContainerCreationInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpscciArray := make([]BasicReplicationProviderSpecificContainerCreationInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpscci, err := unmarshalBasicReplicationProviderSpecificContainerCreationInput(*rawMessage) + if err != nil { + return nil, err + } + rpscciArray[index] = rpscci + } + return rpscciArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) MarshalJSON() ([]byte, error) { + rpscci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput + objectMap := make(map[string]interface{}) + if rpscci.InstanceType != "" { + objectMap["instanceType"] = rpscci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return &rpscci, true +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &rpscci, true +} + +// BasicReplicationProviderSpecificContainerMappingInput provider specific input for pairing operations. +type BasicReplicationProviderSpecificContainerMappingInput interface { + AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) + AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) + AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) +} + +// ReplicationProviderSpecificContainerMappingInput provider specific input for pairing operations. +type ReplicationProviderSpecificContainerMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificContainerMappingInput(body []byte) (BasicReplicationProviderSpecificContainerMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A): + var acmi A2AContainerMappingInput + err := json.Unmarshal(body, &acmi) + return acmi, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt): + var vmccmi VMwareCbtContainerMappingInput + err := json.Unmarshal(body, &vmccmi) + return vmccmi, err + default: + var rpscmi ReplicationProviderSpecificContainerMappingInput + err := json.Unmarshal(body, &rpscmi) + return rpscmi, err + } +} +func unmarshalBasicReplicationProviderSpecificContainerMappingInputArray(body []byte) ([]BasicReplicationProviderSpecificContainerMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpscmiArray := make([]BasicReplicationProviderSpecificContainerMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpscmi, err := unmarshalBasicReplicationProviderSpecificContainerMappingInput(*rawMessage) + if err != nil { + return nil, err + } + rpscmiArray[index] = rpscmi + } + return rpscmiArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) MarshalJSON() ([]byte, error) { + rpscmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput + objectMap := make(map[string]interface{}) + if rpscmi.InstanceType != "" { + objectMap["instanceType"] = rpscmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return &rpscmi, true +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &rpscmi, true +} + +// BasicReplicationProviderSpecificSettings replication provider specific settings. +type BasicReplicationProviderSpecificSettings interface { + AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) + AsA2AReplicationDetails() (*A2AReplicationDetails, bool) + AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) + AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) + AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) + AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) + AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) + AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) + AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) + AsInMageReplicationDetails() (*InMageReplicationDetails, bool) + AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) +} + +// ReplicationProviderSpecificSettings replication provider specific settings. +type ReplicationProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificSettings(body []byte) (BasicReplicationProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration): + var accmrd A2ACrossClusterMigrationReplicationDetails + err := json.Unmarshal(body, &accmrd) + return accmrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A): + var ard A2AReplicationDetails + err := json.Unmarshal(body, &ard) + return ard, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure): + var hvrard HyperVReplicaAzureReplicationDetails + err := json.Unmarshal(body, &hvrard) + return hvrard, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails): + var hvrbrd HyperVReplicaBaseReplicationDetails + err := json.Unmarshal(body, &hvrbrd) + return hvrbrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2): + var hvrbrd HyperVReplicaBlueReplicationDetails + err := json.Unmarshal(body, &hvrbrd) + return hvrbrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012): + var hvrrd HyperVReplicaReplicationDetails + err := json.Unmarshal(body, &hvrrd) + return hvrrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2): + var imavrd InMageAzureV2ReplicationDetails + err := json.Unmarshal(body, &imavrd) + return imavrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback): + var imrfrd InMageRcmFailbackReplicationDetails + err := json.Unmarshal(body, &imrfrd) + return imrfrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm): + var imrrd InMageRcmReplicationDetails + err := json.Unmarshal(body, &imrrd) + return imrrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage): + var imrd InMageReplicationDetails + err := json.Unmarshal(body, &imrd) + return imrd, err + default: + var rpss ReplicationProviderSpecificSettings + err := json.Unmarshal(body, &rpss) + return rpss, err + } +} +func unmarshalBasicReplicationProviderSpecificSettingsArray(body []byte) ([]BasicReplicationProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpssArray := make([]BasicReplicationProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpss, err := unmarshalBasicReplicationProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + rpssArray[index] = rpss + } + return rpssArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) MarshalJSON() ([]byte, error) { + rpss.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings + objectMap := make(map[string]interface{}) + if rpss.InstanceType != "" { + objectMap["instanceType"] = rpss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return &rpss, true +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &rpss, true +} + +// BasicReplicationProviderSpecificUpdateContainerMappingInput provider specific input for update pairing operations. +type BasicReplicationProviderSpecificUpdateContainerMappingInput interface { + AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) + AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) + AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) +} + +// ReplicationProviderSpecificUpdateContainerMappingInput provider specific input for update pairing +// operations. +type ReplicationProviderSpecificUpdateContainerMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(body []byte) (BasicReplicationProviderSpecificUpdateContainerMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A): + var aucmi A2AUpdateContainerMappingInput + err := json.Unmarshal(body, &aucmi) + return aucmi, err + case string(InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm): + var imrucmi InMageRcmUpdateContainerMappingInput + err := json.Unmarshal(body, &imrucmi) + return imrucmi, err + default: + var rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput + err := json.Unmarshal(body, &rpsucmi) + return rpsucmi, err + } +} +func unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInputArray(body []byte) ([]BasicReplicationProviderSpecificUpdateContainerMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpsucmiArray := make([]BasicReplicationProviderSpecificUpdateContainerMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpsucmi, err := unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(*rawMessage) + if err != nil { + return nil, err + } + rpsucmiArray[index] = rpsucmi + } + return rpsucmiArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + rpsucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput + objectMap := make(map[string]interface{}) + if rpsucmi.InstanceType != "" { + objectMap["instanceType"] = rpsucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &rpsucmi, true +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &rpsucmi, true +} + +// ReplicationRecoveryPlansCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansCreateFuture.Result. +func (future *ReplicationRecoveryPlansCreateFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.CreateResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansCreateFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansDeleteFuture.Result. +func (future *ReplicationRecoveryPlansDeleteFuture) result(client ReplicationRecoveryPlansClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryPlansFailoverCancelFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationRecoveryPlansFailoverCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansFailoverCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansFailoverCancelFuture.Result. +func (future *ReplicationRecoveryPlansFailoverCancelFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansFailoverCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.FailoverCancelResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCancelFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansFailoverCommitFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationRecoveryPlansFailoverCommitFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansFailoverCommitFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansFailoverCommitFuture.Result. +func (future *ReplicationRecoveryPlansFailoverCommitFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCommitFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansFailoverCommitFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.FailoverCommitResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCommitFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansPlannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryPlansPlannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansPlannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansPlannedFailoverFuture.Result. +func (future *ReplicationRecoveryPlansPlannedFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.PlannedFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansReprotectFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansReprotectFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansReprotectFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansReprotectFuture.Result. +func (future *ReplicationRecoveryPlansReprotectFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansReprotectFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansReprotectFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.ReprotectResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansReprotectFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansTestFailoverCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryPlansTestFailoverCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansTestFailoverCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansTestFailoverCleanupFuture.Result. +func (future *ReplicationRecoveryPlansTestFailoverCleanupFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.TestFailoverCleanupResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansTestFailoverFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansTestFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansTestFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansTestFailoverFuture.Result. +func (future *ReplicationRecoveryPlansTestFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansTestFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.TestFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansUnplannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryPlansUnplannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansUnplannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansUnplannedFailoverFuture.Result. +func (future *ReplicationRecoveryPlansUnplannedFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.UnplannedFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansUpdateFuture.Result. +func (future *ReplicationRecoveryPlansUpdateFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.UpdateResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUpdateFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryServicesProvidersCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryServicesProvidersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (RecoveryServicesProvider, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersCreateFuture.Result. +func (future *ReplicationRecoveryServicesProvidersCreateFuture) result(client ReplicationRecoveryServicesProvidersClient) (rsp RecoveryServicesProvider, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rsp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rsp.Response.Response, err = future.GetResult(sender); err == nil && rsp.Response.Response.StatusCode != http.StatusNoContent { + rsp, err = client.CreateResponder(rsp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersCreateFuture", "Result", rsp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryServicesProvidersDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryServicesProvidersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersDeleteFuture.Result. +func (future *ReplicationRecoveryServicesProvidersDeleteFuture) result(client ReplicationRecoveryServicesProvidersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryServicesProvidersPurgeFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryServicesProvidersPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersPurgeFuture.Result. +func (future *ReplicationRecoveryServicesProvidersPurgeFuture) result(client ReplicationRecoveryServicesProvidersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryServicesProvidersRefreshProviderFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type ReplicationRecoveryServicesProvidersRefreshProviderFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (RecoveryServicesProvider, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersRefreshProviderFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersRefreshProviderFuture.Result. +func (future *ReplicationRecoveryServicesProvidersRefreshProviderFuture) result(client ReplicationRecoveryServicesProvidersClient) (rsp RecoveryServicesProvider, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rsp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rsp.Response.Response, err = future.GetResult(sender); err == nil && rsp.Response.Response.StatusCode != http.StatusNoContent { + rsp, err = client.RefreshProviderResponder(rsp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture", "Result", rsp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationStorageClassificationMappingsCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationStorageClassificationMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationStorageClassificationMappingsClient) (StorageClassificationMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationStorageClassificationMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationStorageClassificationMappingsCreateFuture.Result. +func (future *ReplicationStorageClassificationMappingsCreateFuture) result(client ReplicationStorageClassificationMappingsClient) (scm StorageClassificationMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + scm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationStorageClassificationMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if scm.Response.Response, err = future.GetResult(sender); err == nil && scm.Response.Response.StatusCode != http.StatusNoContent { + scm, err = client.CreateResponder(scm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsCreateFuture", "Result", scm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationStorageClassificationMappingsDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationStorageClassificationMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationStorageClassificationMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationStorageClassificationMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationStorageClassificationMappingsDeleteFuture.Result. +func (future *ReplicationStorageClassificationMappingsDeleteFuture) result(client ReplicationStorageClassificationMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationStorageClassificationMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationVaultHealthRefreshFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationVaultHealthRefreshFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationVaultHealthClient) (VaultHealthDetails, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationVaultHealthRefreshFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationVaultHealthRefreshFuture.Result. +func (future *ReplicationVaultHealthRefreshFuture) result(client ReplicationVaultHealthClient) (vhd VaultHealthDetails, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthRefreshFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vhd.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationVaultHealthRefreshFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vhd.Response.Response, err = future.GetResult(sender); err == nil && vhd.Response.Response.StatusCode != http.StatusNoContent { + vhd, err = client.RefreshResponder(vhd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthRefreshFuture", "Result", vhd.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationVaultSettingCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationVaultSettingCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationVaultSettingClient) (VaultSetting, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationVaultSettingCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationVaultSettingCreateFuture.Result. +func (future *ReplicationVaultSettingCreateFuture) result(client ReplicationVaultSettingClient) (vs VaultSetting, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vs.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationVaultSettingCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vs.Response.Response, err = future.GetResult(sender); err == nil && vs.Response.Response.StatusCode != http.StatusNoContent { + vs, err = client.CreateResponder(vs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingCreateFuture", "Result", vs.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationvCentersCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (VCenter, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersCreateFuture.Result. +func (future *ReplicationvCentersCreateFuture) result(client ReplicationvCentersClient) (vc VCenter, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent { + vc, err = client.CreateResponder(vc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersCreateFuture", "Result", vc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationvCentersDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersDeleteFuture.Result. +func (future *ReplicationvCentersDeleteFuture) result(client ReplicationvCentersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationvCentersUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (VCenter, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersUpdateFuture.Result. +func (future *ReplicationvCentersUpdateFuture) result(client ReplicationvCentersClient) (vc VCenter, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent { + vc, err = client.UpdateResponder(vc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersUpdateFuture", "Result", vc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReprotectAgentDetails reprotect agent details. +type ReprotectAgentDetails struct { + // ID - READ-ONLY; The reprotect agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The reprotect agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The reprotect agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The reprotect agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the reprotect agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the reprotect agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // ProtectedItemCount - READ-ONLY; The protected item count. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // AccessibleDatastores - READ-ONLY; The list of accessible datastores fetched from discovery. + AccessibleDatastores *[]string `json:"accessibleDatastores,omitempty"` + // VcenterID - READ-ONLY; The Vcenter Id. + VcenterID *string `json:"vcenterId,omitempty"` + // LastDiscoveryInUtc - READ-ONLY; The last time when SDS information discovered in SRS. + LastDiscoveryInUtc *date.Time `json:"lastDiscoveryInUtc,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReprotectAgentDetails. +func (rad ReprotectAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResolveHealthError resolve health errors input properties. +type ResolveHealthError struct { + // HealthErrorID - Health error id. + HealthErrorID *string `json:"healthErrorId,omitempty"` +} + +// ResolveHealthInput resolve health input. +type ResolveHealthInput struct { + // Properties - Disable resolve health input properties. + Properties *ResolveHealthInputProperties `json:"properties,omitempty"` +} + +// ResolveHealthInputProperties resolve health input properties. +type ResolveHealthInputProperties struct { + // HealthErrors - Health errors. + HealthErrors *[]ResolveHealthError `json:"healthErrors,omitempty"` +} + +// Resource azure resource. +type Resource struct { + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location + } + return json.Marshal(objectMap) +} + +// ResourceHealthSummary base class to define the health summary of the resources contained under an Arm +// resource. +type ResourceHealthSummary struct { + // ResourceCount - The count of total resources under the container. + ResourceCount *int32 `json:"resourceCount,omitempty"` + // Issues - The list of summary of health errors across the resources under the container. + Issues *[]HealthErrorSummary `json:"issues,omitempty"` + // CategorizedResourceCounts - The categorized resource counts. + CategorizedResourceCounts map[string]*int32 `json:"categorizedResourceCounts"` +} + +// MarshalJSON is the custom marshaler for ResourceHealthSummary. +func (RHS ResourceHealthSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if RHS.ResourceCount != nil { + objectMap["resourceCount"] = RHS.ResourceCount + } + if RHS.Issues != nil { + objectMap["issues"] = RHS.Issues + } + if RHS.CategorizedResourceCounts != nil { + objectMap["categorizedResourceCounts"] = RHS.CategorizedResourceCounts + } + return json.Marshal(objectMap) +} + +// ResumeJobParams resume job params. +type ResumeJobParams struct { + // Properties - Resume job properties. + Properties *ResumeJobParamsProperties `json:"properties,omitempty"` +} + +// ResumeJobParamsProperties resume job properties. +type ResumeJobParamsProperties struct { + // Comments - Resume job comments. + Comments *string `json:"comments,omitempty"` +} + +// ResyncInput resync input. +type ResyncInput struct { + // Properties - Resync input properties. + Properties *ResyncInputProperties `json:"properties,omitempty"` +} + +// ResyncInputProperties resync input properties. +type ResyncInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicResyncProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ResyncInputProperties struct. +func (rip *ResyncInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicResyncProviderSpecificInput(*v) + if err != nil { + return err + } + rip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicResyncProviderSpecificInput resync provider specific input. +type BasicResyncProviderSpecificInput interface { + AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) + AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) +} + +// ResyncProviderSpecificInput resync provider specific input. +type ResyncProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput', 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicResyncProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicResyncProviderSpecificInput(body []byte) (BasicResyncProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt): + var vmcri VMwareCbtResyncInput + err := json.Unmarshal(body, &vmcri) + return vmcri, err + default: + var rpsi ResyncProviderSpecificInput + err := json.Unmarshal(body, &rpsi) + return rpsi, err + } +} +func unmarshalBasicResyncProviderSpecificInputArray(body []byte) ([]BasicResyncProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpsiArray := make([]BasicResyncProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpsi, err := unmarshalBasicResyncProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rpsiArray[index] = rpsi + } + return rpsiArray, nil +} + +// MarshalJSON is the custom marshaler for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) MarshalJSON() ([]byte, error) { + rpsi.InstanceType = InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput + objectMap := make(map[string]interface{}) + if rpsi.InstanceType != "" { + objectMap["instanceType"] = rpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtResyncInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) { + return nil, false +} + +// AsResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) { + return &rpsi, true +} + +// AsBasicResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsBasicResyncProviderSpecificInput() (BasicResyncProviderSpecificInput, bool) { + return &rpsi, true +} + +// RetentionVolume the retention details of the MT. +type RetentionVolume struct { + // VolumeName - The volume name. + VolumeName *string `json:"volumeName,omitempty"` + // CapacityInBytes - The volume capacity. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // FreeSpaceInBytes - The free space available in this volume. + FreeSpaceInBytes *int64 `json:"freeSpaceInBytes,omitempty"` + // ThresholdPercentage - The threshold percentage. + ThresholdPercentage *int32 `json:"thresholdPercentage,omitempty"` +} + +// ReverseReplicationInput reverse replication input. +type ReverseReplicationInput struct { + // Properties - Reverse replication properties. + Properties *ReverseReplicationInputProperties `json:"properties,omitempty"` +} + +// ReverseReplicationInputProperties reverse replication input properties. +type ReverseReplicationInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - Provider specific reverse replication input. + ProviderSpecificDetails BasicReverseReplicationProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ReverseReplicationInputProperties struct. +func (rrip *ReverseReplicationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rrip.FailoverDirection = &failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReverseReplicationProviderSpecificInput(*v) + if err != nil { + return err + } + rrip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicReverseReplicationProviderSpecificInput provider specific reverse replication input. +type BasicReverseReplicationProviderSpecificInput interface { + AsA2AReprotectInput() (*A2AReprotectInput, bool) + AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) + AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) + AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) + AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) + AsInMageReprotectInput() (*InMageReprotectInput, bool) + AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) +} + +// ReverseReplicationProviderSpecificInput provider specific reverse replication input. +type ReverseReplicationProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReverseReplicationProviderSpecificInput(body []byte) (BasicReverseReplicationProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A): + var ari A2AReprotectInput + err := json.Unmarshal(body, &ari) + return ari, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvrari HyperVReplicaAzureReprotectInput + err := json.Unmarshal(body, &hvrari) + return hvrari, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2): + var imavri InMageAzureV2ReprotectInput + err := json.Unmarshal(body, &imavri) + return imavri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback): + var imrfri InMageRcmFailbackReprotectInput + err := json.Unmarshal(body, &imrfri) + return imrfri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm): + var imrri InMageRcmReprotectInput + err := json.Unmarshal(body, &imrri) + return imrri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage): + var imri InMageReprotectInput + err := json.Unmarshal(body, &imri) + return imri, err + default: + var rrpsi ReverseReplicationProviderSpecificInput + err := json.Unmarshal(body, &rrpsi) + return rrpsi, err + } +} +func unmarshalBasicReverseReplicationProviderSpecificInputArray(body []byte) ([]BasicReverseReplicationProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rrpsiArray := make([]BasicReverseReplicationProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rrpsi, err := unmarshalBasicReverseReplicationProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rrpsiArray[index] = rrpsi + } + return rrpsiArray, nil +} + +// MarshalJSON is the custom marshaler for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) MarshalJSON() ([]byte, error) { + rrpsi.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput + objectMap := make(map[string]interface{}) + if rrpsi.InstanceType != "" { + objectMap["instanceType"] = rrpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return &rrpsi, true +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &rrpsi, true +} + +// RoleAssignment azure role assignment details. +type RoleAssignment struct { + // ID - The ARM Id of the role assignment. + ID *string `json:"id,omitempty"` + // Name - The name of the role assignment. + Name *string `json:"name,omitempty"` + // Scope - Role assignment scope. + Scope *string `json:"scope,omitempty"` + // PrincipalID - Principal Id. + PrincipalID *string `json:"principalId,omitempty"` + // RoleDefinitionID - Role definition id. + RoleDefinitionID *string `json:"roleDefinitionId,omitempty"` +} + +// RunAsAccount CS Accounts Details. +type RunAsAccount struct { + // AccountID - The CS RunAs account Id. + AccountID *string `json:"accountId,omitempty"` + // AccountName - The CS RunAs account name. + AccountName *string `json:"accountName,omitempty"` +} + +// ScriptActionTaskDetails this class represents the script action task details. +type ScriptActionTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // Path - The path. + Path *string `json:"path,omitempty"` + // Output - The output. + Output *string `json:"output,omitempty"` + // IsPrimarySideScript - A value indicating whether it is a primary side script or not. + IsPrimarySideScript *bool `json:"isPrimarySideScript,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) MarshalJSON() ([]byte, error) { + satd.InstanceType = InstanceTypeScriptActionTaskDetails + objectMap := make(map[string]interface{}) + if satd.Name != nil { + objectMap["name"] = satd.Name + } + if satd.Path != nil { + objectMap["path"] = satd.Path + } + if satd.Output != nil { + objectMap["output"] = satd.Output + } + if satd.IsPrimarySideScript != nil { + objectMap["isPrimarySideScript"] = satd.IsPrimarySideScript + } + if satd.InstanceType != "" { + objectMap["instanceType"] = satd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return &satd, true +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &satd, true +} + +// ServiceError ASR error model. +type ServiceError struct { + // Code - Error code. + Code *string `json:"code,omitempty"` + // Message - Error message. + Message *string `json:"message,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ActivityID - Activity Id. + ActivityID *string `json:"activityId,omitempty"` +} + +// BasicStorageAccountCustomDetails storage account custom input. +type BasicStorageAccountCustomDetails interface { + AsExistingStorageAccount() (*ExistingStorageAccount, bool) + AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) +} + +// StorageAccountCustomDetails storage account custom input. +type StorageAccountCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails', 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicStorageAccountCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicStorageAccountCustomDetails(body []byte) (BasicStorageAccountCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting): + var esa ExistingStorageAccount + err := json.Unmarshal(body, &esa) + return esa, err + default: + var sacd StorageAccountCustomDetails + err := json.Unmarshal(body, &sacd) + return sacd, err + } +} +func unmarshalBasicStorageAccountCustomDetailsArray(body []byte) ([]BasicStorageAccountCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sacdArray := make([]BasicStorageAccountCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sacd, err := unmarshalBasicStorageAccountCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + sacdArray[index] = sacd + } + return sacdArray, nil +} + +// MarshalJSON is the custom marshaler for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) MarshalJSON() ([]byte, error) { + sacd.ResourceType = ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails + objectMap := make(map[string]interface{}) + if sacd.ResourceType != "" { + objectMap["resourceType"] = sacd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingStorageAccount is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsExistingStorageAccount() (*ExistingStorageAccount, bool) { + return nil, false +} + +// AsStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) { + return &sacd, true +} + +// AsBasicStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsBasicStorageAccountCustomDetails() (BasicStorageAccountCustomDetails, bool) { + return &sacd, true +} + +// StorageClassification storage object definition. +type StorageClassification struct { + autorest.Response `json:"-"` + // Properties - Properties of the storage object. + Properties *StorageClassificationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageClassification. +func (sc StorageClassification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sc.Properties != nil { + objectMap["properties"] = sc.Properties + } + if sc.Location != nil { + objectMap["location"] = sc.Location + } + return json.Marshal(objectMap) +} + +// StorageClassificationCollection collection of storage details. +type StorageClassificationCollection struct { + autorest.Response `json:"-"` + // Value - The storage details. + Value *[]StorageClassification `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// StorageClassificationCollectionIterator provides access to a complete listing of StorageClassification +// values. +type StorageClassificationCollectionIterator struct { + i int + page StorageClassificationCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StorageClassificationCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StorageClassificationCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StorageClassificationCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StorageClassificationCollectionIterator) Response() StorageClassificationCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StorageClassificationCollectionIterator) Value() StorageClassification { + if !iter.page.NotDone() { + return StorageClassification{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StorageClassificationCollectionIterator type. +func NewStorageClassificationCollectionIterator(page StorageClassificationCollectionPage) StorageClassificationCollectionIterator { + return StorageClassificationCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scc StorageClassificationCollection) IsEmpty() bool { + return scc.Value == nil || len(*scc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scc StorageClassificationCollection) hasNextLink() bool { + return scc.NextLink != nil && len(*scc.NextLink) != 0 +} + +// storageClassificationCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scc StorageClassificationCollection) storageClassificationCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !scc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scc.NextLink))) +} + +// StorageClassificationCollectionPage contains a page of StorageClassification values. +type StorageClassificationCollectionPage struct { + fn func(context.Context, StorageClassificationCollection) (StorageClassificationCollection, error) + scc StorageClassificationCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StorageClassificationCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.scc) + if err != nil { + return err + } + page.scc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StorageClassificationCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StorageClassificationCollectionPage) NotDone() bool { + return !page.scc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StorageClassificationCollectionPage) Response() StorageClassificationCollection { + return page.scc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StorageClassificationCollectionPage) Values() []StorageClassification { + if page.scc.IsEmpty() { + return nil + } + return *page.scc.Value +} + +// Creates a new instance of the StorageClassificationCollectionPage type. +func NewStorageClassificationCollectionPage(cur StorageClassificationCollection, getNextPage func(context.Context, StorageClassificationCollection) (StorageClassificationCollection, error)) StorageClassificationCollectionPage { + return StorageClassificationCollectionPage{ + fn: getNextPage, + scc: cur, + } +} + +// StorageClassificationMapping storage mapping object. +type StorageClassificationMapping struct { + autorest.Response `json:"-"` + // Properties - Properties of the storage mapping object. + Properties *StorageClassificationMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageClassificationMapping. +func (scm StorageClassificationMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scm.Properties != nil { + objectMap["properties"] = scm.Properties + } + if scm.Location != nil { + objectMap["location"] = scm.Location + } + return json.Marshal(objectMap) +} + +// StorageClassificationMappingCollection collection of storage mapping details. +type StorageClassificationMappingCollection struct { + autorest.Response `json:"-"` + // Value - The storage details. + Value *[]StorageClassificationMapping `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// StorageClassificationMappingCollectionIterator provides access to a complete listing of +// StorageClassificationMapping values. +type StorageClassificationMappingCollectionIterator struct { + i int + page StorageClassificationMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StorageClassificationMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StorageClassificationMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StorageClassificationMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StorageClassificationMappingCollectionIterator) Response() StorageClassificationMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StorageClassificationMappingCollectionIterator) Value() StorageClassificationMapping { + if !iter.page.NotDone() { + return StorageClassificationMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StorageClassificationMappingCollectionIterator type. +func NewStorageClassificationMappingCollectionIterator(page StorageClassificationMappingCollectionPage) StorageClassificationMappingCollectionIterator { + return StorageClassificationMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scmc StorageClassificationMappingCollection) IsEmpty() bool { + return scmc.Value == nil || len(*scmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scmc StorageClassificationMappingCollection) hasNextLink() bool { + return scmc.NextLink != nil && len(*scmc.NextLink) != 0 +} + +// storageClassificationMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scmc StorageClassificationMappingCollection) storageClassificationMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !scmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scmc.NextLink))) +} + +// StorageClassificationMappingCollectionPage contains a page of StorageClassificationMapping values. +type StorageClassificationMappingCollectionPage struct { + fn func(context.Context, StorageClassificationMappingCollection) (StorageClassificationMappingCollection, error) + scmc StorageClassificationMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StorageClassificationMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.scmc) + if err != nil { + return err + } + page.scmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StorageClassificationMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StorageClassificationMappingCollectionPage) NotDone() bool { + return !page.scmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StorageClassificationMappingCollectionPage) Response() StorageClassificationMappingCollection { + return page.scmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StorageClassificationMappingCollectionPage) Values() []StorageClassificationMapping { + if page.scmc.IsEmpty() { + return nil + } + return *page.scmc.Value +} + +// Creates a new instance of the StorageClassificationMappingCollectionPage type. +func NewStorageClassificationMappingCollectionPage(cur StorageClassificationMappingCollection, getNextPage func(context.Context, StorageClassificationMappingCollection) (StorageClassificationMappingCollection, error)) StorageClassificationMappingCollectionPage { + return StorageClassificationMappingCollectionPage{ + fn: getNextPage, + scmc: cur, + } +} + +// StorageClassificationMappingInput storage mapping input. +type StorageClassificationMappingInput struct { + // Properties - Storage mapping input properties. + Properties *StorageMappingInputProperties `json:"properties,omitempty"` +} + +// StorageClassificationMappingProperties storage mapping properties. +type StorageClassificationMappingProperties struct { + // TargetStorageClassificationID - Target storage object Id. + TargetStorageClassificationID *string `json:"targetStorageClassificationId,omitempty"` +} + +// StorageClassificationProperties storage object properties. +type StorageClassificationProperties struct { + // FriendlyName - Friendly name of the Storage classification. + FriendlyName *string `json:"friendlyName,omitempty"` +} + +// StorageMappingInputProperties storage mapping input properties. +type StorageMappingInputProperties struct { + // TargetStorageClassificationID - The ID of the storage object. + TargetStorageClassificationID *string `json:"targetStorageClassificationId,omitempty"` +} + +// Subnet subnets of the network. +type Subnet struct { + // Name - The subnet name. + Name *string `json:"name,omitempty"` + // FriendlyName - The subnet friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // AddressList - The list of addresses for the subnet. + AddressList *[]string `json:"addressList,omitempty"` +} + +// SupportedOperatingSystems supported operating systems. +type SupportedOperatingSystems struct { + autorest.Response `json:"-"` + // Properties - The supported operating systems properties. + Properties *SupportedOSProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for SupportedOperatingSystems. +func (sos SupportedOperatingSystems) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sos.Properties != nil { + objectMap["properties"] = sos.Properties + } + if sos.Location != nil { + objectMap["location"] = sos.Location + } + return json.Marshal(objectMap) +} + +// SupportedOSDetails supported operating system details. +type SupportedOSDetails struct { + // OsName - The name. + OsName *string `json:"osName,omitempty"` + // OsType - The type. + OsType *string `json:"osType,omitempty"` + // OsVersions - The list of version for operating system. + OsVersions *[]OSVersionWrapper `json:"osVersions,omitempty"` +} + +// SupportedOSProperties supported operating systems properties. +type SupportedOSProperties struct { + // SupportedOsList - The supported operating systems property list. + SupportedOsList *[]SupportedOSProperty `json:"supportedOsList,omitempty"` +} + +// SupportedOSProperty supported operating systems property. +type SupportedOSProperty struct { + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` + // SupportedOs - The list of supported operating systems. + SupportedOs *[]SupportedOSDetails `json:"supportedOs,omitempty"` +} + +// SwitchProtectionInput switch protection input. +type SwitchProtectionInput struct { + // Properties - Switch protection properties. + Properties *SwitchProtectionInputProperties `json:"properties,omitempty"` +} + +// SwitchProtectionInputProperties switch protection input properties. +type SwitchProtectionInputProperties struct { + // ReplicationProtectedItemName - The unique replication protected item name. + ReplicationProtectedItemName *string `json:"replicationProtectedItemName,omitempty"` + // ProviderSpecificDetails - Provider specific switch protection input. + ProviderSpecificDetails BasicSwitchProtectionProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SwitchProtectionInputProperties struct. +func (spip *SwitchProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "replicationProtectedItemName": + if v != nil { + var replicationProtectedItemName string + err = json.Unmarshal(*v, &replicationProtectedItemName) + if err != nil { + return err + } + spip.ReplicationProtectedItemName = &replicationProtectedItemName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicSwitchProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + spip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// SwitchProtectionJobDetails this class represents details for switch protection job. +type SwitchProtectionJobDetails struct { + // NewReplicationProtectedItemID - ARM Id of the new replication protected item. + NewReplicationProtectedItemID *string `json:"newReplicationProtectedItemId,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) MarshalJSON() ([]byte, error) { + spjd.InstanceType = InstanceTypeSwitchProtectionJobDetails + objectMap := make(map[string]interface{}) + if spjd.NewReplicationProtectedItemID != nil { + objectMap["newReplicationProtectedItemId"] = spjd.NewReplicationProtectedItemID + } + if spjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = spjd.AffectedObjectDetails + } + if spjd.InstanceType != "" { + objectMap["instanceType"] = spjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return &spjd, true +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &spjd, true +} + +// BasicSwitchProtectionProviderSpecificInput provider specific switch protection input. +type BasicSwitchProtectionProviderSpecificInput interface { + AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) + AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) +} + +// SwitchProtectionProviderSpecificInput provider specific switch protection input. +type SwitchProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput', 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicSwitchProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicSwitchProtectionProviderSpecificInput(body []byte) (BasicSwitchProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A): + var aspi A2ASwitchProtectionInput + err := json.Unmarshal(body, &aspi) + return aspi, err + default: + var sppsi SwitchProtectionProviderSpecificInput + err := json.Unmarshal(body, &sppsi) + return sppsi, err + } +} +func unmarshalBasicSwitchProtectionProviderSpecificInputArray(body []byte) ([]BasicSwitchProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sppsiArray := make([]BasicSwitchProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sppsi, err := unmarshalBasicSwitchProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + sppsiArray[index] = sppsi + } + return sppsiArray, nil +} + +// MarshalJSON is the custom marshaler for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + sppsi.InstanceType = InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if sppsi.InstanceType != "" { + objectMap["instanceType"] = sppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ASwitchProtectionInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) { + return nil, false +} + +// AsSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) { + return &sppsi, true +} + +// AsBasicSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsBasicSwitchProtectionProviderSpecificInput() (BasicSwitchProtectionProviderSpecificInput, bool) { + return &sppsi, true +} + +// SwitchProviderInput input definition for switch provider. +type SwitchProviderInput struct { + // Properties - Switch provider input properties. + Properties *SwitchProviderInputProperties `json:"properties,omitempty"` +} + +// SwitchProviderInputProperties input definition for switch provider input properties. +type SwitchProviderInputProperties struct { + // TargetInstanceType - Target provider type. + TargetInstanceType *string `json:"targetInstanceType,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicSwitchProviderProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SwitchProviderInputProperties struct. +func (spip *SwitchProviderInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetInstanceType": + if v != nil { + var targetInstanceType string + err = json.Unmarshal(*v, &targetInstanceType) + if err != nil { + return err + } + spip.TargetInstanceType = &targetInstanceType + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicSwitchProviderProviderSpecificInput(*v) + if err != nil { + return err + } + spip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicSwitchProviderProviderSpecificInput provider specific switch provider input. +type BasicSwitchProviderProviderSpecificInput interface { + AsInMageAzureV2SwitchProviderProviderInput() (*InMageAzureV2SwitchProviderProviderInput, bool) + AsSwitchProviderProviderSpecificInput() (*SwitchProviderProviderSpecificInput, bool) +} + +// SwitchProviderProviderSpecificInput provider specific switch provider input. +type SwitchProviderProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeSwitchProviderProviderSpecificInput', 'InstanceTypeInMageAzureV2' + InstanceType InstanceTypeBasicSwitchProviderProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicSwitchProviderProviderSpecificInput(body []byte) (BasicSwitchProviderProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInMageAzureV2): + var imavsppi InMageAzureV2SwitchProviderProviderInput + err := json.Unmarshal(body, &imavsppi) + return imavsppi, err + default: + var sppsi SwitchProviderProviderSpecificInput + err := json.Unmarshal(body, &sppsi) + return sppsi, err + } +} +func unmarshalBasicSwitchProviderProviderSpecificInputArray(body []byte) ([]BasicSwitchProviderProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sppsiArray := make([]BasicSwitchProviderProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sppsi, err := unmarshalBasicSwitchProviderProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + sppsiArray[index] = sppsi + } + return sppsiArray, nil +} + +// MarshalJSON is the custom marshaler for SwitchProviderProviderSpecificInput. +func (sppsi SwitchProviderProviderSpecificInput) MarshalJSON() ([]byte, error) { + sppsi.InstanceType = InstanceTypeSwitchProviderProviderSpecificInput + objectMap := make(map[string]interface{}) + if sppsi.InstanceType != "" { + objectMap["instanceType"] = sppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageAzureV2SwitchProviderProviderInput is the BasicSwitchProviderProviderSpecificInput implementation for SwitchProviderProviderSpecificInput. +func (sppsi SwitchProviderProviderSpecificInput) AsInMageAzureV2SwitchProviderProviderInput() (*InMageAzureV2SwitchProviderProviderInput, bool) { + return nil, false +} + +// AsSwitchProviderProviderSpecificInput is the BasicSwitchProviderProviderSpecificInput implementation for SwitchProviderProviderSpecificInput. +func (sppsi SwitchProviderProviderSpecificInput) AsSwitchProviderProviderSpecificInput() (*SwitchProviderProviderSpecificInput, bool) { + return &sppsi, true +} + +// AsBasicSwitchProviderProviderSpecificInput is the BasicSwitchProviderProviderSpecificInput implementation for SwitchProviderProviderSpecificInput. +func (sppsi SwitchProviderProviderSpecificInput) AsBasicSwitchProviderProviderSpecificInput() (BasicSwitchProviderProviderSpecificInput, bool) { + return &sppsi, true +} + +// TargetComputeSize represents applicable recovery vm sizes. +type TargetComputeSize struct { + // ID - The Id. + ID *string `json:"id,omitempty"` + // Name - The name. + Name *string `json:"name,omitempty"` + // Type - The Type of the object. + Type *string `json:"type,omitempty"` + // Properties - The custom data. + Properties *TargetComputeSizeProperties `json:"properties,omitempty"` +} + +// TargetComputeSizeCollection target compute size collection. +type TargetComputeSizeCollection struct { + autorest.Response `json:"-"` + // Value - The list of target compute sizes. + Value *[]TargetComputeSize `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// TargetComputeSizeCollectionIterator provides access to a complete listing of TargetComputeSize values. +type TargetComputeSizeCollectionIterator struct { + i int + page TargetComputeSizeCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *TargetComputeSizeCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizeCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *TargetComputeSizeCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TargetComputeSizeCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter TargetComputeSizeCollectionIterator) Response() TargetComputeSizeCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter TargetComputeSizeCollectionIterator) Value() TargetComputeSize { + if !iter.page.NotDone() { + return TargetComputeSize{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the TargetComputeSizeCollectionIterator type. +func NewTargetComputeSizeCollectionIterator(page TargetComputeSizeCollectionPage) TargetComputeSizeCollectionIterator { + return TargetComputeSizeCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (tcsc TargetComputeSizeCollection) IsEmpty() bool { + return tcsc.Value == nil || len(*tcsc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (tcsc TargetComputeSizeCollection) hasNextLink() bool { + return tcsc.NextLink != nil && len(*tcsc.NextLink) != 0 +} + +// targetComputeSizeCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tcsc TargetComputeSizeCollection) targetComputeSizeCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !tcsc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(tcsc.NextLink))) +} + +// TargetComputeSizeCollectionPage contains a page of TargetComputeSize values. +type TargetComputeSizeCollectionPage struct { + fn func(context.Context, TargetComputeSizeCollection) (TargetComputeSizeCollection, error) + tcsc TargetComputeSizeCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *TargetComputeSizeCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizeCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.tcsc) + if err != nil { + return err + } + page.tcsc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *TargetComputeSizeCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TargetComputeSizeCollectionPage) NotDone() bool { + return !page.tcsc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TargetComputeSizeCollectionPage) Response() TargetComputeSizeCollection { + return page.tcsc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TargetComputeSizeCollectionPage) Values() []TargetComputeSize { + if page.tcsc.IsEmpty() { + return nil + } + return *page.tcsc.Value +} + +// Creates a new instance of the TargetComputeSizeCollectionPage type. +func NewTargetComputeSizeCollectionPage(cur TargetComputeSizeCollection, getNextPage func(context.Context, TargetComputeSizeCollection) (TargetComputeSizeCollection, error)) TargetComputeSizeCollectionPage { + return TargetComputeSizeCollectionPage{ + fn: getNextPage, + tcsc: cur, + } +} + +// TargetComputeSizeProperties represents applicable recovery vm sizes properties. +type TargetComputeSizeProperties struct { + // Name - Target compute size name. + Name *string `json:"name,omitempty"` + // FriendlyName - Target compute size display name. + FriendlyName *string `json:"friendlyName,omitempty"` + // CPUCoresCount - The maximum cpu cores count supported by target compute size. + CPUCoresCount *int32 `json:"cpuCoresCount,omitempty"` + // VCPUsAvailable - READ-ONLY; The Available vCPUs supported by target compute size. + VCPUsAvailable *int32 `json:"vCPUsAvailable,omitempty"` + // MemoryInGB - The maximum memory in GB supported by target compute size. + MemoryInGB *float64 `json:"memoryInGB,omitempty"` + // MaxDataDiskCount - The maximum data disks count supported by target compute size. + MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` + // MaxNicsCount - The maximum Nics count supported by target compute size. + MaxNicsCount *int32 `json:"maxNicsCount,omitempty"` + // Errors - The reasons why the target compute size is not applicable for the protected item. + Errors *[]ComputeSizeErrorDetails `json:"errors,omitempty"` + // HighIopsSupported - The value indicating whether the target compute size supports high Iops. + HighIopsSupported *string `json:"highIopsSupported,omitempty"` + // HyperVGenerations - The supported HyperV Generations. + HyperVGenerations *[]string `json:"hyperVGenerations,omitempty"` +} + +// MarshalJSON is the custom marshaler for TargetComputeSizeProperties. +func (tcsp TargetComputeSizeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tcsp.Name != nil { + objectMap["name"] = tcsp.Name + } + if tcsp.FriendlyName != nil { + objectMap["friendlyName"] = tcsp.FriendlyName + } + if tcsp.CPUCoresCount != nil { + objectMap["cpuCoresCount"] = tcsp.CPUCoresCount + } + if tcsp.MemoryInGB != nil { + objectMap["memoryInGB"] = tcsp.MemoryInGB + } + if tcsp.MaxDataDiskCount != nil { + objectMap["maxDataDiskCount"] = tcsp.MaxDataDiskCount + } + if tcsp.MaxNicsCount != nil { + objectMap["maxNicsCount"] = tcsp.MaxNicsCount + } + if tcsp.Errors != nil { + objectMap["errors"] = tcsp.Errors + } + if tcsp.HighIopsSupported != nil { + objectMap["highIopsSupported"] = tcsp.HighIopsSupported + } + if tcsp.HyperVGenerations != nil { + objectMap["hyperVGenerations"] = tcsp.HyperVGenerations + } + return json.Marshal(objectMap) +} + +// BasicTaskTypeDetails task details based on specific task type. +type BasicTaskTypeDetails interface { + AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) + AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) + AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) + AsJobTaskDetails() (*JobTaskDetails, bool) + AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) + AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) + AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) + AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) + AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) + AsTaskTypeDetails() (*TaskTypeDetails, bool) +} + +// TaskTypeDetails task details based on specific task type. +type TaskTypeDetails struct { + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicTaskTypeDetails(body []byte) (BasicTaskTypeDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAutomationRunbookTaskDetails): + var artd AutomationRunbookTaskDetails + err := json.Unmarshal(body, &artd) + return artd, err + case string(InstanceTypeConsistencyCheckTaskDetails): + var cctd ConsistencyCheckTaskDetails + err := json.Unmarshal(body, &cctd) + return cctd, err + case string(InstanceTypeFabricReplicationGroupTaskDetails): + var frgtd FabricReplicationGroupTaskDetails + err := json.Unmarshal(body, &frgtd) + return frgtd, err + case string(InstanceTypeJobTaskDetails): + var jtd JobTaskDetails + err := json.Unmarshal(body, &jtd) + return jtd, err + case string(InstanceTypeManualActionTaskDetails): + var matd ManualActionTaskDetails + err := json.Unmarshal(body, &matd) + return matd, err + case string(InstanceTypeScriptActionTaskDetails): + var satd ScriptActionTaskDetails + err := json.Unmarshal(body, &satd) + return satd, err + case string(InstanceTypeVirtualMachineTaskDetails): + var vmtd VirtualMachineTaskDetails + err := json.Unmarshal(body, &vmtd) + return vmtd, err + case string(InstanceTypeVMNicUpdatesTaskDetails): + var vnutd VMNicUpdatesTaskDetails + err := json.Unmarshal(body, &vnutd) + return vnutd, err + default: + var ttd TaskTypeDetails + err := json.Unmarshal(body, &ttd) + return ttd, err + } +} +func unmarshalBasicTaskTypeDetailsArray(body []byte) ([]BasicTaskTypeDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ttdArray := make([]BasicTaskTypeDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ttd, err := unmarshalBasicTaskTypeDetails(*rawMessage) + if err != nil { + return nil, err + } + ttdArray[index] = ttd + } + return ttdArray, nil +} + +// MarshalJSON is the custom marshaler for TaskTypeDetails. +func (ttd TaskTypeDetails) MarshalJSON() ([]byte, error) { + ttd.InstanceType = InstanceTypeTaskTypeDetails + objectMap := make(map[string]interface{}) + if ttd.InstanceType != "" { + objectMap["instanceType"] = ttd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return &ttd, true +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &ttd, true +} + +// TestFailoverCleanupInput input definition for test failover cleanup. +type TestFailoverCleanupInput struct { + // Properties - Test failover cleanup input properties. + Properties *TestFailoverCleanupInputProperties `json:"properties,omitempty"` +} + +// TestFailoverCleanupInputProperties input definition for test failover cleanup input properties. +type TestFailoverCleanupInputProperties struct { + // Comments - Test failover cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// TestFailoverInput input definition for test failover. +type TestFailoverInput struct { + // Properties - Test failover input properties. + Properties *TestFailoverInputProperties `json:"properties,omitempty"` +} + +// TestFailoverInputProperties input definition for test failover input properties. +type TestFailoverInputProperties struct { + // FailoverDirection - Test failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // NetworkType - Network type to be used for test failover. + NetworkType *string `json:"networkType,omitempty"` + // NetworkID - The id of the network to be used for test failover. + NetworkID *string `json:"networkId,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicTestFailoverProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TestFailoverInputProperties struct. +func (tfip *TestFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + tfip.FailoverDirection = &failoverDirection + } + case "networkType": + if v != nil { + var networkType string + err = json.Unmarshal(*v, &networkType) + if err != nil { + return err + } + tfip.NetworkType = &networkType + } + case "networkId": + if v != nil { + var networkID string + err = json.Unmarshal(*v, &networkID) + if err != nil { + return err + } + tfip.NetworkID = &networkID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicTestFailoverProviderSpecificInput(*v) + if err != nil { + return err + } + tfip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// TestFailoverJobDetails this class represents the details for a test failover job. +type TestFailoverJobDetails struct { + // TestFailoverStatus - The test failover status. + TestFailoverStatus *string `json:"testFailoverStatus,omitempty"` + // Comments - The test failover comments. + Comments *string `json:"comments,omitempty"` + // NetworkName - The test network name. + NetworkName *string `json:"networkName,omitempty"` + // NetworkFriendlyName - The test network friendly name. + NetworkFriendlyName *string `json:"networkFriendlyName,omitempty"` + // NetworkType - The test network type (see TestFailoverInput enum for possible values). + NetworkType *string `json:"networkType,omitempty"` + // ProtectedItemDetails - The test VM details. + ProtectedItemDetails *[]FailoverReplicationProtectedItemDetails `json:"protectedItemDetails,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) MarshalJSON() ([]byte, error) { + tfjd.InstanceType = InstanceTypeTestFailoverJobDetails + objectMap := make(map[string]interface{}) + if tfjd.TestFailoverStatus != nil { + objectMap["testFailoverStatus"] = tfjd.TestFailoverStatus + } + if tfjd.Comments != nil { + objectMap["comments"] = tfjd.Comments + } + if tfjd.NetworkName != nil { + objectMap["networkName"] = tfjd.NetworkName + } + if tfjd.NetworkFriendlyName != nil { + objectMap["networkFriendlyName"] = tfjd.NetworkFriendlyName + } + if tfjd.NetworkType != nil { + objectMap["networkType"] = tfjd.NetworkType + } + if tfjd.ProtectedItemDetails != nil { + objectMap["protectedItemDetails"] = tfjd.ProtectedItemDetails + } + if tfjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = tfjd.AffectedObjectDetails + } + if tfjd.InstanceType != "" { + objectMap["instanceType"] = tfjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return &tfjd, true +} + +// AsJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &tfjd, true +} + +// BasicTestFailoverProviderSpecificInput provider specific test failover input. +type BasicTestFailoverProviderSpecificInput interface { + AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) + AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) + AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) + AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) + AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) + AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) +} + +// TestFailoverProviderSpecificInput provider specific test failover input. +type TestFailoverProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicTestFailoverProviderSpecificInput(body []byte) (BasicTestFailoverProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A): + var atfi A2ATestFailoverInput + err := json.Unmarshal(body, &atfi) + return atfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvratfi HyperVReplicaAzureTestFailoverInput + err := json.Unmarshal(body, &hvratfi) + return hvratfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2): + var imavtfi InMageAzureV2TestFailoverInput + err := json.Unmarshal(body, &imavtfi) + return imavtfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm): + var imrtfi InMageRcmTestFailoverInput + err := json.Unmarshal(body, &imrtfi) + return imrtfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage): + var imtfi InMageTestFailoverInput + err := json.Unmarshal(body, &imtfi) + return imtfi, err + default: + var tfpsi TestFailoverProviderSpecificInput + err := json.Unmarshal(body, &tfpsi) + return tfpsi, err + } +} +func unmarshalBasicTestFailoverProviderSpecificInputArray(body []byte) ([]BasicTestFailoverProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tfpsiArray := make([]BasicTestFailoverProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + tfpsi, err := unmarshalBasicTestFailoverProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + tfpsiArray[index] = tfpsi + } + return tfpsiArray, nil +} + +// MarshalJSON is the custom marshaler for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) MarshalJSON() ([]byte, error) { + tfpsi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput + objectMap := make(map[string]interface{}) + if tfpsi.InstanceType != "" { + objectMap["instanceType"] = tfpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return &tfpsi, true +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &tfpsi, true +} + +// TestMigrateCleanupInput input for test migrate cleanup. +type TestMigrateCleanupInput struct { + // Properties - Test migrate cleanup input properties. + Properties *TestMigrateCleanupInputProperties `json:"properties,omitempty"` +} + +// TestMigrateCleanupInputProperties test migrate cleanup input properties. +type TestMigrateCleanupInputProperties struct { + // Comments - Test migrate cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// TestMigrateInput input for test migrate. +type TestMigrateInput struct { + // Properties - Test migrate input properties. + Properties *TestMigrateInputProperties `json:"properties,omitempty"` +} + +// TestMigrateInputProperties test migrate input properties. +type TestMigrateInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicTestMigrateProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TestMigrateInputProperties struct. +func (tmip *TestMigrateInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicTestMigrateProviderSpecificInput(*v) + if err != nil { + return err + } + tmip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicTestMigrateProviderSpecificInput test migrate provider specific input. +type BasicTestMigrateProviderSpecificInput interface { + AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) + AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) +} + +// TestMigrateProviderSpecificInput test migrate provider specific input. +type TestMigrateProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput', 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicTestMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicTestMigrateProviderSpecificInput(body []byte) (BasicTestMigrateProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt): + var vmctmi VMwareCbtTestMigrateInput + err := json.Unmarshal(body, &vmctmi) + return vmctmi, err + default: + var tmpsi TestMigrateProviderSpecificInput + err := json.Unmarshal(body, &tmpsi) + return tmpsi, err + } +} +func unmarshalBasicTestMigrateProviderSpecificInputArray(body []byte) ([]BasicTestMigrateProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tmpsiArray := make([]BasicTestMigrateProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + tmpsi, err := unmarshalBasicTestMigrateProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + tmpsiArray[index] = tmpsi + } + return tmpsiArray, nil +} + +// MarshalJSON is the custom marshaler for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) MarshalJSON() ([]byte, error) { + tmpsi.InstanceType = InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput + objectMap := make(map[string]interface{}) + if tmpsi.InstanceType != "" { + objectMap["instanceType"] = tmpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtTestMigrateInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) { + return nil, false +} + +// AsTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) { + return &tmpsi, true +} + +// AsBasicTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsBasicTestMigrateProviderSpecificInput() (BasicTestMigrateProviderSpecificInput, bool) { + return &tmpsi, true +} + +// UnplannedFailoverInput input definition for unplanned failover. +type UnplannedFailoverInput struct { + // Properties - Unplanned failover input properties. + Properties *UnplannedFailoverInputProperties `json:"properties,omitempty"` +} + +// UnplannedFailoverInputProperties input definition for unplanned failover input properties. +type UnplannedFailoverInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // SourceSiteOperations - Source site operations status. + SourceSiteOperations *string `json:"sourceSiteOperations,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicUnplannedFailoverProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UnplannedFailoverInputProperties struct. +func (ufip *UnplannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + ufip.FailoverDirection = &failoverDirection + } + case "sourceSiteOperations": + if v != nil { + var sourceSiteOperations string + err = json.Unmarshal(*v, &sourceSiteOperations) + if err != nil { + return err + } + ufip.SourceSiteOperations = &sourceSiteOperations + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUnplannedFailoverProviderSpecificInput(*v) + if err != nil { + return err + } + ufip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUnplannedFailoverProviderSpecificInput provider specific unplanned failover input. +type BasicUnplannedFailoverProviderSpecificInput interface { + AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) + AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) + AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) + AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) + AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) + AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) +} + +// UnplannedFailoverProviderSpecificInput provider specific unplanned failover input. +type UnplannedFailoverProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUnplannedFailoverProviderSpecificInput(body []byte) (BasicUnplannedFailoverProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A): + var aufi A2AUnplannedFailoverInput + err := json.Unmarshal(body, &aufi) + return aufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraufi HyperVReplicaAzureUnplannedFailoverInput + err := json.Unmarshal(body, &hvraufi) + return hvraufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2): + var imavufi InMageAzureV2UnplannedFailoverInput + err := json.Unmarshal(body, &imavufi) + return imavufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm): + var imrufi InMageRcmUnplannedFailoverInput + err := json.Unmarshal(body, &imrufi) + return imrufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage): + var imufi InMageUnplannedFailoverInput + err := json.Unmarshal(body, &imufi) + return imufi, err + default: + var ufpsi UnplannedFailoverProviderSpecificInput + err := json.Unmarshal(body, &ufpsi) + return ufpsi, err + } +} +func unmarshalBasicUnplannedFailoverProviderSpecificInputArray(body []byte) ([]BasicUnplannedFailoverProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ufpsiArray := make([]BasicUnplannedFailoverProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ufpsi, err := unmarshalBasicUnplannedFailoverProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + ufpsiArray[index] = ufpsi + } + return ufpsiArray, nil +} + +// MarshalJSON is the custom marshaler for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) MarshalJSON() ([]byte, error) { + ufpsi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput + objectMap := make(map[string]interface{}) + if ufpsi.InstanceType != "" { + objectMap["instanceType"] = ufpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return &ufpsi, true +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &ufpsi, true +} + +// UpdateApplianceForReplicationProtectedItemInput update appliance for replication protected item input. +type UpdateApplianceForReplicationProtectedItemInput struct { + // Properties - Update appliance replication protected item properties. + Properties *UpdateApplianceForReplicationProtectedItemInputProperties `json:"properties,omitempty"` +} + +// UpdateApplianceForReplicationProtectedItemInputProperties update appliance for protected item input +// properties. +type UpdateApplianceForReplicationProtectedItemInputProperties struct { + // TargetApplianceID - The target appliance Id. + TargetApplianceID *string `json:"targetApplianceId,omitempty"` + // ProviderSpecificDetails - The provider specific input to update replication protected item. + ProviderSpecificDetails BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateApplianceForReplicationProtectedItemInputProperties struct. +func (uafrpiip *UpdateApplianceForReplicationProtectedItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetApplianceId": + if v != nil { + var targetApplianceID string + err = json.Unmarshal(*v, &targetApplianceID) + if err != nil { + return err + } + uafrpiip.TargetApplianceID = &targetApplianceID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput(*v) + if err != nil { + return err + } + uafrpiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput update replication protected item provider +// specific input. +type BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput interface { + AsInMageRcmUpdateApplianceForReplicationProtectedItemInput() (*InMageRcmUpdateApplianceForReplicationProtectedItemInput, bool) + AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (*UpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) +} + +// UpdateApplianceForReplicationProtectedItemProviderSpecificInput update replication protected item provider +// specific input. +type UpdateApplianceForReplicationProtectedItemProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput', 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput(body []byte) (BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm): + var imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput + err := json.Unmarshal(body, &imruafrpii) + return imruafrpii, err + default: + var uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput + err := json.Unmarshal(body, &uafrpipsi) + return uafrpipsi, err + } +} +func unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputArray(body []byte) ([]BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + uafrpipsiArray := make([]BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + uafrpipsi, err := unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + uafrpipsiArray[index] = uafrpipsi + } + return uafrpipsiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) MarshalJSON() ([]byte, error) { + uafrpipsi.InstanceType = InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput + objectMap := make(map[string]interface{}) + if uafrpipsi.InstanceType != "" { + objectMap["instanceType"] = uafrpipsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageRcmUpdateApplianceForReplicationProtectedItemInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) AsInMageRcmUpdateApplianceForReplicationProtectedItemInput() (*InMageRcmUpdateApplianceForReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (*UpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return &uafrpipsi, true +} + +// AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return &uafrpipsi, true +} + +// UpdateDiskInput disk input for update. +type UpdateDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // TargetDiskName - The target disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// UpdateMigrationItemInput update migration item input. +type UpdateMigrationItemInput struct { + // Properties - Update migration item input properties. + Properties *UpdateMigrationItemInputProperties `json:"properties,omitempty"` +} + +// UpdateMigrationItemInputProperties update migration item input properties. +type UpdateMigrationItemInputProperties struct { + // ProviderSpecificDetails - The provider specific input to update migration item. + ProviderSpecificDetails BasicUpdateMigrationItemProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateMigrationItemInputProperties struct. +func (umiip *UpdateMigrationItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateMigrationItemProviderSpecificInput(*v) + if err != nil { + return err + } + umiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateMigrationItemProviderSpecificInput update migration item provider specific input. +type BasicUpdateMigrationItemProviderSpecificInput interface { + AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) + AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) +} + +// UpdateMigrationItemProviderSpecificInput update migration item provider specific input. +type UpdateMigrationItemProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput', 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicUpdateMigrationItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateMigrationItemProviderSpecificInput(body []byte) (BasicUpdateMigrationItemProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt): + var vmcumii VMwareCbtUpdateMigrationItemInput + err := json.Unmarshal(body, &vmcumii) + return vmcumii, err + default: + var umipsi UpdateMigrationItemProviderSpecificInput + err := json.Unmarshal(body, &umipsi) + return umipsi, err + } +} +func unmarshalBasicUpdateMigrationItemProviderSpecificInputArray(body []byte) ([]BasicUpdateMigrationItemProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + umipsiArray := make([]BasicUpdateMigrationItemProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + umipsi, err := unmarshalBasicUpdateMigrationItemProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + umipsiArray[index] = umipsi + } + return umipsiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) MarshalJSON() ([]byte, error) { + umipsi.InstanceType = InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput + objectMap := make(map[string]interface{}) + if umipsi.InstanceType != "" { + objectMap["instanceType"] = umipsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtUpdateMigrationItemInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) { + return nil, false +} + +// AsUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) { + return &umipsi, true +} + +// AsBasicUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsBasicUpdateMigrationItemProviderSpecificInput() (BasicUpdateMigrationItemProviderSpecificInput, bool) { + return &umipsi, true +} + +// UpdateMobilityServiceRequest request to update the mobility service on a protected item. +type UpdateMobilityServiceRequest struct { + // Properties - The properties of the update mobility service request. + Properties *UpdateMobilityServiceRequestProperties `json:"properties,omitempty"` +} + +// UpdateMobilityServiceRequestProperties the properties of an update mobility service request. +type UpdateMobilityServiceRequestProperties struct { + // RunAsAccountID - The CS run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// UpdateNetworkMappingInput update network mapping input. +type UpdateNetworkMappingInput struct { + // Properties - The input properties needed to update network mapping. + Properties *UpdateNetworkMappingInputProperties `json:"properties,omitempty"` +} + +// UpdateNetworkMappingInputProperties common input details for network mapping operation. +type UpdateNetworkMappingInputProperties struct { + // RecoveryFabricName - Recovery fabric name. + RecoveryFabricName *string `json:"recoveryFabricName,omitempty"` + // RecoveryNetworkID - Recovery network Id. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // FabricSpecificDetails - Fabrics specific input network Id. + FabricSpecificDetails BasicFabricSpecificUpdateNetworkMappingInput `json:"fabricSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateNetworkMappingInputProperties struct. +func (unmip *UpdateNetworkMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryFabricName": + if v != nil { + var recoveryFabricName string + err = json.Unmarshal(*v, &recoveryFabricName) + if err != nil { + return err + } + unmip.RecoveryFabricName = &recoveryFabricName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + unmip.RecoveryNetworkID = &recoveryNetworkID + } + case "fabricSpecificDetails": + if v != nil { + fabricSpecificDetails, err := unmarshalBasicFabricSpecificUpdateNetworkMappingInput(*v) + if err != nil { + return err + } + unmip.FabricSpecificDetails = fabricSpecificDetails + } + } + } + + return nil +} + +// UpdatePolicyInput update policy input. +type UpdatePolicyInput struct { + // Properties - The ReplicationProviderSettings. + Properties *UpdatePolicyInputProperties `json:"properties,omitempty"` +} + +// UpdatePolicyInputProperties policy update properties. +type UpdatePolicyInputProperties struct { + // ReplicationProviderSettings - The ReplicationProviderSettings. + ReplicationProviderSettings BasicPolicyProviderSpecificInput `json:"replicationProviderSettings,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdatePolicyInputProperties struct. +func (upip *UpdatePolicyInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "replicationProviderSettings": + if v != nil { + replicationProviderSettings, err := unmarshalBasicPolicyProviderSpecificInput(*v) + if err != nil { + return err + } + upip.ReplicationProviderSettings = replicationProviderSettings + } + } + } + + return nil +} + +// UpdateProtectionContainerMappingInput container pairing update input. +type UpdateProtectionContainerMappingInput struct { + // Properties - Update protection container mapping input properties. + Properties *UpdateProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// UpdateProtectionContainerMappingInputProperties container pairing update input. +type UpdateProtectionContainerMappingInputProperties struct { + // ProviderSpecificInput - Provider specific input for updating protection container mapping. + ProviderSpecificInput BasicReplicationProviderSpecificUpdateContainerMappingInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateProtectionContainerMappingInputProperties struct. +func (upcmip *UpdateProtectionContainerMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(*v) + if err != nil { + return err + } + upcmip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// UpdateRecoveryPlanInput update recovery plan input class. +type UpdateRecoveryPlanInput struct { + // Properties - Recovery plan update properties. + Properties *UpdateRecoveryPlanInputProperties `json:"properties,omitempty"` +} + +// UpdateRecoveryPlanInputProperties recovery plan update properties. +type UpdateRecoveryPlanInputProperties struct { + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` +} + +// UpdateReplicationProtectedItemInput update replication protected item input. +type UpdateReplicationProtectedItemInput struct { + // Properties - Update replication protected item properties. + Properties *UpdateReplicationProtectedItemInputProperties `json:"properties,omitempty"` +} + +// UpdateReplicationProtectedItemInputProperties update protected item input properties. +type UpdateReplicationProtectedItemInputProperties struct { + // RecoveryAzureVMName - Target Azure VM name given by the user. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureVMSize - Target Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // SelectedRecoveryAzureNetworkID - Target Azure Network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The Azure Network Id for test failover. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // VMNics - The list of VM nic details. + VMNics *[]VMNicInputDetails `json:"vmNics,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // RecoveryAvailabilitySetID - The target availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // ProviderSpecificDetails - The provider specific input to update replication protected item. + ProviderSpecificDetails BasicUpdateReplicationProtectedItemProviderInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateReplicationProtectedItemInputProperties struct. +func (urpiip *UpdateReplicationProtectedItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryAzureVMName": + if v != nil { + var recoveryAzureVMName string + err = json.Unmarshal(*v, &recoveryAzureVMName) + if err != nil { + return err + } + urpiip.RecoveryAzureVMName = &recoveryAzureVMName + } + case "recoveryAzureVMSize": + if v != nil { + var recoveryAzureVMSize string + err = json.Unmarshal(*v, &recoveryAzureVMSize) + if err != nil { + return err + } + urpiip.RecoveryAzureVMSize = &recoveryAzureVMSize + } + case "selectedRecoveryAzureNetworkId": + if v != nil { + var selectedRecoveryAzureNetworkID string + err = json.Unmarshal(*v, &selectedRecoveryAzureNetworkID) + if err != nil { + return err + } + urpiip.SelectedRecoveryAzureNetworkID = &selectedRecoveryAzureNetworkID + } + case "selectedTfoAzureNetworkId": + if v != nil { + var selectedTfoAzureNetworkID string + err = json.Unmarshal(*v, &selectedTfoAzureNetworkID) + if err != nil { + return err + } + urpiip.SelectedTfoAzureNetworkID = &selectedTfoAzureNetworkID + } + case "selectedSourceNicId": + if v != nil { + var selectedSourceNicID string + err = json.Unmarshal(*v, &selectedSourceNicID) + if err != nil { + return err + } + urpiip.SelectedSourceNicID = &selectedSourceNicID + } + case "enableRdpOnTargetOption": + if v != nil { + var enableRdpOnTargetOption string + err = json.Unmarshal(*v, &enableRdpOnTargetOption) + if err != nil { + return err + } + urpiip.EnableRdpOnTargetOption = &enableRdpOnTargetOption + } + case "vmNics": + if v != nil { + var VMNics []VMNicInputDetails + err = json.Unmarshal(*v, &VMNics) + if err != nil { + return err + } + urpiip.VMNics = &VMNics + } + case "licenseType": + if v != nil { + var licenseType LicenseType + err = json.Unmarshal(*v, &licenseType) + if err != nil { + return err + } + urpiip.LicenseType = licenseType + } + case "recoveryAvailabilitySetId": + if v != nil { + var recoveryAvailabilitySetID string + err = json.Unmarshal(*v, &recoveryAvailabilitySetID) + if err != nil { + return err + } + urpiip.RecoveryAvailabilitySetID = &recoveryAvailabilitySetID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateReplicationProtectedItemProviderInput(*v) + if err != nil { + return err + } + urpiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateReplicationProtectedItemProviderInput update replication protected item provider specific input. +type BasicUpdateReplicationProtectedItemProviderInput interface { + AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) + AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) + AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) + AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) + AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) +} + +// UpdateReplicationProtectedItemProviderInput update replication protected item provider specific input. +type UpdateReplicationProtectedItemProviderInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateReplicationProtectedItemProviderInput(body []byte) (BasicUpdateReplicationProtectedItemProviderInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A): + var aurpii A2AUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &aurpii) + return aurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure): + var hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &hvraurpii) + return hvraurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2): + var imavurpii InMageAzureV2UpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &imavurpii) + return imavurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm): + var imrurpii InMageRcmUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &imrurpii) + return imrurpii, err + default: + var urpipi UpdateReplicationProtectedItemProviderInput + err := json.Unmarshal(body, &urpipi) + return urpipi, err + } +} +func unmarshalBasicUpdateReplicationProtectedItemProviderInputArray(body []byte) ([]BasicUpdateReplicationProtectedItemProviderInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + urpipiArray := make([]BasicUpdateReplicationProtectedItemProviderInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + urpipi, err := unmarshalBasicUpdateReplicationProtectedItemProviderInput(*rawMessage) + if err != nil { + return nil, err + } + urpipiArray[index] = urpipi + } + return urpipiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) MarshalJSON() ([]byte, error) { + urpipi.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput + objectMap := make(map[string]interface{}) + if urpipi.InstanceType != "" { + objectMap["instanceType"] = urpipi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return &urpipi, true +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &urpipi, true +} + +// UpdateVCenterRequest input required to update vCenter. +type UpdateVCenterRequest struct { + // Properties - The update VCenter Request Properties. + Properties *UpdateVCenterRequestProperties `json:"properties,omitempty"` +} + +// UpdateVCenterRequestProperties the properties of an update vCenter request. +type UpdateVCenterRequestProperties struct { + // FriendlyName - The friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the vCenter to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // ProcessServerID - The process server Id from where the update can be orchestrated. + ProcessServerID *string `json:"processServerId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The CS account Id which has privileges to update the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// VaultHealthDetails vault health details definition. +type VaultHealthDetails struct { + autorest.Response `json:"-"` + // Properties - The vault health related data. + Properties *VaultHealthProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VaultHealthDetails. +func (vhd VaultHealthDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vhd.Properties != nil { + objectMap["properties"] = vhd.Properties + } + if vhd.Location != nil { + objectMap["location"] = vhd.Location + } + return json.Marshal(objectMap) +} + +// VaultHealthProperties class to define the health summary of the Vault. +type VaultHealthProperties struct { + // VaultErrors - The list of errors on the vault. + VaultErrors *[]HealthError `json:"vaultErrors,omitempty"` + // ProtectedItemsHealth - The list of the health detail of the protected items in the vault. + ProtectedItemsHealth *ResourceHealthSummary `json:"protectedItemsHealth,omitempty"` + // FabricsHealth - The list of the health detail of the fabrics in the vault. + FabricsHealth *ResourceHealthSummary `json:"fabricsHealth,omitempty"` + // ContainersHealth - The list of the health detail of the containers in the vault. + ContainersHealth *ResourceHealthSummary `json:"containersHealth,omitempty"` +} + +// VaultSetting vault setting. +type VaultSetting struct { + autorest.Response `json:"-"` + // Properties - The vault setting properties. + Properties *VaultSettingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VaultSetting. +func (vs VaultSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vs.Properties != nil { + objectMap["properties"] = vs.Properties + } + if vs.Location != nil { + objectMap["location"] = vs.Location + } + return json.Marshal(objectMap) +} + +// VaultSettingCollection vault setting collection. +type VaultSettingCollection struct { + autorest.Response `json:"-"` + // Value - The list of vault setting. + Value *[]VaultSetting `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// VaultSettingCollectionIterator provides access to a complete listing of VaultSetting values. +type VaultSettingCollectionIterator struct { + i int + page VaultSettingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VaultSettingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VaultSettingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VaultSettingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VaultSettingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VaultSettingCollectionIterator) Response() VaultSettingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VaultSettingCollectionIterator) Value() VaultSetting { + if !iter.page.NotDone() { + return VaultSetting{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VaultSettingCollectionIterator type. +func NewVaultSettingCollectionIterator(page VaultSettingCollectionPage) VaultSettingCollectionIterator { + return VaultSettingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vsc VaultSettingCollection) IsEmpty() bool { + return vsc.Value == nil || len(*vsc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vsc VaultSettingCollection) hasNextLink() bool { + return vsc.NextLink != nil && len(*vsc.NextLink) != 0 +} + +// vaultSettingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vsc VaultSettingCollection) vaultSettingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !vsc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vsc.NextLink))) +} + +// VaultSettingCollectionPage contains a page of VaultSetting values. +type VaultSettingCollectionPage struct { + fn func(context.Context, VaultSettingCollection) (VaultSettingCollection, error) + vsc VaultSettingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VaultSettingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VaultSettingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vsc) + if err != nil { + return err + } + page.vsc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VaultSettingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VaultSettingCollectionPage) NotDone() bool { + return !page.vsc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VaultSettingCollectionPage) Response() VaultSettingCollection { + return page.vsc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VaultSettingCollectionPage) Values() []VaultSetting { + if page.vsc.IsEmpty() { + return nil + } + return *page.vsc.Value +} + +// Creates a new instance of the VaultSettingCollectionPage type. +func NewVaultSettingCollectionPage(cur VaultSettingCollection, getNextPage func(context.Context, VaultSettingCollection) (VaultSettingCollection, error)) VaultSettingCollectionPage { + return VaultSettingCollectionPage{ + fn: getNextPage, + vsc: cur, + } +} + +// VaultSettingCreationInput input to create vault setting. +type VaultSettingCreationInput struct { + // Properties - Vault setting creation input properties. + Properties *VaultSettingCreationInputProperties `json:"properties,omitempty"` +} + +// VaultSettingCreationInputProperties input to create vault setting. +type VaultSettingCreationInputProperties struct { + // MigrationSolutionID - The migration solution Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // VmwareToAzureProviderType - VMware to Azure provider type. + VmwareToAzureProviderType *string `json:"vmwareToAzureProviderType,omitempty"` +} + +// VaultSettingProperties vault setting properties. +type VaultSettingProperties struct { + // MigrationSolutionID - The migration solution ARM Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // VmwareToAzureProviderType - VMware to Azure provider type. + VmwareToAzureProviderType *string `json:"vmwareToAzureProviderType,omitempty"` +} + +// VCenter vCenter definition. +type VCenter struct { + autorest.Response `json:"-"` + // Properties - VCenter related data. + Properties *VCenterProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VCenter. +func (vc VCenter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vc.Properties != nil { + objectMap["properties"] = vc.Properties + } + if vc.Location != nil { + objectMap["location"] = vc.Location + } + return json.Marshal(objectMap) +} + +// VCenterCollection collection of vCenter details. +type VCenterCollection struct { + autorest.Response `json:"-"` + // Value - The vCenter details. + Value *[]VCenter `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// VCenterCollectionIterator provides access to a complete listing of VCenter values. +type VCenterCollectionIterator struct { + i int + page VCenterCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VCenterCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VCenterCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VCenterCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VCenterCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VCenterCollectionIterator) Response() VCenterCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VCenterCollectionIterator) Value() VCenter { + if !iter.page.NotDone() { + return VCenter{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VCenterCollectionIterator type. +func NewVCenterCollectionIterator(page VCenterCollectionPage) VCenterCollectionIterator { + return VCenterCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vcc VCenterCollection) IsEmpty() bool { + return vcc.Value == nil || len(*vcc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vcc VCenterCollection) hasNextLink() bool { + return vcc.NextLink != nil && len(*vcc.NextLink) != 0 +} + +// vCenterCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vcc VCenterCollection) vCenterCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !vcc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vcc.NextLink))) +} + +// VCenterCollectionPage contains a page of VCenter values. +type VCenterCollectionPage struct { + fn func(context.Context, VCenterCollection) (VCenterCollection, error) + vcc VCenterCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VCenterCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VCenterCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vcc) + if err != nil { + return err + } + page.vcc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VCenterCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VCenterCollectionPage) NotDone() bool { + return !page.vcc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VCenterCollectionPage) Response() VCenterCollection { + return page.vcc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VCenterCollectionPage) Values() []VCenter { + if page.vcc.IsEmpty() { + return nil + } + return *page.vcc.Value +} + +// Creates a new instance of the VCenterCollectionPage type. +func NewVCenterCollectionPage(cur VCenterCollection, getNextPage func(context.Context, VCenterCollection) (VCenterCollection, error)) VCenterCollectionPage { + return VCenterCollectionPage{ + fn: getNextPage, + vcc: cur, + } +} + +// VCenterProperties vCenter properties. +type VCenterProperties struct { + // FriendlyName - Friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // InternalID - VCenter internal ID. + InternalID *string `json:"internalId,omitempty"` + // LastHeartbeat - The time when the last heartbeat was received by vCenter. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // DiscoveryStatus - The VCenter discovery status. + DiscoveryStatus *string `json:"discoveryStatus,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // IPAddress - The IP address of the vCenter. + IPAddress *string `json:"ipAddress,omitempty"` + // InfrastructureID - The infrastructure Id of vCenter. + InfrastructureID *string `json:"infrastructureId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The account Id which has privileges to discover the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // FabricArmResourceName - The ARM resource name of the fabric containing this VCenter. + FabricArmResourceName *string `json:"fabricArmResourceName,omitempty"` + // HealthErrors - The health errors for this VCenter. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// VersionDetails version related details. +type VersionDetails struct { + // Version - The agent version. + Version *string `json:"version,omitempty"` + // ExpiryDate - Version expiry date. + ExpiryDate *date.Time `json:"expiryDate,omitempty"` + // Status - A value indicating whether security update required. Possible values include: 'Supported', 'NotSupported', 'Deprecated', 'UpdateRequired', 'SecurityUpdateRequired' + Status AgentVersionStatus `json:"status,omitempty"` +} + +// VirtualMachineTaskDetails this class represents the virtual machine task details. +type VirtualMachineTaskDetails struct { + // SkippedReason - The skipped reason. + SkippedReason *string `json:"skippedReason,omitempty"` + // SkippedReasonString - The skipped reason string. + SkippedReasonString *string `json:"skippedReasonString,omitempty"` + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) MarshalJSON() ([]byte, error) { + vmtd.InstanceType = InstanceTypeVirtualMachineTaskDetails + objectMap := make(map[string]interface{}) + if vmtd.SkippedReason != nil { + objectMap["skippedReason"] = vmtd.SkippedReason + } + if vmtd.SkippedReasonString != nil { + objectMap["skippedReasonString"] = vmtd.SkippedReasonString + } + if vmtd.JobTask != nil { + objectMap["jobTask"] = vmtd.JobTask + } + if vmtd.InstanceType != "" { + objectMap["instanceType"] = vmtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &vmtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return &vmtd, true +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &vmtd, true +} + +// VmmDetails VMM fabric specific details. +type VmmDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmDetails. +func (vd VmmDetails) MarshalJSON() ([]byte, error) { + vd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM + objectMap := make(map[string]interface{}) + if vd.InstanceType != "" { + objectMap["instanceType"] = vd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVmmDetails() (*VmmDetails, bool) { + return &vd, true +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vd, true +} + +// VmmToAzureCreateNetworkMappingInput create network mappings input properties/behavior specific to Vmm to +// Azure Network mapping. +type VmmToAzureCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtacnmi.InstanceType = InstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtacnmi.InstanceType != "" { + objectMap["instanceType"] = vtacnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return &vtacnmi, true +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &vtacnmi, true +} + +// VmmToAzureNetworkMappingSettings e2A Network Mapping fabric specific settings. +type VmmToAzureNetworkMappingSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) MarshalJSON() ([]byte, error) { + vtanms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtanms.InstanceType != "" { + objectMap["instanceType"] = vtanms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return &vtanms, true +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &vtanms, true +} + +// VmmToAzureUpdateNetworkMappingInput update network mappings input properties/behavior specific to vmm to +// azure. +type VmmToAzureUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtaunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtaunmi.InstanceType != "" { + objectMap["instanceType"] = vtaunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return &vtaunmi, true +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &vtaunmi, true +} + +// VmmToVmmCreateNetworkMappingInput create network mappings input properties/behavior specific to vmm to +// vmm Network mapping. +type VmmToVmmCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtvcnmi.InstanceType = InstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvcnmi.InstanceType != "" { + objectMap["instanceType"] = vtvcnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return &vtvcnmi, true +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &vtvcnmi, true +} + +// VmmToVmmNetworkMappingSettings e2E Network Mapping fabric specific settings. +type VmmToVmmNetworkMappingSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) MarshalJSON() ([]byte, error) { + vtvnms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvnms.InstanceType != "" { + objectMap["instanceType"] = vtvnms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return &vtvnms, true +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &vtvnms, true +} + +// VmmToVmmUpdateNetworkMappingInput update network mappings input properties/behavior specific to vmm to +// vmm. +type VmmToVmmUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtvunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvunmi.InstanceType != "" { + objectMap["instanceType"] = vtvunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return &vtvunmi, true +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &vtvunmi, true +} + +// VmmVirtualMachineDetails VMM fabric provider specific VM settings. +type VmmVirtualMachineDetails struct { + // SourceItemID - The source id of the object. + SourceItemID *string `json:"sourceItemId,omitempty"` + // Generation - The id of the object in fabric. + Generation *string `json:"generation,omitempty"` + // OsDetails - The Last replication time. + OsDetails *OSDetails `json:"osDetails,omitempty"` + // DiskDetails - The Last successful failover time. + DiskDetails *[]DiskDetails `json:"diskDetails,omitempty"` + // HasPhysicalDisk - A value indicating whether the VM has a physical disk attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasPhysicalDisk PresenceStatus `json:"hasPhysicalDisk,omitempty"` + // HasFibreChannelAdapter - A value indicating whether the VM has a fibre channel adapter attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasFibreChannelAdapter PresenceStatus `json:"hasFibreChannelAdapter,omitempty"` + // HasSharedVhd - A value indicating whether the VM has a shared VHD attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasSharedVhd PresenceStatus `json:"hasSharedVhd,omitempty"` + // HyperVHostID - The Id of the hyper-v host in fabric. + HyperVHostID *string `json:"hyperVHostId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) MarshalJSON() ([]byte, error) { + vvmd.InstanceType = InstanceTypeVmmVirtualMachine + objectMap := make(map[string]interface{}) + if vvmd.SourceItemID != nil { + objectMap["sourceItemId"] = vvmd.SourceItemID + } + if vvmd.Generation != nil { + objectMap["generation"] = vvmd.Generation + } + if vvmd.OsDetails != nil { + objectMap["osDetails"] = vvmd.OsDetails + } + if vvmd.DiskDetails != nil { + objectMap["diskDetails"] = vvmd.DiskDetails + } + if vvmd.HasPhysicalDisk != "" { + objectMap["hasPhysicalDisk"] = vvmd.HasPhysicalDisk + } + if vvmd.HasFibreChannelAdapter != "" { + objectMap["hasFibreChannelAdapter"] = vvmd.HasFibreChannelAdapter + } + if vvmd.HasSharedVhd != "" { + objectMap["hasSharedVhd"] = vvmd.HasSharedVhd + } + if vvmd.HyperVHostID != nil { + objectMap["hyperVHostId"] = vvmd.HyperVHostID + } + if vvmd.InstanceType != "" { + objectMap["instanceType"] = vvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return &vvmd, true +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return &vvmd, true +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &vvmd, true +} + +// VMNicDetails hyper V VM network details. +type VMNicDetails struct { + // NicID - The nic Id. + NicID *string `json:"nicId,omitempty"` + // ReplicaNicID - The replica nic Id. + ReplicaNicID *string `json:"replicaNicId,omitempty"` + // SourceNicArmID - The source nic ARM Id. + SourceNicArmID *string `json:"sourceNicArmId,omitempty"` + // VMNetworkName - VM network name. + VMNetworkName *string `json:"vMNetworkName,omitempty"` + // RecoveryVMNetworkID - Recovery VM network Id. + RecoveryVMNetworkID *string `json:"recoveryVMNetworkId,omitempty"` + // IPConfigs - The IP configurations of the NIC. + IPConfigs *[]IPConfigDetails `json:"ipConfigs,omitempty"` + // SelectionType - Selection type for failover. + SelectionType *string `json:"selectionType,omitempty"` + // RecoveryNetworkSecurityGroupID - The id of the NSG associated with the NIC. + RecoveryNetworkSecurityGroupID *string `json:"recoveryNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnRecovery - A value indicating whether the NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnRecovery *bool `json:"enableAcceleratedNetworkingOnRecovery,omitempty"` + // TfoVMNetworkID - The network to be used by NIC during test failover. + TfoVMNetworkID *string `json:"tfoVMNetworkId,omitempty"` + // TfoNetworkSecurityGroupID - The NSG to be used by NIC during test failover. + TfoNetworkSecurityGroupID *string `json:"tfoNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnTfo - Whether the TFO NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnTfo *bool `json:"enableAcceleratedNetworkingOnTfo,omitempty"` + // RecoveryNicName - The name of the NIC to be used when creating target NICs. + RecoveryNicName *string `json:"recoveryNicName,omitempty"` + // RecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs. + RecoveryNicResourceGroupName *string `json:"recoveryNicResourceGroupName,omitempty"` + // ReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during failover subject to availability. + ReuseExistingNic *bool `json:"reuseExistingNic,omitempty"` + // TfoRecoveryNicName - The name of the NIC to be used when creating target NICs in TFO. + TfoRecoveryNicName *string `json:"tfoRecoveryNicName,omitempty"` + // TfoRecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs in TFO. + TfoRecoveryNicResourceGroupName *string `json:"tfoRecoveryNicResourceGroupName,omitempty"` + // TfoReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during test failover subject to availability. + TfoReuseExistingNic *bool `json:"tfoReuseExistingNic,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` +} + +// VMNicInputDetails hyper V VM network input details. +type VMNicInputDetails struct { + // NicID - The nic Id. + NicID *string `json:"nicId,omitempty"` + // IPConfigs - The IP configurations to be used by NIC during test failover and failover. + IPConfigs *[]IPConfigInputDetails `json:"ipConfigs,omitempty"` + // SelectionType - Selection type for failover. + SelectionType *string `json:"selectionType,omitempty"` + // RecoveryNetworkSecurityGroupID - The id of the NSG associated with the NIC. + RecoveryNetworkSecurityGroupID *string `json:"recoveryNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnRecovery - Whether the NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnRecovery *bool `json:"enableAcceleratedNetworkingOnRecovery,omitempty"` + // TfoNetworkSecurityGroupID - The NSG to be used by NIC during test failover. + TfoNetworkSecurityGroupID *string `json:"tfoNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnTfo - Whether the test NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnTfo *bool `json:"enableAcceleratedNetworkingOnTfo,omitempty"` + // RecoveryNicName - The name of the NIC to be used when creating target NICs. + RecoveryNicName *string `json:"recoveryNicName,omitempty"` + // RecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs. + RecoveryNicResourceGroupName *string `json:"recoveryNicResourceGroupName,omitempty"` + // ReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during failover subject to availability. + ReuseExistingNic *bool `json:"reuseExistingNic,omitempty"` + // TfoNicName - The name of the NIC to be used when creating target NICs in TFO. + TfoNicName *string `json:"tfoNicName,omitempty"` + // TfoNicResourceGroupName - The resource group of the NIC to be used when creating target NICs in TFO. + TfoNicResourceGroupName *string `json:"tfoNicResourceGroupName,omitempty"` + // TfoReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during test failover subject to availability. + TfoReuseExistingNic *bool `json:"tfoReuseExistingNic,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` +} + +// VMNicUpdatesTaskDetails this class represents the vm NicUpdates task details. +type VMNicUpdatesTaskDetails struct { + // VMID - Virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // NicID - Nic Id. + NicID *string `json:"nicId,omitempty"` + // Name - Name of the Nic. + Name *string `json:"name,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) MarshalJSON() ([]byte, error) { + vnutd.InstanceType = InstanceTypeVMNicUpdatesTaskDetails + objectMap := make(map[string]interface{}) + if vnutd.VMID != nil { + objectMap["vmId"] = vnutd.VMID + } + if vnutd.NicID != nil { + objectMap["nicId"] = vnutd.NicID + } + if vnutd.Name != nil { + objectMap["name"] = vnutd.Name + } + if vnutd.InstanceType != "" { + objectMap["instanceType"] = vnutd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return &vnutd, true +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &vnutd, true +} + +// VMwareCbtContainerCreationInput vMwareCbt container creation input. +type VMwareCbtContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) MarshalJSON() ([]byte, error) { + vmccci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmccci.InstanceType != "" { + objectMap["instanceType"] = vmccci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return &vmccci, true +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &vmccci, true +} + +// VMwareCbtContainerMappingInput vMwareCbt container mapping input. +type VMwareCbtContainerMappingInput struct { + // KeyVaultID - The target key vault ARM Id. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyVaultURI - The target key vault URL. + KeyVaultURI *string `json:"keyVaultUri,omitempty"` + // StorageAccountID - The storage account ARM Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // StorageAccountSasSecretName - The secret name of the storage account. + StorageAccountSasSecretName *string `json:"storageAccountSasSecretName,omitempty"` + // ServiceBusConnectionStringSecretName - The secret name of the service bus connection string. + ServiceBusConnectionStringSecretName *string `json:"serviceBusConnectionStringSecretName,omitempty"` + // TargetLocation - The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) MarshalJSON() ([]byte, error) { + vmccmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmccmi.KeyVaultID != nil { + objectMap["keyVaultId"] = vmccmi.KeyVaultID + } + if vmccmi.KeyVaultURI != nil { + objectMap["keyVaultUri"] = vmccmi.KeyVaultURI + } + if vmccmi.StorageAccountID != nil { + objectMap["storageAccountId"] = vmccmi.StorageAccountID + } + if vmccmi.StorageAccountSasSecretName != nil { + objectMap["storageAccountSasSecretName"] = vmccmi.StorageAccountSasSecretName + } + if vmccmi.ServiceBusConnectionStringSecretName != nil { + objectMap["serviceBusConnectionStringSecretName"] = vmccmi.ServiceBusConnectionStringSecretName + } + if vmccmi.TargetLocation != nil { + objectMap["targetLocation"] = vmccmi.TargetLocation + } + if vmccmi.InstanceType != "" { + objectMap["instanceType"] = vmccmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return &vmccmi, true +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &vmccmi, true +} + +// VMwareCbtDiskInput vMwareCbt disk input. +type VMwareCbtDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // IsOSDisk - A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // LogStorageAccountSasSecretName - The key vault secret name of the log storage account. + LogStorageAccountSasSecretName *string `json:"logStorageAccountSasSecretName,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// VMwareCbtEnableMigrationInput vMwareCbt specific enable migration input. +type VMwareCbtEnableMigrationInput struct { + // VmwareMachineID - The ARM Id of the VM discovered in VMware. + VmwareMachineID *string `json:"vmwareMachineId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]VMwareCbtDiskInput `json:"disksToInclude,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // DataMoverRunAsAccountID - The data mover run as account Id. + DataMoverRunAsAccountID *string `json:"dataMoverRunAsAccountId,omitempty"` + // SnapshotRunAsAccountID - The snapshot run as account Id. + SnapshotRunAsAccountID *string `json:"snapshotRunAsAccountId,omitempty"` + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The selected test network ARM Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // TargetSubnetName - The target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TestSubnetName - The selected test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedDiskTags - The tags for the seed disks. + SeedDiskTags map[string]*string `json:"seedDiskTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeEnableMigrationProviderSpecificInput', 'InstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEnableMigrationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) MarshalJSON() ([]byte, error) { + vmcemi.InstanceType = InstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcemi.VmwareMachineID != nil { + objectMap["vmwareMachineId"] = vmcemi.VmwareMachineID + } + if vmcemi.DisksToInclude != nil { + objectMap["disksToInclude"] = vmcemi.DisksToInclude + } + if vmcemi.LicenseType != "" { + objectMap["licenseType"] = vmcemi.LicenseType + } + if vmcemi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = vmcemi.SQLServerLicenseType + } + if vmcemi.DataMoverRunAsAccountID != nil { + objectMap["dataMoverRunAsAccountId"] = vmcemi.DataMoverRunAsAccountID + } + if vmcemi.SnapshotRunAsAccountID != nil { + objectMap["snapshotRunAsAccountId"] = vmcemi.SnapshotRunAsAccountID + } + if vmcemi.TargetVMName != nil { + objectMap["targetVmName"] = vmcemi.TargetVMName + } + if vmcemi.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcemi.TargetVMSize + } + if vmcemi.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcemi.TargetResourceGroupID + } + if vmcemi.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcemi.TargetNetworkID + } + if vmcemi.TestNetworkID != nil { + objectMap["testNetworkId"] = vmcemi.TestNetworkID + } + if vmcemi.TargetSubnetName != nil { + objectMap["targetSubnetName"] = vmcemi.TargetSubnetName + } + if vmcemi.TestSubnetName != nil { + objectMap["testSubnetName"] = vmcemi.TestSubnetName + } + if vmcemi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcemi.TargetAvailabilitySetID + } + if vmcemi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcemi.TargetAvailabilityZone + } + if vmcemi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcemi.TargetProximityPlacementGroupID + } + if vmcemi.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcemi.TargetBootDiagnosticsStorageAccountID + } + if vmcemi.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcemi.PerformAutoResync + } + if vmcemi.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcemi.TargetVMTags + } + if vmcemi.SeedDiskTags != nil { + objectMap["seedDiskTags"] = vmcemi.SeedDiskTags + } + if vmcemi.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcemi.TargetDiskTags + } + if vmcemi.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcemi.TargetNicTags + } + if vmcemi.InstanceType != "" { + objectMap["instanceType"] = vmcemi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtEnableMigrationInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) { + return &vmcemi, true +} + +// AsEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsBasicEnableMigrationProviderSpecificInput() (BasicEnableMigrationProviderSpecificInput, bool) { + return &vmcemi, true +} + +// VMwareCbtEventDetails event details for VMwareCbt provider. +type VMwareCbtEventDetails struct { + // MigrationItemName - READ-ONLY; The migration item name. + MigrationItemName *string `json:"migrationItemName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) MarshalJSON() ([]byte, error) { + vmced.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmced.InstanceType != "" { + objectMap["instanceType"] = vmced.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return &vmced, true +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &vmced, true +} + +// VMwareCbtMigrateInput vMwareCbt specific migrate input. +type VMwareCbtMigrateInput struct { + // PerformShutdown - A value indicating whether VM is to be shutdown. + PerformShutdown *string `json:"performShutdown,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput', 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) MarshalJSON() ([]byte, error) { + vmcmi.InstanceType = InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcmi.PerformShutdown != nil { + objectMap["performShutdown"] = vmcmi.PerformShutdown + } + if vmcmi.InstanceType != "" { + objectMap["instanceType"] = vmcmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrateInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) { + return &vmcmi, true +} + +// AsMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsBasicMigrateProviderSpecificInput() (BasicMigrateProviderSpecificInput, bool) { + return &vmcmi, true +} + +// VMwareCbtMigrationDetails vMwareCbt provider specific settings. +type VMwareCbtMigrationDetails struct { + // VmwareMachineID - READ-ONLY; The ARM Id of the VM discovered in VMware. + VmwareMachineID *string `json:"vmwareMachineId,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // FirmwareType - READ-ONLY; The firmware type. + FirmwareType *string `json:"firmwareType,omitempty"` + // TargetGeneration - READ-ONLY; The target generation. + TargetGeneration *string `json:"targetGeneration,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // DataMoverRunAsAccountID - READ-ONLY; The data mover run as account Id. + DataMoverRunAsAccountID *string `json:"dataMoverRunAsAccountId,omitempty"` + // SnapshotRunAsAccountID - READ-ONLY; The snapshot run as account Id. + SnapshotRunAsAccountID *string `json:"snapshotRunAsAccountId,omitempty"` + // TargetVMName - Target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetLocation - READ-ONLY; The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // TargetResourceGroupID - The target resource group Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]VMwareCbtProtectedDiskDetails `json:"protectedDisks,omitempty"` + // TargetNetworkID - The target network Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // VMNics - The network details. + VMNics *[]VMwareCbtNicDetails `json:"vmNics,omitempty"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // MigrationRecoveryPointID - READ-ONLY; The recovery point Id to which the VM was migrated. + MigrationRecoveryPointID *string `json:"migrationRecoveryPointId,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // LastRecoveryPointID - READ-ONLY; The last recovery point Id. + LastRecoveryPointID *string `json:"lastRecoveryPointId,omitempty"` + // InitialSeedingProgressPercentage - READ-ONLY; The initial seeding progress percentage. + InitialSeedingProgressPercentage *int32 `json:"initialSeedingProgressPercentage,omitempty"` + // MigrationProgressPercentage - READ-ONLY; The migration progress percentage. + MigrationProgressPercentage *int32 `json:"migrationProgressPercentage,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // InitialSeedingRetryCount - READ-ONLY; The initial seeding retry count. + InitialSeedingRetryCount *int64 `json:"initialSeedingRetryCount,omitempty"` + // ResyncRetryCount - READ-ONLY; The resync retry count. + ResyncRetryCount *int64 `json:"resyncRetryCount,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // SeedDiskTags - The tags for the seed disks. + SeedDiskTags map[string]*string `json:"seedDiskTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings', 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) MarshalJSON() ([]byte, error) { + vmcmd.InstanceType = InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcmd.LicenseType != nil { + objectMap["licenseType"] = vmcmd.LicenseType + } + if vmcmd.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = vmcmd.SQLServerLicenseType + } + if vmcmd.TargetVMName != nil { + objectMap["targetVmName"] = vmcmd.TargetVMName + } + if vmcmd.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcmd.TargetVMSize + } + if vmcmd.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcmd.TargetResourceGroupID + } + if vmcmd.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcmd.TargetAvailabilitySetID + } + if vmcmd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcmd.TargetAvailabilityZone + } + if vmcmd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcmd.TargetProximityPlacementGroupID + } + if vmcmd.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcmd.TargetBootDiagnosticsStorageAccountID + } + if vmcmd.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcmd.TargetVMTags + } + if vmcmd.ProtectedDisks != nil { + objectMap["protectedDisks"] = vmcmd.ProtectedDisks + } + if vmcmd.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcmd.TargetNetworkID + } + if vmcmd.VMNics != nil { + objectMap["vmNics"] = vmcmd.VMNics + } + if vmcmd.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcmd.TargetNicTags + } + if vmcmd.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcmd.PerformAutoResync + } + if vmcmd.SeedDiskTags != nil { + objectMap["seedDiskTags"] = vmcmd.SeedDiskTags + } + if vmcmd.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcmd.TargetDiskTags + } + if vmcmd.InstanceType != "" { + objectMap["instanceType"] = vmcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrationDetails is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) { + return &vmcmd, true +} + +// AsMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsBasicMigrationProviderSpecificSettings() (BasicMigrationProviderSpecificSettings, bool) { + return &vmcmd, true +} + +// VMwareCbtNicDetails vMwareCbt NIC details. +type VMwareCbtNicDetails struct { + // NicID - READ-ONLY; The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // SourceIPAddress - READ-ONLY; The source IP address. + SourceIPAddress *string `json:"sourceIPAddress,omitempty"` + // SourceIPAddressType - READ-ONLY; The source IP address type. Possible values include: 'Dynamic', 'Static' + SourceIPAddressType EthernetAddressType `json:"sourceIPAddressType,omitempty"` + // SourceNetworkID - READ-ONLY; Source network Id. + SourceNetworkID *string `json:"sourceNetworkId,omitempty"` + // TargetIPAddress - The target IP address. + TargetIPAddress *string `json:"targetIPAddress,omitempty"` + // TargetIPAddressType - The target IP address type. Possible values include: 'Dynamic', 'Static' + TargetIPAddressType EthernetAddressType `json:"targetIPAddressType,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TestNetworkID - Source network Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // TestSubnetName - Test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TestIPAddress - The test IP address. + TestIPAddress *string `json:"testIPAddress,omitempty"` + // TestIPAddressType - The test IP address type. Possible values include: 'Dynamic', 'Static' + TestIPAddressType EthernetAddressType `json:"testIPAddressType,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` + // IsSelectedForMigration - A value indicating whether this NIC is selected for migration. + IsSelectedForMigration *string `json:"isSelectedForMigration,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtNicDetails. +func (vmcnd VMwareCbtNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmcnd.IsPrimaryNic != nil { + objectMap["isPrimaryNic"] = vmcnd.IsPrimaryNic + } + if vmcnd.TargetIPAddress != nil { + objectMap["targetIPAddress"] = vmcnd.TargetIPAddress + } + if vmcnd.TargetIPAddressType != "" { + objectMap["targetIPAddressType"] = vmcnd.TargetIPAddressType + } + if vmcnd.TargetSubnetName != nil { + objectMap["targetSubnetName"] = vmcnd.TargetSubnetName + } + if vmcnd.TestNetworkID != nil { + objectMap["testNetworkId"] = vmcnd.TestNetworkID + } + if vmcnd.TestSubnetName != nil { + objectMap["testSubnetName"] = vmcnd.TestSubnetName + } + if vmcnd.TestIPAddress != nil { + objectMap["testIPAddress"] = vmcnd.TestIPAddress + } + if vmcnd.TestIPAddressType != "" { + objectMap["testIPAddressType"] = vmcnd.TestIPAddressType + } + if vmcnd.TargetNicName != nil { + objectMap["targetNicName"] = vmcnd.TargetNicName + } + if vmcnd.IsSelectedForMigration != nil { + objectMap["isSelectedForMigration"] = vmcnd.IsSelectedForMigration + } + return json.Marshal(objectMap) +} + +// VMwareCbtNicInput vMwareCbt NIC input. +type VMwareCbtNicInput struct { + // NicID - The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetStaticIPAddress - The static IP address. + TargetStaticIPAddress *string `json:"targetStaticIPAddress,omitempty"` + // IsSelectedForMigration - A value indicating whether this NIC is selected for migration. + IsSelectedForMigration *string `json:"isSelectedForMigration,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` + // TestSubnetName - The test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TestStaticIPAddress - The test static IP address. + TestStaticIPAddress *string `json:"testStaticIPAddress,omitempty"` +} + +// VMwareCbtPolicyCreationInput vMware Cbt policy creation input. +type VMwareCbtPolicyCreationInput struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) MarshalJSON() ([]byte, error) { + vmcpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcpci.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = vmcpci.RecoveryPointHistoryInMinutes + } + if vmcpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = vmcpci.CrashConsistentFrequencyInMinutes + } + if vmcpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = vmcpci.AppConsistentFrequencyInMinutes + } + if vmcpci.InstanceType != "" { + objectMap["instanceType"] = vmcpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return &vmcpci, true +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &vmcpci, true +} + +// VmwareCbtPolicyDetails vMware Cbt specific policy details. +type VmwareCbtPolicyDetails struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) MarshalJSON() ([]byte, error) { + vcpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vcpd.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = vcpd.RecoveryPointHistoryInMinutes + } + if vcpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = vcpd.AppConsistentFrequencyInMinutes + } + if vcpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = vcpd.CrashConsistentFrequencyInMinutes + } + if vcpd.InstanceType != "" { + objectMap["instanceType"] = vcpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return &vcpd, true +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &vcpd, true +} + +// VMwareCbtProtectedDiskDetails vMwareCbt protected disk details. +type VMwareCbtProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskPath - READ-ONLY; The disk path. + DiskPath *string `json:"diskPath,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // LogStorageAccountSasSecretName - READ-ONLY; The key vault secret name of the log storage account. + LogStorageAccountSasSecretName *string `json:"logStorageAccountSasSecretName,omitempty"` + // DiskEncryptionSetID - READ-ONLY; The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // SeedManagedDiskID - READ-ONLY; The ARM Id of the seed managed disk. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // TargetManagedDiskID - READ-ONLY; The ARM Id of the target managed disk. + TargetManagedDiskID *string `json:"targetManagedDiskId,omitempty"` + // TargetDiskName - The name for the target managed disk. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtProtectedDiskDetails. +func (vmcpdd VMwareCbtProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmcpdd.DiskType != "" { + objectMap["diskType"] = vmcpdd.DiskType + } + if vmcpdd.TargetDiskName != nil { + objectMap["targetDiskName"] = vmcpdd.TargetDiskName + } + return json.Marshal(objectMap) +} + +// VMwareCbtProtectionContainerMappingDetails vMwareCbt provider specific container mapping details. +type VMwareCbtProtectionContainerMappingDetails struct { + // KeyVaultID - READ-ONLY; The target key vault ARM Id. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyVaultURI - READ-ONLY; The target key vault URI. + KeyVaultURI *string `json:"keyVaultUri,omitempty"` + // StorageAccountID - READ-ONLY; The storage account ARM Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // StorageAccountSasSecretName - READ-ONLY; The secret name of the storage account. + StorageAccountSasSecretName *string `json:"storageAccountSasSecretName,omitempty"` + // ServiceBusConnectionStringSecretName - READ-ONLY; The secret name of the service bus connection string. + ServiceBusConnectionStringSecretName *string `json:"serviceBusConnectionStringSecretName,omitempty"` + // TargetLocation - READ-ONLY; The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + vmcpcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcpcmd.InstanceType != "" { + objectMap["instanceType"] = vmcpcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return &vmcpcmd, true +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &vmcpcmd, true +} + +// VMwareCbtResyncInput vMwareCbt specific resync input. +type VMwareCbtResyncInput struct { + // SkipCbtReset - A value indicating whether CBT is to be reset. + SkipCbtReset *string `json:"skipCbtReset,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput', 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicResyncProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) MarshalJSON() ([]byte, error) { + vmcri.InstanceType = InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcri.SkipCbtReset != nil { + objectMap["skipCbtReset"] = vmcri.SkipCbtReset + } + if vmcri.InstanceType != "" { + objectMap["instanceType"] = vmcri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtResyncInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) { + return &vmcri, true +} + +// AsResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsBasicResyncProviderSpecificInput() (BasicResyncProviderSpecificInput, bool) { + return &vmcri, true +} + +// VMwareCbtTestMigrateInput vMwareCbt specific test migrate input. +type VMwareCbtTestMigrateInput struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // NetworkID - The test network Id. + NetworkID *string `json:"networkId,omitempty"` + // VMNics - The list of NIC details. + VMNics *[]VMwareCbtNicInput `json:"vmNics,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput', 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicTestMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) MarshalJSON() ([]byte, error) { + vmctmi.InstanceType = InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmctmi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = vmctmi.RecoveryPointID + } + if vmctmi.NetworkID != nil { + objectMap["networkId"] = vmctmi.NetworkID + } + if vmctmi.VMNics != nil { + objectMap["vmNics"] = vmctmi.VMNics + } + if vmctmi.InstanceType != "" { + objectMap["instanceType"] = vmctmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtTestMigrateInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) { + return &vmctmi, true +} + +// AsTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsBasicTestMigrateProviderSpecificInput() (BasicTestMigrateProviderSpecificInput, bool) { + return &vmctmi, true +} + +// VMwareCbtUpdateDiskInput vMwareCbt disk input for update. +type VMwareCbtUpdateDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // TargetDiskName - The target disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// VMwareCbtUpdateMigrationItemInput vMwareCbt specific update migration item input. +type VMwareCbtUpdateMigrationItemInput struct { + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The test network ARM Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // VMNics - The list of NIC details. + VMNics *[]VMwareCbtNicInput `json:"vmNics,omitempty"` + // VMDisks - The list of disk update properties. + VMDisks *[]VMwareCbtUpdateDiskInput `json:"vmDisks,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput', 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicUpdateMigrationItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) MarshalJSON() ([]byte, error) { + vmcumii.InstanceType = InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcumii.TargetVMName != nil { + objectMap["targetVmName"] = vmcumii.TargetVMName + } + if vmcumii.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcumii.TargetVMSize + } + if vmcumii.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcumii.TargetResourceGroupID + } + if vmcumii.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcumii.TargetAvailabilitySetID + } + if vmcumii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcumii.TargetAvailabilityZone + } + if vmcumii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcumii.TargetProximityPlacementGroupID + } + if vmcumii.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcumii.TargetBootDiagnosticsStorageAccountID + } + if vmcumii.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcumii.TargetNetworkID + } + if vmcumii.TestNetworkID != nil { + objectMap["testNetworkId"] = vmcumii.TestNetworkID + } + if vmcumii.VMNics != nil { + objectMap["vmNics"] = vmcumii.VMNics + } + if vmcumii.VMDisks != nil { + objectMap["vmDisks"] = vmcumii.VMDisks + } + if vmcumii.LicenseType != "" { + objectMap["licenseType"] = vmcumii.LicenseType + } + if vmcumii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = vmcumii.SQLServerLicenseType + } + if vmcumii.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcumii.PerformAutoResync + } + if vmcumii.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcumii.TargetVMTags + } + if vmcumii.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcumii.TargetDiskTags + } + if vmcumii.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcumii.TargetNicTags + } + if vmcumii.InstanceType != "" { + objectMap["instanceType"] = vmcumii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtUpdateMigrationItemInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) { + return &vmcumii, true +} + +// AsUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsBasicUpdateMigrationItemProviderSpecificInput() (BasicUpdateMigrationItemProviderSpecificInput, bool) { + return &vmcumii, true +} + +// VMwareDetails store the fabric details specific to the VMware fabric. +type VMwareDetails struct { + // ProcessServers - The list of Process Servers associated with the fabric. + ProcessServers *[]ProcessServer `json:"processServers,omitempty"` + // MasterTargetServers - The list of Master Target servers associated with the fabric. + MasterTargetServers *[]MasterTargetServer `json:"masterTargetServers,omitempty"` + // RunAsAccounts - The list of run as accounts created on the server. + RunAsAccounts *[]RunAsAccount `json:"runAsAccounts,omitempty"` + // ReplicationPairCount - The number of replication pairs configured in this CS. + ReplicationPairCount *string `json:"replicationPairCount,omitempty"` + // ProcessServerCount - The number of process servers. + ProcessServerCount *string `json:"processServerCount,omitempty"` + // AgentCount - The number of source and target servers configured to talk to this CS. + AgentCount *string `json:"agentCount,omitempty"` + // ProtectedServers - The number of protected servers. + ProtectedServers *string `json:"protectedServers,omitempty"` + // SystemLoad - The percentage of the system load. + SystemLoad *string `json:"systemLoad,omitempty"` + // SystemLoadStatus - The system load status. + SystemLoadStatus *string `json:"systemLoadStatus,omitempty"` + // CPULoad - The percentage of the CPU load. + CPULoad *string `json:"cpuLoad,omitempty"` + // CPULoadStatus - The CPU load status. + CPULoadStatus *string `json:"cpuLoadStatus,omitempty"` + // TotalMemoryInBytes - The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // MemoryUsageStatus - The memory usage status. + MemoryUsageStatus *string `json:"memoryUsageStatus,omitempty"` + // TotalSpaceInBytes - The total space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - The available space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // SpaceUsageStatus - The space usage status. + SpaceUsageStatus *string `json:"spaceUsageStatus,omitempty"` + // WebLoad - The web load. + WebLoad *string `json:"webLoad,omitempty"` + // WebLoadStatus - The web load status. + WebLoadStatus *string `json:"webLoadStatus,omitempty"` + // DatabaseServerLoad - The database server load. + DatabaseServerLoad *string `json:"databaseServerLoad,omitempty"` + // DatabaseServerLoadStatus - The database server load status. + DatabaseServerLoadStatus *string `json:"databaseServerLoadStatus,omitempty"` + // CsServiceStatus - The CS service status. + CsServiceStatus *string `json:"csServiceStatus,omitempty"` + // IPAddress - The IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // AgentVersion - The agent Version. + AgentVersion *string `json:"agentVersion,omitempty"` + // HostName - The host name. + HostName *string `json:"hostName,omitempty"` + // LastHeartbeat - The last heartbeat received from CS server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // SslCertExpiryDate - CS SSL cert expiry date. + SslCertExpiryDate *date.Time `json:"sslCertExpiryDate,omitempty"` + // SslCertExpiryRemainingDays - CS SSL cert expiry date. + SslCertExpiryRemainingDays *int32 `json:"sslCertExpiryRemainingDays,omitempty"` + // PsTemplateVersion - PS template version. + PsTemplateVersion *string `json:"psTemplateVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // AgentVersionDetails - The agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // SwitchProviderBlockingErrorDetails - The switch provider blocking error information. + SwitchProviderBlockingErrorDetails *[]InMageFabricSwitchProviderBlockingErrorDetails `json:"switchProviderBlockingErrorDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareDetails. +func (vmd VMwareDetails) MarshalJSON() ([]byte, error) { + vmd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware + objectMap := make(map[string]interface{}) + if vmd.ProcessServers != nil { + objectMap["processServers"] = vmd.ProcessServers + } + if vmd.MasterTargetServers != nil { + objectMap["masterTargetServers"] = vmd.MasterTargetServers + } + if vmd.RunAsAccounts != nil { + objectMap["runAsAccounts"] = vmd.RunAsAccounts + } + if vmd.ReplicationPairCount != nil { + objectMap["replicationPairCount"] = vmd.ReplicationPairCount + } + if vmd.ProcessServerCount != nil { + objectMap["processServerCount"] = vmd.ProcessServerCount + } + if vmd.AgentCount != nil { + objectMap["agentCount"] = vmd.AgentCount + } + if vmd.ProtectedServers != nil { + objectMap["protectedServers"] = vmd.ProtectedServers + } + if vmd.SystemLoad != nil { + objectMap["systemLoad"] = vmd.SystemLoad + } + if vmd.SystemLoadStatus != nil { + objectMap["systemLoadStatus"] = vmd.SystemLoadStatus + } + if vmd.CPULoad != nil { + objectMap["cpuLoad"] = vmd.CPULoad + } + if vmd.CPULoadStatus != nil { + objectMap["cpuLoadStatus"] = vmd.CPULoadStatus + } + if vmd.TotalMemoryInBytes != nil { + objectMap["totalMemoryInBytes"] = vmd.TotalMemoryInBytes + } + if vmd.AvailableMemoryInBytes != nil { + objectMap["availableMemoryInBytes"] = vmd.AvailableMemoryInBytes + } + if vmd.MemoryUsageStatus != nil { + objectMap["memoryUsageStatus"] = vmd.MemoryUsageStatus + } + if vmd.TotalSpaceInBytes != nil { + objectMap["totalSpaceInBytes"] = vmd.TotalSpaceInBytes + } + if vmd.AvailableSpaceInBytes != nil { + objectMap["availableSpaceInBytes"] = vmd.AvailableSpaceInBytes + } + if vmd.SpaceUsageStatus != nil { + objectMap["spaceUsageStatus"] = vmd.SpaceUsageStatus + } + if vmd.WebLoad != nil { + objectMap["webLoad"] = vmd.WebLoad + } + if vmd.WebLoadStatus != nil { + objectMap["webLoadStatus"] = vmd.WebLoadStatus + } + if vmd.DatabaseServerLoad != nil { + objectMap["databaseServerLoad"] = vmd.DatabaseServerLoad + } + if vmd.DatabaseServerLoadStatus != nil { + objectMap["databaseServerLoadStatus"] = vmd.DatabaseServerLoadStatus + } + if vmd.CsServiceStatus != nil { + objectMap["csServiceStatus"] = vmd.CsServiceStatus + } + if vmd.IPAddress != nil { + objectMap["ipAddress"] = vmd.IPAddress + } + if vmd.AgentVersion != nil { + objectMap["agentVersion"] = vmd.AgentVersion + } + if vmd.HostName != nil { + objectMap["hostName"] = vmd.HostName + } + if vmd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = vmd.LastHeartbeat + } + if vmd.VersionStatus != nil { + objectMap["versionStatus"] = vmd.VersionStatus + } + if vmd.SslCertExpiryDate != nil { + objectMap["sslCertExpiryDate"] = vmd.SslCertExpiryDate + } + if vmd.SslCertExpiryRemainingDays != nil { + objectMap["sslCertExpiryRemainingDays"] = vmd.SslCertExpiryRemainingDays + } + if vmd.PsTemplateVersion != nil { + objectMap["psTemplateVersion"] = vmd.PsTemplateVersion + } + if vmd.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = vmd.AgentExpiryDate + } + if vmd.AgentVersionDetails != nil { + objectMap["agentVersionDetails"] = vmd.AgentVersionDetails + } + if vmd.SwitchProviderBlockingErrorDetails != nil { + objectMap["switchProviderBlockingErrorDetails"] = vmd.SwitchProviderBlockingErrorDetails + } + if vmd.InstanceType != "" { + objectMap["instanceType"] = vmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return &vmd, true +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vmd, true +} + +// VMwareV2FabricCreationInput vMwareV2 fabric provider specific settings. +type VMwareV2FabricCreationInput struct { + // VmwareSiteID - The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // MigrationSolutionID - The ARM Id of the migration solution. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) MarshalJSON() ([]byte, error) { + vmvfci.InstanceType = InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2 + objectMap := make(map[string]interface{}) + if vmvfci.VmwareSiteID != nil { + objectMap["vmwareSiteId"] = vmvfci.VmwareSiteID + } + if vmvfci.PhysicalSiteID != nil { + objectMap["physicalSiteId"] = vmvfci.PhysicalSiteID + } + if vmvfci.MigrationSolutionID != nil { + objectMap["migrationSolutionId"] = vmvfci.MigrationSolutionID + } + if vmvfci.InstanceType != "" { + objectMap["instanceType"] = vmvfci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return &vmvfci, true +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &vmvfci, true +} + +// VMwareV2FabricSpecificDetails vMwareV2 fabric specific details. +type VMwareV2FabricSpecificDetails struct { + // VmwareSiteID - READ-ONLY; The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - READ-ONLY; The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // MigrationSolutionID - READ-ONLY; The Migration solution ARM Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // ServiceEndpoint - READ-ONLY; The service endpoint. + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` + // ServiceResourceID - READ-ONLY; The service resource Id. + ServiceResourceID *string `json:"serviceResourceId,omitempty"` + // ServiceContainerID - READ-ONLY; The service container Id. + ServiceContainerID *string `json:"serviceContainerId,omitempty"` + // ProcessServers - READ-ONLY; The list of process servers. + ProcessServers *[]ProcessServerDetails `json:"processServers,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) MarshalJSON() ([]byte, error) { + vmvfsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 + objectMap := make(map[string]interface{}) + if vmvfsd.InstanceType != "" { + objectMap["instanceType"] = vmvfsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return &vmvfsd, true +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vmvfsd, true +} + +// VMwareVirtualMachineDetails vMware provider specific settings. +type VMwareVirtualMachineDetails struct { + // AgentGeneratedID - The ID generated by the InMage agent after it gets installed on guest. This is the ID to be used during InMage CreateProtection. + AgentGeneratedID *string `json:"agentGeneratedId,omitempty"` + // AgentInstalled - The value indicating if InMage scout agent is installed on guest. + AgentInstalled *string `json:"agentInstalled,omitempty"` + // OsType - The OsType installed on VM. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // IPAddress - The IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // PoweredOn - The value indicating whether VM is powered on. + PoweredOn *string `json:"poweredOn,omitempty"` + // VCenterInfrastructureID - The VCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. Value can be vCenter or physical. + DiscoveryType *string `json:"discoveryType,omitempty"` + // DiskDetails - The disk details. + DiskDetails *[]InMageDiskDetails `json:"diskDetails,omitempty"` + // ValidationErrors - The validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) MarshalJSON() ([]byte, error) { + vmvmd.InstanceType = InstanceTypeVMwareVirtualMachine + objectMap := make(map[string]interface{}) + if vmvmd.AgentGeneratedID != nil { + objectMap["agentGeneratedId"] = vmvmd.AgentGeneratedID + } + if vmvmd.AgentInstalled != nil { + objectMap["agentInstalled"] = vmvmd.AgentInstalled + } + if vmvmd.OsType != nil { + objectMap["osType"] = vmvmd.OsType + } + if vmvmd.AgentVersion != nil { + objectMap["agentVersion"] = vmvmd.AgentVersion + } + if vmvmd.IPAddress != nil { + objectMap["ipAddress"] = vmvmd.IPAddress + } + if vmvmd.PoweredOn != nil { + objectMap["poweredOn"] = vmvmd.PoweredOn + } + if vmvmd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = vmvmd.VCenterInfrastructureID + } + if vmvmd.DiscoveryType != nil { + objectMap["discoveryType"] = vmvmd.DiscoveryType + } + if vmvmd.DiskDetails != nil { + objectMap["diskDetails"] = vmvmd.DiskDetails + } + if vmvmd.ValidationErrors != nil { + objectMap["validationErrors"] = vmvmd.ValidationErrors + } + if vmvmd.InstanceType != "" { + objectMap["instanceType"] = vmvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return &vmvmd, true +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &vmvmd, true +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/operations.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/operations.go new file mode 100644 index 000000000000..a445a1163265 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/operations.go @@ -0,0 +1,145 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the client for the Operations methods of the Siterecovery service. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string, resourceGroupName string, resourceName string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// List operation to return the list of available operations. +func (client OperationsClient) List(ctx context.Context) (result OperationsDiscoveryCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.odc.Response.Response != nil { + sc = result.odc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.odc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.odc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", resp, "Failure responding to request") + return + } + if result.odc.hasNextLink() && result.odc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/operations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationsDiscoveryCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationsDiscoveryCollection) (result OperationsDiscoveryCollection, err error) { + req, err := lastResults.operationsDiscoveryCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationsDiscoveryCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/recoverypoints.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/recoverypoints.go new file mode 100644 index 000000000000..4557254fed08 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/recoverypoints.go @@ -0,0 +1,235 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RecoveryPointsClient is the client for the RecoveryPoints methods of the Siterecovery service. +type RecoveryPointsClient struct { + BaseClient +} + +// NewRecoveryPointsClient creates an instance of the RecoveryPointsClient client. +func NewRecoveryPointsClient(subscriptionID string, resourceGroupName string, resourceName string) RecoveryPointsClient { + return NewRecoveryPointsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewRecoveryPointsClientWithBaseURI creates an instance of the RecoveryPointsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewRecoveryPointsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) RecoveryPointsClient { + return RecoveryPointsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get get the details of specified recovery point. +// Parameters: +// fabricName - the fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replication protected item name. +// recoveryPointName - the recovery point name. +func (client RecoveryPointsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (result RecoveryPoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, recoveryPointName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client RecoveryPointsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "recoveryPointName": autorest.Encode("path", recoveryPointName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints/{recoveryPointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RecoveryPointsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RecoveryPointsClient) GetResponder(resp *http.Response) (result RecoveryPoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationProtectedItems lists the available recovery points for a replication protected item. +// Parameters: +// fabricName - the fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replication protected item name. +func (client RecoveryPointsClient) ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result RecoveryPointCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.RPCVar.Response.Response != nil { + sc = result.RPCVar.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectedItemsNextResults + req, err := client.ListByReplicationProtectedItemsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.RPCVar.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", resp, "Failure sending request") + return + } + + result.RPCVar, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", resp, "Failure responding to request") + return + } + if result.RPCVar.hasNextLink() && result.RPCVar.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectedItemsPreparer prepares the ListByReplicationProtectedItems request. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectedItemsSender sends the ListByReplicationProtectedItems request. The method will close the +// http.Response Body if it receives an error. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectedItemsResponder handles the response to the ListByReplicationProtectedItems request. The method always +// closes the http.Response Body. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsResponder(resp *http.Response) (result RecoveryPointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectedItemsNextResults retrieves the next set of results, if any. +func (client RecoveryPointsClient) listByReplicationProtectedItemsNextResults(ctx context.Context, lastResults RecoveryPointCollection) (result RecoveryPointCollection, err error) { + req, err := lastResults.recoveryPointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectedItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result RecoveryPointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectedItems(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationalertsettings.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationalertsettings.go new file mode 100644 index 000000000000..3c414803ae43 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationalertsettings.go @@ -0,0 +1,302 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationAlertSettingsClient is the client for the ReplicationAlertSettings methods of the Siterecovery service. +type ReplicationAlertSettingsClient struct { + BaseClient +} + +// NewReplicationAlertSettingsClient creates an instance of the ReplicationAlertSettingsClient client. +func NewReplicationAlertSettingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationAlertSettingsClient { + return NewReplicationAlertSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationAlertSettingsClientWithBaseURI creates an instance of the ReplicationAlertSettingsClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationAlertSettingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationAlertSettingsClient { + return ReplicationAlertSettingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create create or update an email notification(alert) configuration. +// Parameters: +// alertSettingName - the name of the email notification(alert) configuration. +// request - the input to configure the email notification(alert). +func (client ReplicationAlertSettingsClient) Create(ctx context.Context, alertSettingName string, request ConfigureAlertRequest) (result Alert, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, alertSettingName, request) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationAlertSettingsClient) CreatePreparer(ctx context.Context, alertSettingName string, request ConfigureAlertRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertSettingName": autorest.Encode("path", alertSettingName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) CreateResponder(resp *http.Response) (result Alert, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of the specified email notification(alert) configuration. +// Parameters: +// alertSettingName - the name of the email notification configuration. +func (client ReplicationAlertSettingsClient) Get(ctx context.Context, alertSettingName string) (result Alert, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, alertSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationAlertSettingsClient) GetPreparer(ctx context.Context, alertSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertSettingName": autorest.Encode("path", alertSettingName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) GetResponder(resp *http.Response) (result Alert, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of email notification(alert) configurations for the vault. +func (client ReplicationAlertSettingsClient) List(ctx context.Context) (result AlertCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.List") + defer func() { + sc := -1 + if result.ac.Response.Response != nil { + sc = result.ac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", resp, "Failure sending request") + return + } + + result.ac, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", resp, "Failure responding to request") + return + } + if result.ac.hasNextLink() && result.ac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationAlertSettingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) ListResponder(resp *http.Response) (result AlertCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationAlertSettingsClient) listNextResults(ctx context.Context, lastResults AlertCollection) (result AlertCollection, err error) { + req, err := lastResults.alertCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationAlertSettingsClient) ListComplete(ctx context.Context) (result AlertCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationappliances.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationappliances.go new file mode 100644 index 000000000000..c6bffed5baef --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationappliances.go @@ -0,0 +1,152 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationAppliancesClient is the client for the ReplicationAppliances methods of the Siterecovery service. +type ReplicationAppliancesClient struct { + BaseClient +} + +// NewReplicationAppliancesClient creates an instance of the ReplicationAppliancesClient client. +func NewReplicationAppliancesClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationAppliancesClient { + return NewReplicationAppliancesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationAppliancesClientWithBaseURI creates an instance of the ReplicationAppliancesClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewReplicationAppliancesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationAppliancesClient { + return ReplicationAppliancesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// List gets the list of Azure Site Recovery appliances for the vault. +// Parameters: +// filter - oData filter options. +func (client ReplicationAppliancesClient) List(ctx context.Context, filter string) (result ApplianceCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAppliancesClient.List") + defer func() { + sc := -1 + if result.ac.Response.Response != nil { + sc = result.ac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "List", resp, "Failure sending request") + return + } + + result.ac, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "List", resp, "Failure responding to request") + return + } + if result.ac.hasNextLink() && result.ac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationAppliancesClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAppliances", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAppliancesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationAppliancesClient) ListResponder(resp *http.Response) (result ApplianceCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationAppliancesClient) listNextResults(ctx context.Context, lastResults ApplianceCollection) (result ApplianceCollection, err error) { + req, err := lastResults.applianceCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationAppliancesClient) ListComplete(ctx context.Context, filter string) (result ApplianceCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAppliancesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationeligibilityresults.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationeligibilityresults.go new file mode 100644 index 000000000000..7cabdecade8f --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationeligibilityresults.go @@ -0,0 +1,183 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationEligibilityResultsClient is the client for the ReplicationEligibilityResults methods of the Siterecovery +// service. +type ReplicationEligibilityResultsClient struct { + BaseClient +} + +// NewReplicationEligibilityResultsClient creates an instance of the ReplicationEligibilityResultsClient client. +func NewReplicationEligibilityResultsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationEligibilityResultsClient { + return NewReplicationEligibilityResultsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationEligibilityResultsClientWithBaseURI creates an instance of the ReplicationEligibilityResultsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationEligibilityResultsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationEligibilityResultsClient { + return ReplicationEligibilityResultsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get validates whether a given VM can be protected or not in which case returns list of errors. +// Parameters: +// virtualMachineName - virtual Machine name. +func (client ReplicationEligibilityResultsClient) Get(ctx context.Context, virtualMachineName string) (result ReplicationEligibilityResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEligibilityResultsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, virtualMachineName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationEligibilityResultsClient) GetPreparer(ctx context.Context, virtualMachineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineName": autorest.Encode("path", virtualMachineName), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEligibilityResultsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationEligibilityResultsClient) GetResponder(resp *http.Response) (result ReplicationEligibilityResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List validates whether a given VM can be protected or not in which case returns list of errors. +// Parameters: +// virtualMachineName - virtual Machine name. +func (client ReplicationEligibilityResultsClient) List(ctx context.Context, virtualMachineName string) (result ReplicationEligibilityResultsCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEligibilityResultsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, virtualMachineName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationEligibilityResultsClient) ListPreparer(ctx context.Context, virtualMachineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineName": autorest.Encode("path", virtualMachineName), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEligibilityResultsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationEligibilityResultsClient) ListResponder(resp *http.Response) (result ReplicationEligibilityResultsCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationevents.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationevents.go new file mode 100644 index 000000000000..f5e4fe3a08cb --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationevents.go @@ -0,0 +1,228 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationEventsClient is the client for the ReplicationEvents methods of the Siterecovery service. +type ReplicationEventsClient struct { + BaseClient +} + +// NewReplicationEventsClient creates an instance of the ReplicationEventsClient client. +func NewReplicationEventsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationEventsClient { + return NewReplicationEventsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationEventsClientWithBaseURI creates an instance of the ReplicationEventsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationEventsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationEventsClient { + return ReplicationEventsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get the operation to get the details of an Azure Site recovery event. +// Parameters: +// eventName - the name of the Azure Site Recovery event. +func (client ReplicationEventsClient) Get(ctx context.Context, eventName string) (result Event, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, eventName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationEventsClient) GetPreparer(ctx context.Context, eventName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "eventName": autorest.Encode("path", eventName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents/{eventName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEventsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationEventsClient) GetResponder(resp *http.Response) (result Event, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of Azure Site Recovery events for the vault. +// Parameters: +// filter - oData filter options. +func (client ReplicationEventsClient) List(ctx context.Context, filter string) (result EventCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.List") + defer func() { + sc := -1 + if result.ec.Response.Response != nil { + sc = result.ec.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ec.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", resp, "Failure sending request") + return + } + + result.ec, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", resp, "Failure responding to request") + return + } + if result.ec.hasNextLink() && result.ec.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationEventsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEventsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationEventsClient) ListResponder(resp *http.Response) (result EventCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationEventsClient) listNextResults(ctx context.Context, lastResults EventCollection) (result EventCollection, err error) { + req, err := lastResults.eventCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationEventsClient) ListComplete(ctx context.Context, filter string) (result EventCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationfabrics.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationfabrics.go new file mode 100644 index 000000000000..6f09f7dca7a2 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationfabrics.go @@ -0,0 +1,786 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationFabricsClient is the client for the ReplicationFabrics methods of the Siterecovery service. +type ReplicationFabricsClient struct { + BaseClient +} + +// NewReplicationFabricsClient creates an instance of the ReplicationFabricsClient client. +func NewReplicationFabricsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationFabricsClient { + return NewReplicationFabricsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationFabricsClientWithBaseURI creates an instance of the ReplicationFabricsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationFabricsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationFabricsClient { + return ReplicationFabricsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// CheckConsistency the operation to perform a consistency check on the fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationFabricsClient) CheckConsistency(ctx context.Context, fabricName string) (result ReplicationFabricsCheckConsistencyFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.CheckConsistency") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CheckConsistencyPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "CheckConsistency", nil, "Failure preparing request") + return + } + + result, err = client.CheckConsistencySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "CheckConsistency", result.Response(), "Failure sending request") + return + } + + return +} + +// CheckConsistencyPreparer prepares the CheckConsistency request. +func (client ReplicationFabricsClient) CheckConsistencyPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/checkConsistency", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckConsistencySender sends the CheckConsistency request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) CheckConsistencySender(req *http.Request) (future ReplicationFabricsCheckConsistencyFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CheckConsistencyResponder handles the response to the CheckConsistency request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) CheckConsistencyResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Create the operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). +// Parameters: +// fabricName - name of the ASR fabric. +// input - fabric creation input. +func (client ReplicationFabricsClient) Create(ctx context.Context, fabricName string, input FabricCreationInput) (result ReplicationFabricsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationFabricsClient) CreatePreparer(ctx context.Context, fabricName string, input FabricCreationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) CreateSender(req *http.Request) (future ReplicationFabricsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) CreateResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete or remove an Azure Site Recovery fabric. +// Parameters: +// fabricName - ASR fabric to delete. +func (client ReplicationFabricsClient) Delete(ctx context.Context, fabricName string) (result ReplicationFabricsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationFabricsClient) DeletePreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) DeleteSender(req *http.Request) (future ReplicationFabricsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of an Azure Site Recovery fabric. +// Parameters: +// fabricName - fabric name. +// filter - oData filter options. +func (client ReplicationFabricsClient) Get(ctx context.Context, fabricName string, filter string) (result Fabric, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationFabricsClient) GetPreparer(ctx context.Context, fabricName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) GetResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of the Azure Site Recovery fabrics in the vault. +func (client ReplicationFabricsClient) List(ctx context.Context) (result FabricCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.List") + defer func() { + sc := -1 + if result.fc.Response.Response != nil { + sc = result.fc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.fc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", resp, "Failure sending request") + return + } + + result.fc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", resp, "Failure responding to request") + return + } + if result.fc.hasNextLink() && result.fc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationFabricsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) ListResponder(resp *http.Response) (result FabricCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationFabricsClient) listNextResults(ctx context.Context, lastResults FabricCollection) (result FabricCollection, err error) { + req, err := lastResults.fabricCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationFabricsClient) ListComplete(ctx context.Context) (result FabricCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// MigrateToAad the operation to migrate an Azure Site Recovery fabric to AAD. +// Parameters: +// fabricName - ASR fabric to migrate. +func (client ReplicationFabricsClient) MigrateToAad(ctx context.Context, fabricName string) (result ReplicationFabricsMigrateToAadFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.MigrateToAad") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.MigrateToAadPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "MigrateToAad", nil, "Failure preparing request") + return + } + + result, err = client.MigrateToAadSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "MigrateToAad", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateToAadPreparer prepares the MigrateToAad request. +func (client ReplicationFabricsClient) MigrateToAadPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/migratetoaad", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateToAadSender sends the MigrateToAad request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) MigrateToAadSender(req *http.Request) (future ReplicationFabricsMigrateToAadFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateToAadResponder handles the response to the MigrateToAad request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) MigrateToAadResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Purge the operation to purge(force delete) an Azure Site Recovery fabric. +// Parameters: +// fabricName - ASR fabric to purge. +func (client ReplicationFabricsClient) Purge(ctx context.Context, fabricName string) (result ReplicationFabricsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationFabricsClient) PurgePreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) PurgeSender(req *http.Request) (future ReplicationFabricsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// ReassociateGateway the operation to move replications from a process server to another process server. +// Parameters: +// fabricName - the name of the fabric containing the process server. +// failoverProcessServerRequest - the input to the failover process server operation. +func (client ReplicationFabricsClient) ReassociateGateway(ctx context.Context, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest) (result ReplicationFabricsReassociateGatewayFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.ReassociateGateway") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReassociateGatewayPreparer(ctx, fabricName, failoverProcessServerRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "ReassociateGateway", nil, "Failure preparing request") + return + } + + result, err = client.ReassociateGatewaySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "ReassociateGateway", result.Response(), "Failure sending request") + return + } + + return +} + +// ReassociateGatewayPreparer prepares the ReassociateGateway request. +func (client ReplicationFabricsClient) ReassociateGatewayPreparer(ctx context.Context, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/reassociateGateway", pathParameters), + autorest.WithJSON(failoverProcessServerRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReassociateGatewaySender sends the ReassociateGateway request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) ReassociateGatewaySender(req *http.Request) (future ReplicationFabricsReassociateGatewayFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReassociateGatewayResponder handles the response to the ReassociateGateway request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) ReassociateGatewayResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RenewCertificate renews the connection certificate for the ASR replication fabric. +// Parameters: +// fabricName - fabric name to renew certs for. +// renewCertificate - renew certificate input. +func (client ReplicationFabricsClient) RenewCertificate(ctx context.Context, fabricName string, renewCertificate RenewCertificateInput) (result ReplicationFabricsRenewCertificateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.RenewCertificate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RenewCertificatePreparer(ctx, fabricName, renewCertificate) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "RenewCertificate", nil, "Failure preparing request") + return + } + + result, err = client.RenewCertificateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "RenewCertificate", result.Response(), "Failure sending request") + return + } + + return +} + +// RenewCertificatePreparer prepares the RenewCertificate request. +func (client ReplicationFabricsClient) RenewCertificatePreparer(ctx context.Context, fabricName string, renewCertificate RenewCertificateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/renewCertificate", pathParameters), + autorest.WithJSON(renewCertificate), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RenewCertificateSender sends the RenewCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) RenewCertificateSender(req *http.Request) (future ReplicationFabricsRenewCertificateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RenewCertificateResponder handles the response to the RenewCertificate request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) RenewCertificateResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationjobs.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationjobs.go new file mode 100644 index 000000000000..378d57ba9909 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationjobs.go @@ -0,0 +1,547 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationJobsClient is the client for the ReplicationJobs methods of the Siterecovery service. +type ReplicationJobsClient struct { + BaseClient +} + +// NewReplicationJobsClient creates an instance of the ReplicationJobsClient client. +func NewReplicationJobsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationJobsClient { + return NewReplicationJobsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationJobsClientWithBaseURI creates an instance of the ReplicationJobsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationJobsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationJobsClient { + return ReplicationJobsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Cancel the operation to cancel an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Cancel(ctx context.Context, jobName string) (result ReplicationJobsCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Cancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CancelPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Cancel", nil, "Failure preparing request") + return + } + + result, err = client.CancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Cancel", result.Response(), "Failure sending request") + return + } + + return +} + +// CancelPreparer prepares the Cancel request. +func (client ReplicationJobsClient) CancelPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/cancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CancelSender sends the Cancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) CancelSender(req *http.Request) (future ReplicationJobsCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CancelResponder handles the response to the Cancel request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) CancelResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Export the operation to export the details of the Azure Site Recovery jobs of the vault. +// Parameters: +// jobQueryParameter - job query filter. +func (client ReplicationJobsClient) Export(ctx context.Context, jobQueryParameter JobQueryParameter) (result ReplicationJobsExportFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Export") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ExportPreparer(ctx, jobQueryParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Export", nil, "Failure preparing request") + return + } + + result, err = client.ExportSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Export", result.Response(), "Failure sending request") + return + } + + return +} + +// ExportPreparer prepares the Export request. +func (client ReplicationJobsClient) ExportPreparer(ctx context.Context, jobQueryParameter JobQueryParameter) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/export", pathParameters), + autorest.WithJSON(jobQueryParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExportSender sends the Export request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ExportSender(req *http.Request) (future ReplicationJobsExportFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ExportResponder handles the response to the Export request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ExportResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get the details of an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Get(ctx context.Context, jobName string) (result Job, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationJobsClient) GetPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) GetResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of Azure Site Recovery Jobs for the vault. +// Parameters: +// filter - oData filter options. +func (client ReplicationJobsClient) List(ctx context.Context, filter string) (result JobCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.List") + defer func() { + sc := -1 + if result.jc.Response.Response != nil { + sc = result.jc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.jc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", resp, "Failure sending request") + return + } + + result.jc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", resp, "Failure responding to request") + return + } + if result.jc.hasNextLink() && result.jc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationJobsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ListResponder(resp *http.Response) (result JobCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationJobsClient) listNextResults(ctx context.Context, lastResults JobCollection) (result JobCollection, err error) { + req, err := lastResults.jobCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationJobsClient) ListComplete(ctx context.Context, filter string) (result JobCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} + +// Restart the operation to restart an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Restart(ctx context.Context, jobName string) (result ReplicationJobsRestartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Restart") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RestartPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Restart", nil, "Failure preparing request") + return + } + + result, err = client.RestartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Restart", result.Response(), "Failure sending request") + return + } + + return +} + +// RestartPreparer prepares the Restart request. +func (client ReplicationJobsClient) RestartPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartSender sends the Restart request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) RestartSender(req *http.Request) (future ReplicationJobsRestartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestartResponder handles the response to the Restart request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) RestartResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Resume the operation to resume an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +// resumeJobParams - resume rob comments. +func (client ReplicationJobsClient) Resume(ctx context.Context, jobName string, resumeJobParams ResumeJobParams) (result ReplicationJobsResumeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Resume") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResumePreparer(ctx, jobName, resumeJobParams) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Resume", nil, "Failure preparing request") + return + } + + result, err = client.ResumeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Resume", result.Response(), "Failure sending request") + return + } + + return +} + +// ResumePreparer prepares the Resume request. +func (client ReplicationJobsClient) ResumePreparer(ctx context.Context, jobName string, resumeJobParams ResumeJobParams) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/resume", pathParameters), + autorest.WithJSON(resumeJobParams), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResumeSender sends the Resume request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ResumeSender(req *http.Request) (future ReplicationJobsResumeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResumeResponder handles the response to the Resume request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ResumeResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationlogicalnetworks.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationlogicalnetworks.go new file mode 100644 index 000000000000..8b20f858fd18 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationlogicalnetworks.go @@ -0,0 +1,229 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationLogicalNetworksClient is the client for the ReplicationLogicalNetworks methods of the Siterecovery +// service. +type ReplicationLogicalNetworksClient struct { + BaseClient +} + +// NewReplicationLogicalNetworksClient creates an instance of the ReplicationLogicalNetworksClient client. +func NewReplicationLogicalNetworksClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationLogicalNetworksClient { + return NewReplicationLogicalNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationLogicalNetworksClientWithBaseURI creates an instance of the ReplicationLogicalNetworksClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationLogicalNetworksClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationLogicalNetworksClient { + return ReplicationLogicalNetworksClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of a logical network. +// Parameters: +// fabricName - server Id. +// logicalNetworkName - logical network name. +func (client ReplicationLogicalNetworksClient) Get(ctx context.Context, fabricName string, logicalNetworkName string) (result LogicalNetwork, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, logicalNetworkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationLogicalNetworksClient) GetPreparer(ctx context.Context, fabricName string, logicalNetworkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "logicalNetworkName": autorest.Encode("path", logicalNetworkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks/{logicalNetworkName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationLogicalNetworksClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationLogicalNetworksClient) GetResponder(resp *http.Response) (result LogicalNetwork, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationFabrics lists all the logical networks of the Azure Site Recovery fabric. +// Parameters: +// fabricName - server Id. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result LogicalNetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.lnc.Response.Response != nil { + sc = result.lnc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.lnc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.lnc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.lnc.hasNextLink() && result.lnc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsResponder(resp *http.Response) (result LogicalNetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationLogicalNetworksClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults LogicalNetworkCollection) (result LogicalNetworkCollection, err error) { + req, err := lastResults.logicalNetworkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result LogicalNetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationmigrationitems.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationmigrationitems.go new file mode 100644 index 000000000000..7cf872b8646c --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationmigrationitems.go @@ -0,0 +1,1009 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationMigrationItemsClient is the client for the ReplicationMigrationItems methods of the Siterecovery service. +type ReplicationMigrationItemsClient struct { + BaseClient +} + +// NewReplicationMigrationItemsClient creates an instance of the ReplicationMigrationItemsClient client. +func NewReplicationMigrationItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationMigrationItemsClient { + return NewReplicationMigrationItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationMigrationItemsClientWithBaseURI creates an instance of the ReplicationMigrationItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationMigrationItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationMigrationItemsClient { + return ReplicationMigrationItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR migration item (enable migration). +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - enable migration input. +func (client ReplicationMigrationItemsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input EnableMigrationInput) (result ReplicationMigrationItemsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.PolicyID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationMigrationItemsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input EnableMigrationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) CreateSender(req *http.Request) (future ReplicationMigrationItemsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) CreateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// deleteOption - the delete option. +func (client ReplicationMigrationItemsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (result ReplicationMigrationItemsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, migrationItemName, deleteOption) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationMigrationItemsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(deleteOption) > 0 { + queryParameters["deleteOption"] = autorest.Encode("query", deleteOption) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) DeleteSender(req *http.Request) (future ReplicationMigrationItemsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get sends the get request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +func (client ReplicationMigrationItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, migrationItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationMigrationItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) GetResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List sends the list request. +// Parameters: +// skipToken - the pagination token. +// takeToken - the page size. +// filter - oData filter options. +func (client ReplicationMigrationItemsClient) List(ctx context.Context, skipToken string, takeToken string, filter string) (result MigrationItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.List") + defer func() { + sc := -1 + if result.mic.Response.Response != nil { + sc = result.mic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, takeToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.mic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", resp, "Failure sending request") + return + } + + result.mic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", resp, "Failure responding to request") + return + } + if result.mic.hasNextLink() && result.mic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationMigrationItemsClient) ListPreparer(ctx context.Context, skipToken string, takeToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationMigrationItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ListResponder(resp *http.Response) (result MigrationItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationMigrationItemsClient) listNextResults(ctx context.Context, lastResults MigrationItemCollection) (result MigrationItemCollection, err error) { + req, err := lastResults.migrationItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationMigrationItemsClient) ListComplete(ctx context.Context, skipToken string, takeToken string, filter string) (result MigrationItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, takeToken, filter) + return +} + +// ListByReplicationProtectionContainers gets the list of ASR migration items in the protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// skipToken - the pagination token. +// takeToken - the page size. +// filter - oData filter options. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result MigrationItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.mic.Response.Response != nil { + sc = result.mic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName, skipToken, takeToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.mic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.mic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.mic.hasNextLink() && result.mic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result MigrationItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationMigrationItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults MigrationItemCollection) (result MigrationItemCollection, err error) { + req, err := lastResults.migrationItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result MigrationItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName, skipToken, takeToken, filter) + return +} + +// Migrate the operation to initiate migration of the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// migrateInput - migrate input. +func (client ReplicationMigrationItemsClient) Migrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput MigrateInput) (result ReplicationMigrationItemsMigrateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Migrate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: migrateInput, + Constraints: []validation.Constraint{{Target: "migrateInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Migrate", err.Error()) + } + + req, err := client.MigratePreparer(ctx, fabricName, protectionContainerName, migrationItemName, migrateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Migrate", nil, "Failure preparing request") + return + } + + result, err = client.MigrateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Migrate", result.Response(), "Failure sending request") + return + } + + return +} + +// MigratePreparer prepares the Migrate request. +func (client ReplicationMigrationItemsClient) MigratePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput MigrateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrate", pathParameters), + autorest.WithJSON(migrateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateSender sends the Migrate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) MigrateSender(req *http.Request) (future ReplicationMigrationItemsMigrateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateResponder handles the response to the Migrate request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) MigrateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Resync the operation to resynchronize replication of an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - resync input. +func (client ReplicationMigrationItemsClient) Resync(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input ResyncInput) (result ReplicationMigrationItemsResyncFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Resync") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Resync", err.Error()) + } + + req, err := client.ResyncPreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Resync", nil, "Failure preparing request") + return + } + + result, err = client.ResyncSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Resync", result.Response(), "Failure sending request") + return + } + + return +} + +// ResyncPreparer prepares the Resync request. +func (client ReplicationMigrationItemsClient) ResyncPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input ResyncInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/resync", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResyncSender sends the Resync request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ResyncSender(req *http.Request) (future ReplicationMigrationItemsResyncFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResyncResponder handles the response to the Resync request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ResyncResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestMigrate the operation to initiate test migration of the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// testMigrateInput - test migrate input. +func (client ReplicationMigrationItemsClient) TestMigrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput TestMigrateInput) (result ReplicationMigrationItemsTestMigrateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.TestMigrate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testMigrateInput, + Constraints: []validation.Constraint{{Target: "testMigrateInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "TestMigrate", err.Error()) + } + + req, err := client.TestMigratePreparer(ctx, fabricName, protectionContainerName, migrationItemName, testMigrateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrate", nil, "Failure preparing request") + return + } + + result, err = client.TestMigrateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrate", result.Response(), "Failure sending request") + return + } + + return +} + +// TestMigratePreparer prepares the TestMigrate request. +func (client ReplicationMigrationItemsClient) TestMigratePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput TestMigrateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrate", pathParameters), + autorest.WithJSON(testMigrateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestMigrateSender sends the TestMigrate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) TestMigrateSender(req *http.Request) (future ReplicationMigrationItemsTestMigrateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestMigrateResponder handles the response to the TestMigrate request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) TestMigrateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestMigrateCleanup the operation to initiate test migrate cleanup. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// testMigrateCleanupInput - test migrate cleanup input. +func (client ReplicationMigrationItemsClient) TestMigrateCleanup(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput TestMigrateCleanupInput) (result ReplicationMigrationItemsTestMigrateCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.TestMigrateCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testMigrateCleanupInput, + Constraints: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", err.Error()) + } + + req, err := client.TestMigrateCleanupPreparer(ctx, fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestMigrateCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestMigrateCleanupPreparer prepares the TestMigrateCleanup request. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput TestMigrateCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrateCleanup", pathParameters), + autorest.WithJSON(testMigrateCleanupInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestMigrateCleanupSender sends the TestMigrateCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupSender(req *http.Request) (future ReplicationMigrationItemsTestMigrateCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestMigrateCleanupResponder handles the response to the TestMigrateCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update the recovery settings of an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - update migration item input. +func (client ReplicationMigrationItemsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input UpdateMigrationItemInput) (result ReplicationMigrationItemsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationMigrationItemsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input UpdateMigrationItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) UpdateSender(req *http.Request) (future ReplicationMigrationItemsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) UpdateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationnetworkmappings.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationnetworkmappings.go new file mode 100644 index 000000000000..efac734d4303 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationnetworkmappings.go @@ -0,0 +1,610 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationNetworkMappingsClient is the client for the ReplicationNetworkMappings methods of the Siterecovery +// service. +type ReplicationNetworkMappingsClient struct { + BaseClient +} + +// NewReplicationNetworkMappingsClient creates an instance of the ReplicationNetworkMappingsClient client. +func NewReplicationNetworkMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworkMappingsClient { + return NewReplicationNetworkMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationNetworkMappingsClientWithBaseURI creates an instance of the ReplicationNetworkMappingsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationNetworkMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworkMappingsClient { + return ReplicationNetworkMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +// input - create network mapping input. +func (client ReplicationNetworkMappingsClient) Create(ctx context.Context, fabricName string, networkName string, networkMappingName string, input CreateNetworkMappingInput) (result ReplicationNetworkMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.RecoveryNetworkID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationNetworkMappingsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, networkName, networkMappingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationNetworkMappingsClient) CreatePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string, input CreateNetworkMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) CreateSender(req *http.Request) (future ReplicationNetworkMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) CreateResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - ARM Resource Name for network mapping. +func (client ReplicationNetworkMappingsClient) Delete(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result ReplicationNetworkMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, networkName, networkMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationNetworkMappingsClient) DeletePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) DeleteSender(req *http.Request) (future ReplicationNetworkMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +func (client ReplicationNetworkMappingsClient) Get(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result NetworkMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, networkName, networkMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationNetworkMappingsClient) GetPreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) GetResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all ASR network mappings in the vault. +func (client ReplicationNetworkMappingsClient) List(ctx context.Context) (result NetworkMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.List") + defer func() { + sc := -1 + if result.nmc.Response.Response != nil { + sc = result.nmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.nmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", resp, "Failure sending request") + return + } + + result.nmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.nmc.hasNextLink() && result.nmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationNetworkMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationNetworkMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) ListResponder(resp *http.Response) (result NetworkMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationNetworkMappingsClient) listNextResults(ctx context.Context, lastResults NetworkMappingCollection) (result NetworkMappingCollection, err error) { + req, err := lastResults.networkMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworkMappingsClient) ListComplete(ctx context.Context) (result NetworkMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationNetworks lists all ASR network mappings for the specified network. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworks(ctx context.Context, fabricName string, networkName string) (result NetworkMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.ListByReplicationNetworks") + defer func() { + sc := -1 + if result.nmc.Response.Response != nil { + sc = result.nmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationNetworksNextResults + req, err := client.ListByReplicationNetworksPreparer(ctx, fabricName, networkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationNetworksSender(req) + if err != nil { + result.nmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", resp, "Failure sending request") + return + } + + result.nmc, err = client.ListByReplicationNetworksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", resp, "Failure responding to request") + return + } + if result.nmc.hasNextLink() && result.nmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationNetworksPreparer prepares the ListByReplicationNetworks request. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksPreparer(ctx context.Context, fabricName string, networkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationNetworksSender sends the ListByReplicationNetworks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationNetworksResponder handles the response to the ListByReplicationNetworks request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksResponder(resp *http.Response) (result NetworkMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationNetworksNextResults retrieves the next set of results, if any. +func (client ReplicationNetworkMappingsClient) listByReplicationNetworksNextResults(ctx context.Context, lastResults NetworkMappingCollection) (result NetworkMappingCollection, err error) { + req, err := lastResults.networkMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationNetworksSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationNetworksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationNetworksComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksComplete(ctx context.Context, fabricName string, networkName string) (result NetworkMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.ListByReplicationNetworks") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationNetworks(ctx, fabricName, networkName) + return +} + +// Update the operation to update an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +// input - update network mapping input. +func (client ReplicationNetworkMappingsClient) Update(ctx context.Context, fabricName string, networkName string, networkMappingName string, input UpdateNetworkMappingInput) (result ReplicationNetworkMappingsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, networkName, networkMappingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationNetworkMappingsClient) UpdatePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string, input UpdateNetworkMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) UpdateSender(req *http.Request) (future ReplicationNetworkMappingsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) UpdateResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationnetworks.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationnetworks.go new file mode 100644 index 000000000000..fde345bc9429 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationnetworks.go @@ -0,0 +1,343 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationNetworksClient is the client for the ReplicationNetworks methods of the Siterecovery service. +type ReplicationNetworksClient struct { + BaseClient +} + +// NewReplicationNetworksClient creates an instance of the ReplicationNetworksClient client. +func NewReplicationNetworksClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworksClient { + return NewReplicationNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationNetworksClientWithBaseURI creates an instance of the ReplicationNetworksClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationNetworksClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworksClient { + return ReplicationNetworksClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of a network. +// Parameters: +// fabricName - server Id. +// networkName - primary network name. +func (client ReplicationNetworksClient) Get(ctx context.Context, fabricName string, networkName string) (result Network, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, networkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationNetworksClient) GetPreparer(ctx context.Context, fabricName string, networkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) GetResponder(resp *http.Response) (result Network, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the networks available in a vault. +func (client ReplicationNetworksClient) List(ctx context.Context) (result NetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.List") + defer func() { + sc := -1 + if result.nc.Response.Response != nil { + sc = result.nc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.nc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", resp, "Failure sending request") + return + } + + result.nc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", resp, "Failure responding to request") + return + } + if result.nc.hasNextLink() && result.nc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationNetworksClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) ListResponder(resp *http.Response) (result NetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationNetworksClient) listNextResults(ctx context.Context, lastResults NetworkCollection) (result NetworkCollection, err error) { + req, err := lastResults.networkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworksClient) ListComplete(ctx context.Context) (result NetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the networks available for a fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationNetworksClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result NetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.nc.Response.Response != nil { + sc = result.nc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.nc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.nc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.nc.hasNextLink() && result.nc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationNetworksClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) ListByReplicationFabricsResponder(resp *http.Response) (result NetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationNetworksClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults NetworkCollection) (result NetworkCollection, err error) { + req, err := lastResults.networkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworksClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result NetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationpolicies.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationpolicies.go new file mode 100644 index 000000000000..fab63f7edcd6 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationpolicies.go @@ -0,0 +1,465 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationPoliciesClient is the client for the ReplicationPolicies methods of the Siterecovery service. +type ReplicationPoliciesClient struct { + BaseClient +} + +// NewReplicationPoliciesClient creates an instance of the ReplicationPoliciesClient client. +func NewReplicationPoliciesClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationPoliciesClient { + return NewReplicationPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationPoliciesClientWithBaseURI creates an instance of the ReplicationPoliciesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationPoliciesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationPoliciesClient { + return ReplicationPoliciesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a replication policy. +// Parameters: +// policyName - replication policy name. +// input - create policy input. +func (client ReplicationPoliciesClient) Create(ctx context.Context, policyName string, input CreatePolicyInput) (result ReplicationPoliciesCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, policyName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationPoliciesClient) CreatePreparer(ctx context.Context, policyName string, input CreatePolicyInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) CreateSender(req *http.Request) (future ReplicationPoliciesCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) CreateResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a replication policy. +// Parameters: +// policyName - replication policy name. +func (client ReplicationPoliciesClient) Delete(ctx context.Context, policyName string) (result ReplicationPoliciesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationPoliciesClient) DeletePreparer(ctx context.Context, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) DeleteSender(req *http.Request) (future ReplicationPoliciesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a replication policy. +// Parameters: +// policyName - replication policy name. +func (client ReplicationPoliciesClient) Get(ctx context.Context, policyName string) (result Policy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationPoliciesClient) GetPreparer(ctx context.Context, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) GetResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the replication policies for a vault. +func (client ReplicationPoliciesClient) List(ctx context.Context) (result PolicyCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.List") + defer func() { + sc := -1 + if result.pc.Response.Response != nil { + sc = result.pc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", resp, "Failure sending request") + return + } + + result.pc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", resp, "Failure responding to request") + return + } + if result.pc.hasNextLink() && result.pc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationPoliciesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) ListResponder(resp *http.Response) (result PolicyCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationPoliciesClient) listNextResults(ctx context.Context, lastResults PolicyCollection) (result PolicyCollection, err error) { + req, err := lastResults.policyCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationPoliciesClient) ListComplete(ctx context.Context) (result PolicyCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// Update the operation to update a replication policy. +// Parameters: +// policyName - policy Id. +// input - update Policy Input. +func (client ReplicationPoliciesClient) Update(ctx context.Context, policyName string, input UpdatePolicyInput) (result ReplicationPoliciesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, policyName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationPoliciesClient) UpdatePreparer(ctx context.Context, policyName string, input UpdatePolicyInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) UpdateSender(req *http.Request) (future ReplicationPoliciesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) UpdateResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationprotectableitems.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationprotectableitems.go new file mode 100644 index 000000000000..b22357d59e30 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationprotectableitems.go @@ -0,0 +1,245 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectableItemsClient is the client for the ReplicationProtectableItems methods of the Siterecovery +// service. +type ReplicationProtectableItemsClient struct { + BaseClient +} + +// NewReplicationProtectableItemsClient creates an instance of the ReplicationProtectableItemsClient client. +func NewReplicationProtectableItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectableItemsClient { + return NewReplicationProtectableItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectableItemsClientWithBaseURI creates an instance of the ReplicationProtectableItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationProtectableItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectableItemsClient { + return ReplicationProtectableItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get the operation to get the details of a protectable item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// protectableItemName - protectable item name. +func (client ReplicationProtectableItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (result ProtectableItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, protectableItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectableItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectableItemName": autorest.Encode("path", protectableItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems/{protectableItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectableItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectableItemsClient) GetResponder(resp *http.Response) (result ProtectableItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationProtectionContainers lists the protectable items in a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// filter - oData filter options. +// take - take OData query parameter. +// skipToken - skipToken OData query parameter. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result ProtectableItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.pic.Response.Response != nil { + sc = result.pic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName, filter, take, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.pic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.pic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.pic.hasNextLink() && result.pic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(take) > 0 { + queryParameters["$take"] = autorest.Encode("query", take) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ProtectableItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectableItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ProtectableItemCollection) (result ProtectableItemCollection, err error) { + req, err := lastResults.protectableItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result ProtectableItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName, filter, take, skipToken) + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationprotecteditems.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationprotecteditems.go new file mode 100644 index 000000000000..663d79db2902 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationprotecteditems.go @@ -0,0 +1,2021 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectedItemsClient is the client for the ReplicationProtectedItems methods of the Siterecovery service. +type ReplicationProtectedItemsClient struct { + BaseClient +} + +// NewReplicationProtectedItemsClient creates an instance of the ReplicationProtectedItemsClient client. +func NewReplicationProtectedItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectedItemsClient { + return NewReplicationProtectedItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectedItemsClientWithBaseURI creates an instance of the ReplicationProtectedItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationProtectedItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectedItemsClient { + return ReplicationProtectedItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// AddDisks operation to add disks(s) to the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// addDisksInput - add disks input. +func (client ReplicationProtectedItemsClient) AddDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput AddDisksInput) (result ReplicationProtectedItemsAddDisksFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.AddDisks") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddDisksPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, addDisksInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "AddDisks", nil, "Failure preparing request") + return + } + + result, err = client.AddDisksSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "AddDisks", result.Response(), "Failure sending request") + return + } + + return +} + +// AddDisksPreparer prepares the AddDisks request. +func (client ReplicationProtectedItemsClient) AddDisksPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput AddDisksInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/addDisks", pathParameters), + autorest.WithJSON(addDisksInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddDisksSender sends the AddDisks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) AddDisksSender(req *http.Request) (future ReplicationProtectedItemsAddDisksFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// AddDisksResponder handles the response to the AddDisks request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) AddDisksResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ApplyRecoveryPoint the operation to change the recovery point of a failed over replication protected item. +// Parameters: +// fabricName - the ARM fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replicated protected item name. +// applyRecoveryPointInput - the ApplyRecoveryPointInput. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPoint(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput ApplyRecoveryPointInput) (result ReplicationProtectedItemsApplyRecoveryPointFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ApplyRecoveryPoint") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: applyRecoveryPointInput, + Constraints: []validation.Constraint{{Target: "applyRecoveryPointInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", err.Error()) + } + + req, err := client.ApplyRecoveryPointPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, applyRecoveryPointInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", nil, "Failure preparing request") + return + } + + result, err = client.ApplyRecoveryPointSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", result.Response(), "Failure sending request") + return + } + + return +} + +// ApplyRecoveryPointPreparer prepares the ApplyRecoveryPoint request. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput ApplyRecoveryPointInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/applyRecoveryPoint", pathParameters), + autorest.WithJSON(applyRecoveryPointInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ApplyRecoveryPointSender sends the ApplyRecoveryPoint request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointSender(req *http.Request) (future ReplicationProtectedItemsApplyRecoveryPointFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ApplyRecoveryPointResponder handles the response to the ApplyRecoveryPoint request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Create the operation to create an ASR replication protected item (Enable replication). +// Parameters: +// fabricName - name of the fabric. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - a name for the replication protected item. +// input - enable Protection Input. +func (client ReplicationProtectedItemsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input EnableProtectionInput) (result ReplicationProtectedItemsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectedItemsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input EnableProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) CreateSender(req *http.Request) (future ReplicationProtectedItemsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) CreateResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to disable replication on a replication protected item. This will also remove the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// disableProtectionInput - disable protection input. +func (client ReplicationProtectedItemsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput DisableProtectionInput) (result ReplicationProtectedItemsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: disableProtectionInput, + Constraints: []validation.Constraint{{Target: "disableProtectionInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, disableProtectionInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectedItemsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput DisableProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/remove", pathParameters), + autorest.WithJSON(disableProtectionInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) DeleteSender(req *http.Request) (future ReplicationProtectedItemsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// FailoverCancel operation to cancel the failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) FailoverCancel(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsFailoverCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.FailoverCancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCancelPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCancel", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCancel", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCancelPreparer prepares the FailoverCancel request. +func (client ReplicationProtectedItemsClient) FailoverCancelPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCancelSender sends the FailoverCancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) FailoverCancelSender(req *http.Request) (future ReplicationProtectedItemsFailoverCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCancelResponder handles the response to the FailoverCancel request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) FailoverCancelResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// FailoverCommit operation to commit the failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) FailoverCommit(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsFailoverCommitFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.FailoverCommit") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCommitPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCommit", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCommitSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCommit", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCommitPreparer prepares the FailoverCommit request. +func (client ReplicationProtectedItemsClient) FailoverCommitPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCommit", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCommitSender sends the FailoverCommit request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) FailoverCommitSender(req *http.Request) (future ReplicationProtectedItemsFailoverCommitFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCommitResponder handles the response to the FailoverCommit request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) FailoverCommitResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of an ASR replication protected item. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectedItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) GetResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of ASR replication protected items in the vault. +// Parameters: +// skipToken - the pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. +// filter - oData filter options. +func (client ReplicationProtectedItemsClient) List(ctx context.Context, skipToken string, filter string) (result ReplicationProtectedItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.List") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectedItemsClient) ListPreparer(ctx context.Context, skipToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectedItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ListResponder(resp *http.Response) (result ReplicationProtectedItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectedItemsClient) listNextResults(ctx context.Context, lastResults ReplicationProtectedItemCollection) (result ReplicationProtectedItemCollection, err error) { + req, err := lastResults.replicationProtectedItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectedItemsClient) ListComplete(ctx context.Context, skipToken string, filter string) (result ReplicationProtectedItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, filter) + return +} + +// ListByReplicationProtectionContainers gets the list of ASR replication protected items in the protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectedItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ReplicationProtectedItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectedItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ReplicationProtectedItemCollection) (result ReplicationProtectedItemCollection, err error) { + req, err := lastResults.replicationProtectedItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectedItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName) + return +} + +// PlannedFailover operation to initiate a planned failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// failoverInput - planned failover input. +func (client ReplicationProtectedItemsClient) PlannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput PlannedFailoverInput) (result ReplicationProtectedItemsPlannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.PlannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PlannedFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "PlannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.PlannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "PlannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// PlannedFailoverPreparer prepares the PlannedFailover request. +func (client ReplicationProtectedItemsClient) PlannedFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput PlannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/plannedFailover", pathParameters), + autorest.WithJSON(failoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PlannedFailoverSender sends the PlannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) PlannedFailoverSender(req *http.Request) (future ReplicationProtectedItemsPlannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PlannedFailoverResponder handles the response to the PlannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) PlannedFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Purge the operation to delete or purge a replication protected item. This operation will force delete the +// replication protected item. Use the remove operation on replication protected item to perform a clean disable +// replication for the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) Purge(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationProtectedItemsClient) PurgePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) PurgeSender(req *http.Request) (future ReplicationProtectedItemsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RemoveDisks operation to remove disk(s) from the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// removeDisksInput - remove disks input. +func (client ReplicationProtectedItemsClient) RemoveDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput RemoveDisksInput) (result ReplicationProtectedItemsRemoveDisksFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.RemoveDisks") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RemoveDisksPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, removeDisksInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RemoveDisks", nil, "Failure preparing request") + return + } + + result, err = client.RemoveDisksSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RemoveDisks", result.Response(), "Failure sending request") + return + } + + return +} + +// RemoveDisksPreparer prepares the RemoveDisks request. +func (client ReplicationProtectedItemsClient) RemoveDisksPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput RemoveDisksInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/removeDisks", pathParameters), + autorest.WithJSON(removeDisksInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RemoveDisksSender sends the RemoveDisks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) RemoveDisksSender(req *http.Request) (future ReplicationProtectedItemsRemoveDisksFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RemoveDisksResponder handles the response to the RemoveDisks request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) RemoveDisksResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RepairReplication the operation to start resynchronize/repair replication for a replication protected item requiring +// resynchronization. +// Parameters: +// fabricName - the name of the fabric. +// protectionContainerName - the name of the container. +// replicatedProtectedItemName - the name of the replication protected item. +func (client ReplicationProtectedItemsClient) RepairReplication(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsRepairReplicationFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.RepairReplication") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RepairReplicationPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RepairReplication", nil, "Failure preparing request") + return + } + + result, err = client.RepairReplicationSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RepairReplication", result.Response(), "Failure sending request") + return + } + + return +} + +// RepairReplicationPreparer prepares the RepairReplication request. +func (client ReplicationProtectedItemsClient) RepairReplicationPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/repairReplication", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RepairReplicationSender sends the RepairReplication request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) RepairReplicationSender(req *http.Request) (future ReplicationProtectedItemsRepairReplicationFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RepairReplicationResponder handles the response to the RepairReplication request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) RepairReplicationResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Reprotect operation to reprotect or reverse replicate a failed over replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// reprotectInput - reverse replication input. +func (client ReplicationProtectedItemsClient) Reprotect(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput ReverseReplicationInput) (result ReplicationProtectedItemsReprotectFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Reprotect") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReprotectPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, reprotectInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Reprotect", nil, "Failure preparing request") + return + } + + result, err = client.ReprotectSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Reprotect", result.Response(), "Failure sending request") + return + } + + return +} + +// ReprotectPreparer prepares the Reprotect request. +func (client ReplicationProtectedItemsClient) ReprotectPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput ReverseReplicationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/reProtect", pathParameters), + autorest.WithJSON(reprotectInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReprotectSender sends the Reprotect request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ReprotectSender(req *http.Request) (future ReplicationProtectedItemsReprotectFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReprotectResponder handles the response to the Reprotect request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ReprotectResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ResolveHealthErrors operation to resolve health issues of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// resolveHealthInput - health issue input object. +func (client ReplicationProtectedItemsClient) ResolveHealthErrors(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput ResolveHealthInput) (result ReplicationProtectedItemsResolveHealthErrorsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ResolveHealthErrors") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResolveHealthErrorsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, resolveHealthInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ResolveHealthErrors", nil, "Failure preparing request") + return + } + + result, err = client.ResolveHealthErrorsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ResolveHealthErrors", result.Response(), "Failure sending request") + return + } + + return +} + +// ResolveHealthErrorsPreparer prepares the ResolveHealthErrors request. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput ResolveHealthInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/resolveHealthErrors", pathParameters), + autorest.WithJSON(resolveHealthInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResolveHealthErrorsSender sends the ResolveHealthErrors request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsSender(req *http.Request) (future ReplicationProtectedItemsResolveHealthErrorsFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResolveHealthErrorsResponder handles the response to the ResolveHealthErrors request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SwitchProvider operation to initiate a switch provider of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// switchProviderInput - switch provider input. +func (client ReplicationProtectedItemsClient) SwitchProvider(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, switchProviderInput SwitchProviderInput) (result ReplicationProtectedItemsSwitchProviderFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.SwitchProvider") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.SwitchProviderPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, switchProviderInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "SwitchProvider", nil, "Failure preparing request") + return + } + + result, err = client.SwitchProviderSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "SwitchProvider", result.Response(), "Failure sending request") + return + } + + return +} + +// SwitchProviderPreparer prepares the SwitchProvider request. +func (client ReplicationProtectedItemsClient) SwitchProviderPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, switchProviderInput SwitchProviderInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/switchProvider", pathParameters), + autorest.WithJSON(switchProviderInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SwitchProviderSender sends the SwitchProvider request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) SwitchProviderSender(req *http.Request) (future ReplicationProtectedItemsSwitchProviderFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// SwitchProviderResponder handles the response to the SwitchProvider request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) SwitchProviderResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailover operation to perform a test failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// testfailoverInput - test failover input. +func (client ReplicationProtectedItemsClient) TestFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput TestFailoverInput) (result ReplicationProtectedItemsTestFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.TestFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testfailoverInput, + Constraints: []validation.Constraint{{Target: "testfailoverInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "TestFailover", err.Error()) + } + + req, err := client.TestFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, testfailoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailover", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverPreparer prepares the TestFailover request. +func (client ReplicationProtectedItemsClient) TestFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput TestFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailover", pathParameters), + autorest.WithJSON(testfailoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverSender sends the TestFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) TestFailoverSender(req *http.Request) (future ReplicationProtectedItemsTestFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverResponder handles the response to the TestFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) TestFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailoverCleanup operation to clean up the test failover of a replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// cleanupInput - test failover cleanup input. +func (client ReplicationProtectedItemsClient) TestFailoverCleanup(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput TestFailoverCleanupInput) (result ReplicationProtectedItemsTestFailoverCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.TestFailoverCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: cleanupInput, + Constraints: []validation.Constraint{{Target: "cleanupInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "cleanupInput.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "cleanupInput.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", err.Error()) + } + + req, err := client.TestFailoverCleanupPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, cleanupInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverCleanupPreparer prepares the TestFailoverCleanup request. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput TestFailoverCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailoverCleanup", pathParameters), + autorest.WithJSON(cleanupInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverCleanupSender sends the TestFailoverCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupSender(req *http.Request) (future ReplicationProtectedItemsTestFailoverCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverCleanupResponder handles the response to the TestFailoverCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UnplannedFailover operation to initiate a failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// failoverInput - failover input. +func (client ReplicationProtectedItemsClient) UnplannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput UnplannedFailoverInput) (result ReplicationProtectedItemsUnplannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UnplannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: failoverInput, + Constraints: []validation.Constraint{{Target: "failoverInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", err.Error()) + } + + req, err := client.UnplannedFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.UnplannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// UnplannedFailoverPreparer prepares the UnplannedFailover request. +func (client ReplicationProtectedItemsClient) UnplannedFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput UnplannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/unplannedFailover", pathParameters), + autorest.WithJSON(failoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UnplannedFailoverSender sends the UnplannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UnplannedFailoverSender(req *http.Request) (future ReplicationProtectedItemsUnplannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UnplannedFailoverResponder handles the response to the UnplannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UnplannedFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update the recovery settings of an ASR replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// updateProtectionInput - update protection input. +func (client ReplicationProtectedItemsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput UpdateReplicationProtectedItemInput) (result ReplicationProtectedItemsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, updateProtectionInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationProtectedItemsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput UpdateReplicationProtectedItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithJSON(updateProtectionInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateSender(req *http.Request) (future ReplicationProtectedItemsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateAppliance the operation to update appliance of an ASR replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// applianceUpdateInput - appliance update protection input. +func (client ReplicationProtectedItemsClient) UpdateAppliance(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput UpdateApplianceForReplicationProtectedItemInput) (result ReplicationProtectedItemsUpdateApplianceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UpdateAppliance") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: applianceUpdateInput, + Constraints: []validation.Constraint{{Target: "applianceUpdateInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "applianceUpdateInput.Properties.TargetApplianceID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "UpdateAppliance", err.Error()) + } + + req, err := client.UpdateAppliancePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, applianceUpdateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateAppliance", nil, "Failure preparing request") + return + } + + result, err = client.UpdateApplianceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateAppliance", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateAppliancePreparer prepares the UpdateAppliance request. +func (client ReplicationProtectedItemsClient) UpdateAppliancePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput UpdateApplianceForReplicationProtectedItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/updateAppliance", pathParameters), + autorest.WithJSON(applianceUpdateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateApplianceSender sends the UpdateAppliance request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateApplianceSender(req *http.Request) (future ReplicationProtectedItemsUpdateApplianceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateApplianceResponder handles the response to the UpdateAppliance request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateApplianceResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateMobilityService the operation to update(push update) the installed mobility service software on a replication +// protected item to the latest available version. +// Parameters: +// fabricName - the name of the fabric containing the protected item. +// protectionContainerName - the name of the container containing the protected item. +// replicationProtectedItemName - 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. +func (client ReplicationProtectedItemsClient) UpdateMobilityService(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest UpdateMobilityServiceRequest) (result ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UpdateMobilityService") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateMobilityServicePreparer(ctx, fabricName, protectionContainerName, replicationProtectedItemName, updateMobilityServiceRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateMobilityService", nil, "Failure preparing request") + return + } + + result, err = client.UpdateMobilityServiceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateMobilityService", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateMobilityServicePreparer prepares the UpdateMobilityService request. +func (client ReplicationProtectedItemsClient) UpdateMobilityServicePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest UpdateMobilityServiceRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicationProtectedItemName": autorest.Encode("path", replicationProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicationProtectedItemName}/updateMobilityService", pathParameters), + autorest.WithJSON(updateMobilityServiceRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateMobilityServiceSender sends the UpdateMobilityService request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateMobilityServiceSender(req *http.Request) (future ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateMobilityServiceResponder handles the response to the UpdateMobilityService request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateMobilityServiceResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationprotectioncontainermappings.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationprotectioncontainermappings.go new file mode 100644 index 000000000000..caac2b5996c6 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationprotectioncontainermappings.go @@ -0,0 +1,688 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionContainerMappingsClient is the client for the ReplicationProtectionContainerMappings methods of +// the Siterecovery service. +type ReplicationProtectionContainerMappingsClient struct { + BaseClient +} + +// NewReplicationProtectionContainerMappingsClient creates an instance of the +// ReplicationProtectionContainerMappingsClient client. +func NewReplicationProtectionContainerMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainerMappingsClient { + return NewReplicationProtectionContainerMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionContainerMappingsClientWithBaseURI creates an instance of the +// ReplicationProtectionContainerMappingsClient client using a custom endpoint. Use this when interacting with an +// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationProtectionContainerMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainerMappingsClient { + return ReplicationProtectionContainerMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// creationInput - mapping creation input. +func (client ReplicationProtectionContainerMappingsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput CreateProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, mappingName, creationInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionContainerMappingsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput CreateProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithJSON(creationInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) CreateSender(req *http.Request) (future ReplicationProtectionContainerMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) CreateResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete or remove a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// removalInput - removal input. +func (client ReplicationProtectionContainerMappingsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput RemoveProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, mappingName, removalInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectionContainerMappingsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput RemoveProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}/remove", pathParameters), + autorest.WithJSON(removalInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) DeleteSender(req *http.Request) (future ReplicationProtectionContainerMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection Container mapping name. +func (client ReplicationProtectionContainerMappingsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result ProtectionContainerMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, mappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionContainerMappingsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) GetResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the protection container mappings in the vault. +func (client ReplicationProtectionContainerMappingsClient) List(ctx context.Context) (result ProtectionContainerMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.List") + defer func() { + sc := -1 + if result.pcmc.Response.Response != nil { + sc = result.pcmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pcmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", resp, "Failure sending request") + return + } + + result.pcmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.pcmc.hasNextLink() && result.pcmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionContainerMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionContainerMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) ListResponder(resp *http.Response) (result ProtectionContainerMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainerMappingsClient) listNextResults(ctx context.Context, lastResults ProtectionContainerMappingCollection) (result ProtectionContainerMappingCollection, err error) { + req, err := lastResults.protectionContainerMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainerMappingsClient) ListComplete(ctx context.Context) (result ProtectionContainerMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationProtectionContainers lists the protection container mappings for a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainerMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.pcmc.Response.Response != nil { + sc = result.pcmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.pcmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.pcmc, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.pcmc.hasNextLink() && result.pcmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ProtectionContainerMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainerMappingsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ProtectionContainerMappingCollection) (result ProtectionContainerMappingCollection, err error) { + req, err := lastResults.protectionContainerMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainerMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName) + return +} + +// Purge the operation to purge(force delete) a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +func (client ReplicationProtectionContainerMappingsClient) Purge(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result ReplicationProtectionContainerMappingsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, protectionContainerName, mappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationProtectionContainerMappingsClient) PurgePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) PurgeSender(req *http.Request) (future ReplicationProtectionContainerMappingsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update the operation to update protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// updateInput - mapping update input. +func (client ReplicationProtectionContainerMappingsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput UpdateProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, mappingName, updateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationProtectionContainerMappingsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput UpdateProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithJSON(updateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) UpdateSender(req *http.Request) (future ReplicationProtectionContainerMappingsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) UpdateResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationprotectioncontainers.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationprotectioncontainers.go new file mode 100644 index 000000000000..bf887396c149 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationprotectioncontainers.go @@ -0,0 +1,677 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionContainersClient is the client for the ReplicationProtectionContainers methods of the +// Siterecovery service. +type ReplicationProtectionContainersClient struct { + BaseClient +} + +// NewReplicationProtectionContainersClient creates an instance of the ReplicationProtectionContainersClient client. +func NewReplicationProtectionContainersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainersClient { + return NewReplicationProtectionContainersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionContainersClientWithBaseURI creates an instance of the ReplicationProtectionContainersClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationProtectionContainersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainersClient { + return ReplicationProtectionContainersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create operation to create a protection container. +// Parameters: +// fabricName - unique fabric ARM name. +// protectionContainerName - unique protection container ARM name. +// creationInput - creation input. +func (client ReplicationProtectionContainersClient) Create(ctx context.Context, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput) (result ReplicationProtectionContainersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, creationInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionContainersClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}", pathParameters), + autorest.WithJSON(creationInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) CreateSender(req *http.Request) (future ReplicationProtectionContainersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) CreateResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete operation to remove a protection container. +// Parameters: +// fabricName - unique fabric ARM name. +// protectionContainerName - unique protection container ARM name. +func (client ReplicationProtectionContainersClient) Delete(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectionContainersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectionContainersClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) DeleteSender(req *http.Request) (future ReplicationProtectionContainersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DiscoverProtectableItem the operation to a add a protectable item to a protection container(Add physical server). +// Parameters: +// fabricName - the name of the fabric. +// protectionContainerName - the name of the protection container. +// discoverProtectableItemRequest - the request object to add a protectable item. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItem(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest) (result ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.DiscoverProtectableItem") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DiscoverProtectableItemPreparer(ctx, fabricName, protectionContainerName, discoverProtectableItemRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "DiscoverProtectableItem", nil, "Failure preparing request") + return + } + + result, err = client.DiscoverProtectableItemSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "DiscoverProtectableItem", result.Response(), "Failure sending request") + return + } + + return +} + +// DiscoverProtectableItemPreparer prepares the DiscoverProtectableItem request. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemPreparer(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/discoverProtectableItem", pathParameters), + autorest.WithJSON(discoverProtectableItemRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DiscoverProtectableItemSender sends the DiscoverProtectableItem request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemSender(req *http.Request) (future ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DiscoverProtectableItemResponder handles the response to the DiscoverProtectableItem request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectionContainersClient) Get(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainer, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionContainersClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) GetResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the protection containers in a vault. +func (client ReplicationProtectionContainersClient) List(ctx context.Context) (result ProtectionContainerCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.List") + defer func() { + sc := -1 + if result.pcc.Response.Response != nil { + sc = result.pcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", resp, "Failure sending request") + return + } + + result.pcc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", resp, "Failure responding to request") + return + } + if result.pcc.hasNextLink() && result.pcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionContainersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionContainers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) ListResponder(resp *http.Response) (result ProtectionContainerCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainersClient) listNextResults(ctx context.Context, lastResults ProtectionContainerCollection) (result ProtectionContainerCollection, err error) { + req, err := lastResults.protectionContainerCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainersClient) ListComplete(ctx context.Context) (result ProtectionContainerCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the protection containers in the specified fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationProtectionContainersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result ProtectionContainerCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.pcc.Response.Response != nil { + sc = result.pcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.pcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.pcc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.pcc.hasNextLink() && result.pcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsResponder(resp *http.Response) (result ProtectionContainerCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults ProtectionContainerCollection) (result ProtectionContainerCollection, err error) { + req, err := lastResults.protectionContainerCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result ProtectionContainerCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// SwitchProtection operation to switch protection from one container to another or one replication provider to +// another. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// switchInput - switch protection input. +func (client ReplicationProtectionContainersClient) SwitchProtection(ctx context.Context, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput) (result ReplicationProtectionContainersSwitchProtectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.SwitchProtection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.SwitchProtectionPreparer(ctx, fabricName, protectionContainerName, switchInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "SwitchProtection", nil, "Failure preparing request") + return + } + + result, err = client.SwitchProtectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "SwitchProtection", result.Response(), "Failure sending request") + return + } + + return +} + +// SwitchProtectionPreparer prepares the SwitchProtection request. +func (client ReplicationProtectionContainersClient) SwitchProtectionPreparer(ctx context.Context, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/switchprotection", pathParameters), + autorest.WithJSON(switchInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SwitchProtectionSender sends the SwitchProtection request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) SwitchProtectionSender(req *http.Request) (future ReplicationProtectionContainersSwitchProtectionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// SwitchProtectionResponder handles the response to the SwitchProtection request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) SwitchProtectionResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationprotectionintents.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationprotectionintents.go new file mode 100644 index 000000000000..fba362c80896 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationprotectionintents.go @@ -0,0 +1,312 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionIntentsClient is the client for the ReplicationProtectionIntents methods of the Siterecovery +// service. +type ReplicationProtectionIntentsClient struct { + BaseClient +} + +// NewReplicationProtectionIntentsClient creates an instance of the ReplicationProtectionIntentsClient client. +func NewReplicationProtectionIntentsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionIntentsClient { + return NewReplicationProtectionIntentsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionIntentsClientWithBaseURI creates an instance of the ReplicationProtectionIntentsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationProtectionIntentsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionIntentsClient { + return ReplicationProtectionIntentsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR replication protection intent item. +// Parameters: +// intentObjectName - a name for the replication protection item. +// input - create Protection Intent Input. +func (client ReplicationProtectionIntentsClient) Create(ctx context.Context, intentObjectName string, input CreateProtectionIntentInput) (result ReplicationProtectionIntent, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, intentObjectName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionIntentsClient) CreatePreparer(ctx context.Context, intentObjectName string, input CreateProtectionIntentInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "intentObjectName": autorest.Encode("path", intentObjectName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) CreateResponder(resp *http.Response) (result ReplicationProtectionIntent, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of an ASR replication protection intent. +// Parameters: +// intentObjectName - replication protection intent name. +func (client ReplicationProtectionIntentsClient) Get(ctx context.Context, intentObjectName string) (result ReplicationProtectionIntent, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, intentObjectName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionIntentsClient) GetPreparer(ctx context.Context, intentObjectName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "intentObjectName": autorest.Encode("path", intentObjectName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) GetResponder(resp *http.Response) (result ReplicationProtectionIntent, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of ASR replication protection intent objects in the vault. +// Parameters: +// skipToken - the pagination token. +// takeToken - the page size. +func (client ReplicationProtectionIntentsClient) List(ctx context.Context, skipToken string, takeToken string) (result ReplicationProtectionIntentCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.List") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, takeToken) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionIntentsClient) ListPreparer(ctx context.Context, skipToken string, takeToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) ListResponder(resp *http.Response) (result ReplicationProtectionIntentCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionIntentsClient) listNextResults(ctx context.Context, lastResults ReplicationProtectionIntentCollection) (result ReplicationProtectionIntentCollection, err error) { + req, err := lastResults.replicationProtectionIntentCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionIntentsClient) ListComplete(ctx context.Context, skipToken string, takeToken string) (result ReplicationProtectionIntentCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, takeToken) + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationrecoveryplans.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationrecoveryplans.go new file mode 100644 index 000000000000..a38a2c33d9d5 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationrecoveryplans.go @@ -0,0 +1,1069 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationRecoveryPlansClient is the client for the ReplicationRecoveryPlans methods of the Siterecovery service. +type ReplicationRecoveryPlansClient struct { + BaseClient +} + +// NewReplicationRecoveryPlansClient creates an instance of the ReplicationRecoveryPlansClient client. +func NewReplicationRecoveryPlansClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryPlansClient { + return NewReplicationRecoveryPlansClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationRecoveryPlansClientWithBaseURI creates an instance of the ReplicationRecoveryPlansClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationRecoveryPlansClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryPlansClient { + return ReplicationRecoveryPlansClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery Plan creation input. +func (client ReplicationRecoveryPlansClient) Create(ctx context.Context, recoveryPlanName string, input CreateRecoveryPlanInput) (result ReplicationRecoveryPlansCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.PrimaryFabricID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "input.Properties.RecoveryFabricID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "input.Properties.Groups", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationRecoveryPlansClient) CreatePreparer(ctx context.Context, recoveryPlanName string, input CreateRecoveryPlanInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) CreateSender(req *http.Request) (future ReplicationRecoveryPlansCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) CreateResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) Delete(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationRecoveryPlansClient) DeletePreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) DeleteSender(req *http.Request) (future ReplicationRecoveryPlansDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// FailoverCancel the operation to cancel the failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) FailoverCancel(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansFailoverCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.FailoverCancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCancelPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCancel", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCancel", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCancelPreparer prepares the FailoverCancel request. +func (client ReplicationRecoveryPlansClient) FailoverCancelPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCancelSender sends the FailoverCancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) FailoverCancelSender(req *http.Request) (future ReplicationRecoveryPlansFailoverCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCancelResponder handles the response to the FailoverCancel request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) FailoverCancelResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// FailoverCommit the operation to commit the failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) FailoverCommit(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansFailoverCommitFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.FailoverCommit") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCommitPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCommit", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCommitSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCommit", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCommitPreparer prepares the FailoverCommit request. +func (client ReplicationRecoveryPlansClient) FailoverCommitPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCommit", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCommitSender sends the FailoverCommit request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) FailoverCommitSender(req *http.Request) (future ReplicationRecoveryPlansFailoverCommitFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCommitResponder handles the response to the FailoverCommit request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) FailoverCommitResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of the recovery plan. +// Parameters: +// recoveryPlanName - name of the recovery plan. +func (client ReplicationRecoveryPlansClient) Get(ctx context.Context, recoveryPlanName string) (result RecoveryPlan, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationRecoveryPlansClient) GetPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) GetResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the recovery plans in the vault. +func (client ReplicationRecoveryPlansClient) List(ctx context.Context) (result RecoveryPlanCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.List") + defer func() { + sc := -1 + if result.RPCVar.Response.Response != nil { + sc = result.RPCVar.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.RPCVar.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", resp, "Failure sending request") + return + } + + result.RPCVar, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", resp, "Failure responding to request") + return + } + if result.RPCVar.hasNextLink() && result.RPCVar.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationRecoveryPlansClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) ListResponder(resp *http.Response) (result RecoveryPlanCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryPlansClient) listNextResults(ctx context.Context, lastResults RecoveryPlanCollection) (result RecoveryPlanCollection, err error) { + req, err := lastResults.recoveryPlanCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryPlansClient) ListComplete(ctx context.Context) (result RecoveryPlanCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// PlannedFailover the operation to start the planned failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - failover input. +func (client ReplicationRecoveryPlansClient) PlannedFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput) (result ReplicationRecoveryPlansPlannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.PlannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", err.Error()) + } + + req, err := client.PlannedFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.PlannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// PlannedFailoverPreparer prepares the PlannedFailover request. +func (client ReplicationRecoveryPlansClient) PlannedFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/plannedFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PlannedFailoverSender sends the PlannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) PlannedFailoverSender(req *http.Request) (future ReplicationRecoveryPlansPlannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PlannedFailoverResponder handles the response to the PlannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) PlannedFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Reprotect the operation to reprotect(reverse replicate) a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) Reprotect(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansReprotectFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Reprotect") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReprotectPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Reprotect", nil, "Failure preparing request") + return + } + + result, err = client.ReprotectSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Reprotect", result.Response(), "Failure sending request") + return + } + + return +} + +// ReprotectPreparer prepares the Reprotect request. +func (client ReplicationRecoveryPlansClient) ReprotectPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/reProtect", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReprotectSender sends the Reprotect request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) ReprotectSender(req *http.Request) (future ReplicationRecoveryPlansReprotectFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReprotectResponder handles the response to the Reprotect request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) ReprotectResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailover the operation to start the test failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan test failover input. +func (client ReplicationRecoveryPlansClient) TestFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverInput) (result ReplicationRecoveryPlansTestFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.TestFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.NetworkType", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "TestFailover", err.Error()) + } + + req, err := client.TestFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailover", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverPreparer prepares the TestFailover request. +func (client ReplicationRecoveryPlansClient) TestFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverSender sends the TestFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) TestFailoverSender(req *http.Request) (future ReplicationRecoveryPlansTestFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverResponder handles the response to the TestFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) TestFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailoverCleanup the operation to cleanup test failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan test failover cleanup input. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanup(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput) (result ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.TestFailoverCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "input.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", err.Error()) + } + + req, err := client.TestFailoverCleanupPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverCleanupPreparer prepares the TestFailoverCleanup request. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailoverCleanup", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverCleanupSender sends the TestFailoverCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupSender(req *http.Request) (future ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverCleanupResponder handles the response to the TestFailoverCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UnplannedFailover the operation to start the unplanned failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan unplanned failover input. +func (client ReplicationRecoveryPlansClient) UnplannedFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput) (result ReplicationRecoveryPlansUnplannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.UnplannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", err.Error()) + } + + req, err := client.UnplannedFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.UnplannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// UnplannedFailoverPreparer prepares the UnplannedFailover request. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/unplannedFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UnplannedFailoverSender sends the UnplannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverSender(req *http.Request) (future ReplicationRecoveryPlansUnplannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UnplannedFailoverResponder handles the response to the UnplannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - update recovery plan input. +func (client ReplicationRecoveryPlansClient) Update(ctx context.Context, recoveryPlanName string, input UpdateRecoveryPlanInput) (result ReplicationRecoveryPlansUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationRecoveryPlansClient) UpdatePreparer(ctx context.Context, recoveryPlanName string, input UpdateRecoveryPlanInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) UpdateSender(req *http.Request) (future ReplicationRecoveryPlansUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) UpdateResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationrecoveryservicesproviders.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationrecoveryservicesproviders.go new file mode 100644 index 000000000000..4a74aad8b9ee --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationrecoveryservicesproviders.go @@ -0,0 +1,700 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationRecoveryServicesProvidersClient is the client for the ReplicationRecoveryServicesProviders methods of the +// Siterecovery service. +type ReplicationRecoveryServicesProvidersClient struct { + BaseClient +} + +// NewReplicationRecoveryServicesProvidersClient creates an instance of the ReplicationRecoveryServicesProvidersClient +// client. +func NewReplicationRecoveryServicesProvidersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryServicesProvidersClient { + return NewReplicationRecoveryServicesProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationRecoveryServicesProvidersClientWithBaseURI creates an instance of the +// ReplicationRecoveryServicesProvidersClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationRecoveryServicesProvidersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryServicesProvidersClient { + return ReplicationRecoveryServicesProvidersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to add a recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +// addProviderInput - add provider input. +func (client ReplicationRecoveryServicesProvidersClient) Create(ctx context.Context, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput) (result ReplicationRecoveryServicesProvidersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: addProviderInput, + Constraints: []validation.Constraint{{Target: "addProviderInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.MachineName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.AuthenticationIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.ResourceAccessIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, providerName, addProviderInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationRecoveryServicesProvidersClient) CreatePreparer(ctx context.Context, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithJSON(addProviderInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) CreateSender(req *http.Request) (future ReplicationRecoveryServicesProvidersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) CreateResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to removes/delete(unregister) a recovery services provider from the vault. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Delete(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationRecoveryServicesProvidersClient) DeletePreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) DeleteSender(req *http.Request) (future ReplicationRecoveryServicesProvidersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of registered recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Get(ctx context.Context, fabricName string, providerName string) (result RecoveryServicesProvider, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationRecoveryServicesProvidersClient) GetPreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) GetResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the registered recovery services providers in the vault. +func (client ReplicationRecoveryServicesProvidersClient) List(ctx context.Context) (result RecoveryServicesProviderCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.List") + defer func() { + sc := -1 + if result.rspc.Response.Response != nil { + sc = result.rspc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rspc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", resp, "Failure sending request") + return + } + + result.rspc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", resp, "Failure responding to request") + return + } + if result.rspc.hasNextLink() && result.rspc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationRecoveryServicesProvidersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryServicesProviders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) ListResponder(resp *http.Response) (result RecoveryServicesProviderCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryServicesProvidersClient) listNextResults(ctx context.Context, lastResults RecoveryServicesProviderCollection) (result RecoveryServicesProviderCollection, err error) { + req, err := lastResults.recoveryServicesProviderCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryServicesProvidersClient) ListComplete(ctx context.Context) (result RecoveryServicesProviderCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the registered recovery services providers for the specified fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result RecoveryServicesProviderCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.rspc.Response.Response != nil { + sc = result.rspc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.rspc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.rspc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.rspc.hasNextLink() && result.rspc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsResponder(resp *http.Response) (result RecoveryServicesProviderCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryServicesProvidersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults RecoveryServicesProviderCollection) (result RecoveryServicesProviderCollection, err error) { + req, err := lastResults.recoveryServicesProviderCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result RecoveryServicesProviderCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// Purge the operation to purge(force delete) a recovery services provider from the vault. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Purge(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationRecoveryServicesProvidersClient) PurgePreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) PurgeSender(req *http.Request) (future ReplicationRecoveryServicesProvidersPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RefreshProvider the operation to refresh the information from the recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProvider(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.RefreshProvider") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RefreshProviderPreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "RefreshProvider", nil, "Failure preparing request") + return + } + + result, err = client.RefreshProviderSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "RefreshProvider", result.Response(), "Failure sending request") + return + } + + return +} + +// RefreshProviderPreparer prepares the RefreshProvider request. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderPreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/refreshProvider", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RefreshProviderSender sends the RefreshProvider request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderSender(req *http.Request) (future ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RefreshProviderResponder handles the response to the RefreshProvider request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationstorageclassificationmappings.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationstorageclassificationmappings.go new file mode 100644 index 000000000000..1e65fa7d6762 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationstorageclassificationmappings.go @@ -0,0 +1,517 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationStorageClassificationMappingsClient is the client for the ReplicationStorageClassificationMappings +// methods of the Siterecovery service. +type ReplicationStorageClassificationMappingsClient struct { + BaseClient +} + +// NewReplicationStorageClassificationMappingsClient creates an instance of the +// ReplicationStorageClassificationMappingsClient client. +func NewReplicationStorageClassificationMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationMappingsClient { + return NewReplicationStorageClassificationMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationStorageClassificationMappingsClientWithBaseURI creates an instance of the +// ReplicationStorageClassificationMappingsClient client using a custom endpoint. Use this when interacting with an +// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationStorageClassificationMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationMappingsClient { + return ReplicationStorageClassificationMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +// pairingInput - pairing input. +func (client ReplicationStorageClassificationMappingsClient) Create(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput StorageClassificationMappingInput) (result ReplicationStorageClassificationMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName, pairingInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationStorageClassificationMappingsClient) CreatePreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput StorageClassificationMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithJSON(pairingInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) CreateSender(req *http.Request) (future ReplicationStorageClassificationMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) CreateResponder(resp *http.Response) (result StorageClassificationMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +func (client ReplicationStorageClassificationMappingsClient) Delete(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result ReplicationStorageClassificationMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationStorageClassificationMappingsClient) DeletePreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) DeleteSender(req *http.Request) (future ReplicationStorageClassificationMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the specified storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +func (client ReplicationStorageClassificationMappingsClient) Get(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result StorageClassificationMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationStorageClassificationMappingsClient) GetPreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) GetResponder(resp *http.Response) (result StorageClassificationMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the storage classification mappings in the vault. +func (client ReplicationStorageClassificationMappingsClient) List(ctx context.Context) (result StorageClassificationMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.List") + defer func() { + sc := -1 + if result.scmc.Response.Response != nil { + sc = result.scmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.scmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", resp, "Failure sending request") + return + } + + result.scmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.scmc.hasNextLink() && result.scmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationStorageClassificationMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationStorageClassificationMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) ListResponder(resp *http.Response) (result StorageClassificationMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationMappingsClient) listNextResults(ctx context.Context, lastResults StorageClassificationMappingCollection) (result StorageClassificationMappingCollection, err error) { + req, err := lastResults.storageClassificationMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationMappingsClient) ListComplete(ctx context.Context) (result StorageClassificationMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationStorageClassifications lists the storage classification mappings for the fabric. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassifications(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassificationMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.ListByReplicationStorageClassifications") + defer func() { + sc := -1 + if result.scmc.Response.Response != nil { + sc = result.scmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationStorageClassificationsNextResults + req, err := client.ListByReplicationStorageClassificationsPreparer(ctx, fabricName, storageClassificationName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationStorageClassificationsSender(req) + if err != nil { + result.scmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", resp, "Failure sending request") + return + } + + result.scmc, err = client.ListByReplicationStorageClassificationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", resp, "Failure responding to request") + return + } + if result.scmc.hasNextLink() && result.scmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationStorageClassificationsPreparer prepares the ListByReplicationStorageClassifications request. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsPreparer(ctx context.Context, fabricName string, storageClassificationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationStorageClassificationsSender sends the ListByReplicationStorageClassifications request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationStorageClassificationsResponder handles the response to the ListByReplicationStorageClassifications request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsResponder(resp *http.Response) (result StorageClassificationMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationStorageClassificationsNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationMappingsClient) listByReplicationStorageClassificationsNextResults(ctx context.Context, lastResults StorageClassificationMappingCollection) (result StorageClassificationMappingCollection, err error) { + req, err := lastResults.storageClassificationMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationStorageClassificationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationStorageClassificationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationStorageClassificationsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsComplete(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassificationMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.ListByReplicationStorageClassifications") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationStorageClassifications(ctx, fabricName, storageClassificationName) + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationstorageclassifications.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationstorageclassifications.go new file mode 100644 index 000000000000..94970126584d --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationstorageclassifications.go @@ -0,0 +1,345 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationStorageClassificationsClient is the client for the ReplicationStorageClassifications methods of the +// Siterecovery service. +type ReplicationStorageClassificationsClient struct { + BaseClient +} + +// NewReplicationStorageClassificationsClient creates an instance of the ReplicationStorageClassificationsClient +// client. +func NewReplicationStorageClassificationsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationsClient { + return NewReplicationStorageClassificationsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationStorageClassificationsClientWithBaseURI creates an instance of the +// ReplicationStorageClassificationsClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationStorageClassificationsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationsClient { + return ReplicationStorageClassificationsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of the specified storage classification. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +func (client ReplicationStorageClassificationsClient) Get(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassification, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, storageClassificationName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationStorageClassificationsClient) GetPreparer(ctx context.Context, fabricName string, storageClassificationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) GetResponder(resp *http.Response) (result StorageClassification, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the storage classifications in the vault. +func (client ReplicationStorageClassificationsClient) List(ctx context.Context) (result StorageClassificationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.List") + defer func() { + sc := -1 + if result.scc.Response.Response != nil { + sc = result.scc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.scc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", resp, "Failure sending request") + return + } + + result.scc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", resp, "Failure responding to request") + return + } + if result.scc.hasNextLink() && result.scc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationStorageClassificationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationStorageClassifications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) ListResponder(resp *http.Response) (result StorageClassificationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationsClient) listNextResults(ctx context.Context, lastResults StorageClassificationCollection) (result StorageClassificationCollection, err error) { + req, err := lastResults.storageClassificationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationsClient) ListComplete(ctx context.Context) (result StorageClassificationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the storage classifications available in the specified fabric. +// Parameters: +// fabricName - site name of interest. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result StorageClassificationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.scc.Response.Response != nil { + sc = result.scc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.scc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.scc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.scc.hasNextLink() && result.scc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsResponder(resp *http.Response) (result StorageClassificationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationsClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults StorageClassificationCollection) (result StorageClassificationCollection, err error) { + req, err := lastResults.storageClassificationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result StorageClassificationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationvaulthealth.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationvaulthealth.go new file mode 100644 index 000000000000..ff9c26398210 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationvaulthealth.go @@ -0,0 +1,181 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationVaultHealthClient is the client for the ReplicationVaultHealth methods of the Siterecovery service. +type ReplicationVaultHealthClient struct { + BaseClient +} + +// NewReplicationVaultHealthClient creates an instance of the ReplicationVaultHealthClient client. +func NewReplicationVaultHealthClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultHealthClient { + return NewReplicationVaultHealthClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationVaultHealthClientWithBaseURI creates an instance of the ReplicationVaultHealthClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewReplicationVaultHealthClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultHealthClient { + return ReplicationVaultHealthClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the health details of the vault. +func (client ReplicationVaultHealthClient) Get(ctx context.Context) (result VaultHealthDetails, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultHealthClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationVaultHealthClient) GetPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultHealthClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationVaultHealthClient) GetResponder(resp *http.Response) (result VaultHealthDetails, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Refresh sends the refresh request. +func (client ReplicationVaultHealthClient) Refresh(ctx context.Context) (result ReplicationVaultHealthRefreshFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultHealthClient.Refresh") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RefreshPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Refresh", nil, "Failure preparing request") + return + } + + result, err = client.RefreshSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Refresh", result.Response(), "Failure sending request") + return + } + + return +} + +// RefreshPreparer prepares the Refresh request. +func (client ReplicationVaultHealthClient) RefreshPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth/default/refresh", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RefreshSender sends the Refresh request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultHealthClient) RefreshSender(req *http.Request) (future ReplicationVaultHealthRefreshFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RefreshResponder handles the response to the Refresh request. The method always +// closes the http.Response Body. +func (client ReplicationVaultHealthClient) RefreshResponder(resp *http.Response) (result VaultHealthDetails, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationvaultsetting.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationvaultsetting.go new file mode 100644 index 000000000000..cf7c5fb8c33b --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationvaultsetting.go @@ -0,0 +1,312 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationVaultSettingClient is the client for the ReplicationVaultSetting methods of the Siterecovery service. +type ReplicationVaultSettingClient struct { + BaseClient +} + +// NewReplicationVaultSettingClient creates an instance of the ReplicationVaultSettingClient client. +func NewReplicationVaultSettingClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultSettingClient { + return NewReplicationVaultSettingClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationVaultSettingClientWithBaseURI creates an instance of the ReplicationVaultSettingClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewReplicationVaultSettingClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultSettingClient { + return ReplicationVaultSettingClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to configure vault setting. +// Parameters: +// vaultSettingName - vault setting name. +// input - vault setting creation input. +func (client ReplicationVaultSettingClient) Create(ctx context.Context, vaultSettingName string, input VaultSettingCreationInput) (result ReplicationVaultSettingCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationVaultSettingClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, vaultSettingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationVaultSettingClient) CreatePreparer(ctx context.Context, vaultSettingName string, input VaultSettingCreationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultSettingName": autorest.Encode("path", vaultSettingName), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) CreateSender(req *http.Request) (future ReplicationVaultSettingCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) CreateResponder(resp *http.Response) (result VaultSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the vault setting. This includes the Migration Hub connection settings. +// Parameters: +// vaultSettingName - vault setting name. +func (client ReplicationVaultSettingClient) Get(ctx context.Context, vaultSettingName string) (result VaultSetting, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, vaultSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationVaultSettingClient) GetPreparer(ctx context.Context, vaultSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultSettingName": autorest.Encode("path", vaultSettingName), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) GetResponder(resp *http.Response) (result VaultSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of vault setting. This includes the Migration Hub connection settings. +func (client ReplicationVaultSettingClient) List(ctx context.Context) (result VaultSettingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.List") + defer func() { + sc := -1 + if result.vsc.Response.Response != nil { + sc = result.vsc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vsc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", resp, "Failure sending request") + return + } + + result.vsc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", resp, "Failure responding to request") + return + } + if result.vsc.hasNextLink() && result.vsc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationVaultSettingClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) ListResponder(resp *http.Response) (result VaultSettingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationVaultSettingClient) listNextResults(ctx context.Context, lastResults VaultSettingCollection) (result VaultSettingCollection, err error) { + req, err := lastResults.vaultSettingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationVaultSettingClient) ListComplete(ctx context.Context) (result VaultSettingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationvcenters.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationvcenters.go new file mode 100644 index 000000000000..6c3d8c722b48 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/replicationvcenters.go @@ -0,0 +1,591 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationvCentersClient is the client for the ReplicationvCenters methods of the Siterecovery service. +type ReplicationvCentersClient struct { + BaseClient +} + +// NewReplicationvCentersClient creates an instance of the ReplicationvCentersClient client. +func NewReplicationvCentersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationvCentersClient { + return NewReplicationvCentersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationvCentersClientWithBaseURI creates an instance of the ReplicationvCentersClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationvCentersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationvCentersClient { + return ReplicationvCentersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a vCenter object.. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +// addVCenterRequest - the input to the add vCenter operation. +func (client ReplicationvCentersClient) Create(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest) (result ReplicationvCentersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, vcenterName, addVCenterRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationvCentersClient) CreatePreparer(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithJSON(addVCenterRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) CreateSender(req *http.Request) (future ReplicationvCentersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) CreateResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to remove(unregister) a registered vCenter server from the vault. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +func (client ReplicationvCentersClient) Delete(ctx context.Context, fabricName string, vcenterName string) (result ReplicationvCentersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, vcenterName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationvCentersClient) DeletePreparer(ctx context.Context, fabricName string, vcenterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) DeleteSender(req *http.Request) (future ReplicationvCentersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a registered vCenter server(Add vCenter server). +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +func (client ReplicationvCentersClient) Get(ctx context.Context, fabricName string, vcenterName string) (result VCenter, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, vcenterName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationvCentersClient) GetPreparer(ctx context.Context, fabricName string, vcenterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) GetResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the vCenter servers registered in the vault. +func (client ReplicationvCentersClient) List(ctx context.Context) (result VCenterCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.List") + defer func() { + sc := -1 + if result.vcc.Response.Response != nil { + sc = result.vcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", resp, "Failure sending request") + return + } + + result.vcc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", resp, "Failure responding to request") + return + } + if result.vcc.hasNextLink() && result.vcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationvCentersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationvCenters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) ListResponder(resp *http.Response) (result VCenterCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationvCentersClient) listNextResults(ctx context.Context, lastResults VCenterCollection) (result VCenterCollection, err error) { + req, err := lastResults.vCenterCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationvCentersClient) ListComplete(ctx context.Context) (result VCenterCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the vCenter servers registered in a fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationvCentersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result VCenterCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.vcc.Response.Response != nil { + sc = result.vcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.vcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.vcc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.vcc.hasNextLink() && result.vcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationvCentersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) ListByReplicationFabricsResponder(resp *http.Response) (result VCenterCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationvCentersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults VCenterCollection) (result VCenterCollection, err error) { + req, err := lastResults.vCenterCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationvCentersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result VCenterCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// Update the operation to update a registered vCenter. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +// updateVCenterRequest - the input to the update vCenter operation. +func (client ReplicationvCentersClient) Update(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest) (result ReplicationvCentersUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, vcenterName, updateVCenterRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationvCentersClient) UpdatePreparer(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithJSON(updateVCenterRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) UpdateSender(req *http.Request) (future ReplicationvCentersUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) UpdateResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/siterecoveryapi/interfaces.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/siterecoveryapi/interfaces.go new file mode 100644 index 000000000000..86abc6f1a587 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/siterecoveryapi/interfaces.go @@ -0,0 +1,350 @@ +package siterecoveryapi + +// 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. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2022-01-01/siterecovery" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result siterecovery.OperationsDiscoveryCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.OperationsDiscoveryCollectionIterator, err error) +} + +var _ OperationsClientAPI = (*siterecovery.OperationsClient)(nil) + +// ReplicationAlertSettingsClientAPI contains the set of methods on the ReplicationAlertSettingsClient type. +type ReplicationAlertSettingsClientAPI interface { + Create(ctx context.Context, alertSettingName string, request siterecovery.ConfigureAlertRequest) (result siterecovery.Alert, err error) + Get(ctx context.Context, alertSettingName string) (result siterecovery.Alert, err error) + List(ctx context.Context) (result siterecovery.AlertCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.AlertCollectionIterator, err error) +} + +var _ ReplicationAlertSettingsClientAPI = (*siterecovery.ReplicationAlertSettingsClient)(nil) + +// ReplicationAppliancesClientAPI contains the set of methods on the ReplicationAppliancesClient type. +type ReplicationAppliancesClientAPI interface { + List(ctx context.Context, filter string) (result siterecovery.ApplianceCollectionPage, err error) + ListComplete(ctx context.Context, filter string) (result siterecovery.ApplianceCollectionIterator, err error) +} + +var _ ReplicationAppliancesClientAPI = (*siterecovery.ReplicationAppliancesClient)(nil) + +// ReplicationEligibilityResultsClientAPI contains the set of methods on the ReplicationEligibilityResultsClient type. +type ReplicationEligibilityResultsClientAPI interface { + Get(ctx context.Context, virtualMachineName string) (result siterecovery.ReplicationEligibilityResults, err error) + List(ctx context.Context, virtualMachineName string) (result siterecovery.ReplicationEligibilityResultsCollection, err error) +} + +var _ ReplicationEligibilityResultsClientAPI = (*siterecovery.ReplicationEligibilityResultsClient)(nil) + +// ReplicationEventsClientAPI contains the set of methods on the ReplicationEventsClient type. +type ReplicationEventsClientAPI interface { + Get(ctx context.Context, eventName string) (result siterecovery.Event, err error) + List(ctx context.Context, filter string) (result siterecovery.EventCollectionPage, err error) + ListComplete(ctx context.Context, filter string) (result siterecovery.EventCollectionIterator, err error) +} + +var _ ReplicationEventsClientAPI = (*siterecovery.ReplicationEventsClient)(nil) + +// ReplicationFabricsClientAPI contains the set of methods on the ReplicationFabricsClient type. +type ReplicationFabricsClientAPI interface { + CheckConsistency(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsCheckConsistencyFuture, err error) + Create(ctx context.Context, fabricName string, input siterecovery.FabricCreationInput) (result siterecovery.ReplicationFabricsCreateFuture, err error) + Delete(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, filter string) (result siterecovery.Fabric, err error) + List(ctx context.Context) (result siterecovery.FabricCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.FabricCollectionIterator, err error) + MigrateToAad(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsMigrateToAadFuture, err error) + Purge(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsPurgeFuture, err error) + ReassociateGateway(ctx context.Context, fabricName string, failoverProcessServerRequest siterecovery.FailoverProcessServerRequest) (result siterecovery.ReplicationFabricsReassociateGatewayFuture, err error) + RenewCertificate(ctx context.Context, fabricName string, renewCertificate siterecovery.RenewCertificateInput) (result siterecovery.ReplicationFabricsRenewCertificateFuture, err error) +} + +var _ ReplicationFabricsClientAPI = (*siterecovery.ReplicationFabricsClient)(nil) + +// ReplicationLogicalNetworksClientAPI contains the set of methods on the ReplicationLogicalNetworksClient type. +type ReplicationLogicalNetworksClientAPI interface { + Get(ctx context.Context, fabricName string, logicalNetworkName string) (result siterecovery.LogicalNetwork, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.LogicalNetworkCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.LogicalNetworkCollectionIterator, err error) +} + +var _ ReplicationLogicalNetworksClientAPI = (*siterecovery.ReplicationLogicalNetworksClient)(nil) + +// ReplicationNetworksClientAPI contains the set of methods on the ReplicationNetworksClient type. +type ReplicationNetworksClientAPI interface { + Get(ctx context.Context, fabricName string, networkName string) (result siterecovery.Network, err error) + List(ctx context.Context) (result siterecovery.NetworkCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.NetworkCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.NetworkCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.NetworkCollectionIterator, err error) +} + +var _ ReplicationNetworksClientAPI = (*siterecovery.ReplicationNetworksClient)(nil) + +// ReplicationNetworkMappingsClientAPI contains the set of methods on the ReplicationNetworkMappingsClient type. +type ReplicationNetworkMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, networkName string, networkMappingName string, input siterecovery.CreateNetworkMappingInput) (result siterecovery.ReplicationNetworkMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result siterecovery.ReplicationNetworkMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result siterecovery.NetworkMapping, err error) + List(ctx context.Context) (result siterecovery.NetworkMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.NetworkMappingCollectionIterator, err error) + ListByReplicationNetworks(ctx context.Context, fabricName string, networkName string) (result siterecovery.NetworkMappingCollectionPage, err error) + ListByReplicationNetworksComplete(ctx context.Context, fabricName string, networkName string) (result siterecovery.NetworkMappingCollectionIterator, err error) + Update(ctx context.Context, fabricName string, networkName string, networkMappingName string, input siterecovery.UpdateNetworkMappingInput) (result siterecovery.ReplicationNetworkMappingsUpdateFuture, err error) +} + +var _ ReplicationNetworkMappingsClientAPI = (*siterecovery.ReplicationNetworkMappingsClient)(nil) + +// ReplicationProtectionContainersClientAPI contains the set of methods on the ReplicationProtectionContainersClient type. +type ReplicationProtectionContainersClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, creationInput siterecovery.CreateProtectionContainerInput) (result siterecovery.ReplicationProtectionContainersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectionContainersDeleteFuture, err error) + DiscoverProtectableItem(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest siterecovery.DiscoverProtectableItemRequest) (result siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainer, err error) + List(ctx context.Context) (result siterecovery.ProtectionContainerCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.ProtectionContainerCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.ProtectionContainerCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.ProtectionContainerCollectionIterator, err error) + SwitchProtection(ctx context.Context, fabricName string, protectionContainerName string, switchInput siterecovery.SwitchProtectionInput) (result siterecovery.ReplicationProtectionContainersSwitchProtectionFuture, err error) +} + +var _ ReplicationProtectionContainersClientAPI = (*siterecovery.ReplicationProtectionContainersClient)(nil) + +// ReplicationMigrationItemsClientAPI contains the set of methods on the ReplicationMigrationItemsClient type. +type ReplicationMigrationItemsClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.EnableMigrationInput) (result siterecovery.ReplicationMigrationItemsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (result siterecovery.ReplicationMigrationItemsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationItem, err error) + List(ctx context.Context, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionIterator, err error) + Migrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput siterecovery.MigrateInput) (result siterecovery.ReplicationMigrationItemsMigrateFuture, err error) + Resync(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.ResyncInput) (result siterecovery.ReplicationMigrationItemsResyncFuture, err error) + TestMigrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput siterecovery.TestMigrateInput) (result siterecovery.ReplicationMigrationItemsTestMigrateFuture, err error) + TestMigrateCleanup(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput siterecovery.TestMigrateCleanupInput) (result siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.UpdateMigrationItemInput) (result siterecovery.ReplicationMigrationItemsUpdateFuture, err error) +} + +var _ ReplicationMigrationItemsClientAPI = (*siterecovery.ReplicationMigrationItemsClient)(nil) + +// MigrationRecoveryPointsClientAPI contains the set of methods on the MigrationRecoveryPointsClient type. +type MigrationRecoveryPointsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (result siterecovery.MigrationRecoveryPoint, err error) + ListByReplicationMigrationItems(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationRecoveryPointCollectionPage, err error) + ListByReplicationMigrationItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationRecoveryPointCollectionIterator, err error) +} + +var _ MigrationRecoveryPointsClientAPI = (*siterecovery.MigrationRecoveryPointsClient)(nil) + +// ReplicationProtectableItemsClientAPI contains the set of methods on the ReplicationProtectableItemsClient type. +type ReplicationProtectableItemsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (result siterecovery.ProtectableItem, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result siterecovery.ProtectableItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result siterecovery.ProtectableItemCollectionIterator, err error) +} + +var _ ReplicationProtectableItemsClientAPI = (*siterecovery.ReplicationProtectableItemsClient)(nil) + +// ReplicationProtectedItemsClientAPI contains the set of methods on the ReplicationProtectedItemsClient type. +type ReplicationProtectedItemsClientAPI interface { + AddDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput siterecovery.AddDisksInput) (result siterecovery.ReplicationProtectedItemsAddDisksFuture, err error) + ApplyRecoveryPoint(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput siterecovery.ApplyRecoveryPointInput) (result siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture, err error) + Create(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input siterecovery.EnableProtectionInput) (result siterecovery.ReplicationProtectedItemsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput siterecovery.DisableProtectionInput) (result siterecovery.ReplicationProtectedItemsDeleteFuture, err error) + FailoverCancel(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsFailoverCancelFuture, err error) + FailoverCommit(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsFailoverCommitFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItem, err error) + List(ctx context.Context, skipToken string, filter string) (result siterecovery.ReplicationProtectedItemCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, filter string) (result siterecovery.ReplicationProtectedItemCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectedItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectedItemCollectionIterator, err error) + PlannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput siterecovery.PlannedFailoverInput) (result siterecovery.ReplicationProtectedItemsPlannedFailoverFuture, err error) + Purge(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsPurgeFuture, err error) + RemoveDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput siterecovery.RemoveDisksInput) (result siterecovery.ReplicationProtectedItemsRemoveDisksFuture, err error) + RepairReplication(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsRepairReplicationFuture, err error) + Reprotect(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput siterecovery.ReverseReplicationInput) (result siterecovery.ReplicationProtectedItemsReprotectFuture, err error) + ResolveHealthErrors(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput siterecovery.ResolveHealthInput) (result siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture, err error) + SwitchProvider(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, switchProviderInput siterecovery.SwitchProviderInput) (result siterecovery.ReplicationProtectedItemsSwitchProviderFuture, err error) + TestFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput siterecovery.TestFailoverInput) (result siterecovery.ReplicationProtectedItemsTestFailoverFuture, err error) + TestFailoverCleanup(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput siterecovery.TestFailoverCleanupInput) (result siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture, err error) + UnplannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput siterecovery.UnplannedFailoverInput) (result siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput siterecovery.UpdateReplicationProtectedItemInput) (result siterecovery.ReplicationProtectedItemsUpdateFuture, err error) + UpdateAppliance(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput siterecovery.UpdateApplianceForReplicationProtectedItemInput) (result siterecovery.ReplicationProtectedItemsUpdateApplianceFuture, err error) + UpdateMobilityService(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest siterecovery.UpdateMobilityServiceRequest) (result siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) +} + +var _ ReplicationProtectedItemsClientAPI = (*siterecovery.ReplicationProtectedItemsClient)(nil) + +// RecoveryPointsClientAPI contains the set of methods on the RecoveryPointsClient type. +type RecoveryPointsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (result siterecovery.RecoveryPoint, err error) + ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.RecoveryPointCollectionPage, err error) + ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.RecoveryPointCollectionIterator, err error) +} + +var _ RecoveryPointsClientAPI = (*siterecovery.RecoveryPointsClient)(nil) + +// TargetComputeSizesClientAPI contains the set of methods on the TargetComputeSizesClient type. +type TargetComputeSizesClientAPI interface { + ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.TargetComputeSizeCollectionPage, err error) + ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.TargetComputeSizeCollectionIterator, err error) +} + +var _ TargetComputeSizesClientAPI = (*siterecovery.TargetComputeSizesClient)(nil) + +// ReplicationProtectionContainerMappingsClientAPI contains the set of methods on the ReplicationProtectionContainerMappingsClient type. +type ReplicationProtectionContainerMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput siterecovery.CreateProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput siterecovery.RemoveProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result siterecovery.ProtectionContainerMapping, err error) + List(ctx context.Context) (result siterecovery.ProtectionContainerMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.ProtectionContainerMappingCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainerMappingCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainerMappingCollectionIterator, err error) + Purge(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result siterecovery.ReplicationProtectionContainerMappingsPurgeFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput siterecovery.UpdateProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsUpdateFuture, err error) +} + +var _ ReplicationProtectionContainerMappingsClientAPI = (*siterecovery.ReplicationProtectionContainerMappingsClient)(nil) + +// ReplicationRecoveryServicesProvidersClientAPI contains the set of methods on the ReplicationRecoveryServicesProvidersClient type. +type ReplicationRecoveryServicesProvidersClientAPI interface { + Create(ctx context.Context, fabricName string, providerName string, addProviderInput siterecovery.AddRecoveryServicesProviderInput) (result siterecovery.ReplicationRecoveryServicesProvidersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture, err error) + Get(ctx context.Context, fabricName string, providerName string) (result siterecovery.RecoveryServicesProvider, err error) + List(ctx context.Context) (result siterecovery.RecoveryServicesProviderCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.RecoveryServicesProviderCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.RecoveryServicesProviderCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.RecoveryServicesProviderCollectionIterator, err error) + Purge(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture, err error) + RefreshProvider(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) +} + +var _ ReplicationRecoveryServicesProvidersClientAPI = (*siterecovery.ReplicationRecoveryServicesProvidersClient)(nil) + +// ReplicationStorageClassificationsClientAPI contains the set of methods on the ReplicationStorageClassificationsClient type. +type ReplicationStorageClassificationsClientAPI interface { + Get(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassification, err error) + List(ctx context.Context) (result siterecovery.StorageClassificationCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.StorageClassificationCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.StorageClassificationCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.StorageClassificationCollectionIterator, err error) +} + +var _ ReplicationStorageClassificationsClientAPI = (*siterecovery.ReplicationStorageClassificationsClient)(nil) + +// ReplicationStorageClassificationMappingsClientAPI contains the set of methods on the ReplicationStorageClassificationMappingsClient type. +type ReplicationStorageClassificationMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput siterecovery.StorageClassificationMappingInput) (result siterecovery.ReplicationStorageClassificationMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result siterecovery.ReplicationStorageClassificationMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result siterecovery.StorageClassificationMapping, err error) + List(ctx context.Context) (result siterecovery.StorageClassificationMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.StorageClassificationMappingCollectionIterator, err error) + ListByReplicationStorageClassifications(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassificationMappingCollectionPage, err error) + ListByReplicationStorageClassificationsComplete(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassificationMappingCollectionIterator, err error) +} + +var _ ReplicationStorageClassificationMappingsClientAPI = (*siterecovery.ReplicationStorageClassificationMappingsClient)(nil) + +// ReplicationvCentersClientAPI contains the set of methods on the ReplicationvCentersClient type. +type ReplicationvCentersClientAPI interface { + Create(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest siterecovery.AddVCenterRequest) (result siterecovery.ReplicationvCentersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, vcenterName string) (result siterecovery.ReplicationvCentersDeleteFuture, err error) + Get(ctx context.Context, fabricName string, vcenterName string) (result siterecovery.VCenter, err error) + List(ctx context.Context) (result siterecovery.VCenterCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.VCenterCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.VCenterCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.VCenterCollectionIterator, err error) + Update(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest siterecovery.UpdateVCenterRequest) (result siterecovery.ReplicationvCentersUpdateFuture, err error) +} + +var _ ReplicationvCentersClientAPI = (*siterecovery.ReplicationvCentersClient)(nil) + +// ReplicationJobsClientAPI contains the set of methods on the ReplicationJobsClient type. +type ReplicationJobsClientAPI interface { + Cancel(ctx context.Context, jobName string) (result siterecovery.ReplicationJobsCancelFuture, err error) + Export(ctx context.Context, jobQueryParameter siterecovery.JobQueryParameter) (result siterecovery.ReplicationJobsExportFuture, err error) + Get(ctx context.Context, jobName string) (result siterecovery.Job, err error) + List(ctx context.Context, filter string) (result siterecovery.JobCollectionPage, err error) + ListComplete(ctx context.Context, filter string) (result siterecovery.JobCollectionIterator, err error) + Restart(ctx context.Context, jobName string) (result siterecovery.ReplicationJobsRestartFuture, err error) + Resume(ctx context.Context, jobName string, resumeJobParams siterecovery.ResumeJobParams) (result siterecovery.ReplicationJobsResumeFuture, err error) +} + +var _ ReplicationJobsClientAPI = (*siterecovery.ReplicationJobsClient)(nil) + +// ReplicationPoliciesClientAPI contains the set of methods on the ReplicationPoliciesClient type. +type ReplicationPoliciesClientAPI interface { + Create(ctx context.Context, policyName string, input siterecovery.CreatePolicyInput) (result siterecovery.ReplicationPoliciesCreateFuture, err error) + Delete(ctx context.Context, policyName string) (result siterecovery.ReplicationPoliciesDeleteFuture, err error) + Get(ctx context.Context, policyName string) (result siterecovery.Policy, err error) + List(ctx context.Context) (result siterecovery.PolicyCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.PolicyCollectionIterator, err error) + Update(ctx context.Context, policyName string, input siterecovery.UpdatePolicyInput) (result siterecovery.ReplicationPoliciesUpdateFuture, err error) +} + +var _ ReplicationPoliciesClientAPI = (*siterecovery.ReplicationPoliciesClient)(nil) + +// ReplicationProtectionIntentsClientAPI contains the set of methods on the ReplicationProtectionIntentsClient type. +type ReplicationProtectionIntentsClientAPI interface { + Create(ctx context.Context, intentObjectName string, input siterecovery.CreateProtectionIntentInput) (result siterecovery.ReplicationProtectionIntent, err error) + Get(ctx context.Context, intentObjectName string) (result siterecovery.ReplicationProtectionIntent, err error) + List(ctx context.Context, skipToken string, takeToken string) (result siterecovery.ReplicationProtectionIntentCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, takeToken string) (result siterecovery.ReplicationProtectionIntentCollectionIterator, err error) +} + +var _ ReplicationProtectionIntentsClientAPI = (*siterecovery.ReplicationProtectionIntentsClient)(nil) + +// ReplicationRecoveryPlansClientAPI contains the set of methods on the ReplicationRecoveryPlansClient type. +type ReplicationRecoveryPlansClientAPI interface { + Create(ctx context.Context, recoveryPlanName string, input siterecovery.CreateRecoveryPlanInput) (result siterecovery.ReplicationRecoveryPlansCreateFuture, err error) + Delete(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansDeleteFuture, err error) + FailoverCancel(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansFailoverCancelFuture, err error) + FailoverCommit(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansFailoverCommitFuture, err error) + Get(ctx context.Context, recoveryPlanName string) (result siterecovery.RecoveryPlan, err error) + List(ctx context.Context) (result siterecovery.RecoveryPlanCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.RecoveryPlanCollectionIterator, err error) + PlannedFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanPlannedFailoverInput) (result siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture, err error) + Reprotect(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansReprotectFuture, err error) + TestFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanTestFailoverInput) (result siterecovery.ReplicationRecoveryPlansTestFailoverFuture, err error) + TestFailoverCleanup(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanTestFailoverCleanupInput) (result siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) + UnplannedFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanUnplannedFailoverInput) (result siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture, err error) + Update(ctx context.Context, recoveryPlanName string, input siterecovery.UpdateRecoveryPlanInput) (result siterecovery.ReplicationRecoveryPlansUpdateFuture, err error) +} + +var _ ReplicationRecoveryPlansClientAPI = (*siterecovery.ReplicationRecoveryPlansClient)(nil) + +// SupportedOperatingSystemsClientAPI contains the set of methods on the SupportedOperatingSystemsClient type. +type SupportedOperatingSystemsClientAPI interface { + Get(ctx context.Context, instanceType string) (result siterecovery.SupportedOperatingSystems, err error) +} + +var _ SupportedOperatingSystemsClientAPI = (*siterecovery.SupportedOperatingSystemsClient)(nil) + +// ReplicationVaultHealthClientAPI contains the set of methods on the ReplicationVaultHealthClient type. +type ReplicationVaultHealthClientAPI interface { + Get(ctx context.Context) (result siterecovery.VaultHealthDetails, err error) + Refresh(ctx context.Context) (result siterecovery.ReplicationVaultHealthRefreshFuture, err error) +} + +var _ ReplicationVaultHealthClientAPI = (*siterecovery.ReplicationVaultHealthClient)(nil) + +// ReplicationVaultSettingClientAPI contains the set of methods on the ReplicationVaultSettingClient type. +type ReplicationVaultSettingClientAPI interface { + Create(ctx context.Context, vaultSettingName string, input siterecovery.VaultSettingCreationInput) (result siterecovery.ReplicationVaultSettingCreateFuture, err error) + Get(ctx context.Context, vaultSettingName string) (result siterecovery.VaultSetting, err error) + List(ctx context.Context) (result siterecovery.VaultSettingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.VaultSettingCollectionIterator, err error) +} + +var _ ReplicationVaultSettingClientAPI = (*siterecovery.ReplicationVaultSettingClient)(nil) diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/supportedoperatingsystems.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/supportedoperatingsystems.go new file mode 100644 index 000000000000..158144bc8dd6 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/supportedoperatingsystems.go @@ -0,0 +1,110 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SupportedOperatingSystemsClient is the client for the SupportedOperatingSystems methods of the Siterecovery service. +type SupportedOperatingSystemsClient struct { + BaseClient +} + +// NewSupportedOperatingSystemsClient creates an instance of the SupportedOperatingSystemsClient client. +func NewSupportedOperatingSystemsClient(subscriptionID string, resourceGroupName string, resourceName string) SupportedOperatingSystemsClient { + return NewSupportedOperatingSystemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewSupportedOperatingSystemsClientWithBaseURI creates an instance of the SupportedOperatingSystemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewSupportedOperatingSystemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) SupportedOperatingSystemsClient { + return SupportedOperatingSystemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get sends the get request. +// Parameters: +// instanceType - the instance type. +func (client SupportedOperatingSystemsClient) Get(ctx context.Context, instanceType string) (result SupportedOperatingSystems, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SupportedOperatingSystemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, instanceType) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SupportedOperatingSystemsClient) GetPreparer(ctx context.Context, instanceType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(instanceType) > 0 { + queryParameters["instanceType"] = autorest.Encode("query", instanceType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationSupportedOperatingSystems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SupportedOperatingSystemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SupportedOperatingSystemsClient) GetResponder(resp *http.Response) (result SupportedOperatingSystems, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/targetcomputesizes.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/targetcomputesizes.go new file mode 100644 index 000000000000..c2b3551a0f89 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/targetcomputesizes.go @@ -0,0 +1,154 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// TargetComputeSizesClient is the client for the TargetComputeSizes methods of the Siterecovery service. +type TargetComputeSizesClient struct { + BaseClient +} + +// NewTargetComputeSizesClient creates an instance of the TargetComputeSizesClient client. +func NewTargetComputeSizesClient(subscriptionID string, resourceGroupName string, resourceName string) TargetComputeSizesClient { + return NewTargetComputeSizesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewTargetComputeSizesClientWithBaseURI creates an instance of the TargetComputeSizesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewTargetComputeSizesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) TargetComputeSizesClient { + return TargetComputeSizesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// ListByReplicationProtectedItems lists the available target compute sizes for a replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client TargetComputeSizesClient) ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result TargetComputeSizeCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizesClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.tcsc.Response.Response != nil { + sc = result.tcsc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectedItemsNextResults + req, err := client.ListByReplicationProtectedItemsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.tcsc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", resp, "Failure sending request") + return + } + + result.tcsc, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", resp, "Failure responding to request") + return + } + if result.tcsc.hasNextLink() && result.tcsc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectedItemsPreparer prepares the ListByReplicationProtectedItems request. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/targetComputeSizes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectedItemsSender sends the ListByReplicationProtectedItems request. The method will close the +// http.Response Body if it receives an error. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectedItemsResponder handles the response to the ListByReplicationProtectedItems request. The method always +// closes the http.Response Body. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsResponder(resp *http.Response) (result TargetComputeSizeCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectedItemsNextResults retrieves the next set of results, if any. +func (client TargetComputeSizesClient) listByReplicationProtectedItemsNextResults(ctx context.Context, lastResults TargetComputeSizeCollection) (result TargetComputeSizeCollection, err error) { + req, err := lastResults.targetComputeSizeCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectedItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result TargetComputeSizeCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizesClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectedItems(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + return +} diff --git a/services/recoveryservices/mgmt/2022-01-01/siterecovery/version.go b/services/recoveryservices/mgmt/2022-01-01/siterecovery/version.go new file mode 100644 index 000000000000..878853bca0d5 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-01-01/siterecovery/version.go @@ -0,0 +1,19 @@ +package siterecovery + +import "github.com/Azure/azure-sdk-for-go/version" + +// 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. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " siterecovery/2022-01-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/CHANGELOG.md b/services/recoveryservices/mgmt/2022-02-01/siterecovery/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/_meta.json b/services/recoveryservices/mgmt/2022-02-01/siterecovery/_meta.json new file mode 100644 index 000000000000..11c382b55ad7 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "16f5f98c30852b877949ea63418f609233470bf7", + "readme": "/_/azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.md", + "tag": "package-2022-02", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2022-02 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/client.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/client.go new file mode 100644 index 000000000000..412cf9133168 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/client.go @@ -0,0 +1,45 @@ +// Package siterecovery implements the Azure ARM Siterecovery service API version 2022-02-01. +// +// +package siterecovery + +// 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. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Siterecovery + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Siterecovery. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string + ResourceGroupName string + ResourceName string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string, resourceGroupName string, resourceName string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + ResourceGroupName: resourceGroupName, + ResourceName: resourceName, + } +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/enums.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/enums.go new file mode 100644 index 000000000000..80944d8b57f4 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/enums.go @@ -0,0 +1,1916 @@ +package siterecovery + +// 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. + +// A2ARecoveryAvailabilityType enumerates the values for a2a recovery availability type. +type A2ARecoveryAvailabilityType string + +const ( + // AvailabilitySet ... + AvailabilitySet A2ARecoveryAvailabilityType = "AvailabilitySet" + // AvailabilityZone ... + AvailabilityZone A2ARecoveryAvailabilityType = "AvailabilityZone" + // Single ... + Single A2ARecoveryAvailabilityType = "Single" +) + +// PossibleA2ARecoveryAvailabilityTypeValues returns an array of possible values for the A2ARecoveryAvailabilityType const type. +func PossibleA2ARecoveryAvailabilityTypeValues() []A2ARecoveryAvailabilityType { + return []A2ARecoveryAvailabilityType{AvailabilitySet, AvailabilityZone, Single} +} + +// A2ARpRecoveryPointType enumerates the values for a2a rp recovery point type. +type A2ARpRecoveryPointType string + +const ( + // Latest ... + Latest A2ARpRecoveryPointType = "Latest" + // LatestApplicationConsistent ... + LatestApplicationConsistent A2ARpRecoveryPointType = "LatestApplicationConsistent" + // LatestCrashConsistent ... + LatestCrashConsistent A2ARpRecoveryPointType = "LatestCrashConsistent" + // LatestProcessed ... + LatestProcessed A2ARpRecoveryPointType = "LatestProcessed" +) + +// PossibleA2ARpRecoveryPointTypeValues returns an array of possible values for the A2ARpRecoveryPointType const type. +func PossibleA2ARpRecoveryPointTypeValues() []A2ARpRecoveryPointType { + return []A2ARpRecoveryPointType{Latest, LatestApplicationConsistent, LatestCrashConsistent, LatestProcessed} +} + +// AgentAutoUpdateStatus enumerates the values for agent auto update status. +type AgentAutoUpdateStatus string + +const ( + // Disabled ... + Disabled AgentAutoUpdateStatus = "Disabled" + // Enabled ... + Enabled AgentAutoUpdateStatus = "Enabled" +) + +// PossibleAgentAutoUpdateStatusValues returns an array of possible values for the AgentAutoUpdateStatus const type. +func PossibleAgentAutoUpdateStatusValues() []AgentAutoUpdateStatus { + return []AgentAutoUpdateStatus{Disabled, Enabled} +} + +// AgentUpgradeBlockedReason enumerates the values for agent upgrade blocked reason. +type AgentUpgradeBlockedReason string + +const ( + // AgentNoHeartbeat ... + AgentNoHeartbeat AgentUpgradeBlockedReason = "AgentNoHeartbeat" + // AlreadyOnLatestVersion ... + AlreadyOnLatestVersion AgentUpgradeBlockedReason = "AlreadyOnLatestVersion" + // DistroIsNotReported ... + DistroIsNotReported AgentUpgradeBlockedReason = "DistroIsNotReported" + // DistroNotSupportedForUpgrade ... + DistroNotSupportedForUpgrade AgentUpgradeBlockedReason = "DistroNotSupportedForUpgrade" + // IncompatibleApplianceVersion ... + IncompatibleApplianceVersion AgentUpgradeBlockedReason = "IncompatibleApplianceVersion" + // InvalidAgentVersion ... + InvalidAgentVersion AgentUpgradeBlockedReason = "InvalidAgentVersion" + // InvalidDriverVersion ... + InvalidDriverVersion AgentUpgradeBlockedReason = "InvalidDriverVersion" + // MissingUpgradePath ... + MissingUpgradePath AgentUpgradeBlockedReason = "MissingUpgradePath" + // NotProtected ... + NotProtected AgentUpgradeBlockedReason = "NotProtected" + // ProcessServerNoHeartbeat ... + ProcessServerNoHeartbeat AgentUpgradeBlockedReason = "ProcessServerNoHeartbeat" + // RcmProxyNoHeartbeat ... + RcmProxyNoHeartbeat AgentUpgradeBlockedReason = "RcmProxyNoHeartbeat" + // RebootRequired ... + RebootRequired AgentUpgradeBlockedReason = "RebootRequired" + // Unknown ... + Unknown AgentUpgradeBlockedReason = "Unknown" + // UnsupportedProtectionScenario ... + UnsupportedProtectionScenario AgentUpgradeBlockedReason = "UnsupportedProtectionScenario" +) + +// PossibleAgentUpgradeBlockedReasonValues returns an array of possible values for the AgentUpgradeBlockedReason const type. +func PossibleAgentUpgradeBlockedReasonValues() []AgentUpgradeBlockedReason { + return []AgentUpgradeBlockedReason{AgentNoHeartbeat, AlreadyOnLatestVersion, DistroIsNotReported, DistroNotSupportedForUpgrade, IncompatibleApplianceVersion, InvalidAgentVersion, InvalidDriverVersion, MissingUpgradePath, NotProtected, ProcessServerNoHeartbeat, RcmProxyNoHeartbeat, RebootRequired, Unknown, UnsupportedProtectionScenario} +} + +// AgentVersionStatus enumerates the values for agent version status. +type AgentVersionStatus string + +const ( + // Deprecated ... + Deprecated AgentVersionStatus = "Deprecated" + // NotSupported ... + NotSupported AgentVersionStatus = "NotSupported" + // SecurityUpdateRequired ... + SecurityUpdateRequired AgentVersionStatus = "SecurityUpdateRequired" + // Supported ... + Supported AgentVersionStatus = "Supported" + // UpdateRequired ... + UpdateRequired AgentVersionStatus = "UpdateRequired" +) + +// PossibleAgentVersionStatusValues returns an array of possible values for the AgentVersionStatus const type. +func PossibleAgentVersionStatusValues() []AgentVersionStatus { + return []AgentVersionStatus{Deprecated, NotSupported, SecurityUpdateRequired, Supported, UpdateRequired} +} + +// AlternateLocationRecoveryOption enumerates the values for alternate location recovery option. +type AlternateLocationRecoveryOption string + +const ( + // CreateVMIfNotFound ... + CreateVMIfNotFound AlternateLocationRecoveryOption = "CreateVmIfNotFound" + // NoAction ... + NoAction AlternateLocationRecoveryOption = "NoAction" +) + +// PossibleAlternateLocationRecoveryOptionValues returns an array of possible values for the AlternateLocationRecoveryOption const type. +func PossibleAlternateLocationRecoveryOptionValues() []AlternateLocationRecoveryOption { + return []AlternateLocationRecoveryOption{CreateVMIfNotFound, NoAction} +} + +// AutomationAccountAuthenticationType enumerates the values for automation account authentication type. +type AutomationAccountAuthenticationType string + +const ( + // AutomationAccountAuthenticationTypeRunAsAccount ... + AutomationAccountAuthenticationTypeRunAsAccount AutomationAccountAuthenticationType = "RunAsAccount" + // AutomationAccountAuthenticationTypeSystemAssignedIdentity ... + AutomationAccountAuthenticationTypeSystemAssignedIdentity AutomationAccountAuthenticationType = "SystemAssignedIdentity" +) + +// PossibleAutomationAccountAuthenticationTypeValues returns an array of possible values for the AutomationAccountAuthenticationType const type. +func PossibleAutomationAccountAuthenticationTypeValues() []AutomationAccountAuthenticationType { + return []AutomationAccountAuthenticationType{AutomationAccountAuthenticationTypeRunAsAccount, AutomationAccountAuthenticationTypeSystemAssignedIdentity} +} + +// AutoProtectionOfDataDisk enumerates the values for auto protection of data disk. +type AutoProtectionOfDataDisk string + +const ( + // AutoProtectionOfDataDiskDisabled ... + AutoProtectionOfDataDiskDisabled AutoProtectionOfDataDisk = "Disabled" + // AutoProtectionOfDataDiskEnabled ... + AutoProtectionOfDataDiskEnabled AutoProtectionOfDataDisk = "Enabled" +) + +// PossibleAutoProtectionOfDataDiskValues returns an array of possible values for the AutoProtectionOfDataDisk const type. +func PossibleAutoProtectionOfDataDiskValues() []AutoProtectionOfDataDisk { + return []AutoProtectionOfDataDisk{AutoProtectionOfDataDiskDisabled, AutoProtectionOfDataDiskEnabled} +} + +// DataSyncStatus enumerates the values for data sync status. +type DataSyncStatus string + +const ( + // ForDownTime ... + ForDownTime DataSyncStatus = "ForDownTime" + // ForSynchronization ... + ForSynchronization DataSyncStatus = "ForSynchronization" +) + +// PossibleDataSyncStatusValues returns an array of possible values for the DataSyncStatus const type. +func PossibleDataSyncStatusValues() []DataSyncStatus { + return []DataSyncStatus{ForDownTime, ForSynchronization} +} + +// DisableProtectionReason enumerates the values for disable protection reason. +type DisableProtectionReason string + +const ( + // MigrationComplete ... + MigrationComplete DisableProtectionReason = "MigrationComplete" + // NotSpecified ... + NotSpecified DisableProtectionReason = "NotSpecified" +) + +// PossibleDisableProtectionReasonValues returns an array of possible values for the DisableProtectionReason const type. +func PossibleDisableProtectionReasonValues() []DisableProtectionReason { + return []DisableProtectionReason{MigrationComplete, NotSpecified} +} + +// DiskAccountType enumerates the values for disk account type. +type DiskAccountType string + +const ( + // PremiumLRS ... + PremiumLRS DiskAccountType = "Premium_LRS" + // StandardLRS ... + StandardLRS DiskAccountType = "Standard_LRS" + // StandardSSDLRS ... + StandardSSDLRS DiskAccountType = "StandardSSD_LRS" +) + +// PossibleDiskAccountTypeValues returns an array of possible values for the DiskAccountType const type. +func PossibleDiskAccountTypeValues() []DiskAccountType { + return []DiskAccountType{PremiumLRS, StandardLRS, StandardSSDLRS} +} + +// DiskReplicationProgressHealth enumerates the values for disk replication progress health. +type DiskReplicationProgressHealth string + +const ( + // InProgress ... + InProgress DiskReplicationProgressHealth = "InProgress" + // None ... + None DiskReplicationProgressHealth = "None" + // NoProgress ... + NoProgress DiskReplicationProgressHealth = "NoProgress" + // Queued ... + Queued DiskReplicationProgressHealth = "Queued" + // SlowProgress ... + SlowProgress DiskReplicationProgressHealth = "SlowProgress" +) + +// PossibleDiskReplicationProgressHealthValues returns an array of possible values for the DiskReplicationProgressHealth const type. +func PossibleDiskReplicationProgressHealthValues() []DiskReplicationProgressHealth { + return []DiskReplicationProgressHealth{InProgress, None, NoProgress, Queued, SlowProgress} +} + +// EthernetAddressType enumerates the values for ethernet address type. +type EthernetAddressType string + +const ( + // Dynamic ... + Dynamic EthernetAddressType = "Dynamic" + // Static ... + Static EthernetAddressType = "Static" +) + +// PossibleEthernetAddressTypeValues returns an array of possible values for the EthernetAddressType const type. +func PossibleEthernetAddressTypeValues() []EthernetAddressType { + return []EthernetAddressType{Dynamic, Static} +} + +// ExportJobOutputSerializationType enumerates the values for export job output serialization type. +type ExportJobOutputSerializationType string + +const ( + // Excel ... + Excel ExportJobOutputSerializationType = "Excel" + // JSON ... + JSON ExportJobOutputSerializationType = "Json" + // XML ... + XML ExportJobOutputSerializationType = "Xml" +) + +// PossibleExportJobOutputSerializationTypeValues returns an array of possible values for the ExportJobOutputSerializationType const type. +func PossibleExportJobOutputSerializationTypeValues() []ExportJobOutputSerializationType { + return []ExportJobOutputSerializationType{Excel, JSON, XML} +} + +// FailoverDeploymentModel enumerates the values for failover deployment model. +type FailoverDeploymentModel string + +const ( + // Classic ... + Classic FailoverDeploymentModel = "Classic" + // NotApplicable ... + NotApplicable FailoverDeploymentModel = "NotApplicable" + // ResourceManager ... + ResourceManager FailoverDeploymentModel = "ResourceManager" +) + +// PossibleFailoverDeploymentModelValues returns an array of possible values for the FailoverDeploymentModel const type. +func PossibleFailoverDeploymentModelValues() []FailoverDeploymentModel { + return []FailoverDeploymentModel{Classic, NotApplicable, ResourceManager} +} + +// HealthErrorCategory enumerates the values for health error category. +type HealthErrorCategory string + +const ( + // HealthErrorCategoryAgentAutoUpdateArtifactDeleted ... + HealthErrorCategoryAgentAutoUpdateArtifactDeleted HealthErrorCategory = "AgentAutoUpdateArtifactDeleted" + // HealthErrorCategoryAgentAutoUpdateInfra ... + HealthErrorCategoryAgentAutoUpdateInfra HealthErrorCategory = "AgentAutoUpdateInfra" + // HealthErrorCategoryAgentAutoUpdateRunAsAccount ... + HealthErrorCategoryAgentAutoUpdateRunAsAccount HealthErrorCategory = "AgentAutoUpdateRunAsAccount" + // HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired ... + HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired HealthErrorCategory = "AgentAutoUpdateRunAsAccountExpired" + // HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry ... + HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry HealthErrorCategory = "AgentAutoUpdateRunAsAccountExpiry" + // HealthErrorCategoryConfiguration ... + HealthErrorCategoryConfiguration HealthErrorCategory = "Configuration" + // HealthErrorCategoryFabricInfrastructure ... + HealthErrorCategoryFabricInfrastructure HealthErrorCategory = "FabricInfrastructure" + // HealthErrorCategoryNone ... + HealthErrorCategoryNone HealthErrorCategory = "None" + // HealthErrorCategoryReplication ... + HealthErrorCategoryReplication HealthErrorCategory = "Replication" + // HealthErrorCategoryTestFailover ... + HealthErrorCategoryTestFailover HealthErrorCategory = "TestFailover" + // HealthErrorCategoryVersionExpiry ... + HealthErrorCategoryVersionExpiry HealthErrorCategory = "VersionExpiry" +) + +// PossibleHealthErrorCategoryValues returns an array of possible values for the HealthErrorCategory const type. +func PossibleHealthErrorCategoryValues() []HealthErrorCategory { + return []HealthErrorCategory{HealthErrorCategoryAgentAutoUpdateArtifactDeleted, HealthErrorCategoryAgentAutoUpdateInfra, HealthErrorCategoryAgentAutoUpdateRunAsAccount, HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired, HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry, HealthErrorCategoryConfiguration, HealthErrorCategoryFabricInfrastructure, HealthErrorCategoryNone, HealthErrorCategoryReplication, HealthErrorCategoryTestFailover, HealthErrorCategoryVersionExpiry} +} + +// HealthErrorCustomerResolvability enumerates the values for health error customer resolvability. +type HealthErrorCustomerResolvability string + +const ( + // Allowed ... + Allowed HealthErrorCustomerResolvability = "Allowed" + // NotAllowed ... + NotAllowed HealthErrorCustomerResolvability = "NotAllowed" +) + +// PossibleHealthErrorCustomerResolvabilityValues returns an array of possible values for the HealthErrorCustomerResolvability const type. +func PossibleHealthErrorCustomerResolvabilityValues() []HealthErrorCustomerResolvability { + return []HealthErrorCustomerResolvability{Allowed, NotAllowed} +} + +// HyperVReplicaAzureRpRecoveryPointType enumerates the values for hyper v replica azure rp recovery point +// type. +type HyperVReplicaAzureRpRecoveryPointType string + +const ( + // HyperVReplicaAzureRpRecoveryPointTypeLatest ... + HyperVReplicaAzureRpRecoveryPointTypeLatest HyperVReplicaAzureRpRecoveryPointType = "Latest" + // HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent ... + HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent HyperVReplicaAzureRpRecoveryPointType = "LatestApplicationConsistent" + // HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed ... + HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed HyperVReplicaAzureRpRecoveryPointType = "LatestProcessed" +) + +// PossibleHyperVReplicaAzureRpRecoveryPointTypeValues returns an array of possible values for the HyperVReplicaAzureRpRecoveryPointType const type. +func PossibleHyperVReplicaAzureRpRecoveryPointTypeValues() []HyperVReplicaAzureRpRecoveryPointType { + return []HyperVReplicaAzureRpRecoveryPointType{HyperVReplicaAzureRpRecoveryPointTypeLatest, HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent, HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed} +} + +// InMageRcmFailbackRecoveryPointType enumerates the values for in mage rcm failback recovery point type. +type InMageRcmFailbackRecoveryPointType string + +const ( + // ApplicationConsistent ... + ApplicationConsistent InMageRcmFailbackRecoveryPointType = "ApplicationConsistent" + // CrashConsistent ... + CrashConsistent InMageRcmFailbackRecoveryPointType = "CrashConsistent" +) + +// PossibleInMageRcmFailbackRecoveryPointTypeValues returns an array of possible values for the InMageRcmFailbackRecoveryPointType const type. +func PossibleInMageRcmFailbackRecoveryPointTypeValues() []InMageRcmFailbackRecoveryPointType { + return []InMageRcmFailbackRecoveryPointType{ApplicationConsistent, CrashConsistent} +} + +// InMageV2RpRecoveryPointType enumerates the values for in mage v2 rp recovery point type. +type InMageV2RpRecoveryPointType string + +const ( + // InMageV2RpRecoveryPointTypeLatest ... + InMageV2RpRecoveryPointTypeLatest InMageV2RpRecoveryPointType = "Latest" + // InMageV2RpRecoveryPointTypeLatestApplicationConsistent ... + InMageV2RpRecoveryPointTypeLatestApplicationConsistent InMageV2RpRecoveryPointType = "LatestApplicationConsistent" + // InMageV2RpRecoveryPointTypeLatestCrashConsistent ... + InMageV2RpRecoveryPointTypeLatestCrashConsistent InMageV2RpRecoveryPointType = "LatestCrashConsistent" + // InMageV2RpRecoveryPointTypeLatestProcessed ... + InMageV2RpRecoveryPointTypeLatestProcessed InMageV2RpRecoveryPointType = "LatestProcessed" +) + +// PossibleInMageV2RpRecoveryPointTypeValues returns an array of possible values for the InMageV2RpRecoveryPointType const type. +func PossibleInMageV2RpRecoveryPointTypeValues() []InMageV2RpRecoveryPointType { + return []InMageV2RpRecoveryPointType{InMageV2RpRecoveryPointTypeLatest, InMageV2RpRecoveryPointTypeLatestApplicationConsistent, InMageV2RpRecoveryPointTypeLatestCrashConsistent, InMageV2RpRecoveryPointTypeLatestProcessed} +} + +// InstanceType enumerates the values for instance type. +type InstanceType string + +const ( + // InstanceTypeA2A ... + InstanceTypeA2A InstanceType = "A2A" + // InstanceTypeAddDisksProviderSpecificInput ... + InstanceTypeAddDisksProviderSpecificInput InstanceType = "AddDisksProviderSpecificInput" +) + +// PossibleInstanceTypeValues returns an array of possible values for the InstanceType const type. +func PossibleInstanceTypeValues() []InstanceType { + return []InstanceType{InstanceTypeA2A, InstanceTypeAddDisksProviderSpecificInput} +} + +// InstanceTypeBasicApplianceSpecificDetails enumerates the values for instance type basic appliance specific +// details. +type InstanceTypeBasicApplianceSpecificDetails string + +const ( + // InstanceTypeApplianceSpecificDetails ... + InstanceTypeApplianceSpecificDetails InstanceTypeBasicApplianceSpecificDetails = "ApplianceSpecificDetails" + // InstanceTypeInMageRcm ... + InstanceTypeInMageRcm InstanceTypeBasicApplianceSpecificDetails = "InMageRcm" +) + +// PossibleInstanceTypeBasicApplianceSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicApplianceSpecificDetails const type. +func PossibleInstanceTypeBasicApplianceSpecificDetailsValues() []InstanceTypeBasicApplianceSpecificDetails { + return []InstanceTypeBasicApplianceSpecificDetails{InstanceTypeApplianceSpecificDetails, InstanceTypeInMageRcm} +} + +// InstanceTypeBasicApplyRecoveryPointProviderSpecificInput enumerates the values for instance type basic apply +// recovery point provider specific input. +type InstanceTypeBasicApplyRecoveryPointProviderSpecificInput string + +const ( + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "A2A" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "ApplyRecoveryPointProviderSpecificInput" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicApplyRecoveryPointProviderSpecificInput = "InMageRcm" +) + +// PossibleInstanceTypeBasicApplyRecoveryPointProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicApplyRecoveryPointProviderSpecificInput const type. +func PossibleInstanceTypeBasicApplyRecoveryPointProviderSpecificInputValues() []InstanceTypeBasicApplyRecoveryPointProviderSpecificInput { + return []InstanceTypeBasicApplyRecoveryPointProviderSpecificInput{InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm} +} + +// InstanceTypeBasicConfigurationSettings enumerates the values for instance type basic configuration settings. +type InstanceTypeBasicConfigurationSettings string + +const ( + // InstanceTypeConfigurationSettings ... + InstanceTypeConfigurationSettings InstanceTypeBasicConfigurationSettings = "ConfigurationSettings" + // InstanceTypeHyperVVirtualMachine ... + InstanceTypeHyperVVirtualMachine InstanceTypeBasicConfigurationSettings = "HyperVVirtualMachine" + // InstanceTypeReplicationGroupDetails ... + InstanceTypeReplicationGroupDetails InstanceTypeBasicConfigurationSettings = "ReplicationGroupDetails" + // InstanceTypeVmmVirtualMachine ... + InstanceTypeVmmVirtualMachine InstanceTypeBasicConfigurationSettings = "VmmVirtualMachine" + // InstanceTypeVMwareVirtualMachine ... + InstanceTypeVMwareVirtualMachine InstanceTypeBasicConfigurationSettings = "VMwareVirtualMachine" +) + +// PossibleInstanceTypeBasicConfigurationSettingsValues returns an array of possible values for the InstanceTypeBasicConfigurationSettings const type. +func PossibleInstanceTypeBasicConfigurationSettingsValues() []InstanceTypeBasicConfigurationSettings { + return []InstanceTypeBasicConfigurationSettings{InstanceTypeConfigurationSettings, InstanceTypeHyperVVirtualMachine, InstanceTypeReplicationGroupDetails, InstanceTypeVmmVirtualMachine, InstanceTypeVMwareVirtualMachine} +} + +// InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails enumerates the values for instance type basic +// create protection intent provider specific details. +type InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails string + +const ( + // InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails = "A2A" + // InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails ... + InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails = "CreateProtectionIntentProviderSpecificDetails" +) + +// PossibleInstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails const type. +func PossibleInstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsValues() []InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails { + return []InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails{InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails} +} + +// InstanceTypeBasicDisableProtectionProviderSpecificInput enumerates the values for instance type basic +// disable protection provider specific input. +type InstanceTypeBasicDisableProtectionProviderSpecificInput string + +const ( + // InstanceTypeDisableProtectionProviderSpecificInput ... + InstanceTypeDisableProtectionProviderSpecificInput InstanceTypeBasicDisableProtectionProviderSpecificInput = "DisableProtectionProviderSpecificInput" + // InstanceTypeInMage ... + InstanceTypeInMage InstanceTypeBasicDisableProtectionProviderSpecificInput = "InMage" +) + +// PossibleInstanceTypeBasicDisableProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicDisableProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicDisableProtectionProviderSpecificInputValues() []InstanceTypeBasicDisableProtectionProviderSpecificInput { + return []InstanceTypeBasicDisableProtectionProviderSpecificInput{InstanceTypeDisableProtectionProviderSpecificInput, InstanceTypeInMage} +} + +// InstanceTypeBasicEnableMigrationProviderSpecificInput enumerates the values for instance type basic enable +// migration provider specific input. +type InstanceTypeBasicEnableMigrationProviderSpecificInput string + +const ( + // InstanceTypeEnableMigrationProviderSpecificInput ... + InstanceTypeEnableMigrationProviderSpecificInput InstanceTypeBasicEnableMigrationProviderSpecificInput = "EnableMigrationProviderSpecificInput" + // InstanceTypeVMwareCbt ... + InstanceTypeVMwareCbt InstanceTypeBasicEnableMigrationProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicEnableMigrationProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicEnableMigrationProviderSpecificInput const type. +func PossibleInstanceTypeBasicEnableMigrationProviderSpecificInputValues() []InstanceTypeBasicEnableMigrationProviderSpecificInput { + return []InstanceTypeBasicEnableMigrationProviderSpecificInput{InstanceTypeEnableMigrationProviderSpecificInput, InstanceTypeVMwareCbt} +} + +// InstanceTypeBasicEnableProtectionProviderSpecificInput enumerates the values for instance type basic enable +// protection provider specific input. +type InstanceTypeBasicEnableProtectionProviderSpecificInput string + +const ( + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A InstanceTypeBasicEnableProtectionProviderSpecificInput = "A2A" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicEnableProtectionProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput InstanceTypeBasicEnableProtectionProviderSpecificInput = "EnableProtectionProviderSpecificInput" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicEnableProtectionProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMage" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicEnableProtectionProviderSpecificInput = "InMageRcm" +) + +// PossibleInstanceTypeBasicEnableProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicEnableProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicEnableProtectionProviderSpecificInputValues() []InstanceTypeBasicEnableProtectionProviderSpecificInput { + return []InstanceTypeBasicEnableProtectionProviderSpecificInput{InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm} +} + +// InstanceTypeBasicEventProviderSpecificDetails enumerates the values for instance type basic event provider +// specific details. +type InstanceTypeBasicEventProviderSpecificDetails string + +const ( + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicEventProviderSpecificDetails = "A2A" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails InstanceTypeBasicEventProviderSpecificDetails = "EventProviderSpecificDetails" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplica2012" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplica2012R2" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplicaAzure" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails InstanceTypeBasicEventProviderSpecificDetails = "HyperVReplicaBaseEventDetails" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicEventProviderSpecificDetails = "InMageAzureV2" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicEventProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback InstanceTypeBasicEventProviderSpecificDetails = "InMageRcmFailback" + // InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicEventProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicEventProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicEventProviderSpecificDetails const type. +func PossibleInstanceTypeBasicEventProviderSpecificDetailsValues() []InstanceTypeBasicEventProviderSpecificDetails { + return []InstanceTypeBasicEventProviderSpecificDetails{InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback, InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicEventSpecificDetails enumerates the values for instance type basic event specific details. +type InstanceTypeBasicEventSpecificDetails string + +const ( + // InstanceTypeEventSpecificDetails ... + InstanceTypeEventSpecificDetails InstanceTypeBasicEventSpecificDetails = "EventSpecificDetails" + // InstanceTypeJobStatus ... + InstanceTypeJobStatus InstanceTypeBasicEventSpecificDetails = "JobStatus" +) + +// PossibleInstanceTypeBasicEventSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicEventSpecificDetails const type. +func PossibleInstanceTypeBasicEventSpecificDetailsValues() []InstanceTypeBasicEventSpecificDetails { + return []InstanceTypeBasicEventSpecificDetails{InstanceTypeEventSpecificDetails, InstanceTypeJobStatus} +} + +// InstanceTypeBasicFabricSpecificCreateNetworkMappingInput enumerates the values for instance type basic +// fabric specific create network mapping input. +type InstanceTypeBasicFabricSpecificCreateNetworkMappingInput string + +const ( + // InstanceTypeAzureToAzure ... + InstanceTypeAzureToAzure InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "AzureToAzure" + // InstanceTypeFabricSpecificCreateNetworkMappingInput ... + InstanceTypeFabricSpecificCreateNetworkMappingInput InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "FabricSpecificCreateNetworkMappingInput" + // InstanceTypeVmmToAzure ... + InstanceTypeVmmToAzure InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "VmmToAzure" + // InstanceTypeVmmToVmm ... + InstanceTypeVmmToVmm InstanceTypeBasicFabricSpecificCreateNetworkMappingInput = "VmmToVmm" +) + +// PossibleInstanceTypeBasicFabricSpecificCreateNetworkMappingInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificCreateNetworkMappingInput const type. +func PossibleInstanceTypeBasicFabricSpecificCreateNetworkMappingInputValues() []InstanceTypeBasicFabricSpecificCreateNetworkMappingInput { + return []InstanceTypeBasicFabricSpecificCreateNetworkMappingInput{InstanceTypeAzureToAzure, InstanceTypeFabricSpecificCreateNetworkMappingInput, InstanceTypeVmmToAzure, InstanceTypeVmmToVmm} +} + +// InstanceTypeBasicFabricSpecificCreationInput enumerates the values for instance type basic fabric specific +// creation input. +type InstanceTypeBasicFabricSpecificCreationInput string + +const ( + // InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure ... + InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure InstanceTypeBasicFabricSpecificCreationInput = "Azure" + // InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput ... + InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput InstanceTypeBasicFabricSpecificCreationInput = "FabricSpecificCreationInput" + // InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm ... + InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm InstanceTypeBasicFabricSpecificCreationInput = "InMageRcm" + // InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2 ... + InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2 InstanceTypeBasicFabricSpecificCreationInput = "VMwareV2" +) + +// PossibleInstanceTypeBasicFabricSpecificCreationInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificCreationInput const type. +func PossibleInstanceTypeBasicFabricSpecificCreationInputValues() []InstanceTypeBasicFabricSpecificCreationInput { + return []InstanceTypeBasicFabricSpecificCreationInput{InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure, InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput, InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm, InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2} +} + +// InstanceTypeBasicFabricSpecificDetails enumerates the values for instance type basic fabric specific +// details. +type InstanceTypeBasicFabricSpecificDetails string + +const ( + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure InstanceTypeBasicFabricSpecificDetails = "Azure" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails InstanceTypeBasicFabricSpecificDetails = "FabricSpecificDetails" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite InstanceTypeBasicFabricSpecificDetails = "HyperVSite" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicFabricSpecificDetails = "InMageRcm" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM InstanceTypeBasicFabricSpecificDetails = "VMM" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware InstanceTypeBasicFabricSpecificDetails = "VMware" + // InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 ... + InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 InstanceTypeBasicFabricSpecificDetails = "VMwareV2" +) + +// PossibleInstanceTypeBasicFabricSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicFabricSpecificDetails const type. +func PossibleInstanceTypeBasicFabricSpecificDetailsValues() []InstanceTypeBasicFabricSpecificDetails { + return []InstanceTypeBasicFabricSpecificDetails{InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure, InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails, InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite, InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware, InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2} +} + +// InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput enumerates the values for instance type basic +// fabric specific update network mapping input. +type InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput string + +const ( + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "AzureToAzure" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "FabricSpecificUpdateNetworkMappingInput" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "VmmToAzure" + // InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm ... + InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput = "VmmToVmm" +) + +// PossibleInstanceTypeBasicFabricSpecificUpdateNetworkMappingInputValues returns an array of possible values for the InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput const type. +func PossibleInstanceTypeBasicFabricSpecificUpdateNetworkMappingInputValues() []InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput { + return []InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput{InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure, InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm} +} + +// InstanceTypeBasicGroupTaskDetails enumerates the values for instance type basic group task details. +type InstanceTypeBasicGroupTaskDetails string + +const ( + // InstanceTypeGroupTaskDetails ... + InstanceTypeGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "GroupTaskDetails" + // InstanceTypeInlineWorkflowTaskDetails ... + InstanceTypeInlineWorkflowTaskDetails InstanceTypeBasicGroupTaskDetails = "InlineWorkflowTaskDetails" + // InstanceTypeRecoveryPlanGroupTaskDetails ... + InstanceTypeRecoveryPlanGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "RecoveryPlanGroupTaskDetails" + // InstanceTypeRecoveryPlanShutdownGroupTaskDetails ... + InstanceTypeRecoveryPlanShutdownGroupTaskDetails InstanceTypeBasicGroupTaskDetails = "RecoveryPlanShutdownGroupTaskDetails" +) + +// PossibleInstanceTypeBasicGroupTaskDetailsValues returns an array of possible values for the InstanceTypeBasicGroupTaskDetails const type. +func PossibleInstanceTypeBasicGroupTaskDetailsValues() []InstanceTypeBasicGroupTaskDetails { + return []InstanceTypeBasicGroupTaskDetails{InstanceTypeGroupTaskDetails, InstanceTypeInlineWorkflowTaskDetails, InstanceTypeRecoveryPlanGroupTaskDetails, InstanceTypeRecoveryPlanShutdownGroupTaskDetails} +} + +// InstanceTypeBasicJobDetails enumerates the values for instance type basic job details. +type InstanceTypeBasicJobDetails string + +const ( + // InstanceTypeAsrJobDetails ... + InstanceTypeAsrJobDetails InstanceTypeBasicJobDetails = "AsrJobDetails" + // InstanceTypeExportJobDetails ... + InstanceTypeExportJobDetails InstanceTypeBasicJobDetails = "ExportJobDetails" + // InstanceTypeFailoverJobDetails ... + InstanceTypeFailoverJobDetails InstanceTypeBasicJobDetails = "FailoverJobDetails" + // InstanceTypeJobDetails ... + InstanceTypeJobDetails InstanceTypeBasicJobDetails = "JobDetails" + // InstanceTypeSwitchProtectionJobDetails ... + InstanceTypeSwitchProtectionJobDetails InstanceTypeBasicJobDetails = "SwitchProtectionJobDetails" + // InstanceTypeTestFailoverJobDetails ... + InstanceTypeTestFailoverJobDetails InstanceTypeBasicJobDetails = "TestFailoverJobDetails" +) + +// PossibleInstanceTypeBasicJobDetailsValues returns an array of possible values for the InstanceTypeBasicJobDetails const type. +func PossibleInstanceTypeBasicJobDetailsValues() []InstanceTypeBasicJobDetails { + return []InstanceTypeBasicJobDetails{InstanceTypeAsrJobDetails, InstanceTypeExportJobDetails, InstanceTypeFailoverJobDetails, InstanceTypeJobDetails, InstanceTypeSwitchProtectionJobDetails, InstanceTypeTestFailoverJobDetails} +} + +// InstanceTypeBasicMigrateProviderSpecificInput enumerates the values for instance type basic migrate provider +// specific input. +type InstanceTypeBasicMigrateProviderSpecificInput string + +const ( + // InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput ... + InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput InstanceTypeBasicMigrateProviderSpecificInput = "MigrateProviderSpecificInput" + // InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicMigrateProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicMigrateProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicMigrateProviderSpecificInput const type. +func PossibleInstanceTypeBasicMigrateProviderSpecificInputValues() []InstanceTypeBasicMigrateProviderSpecificInput { + return []InstanceTypeBasicMigrateProviderSpecificInput{InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput, InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicMigrationProviderSpecificSettings enumerates the values for instance type basic migration +// provider specific settings. +type InstanceTypeBasicMigrationProviderSpecificSettings string + +const ( + // InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings ... + InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings InstanceTypeBasicMigrationProviderSpecificSettings = "MigrationProviderSpecificSettings" + // InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt ... + InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt InstanceTypeBasicMigrationProviderSpecificSettings = "VMwareCbt" +) + +// PossibleInstanceTypeBasicMigrationProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicMigrationProviderSpecificSettings const type. +func PossibleInstanceTypeBasicMigrationProviderSpecificSettingsValues() []InstanceTypeBasicMigrationProviderSpecificSettings { + return []InstanceTypeBasicMigrationProviderSpecificSettings{InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings, InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicNetworkMappingFabricSpecificSettings enumerates the values for instance type basic network +// mapping fabric specific settings. +type InstanceTypeBasicNetworkMappingFabricSpecificSettings string + +const ( + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure InstanceTypeBasicNetworkMappingFabricSpecificSettings = "AzureToAzure" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings InstanceTypeBasicNetworkMappingFabricSpecificSettings = "NetworkMappingFabricSpecificSettings" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure InstanceTypeBasicNetworkMappingFabricSpecificSettings = "VmmToAzure" + // InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm ... + InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm InstanceTypeBasicNetworkMappingFabricSpecificSettings = "VmmToVmm" +) + +// PossibleInstanceTypeBasicNetworkMappingFabricSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicNetworkMappingFabricSpecificSettings const type. +func PossibleInstanceTypeBasicNetworkMappingFabricSpecificSettingsValues() []InstanceTypeBasicNetworkMappingFabricSpecificSettings { + return []InstanceTypeBasicNetworkMappingFabricSpecificSettings{InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure, InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm} +} + +// InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput enumerates the values for instance type basic +// planned failover provider specific failover input. +type InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput string + +const ( + // InstanceTypeHyperVReplicaAzure ... + InstanceTypeHyperVReplicaAzure InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "HyperVReplicaAzure" + // InstanceTypeHyperVReplicaAzureFailback ... + InstanceTypeHyperVReplicaAzureFailback InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "HyperVReplicaAzureFailback" + // InstanceTypeInMageRcmFailback ... + InstanceTypeInMageRcmFailback InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "InMageRcmFailback" + // InstanceTypePlannedFailoverProviderSpecificFailoverInput ... + InstanceTypePlannedFailoverProviderSpecificFailoverInput InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput = "PlannedFailoverProviderSpecificFailoverInput" +) + +// PossibleInstanceTypeBasicPlannedFailoverProviderSpecificFailoverInputValues returns an array of possible values for the InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput const type. +func PossibleInstanceTypeBasicPlannedFailoverProviderSpecificFailoverInputValues() []InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput { + return []InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput{InstanceTypeHyperVReplicaAzure, InstanceTypeHyperVReplicaAzureFailback, InstanceTypeInMageRcmFailback, InstanceTypePlannedFailoverProviderSpecificFailoverInput} +} + +// InstanceTypeBasicPolicyProviderSpecificDetails enumerates the values for instance type basic policy provider +// specific details. +type InstanceTypeBasicPolicyProviderSpecificDetails string + +const ( + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicPolicyProviderSpecificDetails = "A2A" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplica2012" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplica2012R2" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplicaAzure" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails InstanceTypeBasicPolicyProviderSpecificDetails = "HyperVReplicaBasePolicyDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage InstanceTypeBasicPolicyProviderSpecificDetails = "InMage" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicPolicyProviderSpecificDetails = "InMageAzureV2" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails InstanceTypeBasicPolicyProviderSpecificDetails = "InMageBasePolicyDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicPolicyProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback InstanceTypeBasicPolicyProviderSpecificDetails = "InMageRcmFailback" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails InstanceTypeBasicPolicyProviderSpecificDetails = "PolicyProviderSpecificDetails" + // InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicPolicyProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicPolicyProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicPolicyProviderSpecificDetails const type. +func PossibleInstanceTypeBasicPolicyProviderSpecificDetailsValues() []InstanceTypeBasicPolicyProviderSpecificDetails { + return []InstanceTypeBasicPolicyProviderSpecificDetails{InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails, InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicPolicyProviderSpecificInput enumerates the values for instance type basic policy provider +// specific input. +type InstanceTypeBasicPolicyProviderSpecificInput string + +const ( + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A InstanceTypeBasicPolicyProviderSpecificInput = "A2A" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicPolicyProviderSpecificInput = "A2ACrossClusterMigration" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplica2012" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplica2012R2" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicPolicyProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage InstanceTypeBasicPolicyProviderSpecificInput = "InMage" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicPolicyProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicPolicyProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback InstanceTypeBasicPolicyProviderSpecificInput = "InMageRcmFailback" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput InstanceTypeBasicPolicyProviderSpecificInput = "PolicyProviderSpecificInput" + // InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicPolicyProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicPolicyProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicPolicyProviderSpecificInput const type. +func PossibleInstanceTypeBasicPolicyProviderSpecificInputValues() []InstanceTypeBasicPolicyProviderSpecificInput { + return []InstanceTypeBasicPolicyProviderSpecificInput{InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput, InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails enumerates the values for instance type +// basic protection container mapping provider specific details. +type InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails string + +const ( + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "A2A" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "InMageRcm" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "ProtectionContainerMappingProviderSpecificDetails" + // InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt ... + InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails = "VMwareCbt" +) + +// PossibleInstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails const type. +func PossibleInstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsValues() []InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails { + return []InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails{InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails, InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicProviderSpecificRecoveryPointDetails enumerates the values for instance type basic provider +// specific recovery point details. +type InstanceTypeBasicProviderSpecificRecoveryPointDetails string + +const ( + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A InstanceTypeBasicProviderSpecificRecoveryPointDetails = "A2A" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 InstanceTypeBasicProviderSpecificRecoveryPointDetails = "InMageAzureV2" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm InstanceTypeBasicProviderSpecificRecoveryPointDetails = "InMageRcm" + // InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails ... + InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails InstanceTypeBasicProviderSpecificRecoveryPointDetails = "ProviderSpecificRecoveryPointDetails" +) + +// PossibleInstanceTypeBasicProviderSpecificRecoveryPointDetailsValues returns an array of possible values for the InstanceTypeBasicProviderSpecificRecoveryPointDetails const type. +func PossibleInstanceTypeBasicProviderSpecificRecoveryPointDetailsValues() []InstanceTypeBasicProviderSpecificRecoveryPointDetails { + return []InstanceTypeBasicProviderSpecificRecoveryPointDetails{InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm, InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails} +} + +// InstanceTypeBasicRecoveryPlanActionDetails enumerates the values for instance type basic recovery plan +// action details. +type InstanceTypeBasicRecoveryPlanActionDetails string + +const ( + // InstanceTypeAutomationRunbookActionDetails ... + InstanceTypeAutomationRunbookActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "AutomationRunbookActionDetails" + // InstanceTypeManualActionDetails ... + InstanceTypeManualActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "ManualActionDetails" + // InstanceTypeRecoveryPlanActionDetails ... + InstanceTypeRecoveryPlanActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "RecoveryPlanActionDetails" + // InstanceTypeScriptActionDetails ... + InstanceTypeScriptActionDetails InstanceTypeBasicRecoveryPlanActionDetails = "ScriptActionDetails" +) + +// PossibleInstanceTypeBasicRecoveryPlanActionDetailsValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanActionDetails const type. +func PossibleInstanceTypeBasicRecoveryPlanActionDetailsValues() []InstanceTypeBasicRecoveryPlanActionDetails { + return []InstanceTypeBasicRecoveryPlanActionDetails{InstanceTypeAutomationRunbookActionDetails, InstanceTypeManualActionDetails, InstanceTypeRecoveryPlanActionDetails, InstanceTypeScriptActionDetails} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificDetails enumerates the values for instance type basic recovery +// plan provider specific details. +type InstanceTypeBasicRecoveryPlanProviderSpecificDetails string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificDetails = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails ... + InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails InstanceTypeBasicRecoveryPlanProviderSpecificDetails = "RecoveryPlanProviderSpecificDetails" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificDetails const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificDetailsValues() []InstanceTypeBasicRecoveryPlanProviderSpecificDetails { + return []InstanceTypeBasicRecoveryPlanProviderSpecificDetails{InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput enumerates the values for instance type basic +// recovery plan provider specific failover input. +type InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "HyperVReplicaAzure" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "HyperVReplicaAzureFailback" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMage" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageAzureV2" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageRcm" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "InMageRcmFailback" + // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput ... + InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = "RecoveryPlanProviderSpecificFailoverInput" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputValues() []InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput { + return []InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput{InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback, InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput} +} + +// InstanceTypeBasicRecoveryPlanProviderSpecificInput enumerates the values for instance type basic recovery +// plan provider specific input. +type InstanceTypeBasicRecoveryPlanProviderSpecificInput string + +const ( + // InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificInput = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput ... + InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput InstanceTypeBasicRecoveryPlanProviderSpecificInput = "RecoveryPlanProviderSpecificInput" +) + +// PossibleInstanceTypeBasicRecoveryPlanProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificInput const type. +func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificInputValues() []InstanceTypeBasicRecoveryPlanProviderSpecificInput { + return []InstanceTypeBasicRecoveryPlanProviderSpecificInput{InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput} +} + +// InstanceTypeBasicRemoveDisksProviderSpecificInput enumerates the values for instance type basic remove disks +// provider specific input. +type InstanceTypeBasicRemoveDisksProviderSpecificInput string + +const ( + // InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A InstanceTypeBasicRemoveDisksProviderSpecificInput = "A2A" + // InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput ... + InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput InstanceTypeBasicRemoveDisksProviderSpecificInput = "RemoveDisksProviderSpecificInput" +) + +// PossibleInstanceTypeBasicRemoveDisksProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicRemoveDisksProviderSpecificInput const type. +func PossibleInstanceTypeBasicRemoveDisksProviderSpecificInputValues() []InstanceTypeBasicRemoveDisksProviderSpecificInput { + return []InstanceTypeBasicRemoveDisksProviderSpecificInput{InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput} +} + +// InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings enumerates the values for instance type +// basic replication protection intent provider specific settings. +type InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings string + +const ( + // InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A ... + InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings = "A2A" + // InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings ... + InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings = "ReplicationProtectionIntentProviderSpecificSettings" +) + +// PossibleInstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings const type. +func PossibleInstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsValues() []InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings { + return []InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings{InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A, InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings} +} + +// InstanceTypeBasicReplicationProviderSpecificContainerCreationInput enumerates the values for instance type +// basic replication provider specific container creation input. +type InstanceTypeBasicReplicationProviderSpecificContainerCreationInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "A2ACrossClusterMigration" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "ReplicationProviderSpecificContainerCreationInput" + // InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt ... + InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt InstanceTypeBasicReplicationProviderSpecificContainerCreationInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificContainerCreationInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificContainerCreationInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificContainerCreationInputValues() []InstanceTypeBasicReplicationProviderSpecificContainerCreationInput { + return []InstanceTypeBasicReplicationProviderSpecificContainerCreationInput{InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput, InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReplicationProviderSpecificContainerMappingInput enumerates the values for instance type +// basic replication provider specific container mapping input. +type InstanceTypeBasicReplicationProviderSpecificContainerMappingInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "ReplicationProviderSpecificContainerMappingInput" + // InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt ... + InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt InstanceTypeBasicReplicationProviderSpecificContainerMappingInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificContainerMappingInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificContainerMappingInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificContainerMappingInputValues() []InstanceTypeBasicReplicationProviderSpecificContainerMappingInput { + return []InstanceTypeBasicReplicationProviderSpecificContainerMappingInput{InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput, InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReplicationProviderSpecificSettings enumerates the values for instance type basic +// replication provider specific settings. +type InstanceTypeBasicReplicationProviderSpecificSettings string + +const ( + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificSettings = "A2A" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration InstanceTypeBasicReplicationProviderSpecificSettings = "A2ACrossClusterMigration" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplica2012" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplica2012R2" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplicaAzure" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails InstanceTypeBasicReplicationProviderSpecificSettings = "HyperVReplicaBaseReplicationDetails" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage InstanceTypeBasicReplicationProviderSpecificSettings = "InMage" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 InstanceTypeBasicReplicationProviderSpecificSettings = "InMageAzureV2" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm InstanceTypeBasicReplicationProviderSpecificSettings = "InMageRcm" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback InstanceTypeBasicReplicationProviderSpecificSettings = "InMageRcmFailback" + // InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings ... + InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings InstanceTypeBasicReplicationProviderSpecificSettings = "ReplicationProviderSpecificSettings" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificSettingsValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificSettings const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificSettingsValues() []InstanceTypeBasicReplicationProviderSpecificSettings { + return []InstanceTypeBasicReplicationProviderSpecificSettings{InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback, InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings} +} + +// InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput enumerates the values for instance +// type basic replication provider specific update container mapping input. +type InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput string + +const ( + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "A2A" + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "InMageRcm" + // InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput ... + InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput = "ReplicationProviderSpecificUpdateContainerMappingInput" +) + +// PossibleInstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputValues returns an array of possible values for the InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput const type. +func PossibleInstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputValues() []InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput { + return []InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput{InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A, InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm, InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput} +} + +// InstanceTypeBasicResyncProviderSpecificInput enumerates the values for instance type basic resync provider +// specific input. +type InstanceTypeBasicResyncProviderSpecificInput string + +const ( + // InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput ... + InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput InstanceTypeBasicResyncProviderSpecificInput = "ResyncProviderSpecificInput" + // InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicResyncProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicResyncProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicResyncProviderSpecificInput const type. +func PossibleInstanceTypeBasicResyncProviderSpecificInputValues() []InstanceTypeBasicResyncProviderSpecificInput { + return []InstanceTypeBasicResyncProviderSpecificInput{InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput, InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicReverseReplicationProviderSpecificInput enumerates the values for instance type basic +// reverse replication provider specific input. +type InstanceTypeBasicReverseReplicationProviderSpecificInput string + +const ( + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A InstanceTypeBasicReverseReplicationProviderSpecificInput = "A2A" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicReverseReplicationProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMage" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback InstanceTypeBasicReverseReplicationProviderSpecificInput = "InMageRcmFailback" + // InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput ... + InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput InstanceTypeBasicReverseReplicationProviderSpecificInput = "ReverseReplicationProviderSpecificInput" +) + +// PossibleInstanceTypeBasicReverseReplicationProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicReverseReplicationProviderSpecificInput const type. +func PossibleInstanceTypeBasicReverseReplicationProviderSpecificInputValues() []InstanceTypeBasicReverseReplicationProviderSpecificInput { + return []InstanceTypeBasicReverseReplicationProviderSpecificInput{InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback, InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput} +} + +// InstanceTypeBasicSwitchProtectionProviderSpecificInput enumerates the values for instance type basic switch +// protection provider specific input. +type InstanceTypeBasicSwitchProtectionProviderSpecificInput string + +const ( + // InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A InstanceTypeBasicSwitchProtectionProviderSpecificInput = "A2A" + // InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput ... + InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput InstanceTypeBasicSwitchProtectionProviderSpecificInput = "SwitchProtectionProviderSpecificInput" +) + +// PossibleInstanceTypeBasicSwitchProtectionProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicSwitchProtectionProviderSpecificInput const type. +func PossibleInstanceTypeBasicSwitchProtectionProviderSpecificInputValues() []InstanceTypeBasicSwitchProtectionProviderSpecificInput { + return []InstanceTypeBasicSwitchProtectionProviderSpecificInput{InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput} +} + +// InstanceTypeBasicSwitchProviderProviderSpecificInput enumerates the values for instance type basic switch +// provider provider specific input. +type InstanceTypeBasicSwitchProviderProviderSpecificInput string + +const ( + // InstanceTypeInMageAzureV2 ... + InstanceTypeInMageAzureV2 InstanceTypeBasicSwitchProviderProviderSpecificInput = "InMageAzureV2" + // InstanceTypeSwitchProviderProviderSpecificInput ... + InstanceTypeSwitchProviderProviderSpecificInput InstanceTypeBasicSwitchProviderProviderSpecificInput = "SwitchProviderProviderSpecificInput" +) + +// PossibleInstanceTypeBasicSwitchProviderProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicSwitchProviderProviderSpecificInput const type. +func PossibleInstanceTypeBasicSwitchProviderProviderSpecificInputValues() []InstanceTypeBasicSwitchProviderProviderSpecificInput { + return []InstanceTypeBasicSwitchProviderProviderSpecificInput{InstanceTypeInMageAzureV2, InstanceTypeSwitchProviderProviderSpecificInput} +} + +// InstanceTypeBasicTaskTypeDetails enumerates the values for instance type basic task type details. +type InstanceTypeBasicTaskTypeDetails string + +const ( + // InstanceTypeAutomationRunbookTaskDetails ... + InstanceTypeAutomationRunbookTaskDetails InstanceTypeBasicTaskTypeDetails = "AutomationRunbookTaskDetails" + // InstanceTypeConsistencyCheckTaskDetails ... + InstanceTypeConsistencyCheckTaskDetails InstanceTypeBasicTaskTypeDetails = "ConsistencyCheckTaskDetails" + // InstanceTypeFabricReplicationGroupTaskDetails ... + InstanceTypeFabricReplicationGroupTaskDetails InstanceTypeBasicTaskTypeDetails = "FabricReplicationGroupTaskDetails" + // InstanceTypeJobTaskDetails ... + InstanceTypeJobTaskDetails InstanceTypeBasicTaskTypeDetails = "JobTaskDetails" + // InstanceTypeManualActionTaskDetails ... + InstanceTypeManualActionTaskDetails InstanceTypeBasicTaskTypeDetails = "ManualActionTaskDetails" + // InstanceTypeScriptActionTaskDetails ... + InstanceTypeScriptActionTaskDetails InstanceTypeBasicTaskTypeDetails = "ScriptActionTaskDetails" + // InstanceTypeTaskTypeDetails ... + InstanceTypeTaskTypeDetails InstanceTypeBasicTaskTypeDetails = "TaskTypeDetails" + // InstanceTypeVirtualMachineTaskDetails ... + InstanceTypeVirtualMachineTaskDetails InstanceTypeBasicTaskTypeDetails = "VirtualMachineTaskDetails" + // InstanceTypeVMNicUpdatesTaskDetails ... + InstanceTypeVMNicUpdatesTaskDetails InstanceTypeBasicTaskTypeDetails = "VmNicUpdatesTaskDetails" +) + +// PossibleInstanceTypeBasicTaskTypeDetailsValues returns an array of possible values for the InstanceTypeBasicTaskTypeDetails const type. +func PossibleInstanceTypeBasicTaskTypeDetailsValues() []InstanceTypeBasicTaskTypeDetails { + return []InstanceTypeBasicTaskTypeDetails{InstanceTypeAutomationRunbookTaskDetails, InstanceTypeConsistencyCheckTaskDetails, InstanceTypeFabricReplicationGroupTaskDetails, InstanceTypeJobTaskDetails, InstanceTypeManualActionTaskDetails, InstanceTypeScriptActionTaskDetails, InstanceTypeTaskTypeDetails, InstanceTypeVirtualMachineTaskDetails, InstanceTypeVMNicUpdatesTaskDetails} +} + +// InstanceTypeBasicTestFailoverProviderSpecificInput enumerates the values for instance type basic test +// failover provider specific input. +type InstanceTypeBasicTestFailoverProviderSpecificInput string + +const ( + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A InstanceTypeBasicTestFailoverProviderSpecificInput = "A2A" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicTestFailoverProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage InstanceTypeBasicTestFailoverProviderSpecificInput = "InMage" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicTestFailoverProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicTestFailoverProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput ... + InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput InstanceTypeBasicTestFailoverProviderSpecificInput = "TestFailoverProviderSpecificInput" +) + +// PossibleInstanceTypeBasicTestFailoverProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicTestFailoverProviderSpecificInput const type. +func PossibleInstanceTypeBasicTestFailoverProviderSpecificInputValues() []InstanceTypeBasicTestFailoverProviderSpecificInput { + return []InstanceTypeBasicTestFailoverProviderSpecificInput{InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput} +} + +// InstanceTypeBasicTestMigrateProviderSpecificInput enumerates the values for instance type basic test migrate +// provider specific input. +type InstanceTypeBasicTestMigrateProviderSpecificInput string + +const ( + // InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput ... + InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput InstanceTypeBasicTestMigrateProviderSpecificInput = "TestMigrateProviderSpecificInput" + // InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicTestMigrateProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicTestMigrateProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicTestMigrateProviderSpecificInput const type. +func PossibleInstanceTypeBasicTestMigrateProviderSpecificInputValues() []InstanceTypeBasicTestMigrateProviderSpecificInput { + return []InstanceTypeBasicTestMigrateProviderSpecificInput{InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput, InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicUnplannedFailoverProviderSpecificInput enumerates the values for instance type basic +// unplanned failover provider specific input. +type InstanceTypeBasicUnplannedFailoverProviderSpecificInput string + +const ( + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "A2A" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "HyperVReplicaAzure" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMage" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMageAzureV2" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput ... + InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput InstanceTypeBasicUnplannedFailoverProviderSpecificInput = "UnplannedFailoverProviderSpecificInput" +) + +// PossibleInstanceTypeBasicUnplannedFailoverProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUnplannedFailoverProviderSpecificInput const type. +func PossibleInstanceTypeBasicUnplannedFailoverProviderSpecificInputValues() []InstanceTypeBasicUnplannedFailoverProviderSpecificInput { + return []InstanceTypeBasicUnplannedFailoverProviderSpecificInput{InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput} +} + +// InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput enumerates the values for +// instance type basic update appliance for replication protected item provider specific input. +type InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput string + +const ( + // InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm ... + InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput = "InMageRcm" + // InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput ... + InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput = "UpdateApplianceForReplicationProtectedItemProviderSpecificInput" +) + +// PossibleInstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput const type. +func PossibleInstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputValues() []InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput { + return []InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput{InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm, InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput} +} + +// InstanceTypeBasicUpdateMigrationItemProviderSpecificInput enumerates the values for instance type basic +// update migration item provider specific input. +type InstanceTypeBasicUpdateMigrationItemProviderSpecificInput string + +const ( + // InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput ... + InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput InstanceTypeBasicUpdateMigrationItemProviderSpecificInput = "UpdateMigrationItemProviderSpecificInput" + // InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt ... + InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt InstanceTypeBasicUpdateMigrationItemProviderSpecificInput = "VMwareCbt" +) + +// PossibleInstanceTypeBasicUpdateMigrationItemProviderSpecificInputValues returns an array of possible values for the InstanceTypeBasicUpdateMigrationItemProviderSpecificInput const type. +func PossibleInstanceTypeBasicUpdateMigrationItemProviderSpecificInputValues() []InstanceTypeBasicUpdateMigrationItemProviderSpecificInput { + return []InstanceTypeBasicUpdateMigrationItemProviderSpecificInput{InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput, InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt} +} + +// InstanceTypeBasicUpdateReplicationProtectedItemProviderInput enumerates the values for instance type basic +// update replication protected item provider input. +type InstanceTypeBasicUpdateReplicationProtectedItemProviderInput string + +const ( + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "A2A" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "HyperVReplicaAzure" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "InMageAzureV2" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "InMageRcm" + // InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput ... + InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput InstanceTypeBasicUpdateReplicationProtectedItemProviderInput = "UpdateReplicationProtectedItemProviderInput" +) + +// PossibleInstanceTypeBasicUpdateReplicationProtectedItemProviderInputValues returns an array of possible values for the InstanceTypeBasicUpdateReplicationProtectedItemProviderInput const type. +func PossibleInstanceTypeBasicUpdateReplicationProtectedItemProviderInputValues() []InstanceTypeBasicUpdateReplicationProtectedItemProviderInput { + return []InstanceTypeBasicUpdateReplicationProtectedItemProviderInput{InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm, InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput} +} + +// LicenseType enumerates the values for license type. +type LicenseType string + +const ( + // LicenseTypeNoLicenseType ... + LicenseTypeNoLicenseType LicenseType = "NoLicenseType" + // LicenseTypeNotSpecified ... + LicenseTypeNotSpecified LicenseType = "NotSpecified" + // LicenseTypeWindowsServer ... + LicenseTypeWindowsServer LicenseType = "WindowsServer" +) + +// PossibleLicenseTypeValues returns an array of possible values for the LicenseType const type. +func PossibleLicenseTypeValues() []LicenseType { + return []LicenseType{LicenseTypeNoLicenseType, LicenseTypeNotSpecified, LicenseTypeWindowsServer} +} + +// MigrationItemOperation enumerates the values for migration item operation. +type MigrationItemOperation string + +const ( + // DisableMigration ... + DisableMigration MigrationItemOperation = "DisableMigration" + // Migrate ... + Migrate MigrationItemOperation = "Migrate" + // StartResync ... + StartResync MigrationItemOperation = "StartResync" + // TestMigrate ... + TestMigrate MigrationItemOperation = "TestMigrate" + // TestMigrateCleanup ... + TestMigrateCleanup MigrationItemOperation = "TestMigrateCleanup" +) + +// PossibleMigrationItemOperationValues returns an array of possible values for the MigrationItemOperation const type. +func PossibleMigrationItemOperationValues() []MigrationItemOperation { + return []MigrationItemOperation{DisableMigration, Migrate, StartResync, TestMigrate, TestMigrateCleanup} +} + +// MigrationRecoveryPointType enumerates the values for migration recovery point type. +type MigrationRecoveryPointType string + +const ( + // MigrationRecoveryPointTypeApplicationConsistent ... + MigrationRecoveryPointTypeApplicationConsistent MigrationRecoveryPointType = "ApplicationConsistent" + // MigrationRecoveryPointTypeCrashConsistent ... + MigrationRecoveryPointTypeCrashConsistent MigrationRecoveryPointType = "CrashConsistent" + // MigrationRecoveryPointTypeNotSpecified ... + MigrationRecoveryPointTypeNotSpecified MigrationRecoveryPointType = "NotSpecified" +) + +// PossibleMigrationRecoveryPointTypeValues returns an array of possible values for the MigrationRecoveryPointType const type. +func PossibleMigrationRecoveryPointTypeValues() []MigrationRecoveryPointType { + return []MigrationRecoveryPointType{MigrationRecoveryPointTypeApplicationConsistent, MigrationRecoveryPointTypeCrashConsistent, MigrationRecoveryPointTypeNotSpecified} +} + +// MigrationState enumerates the values for migration state. +type MigrationState string + +const ( + // MigrationStateDisableMigrationFailed ... + MigrationStateDisableMigrationFailed MigrationState = "DisableMigrationFailed" + // MigrationStateDisableMigrationInProgress ... + MigrationStateDisableMigrationInProgress MigrationState = "DisableMigrationInProgress" + // MigrationStateEnableMigrationFailed ... + MigrationStateEnableMigrationFailed MigrationState = "EnableMigrationFailed" + // MigrationStateEnableMigrationInProgress ... + MigrationStateEnableMigrationInProgress MigrationState = "EnableMigrationInProgress" + // MigrationStateInitialSeedingFailed ... + MigrationStateInitialSeedingFailed MigrationState = "InitialSeedingFailed" + // MigrationStateInitialSeedingInProgress ... + MigrationStateInitialSeedingInProgress MigrationState = "InitialSeedingInProgress" + // MigrationStateMigrationFailed ... + MigrationStateMigrationFailed MigrationState = "MigrationFailed" + // MigrationStateMigrationInProgress ... + MigrationStateMigrationInProgress MigrationState = "MigrationInProgress" + // MigrationStateMigrationSucceeded ... + MigrationStateMigrationSucceeded MigrationState = "MigrationSucceeded" + // MigrationStateNone ... + MigrationStateNone MigrationState = "None" + // MigrationStateReplicating ... + MigrationStateReplicating MigrationState = "Replicating" +) + +// PossibleMigrationStateValues returns an array of possible values for the MigrationState const type. +func PossibleMigrationStateValues() []MigrationState { + return []MigrationState{MigrationStateDisableMigrationFailed, MigrationStateDisableMigrationInProgress, MigrationStateEnableMigrationFailed, MigrationStateEnableMigrationInProgress, MigrationStateInitialSeedingFailed, MigrationStateInitialSeedingInProgress, MigrationStateMigrationFailed, MigrationStateMigrationInProgress, MigrationStateMigrationSucceeded, MigrationStateNone, MigrationStateReplicating} +} + +// MobilityAgentUpgradeState enumerates the values for mobility agent upgrade state. +type MobilityAgentUpgradeState string + +const ( + // MobilityAgentUpgradeStateCommit ... + MobilityAgentUpgradeStateCommit MobilityAgentUpgradeState = "Commit" + // MobilityAgentUpgradeStateCompleted ... + MobilityAgentUpgradeStateCompleted MobilityAgentUpgradeState = "Completed" + // MobilityAgentUpgradeStateNone ... + MobilityAgentUpgradeStateNone MobilityAgentUpgradeState = "None" + // MobilityAgentUpgradeStateStarted ... + MobilityAgentUpgradeStateStarted MobilityAgentUpgradeState = "Started" +) + +// PossibleMobilityAgentUpgradeStateValues returns an array of possible values for the MobilityAgentUpgradeState const type. +func PossibleMobilityAgentUpgradeStateValues() []MobilityAgentUpgradeState { + return []MobilityAgentUpgradeState{MobilityAgentUpgradeStateCommit, MobilityAgentUpgradeStateCompleted, MobilityAgentUpgradeStateNone, MobilityAgentUpgradeStateStarted} +} + +// MultiVMGroupCreateOption enumerates the values for multi vm group create option. +type MultiVMGroupCreateOption string + +const ( + // AutoCreated ... + AutoCreated MultiVMGroupCreateOption = "AutoCreated" + // UserSpecified ... + UserSpecified MultiVMGroupCreateOption = "UserSpecified" +) + +// PossibleMultiVMGroupCreateOptionValues returns an array of possible values for the MultiVMGroupCreateOption const type. +func PossibleMultiVMGroupCreateOptionValues() []MultiVMGroupCreateOption { + return []MultiVMGroupCreateOption{AutoCreated, UserSpecified} +} + +// MultiVMSyncPointOption enumerates the values for multi vm sync point option. +type MultiVMSyncPointOption string + +const ( + // UseMultiVMSyncRecoveryPoint ... + UseMultiVMSyncRecoveryPoint MultiVMSyncPointOption = "UseMultiVmSyncRecoveryPoint" + // UsePerVMRecoveryPoint ... + UsePerVMRecoveryPoint MultiVMSyncPointOption = "UsePerVmRecoveryPoint" +) + +// PossibleMultiVMSyncPointOptionValues returns an array of possible values for the MultiVMSyncPointOption const type. +func PossibleMultiVMSyncPointOptionValues() []MultiVMSyncPointOption { + return []MultiVMSyncPointOption{UseMultiVMSyncRecoveryPoint, UsePerVMRecoveryPoint} +} + +// PlannedFailoverStatus enumerates the values for planned failover status. +type PlannedFailoverStatus string + +const ( + // PlannedFailoverStatusCancelled ... + PlannedFailoverStatusCancelled PlannedFailoverStatus = "Cancelled" + // PlannedFailoverStatusFailed ... + PlannedFailoverStatusFailed PlannedFailoverStatus = "Failed" + // PlannedFailoverStatusSucceeded ... + PlannedFailoverStatusSucceeded PlannedFailoverStatus = "Succeeded" + // PlannedFailoverStatusUnknown ... + PlannedFailoverStatusUnknown PlannedFailoverStatus = "Unknown" +) + +// PossiblePlannedFailoverStatusValues returns an array of possible values for the PlannedFailoverStatus const type. +func PossiblePlannedFailoverStatusValues() []PlannedFailoverStatus { + return []PlannedFailoverStatus{PlannedFailoverStatusCancelled, PlannedFailoverStatusFailed, PlannedFailoverStatusSucceeded, PlannedFailoverStatusUnknown} +} + +// PossibleOperationsDirections enumerates the values for possible operations directions. +type PossibleOperationsDirections string + +const ( + // PrimaryToRecovery ... + PrimaryToRecovery PossibleOperationsDirections = "PrimaryToRecovery" + // RecoveryToPrimary ... + RecoveryToPrimary PossibleOperationsDirections = "RecoveryToPrimary" +) + +// PossiblePossibleOperationsDirectionsValues returns an array of possible values for the PossibleOperationsDirections const type. +func PossiblePossibleOperationsDirectionsValues() []PossibleOperationsDirections { + return []PossibleOperationsDirections{PrimaryToRecovery, RecoveryToPrimary} +} + +// PresenceStatus enumerates the values for presence status. +type PresenceStatus string + +const ( + // PresenceStatusNotPresent ... + PresenceStatusNotPresent PresenceStatus = "NotPresent" + // PresenceStatusPresent ... + PresenceStatusPresent PresenceStatus = "Present" + // PresenceStatusUnknown ... + PresenceStatusUnknown PresenceStatus = "Unknown" +) + +// PossiblePresenceStatusValues returns an array of possible values for the PresenceStatus const type. +func PossiblePresenceStatusValues() []PresenceStatus { + return []PresenceStatus{PresenceStatusNotPresent, PresenceStatusPresent, PresenceStatusUnknown} +} + +// ProtectionHealth enumerates the values for protection health. +type ProtectionHealth string + +const ( + // ProtectionHealthCritical ... + ProtectionHealthCritical ProtectionHealth = "Critical" + // ProtectionHealthNone ... + ProtectionHealthNone ProtectionHealth = "None" + // ProtectionHealthNormal ... + ProtectionHealthNormal ProtectionHealth = "Normal" + // ProtectionHealthWarning ... + ProtectionHealthWarning ProtectionHealth = "Warning" +) + +// PossibleProtectionHealthValues returns an array of possible values for the ProtectionHealth const type. +func PossibleProtectionHealthValues() []ProtectionHealth { + return []ProtectionHealth{ProtectionHealthCritical, ProtectionHealthNone, ProtectionHealthNormal, ProtectionHealthWarning} +} + +// RcmComponentStatus enumerates the values for rcm component status. +type RcmComponentStatus string + +const ( + // RcmComponentStatusCritical ... + RcmComponentStatusCritical RcmComponentStatus = "Critical" + // RcmComponentStatusHealthy ... + RcmComponentStatusHealthy RcmComponentStatus = "Healthy" + // RcmComponentStatusUnknown ... + RcmComponentStatusUnknown RcmComponentStatus = "Unknown" + // RcmComponentStatusWarning ... + RcmComponentStatusWarning RcmComponentStatus = "Warning" +) + +// PossibleRcmComponentStatusValues returns an array of possible values for the RcmComponentStatus const type. +func PossibleRcmComponentStatusValues() []RcmComponentStatus { + return []RcmComponentStatus{RcmComponentStatusCritical, RcmComponentStatusHealthy, RcmComponentStatusUnknown, RcmComponentStatusWarning} +} + +// RecoveryPlanActionLocation enumerates the values for recovery plan action location. +type RecoveryPlanActionLocation string + +const ( + // Primary ... + Primary RecoveryPlanActionLocation = "Primary" + // Recovery ... + Recovery RecoveryPlanActionLocation = "Recovery" +) + +// PossibleRecoveryPlanActionLocationValues returns an array of possible values for the RecoveryPlanActionLocation const type. +func PossibleRecoveryPlanActionLocationValues() []RecoveryPlanActionLocation { + return []RecoveryPlanActionLocation{Primary, Recovery} +} + +// RecoveryPlanGroupType enumerates the values for recovery plan group type. +type RecoveryPlanGroupType string + +const ( + // Boot ... + Boot RecoveryPlanGroupType = "Boot" + // Failover ... + Failover RecoveryPlanGroupType = "Failover" + // Shutdown ... + Shutdown RecoveryPlanGroupType = "Shutdown" +) + +// PossibleRecoveryPlanGroupTypeValues returns an array of possible values for the RecoveryPlanGroupType const type. +func PossibleRecoveryPlanGroupTypeValues() []RecoveryPlanGroupType { + return []RecoveryPlanGroupType{Boot, Failover, Shutdown} +} + +// RecoveryPlanPointType enumerates the values for recovery plan point type. +type RecoveryPlanPointType string + +const ( + // RecoveryPlanPointTypeLatest ... + RecoveryPlanPointTypeLatest RecoveryPlanPointType = "Latest" + // RecoveryPlanPointTypeLatestApplicationConsistent ... + RecoveryPlanPointTypeLatestApplicationConsistent RecoveryPlanPointType = "LatestApplicationConsistent" + // RecoveryPlanPointTypeLatestCrashConsistent ... + RecoveryPlanPointTypeLatestCrashConsistent RecoveryPlanPointType = "LatestCrashConsistent" + // RecoveryPlanPointTypeLatestProcessed ... + RecoveryPlanPointTypeLatestProcessed RecoveryPlanPointType = "LatestProcessed" +) + +// PossibleRecoveryPlanPointTypeValues returns an array of possible values for the RecoveryPlanPointType const type. +func PossibleRecoveryPlanPointTypeValues() []RecoveryPlanPointType { + return []RecoveryPlanPointType{RecoveryPlanPointTypeLatest, RecoveryPlanPointTypeLatestApplicationConsistent, RecoveryPlanPointTypeLatestCrashConsistent, RecoveryPlanPointTypeLatestProcessed} +} + +// RecoveryPointSyncType enumerates the values for recovery point sync type. +type RecoveryPointSyncType string + +const ( + // MultiVMSyncRecoveryPoint ... + MultiVMSyncRecoveryPoint RecoveryPointSyncType = "MultiVmSyncRecoveryPoint" + // PerVMRecoveryPoint ... + PerVMRecoveryPoint RecoveryPointSyncType = "PerVmRecoveryPoint" +) + +// PossibleRecoveryPointSyncTypeValues returns an array of possible values for the RecoveryPointSyncType const type. +func PossibleRecoveryPointSyncTypeValues() []RecoveryPointSyncType { + return []RecoveryPointSyncType{MultiVMSyncRecoveryPoint, PerVMRecoveryPoint} +} + +// RecoveryPointType enumerates the values for recovery point type. +type RecoveryPointType string + +const ( + // Custom ... + Custom RecoveryPointType = "Custom" + // LatestTag ... + LatestTag RecoveryPointType = "LatestTag" + // LatestTime ... + LatestTime RecoveryPointType = "LatestTime" +) + +// PossibleRecoveryPointTypeValues returns an array of possible values for the RecoveryPointType const type. +func PossibleRecoveryPointTypeValues() []RecoveryPointType { + return []RecoveryPointType{Custom, LatestTag, LatestTime} +} + +// ReplicationProtectedItemOperation enumerates the values for replication protected item operation. +type ReplicationProtectedItemOperation string + +const ( + // CancelFailover ... + CancelFailover ReplicationProtectedItemOperation = "CancelFailover" + // ChangePit ... + ChangePit ReplicationProtectedItemOperation = "ChangePit" + // Commit ... + Commit ReplicationProtectedItemOperation = "Commit" + // CompleteMigration ... + CompleteMigration ReplicationProtectedItemOperation = "CompleteMigration" + // DisableProtection ... + DisableProtection ReplicationProtectedItemOperation = "DisableProtection" + // Failback ... + Failback ReplicationProtectedItemOperation = "Failback" + // FinalizeFailback ... + FinalizeFailback ReplicationProtectedItemOperation = "FinalizeFailback" + // PlannedFailover ... + PlannedFailover ReplicationProtectedItemOperation = "PlannedFailover" + // RepairReplication ... + RepairReplication ReplicationProtectedItemOperation = "RepairReplication" + // ReverseReplicate ... + ReverseReplicate ReplicationProtectedItemOperation = "ReverseReplicate" + // SwitchProtection ... + SwitchProtection ReplicationProtectedItemOperation = "SwitchProtection" + // TestFailover ... + TestFailover ReplicationProtectedItemOperation = "TestFailover" + // TestFailoverCleanup ... + TestFailoverCleanup ReplicationProtectedItemOperation = "TestFailoverCleanup" + // UnplannedFailover ... + UnplannedFailover ReplicationProtectedItemOperation = "UnplannedFailover" +) + +// PossibleReplicationProtectedItemOperationValues returns an array of possible values for the ReplicationProtectedItemOperation const type. +func PossibleReplicationProtectedItemOperationValues() []ReplicationProtectedItemOperation { + return []ReplicationProtectedItemOperation{CancelFailover, ChangePit, Commit, CompleteMigration, DisableProtection, Failback, FinalizeFailback, PlannedFailover, RepairReplication, ReverseReplicate, SwitchProtection, TestFailover, TestFailoverCleanup, UnplannedFailover} +} + +// ResourceType enumerates the values for resource type. +type ResourceType string + +const ( + // ResourceTypeExisting ... + ResourceTypeExisting ResourceType = "Existing" + // ResourceTypeNew ... + ResourceTypeNew ResourceType = "New" + // ResourceTypeProtectionProfileCustomDetails ... + ResourceTypeProtectionProfileCustomDetails ResourceType = "ProtectionProfileCustomDetails" +) + +// PossibleResourceTypeValues returns an array of possible values for the ResourceType const type. +func PossibleResourceTypeValues() []ResourceType { + return []ResourceType{ResourceTypeExisting, ResourceTypeNew, ResourceTypeProtectionProfileCustomDetails} +} + +// ResourceTypeBasicRecoveryAvailabilitySetCustomDetails enumerates the values for resource type basic recovery +// availability set custom details. +type ResourceTypeBasicRecoveryAvailabilitySetCustomDetails string + +const ( + // ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryAvailabilitySetCustomDetails = "Existing" + // ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails ... + ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails ResourceTypeBasicRecoveryAvailabilitySetCustomDetails = "RecoveryAvailabilitySetCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryAvailabilitySetCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryAvailabilitySetCustomDetails const type. +func PossibleResourceTypeBasicRecoveryAvailabilitySetCustomDetailsValues() []ResourceTypeBasicRecoveryAvailabilitySetCustomDetails { + return []ResourceTypeBasicRecoveryAvailabilitySetCustomDetails{ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails} +} + +// ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails enumerates the values for resource type basic +// recovery proximity placement group custom details. +type ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails string + +const ( + // ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails = "Existing" + // ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails ... + ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails = "RecoveryProximityPlacementGroupCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails const type. +func PossibleResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsValues() []ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails { + return []ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails{ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails} +} + +// ResourceTypeBasicRecoveryResourceGroupCustomDetails enumerates the values for resource type basic recovery +// resource group custom details. +type ResourceTypeBasicRecoveryResourceGroupCustomDetails string + +const ( + // ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryResourceGroupCustomDetails = "Existing" + // ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails ... + ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails ResourceTypeBasicRecoveryResourceGroupCustomDetails = "RecoveryResourceGroupCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryResourceGroupCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryResourceGroupCustomDetails const type. +func PossibleResourceTypeBasicRecoveryResourceGroupCustomDetailsValues() []ResourceTypeBasicRecoveryResourceGroupCustomDetails { + return []ResourceTypeBasicRecoveryResourceGroupCustomDetails{ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails} +} + +// ResourceTypeBasicRecoveryVirtualNetworkCustomDetails enumerates the values for resource type basic recovery +// virtual network custom details. +type ResourceTypeBasicRecoveryVirtualNetworkCustomDetails string + +const ( + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "Existing" + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "New" + // ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails ... + ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails ResourceTypeBasicRecoveryVirtualNetworkCustomDetails = "RecoveryVirtualNetworkCustomDetails" +) + +// PossibleResourceTypeBasicRecoveryVirtualNetworkCustomDetailsValues returns an array of possible values for the ResourceTypeBasicRecoveryVirtualNetworkCustomDetails const type. +func PossibleResourceTypeBasicRecoveryVirtualNetworkCustomDetailsValues() []ResourceTypeBasicRecoveryVirtualNetworkCustomDetails { + return []ResourceTypeBasicRecoveryVirtualNetworkCustomDetails{ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting, ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew, ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails} +} + +// ResourceTypeBasicStorageAccountCustomDetails enumerates the values for resource type basic storage account +// custom details. +type ResourceTypeBasicStorageAccountCustomDetails string + +const ( + // ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting ... + ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting ResourceTypeBasicStorageAccountCustomDetails = "Existing" + // ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails ... + ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails ResourceTypeBasicStorageAccountCustomDetails = "StorageAccountCustomDetails" +) + +// PossibleResourceTypeBasicStorageAccountCustomDetailsValues returns an array of possible values for the ResourceTypeBasicStorageAccountCustomDetails const type. +func PossibleResourceTypeBasicStorageAccountCustomDetailsValues() []ResourceTypeBasicStorageAccountCustomDetails { + return []ResourceTypeBasicStorageAccountCustomDetails{ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting, ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails} +} + +// ResyncState enumerates the values for resync state. +type ResyncState string + +const ( + // ResyncStateNone ... + ResyncStateNone ResyncState = "None" + // ResyncStatePreparedForResynchronization ... + ResyncStatePreparedForResynchronization ResyncState = "PreparedForResynchronization" + // ResyncStateStartedResynchronization ... + ResyncStateStartedResynchronization ResyncState = "StartedResynchronization" +) + +// PossibleResyncStateValues returns an array of possible values for the ResyncState const type. +func PossibleResyncStateValues() []ResyncState { + return []ResyncState{ResyncStateNone, ResyncStatePreparedForResynchronization, ResyncStateStartedResynchronization} +} + +// RpInMageRecoveryPointType enumerates the values for rp in mage recovery point type. +type RpInMageRecoveryPointType string + +const ( + // RpInMageRecoveryPointTypeCustom ... + RpInMageRecoveryPointTypeCustom RpInMageRecoveryPointType = "Custom" + // RpInMageRecoveryPointTypeLatestTag ... + RpInMageRecoveryPointTypeLatestTag RpInMageRecoveryPointType = "LatestTag" + // RpInMageRecoveryPointTypeLatestTime ... + RpInMageRecoveryPointTypeLatestTime RpInMageRecoveryPointType = "LatestTime" +) + +// PossibleRpInMageRecoveryPointTypeValues returns an array of possible values for the RpInMageRecoveryPointType const type. +func PossibleRpInMageRecoveryPointTypeValues() []RpInMageRecoveryPointType { + return []RpInMageRecoveryPointType{RpInMageRecoveryPointTypeCustom, RpInMageRecoveryPointTypeLatestTag, RpInMageRecoveryPointTypeLatestTime} +} + +// SetMultiVMSyncStatus enumerates the values for set multi vm sync status. +type SetMultiVMSyncStatus string + +const ( + // Disable ... + Disable SetMultiVMSyncStatus = "Disable" + // Enable ... + Enable SetMultiVMSyncStatus = "Enable" +) + +// PossibleSetMultiVMSyncStatusValues returns an array of possible values for the SetMultiVMSyncStatus const type. +func PossibleSetMultiVMSyncStatusValues() []SetMultiVMSyncStatus { + return []SetMultiVMSyncStatus{Disable, Enable} +} + +// Severity enumerates the values for severity. +type Severity string + +const ( + // Error ... + Error Severity = "Error" + // Info ... + Info Severity = "Info" + // NONE ... + NONE Severity = "NONE" + // Warning ... + Warning Severity = "Warning" +) + +// PossibleSeverityValues returns an array of possible values for the Severity const type. +func PossibleSeverityValues() []Severity { + return []Severity{Error, Info, NONE, Warning} +} + +// SourceSiteOperations enumerates the values for source site operations. +type SourceSiteOperations string + +const ( + // NotRequired ... + NotRequired SourceSiteOperations = "NotRequired" + // Required ... + Required SourceSiteOperations = "Required" +) + +// PossibleSourceSiteOperationsValues returns an array of possible values for the SourceSiteOperations const type. +func PossibleSourceSiteOperationsValues() []SourceSiteOperations { + return []SourceSiteOperations{NotRequired, Required} +} + +// SQLServerLicenseType enumerates the values for sql server license type. +type SQLServerLicenseType string + +const ( + // SQLServerLicenseTypeAHUB ... + SQLServerLicenseTypeAHUB SQLServerLicenseType = "AHUB" + // SQLServerLicenseTypeNoLicenseType ... + SQLServerLicenseTypeNoLicenseType SQLServerLicenseType = "NoLicenseType" + // SQLServerLicenseTypeNotSpecified ... + SQLServerLicenseTypeNotSpecified SQLServerLicenseType = "NotSpecified" + // SQLServerLicenseTypePAYG ... + SQLServerLicenseTypePAYG SQLServerLicenseType = "PAYG" +) + +// PossibleSQLServerLicenseTypeValues returns an array of possible values for the SQLServerLicenseType const type. +func PossibleSQLServerLicenseTypeValues() []SQLServerLicenseType { + return []SQLServerLicenseType{SQLServerLicenseTypeAHUB, SQLServerLicenseTypeNoLicenseType, SQLServerLicenseTypeNotSpecified, SQLServerLicenseTypePAYG} +} + +// TestMigrationState enumerates the values for test migration state. +type TestMigrationState string + +const ( + // TestMigrationStateNone ... + TestMigrationStateNone TestMigrationState = "None" + // TestMigrationStateTestMigrationCleanupInProgress ... + TestMigrationStateTestMigrationCleanupInProgress TestMigrationState = "TestMigrationCleanupInProgress" + // TestMigrationStateTestMigrationFailed ... + TestMigrationStateTestMigrationFailed TestMigrationState = "TestMigrationFailed" + // TestMigrationStateTestMigrationInProgress ... + TestMigrationStateTestMigrationInProgress TestMigrationState = "TestMigrationInProgress" + // TestMigrationStateTestMigrationSucceeded ... + TestMigrationStateTestMigrationSucceeded TestMigrationState = "TestMigrationSucceeded" +) + +// PossibleTestMigrationStateValues returns an array of possible values for the TestMigrationState const type. +func PossibleTestMigrationStateValues() []TestMigrationState { + return []TestMigrationState{TestMigrationStateNone, TestMigrationStateTestMigrationCleanupInProgress, TestMigrationStateTestMigrationFailed, TestMigrationStateTestMigrationInProgress, TestMigrationStateTestMigrationSucceeded} +} + +// VMEncryptionType enumerates the values for vm encryption type. +type VMEncryptionType string + +const ( + // NotEncrypted ... + NotEncrypted VMEncryptionType = "NotEncrypted" + // OnePassEncrypted ... + OnePassEncrypted VMEncryptionType = "OnePassEncrypted" + // TwoPassEncrypted ... + TwoPassEncrypted VMEncryptionType = "TwoPassEncrypted" +) + +// PossibleVMEncryptionTypeValues returns an array of possible values for the VMEncryptionType const type. +func PossibleVMEncryptionTypeValues() []VMEncryptionType { + return []VMEncryptionType{NotEncrypted, OnePassEncrypted, TwoPassEncrypted} +} + +// VMReplicationProgressHealth enumerates the values for vm replication progress health. +type VMReplicationProgressHealth string + +const ( + // VMReplicationProgressHealthInProgress ... + VMReplicationProgressHealthInProgress VMReplicationProgressHealth = "InProgress" + // VMReplicationProgressHealthNone ... + VMReplicationProgressHealthNone VMReplicationProgressHealth = "None" + // VMReplicationProgressHealthNoProgress ... + VMReplicationProgressHealthNoProgress VMReplicationProgressHealth = "NoProgress" + // VMReplicationProgressHealthSlowProgress ... + VMReplicationProgressHealthSlowProgress VMReplicationProgressHealth = "SlowProgress" +) + +// PossibleVMReplicationProgressHealthValues returns an array of possible values for the VMReplicationProgressHealth const type. +func PossibleVMReplicationProgressHealthValues() []VMReplicationProgressHealth { + return []VMReplicationProgressHealth{VMReplicationProgressHealthInProgress, VMReplicationProgressHealthNone, VMReplicationProgressHealthNoProgress, VMReplicationProgressHealthSlowProgress} +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/migrationrecoverypoints.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/migrationrecoverypoints.go new file mode 100644 index 000000000000..832b7a7cb9fa --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/migrationrecoverypoints.go @@ -0,0 +1,236 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// MigrationRecoveryPointsClient is the client for the MigrationRecoveryPoints methods of the Siterecovery service. +type MigrationRecoveryPointsClient struct { + BaseClient +} + +// NewMigrationRecoveryPointsClient creates an instance of the MigrationRecoveryPointsClient client. +func NewMigrationRecoveryPointsClient(subscriptionID string, resourceGroupName string, resourceName string) MigrationRecoveryPointsClient { + return NewMigrationRecoveryPointsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewMigrationRecoveryPointsClientWithBaseURI creates an instance of the MigrationRecoveryPointsClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewMigrationRecoveryPointsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) MigrationRecoveryPointsClient { + return MigrationRecoveryPointsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get sends the get request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// migrationRecoveryPointName - the migration recovery point name. +func (client MigrationRecoveryPointsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (result MigrationRecoveryPoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, migrationItemName, migrationRecoveryPointName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client MigrationRecoveryPointsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "migrationRecoveryPointName": autorest.Encode("path", migrationRecoveryPointName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints/{migrationRecoveryPointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client MigrationRecoveryPointsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client MigrationRecoveryPointsClient) GetResponder(resp *http.Response) (result MigrationRecoveryPoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationMigrationItems sends the list by replication migration items request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItems(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationRecoveryPointCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.ListByReplicationMigrationItems") + defer func() { + sc := -1 + if result.mrpc.Response.Response != nil { + sc = result.mrpc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationMigrationItemsNextResults + req, err := client.ListByReplicationMigrationItemsPreparer(ctx, fabricName, protectionContainerName, migrationItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationMigrationItemsSender(req) + if err != nil { + result.mrpc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", resp, "Failure sending request") + return + } + + result.mrpc, err = client.ListByReplicationMigrationItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "ListByReplicationMigrationItems", resp, "Failure responding to request") + return + } + if result.mrpc.hasNextLink() && result.mrpc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationMigrationItemsPreparer prepares the ListByReplicationMigrationItems request. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationMigrationItemsSender sends the ListByReplicationMigrationItems request. The method will close the +// http.Response Body if it receives an error. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationMigrationItemsResponder handles the response to the ListByReplicationMigrationItems request. The method always +// closes the http.Response Body. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsResponder(resp *http.Response) (result MigrationRecoveryPointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationMigrationItemsNextResults retrieves the next set of results, if any. +func (client MigrationRecoveryPointsClient) listByReplicationMigrationItemsNextResults(ctx context.Context, lastResults MigrationRecoveryPointCollection) (result MigrationRecoveryPointCollection, err error) { + req, err := lastResults.migrationRecoveryPointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationMigrationItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationMigrationItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.MigrationRecoveryPointsClient", "listByReplicationMigrationItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationMigrationItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client MigrationRecoveryPointsClient) ListByReplicationMigrationItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationRecoveryPointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointsClient.ListByReplicationMigrationItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationMigrationItems(ctx, fabricName, protectionContainerName, migrationItemName) + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/models.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/models.go new file mode 100644 index 000000000000..dfd0bc1b5810 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/models.go @@ -0,0 +1,33227 @@ +package siterecovery + +// 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. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2022-02-01/siterecovery" + +// A2AAddDisksInput a2A add disk(s) input. +type A2AAddDisksInput struct { + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeAddDisksProviderSpecificInput', 'InstanceTypeA2A' + InstanceType InstanceType `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AAddDisksInput. +func (aadi A2AAddDisksInput) MarshalJSON() ([]byte, error) { + aadi.InstanceType = InstanceTypeA2A + objectMap := make(map[string]interface{}) + if aadi.VMDisks != nil { + objectMap["vmDisks"] = aadi.VMDisks + } + if aadi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aadi.VMManagedDisks + } + if aadi.InstanceType != "" { + objectMap["instanceType"] = aadi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AAddDisksInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsA2AAddDisksInput() (*A2AAddDisksInput, bool) { + return &aadi, true +} + +// AsAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for A2AAddDisksInput. +func (aadi A2AAddDisksInput) AsBasicAddDisksProviderSpecificInput() (BasicAddDisksProviderSpecificInput, bool) { + return &aadi, true +} + +// A2AApplyRecoveryPointInput applyRecoveryPoint input specific to A2A provider. +type A2AApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + aarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aarpi.InstanceType != "" { + objectMap["instanceType"] = aarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return &aarpi, true +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2AApplyRecoveryPointInput. +func (aarpi A2AApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &aarpi, true +} + +// A2AContainerCreationInput a2A cloud creation input. +type A2AContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) MarshalJSON() ([]byte, error) { + acci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acci.InstanceType != "" { + objectMap["instanceType"] = acci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return &acci, true +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2AContainerCreationInput. +func (acci A2AContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &acci, true +} + +// A2AContainerMappingInput a2A container mapping input. +type A2AContainerMappingInput struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) MarshalJSON() ([]byte, error) { + acmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acmi.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = acmi.AgentAutoUpdateStatus + } + if acmi.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = acmi.AutomationAccountArmID + } + if acmi.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = acmi.AutomationAccountAuthenticationType + } + if acmi.InstanceType != "" { + objectMap["instanceType"] = acmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return &acmi, true +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for A2AContainerMappingInput. +func (acmi A2AContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &acmi, true +} + +// A2ACreateProtectionIntentInput a2A create protection intent input. +type A2ACreateProtectionIntentInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryLocation - The primary location for the virtual machine. + PrimaryLocation *string `json:"primaryLocation,omitempty"` + // RecoveryLocation - The recovery location for the virtual machine. + RecoveryLocation *string `json:"recoveryLocation,omitempty"` + // RecoverySubscriptionID - The recovery subscription Id of the virtual machine. + RecoverySubscriptionID *string `json:"recoverySubscriptionId,omitempty"` + // RecoveryAvailabilityType - The recovery availability type of the virtual machine. Possible values include: 'Single', 'AvailabilitySet', 'AvailabilityZone' + RecoveryAvailabilityType A2ARecoveryAvailabilityType `json:"recoveryAvailabilityType,omitempty"` + // ProtectionProfileCustomInput - The protection profile custom inputs. + ProtectionProfileCustomInput BasicProtectionProfileCustomDetails `json:"protectionProfileCustomInput,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` + // RecoveryAvailabilitySetCustomInput - The recovery availability set input. + RecoveryAvailabilitySetCustomInput BasicRecoveryAvailabilitySetCustomDetails `json:"recoveryAvailabilitySetCustomInput,omitempty"` + // RecoveryVirtualNetworkCustomInput - The recovery virtual network input. + RecoveryVirtualNetworkCustomInput BasicRecoveryVirtualNetworkCustomDetails `json:"recoveryVirtualNetworkCustomInput,omitempty"` + // RecoveryProximityPlacementGroupCustomInput - The recovery proximity placement group custom input. + RecoveryProximityPlacementGroupCustomInput BasicRecoveryProximityPlacementGroupCustomDetails `json:"recoveryProximityPlacementGroupCustomInput,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // VMDisks - The list of vm disk inputs. + VMDisks *[]A2AProtectionIntentDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk inputs. + VMManagedDisks *[]A2AProtectionIntentManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccount - The boot diagnostic storage account. + RecoveryBootDiagStorageAccount BasicStorageAccountCustomDetails `json:"recoveryBootDiagStorageAccount,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the authentication type for automation account. The default value is "RunAsAccount". Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails', 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) MarshalJSON() ([]byte, error) { + acpii.InstanceType = InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if acpii.FabricObjectID != nil { + objectMap["fabricObjectId"] = acpii.FabricObjectID + } + if acpii.PrimaryLocation != nil { + objectMap["primaryLocation"] = acpii.PrimaryLocation + } + if acpii.RecoveryLocation != nil { + objectMap["recoveryLocation"] = acpii.RecoveryLocation + } + if acpii.RecoverySubscriptionID != nil { + objectMap["recoverySubscriptionId"] = acpii.RecoverySubscriptionID + } + if acpii.RecoveryAvailabilityType != "" { + objectMap["recoveryAvailabilityType"] = acpii.RecoveryAvailabilityType + } + objectMap["protectionProfileCustomInput"] = acpii.ProtectionProfileCustomInput + if acpii.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = acpii.RecoveryResourceGroupID + } + objectMap["primaryStagingStorageAccountCustomInput"] = acpii.PrimaryStagingStorageAccountCustomInput + objectMap["recoveryAvailabilitySetCustomInput"] = acpii.RecoveryAvailabilitySetCustomInput + objectMap["recoveryVirtualNetworkCustomInput"] = acpii.RecoveryVirtualNetworkCustomInput + objectMap["recoveryProximityPlacementGroupCustomInput"] = acpii.RecoveryProximityPlacementGroupCustomInput + if acpii.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = acpii.AutoProtectionOfDataDisk + } + if acpii.VMDisks != nil { + objectMap["vmDisks"] = acpii.VMDisks + } + if acpii.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = acpii.VMManagedDisks + } + if acpii.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = acpii.MultiVMGroupName + } + if acpii.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = acpii.MultiVMGroupID + } + objectMap["recoveryBootDiagStorageAccount"] = acpii.RecoveryBootDiagStorageAccount + if acpii.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = acpii.DiskEncryptionInfo + } + if acpii.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = acpii.RecoveryAvailabilityZone + } + if acpii.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = acpii.AgentAutoUpdateStatus + } + if acpii.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = acpii.AutomationAccountAuthenticationType + } + if acpii.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = acpii.AutomationAccountArmID + } + if acpii.InstanceType != "" { + objectMap["instanceType"] = acpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACreateProtectionIntentInput is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) { + return &acpii, true +} + +// AsCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for A2ACreateProtectionIntentInput. +func (acpii A2ACreateProtectionIntentInput) AsBasicCreateProtectionIntentProviderSpecificDetails() (BasicCreateProtectionIntentProviderSpecificDetails, bool) { + return &acpii, true +} + +// UnmarshalJSON is the custom unmarshaler for A2ACreateProtectionIntentInput struct. +func (acpii *A2ACreateProtectionIntentInput) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "fabricObjectId": + if v != nil { + var fabricObjectID string + err = json.Unmarshal(*v, &fabricObjectID) + if err != nil { + return err + } + acpii.FabricObjectID = &fabricObjectID + } + case "primaryLocation": + if v != nil { + var primaryLocation string + err = json.Unmarshal(*v, &primaryLocation) + if err != nil { + return err + } + acpii.PrimaryLocation = &primaryLocation + } + case "recoveryLocation": + if v != nil { + var recoveryLocation string + err = json.Unmarshal(*v, &recoveryLocation) + if err != nil { + return err + } + acpii.RecoveryLocation = &recoveryLocation + } + case "recoverySubscriptionId": + if v != nil { + var recoverySubscriptionID string + err = json.Unmarshal(*v, &recoverySubscriptionID) + if err != nil { + return err + } + acpii.RecoverySubscriptionID = &recoverySubscriptionID + } + case "recoveryAvailabilityType": + if v != nil { + var recoveryAvailabilityType A2ARecoveryAvailabilityType + err = json.Unmarshal(*v, &recoveryAvailabilityType) + if err != nil { + return err + } + acpii.RecoveryAvailabilityType = recoveryAvailabilityType + } + case "protectionProfileCustomInput": + if v != nil { + protectionProfileCustomInput, err := unmarshalBasicProtectionProfileCustomDetails(*v) + if err != nil { + return err + } + acpii.ProtectionProfileCustomInput = protectionProfileCustomInput + } + case "recoveryResourceGroupId": + if v != nil { + var recoveryResourceGroupID string + err = json.Unmarshal(*v, &recoveryResourceGroupID) + if err != nil { + return err + } + acpii.RecoveryResourceGroupID = &recoveryResourceGroupID + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + acpii.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + case "recoveryAvailabilitySetCustomInput": + if v != nil { + recoveryAvailabilitySetCustomInput, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryAvailabilitySetCustomInput = recoveryAvailabilitySetCustomInput + } + case "recoveryVirtualNetworkCustomInput": + if v != nil { + recoveryVirtualNetworkCustomInput, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryVirtualNetworkCustomInput = recoveryVirtualNetworkCustomInput + } + case "recoveryProximityPlacementGroupCustomInput": + if v != nil { + recoveryProximityPlacementGroupCustomInput, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryProximityPlacementGroupCustomInput = recoveryProximityPlacementGroupCustomInput + } + case "autoProtectionOfDataDisk": + if v != nil { + var autoProtectionOfDataDisk AutoProtectionOfDataDisk + err = json.Unmarshal(*v, &autoProtectionOfDataDisk) + if err != nil { + return err + } + acpii.AutoProtectionOfDataDisk = autoProtectionOfDataDisk + } + case "vmDisks": + if v != nil { + var VMDisks []A2AProtectionIntentDiskInputDetails + err = json.Unmarshal(*v, &VMDisks) + if err != nil { + return err + } + acpii.VMDisks = &VMDisks + } + case "vmManagedDisks": + if v != nil { + var VMManagedDisks []A2AProtectionIntentManagedDiskInputDetails + err = json.Unmarshal(*v, &VMManagedDisks) + if err != nil { + return err + } + acpii.VMManagedDisks = &VMManagedDisks + } + case "multiVmGroupName": + if v != nil { + var multiVMGroupName string + err = json.Unmarshal(*v, &multiVMGroupName) + if err != nil { + return err + } + acpii.MultiVMGroupName = &multiVMGroupName + } + case "multiVmGroupId": + if v != nil { + var multiVMGroupID string + err = json.Unmarshal(*v, &multiVMGroupID) + if err != nil { + return err + } + acpii.MultiVMGroupID = &multiVMGroupID + } + case "recoveryBootDiagStorageAccount": + if v != nil { + recoveryBootDiagStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + acpii.RecoveryBootDiagStorageAccount = recoveryBootDiagStorageAccount + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + acpii.DiskEncryptionInfo = &diskEncryptionInfo + } + case "recoveryAvailabilityZone": + if v != nil { + var recoveryAvailabilityZone string + err = json.Unmarshal(*v, &recoveryAvailabilityZone) + if err != nil { + return err + } + acpii.RecoveryAvailabilityZone = &recoveryAvailabilityZone + } + case "agentAutoUpdateStatus": + if v != nil { + var agentAutoUpdateStatus AgentAutoUpdateStatus + err = json.Unmarshal(*v, &agentAutoUpdateStatus) + if err != nil { + return err + } + acpii.AgentAutoUpdateStatus = agentAutoUpdateStatus + } + case "automationAccountAuthenticationType": + if v != nil { + var automationAccountAuthenticationType AutomationAccountAuthenticationType + err = json.Unmarshal(*v, &automationAccountAuthenticationType) + if err != nil { + return err + } + acpii.AutomationAccountAuthenticationType = automationAccountAuthenticationType + } + case "automationAccountArmId": + if v != nil { + var automationAccountArmID string + err = json.Unmarshal(*v, &automationAccountArmID) + if err != nil { + return err + } + acpii.AutomationAccountArmID = &automationAccountArmID + } + case "instanceType": + if v != nil { + var instanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails + err = json.Unmarshal(*v, &instanceType) + if err != nil { + return err + } + acpii.InstanceType = instanceType + } + } + } + + return nil +} + +// A2ACrossClusterMigrationApplyRecoveryPointInput applyRecoveryPoint input specific to +// A2ACrossClusterMigration provider. +type A2ACrossClusterMigrationApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + accmarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmarpi.InstanceType != "" { + objectMap["instanceType"] = accmarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return &accmarpi, true +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for A2ACrossClusterMigrationApplyRecoveryPointInput. +func (accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &accmarpi, true +} + +// A2ACrossClusterMigrationContainerCreationInput a2ACrossClusterMigration cloud creation input. +type A2ACrossClusterMigrationContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) MarshalJSON() ([]byte, error) { + accmcci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmcci.InstanceType != "" { + objectMap["instanceType"] = accmcci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return &accmcci, true +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for A2ACrossClusterMigrationContainerCreationInput. +func (accmcci A2ACrossClusterMigrationContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &accmcci, true +} + +// A2ACrossClusterMigrationEnableProtectionInput a2A Cross-Cluster Migration enable protection input. +type A2ACrossClusterMigrationEnableProtectionInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) MarshalJSON() ([]byte, error) { + accmepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmepi.FabricObjectID != nil { + objectMap["fabricObjectId"] = accmepi.FabricObjectID + } + if accmepi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = accmepi.RecoveryContainerID + } + if accmepi.InstanceType != "" { + objectMap["instanceType"] = accmepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return &accmepi, true +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2ACrossClusterMigrationEnableProtectionInput. +func (accmepi A2ACrossClusterMigrationEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &accmepi, true +} + +// A2ACrossClusterMigrationPolicyCreationInput a2A Cross-Cluster Migration Policy creation input. +type A2ACrossClusterMigrationPolicyCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) MarshalJSON() ([]byte, error) { + accmpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmpci.InstanceType != "" { + objectMap["instanceType"] = accmpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return &accmpci, true +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2ACrossClusterMigrationPolicyCreationInput. +func (accmpci A2ACrossClusterMigrationPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &accmpci, true +} + +// A2ACrossClusterMigrationReplicationDetails a2A provider specific settings. +type A2ACrossClusterMigrationReplicationDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryFabricLocation - Primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // OsType - The type of operating system. + OsType *string `json:"osType,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // LifecycleID - An id associated with the PE 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 item even though other internal Ids/ARM Id might be changing. + LifecycleID *string `json:"lifecycleId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) MarshalJSON() ([]byte, error) { + accmrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration + objectMap := make(map[string]interface{}) + if accmrd.FabricObjectID != nil { + objectMap["fabricObjectId"] = accmrd.FabricObjectID + } + if accmrd.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = accmrd.PrimaryFabricLocation + } + if accmrd.OsType != nil { + objectMap["osType"] = accmrd.OsType + } + if accmrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = accmrd.VMProtectionState + } + if accmrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = accmrd.VMProtectionStateDescription + } + if accmrd.LifecycleID != nil { + objectMap["lifecycleId"] = accmrd.LifecycleID + } + if accmrd.InstanceType != "" { + objectMap["instanceType"] = accmrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return &accmrd, true +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2ACrossClusterMigrationReplicationDetails. +func (accmrd A2ACrossClusterMigrationReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &accmrd, true +} + +// A2AEnableProtectionInput a2A enable protection input. +type A2AEnableProtectionInput struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryExtendedLocation - The recovery extended location. + RecoveryExtendedLocation *ExtendedLocation `json:"recoveryExtendedLocation,omitempty"` + // RecoveryAzureNetworkID - The recovery Azure virtual network ARM id. + RecoveryAzureNetworkID *string `json:"recoveryAzureNetworkId,omitempty"` + // RecoverySubnetName - The recovery subnet name. + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + // RecoveryVirtualMachineScaleSetID - The virtual machine scale set Id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) MarshalJSON() ([]byte, error) { + aepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aepi.FabricObjectID != nil { + objectMap["fabricObjectId"] = aepi.FabricObjectID + } + if aepi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = aepi.RecoveryContainerID + } + if aepi.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aepi.RecoveryResourceGroupID + } + if aepi.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aepi.RecoveryCloudServiceID + } + if aepi.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = aepi.RecoveryAvailabilitySetID + } + if aepi.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aepi.RecoveryProximityPlacementGroupID + } + if aepi.VMDisks != nil { + objectMap["vmDisks"] = aepi.VMDisks + } + if aepi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aepi.VMManagedDisks + } + if aepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = aepi.MultiVMGroupName + } + if aepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = aepi.MultiVMGroupID + } + if aepi.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aepi.RecoveryBootDiagStorageAccountID + } + if aepi.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aepi.DiskEncryptionInfo + } + if aepi.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = aepi.RecoveryAvailabilityZone + } + if aepi.RecoveryExtendedLocation != nil { + objectMap["recoveryExtendedLocation"] = aepi.RecoveryExtendedLocation + } + if aepi.RecoveryAzureNetworkID != nil { + objectMap["recoveryAzureNetworkId"] = aepi.RecoveryAzureNetworkID + } + if aepi.RecoverySubnetName != nil { + objectMap["recoverySubnetName"] = aepi.RecoverySubnetName + } + if aepi.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aepi.RecoveryVirtualMachineScaleSetID + } + if aepi.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = aepi.RecoveryCapacityReservationGroupID + } + if aepi.InstanceType != "" { + objectMap["instanceType"] = aepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return &aepi, true +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for A2AEnableProtectionInput. +func (aepi A2AEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &aepi, true +} + +// A2AEventDetails model class for event details of a A2A event. +type A2AEventDetails struct { + // ProtectedItemName - The protected item arm name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // FabricObjectID - The azure vm arm id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // FabricName - Fabric arm name. + FabricName *string `json:"fabricName,omitempty"` + // FabricLocation - The fabric location. + FabricLocation *string `json:"fabricLocation,omitempty"` + // RemoteFabricName - Remote fabric arm name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // RemoteFabricLocation - Remote fabric location. + RemoteFabricLocation *string `json:"remoteFabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AEventDetails. +func (aed A2AEventDetails) MarshalJSON() ([]byte, error) { + aed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aed.ProtectedItemName != nil { + objectMap["protectedItemName"] = aed.ProtectedItemName + } + if aed.FabricObjectID != nil { + objectMap["fabricObjectId"] = aed.FabricObjectID + } + if aed.FabricName != nil { + objectMap["fabricName"] = aed.FabricName + } + if aed.FabricLocation != nil { + objectMap["fabricLocation"] = aed.FabricLocation + } + if aed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = aed.RemoteFabricName + } + if aed.RemoteFabricLocation != nil { + objectMap["remoteFabricLocation"] = aed.RemoteFabricLocation + } + if aed.InstanceType != "" { + objectMap["instanceType"] = aed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return &aed, true +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for A2AEventDetails. +func (aed A2AEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &aed, true +} + +// A2APolicyCreationInput a2A Policy creation input. +type A2APolicyCreationInput struct { + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) MarshalJSON() ([]byte, error) { + apci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apci.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = apci.RecoveryPointHistory + } + if apci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = apci.CrashConsistentFrequencyInMinutes + } + if apci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = apci.AppConsistentFrequencyInMinutes + } + if apci.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = apci.MultiVMSyncStatus + } + if apci.InstanceType != "" { + objectMap["instanceType"] = apci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return &apci, true +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for A2APolicyCreationInput. +func (apci A2APolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &apci, true +} + +// A2APolicyDetails a2A specific policy details. +type A2APolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2APolicyDetails. +func (apd A2APolicyDetails) MarshalJSON() ([]byte, error) { + apd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = apd.RecoveryPointThresholdInMinutes + } + if apd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = apd.RecoveryPointHistory + } + if apd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = apd.AppConsistentFrequencyInMinutes + } + if apd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = apd.MultiVMSyncStatus + } + if apd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = apd.CrashConsistentFrequencyInMinutes + } + if apd.InstanceType != "" { + objectMap["instanceType"] = apd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return &apd, true +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for A2APolicyDetails. +func (apd A2APolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &apd, true +} + +// A2AProtectedDiskDetails a2A protected disk details. +type A2AProtectedDiskDetails struct { + // DiskURI - The disk uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountID - The recovery disk storage account. + RecoveryAzureStorageAccountID *string `json:"recoveryAzureStorageAccountId,omitempty"` + // PrimaryDiskAzureStorageAccountID - The primary disk storage account. + PrimaryDiskAzureStorageAccountID *string `json:"primaryDiskAzureStorageAccountId,omitempty"` + // RecoveryDiskURI - Recovery disk uri. + RecoveryDiskURI *string `json:"recoveryDiskUri,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // DiskType - The type of disk. + DiskType *string `json:"diskType,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *bool `json:"resyncRequired,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // DataPendingInStagingStorageAccountInMB - The data pending for replication in MB at staging account. + DataPendingInStagingStorageAccountInMB *float64 `json:"dataPendingInStagingStorageAccountInMB,omitempty"` + // DataPendingAtSourceAgentInMB - The data pending at source virtual machine in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // DiskState - The disk state. + DiskState *string `json:"diskState,omitempty"` + // AllowedDiskLevelOperation - The disk level operations list. + AllowedDiskLevelOperation *[]string `json:"allowedDiskLevelOperation,omitempty"` + // IsDiskEncrypted - A value indicating whether vm has encrypted os disk or not. + IsDiskEncrypted *bool `json:"isDiskEncrypted,omitempty"` + // SecretIdentifier - The secret URL / identifier (BEK). + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // DekKeyVaultArmID - The KeyVault resource id for secret (BEK). + DekKeyVaultArmID *string `json:"dekKeyVaultArmId,omitempty"` + // IsDiskKeyEncrypted - A value indicating whether disk key got encrypted or not. + IsDiskKeyEncrypted *bool `json:"isDiskKeyEncrypted,omitempty"` + // KeyIdentifier - The key URL / identifier (KEK). + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KekKeyVaultArmID - The KeyVault resource id for key (KEK). + KekKeyVaultArmID *string `json:"kekKeyVaultArmId,omitempty"` + // FailoverDiskName - The failover name for the managed disk. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The test failover name for the managed disk. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AProtectedManagedDiskDetails a2A protected managed disk details. +type A2AProtectedManagedDiskDetails struct { + // DiskID - The managed disk Arm id. + DiskID *string `json:"diskId,omitempty"` + // RecoveryResourceGroupID - The recovery disk resource group Arm Id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryTargetDiskID - Recovery target disk Arm Id. + RecoveryTargetDiskID *string `json:"recoveryTargetDiskId,omitempty"` + // RecoveryReplicaDiskID - Recovery replica disk Arm Id. + RecoveryReplicaDiskID *string `json:"recoveryReplicaDiskId,omitempty"` + // RecoveryOrignalTargetDiskID - Recovery original target disk Arm Id. + RecoveryOrignalTargetDiskID *string `json:"recoveryOrignalTargetDiskId,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // PrimaryDiskEncryptionSetID - The primary disk encryption set Id. + PrimaryDiskEncryptionSetID *string `json:"primaryDiskEncryptionSetId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // DiskType - The type of disk. + DiskType *string `json:"diskType,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *bool `json:"resyncRequired,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // DataPendingInStagingStorageAccountInMB - The data pending for replication in MB at staging account. + DataPendingInStagingStorageAccountInMB *float64 `json:"dataPendingInStagingStorageAccountInMB,omitempty"` + // DataPendingAtSourceAgentInMB - The data pending at source virtual machine in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // DiskState - The disk state. + DiskState *string `json:"diskState,omitempty"` + // AllowedDiskLevelOperation - The disk level operations list. + AllowedDiskLevelOperation *[]string `json:"allowedDiskLevelOperation,omitempty"` + // IsDiskEncrypted - A value indicating whether vm has encrypted os disk or not. + IsDiskEncrypted *bool `json:"isDiskEncrypted,omitempty"` + // SecretIdentifier - The secret URL / identifier (BEK). + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // DekKeyVaultArmID - The KeyVault resource id for secret (BEK). + DekKeyVaultArmID *string `json:"dekKeyVaultArmId,omitempty"` + // IsDiskKeyEncrypted - A value indicating whether disk key got encrypted or not. + IsDiskKeyEncrypted *bool `json:"isDiskKeyEncrypted,omitempty"` + // KeyIdentifier - The key URL / identifier (KEK). + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KekKeyVaultArmID - The KeyVault resource id for key (KEK). + KekKeyVaultArmID *string `json:"kekKeyVaultArmId,omitempty"` + // FailoverDiskName - The failover name for the managed disk. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The test failover name for the managed disk. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AProtectionContainerMappingDetails a2A provider specific settings. +type A2AProtectionContainerMappingDetails struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // ScheduleName - The schedule arm name. + ScheduleName *string `json:"scheduleName,omitempty"` + // JobScheduleName - The job schedule arm name. + JobScheduleName *string `json:"jobScheduleName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + apcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if apcmd.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = apcmd.AgentAutoUpdateStatus + } + if apcmd.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = apcmd.AutomationAccountArmID + } + if apcmd.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = apcmd.AutomationAccountAuthenticationType + } + if apcmd.ScheduleName != nil { + objectMap["scheduleName"] = apcmd.ScheduleName + } + if apcmd.JobScheduleName != nil { + objectMap["jobScheduleName"] = apcmd.JobScheduleName + } + if apcmd.InstanceType != "" { + objectMap["instanceType"] = apcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return &apcmd, true +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for A2AProtectionContainerMappingDetails. +func (apcmd A2AProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &apcmd, true +} + +// A2AProtectionIntentDiskInputDetails azure VM unmanaged disk input details. +type A2AProtectionIntentDiskInputDetails struct { + // DiskURI - The disk Uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountCustomInput - The recovery VHD storage account input. + RecoveryAzureStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"recoveryAzureStorageAccountCustomInput,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for A2AProtectionIntentDiskInputDetails struct. +func (apidid *A2AProtectionIntentDiskInputDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "diskUri": + if v != nil { + var diskURI string + err = json.Unmarshal(*v, &diskURI) + if err != nil { + return err + } + apidid.DiskURI = &diskURI + } + case "recoveryAzureStorageAccountCustomInput": + if v != nil { + recoveryAzureStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apidid.RecoveryAzureStorageAccountCustomInput = recoveryAzureStorageAccountCustomInput + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apidid.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + } + } + + return nil +} + +// A2AProtectionIntentManagedDiskInputDetails azure VM managed disk input details. +type A2AProtectionIntentManagedDiskInputDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // PrimaryStagingStorageAccountCustomInput - The primary staging storage account input. + PrimaryStagingStorageAccountCustomInput BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput,omitempty"` + // RecoveryResourceGroupCustomInput - The recovery resource group input. + RecoveryResourceGroupCustomInput BasicRecoveryResourceGroupCustomDetails `json:"recoveryResourceGroupCustomInput,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for one / single pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for A2AProtectionIntentManagedDiskInputDetails struct. +func (apimdid *A2AProtectionIntentManagedDiskInputDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "diskId": + if v != nil { + var diskID string + err = json.Unmarshal(*v, &diskID) + if err != nil { + return err + } + apimdid.DiskID = &diskID + } + case "primaryStagingStorageAccountCustomInput": + if v != nil { + primaryStagingStorageAccountCustomInput, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + apimdid.PrimaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput + } + case "recoveryResourceGroupCustomInput": + if v != nil { + recoveryResourceGroupCustomInput, err := unmarshalBasicRecoveryResourceGroupCustomDetails(*v) + if err != nil { + return err + } + apimdid.RecoveryResourceGroupCustomInput = recoveryResourceGroupCustomInput + } + case "recoveryReplicaDiskAccountType": + if v != nil { + var recoveryReplicaDiskAccountType string + err = json.Unmarshal(*v, &recoveryReplicaDiskAccountType) + if err != nil { + return err + } + apimdid.RecoveryReplicaDiskAccountType = &recoveryReplicaDiskAccountType + } + case "recoveryTargetDiskAccountType": + if v != nil { + var recoveryTargetDiskAccountType string + err = json.Unmarshal(*v, &recoveryTargetDiskAccountType) + if err != nil { + return err + } + apimdid.RecoveryTargetDiskAccountType = &recoveryTargetDiskAccountType + } + case "recoveryDiskEncryptionSetId": + if v != nil { + var recoveryDiskEncryptionSetID string + err = json.Unmarshal(*v, &recoveryDiskEncryptionSetID) + if err != nil { + return err + } + apimdid.RecoveryDiskEncryptionSetID = &recoveryDiskEncryptionSetID + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + apimdid.DiskEncryptionInfo = &diskEncryptionInfo + } + } + } + + return nil +} + +// A2ARecoveryPointDetails a2A provider specific recovery point details. +type A2ARecoveryPointDetails struct { + // RecoveryPointSyncType - A value indicating whether the recovery point is multi VM consistent. Possible values include: 'MultiVMSyncRecoveryPoint', 'PerVMRecoveryPoint' + RecoveryPointSyncType RecoveryPointSyncType `json:"recoveryPointSyncType,omitempty"` + // Disks - List of disk ids representing a recovery point. + Disks *[]string `json:"disks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) MarshalJSON() ([]byte, error) { + arpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if arpd.RecoveryPointSyncType != "" { + objectMap["recoveryPointSyncType"] = arpd.RecoveryPointSyncType + } + if arpd.Disks != nil { + objectMap["disks"] = arpd.Disks + } + if arpd.InstanceType != "" { + objectMap["instanceType"] = arpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return &arpd, true +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for A2ARecoveryPointDetails. +func (arpd A2ARecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &arpd, true +} + +// A2ARemoveDisksInput a2A remove disk(s) input. +type A2ARemoveDisksInput struct { + // VMDisksUris - The list of vm disk vhd URIs. + VMDisksUris *[]string `json:"vmDisksUris,omitempty"` + // VMManagedDisksIds - The list of vm managed disk Ids. + VMManagedDisksIds *[]string `json:"vmManagedDisksIds,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput', 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRemoveDisksProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) MarshalJSON() ([]byte, error) { + ardi.InstanceType = InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ardi.VMDisksUris != nil { + objectMap["vmDisksUris"] = ardi.VMDisksUris + } + if ardi.VMManagedDisksIds != nil { + objectMap["vmManagedDisksIds"] = ardi.VMManagedDisksIds + } + if ardi.InstanceType != "" { + objectMap["instanceType"] = ardi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARemoveDisksInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) { + return &ardi, true +} + +// AsRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for A2ARemoveDisksInput. +func (ardi A2ARemoveDisksInput) AsBasicRemoveDisksProviderSpecificInput() (BasicRemoveDisksProviderSpecificInput, bool) { + return &ardi, true +} + +// A2AReplicationDetails a2A provider specific settings. +type A2AReplicationDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // InitialPrimaryZone - READ-ONLY; The initial primary availability zone. + InitialPrimaryZone *string `json:"initialPrimaryZone,omitempty"` + // InitialPrimaryFabricLocation - READ-ONLY; The initial primary fabric location. + InitialPrimaryFabricLocation *string `json:"initialPrimaryFabricLocation,omitempty"` + // InitialRecoveryZone - READ-ONLY; The initial recovery availability zone. + InitialRecoveryZone *string `json:"initialRecoveryZone,omitempty"` + // InitialPrimaryExtendedLocation - The initial primary extended location. + InitialPrimaryExtendedLocation *ExtendedLocation `json:"initialPrimaryExtendedLocation,omitempty"` + // InitialRecoveryExtendedLocation - The initial recovery extended location. + InitialRecoveryExtendedLocation *ExtendedLocation `json:"initialRecoveryExtendedLocation,omitempty"` + // InitialRecoveryFabricLocation - READ-ONLY; The initial recovery fabric location. + InitialRecoveryFabricLocation *string `json:"initialRecoveryFabricLocation,omitempty"` + // MultiVMGroupID - The multi vm group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupCreateOption - Whether Multi VM group is auto created or specified by user. Possible values include: 'AutoCreated', 'UserSpecified' + MultiVMGroupCreateOption MultiVMGroupCreateOption `json:"multiVmGroupCreateOption,omitempty"` + // ManagementID - The management Id. + ManagementID *string `json:"managementId,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]A2AProtectedDiskDetails `json:"protectedDisks,omitempty"` + // UnprotectedDisks - The list of unprotected disks. + UnprotectedDisks *[]A2AUnprotectedDiskDetails `json:"unprotectedDisks,omitempty"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]A2AProtectedManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // RecoveryBootDiagStorageAccountID - The recovery boot diagnostic storage account Arm Id. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // PrimaryFabricLocation - Primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // RecoveryFabricLocation - The recovery fabric location. + RecoveryFabricLocation *string `json:"recoveryFabricLocation,omitempty"` + // OsType - The type of operating system. + OsType *string `json:"osType,omitempty"` + // RecoveryAzureVMSize - The size of recovery virtual machine. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureVMName - The name of recovery virtual machine. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureResourceGroupID - The recovery resource group. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryCloudService - The recovery cloud service. + RecoveryCloudService *string `json:"recoveryCloudService,omitempty"` + // RecoveryAvailabilitySet - The recovery availability set. + RecoveryAvailabilitySet *string `json:"recoveryAvailabilitySet,omitempty"` + // SelectedRecoveryAzureNetworkID - The recovery virtual network. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The test failover virtual network. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // VMNics - The virtual machine nic details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMSyncedConfigDetails - The synced configuration details. + VMSyncedConfigDetails *AzureToAzureVMSyncedConfigDetails `json:"vmSyncedConfigDetails,omitempty"` + // MonitoringPercentageCompletion - The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 `json:"monitoringPercentageCompletion,omitempty"` + // MonitoringJobType - The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string `json:"monitoringJobType,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // IsReplicationAgentUpdateRequired - A value indicating whether replication agent update is required. + IsReplicationAgentUpdateRequired *bool `json:"isReplicationAgentUpdateRequired,omitempty"` + // AgentCertificateExpiryDate - READ-ONLY; Agent certificate expiry date. + AgentCertificateExpiryDate *date.Time `json:"agentCertificateExpiryDate,omitempty"` + // IsReplicationAgentCertificateUpdateRequired - A value indicating whether agent certificate update is required. + IsReplicationAgentCertificateUpdateRequired *bool `json:"isReplicationAgentCertificateUpdateRequired,omitempty"` + // RecoveryFabricObjectID - The recovery fabric object Id. + RecoveryFabricObjectID *string `json:"recoveryFabricObjectId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // LifecycleID - An id associated with the PE 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 item even though other internal Ids/ARM Id might be changing. + LifecycleID *string `json:"lifecycleId,omitempty"` + // TestFailoverRecoveryFabricObjectID - The test failover fabric object Id. + TestFailoverRecoveryFabricObjectID *string `json:"testFailoverRecoveryFabricObjectId,omitempty"` + // RpoInSeconds - The last RPO value in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // LastRpoCalculatedTime - The time (in UTC) when the last RPO value was calculated by Protection Service. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // PrimaryAvailabilityZone - The primary availability zone. + PrimaryAvailabilityZone *string `json:"primaryAvailabilityZone,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // PrimaryExtendedLocation - The primary Extended Location. + PrimaryExtendedLocation *ExtendedLocation `json:"primaryExtendedLocation,omitempty"` + // RecoveryExtendedLocation - The recovery Extended Location. + RecoveryExtendedLocation *ExtendedLocation `json:"recoveryExtendedLocation,omitempty"` + // VMEncryptionType - READ-ONLY; The encryption type of the VM. Possible values include: 'NotEncrypted', 'OnePassEncrypted', 'TwoPassEncrypted' + VMEncryptionType VMEncryptionType `json:"vmEncryptionType,omitempty"` + // TfoAzureVMName - The test failover vm name. + TfoAzureVMName *string `json:"tfoAzureVMName,omitempty"` + // RecoveryAzureGeneration - READ-ONLY; The recovery azure generation. + RecoveryAzureGeneration *string `json:"recoveryAzureGeneration,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // RecoveryVirtualMachineScaleSetID - The recovery virtual machine scale set id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReplicationDetails. +func (ard A2AReplicationDetails) MarshalJSON() ([]byte, error) { + ard.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ard.FabricObjectID != nil { + objectMap["fabricObjectId"] = ard.FabricObjectID + } + if ard.InitialPrimaryExtendedLocation != nil { + objectMap["initialPrimaryExtendedLocation"] = ard.InitialPrimaryExtendedLocation + } + if ard.InitialRecoveryExtendedLocation != nil { + objectMap["initialRecoveryExtendedLocation"] = ard.InitialRecoveryExtendedLocation + } + if ard.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = ard.MultiVMGroupID + } + if ard.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = ard.MultiVMGroupName + } + if ard.MultiVMGroupCreateOption != "" { + objectMap["multiVmGroupCreateOption"] = ard.MultiVMGroupCreateOption + } + if ard.ManagementID != nil { + objectMap["managementId"] = ard.ManagementID + } + if ard.ProtectedDisks != nil { + objectMap["protectedDisks"] = ard.ProtectedDisks + } + if ard.UnprotectedDisks != nil { + objectMap["unprotectedDisks"] = ard.UnprotectedDisks + } + if ard.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = ard.ProtectedManagedDisks + } + if ard.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = ard.RecoveryBootDiagStorageAccountID + } + if ard.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = ard.PrimaryFabricLocation + } + if ard.RecoveryFabricLocation != nil { + objectMap["recoveryFabricLocation"] = ard.RecoveryFabricLocation + } + if ard.OsType != nil { + objectMap["osType"] = ard.OsType + } + if ard.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = ard.RecoveryAzureVMSize + } + if ard.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVMName"] = ard.RecoveryAzureVMName + } + if ard.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = ard.RecoveryAzureResourceGroupID + } + if ard.RecoveryCloudService != nil { + objectMap["recoveryCloudService"] = ard.RecoveryCloudService + } + if ard.RecoveryAvailabilitySet != nil { + objectMap["recoveryAvailabilitySet"] = ard.RecoveryAvailabilitySet + } + if ard.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = ard.SelectedRecoveryAzureNetworkID + } + if ard.SelectedTfoAzureNetworkID != nil { + objectMap["selectedTfoAzureNetworkId"] = ard.SelectedTfoAzureNetworkID + } + if ard.VMNics != nil { + objectMap["vmNics"] = ard.VMNics + } + if ard.VMSyncedConfigDetails != nil { + objectMap["vmSyncedConfigDetails"] = ard.VMSyncedConfigDetails + } + if ard.MonitoringPercentageCompletion != nil { + objectMap["monitoringPercentageCompletion"] = ard.MonitoringPercentageCompletion + } + if ard.MonitoringJobType != nil { + objectMap["monitoringJobType"] = ard.MonitoringJobType + } + if ard.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = ard.LastHeartbeat + } + if ard.AgentVersion != nil { + objectMap["agentVersion"] = ard.AgentVersion + } + if ard.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = ard.AgentExpiryDate + } + if ard.IsReplicationAgentUpdateRequired != nil { + objectMap["isReplicationAgentUpdateRequired"] = ard.IsReplicationAgentUpdateRequired + } + if ard.IsReplicationAgentCertificateUpdateRequired != nil { + objectMap["isReplicationAgentCertificateUpdateRequired"] = ard.IsReplicationAgentCertificateUpdateRequired + } + if ard.RecoveryFabricObjectID != nil { + objectMap["recoveryFabricObjectId"] = ard.RecoveryFabricObjectID + } + if ard.VMProtectionState != nil { + objectMap["vmProtectionState"] = ard.VMProtectionState + } + if ard.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = ard.VMProtectionStateDescription + } + if ard.LifecycleID != nil { + objectMap["lifecycleId"] = ard.LifecycleID + } + if ard.TestFailoverRecoveryFabricObjectID != nil { + objectMap["testFailoverRecoveryFabricObjectId"] = ard.TestFailoverRecoveryFabricObjectID + } + if ard.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = ard.RpoInSeconds + } + if ard.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = ard.LastRpoCalculatedTime + } + if ard.PrimaryAvailabilityZone != nil { + objectMap["primaryAvailabilityZone"] = ard.PrimaryAvailabilityZone + } + if ard.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = ard.RecoveryAvailabilityZone + } + if ard.PrimaryExtendedLocation != nil { + objectMap["primaryExtendedLocation"] = ard.PrimaryExtendedLocation + } + if ard.RecoveryExtendedLocation != nil { + objectMap["recoveryExtendedLocation"] = ard.RecoveryExtendedLocation + } + if ard.TfoAzureVMName != nil { + objectMap["tfoAzureVMName"] = ard.TfoAzureVMName + } + if ard.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = ard.RecoveryProximityPlacementGroupID + } + if ard.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = ard.AutoProtectionOfDataDisk + } + if ard.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = ard.RecoveryVirtualMachineScaleSetID + } + if ard.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = ard.RecoveryCapacityReservationGroupID + } + if ard.InstanceType != "" { + objectMap["instanceType"] = ard.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return &ard, true +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for A2AReplicationDetails. +func (ard A2AReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &ard, true +} + +// A2AReplicationIntentDetails a2A provider specific settings. +type A2AReplicationIntentDetails struct { + // FabricObjectID - The fabric specific object Id of the virtual machine. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // PrimaryLocation - The primary location for the virtual machine. + PrimaryLocation *string `json:"primaryLocation,omitempty"` + // RecoveryLocation - The recovery location for the virtual machine. + RecoveryLocation *string `json:"recoveryLocation,omitempty"` + // RecoverySubscriptionID - The recovery subscription Id of the virtual machine. + RecoverySubscriptionID *string `json:"recoverySubscriptionId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AProtectionIntentDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AProtectionIntentManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ProtectionProfile - The protection profile custom details. + ProtectionProfile BasicProtectionProfileCustomDetails `json:"protectionProfile,omitempty"` + // PrimaryStagingStorageAccount - The primary staging storage account details. + PrimaryStagingStorageAccount BasicStorageAccountCustomDetails `json:"primaryStagingStorageAccount,omitempty"` + // RecoveryAvailabilitySet - The recovery availability set details. + RecoveryAvailabilitySet BasicRecoveryAvailabilitySetCustomDetails `json:"recoveryAvailabilitySet,omitempty"` + // RecoveryVirtualNetwork - The recovery virtual network details. + RecoveryVirtualNetwork BasicRecoveryVirtualNetworkCustomDetails `json:"recoveryVirtualNetwork,omitempty"` + // RecoveryProximityPlacementGroup - The recovery proximity placement group custom details. + RecoveryProximityPlacementGroup BasicRecoveryProximityPlacementGroupCustomDetails `json:"recoveryProximityPlacementGroup,omitempty"` + // AutoProtectionOfDataDisk - A value indicating whether the auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + AutoProtectionOfDataDisk AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMGroupID - The multi vm group id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // RecoveryBootDiagStorageAccount - The boot diagnostic storage account. + RecoveryBootDiagStorageAccount BasicStorageAccountCustomDetails `json:"recoveryBootDiagStorageAccount,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for two pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryAvailabilityType - The recovery availability type of the virtual machine. + RecoveryAvailabilityType *string `json:"recoveryAvailabilityType,omitempty"` + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings', 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A' + InstanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) MarshalJSON() ([]byte, error) { + arid.InstanceType = InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if arid.FabricObjectID != nil { + objectMap["fabricObjectId"] = arid.FabricObjectID + } + if arid.PrimaryLocation != nil { + objectMap["primaryLocation"] = arid.PrimaryLocation + } + if arid.RecoveryLocation != nil { + objectMap["recoveryLocation"] = arid.RecoveryLocation + } + if arid.RecoverySubscriptionID != nil { + objectMap["recoverySubscriptionId"] = arid.RecoverySubscriptionID + } + if arid.VMDisks != nil { + objectMap["vmDisks"] = arid.VMDisks + } + if arid.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = arid.VMManagedDisks + } + if arid.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = arid.RecoveryResourceGroupID + } + objectMap["protectionProfile"] = arid.ProtectionProfile + objectMap["primaryStagingStorageAccount"] = arid.PrimaryStagingStorageAccount + objectMap["recoveryAvailabilitySet"] = arid.RecoveryAvailabilitySet + objectMap["recoveryVirtualNetwork"] = arid.RecoveryVirtualNetwork + objectMap["recoveryProximityPlacementGroup"] = arid.RecoveryProximityPlacementGroup + if arid.AutoProtectionOfDataDisk != "" { + objectMap["autoProtectionOfDataDisk"] = arid.AutoProtectionOfDataDisk + } + if arid.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = arid.MultiVMGroupName + } + if arid.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = arid.MultiVMGroupID + } + objectMap["recoveryBootDiagStorageAccount"] = arid.RecoveryBootDiagStorageAccount + if arid.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = arid.DiskEncryptionInfo + } + if arid.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = arid.RecoveryAvailabilityZone + } + if arid.RecoveryAvailabilityType != nil { + objectMap["recoveryAvailabilityType"] = arid.RecoveryAvailabilityType + } + if arid.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = arid.AgentAutoUpdateStatus + } + if arid.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = arid.AutomationAccountArmID + } + if arid.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = arid.AutomationAccountAuthenticationType + } + if arid.InstanceType != "" { + objectMap["instanceType"] = arid.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReplicationIntentDetails is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) { + return &arid, true +} + +// AsReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for A2AReplicationIntentDetails. +func (arid A2AReplicationIntentDetails) AsBasicReplicationProtectionIntentProviderSpecificSettings() (BasicReplicationProtectionIntentProviderSpecificSettings, bool) { + return &arid, true +} + +// UnmarshalJSON is the custom unmarshaler for A2AReplicationIntentDetails struct. +func (arid *A2AReplicationIntentDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "fabricObjectId": + if v != nil { + var fabricObjectID string + err = json.Unmarshal(*v, &fabricObjectID) + if err != nil { + return err + } + arid.FabricObjectID = &fabricObjectID + } + case "primaryLocation": + if v != nil { + var primaryLocation string + err = json.Unmarshal(*v, &primaryLocation) + if err != nil { + return err + } + arid.PrimaryLocation = &primaryLocation + } + case "recoveryLocation": + if v != nil { + var recoveryLocation string + err = json.Unmarshal(*v, &recoveryLocation) + if err != nil { + return err + } + arid.RecoveryLocation = &recoveryLocation + } + case "recoverySubscriptionId": + if v != nil { + var recoverySubscriptionID string + err = json.Unmarshal(*v, &recoverySubscriptionID) + if err != nil { + return err + } + arid.RecoverySubscriptionID = &recoverySubscriptionID + } + case "vmDisks": + if v != nil { + var VMDisks []A2AProtectionIntentDiskInputDetails + err = json.Unmarshal(*v, &VMDisks) + if err != nil { + return err + } + arid.VMDisks = &VMDisks + } + case "vmManagedDisks": + if v != nil { + var VMManagedDisks []A2AProtectionIntentManagedDiskInputDetails + err = json.Unmarshal(*v, &VMManagedDisks) + if err != nil { + return err + } + arid.VMManagedDisks = &VMManagedDisks + } + case "recoveryResourceGroupId": + if v != nil { + var recoveryResourceGroupID string + err = json.Unmarshal(*v, &recoveryResourceGroupID) + if err != nil { + return err + } + arid.RecoveryResourceGroupID = &recoveryResourceGroupID + } + case "protectionProfile": + if v != nil { + protectionProfile, err := unmarshalBasicProtectionProfileCustomDetails(*v) + if err != nil { + return err + } + arid.ProtectionProfile = protectionProfile + } + case "primaryStagingStorageAccount": + if v != nil { + primaryStagingStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + arid.PrimaryStagingStorageAccount = primaryStagingStorageAccount + } + case "recoveryAvailabilitySet": + if v != nil { + recoveryAvailabilitySet, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryAvailabilitySet = recoveryAvailabilitySet + } + case "recoveryVirtualNetwork": + if v != nil { + recoveryVirtualNetwork, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryVirtualNetwork = recoveryVirtualNetwork + } + case "recoveryProximityPlacementGroup": + if v != nil { + recoveryProximityPlacementGroup, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryProximityPlacementGroup = recoveryProximityPlacementGroup + } + case "autoProtectionOfDataDisk": + if v != nil { + var autoProtectionOfDataDisk AutoProtectionOfDataDisk + err = json.Unmarshal(*v, &autoProtectionOfDataDisk) + if err != nil { + return err + } + arid.AutoProtectionOfDataDisk = autoProtectionOfDataDisk + } + case "multiVmGroupName": + if v != nil { + var multiVMGroupName string + err = json.Unmarshal(*v, &multiVMGroupName) + if err != nil { + return err + } + arid.MultiVMGroupName = &multiVMGroupName + } + case "multiVmGroupId": + if v != nil { + var multiVMGroupID string + err = json.Unmarshal(*v, &multiVMGroupID) + if err != nil { + return err + } + arid.MultiVMGroupID = &multiVMGroupID + } + case "recoveryBootDiagStorageAccount": + if v != nil { + recoveryBootDiagStorageAccount, err := unmarshalBasicStorageAccountCustomDetails(*v) + if err != nil { + return err + } + arid.RecoveryBootDiagStorageAccount = recoveryBootDiagStorageAccount + } + case "diskEncryptionInfo": + if v != nil { + var diskEncryptionInfo DiskEncryptionInfo + err = json.Unmarshal(*v, &diskEncryptionInfo) + if err != nil { + return err + } + arid.DiskEncryptionInfo = &diskEncryptionInfo + } + case "recoveryAvailabilityZone": + if v != nil { + var recoveryAvailabilityZone string + err = json.Unmarshal(*v, &recoveryAvailabilityZone) + if err != nil { + return err + } + arid.RecoveryAvailabilityZone = &recoveryAvailabilityZone + } + case "recoveryAvailabilityType": + if v != nil { + var recoveryAvailabilityType string + err = json.Unmarshal(*v, &recoveryAvailabilityType) + if err != nil { + return err + } + arid.RecoveryAvailabilityType = &recoveryAvailabilityType + } + case "agentAutoUpdateStatus": + if v != nil { + var agentAutoUpdateStatus AgentAutoUpdateStatus + err = json.Unmarshal(*v, &agentAutoUpdateStatus) + if err != nil { + return err + } + arid.AgentAutoUpdateStatus = agentAutoUpdateStatus + } + case "automationAccountArmId": + if v != nil { + var automationAccountArmID string + err = json.Unmarshal(*v, &automationAccountArmID) + if err != nil { + return err + } + arid.AutomationAccountArmID = &automationAccountArmID + } + case "automationAccountAuthenticationType": + if v != nil { + var automationAccountAuthenticationType AutomationAccountAuthenticationType + err = json.Unmarshal(*v, &automationAccountAuthenticationType) + if err != nil { + return err + } + arid.AutomationAccountAuthenticationType = automationAccountAuthenticationType + } + case "instanceType": + if v != nil { + var instanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings + err = json.Unmarshal(*v, &instanceType) + if err != nil { + return err + } + arid.InstanceType = instanceType + } + } + } + + return nil +} + +// A2AReprotectInput azure specific reprotect input. +type A2AReprotectInput struct { + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AReprotectInput. +func (ari A2AReprotectInput) MarshalJSON() ([]byte, error) { + ari.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if ari.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = ari.RecoveryContainerID + } + if ari.VMDisks != nil { + objectMap["vmDisks"] = ari.VMDisks + } + if ari.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = ari.RecoveryResourceGroupID + } + if ari.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = ari.RecoveryCloudServiceID + } + if ari.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = ari.RecoveryAvailabilitySetID + } + if ari.PolicyID != nil { + objectMap["policyId"] = ari.PolicyID + } + if ari.InstanceType != "" { + objectMap["instanceType"] = ari.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return &ari, true +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for A2AReprotectInput. +func (ari A2AReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &ari, true +} + +// A2ASwitchProtectionInput a2A specific switch protection input. +type A2ASwitchProtectionInput struct { + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // VMDisks - The list of vm disk details. + VMDisks *[]A2AVMDiskInputDetails `json:"vmDisks,omitempty"` + // VMManagedDisks - The list of vm managed disk details. + VMManagedDisks *[]A2AVMManagedDiskInputDetails `json:"vmManagedDisks,omitempty"` + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryCloudServiceID - The recovery cloud service Id. Valid for V1 scenarios. + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // RecoveryAvailabilityZone - The recovery availability zone. + RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // RecoveryVirtualMachineScaleSetID - The virtual machine scale set id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput', 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicSwitchProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) MarshalJSON() ([]byte, error) { + aspi.InstanceType = InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aspi.RecoveryContainerID != nil { + objectMap["recoveryContainerId"] = aspi.RecoveryContainerID + } + if aspi.VMDisks != nil { + objectMap["vmDisks"] = aspi.VMDisks + } + if aspi.VMManagedDisks != nil { + objectMap["vmManagedDisks"] = aspi.VMManagedDisks + } + if aspi.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aspi.RecoveryResourceGroupID + } + if aspi.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aspi.RecoveryCloudServiceID + } + if aspi.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = aspi.RecoveryAvailabilitySetID + } + if aspi.PolicyID != nil { + objectMap["policyId"] = aspi.PolicyID + } + if aspi.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aspi.RecoveryBootDiagStorageAccountID + } + if aspi.RecoveryAvailabilityZone != nil { + objectMap["recoveryAvailabilityZone"] = aspi.RecoveryAvailabilityZone + } + if aspi.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aspi.RecoveryProximityPlacementGroupID + } + if aspi.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aspi.RecoveryVirtualMachineScaleSetID + } + if aspi.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = aspi.RecoveryCapacityReservationGroupID + } + if aspi.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aspi.DiskEncryptionInfo + } + if aspi.InstanceType != "" { + objectMap["instanceType"] = aspi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ASwitchProtectionInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) { + return &aspi, true +} + +// AsSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for A2ASwitchProtectionInput. +func (aspi A2ASwitchProtectionInput) AsBasicSwitchProtectionProviderSpecificInput() (BasicSwitchProtectionProviderSpecificInput, bool) { + return &aspi, true +} + +// A2ATestFailoverInput a2A provider specific input for test failover. +type A2ATestFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for TFO or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) MarshalJSON() ([]byte, error) { + atfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if atfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = atfi.RecoveryPointID + } + if atfi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = atfi.CloudServiceCreationOption + } + if atfi.InstanceType != "" { + objectMap["instanceType"] = atfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return &atfi, true +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for A2ATestFailoverInput. +func (atfi A2ATestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &atfi, true +} + +// A2AUnplannedFailoverInput a2A provider specific input for unplanned failover. +type A2AUnplannedFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for failover or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + aufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = aufi.RecoveryPointID + } + if aufi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = aufi.CloudServiceCreationOption + } + if aufi.InstanceType != "" { + objectMap["instanceType"] = aufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return &aufi, true +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for A2AUnplannedFailoverInput. +func (aufi A2AUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &aufi, true +} + +// A2AUnprotectedDiskDetails a2A unprotected disk details. +type A2AUnprotectedDiskDetails struct { + // DiskLunID - The source lun Id for the data disk. + DiskLunID *int32 `json:"diskLunId,omitempty"` + // DiskAutoProtectionStatus - A value indicating whether the disk auto protection is enabled. Possible values include: 'AutoProtectionOfDataDiskDisabled', 'AutoProtectionOfDataDiskEnabled' + DiskAutoProtectionStatus AutoProtectionOfDataDisk `json:"diskAutoProtectionStatus,omitempty"` +} + +// A2AUpdateContainerMappingInput a2A update protection container mapping. +type A2AUpdateContainerMappingInput struct { + // AgentAutoUpdateStatus - A value indicating whether the auto update is enabled. Possible values include: 'Disabled', 'Enabled' + AgentAutoUpdateStatus AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"` + // AutomationAccountArmID - The automation account arm id. + AutomationAccountArmID *string `json:"automationAccountArmId,omitempty"` + // AutomationAccountAuthenticationType - A value indicating the type authentication to use for automation Account. Possible values include: 'AutomationAccountAuthenticationTypeRunAsAccount', 'AutomationAccountAuthenticationTypeSystemAssignedIdentity' + AutomationAccountAuthenticationType AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + aucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aucmi.AgentAutoUpdateStatus != "" { + objectMap["agentAutoUpdateStatus"] = aucmi.AgentAutoUpdateStatus + } + if aucmi.AutomationAccountArmID != nil { + objectMap["automationAccountArmId"] = aucmi.AutomationAccountArmID + } + if aucmi.AutomationAccountAuthenticationType != "" { + objectMap["automationAccountAuthenticationType"] = aucmi.AutomationAccountAuthenticationType + } + if aucmi.InstanceType != "" { + objectMap["instanceType"] = aucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return &aucmi, true +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for A2AUpdateContainerMappingInput. +func (aucmi A2AUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &aucmi, true +} + +// A2AUpdateReplicationProtectedItemInput inMage Azure V2 input to update replication protected item. +type A2AUpdateReplicationProtectedItemInput struct { + // RecoveryCloudServiceID - The target cloud service ARM Id (for V1). + RecoveryCloudServiceID *string `json:"recoveryCloudServiceId,omitempty"` + // RecoveryResourceGroupID - The target resource group ARM Id (for V2). + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ManagedDiskUpdateDetails - Managed disk update details. + ManagedDiskUpdateDetails *[]A2AVMManagedDiskUpdateDetails `json:"managedDiskUpdateDetails,omitempty"` + // RecoveryBootDiagStorageAccountID - The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string `json:"recoveryBootDiagStorageAccountId,omitempty"` + // DiskEncryptionInfo - The recovery os disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // TfoAzureVMName - The user given name for Test Failover VM. + TfoAzureVMName *string `json:"tfoAzureVMName,omitempty"` + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // RecoveryVirtualMachineScaleSetID - The recovery virtual machine scale set Id. + RecoveryVirtualMachineScaleSetID *string `json:"recoveryVirtualMachineScaleSetId,omitempty"` + // RecoveryCapacityReservationGroupID - The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string `json:"recoveryCapacityReservationGroupId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + aurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if aurpii.RecoveryCloudServiceID != nil { + objectMap["recoveryCloudServiceId"] = aurpii.RecoveryCloudServiceID + } + if aurpii.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = aurpii.RecoveryResourceGroupID + } + if aurpii.ManagedDiskUpdateDetails != nil { + objectMap["managedDiskUpdateDetails"] = aurpii.ManagedDiskUpdateDetails + } + if aurpii.RecoveryBootDiagStorageAccountID != nil { + objectMap["recoveryBootDiagStorageAccountId"] = aurpii.RecoveryBootDiagStorageAccountID + } + if aurpii.DiskEncryptionInfo != nil { + objectMap["diskEncryptionInfo"] = aurpii.DiskEncryptionInfo + } + if aurpii.TfoAzureVMName != nil { + objectMap["tfoAzureVMName"] = aurpii.TfoAzureVMName + } + if aurpii.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = aurpii.RecoveryProximityPlacementGroupID + } + if aurpii.RecoveryVirtualMachineScaleSetID != nil { + objectMap["recoveryVirtualMachineScaleSetId"] = aurpii.RecoveryVirtualMachineScaleSetID + } + if aurpii.RecoveryCapacityReservationGroupID != nil { + objectMap["recoveryCapacityReservationGroupId"] = aurpii.RecoveryCapacityReservationGroupID + } + if aurpii.InstanceType != "" { + objectMap["instanceType"] = aurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return &aurpii, true +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for A2AUpdateReplicationProtectedItemInput. +func (aurpii A2AUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &aurpii, true +} + +// A2AVMDiskInputDetails a2A disk input details. +type A2AVMDiskInputDetails struct { + // DiskURI - The disk Uri. + DiskURI *string `json:"diskUri,omitempty"` + // RecoveryAzureStorageAccountID - The recovery VHD storage account Id. + RecoveryAzureStorageAccountID *string `json:"recoveryAzureStorageAccountId,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account Id. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` +} + +// A2AVMManagedDiskInputDetails a2A managed disk input details. +type A2AVMManagedDiskInputDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // PrimaryStagingAzureStorageAccountID - The primary staging storage account Arm Id. + PrimaryStagingAzureStorageAccountID *string `json:"primaryStagingAzureStorageAccountId,omitempty"` + // RecoveryResourceGroupID - The target resource group Arm Id. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type. Its an optional value and will be same as source disk type if not user provided. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` + // DiskEncryptionInfo - The recovery disk encryption information (for one / single pass flows). + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` +} + +// A2AVMManagedDiskUpdateDetails a2A Vm managed disk update details. +type A2AVMManagedDiskUpdateDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // RecoveryTargetDiskAccountType - The target disk type before failover. + RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryReplicaDiskAccountType - The replica disk type before failover. + RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` + // DiskEncryptionInfo - The recovery os disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` + // FailoverDiskName - The target disk name for unplanned failover operation. + FailoverDiskName *string `json:"failoverDiskName,omitempty"` + // TfoDiskName - The target disk name for test failover operation. + TfoDiskName *string `json:"tfoDiskName,omitempty"` +} + +// A2AZoneDetails zone details data. +type A2AZoneDetails struct { + // Source - Source zone info. + Source *string `json:"source,omitempty"` + // Target - The target zone info. + Target *string `json:"target,omitempty"` +} + +// AddDisksInput input for add disk(s) operation. +type AddDisksInput struct { + // Properties - Add disks input properties. + Properties *AddDisksInputProperties `json:"properties,omitempty"` +} + +// AddDisksInputProperties add Disks input properties. +type AddDisksInputProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicAddDisksProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AddDisksInputProperties struct. +func (adip *AddDisksInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicAddDisksProviderSpecificInput(*v) + if err != nil { + return err + } + adip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicAddDisksProviderSpecificInput add Disks provider specific input. +type BasicAddDisksProviderSpecificInput interface { + AsA2AAddDisksInput() (*A2AAddDisksInput, bool) + AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) +} + +// AddDisksProviderSpecificInput add Disks provider specific input. +type AddDisksProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeAddDisksProviderSpecificInput', 'InstanceTypeA2A' + InstanceType InstanceType `json:"instanceType,omitempty"` +} + +func unmarshalBasicAddDisksProviderSpecificInput(body []byte) (BasicAddDisksProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeA2A): + var aadi A2AAddDisksInput + err := json.Unmarshal(body, &aadi) + return aadi, err + default: + var adpsi AddDisksProviderSpecificInput + err := json.Unmarshal(body, &adpsi) + return adpsi, err + } +} +func unmarshalBasicAddDisksProviderSpecificInputArray(body []byte) ([]BasicAddDisksProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + adpsiArray := make([]BasicAddDisksProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + adpsi, err := unmarshalBasicAddDisksProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + adpsiArray[index] = adpsi + } + return adpsiArray, nil +} + +// MarshalJSON is the custom marshaler for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) MarshalJSON() ([]byte, error) { + adpsi.InstanceType = InstanceTypeAddDisksProviderSpecificInput + objectMap := make(map[string]interface{}) + if adpsi.InstanceType != "" { + objectMap["instanceType"] = adpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AAddDisksInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsA2AAddDisksInput() (*A2AAddDisksInput, bool) { + return nil, false +} + +// AsAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsAddDisksProviderSpecificInput() (*AddDisksProviderSpecificInput, bool) { + return &adpsi, true +} + +// AsBasicAddDisksProviderSpecificInput is the BasicAddDisksProviderSpecificInput implementation for AddDisksProviderSpecificInput. +func (adpsi AddDisksProviderSpecificInput) AsBasicAddDisksProviderSpecificInput() (BasicAddDisksProviderSpecificInput, bool) { + return &adpsi, true +} + +// AddRecoveryServicesProviderInput input required to add a provider. +type AddRecoveryServicesProviderInput struct { + // Properties - The properties of an add provider request. + Properties *AddRecoveryServicesProviderInputProperties `json:"properties,omitempty"` +} + +// AddRecoveryServicesProviderInputProperties the properties of an add provider request. +type AddRecoveryServicesProviderInputProperties struct { + // MachineName - The name of the machine where the provider is getting added. + MachineName *string `json:"machineName,omitempty"` + // MachineID - The Id of the machine where the provider is getting added. + MachineID *string `json:"machineId,omitempty"` + // BiosID - The Bios Id of the machine. + BiosID *string `json:"biosId,omitempty"` + // AuthenticationIdentityInput - The identity provider input for DRA authentication. + AuthenticationIdentityInput *IdentityProviderInput `json:"authenticationIdentityInput,omitempty"` + // ResourceAccessIdentityInput - The identity provider input for resource access. + ResourceAccessIdentityInput *IdentityProviderInput `json:"resourceAccessIdentityInput,omitempty"` + // DataPlaneAuthenticationIdentityInput - The identity provider input for data plane authentication. + DataPlaneAuthenticationIdentityInput *IdentityProviderInput `json:"dataPlaneAuthenticationIdentityInput,omitempty"` +} + +// AddVCenterRequest input required to add vCenter. +type AddVCenterRequest struct { + // Properties - The properties of an add vCenter request. + Properties *AddVCenterRequestProperties `json:"properties,omitempty"` +} + +// AddVCenterRequestProperties the properties of an add vCenter request. +type AddVCenterRequestProperties struct { + // FriendlyName - The friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the vCenter to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // ProcessServerID - The process server Id from where the discovery is orchestrated. + ProcessServerID *string `json:"processServerId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The account Id which has privileges to discover the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// AgentDetails agent details. +type AgentDetails struct { + // AgentID - READ-ONLY; The Id of the agent running on the server. + AgentID *string `json:"agentId,omitempty"` + // MachineID - READ-ONLY; The Id of the machine to which the agent is registered. + MachineID *string `json:"machineId,omitempty"` + // BiosID - READ-ONLY; The machine BIOS Id. + BiosID *string `json:"biosId,omitempty"` + // Fqdn - READ-ONLY; The machine FQDN. + Fqdn *string `json:"fqdn,omitempty"` + // Disks - READ-ONLY; The disks. + Disks *[]AgentDiskDetails `json:"disks,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentDetails. +func (ad AgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AgentDiskDetails agent disk details. +type AgentDiskDetails struct { + // DiskID - READ-ONLY; The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LunID - READ-ONLY; The lun of disk. + LunID *int32 `json:"lunId,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentDiskDetails. +func (add AgentDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Alert implements the Alert class. +type Alert struct { + autorest.Response `json:"-"` + // Properties - Alert related data. + Properties *AlertProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Alert. +func (a Alert) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.Properties != nil { + objectMap["properties"] = a.Properties + } + if a.Location != nil { + objectMap["location"] = a.Location + } + return json.Marshal(objectMap) +} + +// AlertCollection collection of alerts. +type AlertCollection struct { + autorest.Response `json:"-"` + // Value - The list of alerts. + Value *[]Alert `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// AlertCollectionIterator provides access to a complete listing of Alert values. +type AlertCollectionIterator struct { + i int + page AlertCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AlertCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AlertCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AlertCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AlertCollectionIterator) Response() AlertCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AlertCollectionIterator) Value() Alert { + if !iter.page.NotDone() { + return Alert{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AlertCollectionIterator type. +func NewAlertCollectionIterator(page AlertCollectionPage) AlertCollectionIterator { + return AlertCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ac AlertCollection) IsEmpty() bool { + return ac.Value == nil || len(*ac.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ac AlertCollection) hasNextLink() bool { + return ac.NextLink != nil && len(*ac.NextLink) != 0 +} + +// alertCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ac AlertCollection) alertCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ac.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ac.NextLink))) +} + +// AlertCollectionPage contains a page of Alert values. +type AlertCollectionPage struct { + fn func(context.Context, AlertCollection) (AlertCollection, error) + ac AlertCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AlertCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ac) + if err != nil { + return err + } + page.ac = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AlertCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AlertCollectionPage) NotDone() bool { + return !page.ac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AlertCollectionPage) Response() AlertCollection { + return page.ac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AlertCollectionPage) Values() []Alert { + if page.ac.IsEmpty() { + return nil + } + return *page.ac.Value +} + +// Creates a new instance of the AlertCollectionPage type. +func NewAlertCollectionPage(cur AlertCollection, getNextPage func(context.Context, AlertCollection) (AlertCollection, error)) AlertCollectionPage { + return AlertCollectionPage{ + fn: getNextPage, + ac: cur, + } +} + +// AlertProperties the properties of an alert. +type AlertProperties struct { + // SendToOwners - A value indicating whether to send email to subscription administrator. + SendToOwners *string `json:"sendToOwners,omitempty"` + // CustomEmailAddresses - The custom email address for sending emails. + CustomEmailAddresses *[]string `json:"customEmailAddresses,omitempty"` + // Locale - The locale for the email notification. + Locale *string `json:"locale,omitempty"` +} + +// ApplianceCollection collection of appliance details. +type ApplianceCollection struct { + autorest.Response `json:"-"` + // Value - The appliance details. + Value *[]ReplicationAppliance `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ApplianceCollectionIterator provides access to a complete listing of ReplicationAppliance values. +type ApplianceCollectionIterator struct { + i int + page ApplianceCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ApplianceCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplianceCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ApplianceCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ApplianceCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ApplianceCollectionIterator) Response() ApplianceCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ApplianceCollectionIterator) Value() ReplicationAppliance { + if !iter.page.NotDone() { + return ReplicationAppliance{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ApplianceCollectionIterator type. +func NewApplianceCollectionIterator(page ApplianceCollectionPage) ApplianceCollectionIterator { + return ApplianceCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ac ApplianceCollection) IsEmpty() bool { + return ac.Value == nil || len(*ac.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ac ApplianceCollection) hasNextLink() bool { + return ac.NextLink != nil && len(*ac.NextLink) != 0 +} + +// applianceCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ac ApplianceCollection) applianceCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ac.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ac.NextLink))) +} + +// ApplianceCollectionPage contains a page of ReplicationAppliance values. +type ApplianceCollectionPage struct { + fn func(context.Context, ApplianceCollection) (ApplianceCollection, error) + ac ApplianceCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ApplianceCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplianceCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ac) + if err != nil { + return err + } + page.ac = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ApplianceCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ApplianceCollectionPage) NotDone() bool { + return !page.ac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ApplianceCollectionPage) Response() ApplianceCollection { + return page.ac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ApplianceCollectionPage) Values() []ReplicationAppliance { + if page.ac.IsEmpty() { + return nil + } + return *page.ac.Value +} + +// Creates a new instance of the ApplianceCollectionPage type. +func NewApplianceCollectionPage(cur ApplianceCollection, getNextPage func(context.Context, ApplianceCollection) (ApplianceCollection, error)) ApplianceCollectionPage { + return ApplianceCollectionPage{ + fn: getNextPage, + ac: cur, + } +} + +// ApplianceQueryParameter query parameter to get appliance. +type ApplianceQueryParameter struct { + // ProviderType - The providerType to be used for fetching appliance details. + ProviderType *string `json:"providerType,omitempty"` +} + +// BasicApplianceSpecificDetails appliance specific details. +type BasicApplianceSpecificDetails interface { + AsInMageRcmApplianceSpecificDetails() (*InMageRcmApplianceSpecificDetails, bool) + AsApplianceSpecificDetails() (*ApplianceSpecificDetails, bool) +} + +// ApplianceSpecificDetails appliance specific details. +type ApplianceSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeApplianceSpecificDetails', 'InstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplianceSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicApplianceSpecificDetails(body []byte) (BasicApplianceSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInMageRcm): + var imrasd InMageRcmApplianceSpecificDetails + err := json.Unmarshal(body, &imrasd) + return imrasd, err + default: + var asd ApplianceSpecificDetails + err := json.Unmarshal(body, &asd) + return asd, err + } +} +func unmarshalBasicApplianceSpecificDetailsArray(body []byte) ([]BasicApplianceSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + asdArray := make([]BasicApplianceSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + asd, err := unmarshalBasicApplianceSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + asdArray[index] = asd + } + return asdArray, nil +} + +// MarshalJSON is the custom marshaler for ApplianceSpecificDetails. +func (asd ApplianceSpecificDetails) MarshalJSON() ([]byte, error) { + asd.InstanceType = InstanceTypeApplianceSpecificDetails + objectMap := make(map[string]interface{}) + if asd.InstanceType != "" { + objectMap["instanceType"] = asd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageRcmApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for ApplianceSpecificDetails. +func (asd ApplianceSpecificDetails) AsInMageRcmApplianceSpecificDetails() (*InMageRcmApplianceSpecificDetails, bool) { + return nil, false +} + +// AsApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for ApplianceSpecificDetails. +func (asd ApplianceSpecificDetails) AsApplianceSpecificDetails() (*ApplianceSpecificDetails, bool) { + return &asd, true +} + +// AsBasicApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for ApplianceSpecificDetails. +func (asd ApplianceSpecificDetails) AsBasicApplianceSpecificDetails() (BasicApplianceSpecificDetails, bool) { + return &asd, true +} + +// ApplyRecoveryPointInput input to apply recovery point. +type ApplyRecoveryPointInput struct { + // Properties - The input properties to apply recovery point. + Properties *ApplyRecoveryPointInputProperties `json:"properties,omitempty"` +} + +// ApplyRecoveryPointInputProperties input properties to apply recovery point. +type ApplyRecoveryPointInputProperties struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // ProviderSpecificDetails - Provider specific input for applying recovery point. + ProviderSpecificDetails BasicApplyRecoveryPointProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ApplyRecoveryPointInputProperties struct. +func (arpip *ApplyRecoveryPointInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryPointId": + if v != nil { + var recoveryPointID string + err = json.Unmarshal(*v, &recoveryPointID) + if err != nil { + return err + } + arpip.RecoveryPointID = &recoveryPointID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicApplyRecoveryPointProviderSpecificInput(*v) + if err != nil { + return err + } + arpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicApplyRecoveryPointProviderSpecificInput provider specific input for apply recovery point. +type BasicApplyRecoveryPointProviderSpecificInput interface { + AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) + AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) + AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) + AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) + AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) + AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) +} + +// ApplyRecoveryPointProviderSpecificInput provider specific input for apply recovery point. +type ApplyRecoveryPointProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicApplyRecoveryPointProviderSpecificInput(body []byte) (BasicApplyRecoveryPointProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A): + var aarpi A2AApplyRecoveryPointInput + err := json.Unmarshal(body, &aarpi) + return aarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmarpi A2ACrossClusterMigrationApplyRecoveryPointInput + err := json.Unmarshal(body, &accmarpi) + return accmarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraarpi HyperVReplicaAzureApplyRecoveryPointInput + err := json.Unmarshal(body, &hvraarpi) + return hvraarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2): + var imavarpi InMageAzureV2ApplyRecoveryPointInput + err := json.Unmarshal(body, &imavarpi) + return imavarpi, err + case string(InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm): + var imrarpi InMageRcmApplyRecoveryPointInput + err := json.Unmarshal(body, &imrarpi) + return imrarpi, err + default: + var arppsi ApplyRecoveryPointProviderSpecificInput + err := json.Unmarshal(body, &arppsi) + return arppsi, err + } +} +func unmarshalBasicApplyRecoveryPointProviderSpecificInputArray(body []byte) ([]BasicApplyRecoveryPointProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + arppsiArray := make([]BasicApplyRecoveryPointProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + arppsi, err := unmarshalBasicApplyRecoveryPointProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + arppsiArray[index] = arppsi + } + return arppsiArray, nil +} + +// MarshalJSON is the custom marshaler for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) MarshalJSON() ([]byte, error) { + arppsi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput + objectMap := make(map[string]interface{}) + if arppsi.InstanceType != "" { + objectMap["instanceType"] = arppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return &arppsi, true +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for ApplyRecoveryPointProviderSpecificInput. +func (arppsi ApplyRecoveryPointProviderSpecificInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &arppsi, true +} + +// AsrJobDetails this class represents job details based on specific job type. +type AsrJobDetails struct { + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AsrJobDetails. +func (ajd AsrJobDetails) MarshalJSON() ([]byte, error) { + ajd.InstanceType = InstanceTypeAsrJobDetails + objectMap := make(map[string]interface{}) + if ajd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = ajd.AffectedObjectDetails + } + if ajd.InstanceType != "" { + objectMap["instanceType"] = ajd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return &ajd, true +} + +// AsExportJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for AsrJobDetails. +func (ajd AsrJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &ajd, true +} + +// ASRTask task of the Job. +type ASRTask struct { + // TaskID - The Id. + TaskID *string `json:"taskId,omitempty"` + // Name - The unique Task name. + Name *string `json:"name,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // AllowedActions - The state/actions applicable on this task. + AllowedActions *[]string `json:"allowedActions,omitempty"` + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // State - The State. It is one of these values - NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or Other. + State *string `json:"state,omitempty"` + // StateDescription - The description of the task state. For example - For Succeeded state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. + StateDescription *string `json:"stateDescription,omitempty"` + // TaskType - The type of task. Details in CustomDetails property depend on this type. + TaskType *string `json:"taskType,omitempty"` + // CustomDetails - The custom task details based on the task type. + CustomDetails BasicTaskTypeDetails `json:"customDetails,omitempty"` + // GroupTaskCustomDetails - The custom task details based on the task type, if the task type is GroupTaskDetails or one of the types derived from it. + GroupTaskCustomDetails BasicGroupTaskDetails `json:"groupTaskCustomDetails,omitempty"` + // Errors - The task error details. + Errors *[]JobErrorDetails `json:"errors,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ASRTask struct. +func (at *ASRTask) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "taskId": + if v != nil { + var taskID string + err = json.Unmarshal(*v, &taskID) + if err != nil { + return err + } + at.TaskID = &taskID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + at.Name = &name + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + at.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + at.EndTime = &endTime + } + case "allowedActions": + if v != nil { + var allowedActions []string + err = json.Unmarshal(*v, &allowedActions) + if err != nil { + return err + } + at.AllowedActions = &allowedActions + } + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + at.FriendlyName = &friendlyName + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + at.State = &state + } + case "stateDescription": + if v != nil { + var stateDescription string + err = json.Unmarshal(*v, &stateDescription) + if err != nil { + return err + } + at.StateDescription = &stateDescription + } + case "taskType": + if v != nil { + var taskType string + err = json.Unmarshal(*v, &taskType) + if err != nil { + return err + } + at.TaskType = &taskType + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicTaskTypeDetails(*v) + if err != nil { + return err + } + at.CustomDetails = customDetails + } + case "groupTaskCustomDetails": + if v != nil { + groupTaskCustomDetails, err := unmarshalBasicGroupTaskDetails(*v) + if err != nil { + return err + } + at.GroupTaskCustomDetails = groupTaskCustomDetails + } + case "errors": + if v != nil { + var errorsVar []JobErrorDetails + err = json.Unmarshal(*v, &errorsVar) + if err != nil { + return err + } + at.Errors = &errorsVar + } + } + } + + return nil +} + +// AutomationRunbookTaskDetails this class represents the task details for an automation runbook. +type AutomationRunbookTaskDetails struct { + // Name - The recovery plan task name. + Name *string `json:"name,omitempty"` + // CloudServiceName - The cloud service of the automation runbook account. + CloudServiceName *string `json:"cloudServiceName,omitempty"` + // SubscriptionID - The subscription Id of the automation runbook account. + SubscriptionID *string `json:"subscriptionId,omitempty"` + // AccountName - The automation account name of the runbook. + AccountName *string `json:"accountName,omitempty"` + // RunbookID - The runbook Id. + RunbookID *string `json:"runbookId,omitempty"` + // RunbookName - The runbook name. + RunbookName *string `json:"runbookName,omitempty"` + // JobID - The job Id of the runbook execution. + JobID *string `json:"jobId,omitempty"` + // JobOutput - The execution output of the runbook. + JobOutput *string `json:"jobOutput,omitempty"` + // IsPrimarySideScript - A value indicating whether it is a primary side script or not. + IsPrimarySideScript *bool `json:"isPrimarySideScript,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) MarshalJSON() ([]byte, error) { + artd.InstanceType = InstanceTypeAutomationRunbookTaskDetails + objectMap := make(map[string]interface{}) + if artd.Name != nil { + objectMap["name"] = artd.Name + } + if artd.CloudServiceName != nil { + objectMap["cloudServiceName"] = artd.CloudServiceName + } + if artd.SubscriptionID != nil { + objectMap["subscriptionId"] = artd.SubscriptionID + } + if artd.AccountName != nil { + objectMap["accountName"] = artd.AccountName + } + if artd.RunbookID != nil { + objectMap["runbookId"] = artd.RunbookID + } + if artd.RunbookName != nil { + objectMap["runbookName"] = artd.RunbookName + } + if artd.JobID != nil { + objectMap["jobId"] = artd.JobID + } + if artd.JobOutput != nil { + objectMap["jobOutput"] = artd.JobOutput + } + if artd.IsPrimarySideScript != nil { + objectMap["isPrimarySideScript"] = artd.IsPrimarySideScript + } + if artd.InstanceType != "" { + objectMap["instanceType"] = artd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return &artd, true +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for AutomationRunbookTaskDetails. +func (artd AutomationRunbookTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &artd, true +} + +// AzureFabricCreationInput fabric provider specific settings. +type AzureFabricCreationInput struct { + // Location - The Location. + Location *string `json:"location,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) MarshalJSON() ([]byte, error) { + afci.InstanceType = InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure + objectMap := make(map[string]interface{}) + if afci.Location != nil { + objectMap["location"] = afci.Location + } + if afci.InstanceType != "" { + objectMap["instanceType"] = afci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return &afci, true +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for AzureFabricCreationInput. +func (afci AzureFabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &afci, true +} + +// AzureFabricSpecificDetails azure Fabric Specific Details. +type AzureFabricSpecificDetails struct { + // Location - The Location for the Azure fabric. + Location *string `json:"location,omitempty"` + // ContainerIds - The container Ids for the Azure fabric. + ContainerIds *[]string `json:"containerIds,omitempty"` + // Zones - The zones. + Zones *[]A2AZoneDetails `json:"zones,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) MarshalJSON() ([]byte, error) { + afsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure + objectMap := make(map[string]interface{}) + if afsd.Location != nil { + objectMap["location"] = afsd.Location + } + if afsd.ContainerIds != nil { + objectMap["containerIds"] = afsd.ContainerIds + } + if afsd.Zones != nil { + objectMap["zones"] = afsd.Zones + } + if afsd.InstanceType != "" { + objectMap["instanceType"] = afsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return &afsd, true +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for AzureFabricSpecificDetails. +func (afsd AzureFabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &afsd, true +} + +// AzureToAzureCreateNetworkMappingInput create network mappings input properties/behavior specific to +// Azure to Azure Network mapping. +type AzureToAzureCreateNetworkMappingInput struct { + // PrimaryNetworkID - The primary azure vnet Id. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + atacnmi.InstanceType = InstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if atacnmi.PrimaryNetworkID != nil { + objectMap["primaryNetworkId"] = atacnmi.PrimaryNetworkID + } + if atacnmi.InstanceType != "" { + objectMap["instanceType"] = atacnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return &atacnmi, true +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for AzureToAzureCreateNetworkMappingInput. +func (atacnmi AzureToAzureCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &atacnmi, true +} + +// AzureToAzureNetworkMappingSettings a2A Network Mapping fabric specific settings. +type AzureToAzureNetworkMappingSettings struct { + // PrimaryFabricLocation - The primary fabric location. + PrimaryFabricLocation *string `json:"primaryFabricLocation,omitempty"` + // RecoveryFabricLocation - The recovery fabric location. + RecoveryFabricLocation *string `json:"recoveryFabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) MarshalJSON() ([]byte, error) { + atanms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if atanms.PrimaryFabricLocation != nil { + objectMap["primaryFabricLocation"] = atanms.PrimaryFabricLocation + } + if atanms.RecoveryFabricLocation != nil { + objectMap["recoveryFabricLocation"] = atanms.RecoveryFabricLocation + } + if atanms.InstanceType != "" { + objectMap["instanceType"] = atanms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return &atanms, true +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for AzureToAzureNetworkMappingSettings. +func (atanms AzureToAzureNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &atanms, true +} + +// AzureToAzureUpdateNetworkMappingInput updates network mappings input. +type AzureToAzureUpdateNetworkMappingInput struct { + // PrimaryNetworkID - The primary azure vnet Id. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + ataunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure + objectMap := make(map[string]interface{}) + if ataunmi.PrimaryNetworkID != nil { + objectMap["primaryNetworkId"] = ataunmi.PrimaryNetworkID + } + if ataunmi.InstanceType != "" { + objectMap["instanceType"] = ataunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return &ataunmi, true +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for AzureToAzureUpdateNetworkMappingInput. +func (ataunmi AzureToAzureUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &ataunmi, true +} + +// AzureToAzureVMSyncedConfigDetails azure to Azure VM synced configuration details. +type AzureToAzureVMSyncedConfigDetails struct { + // Tags - The Azure VM tags. + Tags map[string]*string `json:"tags"` + // InputEndpoints - The Azure VM input endpoints. + InputEndpoints *[]InputEndpoint `json:"inputEndpoints,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureToAzureVMSyncedConfigDetails. +func (atavscd AzureToAzureVMSyncedConfigDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if atavscd.Tags != nil { + objectMap["tags"] = atavscd.Tags + } + if atavscd.InputEndpoints != nil { + objectMap["inputEndpoints"] = atavscd.InputEndpoints + } + return json.Marshal(objectMap) +} + +// AzureVMDiskDetails disk details for E2A provider. +type AzureVMDiskDetails struct { + // VhdType - VHD type. + VhdType *string `json:"vhdType,omitempty"` + // VhdID - The VHD id. + VhdID *string `json:"vhdId,omitempty"` + // DiskID - The disk resource id. + DiskID *string `json:"diskId,omitempty"` + // VhdName - VHD name. + VhdName *string `json:"vhdName,omitempty"` + // MaxSizeMB - Max side in MB. + MaxSizeMB *string `json:"maxSizeMB,omitempty"` + // TargetDiskLocation - Blob uri of the Azure disk. + TargetDiskLocation *string `json:"targetDiskLocation,omitempty"` + // TargetDiskName - The target Azure disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` + // LunID - Ordinal\LunId of the disk for the Azure VM. + LunID *string `json:"lunId,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // CustomTargetDiskName - The custom target Azure disk name. + CustomTargetDiskName *string `json:"customTargetDiskName,omitempty"` +} + +// ComputeSizeErrorDetails represents the error used to indicate why the target compute size is not +// applicable. +type ComputeSizeErrorDetails struct { + // Message - The error message. + Message *string `json:"message,omitempty"` + // Severity - The severity of the error. + Severity *string `json:"severity,omitempty"` +} + +// BasicConfigurationSettings replication provider specific settings. +type BasicConfigurationSettings interface { + AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) + AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) + AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) + AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) + AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) + AsConfigurationSettings() (*ConfigurationSettings, bool) +} + +// ConfigurationSettings replication provider specific settings. +type ConfigurationSettings struct { + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicConfigurationSettings(body []byte) (BasicConfigurationSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeHyperVVirtualMachine): + var hvvmd HyperVVirtualMachineDetails + err := json.Unmarshal(body, &hvvmd) + return hvvmd, err + case string(InstanceTypeReplicationGroupDetails): + var rgd ReplicationGroupDetails + err := json.Unmarshal(body, &rgd) + return rgd, err + case string(InstanceTypeVmmVirtualMachine): + var vvmd VmmVirtualMachineDetails + err := json.Unmarshal(body, &vvmd) + return vvmd, err + case string(InstanceTypeVMwareVirtualMachine): + var vmvmd VMwareVirtualMachineDetails + err := json.Unmarshal(body, &vmvmd) + return vmvmd, err + default: + var cs ConfigurationSettings + err := json.Unmarshal(body, &cs) + return cs, err + } +} +func unmarshalBasicConfigurationSettingsArray(body []byte) ([]BasicConfigurationSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + csArray := make([]BasicConfigurationSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cs, err := unmarshalBasicConfigurationSettings(*rawMessage) + if err != nil { + return nil, err + } + csArray[index] = cs + } + return csArray, nil +} + +// MarshalJSON is the custom marshaler for ConfigurationSettings. +func (cs ConfigurationSettings) MarshalJSON() ([]byte, error) { + cs.InstanceType = InstanceTypeConfigurationSettings + objectMap := make(map[string]interface{}) + if cs.InstanceType != "" { + objectMap["instanceType"] = cs.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return &cs, true +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for ConfigurationSettings. +func (cs ConfigurationSettings) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &cs, true +} + +// ConfigureAlertRequest request to configure alerts for the system. +type ConfigureAlertRequest struct { + // Properties - The properties of a configure alert request. + Properties *ConfigureAlertRequestProperties `json:"properties,omitempty"` +} + +// ConfigureAlertRequestProperties properties of a configure alert request. +type ConfigureAlertRequestProperties struct { + // SendToOwners - A value indicating whether to send email to subscription administrator. + SendToOwners *string `json:"sendToOwners,omitempty"` + // CustomEmailAddresses - The custom email address for sending emails. + CustomEmailAddresses *[]string `json:"customEmailAddresses,omitempty"` + // Locale - The locale for the email notification. + Locale *string `json:"locale,omitempty"` +} + +// ConsistencyCheckTaskDetails this class contains monitoring details of all the inconsistent Protected +// Entities in Vmm. +type ConsistencyCheckTaskDetails struct { + // VMDetails - The list of inconsistent Vm details. + VMDetails *[]InconsistentVMDetails `json:"vmDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) MarshalJSON() ([]byte, error) { + cctd.InstanceType = InstanceTypeConsistencyCheckTaskDetails + objectMap := make(map[string]interface{}) + if cctd.VMDetails != nil { + objectMap["vmDetails"] = cctd.VMDetails + } + if cctd.InstanceType != "" { + objectMap["instanceType"] = cctd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return &cctd, true +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ConsistencyCheckTaskDetails. +func (cctd ConsistencyCheckTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &cctd, true +} + +// CreateNetworkMappingInput create network mappings input. +type CreateNetworkMappingInput struct { + // Properties - Input properties for creating network mapping. + Properties *CreateNetworkMappingInputProperties `json:"properties,omitempty"` +} + +// CreateNetworkMappingInputProperties common input details for network mapping operation. +type CreateNetworkMappingInputProperties struct { + // RecoveryFabricName - Recovery fabric Name. + RecoveryFabricName *string `json:"recoveryFabricName,omitempty"` + // RecoveryNetworkID - Recovery network Id. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // FabricSpecificDetails - Fabric specific input properties. + FabricSpecificDetails BasicFabricSpecificCreateNetworkMappingInput `json:"fabricSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateNetworkMappingInputProperties struct. +func (cnmip *CreateNetworkMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryFabricName": + if v != nil { + var recoveryFabricName string + err = json.Unmarshal(*v, &recoveryFabricName) + if err != nil { + return err + } + cnmip.RecoveryFabricName = &recoveryFabricName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + cnmip.RecoveryNetworkID = &recoveryNetworkID + } + case "fabricSpecificDetails": + if v != nil { + fabricSpecificDetails, err := unmarshalBasicFabricSpecificCreateNetworkMappingInput(*v) + if err != nil { + return err + } + cnmip.FabricSpecificDetails = fabricSpecificDetails + } + } + } + + return nil +} + +// CreatePolicyInput protection Policy input. +type CreatePolicyInput struct { + // Properties - Policy creation properties. + Properties *CreatePolicyInputProperties `json:"properties,omitempty"` +} + +// CreatePolicyInputProperties policy creation properties. +type CreatePolicyInputProperties struct { + // ProviderSpecificInput - The ReplicationProviderSettings. + ProviderSpecificInput BasicPolicyProviderSpecificInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreatePolicyInputProperties struct. +func (cpip *CreatePolicyInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicPolicyProviderSpecificInput(*v) + if err != nil { + return err + } + cpip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionContainerInput create protection container input. +type CreateProtectionContainerInput struct { + // Properties - Create protection container input properties. + Properties *CreateProtectionContainerInputProperties `json:"properties,omitempty"` +} + +// CreateProtectionContainerInputProperties create protection container input properties. +type CreateProtectionContainerInputProperties struct { + // ProviderSpecificInput - Provider specific inputs for container creation. + ProviderSpecificInput *[]BasicReplicationProviderSpecificContainerCreationInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionContainerInputProperties struct. +func (cpcip *CreateProtectionContainerInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificContainerCreationInputArray(*v) + if err != nil { + return err + } + cpcip.ProviderSpecificInput = &providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionContainerMappingInput configure pairing input. +type CreateProtectionContainerMappingInput struct { + // Properties - Configure protection input properties. + Properties *CreateProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// CreateProtectionContainerMappingInputProperties configure pairing input properties. +type CreateProtectionContainerMappingInputProperties struct { + // TargetProtectionContainerID - The target unique protection container name. + TargetProtectionContainerID *string `json:"targetProtectionContainerId,omitempty"` + // PolicyID - Applicable policy. + PolicyID *string `json:"policyId,omitempty"` + // ProviderSpecificInput - Provider specific input for pairing. + ProviderSpecificInput BasicReplicationProviderSpecificContainerMappingInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionContainerMappingInputProperties struct. +func (cpcmip *CreateProtectionContainerMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetProtectionContainerId": + if v != nil { + var targetProtectionContainerID string + err = json.Unmarshal(*v, &targetProtectionContainerID) + if err != nil { + return err + } + cpcmip.TargetProtectionContainerID = &targetProtectionContainerID + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + cpcmip.PolicyID = &policyID + } + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificContainerMappingInput(*v) + if err != nil { + return err + } + cpcmip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// CreateProtectionIntentInput create protection intent input. +type CreateProtectionIntentInput struct { + // Properties - Create protection intent input properties. + Properties *CreateProtectionIntentProperties `json:"properties,omitempty"` +} + +// CreateProtectionIntentProperties create protection intent input properties. +type CreateProtectionIntentProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For A2A provider, it will be A2ACreateProtectionIntentInput object. + ProviderSpecificDetails BasicCreateProtectionIntentProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateProtectionIntentProperties struct. +func (cpip *CreateProtectionIntentProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicCreateProtectionIntentProviderSpecificDetails(*v) + if err != nil { + return err + } + cpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicCreateProtectionIntentProviderSpecificDetails create protection intent provider specific input. +type BasicCreateProtectionIntentProviderSpecificDetails interface { + AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) + AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) +} + +// CreateProtectionIntentProviderSpecificDetails create protection intent provider specific input. +type CreateProtectionIntentProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails', 'InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicCreateProtectionIntentProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicCreateProtectionIntentProviderSpecificDetails(body []byte) (BasicCreateProtectionIntentProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeA2A): + var acpii A2ACreateProtectionIntentInput + err := json.Unmarshal(body, &acpii) + return acpii, err + default: + var cpipsd CreateProtectionIntentProviderSpecificDetails + err := json.Unmarshal(body, &cpipsd) + return cpipsd, err + } +} +func unmarshalBasicCreateProtectionIntentProviderSpecificDetailsArray(body []byte) ([]BasicCreateProtectionIntentProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + cpipsdArray := make([]BasicCreateProtectionIntentProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cpipsd, err := unmarshalBasicCreateProtectionIntentProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + cpipsdArray[index] = cpipsd + } + return cpipsdArray, nil +} + +// MarshalJSON is the custom marshaler for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) MarshalJSON() ([]byte, error) { + cpipsd.InstanceType = InstanceTypeBasicCreateProtectionIntentProviderSpecificDetailsInstanceTypeCreateProtectionIntentProviderSpecificDetails + objectMap := make(map[string]interface{}) + if cpipsd.InstanceType != "" { + objectMap["instanceType"] = cpipsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACreateProtectionIntentInput is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsA2ACreateProtectionIntentInput() (*A2ACreateProtectionIntentInput, bool) { + return nil, false +} + +// AsCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsCreateProtectionIntentProviderSpecificDetails() (*CreateProtectionIntentProviderSpecificDetails, bool) { + return &cpipsd, true +} + +// AsBasicCreateProtectionIntentProviderSpecificDetails is the BasicCreateProtectionIntentProviderSpecificDetails implementation for CreateProtectionIntentProviderSpecificDetails. +func (cpipsd CreateProtectionIntentProviderSpecificDetails) AsBasicCreateProtectionIntentProviderSpecificDetails() (BasicCreateProtectionIntentProviderSpecificDetails, bool) { + return &cpipsd, true +} + +// CreateRecoveryPlanInput create recovery plan input class. +type CreateRecoveryPlanInput struct { + // Properties - Recovery plan creation properties. + Properties *CreateRecoveryPlanInputProperties `json:"properties,omitempty"` +} + +// CreateRecoveryPlanInputProperties recovery plan creation properties. +type CreateRecoveryPlanInputProperties struct { + // PrimaryFabricID - The primary fabric Id. + PrimaryFabricID *string `json:"primaryFabricId,omitempty"` + // RecoveryFabricID - The recovery fabric Id. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // FailoverDeploymentModel - The failover deployment model. Possible values include: 'NotApplicable', 'Classic', 'ResourceManager' + FailoverDeploymentModel FailoverDeploymentModel `json:"failoverDeploymentModel,omitempty"` + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` + // ProviderSpecificInput - The provider specific input. + ProviderSpecificInput *[]BasicRecoveryPlanProviderSpecificInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CreateRecoveryPlanInputProperties struct. +func (crpip *CreateRecoveryPlanInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "primaryFabricId": + if v != nil { + var primaryFabricID string + err = json.Unmarshal(*v, &primaryFabricID) + if err != nil { + return err + } + crpip.PrimaryFabricID = &primaryFabricID + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + crpip.RecoveryFabricID = &recoveryFabricID + } + case "failoverDeploymentModel": + if v != nil { + var failoverDeploymentModel FailoverDeploymentModel + err = json.Unmarshal(*v, &failoverDeploymentModel) + if err != nil { + return err + } + crpip.FailoverDeploymentModel = failoverDeploymentModel + } + case "groups": + if v != nil { + var groups []RecoveryPlanGroup + err = json.Unmarshal(*v, &groups) + if err != nil { + return err + } + crpip.Groups = &groups + } + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicRecoveryPlanProviderSpecificInputArray(*v) + if err != nil { + return err + } + crpip.ProviderSpecificInput = &providerSpecificInput + } + } + } + + return nil +} + +// CurrentJobDetails current job details of the migration item. +type CurrentJobDetails struct { + // JobName - READ-ONLY; The job name. + JobName *string `json:"jobName,omitempty"` + // JobID - READ-ONLY; The ARM Id of the job being executed. + JobID *string `json:"jobId,omitempty"` + // StartTime - READ-ONLY; The start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for CurrentJobDetails. +func (cjd CurrentJobDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CurrentScenarioDetails current scenario details of the protected entity. +type CurrentScenarioDetails struct { + // ScenarioName - Scenario name. + ScenarioName *string `json:"scenarioName,omitempty"` + // JobID - ARM Id of the job being executed. + JobID *string `json:"jobId,omitempty"` + // StartTime - Start time of the workflow. + StartTime *date.Time `json:"startTime,omitempty"` +} + +// DataStore the datastore details of the MT. +type DataStore struct { + // SymbolicName - The symbolic name of data store. + SymbolicName *string `json:"symbolicName,omitempty"` + // UUID - The uuid of data store. + UUID *string `json:"uuid,omitempty"` + // Capacity - The capacity of data store in GBs. + Capacity *string `json:"capacity,omitempty"` + // FreeSpace - The free space of data store in GBs. + FreeSpace *string `json:"freeSpace,omitempty"` + // Type - The type of data store. + Type *string `json:"type,omitempty"` +} + +// DisableProtectionInput disable protection input. +type DisableProtectionInput struct { + // Properties - Disable protection input properties. + Properties *DisableProtectionInputProperties `json:"properties,omitempty"` +} + +// DisableProtectionInputProperties disable protection input properties. +type DisableProtectionInputProperties struct { + // DisableProtectionReason - Disable protection reason. It can have values NotSpecified/MigrationComplete. Possible values include: 'NotSpecified', 'MigrationComplete' + DisableProtectionReason DisableProtectionReason `json:"disableProtectionReason,omitempty"` + // ReplicationProviderInput - Replication provider specific input. + ReplicationProviderInput BasicDisableProtectionProviderSpecificInput `json:"replicationProviderInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DisableProtectionInputProperties struct. +func (dpip *DisableProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "disableProtectionReason": + if v != nil { + var disableProtectionReason DisableProtectionReason + err = json.Unmarshal(*v, &disableProtectionReason) + if err != nil { + return err + } + dpip.DisableProtectionReason = disableProtectionReason + } + case "replicationProviderInput": + if v != nil { + replicationProviderInput, err := unmarshalBasicDisableProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + dpip.ReplicationProviderInput = replicationProviderInput + } + } + } + + return nil +} + +// BasicDisableProtectionProviderSpecificInput disable protection provider specific input. +type BasicDisableProtectionProviderSpecificInput interface { + AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) + AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) +} + +// DisableProtectionProviderSpecificInput disable protection provider specific input. +type DisableProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeDisableProtectionProviderSpecificInput', 'InstanceTypeInMage' + InstanceType InstanceTypeBasicDisableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicDisableProtectionProviderSpecificInput(body []byte) (BasicDisableProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInMage): + var imdppsi InMageDisableProtectionProviderSpecificInput + err := json.Unmarshal(body, &imdppsi) + return imdppsi, err + default: + var dppsi DisableProtectionProviderSpecificInput + err := json.Unmarshal(body, &dppsi) + return dppsi, err + } +} +func unmarshalBasicDisableProtectionProviderSpecificInputArray(body []byte) ([]BasicDisableProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dppsiArray := make([]BasicDisableProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + dppsi, err := unmarshalBasicDisableProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + dppsiArray[index] = dppsi + } + return dppsiArray, nil +} + +// MarshalJSON is the custom marshaler for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + dppsi.InstanceType = InstanceTypeDisableProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if dppsi.InstanceType != "" { + objectMap["instanceType"] = dppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) { + return &dppsi, true +} + +// AsBasicDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for DisableProtectionProviderSpecificInput. +func (dppsi DisableProtectionProviderSpecificInput) AsBasicDisableProtectionProviderSpecificInput() (BasicDisableProtectionProviderSpecificInput, bool) { + return &dppsi, true +} + +// DiscoverProtectableItemRequest request to add a physical machine as a protectable item in a container. +type DiscoverProtectableItemRequest struct { + // Properties - The properties of a discover protectable item request. + Properties *DiscoverProtectableItemRequestProperties `json:"properties,omitempty"` +} + +// DiscoverProtectableItemRequestProperties discover protectable item properties. +type DiscoverProtectableItemRequestProperties struct { + // FriendlyName - The friendly name of the physical machine. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the physical machine to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // OsType - The OS type on the physical machine. + OsType *string `json:"osType,omitempty"` +} + +// DiskDetails onprem disk details data. +type DiskDetails struct { + // MaxSizeMB - The hard disk max size in MB. + MaxSizeMB *int64 `json:"maxSizeMB,omitempty"` + // VhdType - The type of the volume. + VhdType *string `json:"vhdType,omitempty"` + // VhdID - The VHD Id. + VhdID *string `json:"vhdId,omitempty"` + // VhdName - The VHD name. + VhdName *string `json:"vhdName,omitempty"` +} + +// DiskEncryptionInfo recovery disk encryption info (BEK and KEK). +type DiskEncryptionInfo struct { + // DiskEncryptionKeyInfo - The recovery KeyVault reference for secret. + DiskEncryptionKeyInfo *DiskEncryptionKeyInfo `json:"diskEncryptionKeyInfo,omitempty"` + // KeyEncryptionKeyInfo - The recovery KeyVault reference for key. + KeyEncryptionKeyInfo *KeyEncryptionKeyInfo `json:"keyEncryptionKeyInfo,omitempty"` +} + +// DiskEncryptionKeyInfo disk Encryption Key Information (BitLocker Encryption Key (BEK) on Windows). +type DiskEncryptionKeyInfo struct { + // SecretIdentifier - The secret url / identifier. + SecretIdentifier *string `json:"secretIdentifier,omitempty"` + // KeyVaultResourceArmID - The KeyVault resource ARM id for secret. + KeyVaultResourceArmID *string `json:"keyVaultResourceArmId,omitempty"` +} + +// DiskVolumeDetails volume details. +type DiskVolumeDetails struct { + // Label - The volume label. + Label *string `json:"label,omitempty"` + // Name - The volume name. + Name *string `json:"name,omitempty"` +} + +// Display contains the localized display information for this particular operation / action. These value +// will be used by several clients for (1) custom role definitions for RBAC; (2) complex query filters for +// the event service; and (3) audit history / records for management operations. +type Display struct { + // Provider - The provider. The localized friendly form of the resource provider name - it is expected to also include the publisher/company responsible. It should use Title Casing and begin with "Microsoft" for 1st party services. e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". + Provider *string `json:"provider,omitempty"` + // Resource - The resource. The localized friendly form of the resource related to this action/operation - it should match the public documentation for the resource provider. It should use Title Casing. This value should be unique for a particular URL type (e.g. nested types should *not* reuse their parent's display.resource field). e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual Machine VM Sizes" or "Scheduler Jobs". + Resource *string `json:"resource,omitempty"` + // Operation - The operation. The localized friendly name for the operation, as it should be shown to the user. It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use Title Casing. Prescriptive guidance: Read Create or Update Delete 'ActionName'. + Operation *string `json:"operation,omitempty"` + // Description - The description. The localized friendly description for the operation, as it should be shown to the user. It should be thorough, yet concise - it will be used in tool tips and detailed views. Prescriptive guidance for namespaces: Read any 'display.provider' resource Create or Update any 'display.provider' resource Delete any 'display.provider' resource Perform any other action on any 'display.provider' resource Prescriptive guidance for namespaces: Read any 'display.resource' Create or Update any 'display.resource' Delete any 'display.resource' 'ActionName' any 'display.resources'. + Description *string `json:"description,omitempty"` +} + +// DraDetails DRA details. +type DraDetails struct { + // ID - READ-ONLY; The DRA Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The DRA name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The DRA Bios Id. + BiosID *string `json:"biosId,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the DRA. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // ForwardProtectedItemCount - READ-ONLY; The count of protected items which are protected in forward direction. + ForwardProtectedItemCount *int32 `json:"forwardProtectedItemCount,omitempty"` + // ReverseProtectedItemCount - READ-ONLY; The count of protected items which are protected in reverse direction. + ReverseProtectedItemCount *int32 `json:"reverseProtectedItemCount,omitempty"` +} + +// MarshalJSON is the custom marshaler for DraDetails. +func (dd DraDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// EnableMigrationInput enable migration input. +type EnableMigrationInput struct { + // Properties - Enable migration input properties. + Properties *EnableMigrationInputProperties `json:"properties,omitempty"` +} + +// EnableMigrationInputProperties enable migration input properties. +type EnableMigrationInputProperties struct { + // PolicyID - The policy Id. + PolicyID *string `json:"policyId,omitempty"` + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicEnableMigrationProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EnableMigrationInputProperties struct. +func (emip *EnableMigrationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + emip.PolicyID = &policyID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEnableMigrationProviderSpecificInput(*v) + if err != nil { + return err + } + emip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicEnableMigrationProviderSpecificInput enable migration provider specific input. +type BasicEnableMigrationProviderSpecificInput interface { + AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) + AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) +} + +// EnableMigrationProviderSpecificInput enable migration provider specific input. +type EnableMigrationProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeEnableMigrationProviderSpecificInput', 'InstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEnableMigrationProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicEnableMigrationProviderSpecificInput(body []byte) (BasicEnableMigrationProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeVMwareCbt): + var vmcemi VMwareCbtEnableMigrationInput + err := json.Unmarshal(body, &vmcemi) + return vmcemi, err + default: + var empsi EnableMigrationProviderSpecificInput + err := json.Unmarshal(body, &empsi) + return empsi, err + } +} +func unmarshalBasicEnableMigrationProviderSpecificInputArray(body []byte) ([]BasicEnableMigrationProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + empsiArray := make([]BasicEnableMigrationProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + empsi, err := unmarshalBasicEnableMigrationProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + empsiArray[index] = empsi + } + return empsiArray, nil +} + +// MarshalJSON is the custom marshaler for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) MarshalJSON() ([]byte, error) { + empsi.InstanceType = InstanceTypeEnableMigrationProviderSpecificInput + objectMap := make(map[string]interface{}) + if empsi.InstanceType != "" { + objectMap["instanceType"] = empsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtEnableMigrationInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) { + return nil, false +} + +// AsEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) { + return &empsi, true +} + +// AsBasicEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for EnableMigrationProviderSpecificInput. +func (empsi EnableMigrationProviderSpecificInput) AsBasicEnableMigrationProviderSpecificInput() (BasicEnableMigrationProviderSpecificInput, bool) { + return &empsi, true +} + +// EnableProtectionInput enable protection input. +type EnableProtectionInput struct { + // Properties - Enable protection input properties. + Properties *EnableProtectionInputProperties `json:"properties,omitempty"` +} + +// EnableProtectionInputProperties enable protection input properties. +type EnableProtectionInputProperties struct { + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // ProtectableItemID - The protectable item Id. + ProtectableItemID *string `json:"protectableItemId,omitempty"` + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicEnableProtectionProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EnableProtectionInputProperties struct. +func (epip *EnableProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + epip.PolicyID = &policyID + } + case "protectableItemId": + if v != nil { + var protectableItemID string + err = json.Unmarshal(*v, &protectableItemID) + if err != nil { + return err + } + epip.ProtectableItemID = &protectableItemID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEnableProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + epip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicEnableProtectionProviderSpecificInput enable protection provider specific input. +type BasicEnableProtectionProviderSpecificInput interface { + AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) + AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) + AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) + AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) + AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) + AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) + AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) +} + +// EnableProtectionProviderSpecificInput enable protection provider specific input. +type EnableProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicEnableProtectionProviderSpecificInput(body []byte) (BasicEnableProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmepi A2ACrossClusterMigrationEnableProtectionInput + err := json.Unmarshal(body, &accmepi) + return accmepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A): + var aepi A2AEnableProtectionInput + err := json.Unmarshal(body, &aepi) + return aepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraepi HyperVReplicaAzureEnableProtectionInput + err := json.Unmarshal(body, &hvraepi) + return hvraepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2): + var imavepi InMageAzureV2EnableProtectionInput + err := json.Unmarshal(body, &imavepi) + return imavepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage): + var imepi InMageEnableProtectionInput + err := json.Unmarshal(body, &imepi) + return imepi, err + case string(InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm): + var imrepi InMageRcmEnableProtectionInput + err := json.Unmarshal(body, &imrepi) + return imrepi, err + default: + var eppsi EnableProtectionProviderSpecificInput + err := json.Unmarshal(body, &eppsi) + return eppsi, err + } +} +func unmarshalBasicEnableProtectionProviderSpecificInputArray(body []byte) ([]BasicEnableProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + eppsiArray := make([]BasicEnableProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + eppsi, err := unmarshalBasicEnableProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + eppsiArray[index] = eppsi + } + return eppsiArray, nil +} + +// MarshalJSON is the custom marshaler for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + eppsi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if eppsi.InstanceType != "" { + objectMap["instanceType"] = eppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return &eppsi, true +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for EnableProtectionProviderSpecificInput. +func (eppsi EnableProtectionProviderSpecificInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &eppsi, true +} + +// EncryptionDetails encryption details for the fabric. +type EncryptionDetails struct { + // KekState - The key encryption key state for the Vmm. + KekState *string `json:"kekState,omitempty"` + // KekCertThumbprint - The key encryption key certificate thumbprint. + KekCertThumbprint *string `json:"kekCertThumbprint,omitempty"` + // KekCertExpiryDate - The key encryption key certificate expiry date. + KekCertExpiryDate *date.Time `json:"kekCertExpiryDate,omitempty"` +} + +// Event implements the Event class. +type Event struct { + autorest.Response `json:"-"` + // Properties - Event related data. + Properties *EventProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Event. +func (e Event) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if e.Properties != nil { + objectMap["properties"] = e.Properties + } + if e.Location != nil { + objectMap["location"] = e.Location + } + return json.Marshal(objectMap) +} + +// EventCollection collection of fabric details. +type EventCollection struct { + autorest.Response `json:"-"` + // Value - The list of events. + Value *[]Event `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// EventCollectionIterator provides access to a complete listing of Event values. +type EventCollectionIterator struct { + i int + page EventCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *EventCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EventCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *EventCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EventCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter EventCollectionIterator) Response() EventCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter EventCollectionIterator) Value() Event { + if !iter.page.NotDone() { + return Event{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the EventCollectionIterator type. +func NewEventCollectionIterator(page EventCollectionPage) EventCollectionIterator { + return EventCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ec EventCollection) IsEmpty() bool { + return ec.Value == nil || len(*ec.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ec EventCollection) hasNextLink() bool { + return ec.NextLink != nil && len(*ec.NextLink) != 0 +} + +// eventCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ec EventCollection) eventCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ec.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ec.NextLink))) +} + +// EventCollectionPage contains a page of Event values. +type EventCollectionPage struct { + fn func(context.Context, EventCollection) (EventCollection, error) + ec EventCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *EventCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EventCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ec) + if err != nil { + return err + } + page.ec = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *EventCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EventCollectionPage) NotDone() bool { + return !page.ec.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EventCollectionPage) Response() EventCollection { + return page.ec +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EventCollectionPage) Values() []Event { + if page.ec.IsEmpty() { + return nil + } + return *page.ec.Value +} + +// Creates a new instance of the EventCollectionPage type. +func NewEventCollectionPage(cur EventCollection, getNextPage func(context.Context, EventCollection) (EventCollection, error)) EventCollectionPage { + return EventCollectionPage{ + fn: getNextPage, + ec: cur, + } +} + +// EventProperties the properties of a monitoring event. +type EventProperties struct { + // EventCode - The Id of the monitoring event. + EventCode *string `json:"eventCode,omitempty"` + // Description - The event name. + Description *string `json:"description,omitempty"` + // EventType - The type of the event. for example: VM Health, Server Health, Job Failure etc. + EventType *string `json:"eventType,omitempty"` + // AffectedObjectFriendlyName - The friendly name of the source of the event on which it is raised (for example, VM, VMM etc). + AffectedObjectFriendlyName *string `json:"affectedObjectFriendlyName,omitempty"` + // AffectedObjectCorrelationID - The affected object correlationId for the event. + AffectedObjectCorrelationID *string `json:"affectedObjectCorrelationId,omitempty"` + // Severity - The severity of the event. + Severity *string `json:"severity,omitempty"` + // TimeOfOccurrence - The time of occurrence of the event. + TimeOfOccurrence *date.Time `json:"timeOfOccurrence,omitempty"` + // FabricID - The ARM ID of the fabric. + FabricID *string `json:"fabricId,omitempty"` + // ProviderSpecificDetails - The provider specific settings. + ProviderSpecificDetails BasicEventProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` + // EventSpecificDetails - The event specific settings. + EventSpecificDetails BasicEventSpecificDetails `json:"eventSpecificDetails,omitempty"` + // HealthErrors - The list of errors / warnings capturing details associated with the issue(s). + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EventProperties struct. +func (ep *EventProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "eventCode": + if v != nil { + var eventCode string + err = json.Unmarshal(*v, &eventCode) + if err != nil { + return err + } + ep.EventCode = &eventCode + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ep.Description = &description + } + case "eventType": + if v != nil { + var eventType string + err = json.Unmarshal(*v, &eventType) + if err != nil { + return err + } + ep.EventType = &eventType + } + case "affectedObjectFriendlyName": + if v != nil { + var affectedObjectFriendlyName string + err = json.Unmarshal(*v, &affectedObjectFriendlyName) + if err != nil { + return err + } + ep.AffectedObjectFriendlyName = &affectedObjectFriendlyName + } + case "affectedObjectCorrelationId": + if v != nil { + var affectedObjectCorrelationID string + err = json.Unmarshal(*v, &affectedObjectCorrelationID) + if err != nil { + return err + } + ep.AffectedObjectCorrelationID = &affectedObjectCorrelationID + } + case "severity": + if v != nil { + var severity string + err = json.Unmarshal(*v, &severity) + if err != nil { + return err + } + ep.Severity = &severity + } + case "timeOfOccurrence": + if v != nil { + var timeOfOccurrence date.Time + err = json.Unmarshal(*v, &timeOfOccurrence) + if err != nil { + return err + } + ep.TimeOfOccurrence = &timeOfOccurrence + } + case "fabricId": + if v != nil { + var fabricID string + err = json.Unmarshal(*v, &fabricID) + if err != nil { + return err + } + ep.FabricID = &fabricID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicEventProviderSpecificDetails(*v) + if err != nil { + return err + } + ep.ProviderSpecificDetails = providerSpecificDetails + } + case "eventSpecificDetails": + if v != nil { + eventSpecificDetails, err := unmarshalBasicEventSpecificDetails(*v) + if err != nil { + return err + } + ep.EventSpecificDetails = eventSpecificDetails + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + ep.HealthErrors = &healthErrors + } + } + } + + return nil +} + +// BasicEventProviderSpecificDetails model class for provider specific details for an event. +type BasicEventProviderSpecificDetails interface { + AsA2AEventDetails() (*A2AEventDetails, bool) + AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) + AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) + AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) + AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) + AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) + AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) + AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) + AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) + AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) +} + +// EventProviderSpecificDetails model class for provider specific details for an event. +type EventProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicEventProviderSpecificDetails(body []byte) (BasicEventProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A): + var aed A2AEventDetails + err := json.Unmarshal(body, &aed) + return aed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012): + var hvr2ed HyperVReplica2012EventDetails + err := json.Unmarshal(body, &hvr2ed) + return hvr2ed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2): + var hvr2ed HyperVReplica2012R2EventDetails + err := json.Unmarshal(body, &hvr2ed) + return hvr2ed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure): + var hvraed HyperVReplicaAzureEventDetails + err := json.Unmarshal(body, &hvraed) + return hvraed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails): + var hvrbed HyperVReplicaBaseEventDetails + err := json.Unmarshal(body, &hvrbed) + return hvrbed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2): + var imaved InMageAzureV2EventDetails + err := json.Unmarshal(body, &imaved) + return imaved, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm): + var imred InMageRcmEventDetails + err := json.Unmarshal(body, &imred) + return imred, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback): + var imrfed InMageRcmFailbackEventDetails + err := json.Unmarshal(body, &imrfed) + return imrfed, err + case string(InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt): + var vmced VMwareCbtEventDetails + err := json.Unmarshal(body, &vmced) + return vmced, err + default: + var epsd EventProviderSpecificDetails + err := json.Unmarshal(body, &epsd) + return epsd, err + } +} +func unmarshalBasicEventProviderSpecificDetailsArray(body []byte) ([]BasicEventProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + epsdArray := make([]BasicEventProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + epsd, err := unmarshalBasicEventProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + epsdArray[index] = epsd + } + return epsdArray, nil +} + +// MarshalJSON is the custom marshaler for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) MarshalJSON() ([]byte, error) { + epsd.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails + objectMap := make(map[string]interface{}) + if epsd.InstanceType != "" { + objectMap["instanceType"] = epsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return &epsd, true +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for EventProviderSpecificDetails. +func (epsd EventProviderSpecificDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &epsd, true +} + +// EventQueryParameter implements the event query parameter. +type EventQueryParameter struct { + // EventCode - The source id of the events to be queried. + EventCode *string `json:"eventCode,omitempty"` + // Severity - The severity of the events to be queried. + Severity *string `json:"severity,omitempty"` + // EventType - The type of the events to be queried. + EventType *string `json:"eventType,omitempty"` + // FabricName - The affected object server id of the events to be queried. + FabricName *string `json:"fabricName,omitempty"` + // AffectedObjectFriendlyName - The affected object name of the events to be queried. + AffectedObjectFriendlyName *string `json:"affectedObjectFriendlyName,omitempty"` + // AffectedObjectCorrelationID - The affected object correlationId for the events to be queried. + AffectedObjectCorrelationID *string `json:"affectedObjectCorrelationId,omitempty"` + // StartTime - The start time of the time range within which the events are to be queried. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time of the time range within which the events are to be queried. + EndTime *date.Time `json:"endTime,omitempty"` +} + +// BasicEventSpecificDetails model class for event specific details for an event. +type BasicEventSpecificDetails interface { + AsJobStatusEventDetails() (*JobStatusEventDetails, bool) + AsEventSpecificDetails() (*EventSpecificDetails, bool) +} + +// EventSpecificDetails model class for event specific details for an event. +type EventSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeEventSpecificDetails', 'InstanceTypeJobStatus' + InstanceType InstanceTypeBasicEventSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicEventSpecificDetails(body []byte) (BasicEventSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeJobStatus): + var jsed JobStatusEventDetails + err := json.Unmarshal(body, &jsed) + return jsed, err + default: + var esd EventSpecificDetails + err := json.Unmarshal(body, &esd) + return esd, err + } +} +func unmarshalBasicEventSpecificDetailsArray(body []byte) ([]BasicEventSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + esdArray := make([]BasicEventSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + esd, err := unmarshalBasicEventSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + esdArray[index] = esd + } + return esdArray, nil +} + +// MarshalJSON is the custom marshaler for EventSpecificDetails. +func (esd EventSpecificDetails) MarshalJSON() ([]byte, error) { + esd.InstanceType = InstanceTypeEventSpecificDetails + objectMap := make(map[string]interface{}) + if esd.InstanceType != "" { + objectMap["instanceType"] = esd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsJobStatusEventDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsJobStatusEventDetails() (*JobStatusEventDetails, bool) { + return nil, false +} + +// AsEventSpecificDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsEventSpecificDetails() (*EventSpecificDetails, bool) { + return &esd, true +} + +// AsBasicEventSpecificDetails is the BasicEventSpecificDetails implementation for EventSpecificDetails. +func (esd EventSpecificDetails) AsBasicEventSpecificDetails() (BasicEventSpecificDetails, bool) { + return &esd, true +} + +// ExistingProtectionProfile existing storage account input. +type ExistingProtectionProfile struct { + // ProtectionProfileID - The protection profile Arm Id. Throw error, if resource does not exists. + ProtectionProfileID *string `json:"protectionProfileId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) MarshalJSON() ([]byte, error) { + epp.ResourceType = ResourceTypeExisting + objectMap := make(map[string]interface{}) + if epp.ProtectionProfileID != nil { + objectMap["protectionProfileId"] = epp.ProtectionProfileID + } + if epp.ResourceType != "" { + objectMap["resourceType"] = epp.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return &epp, true +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return nil, false +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return nil, false +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ExistingProtectionProfile. +func (epp ExistingProtectionProfile) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &epp, true +} + +// ExistingRecoveryAvailabilitySet existing recovery availability set input. +type ExistingRecoveryAvailabilitySet struct { + // RecoveryAvailabilitySetID - The recovery availability set Id. Will throw error, if resource does not exist. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails', 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryAvailabilitySetCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) MarshalJSON() ([]byte, error) { + eras.ResourceType = ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if eras.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = eras.RecoveryAvailabilitySetID + } + if eras.ResourceType != "" { + objectMap["resourceType"] = eras.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryAvailabilitySet is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) { + return &eras, true +} + +// AsRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for ExistingRecoveryAvailabilitySet. +func (eras ExistingRecoveryAvailabilitySet) AsBasicRecoveryAvailabilitySetCustomDetails() (BasicRecoveryAvailabilitySetCustomDetails, bool) { + return &eras, true +} + +// ExistingRecoveryProximityPlacementGroup existing recovery proximity placement group input. +type ExistingRecoveryProximityPlacementGroup struct { + // RecoveryProximityPlacementGroupID - The recovery proximity placement group Id. Will throw error, if resource does not exist. + RecoveryProximityPlacementGroupID *string `json:"recoveryProximityPlacementGroupId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails', 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) MarshalJSON() ([]byte, error) { + erppg.ResourceType = ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if erppg.RecoveryProximityPlacementGroupID != nil { + objectMap["recoveryProximityPlacementGroupId"] = erppg.RecoveryProximityPlacementGroupID + } + if erppg.ResourceType != "" { + objectMap["resourceType"] = erppg.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryProximityPlacementGroup is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) { + return &erppg, true +} + +// AsRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for ExistingRecoveryProximityPlacementGroup. +func (erppg ExistingRecoveryProximityPlacementGroup) AsBasicRecoveryProximityPlacementGroupCustomDetails() (BasicRecoveryProximityPlacementGroupCustomDetails, bool) { + return &erppg, true +} + +// ExistingRecoveryRecoveryResourceGroup existing recovery resource group input. +type ExistingRecoveryRecoveryResourceGroup struct { + // RecoveryResourceGroupID - The recovery resource group Id. Valid for V2 scenarios. + RecoveryResourceGroupID *string `json:"recoveryResourceGroupId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails', 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryResourceGroupCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) MarshalJSON() ([]byte, error) { + errrg.ResourceType = ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if errrg.RecoveryResourceGroupID != nil { + objectMap["recoveryResourceGroupId"] = errrg.RecoveryResourceGroupID + } + if errrg.ResourceType != "" { + objectMap["resourceType"] = errrg.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryRecoveryResourceGroup is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) { + return &errrg, true +} + +// AsRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for ExistingRecoveryRecoveryResourceGroup. +func (errrg ExistingRecoveryRecoveryResourceGroup) AsBasicRecoveryResourceGroupCustomDetails() (BasicRecoveryResourceGroupCustomDetails, bool) { + return &errrg, true +} + +// ExistingRecoveryVirtualNetwork existing recovery virtual network input. +type ExistingRecoveryVirtualNetwork struct { + // RecoveryVirtualNetworkID - The recovery virtual network Id. Will throw error, if resource does not exist. + RecoveryVirtualNetworkID *string `json:"recoveryVirtualNetworkId,omitempty"` + // RecoverySubnetName - The recovery subnet name. + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) MarshalJSON() ([]byte, error) { + ervn.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if ervn.RecoveryVirtualNetworkID != nil { + objectMap["recoveryVirtualNetworkId"] = ervn.RecoveryVirtualNetworkID + } + if ervn.RecoverySubnetName != nil { + objectMap["recoverySubnetName"] = ervn.RecoverySubnetName + } + if ervn.ResourceType != "" { + objectMap["resourceType"] = ervn.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return &ervn, true +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for ExistingRecoveryVirtualNetwork. +func (ervn ExistingRecoveryVirtualNetwork) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &ervn, true +} + +// ExistingStorageAccount existing storage account input. +type ExistingStorageAccount struct { + // AzureStorageAccountID - The storage account Arm Id. Throw error, if resource does not exists. + AzureStorageAccountID *string `json:"azureStorageAccountId,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails', 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicStorageAccountCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExistingStorageAccount. +func (esa ExistingStorageAccount) MarshalJSON() ([]byte, error) { + esa.ResourceType = ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting + objectMap := make(map[string]interface{}) + if esa.AzureStorageAccountID != nil { + objectMap["azureStorageAccountId"] = esa.AzureStorageAccountID + } + if esa.ResourceType != "" { + objectMap["resourceType"] = esa.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingStorageAccount is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsExistingStorageAccount() (*ExistingStorageAccount, bool) { + return &esa, true +} + +// AsStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) { + return nil, false +} + +// AsBasicStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for ExistingStorageAccount. +func (esa ExistingStorageAccount) AsBasicStorageAccountCustomDetails() (BasicStorageAccountCustomDetails, bool) { + return &esa, true +} + +// ExportJobDetails this class represents details for export jobs workflow. +type ExportJobDetails struct { + // BlobURI - BlobUri of the exported jobs. + BlobURI *string `json:"blobUri,omitempty"` + // SasToken - The sas token to access blob. + SasToken *string `json:"sasToken,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExportJobDetails. +func (ejd ExportJobDetails) MarshalJSON() ([]byte, error) { + ejd.InstanceType = InstanceTypeExportJobDetails + objectMap := make(map[string]interface{}) + if ejd.BlobURI != nil { + objectMap["blobUri"] = ejd.BlobURI + } + if ejd.SasToken != nil { + objectMap["sasToken"] = ejd.SasToken + } + if ejd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = ejd.AffectedObjectDetails + } + if ejd.InstanceType != "" { + objectMap["instanceType"] = ejd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return &ejd, true +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for ExportJobDetails. +func (ejd ExportJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &ejd, true +} + +// ExtendedLocation extended location of the resource. +type ExtendedLocation struct { + // Name - The name of the extended location. + Name *string `json:"name,omitempty"` + // Type - The extended location type. + Type *string `json:"type,omitempty"` +} + +// Fabric fabric definition. +type Fabric struct { + autorest.Response `json:"-"` + // Properties - Fabric related data. + Properties *FabricProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Fabric. +func (f Fabric) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if f.Properties != nil { + objectMap["properties"] = f.Properties + } + if f.Location != nil { + objectMap["location"] = f.Location + } + return json.Marshal(objectMap) +} + +// FabricCollection collection of fabric details. +type FabricCollection struct { + autorest.Response `json:"-"` + // Value - The fabric details. + Value *[]Fabric `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// FabricCollectionIterator provides access to a complete listing of Fabric values. +type FabricCollectionIterator struct { + i int + page FabricCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *FabricCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FabricCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *FabricCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter FabricCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter FabricCollectionIterator) Response() FabricCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter FabricCollectionIterator) Value() Fabric { + if !iter.page.NotDone() { + return Fabric{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the FabricCollectionIterator type. +func NewFabricCollectionIterator(page FabricCollectionPage) FabricCollectionIterator { + return FabricCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (fc FabricCollection) IsEmpty() bool { + return fc.Value == nil || len(*fc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (fc FabricCollection) hasNextLink() bool { + return fc.NextLink != nil && len(*fc.NextLink) != 0 +} + +// fabricCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (fc FabricCollection) fabricCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !fc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(fc.NextLink))) +} + +// FabricCollectionPage contains a page of Fabric values. +type FabricCollectionPage struct { + fn func(context.Context, FabricCollection) (FabricCollection, error) + fc FabricCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *FabricCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FabricCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.fc) + if err != nil { + return err + } + page.fc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *FabricCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page FabricCollectionPage) NotDone() bool { + return !page.fc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page FabricCollectionPage) Response() FabricCollection { + return page.fc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page FabricCollectionPage) Values() []Fabric { + if page.fc.IsEmpty() { + return nil + } + return *page.fc.Value +} + +// Creates a new instance of the FabricCollectionPage type. +func NewFabricCollectionPage(cur FabricCollection, getNextPage func(context.Context, FabricCollection) (FabricCollection, error)) FabricCollectionPage { + return FabricCollectionPage{ + fn: getNextPage, + fc: cur, + } +} + +// FabricCreationInput site details provided during the time of site creation. +type FabricCreationInput struct { + // Properties - Fabric creation input. + Properties *FabricCreationInputProperties `json:"properties,omitempty"` +} + +// FabricCreationInputProperties properties of site details provided during the time of site creation. +type FabricCreationInputProperties struct { + // CustomDetails - Fabric provider specific creation input. + CustomDetails BasicFabricSpecificCreationInput `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for FabricCreationInputProperties struct. +func (fcip *FabricCreationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicFabricSpecificCreationInput(*v) + if err != nil { + return err + } + fcip.CustomDetails = customDetails + } + } + } + + return nil +} + +// FabricProperties fabric properties. +type FabricProperties struct { + // FriendlyName - Friendly name of the fabric. + FriendlyName *string `json:"friendlyName,omitempty"` + // EncryptionDetails - Encryption details for the fabric. + EncryptionDetails *EncryptionDetails `json:"encryptionDetails,omitempty"` + // RolloverEncryptionDetails - Rollover encryption details for the fabric. + RolloverEncryptionDetails *EncryptionDetails `json:"rolloverEncryptionDetails,omitempty"` + // InternalIdentifier - Dra Registration Id. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // BcdrState - BCDR state of the fabric. + BcdrState *string `json:"bcdrState,omitempty"` + // CustomDetails - Fabric specific settings. + CustomDetails BasicFabricSpecificDetails `json:"customDetails,omitempty"` + // HealthErrorDetails - Fabric health error details. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // Health - Health of fabric. + Health *string `json:"health,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for FabricProperties struct. +func (fp *FabricProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + fp.FriendlyName = &friendlyName + } + case "encryptionDetails": + if v != nil { + var encryptionDetails EncryptionDetails + err = json.Unmarshal(*v, &encryptionDetails) + if err != nil { + return err + } + fp.EncryptionDetails = &encryptionDetails + } + case "rolloverEncryptionDetails": + if v != nil { + var rolloverEncryptionDetails EncryptionDetails + err = json.Unmarshal(*v, &rolloverEncryptionDetails) + if err != nil { + return err + } + fp.RolloverEncryptionDetails = &rolloverEncryptionDetails + } + case "internalIdentifier": + if v != nil { + var internalIdentifier string + err = json.Unmarshal(*v, &internalIdentifier) + if err != nil { + return err + } + fp.InternalIdentifier = &internalIdentifier + } + case "bcdrState": + if v != nil { + var bcdrState string + err = json.Unmarshal(*v, &bcdrState) + if err != nil { + return err + } + fp.BcdrState = &bcdrState + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicFabricSpecificDetails(*v) + if err != nil { + return err + } + fp.CustomDetails = customDetails + } + case "healthErrorDetails": + if v != nil { + var healthErrorDetails []HealthError + err = json.Unmarshal(*v, &healthErrorDetails) + if err != nil { + return err + } + fp.HealthErrorDetails = &healthErrorDetails + } + case "health": + if v != nil { + var health string + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + fp.Health = &health + } + } + } + + return nil +} + +// FabricQueryParameter query parameter to get fabric. +type FabricQueryParameter struct { + // ZoneToZoneMappings - A value indicating whether the zone to zone mappings are to be returned. + ZoneToZoneMappings *string `json:"zoneToZoneMappings,omitempty"` + // FetchAgentDetails - A value indicating whether the agent details are to be fetched. + FetchAgentDetails *string `json:"fetchAgentDetails,omitempty"` + // BiosID - The BIOS Id to be used for fetching agent details. + BiosID *string `json:"biosId,omitempty"` + // Fqdn - The FQDN to be used for fetching agent details. + Fqdn *string `json:"fqdn,omitempty"` + // DiscoveryType - The type of the discovered machine to be used for fetching agent details. + DiscoveryType *string `json:"discoveryType,omitempty"` + // OsType - The OS type to be used for fetching agent details. + OsType *string `json:"osType,omitempty"` +} + +// FabricReplicationGroupTaskDetails this class represents the fabric replication group task details. +type FabricReplicationGroupTaskDetails struct { + // SkippedReason - The skipped reason. + SkippedReason *string `json:"skippedReason,omitempty"` + // SkippedReasonString - The skipped reason string. + SkippedReasonString *string `json:"skippedReasonString,omitempty"` + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) MarshalJSON() ([]byte, error) { + frgtd.InstanceType = InstanceTypeFabricReplicationGroupTaskDetails + objectMap := make(map[string]interface{}) + if frgtd.SkippedReason != nil { + objectMap["skippedReason"] = frgtd.SkippedReason + } + if frgtd.SkippedReasonString != nil { + objectMap["skippedReasonString"] = frgtd.SkippedReasonString + } + if frgtd.JobTask != nil { + objectMap["jobTask"] = frgtd.JobTask + } + if frgtd.InstanceType != "" { + objectMap["instanceType"] = frgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return &frgtd, true +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &frgtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for FabricReplicationGroupTaskDetails. +func (frgtd FabricReplicationGroupTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &frgtd, true +} + +// BasicFabricSpecificCreateNetworkMappingInput input details specific to fabrics during Network Mapping. +type BasicFabricSpecificCreateNetworkMappingInput interface { + AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) + AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) + AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) + AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) +} + +// FabricSpecificCreateNetworkMappingInput input details specific to fabrics during Network Mapping. +type FabricSpecificCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificCreateNetworkMappingInput(body []byte) (BasicFabricSpecificCreateNetworkMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAzureToAzure): + var atacnmi AzureToAzureCreateNetworkMappingInput + err := json.Unmarshal(body, &atacnmi) + return atacnmi, err + case string(InstanceTypeVmmToAzure): + var vtacnmi VmmToAzureCreateNetworkMappingInput + err := json.Unmarshal(body, &vtacnmi) + return vtacnmi, err + case string(InstanceTypeVmmToVmm): + var vtvcnmi VmmToVmmCreateNetworkMappingInput + err := json.Unmarshal(body, &vtvcnmi) + return vtvcnmi, err + default: + var fscnmi FabricSpecificCreateNetworkMappingInput + err := json.Unmarshal(body, &fscnmi) + return fscnmi, err + } +} +func unmarshalBasicFabricSpecificCreateNetworkMappingInputArray(body []byte) ([]BasicFabricSpecificCreateNetworkMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fscnmiArray := make([]BasicFabricSpecificCreateNetworkMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fscnmi, err := unmarshalBasicFabricSpecificCreateNetworkMappingInput(*rawMessage) + if err != nil { + return nil, err + } + fscnmiArray[index] = fscnmi + } + return fscnmiArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + fscnmi.InstanceType = InstanceTypeFabricSpecificCreateNetworkMappingInput + objectMap := make(map[string]interface{}) + if fscnmi.InstanceType != "" { + objectMap["instanceType"] = fscnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return &fscnmi, true +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for FabricSpecificCreateNetworkMappingInput. +func (fscnmi FabricSpecificCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &fscnmi, true +} + +// BasicFabricSpecificCreationInput fabric provider specific settings. +type BasicFabricSpecificCreationInput interface { + AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) + AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) + AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) + AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) +} + +// FabricSpecificCreationInput fabric provider specific settings. +type FabricSpecificCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificCreationInput(body []byte) (BasicFabricSpecificCreationInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure): + var afci AzureFabricCreationInput + err := json.Unmarshal(body, &afci) + return afci, err + case string(InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm): + var imrfci InMageRcmFabricCreationInput + err := json.Unmarshal(body, &imrfci) + return imrfci, err + case string(InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2): + var vmvfci VMwareV2FabricCreationInput + err := json.Unmarshal(body, &vmvfci) + return vmvfci, err + default: + var fsci FabricSpecificCreationInput + err := json.Unmarshal(body, &fsci) + return fsci, err + } +} +func unmarshalBasicFabricSpecificCreationInputArray(body []byte) ([]BasicFabricSpecificCreationInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsciArray := make([]BasicFabricSpecificCreationInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsci, err := unmarshalBasicFabricSpecificCreationInput(*rawMessage) + if err != nil { + return nil, err + } + fsciArray[index] = fsci + } + return fsciArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) MarshalJSON() ([]byte, error) { + fsci.InstanceType = InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput + objectMap := make(map[string]interface{}) + if fsci.InstanceType != "" { + objectMap["instanceType"] = fsci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return &fsci, true +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for FabricSpecificCreationInput. +func (fsci FabricSpecificCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &fsci, true +} + +// BasicFabricSpecificDetails fabric specific details. +type BasicFabricSpecificDetails interface { + AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) + AsHyperVSiteDetails() (*HyperVSiteDetails, bool) + AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) + AsVmmDetails() (*VmmDetails, bool) + AsVMwareDetails() (*VMwareDetails, bool) + AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) + AsFabricSpecificDetails() (*FabricSpecificDetails, bool) +} + +// FabricSpecificDetails fabric specific details. +type FabricSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificDetails(body []byte) (BasicFabricSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure): + var afsd AzureFabricSpecificDetails + err := json.Unmarshal(body, &afsd) + return afsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite): + var hvsd HyperVSiteDetails + err := json.Unmarshal(body, &hvsd) + return hvsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm): + var imrfsd InMageRcmFabricSpecificDetails + err := json.Unmarshal(body, &imrfsd) + return imrfsd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM): + var vd VmmDetails + err := json.Unmarshal(body, &vd) + return vd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware): + var vmd VMwareDetails + err := json.Unmarshal(body, &vmd) + return vmd, err + case string(InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2): + var vmvfsd VMwareV2FabricSpecificDetails + err := json.Unmarshal(body, &vmvfsd) + return vmvfsd, err + default: + var fsd FabricSpecificDetails + err := json.Unmarshal(body, &fsd) + return fsd, err + } +} +func unmarshalBasicFabricSpecificDetailsArray(body []byte) ([]BasicFabricSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsdArray := make([]BasicFabricSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsd, err := unmarshalBasicFabricSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + fsdArray[index] = fsd + } + return fsdArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificDetails. +func (fsd FabricSpecificDetails) MarshalJSON() ([]byte, error) { + fsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails + objectMap := make(map[string]interface{}) + if fsd.InstanceType != "" { + objectMap["instanceType"] = fsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return &fsd, true +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for FabricSpecificDetails. +func (fsd FabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &fsd, true +} + +// BasicFabricSpecificUpdateNetworkMappingInput input details specific to fabrics during Network Mapping. +type BasicFabricSpecificUpdateNetworkMappingInput interface { + AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) + AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) + AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) + AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) +} + +// FabricSpecificUpdateNetworkMappingInput input details specific to fabrics during Network Mapping. +type FabricSpecificUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicFabricSpecificUpdateNetworkMappingInput(body []byte) (BasicFabricSpecificUpdateNetworkMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure): + var ataunmi AzureToAzureUpdateNetworkMappingInput + err := json.Unmarshal(body, &ataunmi) + return ataunmi, err + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure): + var vtaunmi VmmToAzureUpdateNetworkMappingInput + err := json.Unmarshal(body, &vtaunmi) + return vtaunmi, err + case string(InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm): + var vtvunmi VmmToVmmUpdateNetworkMappingInput + err := json.Unmarshal(body, &vtvunmi) + return vtvunmi, err + default: + var fsunmi FabricSpecificUpdateNetworkMappingInput + err := json.Unmarshal(body, &fsunmi) + return fsunmi, err + } +} +func unmarshalBasicFabricSpecificUpdateNetworkMappingInputArray(body []byte) ([]BasicFabricSpecificUpdateNetworkMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsunmiArray := make([]BasicFabricSpecificUpdateNetworkMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsunmi, err := unmarshalBasicFabricSpecificUpdateNetworkMappingInput(*rawMessage) + if err != nil { + return nil, err + } + fsunmiArray[index] = fsunmi + } + return fsunmiArray, nil +} + +// MarshalJSON is the custom marshaler for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + fsunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput + objectMap := make(map[string]interface{}) + if fsunmi.InstanceType != "" { + objectMap["instanceType"] = fsunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return &fsunmi, true +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for FabricSpecificUpdateNetworkMappingInput. +func (fsunmi FabricSpecificUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &fsunmi, true +} + +// FailoverJobDetails this class represents the details for a failover job. +type FailoverJobDetails struct { + // ProtectedItemDetails - The test VM details. + ProtectedItemDetails *[]FailoverReplicationProtectedItemDetails `json:"protectedItemDetails,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for FailoverJobDetails. +func (fjd FailoverJobDetails) MarshalJSON() ([]byte, error) { + fjd.InstanceType = InstanceTypeFailoverJobDetails + objectMap := make(map[string]interface{}) + if fjd.ProtectedItemDetails != nil { + objectMap["protectedItemDetails"] = fjd.ProtectedItemDetails + } + if fjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = fjd.AffectedObjectDetails + } + if fjd.InstanceType != "" { + objectMap["instanceType"] = fjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return &fjd, true +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for FailoverJobDetails. +func (fjd FailoverJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &fjd, true +} + +// FailoverProcessServerRequest request to failover a process server. +type FailoverProcessServerRequest struct { + // Properties - The properties of the PS Failover request. + Properties *FailoverProcessServerRequestProperties `json:"properties,omitempty"` +} + +// FailoverProcessServerRequestProperties the properties of the Failover Process Server request. +type FailoverProcessServerRequestProperties struct { + // ContainerName - The container identifier. + ContainerName *string `json:"containerName,omitempty"` + // SourceProcessServerID - The source process server. + SourceProcessServerID *string `json:"sourceProcessServerId,omitempty"` + // TargetProcessServerID - The new process server. + TargetProcessServerID *string `json:"targetProcessServerId,omitempty"` + // VmsToMigrate - The VMS to migrate. + VmsToMigrate *[]string `json:"vmsToMigrate,omitempty"` + // UpdateType - A value for failover type. It can be systemlevel/serverlevel. + UpdateType *string `json:"updateType,omitempty"` +} + +// FailoverReplicationProtectedItemDetails failover details for a replication protected item. +type FailoverReplicationProtectedItemDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // FriendlyName - The friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // TestVMName - The test Vm name. + TestVMName *string `json:"testVmName,omitempty"` + // TestVMFriendlyName - The test Vm friendly name. + TestVMFriendlyName *string `json:"testVmFriendlyName,omitempty"` + // NetworkConnectionStatus - The network connection status. + NetworkConnectionStatus *string `json:"networkConnectionStatus,omitempty"` + // NetworkFriendlyName - The network friendly name. + NetworkFriendlyName *string `json:"networkFriendlyName,omitempty"` + // Subnet - The network subnet. + Subnet *string `json:"subnet,omitempty"` + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // RecoveryPointTime - The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` +} + +// BasicGroupTaskDetails this class represents the group task details when parent child relationship exists in the +// drill down. +type BasicGroupTaskDetails interface { + AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) + AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) + AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) + AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) + AsGroupTaskDetails() (*GroupTaskDetails, bool) +} + +// GroupTaskDetails this class represents the group task details when parent child relationship exists in the +// drill down. +type GroupTaskDetails struct { + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicGroupTaskDetails(body []byte) (BasicGroupTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInlineWorkflowTaskDetails): + var iwtd InlineWorkflowTaskDetails + err := json.Unmarshal(body, &iwtd) + return iwtd, err + case string(InstanceTypeRecoveryPlanGroupTaskDetails): + var rpgtd RecoveryPlanGroupTaskDetails + err := json.Unmarshal(body, &rpgtd) + return rpgtd, err + case string(InstanceTypeRecoveryPlanShutdownGroupTaskDetails): + var rpsgtd RecoveryPlanShutdownGroupTaskDetails + err := json.Unmarshal(body, &rpsgtd) + return rpsgtd, err + default: + var gtd GroupTaskDetails + err := json.Unmarshal(body, >d) + return gtd, err + } +} +func unmarshalBasicGroupTaskDetailsArray(body []byte) ([]BasicGroupTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + gtdArray := make([]BasicGroupTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + gtd, err := unmarshalBasicGroupTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + gtdArray[index] = gtd + } + return gtdArray, nil +} + +// MarshalJSON is the custom marshaler for GroupTaskDetails. +func (gtd GroupTaskDetails) MarshalJSON() ([]byte, error) { + gtd.InstanceType = InstanceTypeGroupTaskDetails + objectMap := make(map[string]interface{}) + if gtd.ChildTasks != nil { + objectMap["childTasks"] = gtd.ChildTasks + } + if gtd.InstanceType != "" { + objectMap["instanceType"] = gtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return >d, true +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for GroupTaskDetails. +func (gtd GroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return >d, true +} + +// HealthError health Error. +type HealthError struct { + // InnerHealthErrors - The inner health errors. HealthError having a list of HealthError as child errors is problematic. InnerHealthError is used because this will prevent an infinite loop of structures when Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health errors and all API consumers can utilize this in the same fashion as Exception -> InnerException. + InnerHealthErrors *[]InnerHealthError `json:"innerHealthErrors,omitempty"` + // ErrorSource - Source of error. + ErrorSource *string `json:"errorSource,omitempty"` + // ErrorType - Type of error. + ErrorType *string `json:"errorType,omitempty"` + // ErrorLevel - Level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // ErrorCategory - Category of error. + ErrorCategory *string `json:"errorCategory,omitempty"` + // ErrorCode - Error code. + ErrorCode *string `json:"errorCode,omitempty"` + // SummaryMessage - Summary message of the entity. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // ErrorMessage - Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // CreationTimeUtc - Error creation time (UTC). + CreationTimeUtc *date.Time `json:"creationTimeUtc,omitempty"` + // RecoveryProviderErrorMessage - DRA error message. + RecoveryProviderErrorMessage *string `json:"recoveryProviderErrorMessage,omitempty"` + // EntityID - ID of the entity. + EntityID *string `json:"entityId,omitempty"` + // ErrorID - The health error unique id. + ErrorID *string `json:"errorId,omitempty"` + // CustomerResolvability - Value indicating whether the health error is customer resolvable. Possible values include: 'Allowed', 'NotAllowed' + CustomerResolvability HealthErrorCustomerResolvability `json:"customerResolvability,omitempty"` +} + +// HealthErrorSummary class to define the summary of the health error details. +type HealthErrorSummary struct { + // SummaryCode - The code of the health error. + SummaryCode *string `json:"summaryCode,omitempty"` + // Category - The category of the health error. Possible values include: 'HealthErrorCategoryNone', 'HealthErrorCategoryReplication', 'HealthErrorCategoryTestFailover', 'HealthErrorCategoryConfiguration', 'HealthErrorCategoryFabricInfrastructure', 'HealthErrorCategoryVersionExpiry', 'HealthErrorCategoryAgentAutoUpdateInfra', 'HealthErrorCategoryAgentAutoUpdateArtifactDeleted', 'HealthErrorCategoryAgentAutoUpdateRunAsAccount', 'HealthErrorCategoryAgentAutoUpdateRunAsAccountExpiry', 'HealthErrorCategoryAgentAutoUpdateRunAsAccountExpired' + Category HealthErrorCategory `json:"category,omitempty"` + // Severity - Severity of error. Possible values include: 'NONE', 'Warning', 'Error', 'Info' + Severity Severity `json:"severity,omitempty"` + // SummaryMessage - The summary message of the health error. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // AffectedResourceType - The type of affected ARM resource. + AffectedResourceType *string `json:"affectedResourceType,omitempty"` + // AffectedResourceSubtype - The sub type of any subcomponent within the ARM resource that this might be applicable. Value remains null if not applicable. + AffectedResourceSubtype *string `json:"affectedResourceSubtype,omitempty"` + // AffectedResourceCorrelationIds - The list of affected resource correlation Ids. This can be used to uniquely identify the count of items affected by a specific category and severity as well as count of item affected by an specific issue. + AffectedResourceCorrelationIds *[]string `json:"affectedResourceCorrelationIds,omitempty"` +} + +// HyperVHostDetails hyper-V host details. +type HyperVHostDetails struct { + // ID - READ-ONLY; The Hyper-V host Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The Hyper-V host name. + Name *string `json:"name,omitempty"` + // MarsAgentVersion - READ-ONLY; The Mars agent version. + MarsAgentVersion *string `json:"marsAgentVersion,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVHostDetails. +func (hvhd HyperVHostDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// HyperVReplica2012EventDetails model class for event details of a HyperVReplica E2E event. +type HyperVReplica2012EventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) MarshalJSON() ([]byte, error) { + hvr2ed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvr2ed.ContainerName != nil { + objectMap["containerName"] = hvr2ed.ContainerName + } + if hvr2ed.FabricName != nil { + objectMap["fabricName"] = hvr2ed.FabricName + } + if hvr2ed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvr2ed.RemoteContainerName + } + if hvr2ed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvr2ed.RemoteFabricName + } + if hvr2ed.InstanceType != "" { + objectMap["instanceType"] = hvr2ed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return &hvr2ed, true +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012EventDetails. +func (hvr2ed HyperVReplica2012EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvr2ed, true +} + +// HyperVReplica2012R2EventDetails model class for event details of a HyperVReplica blue E2E event. +type HyperVReplica2012R2EventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) MarshalJSON() ([]byte, error) { + hvr2ed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvr2ed.ContainerName != nil { + objectMap["containerName"] = hvr2ed.ContainerName + } + if hvr2ed.FabricName != nil { + objectMap["fabricName"] = hvr2ed.FabricName + } + if hvr2ed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvr2ed.RemoteContainerName + } + if hvr2ed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvr2ed.RemoteFabricName + } + if hvr2ed.InstanceType != "" { + objectMap["instanceType"] = hvr2ed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return &hvr2ed, true +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplica2012R2EventDetails. +func (hvr2ed HyperVReplica2012R2EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvr2ed, true +} + +// HyperVReplicaAzureApplyRecoveryPointInput applyRecoveryPoint input specific to HyperVReplicaAzure +// provider. +type HyperVReplicaAzureApplyRecoveryPointInput struct { + // PrimaryKekCertificatePfx - The primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - The secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + hvraarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraarpi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvraarpi.PrimaryKekCertificatePfx + } + if hvraarpi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvraarpi.SecondaryKekCertificatePfx + } + if hvraarpi.InstanceType != "" { + objectMap["instanceType"] = hvraarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return &hvraarpi, true +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for HyperVReplicaAzureApplyRecoveryPointInput. +func (hvraarpi HyperVReplicaAzureApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &hvraarpi, true +} + +// HyperVReplicaAzureDiskInputDetails disk input details. +type HyperVReplicaAzureDiskInputDetails struct { + // DiskID - The DiskId. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The LogStorageAccountId. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// HyperVReplicaAzureEnableProtectionInput hyperVReplicaAzure specific enable protection input. +type HyperVReplicaAzureEnableProtectionInput struct { + // HvHostVMID - The Hyper-V host VM Id. + HvHostVMID *string `json:"hvHostVmId,omitempty"` + // VMName - The VM Name. + VMName *string `json:"vmName,omitempty"` + // OsType - The OS type associated with VM. + OsType *string `json:"osType,omitempty"` + // VhdID - The OS disk VHD id associated with VM. + VhdID *string `json:"vhdId,omitempty"` + // TargetStorageAccountID - The storage account Id. + TargetStorageAccountID *string `json:"targetStorageAccountId,omitempty"` + // TargetAzureNetworkID - The selected target Azure network Id. + TargetAzureNetworkID *string `json:"targetAzureNetworkId,omitempty"` + // TargetAzureSubnetID - The selected target Azure subnet Id. + TargetAzureSubnetID *string `json:"targetAzureSubnetId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // TargetAzureVMName - The target azure VM Name. + TargetAzureVMName *string `json:"targetAzureVmName,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DisksToInclude - The list of VHD Ids of disks to be protected. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // TargetAzureV1ResourceGroupID - The Id of the target resource group (for classic deployment) in which the failover VM is to be created. + TargetAzureV1ResourceGroupID *string `json:"targetAzureV1ResourceGroupId,omitempty"` + // TargetAzureV2ResourceGroupID - The Id of the target resource group (for resource manager deployment) in which the failover VM is to be created. + TargetAzureV2ResourceGroupID *string `json:"targetAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id for resource manager deployment. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetProximityPlacementGroupID - The proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisksForReplication - A value indicating whether managed disks should be used during replication. + UseManagedDisksForReplication *string `json:"useManagedDisksForReplication,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DisksToIncludeForManagedDisks - The disks to include list for managed disks. + DisksToIncludeForManagedDisks *[]HyperVReplicaAzureDiskInputDetails `json:"disksToIncludeForManagedDisks,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) MarshalJSON() ([]byte, error) { + hvraepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraepi.HvHostVMID != nil { + objectMap["hvHostVmId"] = hvraepi.HvHostVMID + } + if hvraepi.VMName != nil { + objectMap["vmName"] = hvraepi.VMName + } + if hvraepi.OsType != nil { + objectMap["osType"] = hvraepi.OsType + } + if hvraepi.VhdID != nil { + objectMap["vhdId"] = hvraepi.VhdID + } + if hvraepi.TargetStorageAccountID != nil { + objectMap["targetStorageAccountId"] = hvraepi.TargetStorageAccountID + } + if hvraepi.TargetAzureNetworkID != nil { + objectMap["targetAzureNetworkId"] = hvraepi.TargetAzureNetworkID + } + if hvraepi.TargetAzureSubnetID != nil { + objectMap["targetAzureSubnetId"] = hvraepi.TargetAzureSubnetID + } + if hvraepi.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = hvraepi.EnableRdpOnTargetOption + } + if hvraepi.TargetAzureVMName != nil { + objectMap["targetAzureVmName"] = hvraepi.TargetAzureVMName + } + if hvraepi.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = hvraepi.LogStorageAccountID + } + if hvraepi.DisksToInclude != nil { + objectMap["disksToInclude"] = hvraepi.DisksToInclude + } + if hvraepi.TargetAzureV1ResourceGroupID != nil { + objectMap["targetAzureV1ResourceGroupId"] = hvraepi.TargetAzureV1ResourceGroupID + } + if hvraepi.TargetAzureV2ResourceGroupID != nil { + objectMap["targetAzureV2ResourceGroupId"] = hvraepi.TargetAzureV2ResourceGroupID + } + if hvraepi.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvraepi.UseManagedDisks + } + if hvraepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = hvraepi.TargetAvailabilitySetID + } + if hvraepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvraepi.TargetAvailabilityZone + } + if hvraepi.LicenseType != "" { + objectMap["licenseType"] = hvraepi.LicenseType + } + if hvraepi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = hvraepi.SQLServerLicenseType + } + if hvraepi.TargetVMSize != nil { + objectMap["targetVmSize"] = hvraepi.TargetVMSize + } + if hvraepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvraepi.TargetProximityPlacementGroupID + } + if hvraepi.UseManagedDisksForReplication != nil { + objectMap["useManagedDisksForReplication"] = hvraepi.UseManagedDisksForReplication + } + if hvraepi.DiskType != "" { + objectMap["diskType"] = hvraepi.DiskType + } + if hvraepi.DisksToIncludeForManagedDisks != nil { + objectMap["disksToIncludeForManagedDisks"] = hvraepi.DisksToIncludeForManagedDisks + } + if hvraepi.DiskEncryptionSetID != nil { + objectMap["diskEncryptionSetId"] = hvraepi.DiskEncryptionSetID + } + if hvraepi.TargetVMTags != nil { + objectMap["targetVmTags"] = hvraepi.TargetVMTags + } + if hvraepi.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = hvraepi.SeedManagedDiskTags + } + if hvraepi.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvraepi.TargetManagedDiskTags + } + if hvraepi.TargetNicTags != nil { + objectMap["targetNicTags"] = hvraepi.TargetNicTags + } + if hvraepi.InstanceType != "" { + objectMap["instanceType"] = hvraepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return &hvraepi, true +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for HyperVReplicaAzureEnableProtectionInput. +func (hvraepi HyperVReplicaAzureEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &hvraepi, true +} + +// HyperVReplicaAzureEventDetails model class for event details of a HyperVReplica E2A event. +type HyperVReplicaAzureEventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) MarshalJSON() ([]byte, error) { + hvraed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraed.ContainerName != nil { + objectMap["containerName"] = hvraed.ContainerName + } + if hvraed.FabricName != nil { + objectMap["fabricName"] = hvraed.FabricName + } + if hvraed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvraed.RemoteContainerName + } + if hvraed.InstanceType != "" { + objectMap["instanceType"] = hvraed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return &hvraed, true +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaAzureEventDetails. +func (hvraed HyperVReplicaAzureEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvraed, true +} + +// HyperVReplicaAzureFailbackProviderInput hyperVReplicaAzureFailback specific planned failover input. +type HyperVReplicaAzureFailbackProviderInput struct { + // DataSyncOption - Data sync option. + DataSyncOption *string `json:"dataSyncOption,omitempty"` + // RecoveryVMCreationOption - ALR options to create alternate recovery. + RecoveryVMCreationOption *string `json:"recoveryVmCreationOption,omitempty"` + // ProviderIDForAlternateRecovery - Provider Id for alternate location. + ProviderIDForAlternateRecovery *string `json:"providerIdForAlternateRecovery,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) MarshalJSON() ([]byte, error) { + hvrafpi.InstanceType = InstanceTypeHyperVReplicaAzureFailback + objectMap := make(map[string]interface{}) + if hvrafpi.DataSyncOption != nil { + objectMap["dataSyncOption"] = hvrafpi.DataSyncOption + } + if hvrafpi.RecoveryVMCreationOption != nil { + objectMap["recoveryVmCreationOption"] = hvrafpi.RecoveryVMCreationOption + } + if hvrafpi.ProviderIDForAlternateRecovery != nil { + objectMap["providerIdForAlternateRecovery"] = hvrafpi.ProviderIDForAlternateRecovery + } + if hvrafpi.InstanceType != "" { + objectMap["instanceType"] = hvrafpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return &hvrafpi, true +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzureFailbackProviderInput. +func (hvrafpi HyperVReplicaAzureFailbackProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &hvrafpi, true +} + +// HyperVReplicaAzureManagedDiskDetails hyper-V Managed disk details. +type HyperVReplicaAzureManagedDiskDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // SeedManagedDiskID - Seed managed disk Id. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // ReplicaDiskType - The replica disk type. + ReplicaDiskType *string `json:"replicaDiskType,omitempty"` + // DiskEncryptionSetID - The disk encryption set ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// HyperVReplicaAzurePlannedFailoverProviderInput hyperVReplicaAzure specific planned failover input. +type HyperVReplicaAzurePlannedFailoverProviderInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) MarshalJSON() ([]byte, error) { + hvrapfpi.InstanceType = InstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapfpi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvrapfpi.PrimaryKekCertificatePfx + } + if hvrapfpi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvrapfpi.SecondaryKekCertificatePfx + } + if hvrapfpi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvrapfpi.RecoveryPointID + } + if hvrapfpi.InstanceType != "" { + objectMap["instanceType"] = hvrapfpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return &hvrapfpi, true +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for HyperVReplicaAzurePlannedFailoverProviderInput. +func (hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &hvrapfpi, true +} + +// HyperVReplicaAzurePolicyDetails hyper-V Replica Azure specific protection profile details. +type HyperVReplicaAzurePolicyDetails struct { + // RecoveryPointHistoryDurationInHours - The duration (in hours) to which point the recovery history needs to be maintained. + RecoveryPointHistoryDurationInHours *int32 `json:"recoveryPointHistoryDurationInHours,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - The interval (in hours) at which Hyper-V Replica should create an application consistent snapshot within the VM. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // ReplicationInterval - The replication interval. + ReplicationInterval *int32 `json:"replicationInterval,omitempty"` + // OnlineReplicationStartTime - The scheduled start time for the initial replication. If this parameter is Null, the initial replication starts immediately. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // Encryption - A value indicating whether encryption is enabled for virtual machines in this cloud. + Encryption *string `json:"encryption,omitempty"` + // ActiveStorageAccountID - The active storage account Id. + ActiveStorageAccountID *string `json:"activeStorageAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) MarshalJSON() ([]byte, error) { + hvrapd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapd.RecoveryPointHistoryDurationInHours != nil { + objectMap["recoveryPointHistoryDurationInHours"] = hvrapd.RecoveryPointHistoryDurationInHours + } + if hvrapd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrapd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrapd.ReplicationInterval != nil { + objectMap["replicationInterval"] = hvrapd.ReplicationInterval + } + if hvrapd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrapd.OnlineReplicationStartTime + } + if hvrapd.Encryption != nil { + objectMap["encryption"] = hvrapd.Encryption + } + if hvrapd.ActiveStorageAccountID != nil { + objectMap["activeStorageAccountId"] = hvrapd.ActiveStorageAccountID + } + if hvrapd.InstanceType != "" { + objectMap["instanceType"] = hvrapd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return &hvrapd, true +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaAzurePolicyDetails. +func (hvrapd HyperVReplicaAzurePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrapd, true +} + +// HyperVReplicaAzurePolicyInput hyper-V Replica Azure specific input for creating a protection profile. +type HyperVReplicaAzurePolicyInput struct { + // RecoveryPointHistoryDuration - The duration (in hours) to which point the recovery history needs to be maintained. + RecoveryPointHistoryDuration *int32 `json:"recoveryPointHistoryDuration,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - The interval (in hours) at which Hyper-V Replica should create an application consistent snapshot within the VM. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // ReplicationInterval - The replication interval. + ReplicationInterval *int32 `json:"replicationInterval,omitempty"` + // OnlineReplicationStartTime - The scheduled start time for the initial replication. If this parameter is Null, the initial replication starts immediately. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // StorageAccounts - The list of storage accounts to which the VMs in the primary cloud can replicate to. + StorageAccounts *[]string `json:"storageAccounts,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) MarshalJSON() ([]byte, error) { + hvrapi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrapi.RecoveryPointHistoryDuration != nil { + objectMap["recoveryPointHistoryDuration"] = hvrapi.RecoveryPointHistoryDuration + } + if hvrapi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrapi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrapi.ReplicationInterval != nil { + objectMap["replicationInterval"] = hvrapi.ReplicationInterval + } + if hvrapi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrapi.OnlineReplicationStartTime + } + if hvrapi.StorageAccounts != nil { + objectMap["storageAccounts"] = hvrapi.StorageAccounts + } + if hvrapi.InstanceType != "" { + objectMap["instanceType"] = hvrapi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return &hvrapi, true +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaAzurePolicyInput. +func (hvrapi HyperVReplicaAzurePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrapi, true +} + +// HyperVReplicaAzureReplicationDetails hyper V Replica Azure provider specific settings. +type HyperVReplicaAzureReplicationDetails struct { + // AzureVMDiskDetails - Azure VM Disk details. + AzureVMDiskDetails *[]AzureVMDiskDetails `json:"azureVmDiskDetails,omitempty"` + // RecoveryAzureVMName - Recovery Azure given name. + RecoveryAzureVMName *string `json:"recoveryAzureVmName,omitempty"` + // RecoveryAzureVMSize - The Recovery Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureStorageAccount - The recovery Azure storage account. + RecoveryAzureStorageAccount *string `json:"recoveryAzureStorageAccount,omitempty"` + // RecoveryAzureLogStorageAccountID - The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. + RecoveryAzureLogStorageAccountID *string `json:"recoveryAzureLogStorageAccountId,omitempty"` + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // RpoInSeconds - Last RPO value. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // SelectedRecoveryAzureNetworkID - The selected recovery azure network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // Encryption - The encryption info. + Encryption *string `json:"encryption,omitempty"` + // OSDetails - The operating system info. + OSDetails *OSDetails `json:"oSDetails,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // RecoveryAzureResourceGroupID - The target resource group Id. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]HyperVReplicaAzureManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) MarshalJSON() ([]byte, error) { + hvrard.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrard.AzureVMDiskDetails != nil { + objectMap["azureVmDiskDetails"] = hvrard.AzureVMDiskDetails + } + if hvrard.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVmName"] = hvrard.RecoveryAzureVMName + } + if hvrard.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = hvrard.RecoveryAzureVMSize + } + if hvrard.RecoveryAzureStorageAccount != nil { + objectMap["recoveryAzureStorageAccount"] = hvrard.RecoveryAzureStorageAccount + } + if hvrard.RecoveryAzureLogStorageAccountID != nil { + objectMap["recoveryAzureLogStorageAccountId"] = hvrard.RecoveryAzureLogStorageAccountID + } + if hvrard.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrard.LastReplicatedTime + } + if hvrard.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = hvrard.RpoInSeconds + } + if hvrard.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = hvrard.LastRpoCalculatedTime + } + if hvrard.VMID != nil { + objectMap["vmId"] = hvrard.VMID + } + if hvrard.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrard.VMProtectionState + } + if hvrard.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrard.VMProtectionStateDescription + } + if hvrard.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrard.InitialReplicationDetails + } + if hvrard.VMNics != nil { + objectMap["vmNics"] = hvrard.VMNics + } + if hvrard.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = hvrard.SelectedRecoveryAzureNetworkID + } + if hvrard.SelectedSourceNicID != nil { + objectMap["selectedSourceNicId"] = hvrard.SelectedSourceNicID + } + if hvrard.Encryption != nil { + objectMap["encryption"] = hvrard.Encryption + } + if hvrard.OSDetails != nil { + objectMap["oSDetails"] = hvrard.OSDetails + } + if hvrard.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = hvrard.SourceVMRAMSizeInMB + } + if hvrard.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = hvrard.SourceVMCPUCount + } + if hvrard.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = hvrard.EnableRdpOnTargetOption + } + if hvrard.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = hvrard.RecoveryAzureResourceGroupID + } + if hvrard.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = hvrard.RecoveryAvailabilitySetID + } + if hvrard.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvrard.TargetAvailabilityZone + } + if hvrard.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvrard.TargetProximityPlacementGroupID + } + if hvrard.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvrard.UseManagedDisks + } + if hvrard.LicenseType != nil { + objectMap["licenseType"] = hvrard.LicenseType + } + if hvrard.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = hvrard.SQLServerLicenseType + } + if hvrard.TargetVMTags != nil { + objectMap["targetVmTags"] = hvrard.TargetVMTags + } + if hvrard.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = hvrard.SeedManagedDiskTags + } + if hvrard.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvrard.TargetManagedDiskTags + } + if hvrard.TargetNicTags != nil { + objectMap["targetNicTags"] = hvrard.TargetNicTags + } + if hvrard.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = hvrard.ProtectedManagedDisks + } + if hvrard.InstanceType != "" { + objectMap["instanceType"] = hvrard.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return &hvrard, true +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaAzureReplicationDetails. +func (hvrard HyperVReplicaAzureReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrard, true +} + +// HyperVReplicaAzureReprotectInput azure specific reprotect input. +type HyperVReplicaAzureReprotectInput struct { + // HvHostVMID - The Hyper-V host Vm Id. + HvHostVMID *string `json:"hvHostVmId,omitempty"` + // VMName - The Vm Name. + VMName *string `json:"vmName,omitempty"` + // OsType - The OS type associated with vm. + OsType *string `json:"osType,omitempty"` + // VHDID - The OS disk VHD id associated with vm. + VHDID *string `json:"vHDId,omitempty"` + // StorageAccountID - The storage account name. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) MarshalJSON() ([]byte, error) { + hvrari.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvrari.HvHostVMID != nil { + objectMap["hvHostVmId"] = hvrari.HvHostVMID + } + if hvrari.VMName != nil { + objectMap["vmName"] = hvrari.VMName + } + if hvrari.OsType != nil { + objectMap["osType"] = hvrari.OsType + } + if hvrari.VHDID != nil { + objectMap["vHDId"] = hvrari.VHDID + } + if hvrari.StorageAccountID != nil { + objectMap["storageAccountId"] = hvrari.StorageAccountID + } + if hvrari.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = hvrari.LogStorageAccountID + } + if hvrari.InstanceType != "" { + objectMap["instanceType"] = hvrari.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return &hvrari, true +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for HyperVReplicaAzureReprotectInput. +func (hvrari HyperVReplicaAzureReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &hvrari, true +} + +// HyperVReplicaAzureTestFailoverInput hvrA provider specific input for test failover. +type HyperVReplicaAzureTestFailoverInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) MarshalJSON() ([]byte, error) { + hvratfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvratfi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvratfi.PrimaryKekCertificatePfx + } + if hvratfi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvratfi.SecondaryKekCertificatePfx + } + if hvratfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvratfi.RecoveryPointID + } + if hvratfi.InstanceType != "" { + objectMap["instanceType"] = hvratfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return &hvratfi, true +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for HyperVReplicaAzureTestFailoverInput. +func (hvratfi HyperVReplicaAzureTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &hvratfi, true +} + +// HyperVReplicaAzureUnplannedFailoverInput hvrA provider specific input for unplanned failover. +type HyperVReplicaAzureUnplannedFailoverInput struct { + // PrimaryKekCertificatePfx - Primary kek certificate pfx. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - Secondary kek certificate pfx. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + hvraufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraufi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = hvraufi.PrimaryKekCertificatePfx + } + if hvraufi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = hvraufi.SecondaryKekCertificatePfx + } + if hvraufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = hvraufi.RecoveryPointID + } + if hvraufi.InstanceType != "" { + objectMap["instanceType"] = hvraufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return &hvraufi, true +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for HyperVReplicaAzureUnplannedFailoverInput. +func (hvraufi HyperVReplicaAzureUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &hvraufi, true +} + +// HyperVReplicaAzureUpdateReplicationProtectedItemInput hyperV replica Azure input to update replication +// protected item. +type HyperVReplicaAzureUpdateReplicationProtectedItemInput struct { + // RecoveryAzureV1ResourceGroupID - The recovery Azure resource group Id for classic deployment. + RecoveryAzureV1ResourceGroupID *string `json:"recoveryAzureV1ResourceGroupId,omitempty"` + // RecoveryAzureV2ResourceGroupID - The recovery Azure resource group Id for resource manager deployment. + RecoveryAzureV2ResourceGroupID *string `json:"recoveryAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // DiskIDToDiskEncryptionMap - The dictionary of disk resource Id to disk encryption set ARM Id. + DiskIDToDiskEncryptionMap map[string]*string `json:"diskIdToDiskEncryptionMap"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // VMDisks - The list of disk update properties. + VMDisks *[]UpdateDiskInput `json:"vmDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + hvraurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if hvraurpii.RecoveryAzureV1ResourceGroupID != nil { + objectMap["recoveryAzureV1ResourceGroupId"] = hvraurpii.RecoveryAzureV1ResourceGroupID + } + if hvraurpii.RecoveryAzureV2ResourceGroupID != nil { + objectMap["recoveryAzureV2ResourceGroupId"] = hvraurpii.RecoveryAzureV2ResourceGroupID + } + if hvraurpii.UseManagedDisks != nil { + objectMap["useManagedDisks"] = hvraurpii.UseManagedDisks + } + if hvraurpii.DiskIDToDiskEncryptionMap != nil { + objectMap["diskIdToDiskEncryptionMap"] = hvraurpii.DiskIDToDiskEncryptionMap + } + if hvraurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = hvraurpii.TargetProximityPlacementGroupID + } + if hvraurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = hvraurpii.TargetAvailabilityZone + } + if hvraurpii.TargetVMTags != nil { + objectMap["targetVmTags"] = hvraurpii.TargetVMTags + } + if hvraurpii.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = hvraurpii.TargetManagedDiskTags + } + if hvraurpii.TargetNicTags != nil { + objectMap["targetNicTags"] = hvraurpii.TargetNicTags + } + if hvraurpii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = hvraurpii.SQLServerLicenseType + } + if hvraurpii.VMDisks != nil { + objectMap["vmDisks"] = hvraurpii.VMDisks + } + if hvraurpii.InstanceType != "" { + objectMap["instanceType"] = hvraurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return &hvraurpii, true +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for HyperVReplicaAzureUpdateReplicationProtectedItemInput. +func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &hvraurpii, true +} + +// HyperVReplicaBaseEventDetails abstract model class for event details of a HyperVReplica E2E event. +type HyperVReplicaBaseEventDetails struct { + // ContainerName - The container friendly name. + ContainerName *string `json:"containerName,omitempty"` + // FabricName - The fabric friendly name. + FabricName *string `json:"fabricName,omitempty"` + // RemoteContainerName - The remote container name. + RemoteContainerName *string `json:"remoteContainerName,omitempty"` + // RemoteFabricName - The remote fabric name. + RemoteFabricName *string `json:"remoteFabricName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) MarshalJSON() ([]byte, error) { + hvrbed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails + objectMap := make(map[string]interface{}) + if hvrbed.ContainerName != nil { + objectMap["containerName"] = hvrbed.ContainerName + } + if hvrbed.FabricName != nil { + objectMap["fabricName"] = hvrbed.FabricName + } + if hvrbed.RemoteContainerName != nil { + objectMap["remoteContainerName"] = hvrbed.RemoteContainerName + } + if hvrbed.RemoteFabricName != nil { + objectMap["remoteFabricName"] = hvrbed.RemoteFabricName + } + if hvrbed.InstanceType != "" { + objectMap["instanceType"] = hvrbed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return &hvrbed, true +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for HyperVReplicaBaseEventDetails. +func (hvrbed HyperVReplicaBaseEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &hvrbed, true +} + +// HyperVReplicaBasePolicyDetails base class for HyperVReplica policy details. +type HyperVReplicaBasePolicyDetails struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud. + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) MarshalJSON() ([]byte, error) { + hvrbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails + objectMap := make(map[string]interface{}) + if hvrbpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpd.RecoveryPoints + } + if hvrbpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpd.Compression != nil { + objectMap["compression"] = hvrbpd.Compression + } + if hvrbpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpd.InitialReplicationMethod + } + if hvrbpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpd.OnlineReplicationStartTime + } + if hvrbpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpd.OfflineReplicationImportPath + } + if hvrbpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpd.OfflineReplicationExportPath + } + if hvrbpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpd.ReplicationPort + } + if hvrbpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpd.AllowedAuthenticationType + } + if hvrbpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrbpd.ReplicaDeletionOption + } + if hvrbpd.InstanceType != "" { + objectMap["instanceType"] = hvrbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return &hvrbpd, true +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBasePolicyDetails. +func (hvrbpd HyperVReplicaBasePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrbpd, true +} + +// HyperVReplicaBaseReplicationDetails hyper V replica provider specific settings base class. +type HyperVReplicaBaseReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) MarshalJSON() ([]byte, error) { + hvrbrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails + objectMap := make(map[string]interface{}) + if hvrbrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrbrd.LastReplicatedTime + } + if hvrbrd.VMNics != nil { + objectMap["vmNics"] = hvrbrd.VMNics + } + if hvrbrd.VMID != nil { + objectMap["vmId"] = hvrbrd.VMID + } + if hvrbrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrbrd.VMProtectionState + } + if hvrbrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrbrd.VMProtectionStateDescription + } + if hvrbrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrbrd.InitialReplicationDetails + } + if hvrbrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrbrd.VMDiskDetails + } + if hvrbrd.InstanceType != "" { + objectMap["instanceType"] = hvrbrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return &hvrbrd, true +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBaseReplicationDetails. +func (hvrbrd HyperVReplicaBaseReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrbrd, true +} + +// HyperVReplicaBluePolicyDetails hyper-V Replica Blue specific protection profile details. +type HyperVReplicaBluePolicyDetails struct { + // ReplicationFrequencyInSeconds - A value indicating the replication interval. + ReplicationFrequencyInSeconds *int32 `json:"replicationFrequencyInSeconds,omitempty"` + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) MarshalJSON() ([]byte, error) { + hvrbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbpd.ReplicationFrequencyInSeconds != nil { + objectMap["replicationFrequencyInSeconds"] = hvrbpd.ReplicationFrequencyInSeconds + } + if hvrbpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpd.RecoveryPoints + } + if hvrbpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpd.Compression != nil { + objectMap["compression"] = hvrbpd.Compression + } + if hvrbpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpd.InitialReplicationMethod + } + if hvrbpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpd.OnlineReplicationStartTime + } + if hvrbpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpd.OfflineReplicationImportPath + } + if hvrbpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpd.OfflineReplicationExportPath + } + if hvrbpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpd.ReplicationPort + } + if hvrbpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpd.AllowedAuthenticationType + } + if hvrbpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrbpd.ReplicaDeletionOption + } + if hvrbpd.InstanceType != "" { + objectMap["instanceType"] = hvrbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return &hvrbpd, true +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaBluePolicyDetails. +func (hvrbpd HyperVReplicaBluePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrbpd, true +} + +// HyperVReplicaBluePolicyInput hyperV Replica Blue policy input. +type HyperVReplicaBluePolicyInput struct { + // ReplicationFrequencyInSeconds - A value indicating the replication interval. + ReplicationFrequencyInSeconds *int32 `json:"replicationFrequencyInSeconds,omitempty"` + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletion - A value indicating whether the VM has to be auto deleted. + ReplicaDeletion *string `json:"replicaDeletion,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) MarshalJSON() ([]byte, error) { + hvrbpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbpi.ReplicationFrequencyInSeconds != nil { + objectMap["replicationFrequencyInSeconds"] = hvrbpi.ReplicationFrequencyInSeconds + } + if hvrbpi.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrbpi.RecoveryPoints + } + if hvrbpi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrbpi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrbpi.Compression != nil { + objectMap["compression"] = hvrbpi.Compression + } + if hvrbpi.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrbpi.InitialReplicationMethod + } + if hvrbpi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrbpi.OnlineReplicationStartTime + } + if hvrbpi.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrbpi.OfflineReplicationImportPath + } + if hvrbpi.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrbpi.OfflineReplicationExportPath + } + if hvrbpi.ReplicationPort != nil { + objectMap["replicationPort"] = hvrbpi.ReplicationPort + } + if hvrbpi.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrbpi.AllowedAuthenticationType + } + if hvrbpi.ReplicaDeletion != nil { + objectMap["replicaDeletion"] = hvrbpi.ReplicaDeletion + } + if hvrbpi.InstanceType != "" { + objectMap["instanceType"] = hvrbpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return &hvrbpi, true +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return &hvrbpi, true +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaBluePolicyInput. +func (hvrbpi HyperVReplicaBluePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrbpi, true +} + +// HyperVReplicaBlueReplicationDetails hyperV replica 2012 R2 (Blue) replication details. +type HyperVReplicaBlueReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) MarshalJSON() ([]byte, error) { + hvrbrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2 + objectMap := make(map[string]interface{}) + if hvrbrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrbrd.LastReplicatedTime + } + if hvrbrd.VMNics != nil { + objectMap["vmNics"] = hvrbrd.VMNics + } + if hvrbrd.VMID != nil { + objectMap["vmId"] = hvrbrd.VMID + } + if hvrbrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrbrd.VMProtectionState + } + if hvrbrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrbrd.VMProtectionStateDescription + } + if hvrbrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrbrd.InitialReplicationDetails + } + if hvrbrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrbrd.VMDiskDetails + } + if hvrbrd.InstanceType != "" { + objectMap["instanceType"] = hvrbrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return &hvrbrd, true +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaBlueReplicationDetails. +func (hvrbrd HyperVReplicaBlueReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrbrd, true +} + +// HyperVReplicaPolicyDetails hyper-V Replica Blue specific protection profile details. +type HyperVReplicaPolicyDetails struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletionOption - A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud + ReplicaDeletionOption *string `json:"replicaDeletionOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) MarshalJSON() ([]byte, error) { + hvrpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrpd.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrpd.RecoveryPoints + } + if hvrpd.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrpd.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrpd.Compression != nil { + objectMap["compression"] = hvrpd.Compression + } + if hvrpd.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrpd.InitialReplicationMethod + } + if hvrpd.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrpd.OnlineReplicationStartTime + } + if hvrpd.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrpd.OfflineReplicationImportPath + } + if hvrpd.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrpd.OfflineReplicationExportPath + } + if hvrpd.ReplicationPort != nil { + objectMap["replicationPort"] = hvrpd.ReplicationPort + } + if hvrpd.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrpd.AllowedAuthenticationType + } + if hvrpd.ReplicaDeletionOption != nil { + objectMap["replicaDeletionOption"] = hvrpd.ReplicaDeletionOption + } + if hvrpd.InstanceType != "" { + objectMap["instanceType"] = hvrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return &hvrpd, true +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for HyperVReplicaPolicyDetails. +func (hvrpd HyperVReplicaPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &hvrpd, true +} + +// BasicHyperVReplicaPolicyInput hyper-V Replica specific policy Input. +type BasicHyperVReplicaPolicyInput interface { + AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) + AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) +} + +// HyperVReplicaPolicyInput hyper-V Replica specific policy Input. +type HyperVReplicaPolicyInput struct { + // RecoveryPoints - A value indicating the number of recovery points. + RecoveryPoints *int32 `json:"recoveryPoints,omitempty"` + // ApplicationConsistentSnapshotFrequencyInHours - A value indicating the application consistent frequency. + ApplicationConsistentSnapshotFrequencyInHours *int32 `json:"applicationConsistentSnapshotFrequencyInHours,omitempty"` + // Compression - A value indicating whether compression has to be enabled. + Compression *string `json:"compression,omitempty"` + // InitialReplicationMethod - A value indicating whether IR is online. + InitialReplicationMethod *string `json:"initialReplicationMethod,omitempty"` + // OnlineReplicationStartTime - A value indicating the online IR start time. + OnlineReplicationStartTime *string `json:"onlineReplicationStartTime,omitempty"` + // OfflineReplicationImportPath - A value indicating the offline IR import path. + OfflineReplicationImportPath *string `json:"offlineReplicationImportPath,omitempty"` + // OfflineReplicationExportPath - A value indicating the offline IR export path. + OfflineReplicationExportPath *string `json:"offlineReplicationExportPath,omitempty"` + // ReplicationPort - A value indicating the recovery HTTPS port. + ReplicationPort *int32 `json:"replicationPort,omitempty"` + // AllowedAuthenticationType - A value indicating the authentication type. + AllowedAuthenticationType *int32 `json:"allowedAuthenticationType,omitempty"` + // ReplicaDeletion - A value indicating whether the VM has to be auto deleted. + ReplicaDeletion *string `json:"replicaDeletion,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicHyperVReplicaPolicyInput(body []byte) (BasicHyperVReplicaPolicyInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2): + var hvrbpi HyperVReplicaBluePolicyInput + err := json.Unmarshal(body, &hvrbpi) + return hvrbpi, err + default: + var hvrpi HyperVReplicaPolicyInput + err := json.Unmarshal(body, &hvrpi) + return hvrpi, err + } +} +func unmarshalBasicHyperVReplicaPolicyInputArray(body []byte) ([]BasicHyperVReplicaPolicyInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + hvrpiArray := make([]BasicHyperVReplicaPolicyInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + hvrpi, err := unmarshalBasicHyperVReplicaPolicyInput(*rawMessage) + if err != nil { + return nil, err + } + hvrpiArray[index] = hvrpi + } + return hvrpiArray, nil +} + +// MarshalJSON is the custom marshaler for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) MarshalJSON() ([]byte, error) { + hvrpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrpi.RecoveryPoints != nil { + objectMap["recoveryPoints"] = hvrpi.RecoveryPoints + } + if hvrpi.ApplicationConsistentSnapshotFrequencyInHours != nil { + objectMap["applicationConsistentSnapshotFrequencyInHours"] = hvrpi.ApplicationConsistentSnapshotFrequencyInHours + } + if hvrpi.Compression != nil { + objectMap["compression"] = hvrpi.Compression + } + if hvrpi.InitialReplicationMethod != nil { + objectMap["initialReplicationMethod"] = hvrpi.InitialReplicationMethod + } + if hvrpi.OnlineReplicationStartTime != nil { + objectMap["onlineReplicationStartTime"] = hvrpi.OnlineReplicationStartTime + } + if hvrpi.OfflineReplicationImportPath != nil { + objectMap["offlineReplicationImportPath"] = hvrpi.OfflineReplicationImportPath + } + if hvrpi.OfflineReplicationExportPath != nil { + objectMap["offlineReplicationExportPath"] = hvrpi.OfflineReplicationExportPath + } + if hvrpi.ReplicationPort != nil { + objectMap["replicationPort"] = hvrpi.ReplicationPort + } + if hvrpi.AllowedAuthenticationType != nil { + objectMap["allowedAuthenticationType"] = hvrpi.AllowedAuthenticationType + } + if hvrpi.ReplicaDeletion != nil { + objectMap["replicaDeletion"] = hvrpi.ReplicaDeletion + } + if hvrpi.InstanceType != "" { + objectMap["instanceType"] = hvrpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return &hvrpi, true +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return &hvrpi, true +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for HyperVReplicaPolicyInput. +func (hvrpi HyperVReplicaPolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &hvrpi, true +} + +// HyperVReplicaReplicationDetails hyperV replica 2012 replication details. +type HyperVReplicaReplicationDetails struct { + // LastReplicatedTime - The Last replication time. + LastReplicatedTime *date.Time `json:"lastReplicatedTime,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // InitialReplicationDetails - Initial replication details. + InitialReplicationDetails *InitialReplicationDetails `json:"initialReplicationDetails,omitempty"` + // VMDiskDetails - VM disk details. + VMDiskDetails *[]DiskDetails `json:"vMDiskDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) MarshalJSON() ([]byte, error) { + hvrrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012 + objectMap := make(map[string]interface{}) + if hvrrd.LastReplicatedTime != nil { + objectMap["lastReplicatedTime"] = hvrrd.LastReplicatedTime + } + if hvrrd.VMNics != nil { + objectMap["vmNics"] = hvrrd.VMNics + } + if hvrrd.VMID != nil { + objectMap["vmId"] = hvrrd.VMID + } + if hvrrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = hvrrd.VMProtectionState + } + if hvrrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = hvrrd.VMProtectionStateDescription + } + if hvrrd.InitialReplicationDetails != nil { + objectMap["initialReplicationDetails"] = hvrrd.InitialReplicationDetails + } + if hvrrd.VMDiskDetails != nil { + objectMap["vMDiskDetails"] = hvrrd.VMDiskDetails + } + if hvrrd.InstanceType != "" { + objectMap["instanceType"] = hvrrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return &hvrrd, true +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for HyperVReplicaReplicationDetails. +func (hvrrd HyperVReplicaReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &hvrrd, true +} + +// HyperVSiteDetails hyperVSite fabric specific details. +type HyperVSiteDetails struct { + // HyperVHosts - The list of Hyper-V hosts associated with the fabric. + HyperVHosts *[]HyperVHostDetails `json:"hyperVHosts,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) MarshalJSON() ([]byte, error) { + hvsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite + objectMap := make(map[string]interface{}) + if hvsd.HyperVHosts != nil { + objectMap["hyperVHosts"] = hvsd.HyperVHosts + } + if hvsd.InstanceType != "" { + objectMap["instanceType"] = hvsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return &hvsd, true +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for HyperVSiteDetails. +func (hvsd HyperVSiteDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &hvsd, true +} + +// BasicHyperVVirtualMachineDetails single Host fabric provider specific VM settings. +type BasicHyperVVirtualMachineDetails interface { + AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) + AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) +} + +// HyperVVirtualMachineDetails single Host fabric provider specific VM settings. +type HyperVVirtualMachineDetails struct { + // SourceItemID - The source id of the object. + SourceItemID *string `json:"sourceItemId,omitempty"` + // Generation - The id of the object in fabric. + Generation *string `json:"generation,omitempty"` + // OsDetails - The Last replication time. + OsDetails *OSDetails `json:"osDetails,omitempty"` + // DiskDetails - The Last successful failover time. + DiskDetails *[]DiskDetails `json:"diskDetails,omitempty"` + // HasPhysicalDisk - A value indicating whether the VM has a physical disk attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasPhysicalDisk PresenceStatus `json:"hasPhysicalDisk,omitempty"` + // HasFibreChannelAdapter - A value indicating whether the VM has a fibre channel adapter attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasFibreChannelAdapter PresenceStatus `json:"hasFibreChannelAdapter,omitempty"` + // HasSharedVhd - A value indicating whether the VM has a shared VHD attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasSharedVhd PresenceStatus `json:"hasSharedVhd,omitempty"` + // HyperVHostID - The Id of the hyper-v host in fabric. + HyperVHostID *string `json:"hyperVHostId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicHyperVVirtualMachineDetails(body []byte) (BasicHyperVVirtualMachineDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeVmmVirtualMachine): + var vvmd VmmVirtualMachineDetails + err := json.Unmarshal(body, &vvmd) + return vvmd, err + default: + var hvvmd HyperVVirtualMachineDetails + err := json.Unmarshal(body, &hvvmd) + return hvvmd, err + } +} +func unmarshalBasicHyperVVirtualMachineDetailsArray(body []byte) ([]BasicHyperVVirtualMachineDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + hvvmdArray := make([]BasicHyperVVirtualMachineDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + hvvmd, err := unmarshalBasicHyperVVirtualMachineDetails(*rawMessage) + if err != nil { + return nil, err + } + hvvmdArray[index] = hvvmd + } + return hvvmdArray, nil +} + +// MarshalJSON is the custom marshaler for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) MarshalJSON() ([]byte, error) { + hvvmd.InstanceType = InstanceTypeHyperVVirtualMachine + objectMap := make(map[string]interface{}) + if hvvmd.SourceItemID != nil { + objectMap["sourceItemId"] = hvvmd.SourceItemID + } + if hvvmd.Generation != nil { + objectMap["generation"] = hvvmd.Generation + } + if hvvmd.OsDetails != nil { + objectMap["osDetails"] = hvvmd.OsDetails + } + if hvvmd.DiskDetails != nil { + objectMap["diskDetails"] = hvvmd.DiskDetails + } + if hvvmd.HasPhysicalDisk != "" { + objectMap["hasPhysicalDisk"] = hvvmd.HasPhysicalDisk + } + if hvvmd.HasFibreChannelAdapter != "" { + objectMap["hasFibreChannelAdapter"] = hvvmd.HasFibreChannelAdapter + } + if hvvmd.HasSharedVhd != "" { + objectMap["hasSharedVhd"] = hvvmd.HasSharedVhd + } + if hvvmd.HyperVHostID != nil { + objectMap["hyperVHostId"] = hvvmd.HyperVHostID + } + if hvvmd.InstanceType != "" { + objectMap["instanceType"] = hvvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return &hvvmd, true +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return &hvvmd, true +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for HyperVVirtualMachineDetails. +func (hvvmd HyperVVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &hvvmd, true +} + +// IdentityProviderDetails identity provider details. +type IdentityProviderDetails struct { + // TenantID - The tenant Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + TenantID *string `json:"tenantId,omitempty"` + // ApplicationID - The application/client Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ApplicationID *string `json:"applicationId,omitempty"` + // ObjectID - The object Id of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ObjectID *string `json:"objectId,omitempty"` + // Audience - The intended Audience of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + Audience *string `json:"audience,omitempty"` + // AadAuthority - The base authority for Azure Active Directory authentication. + AadAuthority *string `json:"aadAuthority,omitempty"` +} + +// IdentityProviderInput identity provider input. +type IdentityProviderInput struct { + // TenantID - The tenant Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + TenantID *string `json:"tenantId,omitempty"` + // ApplicationID - The application/client Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ApplicationID *string `json:"applicationId,omitempty"` + // ObjectID - The object Id of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + ObjectID *string `json:"objectId,omitempty"` + // Audience - The intended Audience of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + Audience *string `json:"audience,omitempty"` + // AadAuthority - The base authority for Azure Active Directory authentication. + AadAuthority *string `json:"aadAuthority,omitempty"` +} + +// InconsistentVMDetails this class stores the monitoring details for consistency check of inconsistent +// Protected Entity. +type InconsistentVMDetails struct { + // VMName - The Vm name. + VMName *string `json:"vmName,omitempty"` + // CloudName - The Cloud name. + CloudName *string `json:"cloudName,omitempty"` + // Details - The list of details regarding state of the Protected Entity in SRS and On prem. + Details *[]string `json:"details,omitempty"` + // ErrorIds - The list of error ids. + ErrorIds *[]string `json:"errorIds,omitempty"` +} + +// InitialReplicationDetails initial replication details. +type InitialReplicationDetails struct { + // InitialReplicationType - Initial replication type. + InitialReplicationType *string `json:"initialReplicationType,omitempty"` + // InitialReplicationProgressPercentage - The initial replication progress percentage. + InitialReplicationProgressPercentage *string `json:"initialReplicationProgressPercentage,omitempty"` +} + +// InlineWorkflowTaskDetails this class represents the inline workflow task details. +type InlineWorkflowTaskDetails struct { + // WorkflowIds - The list of child workflow ids. + WorkflowIds *[]string `json:"workflowIds,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) MarshalJSON() ([]byte, error) { + iwtd.InstanceType = InstanceTypeInlineWorkflowTaskDetails + objectMap := make(map[string]interface{}) + if iwtd.WorkflowIds != nil { + objectMap["workflowIds"] = iwtd.WorkflowIds + } + if iwtd.ChildTasks != nil { + objectMap["childTasks"] = iwtd.ChildTasks + } + if iwtd.InstanceType != "" { + objectMap["instanceType"] = iwtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return &iwtd, true +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for InlineWorkflowTaskDetails. +func (iwtd InlineWorkflowTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &iwtd, true +} + +// InMageAgentDetails the details of the InMage agent. +type InMageAgentDetails struct { + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentUpdateStatus - A value indicating whether installed agent needs to be updated. + AgentUpdateStatus *string `json:"agentUpdateStatus,omitempty"` + // PostUpdateRebootStatus - A value indicating whether reboot is required after update is applied. + PostUpdateRebootStatus *string `json:"postUpdateRebootStatus,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` +} + +// InMageAzureV2ApplyRecoveryPointInput applyRecoveryPoint input specific to InMageAzureV2 provider. +type InMageAzureV2ApplyRecoveryPointInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + imavarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavarpi.InstanceType != "" { + objectMap["instanceType"] = imavarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return &imavarpi, true +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageAzureV2ApplyRecoveryPointInput. +func (imavarpi InMageAzureV2ApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &imavarpi, true +} + +// InMageAzureV2DiskInputDetails disk input details. +type InMageAzureV2DiskInputDetails struct { + // DiskID - The DiskId. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The LogStorageAccountId. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageAzureV2EnableProtectionInput vMware Azure specific enable protection input. +type InMageAzureV2EnableProtectionInput struct { + // MasterTargetID - The Master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // StorageAccountID - The storage account Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // MultiVMGroupID - The multi VM group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]InMageAzureV2DiskInputDetails `json:"disksToInclude,omitempty"` + // TargetAzureNetworkID - The selected target Azure network Id. + TargetAzureNetworkID *string `json:"targetAzureNetworkId,omitempty"` + // TargetAzureSubnetID - The selected target Azure subnet Id. + TargetAzureSubnetID *string `json:"targetAzureSubnetId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target VM after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // TargetAzureVMName - The target azure VM Name. + TargetAzureVMName *string `json:"targetAzureVmName,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // TargetAzureV1ResourceGroupID - The Id of the target resource group (for classic deployment) in which the failover VM is to be created. + TargetAzureV1ResourceGroupID *string `json:"targetAzureV1ResourceGroupId,omitempty"` + // TargetAzureV2ResourceGroupID - The Id of the target resource group (for resource manager deployment) in which the failover VM is to be created. + TargetAzureV2ResourceGroupID *string `json:"targetAzureV2ResourceGroupId,omitempty"` + // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id for resource manager deployment. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) MarshalJSON() ([]byte, error) { + imavepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavepi.MasterTargetID != nil { + objectMap["masterTargetId"] = imavepi.MasterTargetID + } + if imavepi.ProcessServerID != nil { + objectMap["processServerId"] = imavepi.ProcessServerID + } + if imavepi.StorageAccountID != nil { + objectMap["storageAccountId"] = imavepi.StorageAccountID + } + if imavepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imavepi.RunAsAccountID + } + if imavepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imavepi.MultiVMGroupID + } + if imavepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imavepi.MultiVMGroupName + } + if imavepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imavepi.DisksToInclude + } + if imavepi.TargetAzureNetworkID != nil { + objectMap["targetAzureNetworkId"] = imavepi.TargetAzureNetworkID + } + if imavepi.TargetAzureSubnetID != nil { + objectMap["targetAzureSubnetId"] = imavepi.TargetAzureSubnetID + } + if imavepi.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = imavepi.EnableRdpOnTargetOption + } + if imavepi.TargetAzureVMName != nil { + objectMap["targetAzureVmName"] = imavepi.TargetAzureVMName + } + if imavepi.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imavepi.LogStorageAccountID + } + if imavepi.TargetAzureV1ResourceGroupID != nil { + objectMap["targetAzureV1ResourceGroupId"] = imavepi.TargetAzureV1ResourceGroupID + } + if imavepi.TargetAzureV2ResourceGroupID != nil { + objectMap["targetAzureV2ResourceGroupId"] = imavepi.TargetAzureV2ResourceGroupID + } + if imavepi.DiskType != "" { + objectMap["diskType"] = imavepi.DiskType + } + if imavepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imavepi.TargetAvailabilitySetID + } + if imavepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavepi.TargetAvailabilityZone + } + if imavepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavepi.TargetProximityPlacementGroupID + } + if imavepi.LicenseType != "" { + objectMap["licenseType"] = imavepi.LicenseType + } + if imavepi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = imavepi.SQLServerLicenseType + } + if imavepi.TargetVMSize != nil { + objectMap["targetVmSize"] = imavepi.TargetVMSize + } + if imavepi.DiskEncryptionSetID != nil { + objectMap["diskEncryptionSetId"] = imavepi.DiskEncryptionSetID + } + if imavepi.TargetVMTags != nil { + objectMap["targetVmTags"] = imavepi.TargetVMTags + } + if imavepi.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = imavepi.SeedManagedDiskTags + } + if imavepi.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavepi.TargetManagedDiskTags + } + if imavepi.TargetNicTags != nil { + objectMap["targetNicTags"] = imavepi.TargetNicTags + } + if imavepi.InstanceType != "" { + objectMap["instanceType"] = imavepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return &imavepi, true +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageAzureV2EnableProtectionInput. +func (imavepi InMageAzureV2EnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imavepi, true +} + +// InMageAzureV2EventDetails model class for event details of a VMwareAzureV2 event. +type InMageAzureV2EventDetails struct { + // EventType - InMage Event type. Takes one of the values of InMageDataContract.InMageMonitoringEventType. + EventType *string `json:"eventType,omitempty"` + // Category - InMage Event Category. + Category *string `json:"category,omitempty"` + // Component - InMage Event Component. + Component *string `json:"component,omitempty"` + // CorrectiveAction - Corrective Action string for the event. + CorrectiveAction *string `json:"correctiveAction,omitempty"` + // Details - InMage Event Details. + Details *string `json:"details,omitempty"` + // Summary - InMage Event Summary. + Summary *string `json:"summary,omitempty"` + // SiteName - VMware Site name. + SiteName *string `json:"siteName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) MarshalJSON() ([]byte, error) { + imaved.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imaved.EventType != nil { + objectMap["eventType"] = imaved.EventType + } + if imaved.Category != nil { + objectMap["category"] = imaved.Category + } + if imaved.Component != nil { + objectMap["component"] = imaved.Component + } + if imaved.CorrectiveAction != nil { + objectMap["correctiveAction"] = imaved.CorrectiveAction + } + if imaved.Details != nil { + objectMap["details"] = imaved.Details + } + if imaved.Summary != nil { + objectMap["summary"] = imaved.Summary + } + if imaved.SiteName != nil { + objectMap["siteName"] = imaved.SiteName + } + if imaved.InstanceType != "" { + objectMap["instanceType"] = imaved.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return &imaved, true +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageAzureV2EventDetails. +func (imaved InMageAzureV2EventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imaved, true +} + +// InMageAzureV2ManagedDiskDetails inMageAzureV2 Managed disk details. +type InMageAzureV2ManagedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // SeedManagedDiskID - Seed managed disk Id. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // ReplicaDiskType - The replica disk type. + ReplicaDiskType *string `json:"replicaDiskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // TargetDiskName - The target disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// InMageAzureV2PolicyDetails inMage Azure v2 specific protection profile details. +type InMageAzureV2PolicyDetails struct { + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) MarshalJSON() ([]byte, error) { + imavpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imavpd.CrashConsistentFrequencyInMinutes + } + if imavpd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imavpd.RecoveryPointThresholdInMinutes + } + if imavpd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imavpd.RecoveryPointHistory + } + if imavpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imavpd.AppConsistentFrequencyInMinutes + } + if imavpd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imavpd.MultiVMSyncStatus + } + if imavpd.InstanceType != "" { + objectMap["instanceType"] = imavpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return &imavpd, true +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageAzureV2PolicyDetails. +func (imavpd InMageAzureV2PolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imavpd, true +} + +// InMageAzureV2PolicyInput vMWare Azure specific policy Input. +type InMageAzureV2PolicyInput struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) MarshalJSON() ([]byte, error) { + imavpi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavpi.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imavpi.RecoveryPointThresholdInMinutes + } + if imavpi.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imavpi.RecoveryPointHistory + } + if imavpi.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imavpi.CrashConsistentFrequencyInMinutes + } + if imavpi.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imavpi.AppConsistentFrequencyInMinutes + } + if imavpi.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = imavpi.MultiVMSyncStatus + } + if imavpi.InstanceType != "" { + objectMap["instanceType"] = imavpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return &imavpi, true +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageAzureV2PolicyInput. +func (imavpi InMageAzureV2PolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imavpi, true +} + +// InMageAzureV2ProtectedDiskDetails inMageAzureV2 protected disk details. +type InMageAzureV2ProtectedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // HealthErrorCode - The health error code for the disk. + HealthErrorCode *string `json:"healthErrorCode,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncDurationInSeconds - The resync duration in seconds. + ResyncDurationInSeconds *int64 `json:"resyncDurationInSeconds,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // FileSystemCapacityInBytes - The disk file system capacity in bytes. + FileSystemCapacityInBytes *int64 `json:"fileSystemCapacityInBytes,omitempty"` + // SourceDataInMegaBytes - The source data transit in MB. + SourceDataInMegaBytes *float64 `json:"sourceDataInMegaBytes,omitempty"` + // PsDataInMegaBytes - The PS data transit in MB. + PsDataInMegaBytes *float64 `json:"psDataInMegaBytes,omitempty"` + // TargetDataInMegaBytes - The target data transit in MB. + TargetDataInMegaBytes *float64 `json:"targetDataInMegaBytes,omitempty"` + // DiskResized - A value indicating whether disk is resized. + DiskResized *string `json:"diskResized,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // ResyncProcessedBytes - The resync processed bytes. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTotalTransferredBytes - The resync total transferred bytes. + ResyncTotalTransferredBytes *int64 `json:"resyncTotalTransferredBytes,omitempty"` + // ResyncLast15MinutesTransferredBytes - The resync last 15 minutes transferred bytes. + ResyncLast15MinutesTransferredBytes *int64 `json:"resyncLast15MinutesTransferredBytes,omitempty"` + // ResyncLastDataTransferTimeUTC - The last data transfer time in UTC. + ResyncLastDataTransferTimeUTC *date.Time `json:"resyncLastDataTransferTimeUTC,omitempty"` + // ResyncStartTime - The resync start time. + ResyncStartTime *date.Time `json:"resyncStartTime,omitempty"` + // ProgressHealth - The Progress Health. + ProgressHealth *string `json:"progressHealth,omitempty"` + // ProgressStatus - The Progress Status. + ProgressStatus *string `json:"progressStatus,omitempty"` + // SecondsToTakeSwitchProvider - The seconds to take for switch provider. + SecondsToTakeSwitchProvider *int64 `json:"secondsToTakeSwitchProvider,omitempty"` +} + +// InMageAzureV2RecoveryPointDetails inMage Azure V2 provider specific recovery point details. +type InMageAzureV2RecoveryPointDetails struct { + // IsMultiVMSyncPoint - A value indicating whether the recovery point is multi VM consistent. + IsMultiVMSyncPoint *string `json:"isMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) MarshalJSON() ([]byte, error) { + imavrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavrpd.IsMultiVMSyncPoint != nil { + objectMap["isMultiVmSyncPoint"] = imavrpd.IsMultiVMSyncPoint + } + if imavrpd.InstanceType != "" { + objectMap["instanceType"] = imavrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return &imavrpd, true +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageAzureV2RecoveryPointDetails. +func (imavrpd InMageAzureV2RecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &imavrpd, true +} + +// InMageAzureV2ReplicationDetails inMageAzureV2 provider specific settings. +type InMageAzureV2ReplicationDetails struct { + // InfrastructureVMID - The infrastructure VM Id. + InfrastructureVMID *string `json:"infrastructureVmId,omitempty"` + // VCenterInfrastructureID - The vCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // CompressedDataRateInMB - The compressed data change rate in MB. + CompressedDataRateInMB *float64 `json:"compressedDataRateInMB,omitempty"` + // UncompressedDataRateInMB - The uncompressed data change rate in MB. + UncompressedDataRateInMB *float64 `json:"uncompressedDataRateInMB,omitempty"` + // IPAddress - The source IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // IsAgentUpdateRequired - A value indicating whether installed agent needs to be updated. + IsAgentUpdateRequired *string `json:"isAgentUpdateRequired,omitempty"` + // IsRebootAfterUpdateRequired - A value indicating whether the source server requires a restart after update. + IsRebootAfterUpdateRequired *string `json:"isRebootAfterUpdateRequired,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // ProcessServerName - The process server name. + ProcessServerName *string `json:"processServerName,omitempty"` + // MultiVMGroupID - The multi vm group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi vm sync is enabled or disabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageAzureV2ProtectedDiskDetails `json:"protectedDisks,omitempty"` + // DiskResized - A value indicating whether any disk is resized for this VM. + DiskResized *string `json:"diskResized,omitempty"` + // MasterTargetID - The master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // OsType - The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // VhdName - The OS disk VHD name. + VhdName *string `json:"vhdName,omitempty"` + // OsDiskID - The id of the disk containing the OS. + OsDiskID *string `json:"osDiskId,omitempty"` + // AzureVMDiskDetails - Azure VM Disk details. + AzureVMDiskDetails *[]AzureVMDiskDetails `json:"azureVMDiskDetails,omitempty"` + // RecoveryAzureVMName - Recovery Azure given name. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureVMSize - The Recovery Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // RecoveryAzureStorageAccount - The recovery Azure storage account. + RecoveryAzureStorageAccount *string `json:"recoveryAzureStorageAccount,omitempty"` + // RecoveryAzureLogStorageAccountID - The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. + RecoveryAzureLogStorageAccountID *string `json:"recoveryAzureLogStorageAccountId,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // SelectedRecoveryAzureNetworkID - The selected recovery azure network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The test failover virtual network. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. Value can be vCenter or physical. + DiscoveryType *string `json:"discoveryType,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // Datastores - The datastores of the on-premise machine. Value can be list of strings that contain datastore names. + Datastores *[]string `json:"datastores,omitempty"` + // TargetVMID - The ARM Id of the target Azure VM. This value will be null until the VM is failed over. Only after failure it will be populated with the ARM Id of the Azure VM. + TargetVMID *string `json:"targetVmId,omitempty"` + // RecoveryAzureResourceGroupID - The target resource group Id. + RecoveryAzureResourceGroupID *string `json:"recoveryAzureResourceGroupId,omitempty"` + // RecoveryAvailabilitySetID - The recovery availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // ValidationErrors - The validation errors of the on-premise machine Value can be list of validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastUpdateReceivedTime - The last update time received from on-prem components. + LastUpdateReceivedTime *date.Time `json:"lastUpdateReceivedTime,omitempty"` + // ReplicaID - The replica id of the protected item. + ReplicaID *string `json:"replicaId,omitempty"` + // OsVersion - The OS Version of the protected item. + OsVersion *string `json:"osVersion,omitempty"` + // ProtectedManagedDisks - The list of protected managed disks. + ProtectedManagedDisks *[]InMageAzureV2ManagedDiskDetails `json:"protectedManagedDisks,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // FirmwareType - The firmware type of this protected item. + FirmwareType *string `json:"firmwareType,omitempty"` + // AzureVMGeneration - The target generation for this protected item. + AzureVMGeneration *string `json:"azureVmGeneration,omitempty"` + // IsAdditionalStatsAvailable - A value indicating whether additional IR stats are available or not. + IsAdditionalStatsAvailable *bool `json:"isAdditionalStatsAvailable,omitempty"` + // TotalDataTransferred - The total transferred data in bytes. + TotalDataTransferred *int64 `json:"totalDataTransferred,omitempty"` + // TotalProgressHealth - The progress health. + TotalProgressHealth *string `json:"totalProgressHealth,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedManagedDiskTags - The tags for the seed managed disks. + SeedManagedDiskTags map[string]*string `json:"seedManagedDiskTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // SwitchProviderBlockingErrorDetails - The switch provider blocking error information. + SwitchProviderBlockingErrorDetails *[]InMageAzureV2SwitchProviderBlockingErrorDetails `json:"switchProviderBlockingErrorDetails,omitempty"` + // SwitchProviderDetails - The switch provider blocking error information. + SwitchProviderDetails *InMageAzureV2SwitchProviderDetails `json:"switchProviderDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) MarshalJSON() ([]byte, error) { + imavrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavrd.InfrastructureVMID != nil { + objectMap["infrastructureVmId"] = imavrd.InfrastructureVMID + } + if imavrd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = imavrd.VCenterInfrastructureID + } + if imavrd.ProtectionStage != nil { + objectMap["protectionStage"] = imavrd.ProtectionStage + } + if imavrd.VMID != nil { + objectMap["vmId"] = imavrd.VMID + } + if imavrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = imavrd.VMProtectionState + } + if imavrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = imavrd.VMProtectionStateDescription + } + if imavrd.ResyncProgressPercentage != nil { + objectMap["resyncProgressPercentage"] = imavrd.ResyncProgressPercentage + } + if imavrd.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = imavrd.RpoInSeconds + } + if imavrd.CompressedDataRateInMB != nil { + objectMap["compressedDataRateInMB"] = imavrd.CompressedDataRateInMB + } + if imavrd.UncompressedDataRateInMB != nil { + objectMap["uncompressedDataRateInMB"] = imavrd.UncompressedDataRateInMB + } + if imavrd.IPAddress != nil { + objectMap["ipAddress"] = imavrd.IPAddress + } + if imavrd.AgentVersion != nil { + objectMap["agentVersion"] = imavrd.AgentVersion + } + if imavrd.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = imavrd.AgentExpiryDate + } + if imavrd.IsAgentUpdateRequired != nil { + objectMap["isAgentUpdateRequired"] = imavrd.IsAgentUpdateRequired + } + if imavrd.IsRebootAfterUpdateRequired != nil { + objectMap["isRebootAfterUpdateRequired"] = imavrd.IsRebootAfterUpdateRequired + } + if imavrd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = imavrd.LastHeartbeat + } + if imavrd.ProcessServerID != nil { + objectMap["processServerId"] = imavrd.ProcessServerID + } + if imavrd.ProcessServerName != nil { + objectMap["processServerName"] = imavrd.ProcessServerName + } + if imavrd.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imavrd.MultiVMGroupID + } + if imavrd.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imavrd.MultiVMGroupName + } + if imavrd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imavrd.MultiVMSyncStatus + } + if imavrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imavrd.ProtectedDisks + } + if imavrd.DiskResized != nil { + objectMap["diskResized"] = imavrd.DiskResized + } + if imavrd.MasterTargetID != nil { + objectMap["masterTargetId"] = imavrd.MasterTargetID + } + if imavrd.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = imavrd.SourceVMCPUCount + } + if imavrd.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = imavrd.SourceVMRAMSizeInMB + } + if imavrd.OsType != nil { + objectMap["osType"] = imavrd.OsType + } + if imavrd.VhdName != nil { + objectMap["vhdName"] = imavrd.VhdName + } + if imavrd.OsDiskID != nil { + objectMap["osDiskId"] = imavrd.OsDiskID + } + if imavrd.AzureVMDiskDetails != nil { + objectMap["azureVMDiskDetails"] = imavrd.AzureVMDiskDetails + } + if imavrd.RecoveryAzureVMName != nil { + objectMap["recoveryAzureVMName"] = imavrd.RecoveryAzureVMName + } + if imavrd.RecoveryAzureVMSize != nil { + objectMap["recoveryAzureVMSize"] = imavrd.RecoveryAzureVMSize + } + if imavrd.RecoveryAzureStorageAccount != nil { + objectMap["recoveryAzureStorageAccount"] = imavrd.RecoveryAzureStorageAccount + } + if imavrd.RecoveryAzureLogStorageAccountID != nil { + objectMap["recoveryAzureLogStorageAccountId"] = imavrd.RecoveryAzureLogStorageAccountID + } + if imavrd.VMNics != nil { + objectMap["vmNics"] = imavrd.VMNics + } + if imavrd.SelectedRecoveryAzureNetworkID != nil { + objectMap["selectedRecoveryAzureNetworkId"] = imavrd.SelectedRecoveryAzureNetworkID + } + if imavrd.SelectedTfoAzureNetworkID != nil { + objectMap["selectedTfoAzureNetworkId"] = imavrd.SelectedTfoAzureNetworkID + } + if imavrd.SelectedSourceNicID != nil { + objectMap["selectedSourceNicId"] = imavrd.SelectedSourceNicID + } + if imavrd.DiscoveryType != nil { + objectMap["discoveryType"] = imavrd.DiscoveryType + } + if imavrd.EnableRdpOnTargetOption != nil { + objectMap["enableRdpOnTargetOption"] = imavrd.EnableRdpOnTargetOption + } + if imavrd.Datastores != nil { + objectMap["datastores"] = imavrd.Datastores + } + if imavrd.TargetVMID != nil { + objectMap["targetVmId"] = imavrd.TargetVMID + } + if imavrd.RecoveryAzureResourceGroupID != nil { + objectMap["recoveryAzureResourceGroupId"] = imavrd.RecoveryAzureResourceGroupID + } + if imavrd.RecoveryAvailabilitySetID != nil { + objectMap["recoveryAvailabilitySetId"] = imavrd.RecoveryAvailabilitySetID + } + if imavrd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavrd.TargetAvailabilityZone + } + if imavrd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavrd.TargetProximityPlacementGroupID + } + if imavrd.UseManagedDisks != nil { + objectMap["useManagedDisks"] = imavrd.UseManagedDisks + } + if imavrd.LicenseType != nil { + objectMap["licenseType"] = imavrd.LicenseType + } + if imavrd.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = imavrd.SQLServerLicenseType + } + if imavrd.ValidationErrors != nil { + objectMap["validationErrors"] = imavrd.ValidationErrors + } + if imavrd.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = imavrd.LastRpoCalculatedTime + } + if imavrd.LastUpdateReceivedTime != nil { + objectMap["lastUpdateReceivedTime"] = imavrd.LastUpdateReceivedTime + } + if imavrd.ReplicaID != nil { + objectMap["replicaId"] = imavrd.ReplicaID + } + if imavrd.OsVersion != nil { + objectMap["osVersion"] = imavrd.OsVersion + } + if imavrd.ProtectedManagedDisks != nil { + objectMap["protectedManagedDisks"] = imavrd.ProtectedManagedDisks + } + if imavrd.FirmwareType != nil { + objectMap["firmwareType"] = imavrd.FirmwareType + } + if imavrd.AzureVMGeneration != nil { + objectMap["azureVmGeneration"] = imavrd.AzureVMGeneration + } + if imavrd.IsAdditionalStatsAvailable != nil { + objectMap["isAdditionalStatsAvailable"] = imavrd.IsAdditionalStatsAvailable + } + if imavrd.TotalDataTransferred != nil { + objectMap["totalDataTransferred"] = imavrd.TotalDataTransferred + } + if imavrd.TotalProgressHealth != nil { + objectMap["totalProgressHealth"] = imavrd.TotalProgressHealth + } + if imavrd.TargetVMTags != nil { + objectMap["targetVmTags"] = imavrd.TargetVMTags + } + if imavrd.SeedManagedDiskTags != nil { + objectMap["seedManagedDiskTags"] = imavrd.SeedManagedDiskTags + } + if imavrd.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavrd.TargetManagedDiskTags + } + if imavrd.TargetNicTags != nil { + objectMap["targetNicTags"] = imavrd.TargetNicTags + } + if imavrd.SwitchProviderBlockingErrorDetails != nil { + objectMap["switchProviderBlockingErrorDetails"] = imavrd.SwitchProviderBlockingErrorDetails + } + if imavrd.SwitchProviderDetails != nil { + objectMap["switchProviderDetails"] = imavrd.SwitchProviderDetails + } + if imavrd.InstanceType != "" { + objectMap["instanceType"] = imavrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return &imavrd, true +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageAzureV2ReplicationDetails. +func (imavrd InMageAzureV2ReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imavrd, true +} + +// InMageAzureV2ReprotectInput inMageAzureV2 specific provider input. +type InMageAzureV2ReprotectInput struct { + // MasterTargetID - The Master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // StorageAccountID - The storage account id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // LogStorageAccountID - The storage account to be used for logging during replication. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) MarshalJSON() ([]byte, error) { + imavri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavri.MasterTargetID != nil { + objectMap["masterTargetId"] = imavri.MasterTargetID + } + if imavri.ProcessServerID != nil { + objectMap["processServerId"] = imavri.ProcessServerID + } + if imavri.StorageAccountID != nil { + objectMap["storageAccountId"] = imavri.StorageAccountID + } + if imavri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imavri.RunAsAccountID + } + if imavri.PolicyID != nil { + objectMap["policyId"] = imavri.PolicyID + } + if imavri.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imavri.LogStorageAccountID + } + if imavri.DisksToInclude != nil { + objectMap["disksToInclude"] = imavri.DisksToInclude + } + if imavri.InstanceType != "" { + objectMap["instanceType"] = imavri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return &imavri, true +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageAzureV2ReprotectInput. +func (imavri InMageAzureV2ReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imavri, true +} + +// InMageAzureV2SwitchProviderBlockingErrorDetails inMageAzureV2 switch provider blocking error details. +type InMageAzureV2SwitchProviderBlockingErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2SwitchProviderBlockingErrorDetails. +func (imavspbed InMageAzureV2SwitchProviderBlockingErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageAzureV2SwitchProviderDetails inMageAzureV2 switch provider details. +type InMageAzureV2SwitchProviderDetails struct { + // TargetVaultID - READ-ONLY; The target vault Id. + TargetVaultID *string `json:"targetVaultId,omitempty"` + // TargetResourceID - READ-ONLY; The target resource Id. + TargetResourceID *string `json:"targetResourceId,omitempty"` + // TargetFabricID - READ-ONLY; The target fabric Id. + TargetFabricID *string `json:"targetFabricId,omitempty"` + // TargetApplianceID - READ-ONLY; The target appliance Id. + TargetApplianceID *string `json:"targetApplianceId,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2SwitchProviderDetails. +func (imavspd InMageAzureV2SwitchProviderDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageAzureV2SwitchProviderProviderInput provider specific input for InMageAzureV2 switch provider. +type InMageAzureV2SwitchProviderProviderInput struct { + // TargetVaultID - The target vault Id. + TargetVaultID *string `json:"targetVaultID,omitempty"` + // TargetFabricID - The target fabric Id. + TargetFabricID *string `json:"targetFabricID,omitempty"` + // TargetApplianceID - The target appliance Id. + TargetApplianceID *string `json:"targetApplianceID,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeSwitchProviderProviderSpecificInput', 'InstanceTypeInMageAzureV2' + InstanceType InstanceTypeBasicSwitchProviderProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2SwitchProviderProviderInput. +func (imavsppi InMageAzureV2SwitchProviderProviderInput) MarshalJSON() ([]byte, error) { + imavsppi.InstanceType = InstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavsppi.TargetVaultID != nil { + objectMap["targetVaultID"] = imavsppi.TargetVaultID + } + if imavsppi.TargetFabricID != nil { + objectMap["targetFabricID"] = imavsppi.TargetFabricID + } + if imavsppi.TargetApplianceID != nil { + objectMap["targetApplianceID"] = imavsppi.TargetApplianceID + } + if imavsppi.InstanceType != "" { + objectMap["instanceType"] = imavsppi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageAzureV2SwitchProviderProviderInput is the BasicSwitchProviderProviderSpecificInput implementation for InMageAzureV2SwitchProviderProviderInput. +func (imavsppi InMageAzureV2SwitchProviderProviderInput) AsInMageAzureV2SwitchProviderProviderInput() (*InMageAzureV2SwitchProviderProviderInput, bool) { + return &imavsppi, true +} + +// AsSwitchProviderProviderSpecificInput is the BasicSwitchProviderProviderSpecificInput implementation for InMageAzureV2SwitchProviderProviderInput. +func (imavsppi InMageAzureV2SwitchProviderProviderInput) AsSwitchProviderProviderSpecificInput() (*SwitchProviderProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicSwitchProviderProviderSpecificInput is the BasicSwitchProviderProviderSpecificInput implementation for InMageAzureV2SwitchProviderProviderInput. +func (imavsppi InMageAzureV2SwitchProviderProviderInput) AsBasicSwitchProviderProviderSpecificInput() (BasicSwitchProviderProviderSpecificInput, bool) { + return &imavsppi, true +} + +// InMageAzureV2TestFailoverInput inMageAzureV2 provider specific input for test failover. +type InMageAzureV2TestFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) MarshalJSON() ([]byte, error) { + imavtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imavtfi.RecoveryPointID + } + if imavtfi.InstanceType != "" { + objectMap["instanceType"] = imavtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return &imavtfi, true +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageAzureV2TestFailoverInput. +func (imavtfi InMageAzureV2TestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imavtfi, true +} + +// InMageAzureV2UnplannedFailoverInput inMageAzureV2 provider specific input for unplanned failover. +type InMageAzureV2UnplannedFailoverInput struct { + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imavufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imavufi.RecoveryPointID + } + if imavufi.InstanceType != "" { + objectMap["instanceType"] = imavufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return &imavufi, true +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageAzureV2UnplannedFailoverInput. +func (imavufi InMageAzureV2UnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imavufi, true +} + +// InMageAzureV2UpdateReplicationProtectedItemInput inMage Azure V2 input to update replication protected +// item. +type InMageAzureV2UpdateReplicationProtectedItemInput struct { + // RecoveryAzureV1ResourceGroupID - The recovery Azure resource group Id for classic deployment. + RecoveryAzureV1ResourceGroupID *string `json:"recoveryAzureV1ResourceGroupId,omitempty"` + // RecoveryAzureV2ResourceGroupID - The recovery Azure resource group Id for resource manager deployment. + RecoveryAzureV2ResourceGroupID *string `json:"recoveryAzureV2ResourceGroupId,omitempty"` + // UseManagedDisks - A value indicating whether managed disks should be used during failover. + UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetManagedDiskTags - The tags for the target managed disks. + TargetManagedDiskTags map[string]*string `json:"targetManagedDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // VMDisks - The list of disk update properties. + VMDisks *[]UpdateDiskInput `json:"vmDisks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imavurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if imavurpii.RecoveryAzureV1ResourceGroupID != nil { + objectMap["recoveryAzureV1ResourceGroupId"] = imavurpii.RecoveryAzureV1ResourceGroupID + } + if imavurpii.RecoveryAzureV2ResourceGroupID != nil { + objectMap["recoveryAzureV2ResourceGroupId"] = imavurpii.RecoveryAzureV2ResourceGroupID + } + if imavurpii.UseManagedDisks != nil { + objectMap["useManagedDisks"] = imavurpii.UseManagedDisks + } + if imavurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imavurpii.TargetProximityPlacementGroupID + } + if imavurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imavurpii.TargetAvailabilityZone + } + if imavurpii.TargetVMTags != nil { + objectMap["targetVmTags"] = imavurpii.TargetVMTags + } + if imavurpii.TargetManagedDiskTags != nil { + objectMap["targetManagedDiskTags"] = imavurpii.TargetManagedDiskTags + } + if imavurpii.TargetNicTags != nil { + objectMap["targetNicTags"] = imavurpii.TargetNicTags + } + if imavurpii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = imavurpii.SQLServerLicenseType + } + if imavurpii.VMDisks != nil { + objectMap["vmDisks"] = imavurpii.VMDisks + } + if imavurpii.InstanceType != "" { + objectMap["instanceType"] = imavurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return &imavurpii, true +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageAzureV2UpdateReplicationProtectedItemInput. +func (imavurpii InMageAzureV2UpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &imavurpii, true +} + +// InMageBasePolicyDetails base class for the policies of providers using InMage replication. +type InMageBasePolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) MarshalJSON() ([]byte, error) { + imbpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails + objectMap := make(map[string]interface{}) + if imbpd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = imbpd.RecoveryPointThresholdInMinutes + } + if imbpd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = imbpd.RecoveryPointHistory + } + if imbpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imbpd.AppConsistentFrequencyInMinutes + } + if imbpd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imbpd.MultiVMSyncStatus + } + if imbpd.InstanceType != "" { + objectMap["instanceType"] = imbpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return &imbpd, true +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageBasePolicyDetails. +func (imbpd InMageBasePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imbpd, true +} + +// InMageDisableProtectionProviderSpecificInput inMage disable protection provider specific input. +type InMageDisableProtectionProviderSpecificInput struct { + // ReplicaVMDeletionStatus - A value indicating whether the replica VM should be destroyed or retained. Values from Delete and Retain. + ReplicaVMDeletionStatus *string `json:"replicaVmDeletionStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeDisableProtectionProviderSpecificInput', 'InstanceTypeInMage' + InstanceType InstanceTypeBasicDisableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + imdppsi.InstanceType = InstanceTypeInMage + objectMap := make(map[string]interface{}) + if imdppsi.ReplicaVMDeletionStatus != nil { + objectMap["replicaVmDeletionStatus"] = imdppsi.ReplicaVMDeletionStatus + } + if imdppsi.InstanceType != "" { + objectMap["instanceType"] = imdppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsInMageDisableProtectionProviderSpecificInput() (*InMageDisableProtectionProviderSpecificInput, bool) { + return &imdppsi, true +} + +// AsDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsDisableProtectionProviderSpecificInput() (*DisableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicDisableProtectionProviderSpecificInput is the BasicDisableProtectionProviderSpecificInput implementation for InMageDisableProtectionProviderSpecificInput. +func (imdppsi InMageDisableProtectionProviderSpecificInput) AsBasicDisableProtectionProviderSpecificInput() (BasicDisableProtectionProviderSpecificInput, bool) { + return &imdppsi, true +} + +// InMageDiskDetails vMware/Physical specific Disk Details. +type InMageDiskDetails struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskSizeInMB - The disk size in MB. + DiskSizeInMB *string `json:"diskSizeInMB,omitempty"` + // DiskType - Whether disk is system disk or data disk. + DiskType *string `json:"diskType,omitempty"` + // DiskConfiguration - Whether disk is dynamic disk or basic disk. + DiskConfiguration *string `json:"diskConfiguration,omitempty"` + // VolumeList - Volumes of the disk. + VolumeList *[]DiskVolumeDetails `json:"volumeList,omitempty"` +} + +// InMageDiskExclusionInput diskExclusionInput when doing enable protection of virtual machine in InMage +// provider. +type InMageDiskExclusionInput struct { + // VolumeOptions - The volume label based option for disk exclusion. + VolumeOptions *[]InMageVolumeExclusionOptions `json:"volumeOptions,omitempty"` + // DiskSignatureOptions - The guest disk signature based option for disk exclusion. + DiskSignatureOptions *[]InMageDiskSignatureExclusionOptions `json:"diskSignatureOptions,omitempty"` +} + +// InMageDiskSignatureExclusionOptions guest disk signature based disk exclusion option when doing enable +// protection of virtual machine in InMage provider. +type InMageDiskSignatureExclusionOptions struct { + // DiskSignature - The guest signature of disk to be excluded from replication. + DiskSignature *string `json:"diskSignature,omitempty"` +} + +// InMageEnableProtectionInput vMware Azure specific enable protection input. +type InMageEnableProtectionInput struct { + // VMFriendlyName - The VM Name. + VMFriendlyName *string `json:"vmFriendlyName,omitempty"` + // MasterTargetID - The Master Target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RetentionDrive - The retention drive to use on the MT. + RetentionDrive *string `json:"retentionDrive,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // MultiVMGroupID - The multi VM group Id. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // DiskExclusionInput - The enable disk exclusion input. + DiskExclusionInput *InMageDiskExclusionInput `json:"diskExclusionInput,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) MarshalJSON() ([]byte, error) { + imepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imepi.VMFriendlyName != nil { + objectMap["vmFriendlyName"] = imepi.VMFriendlyName + } + if imepi.MasterTargetID != nil { + objectMap["masterTargetId"] = imepi.MasterTargetID + } + if imepi.ProcessServerID != nil { + objectMap["processServerId"] = imepi.ProcessServerID + } + if imepi.RetentionDrive != nil { + objectMap["retentionDrive"] = imepi.RetentionDrive + } + if imepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imepi.RunAsAccountID + } + if imepi.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imepi.MultiVMGroupID + } + if imepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imepi.MultiVMGroupName + } + if imepi.DatastoreName != nil { + objectMap["datastoreName"] = imepi.DatastoreName + } + if imepi.DiskExclusionInput != nil { + objectMap["diskExclusionInput"] = imepi.DiskExclusionInput + } + if imepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imepi.DisksToInclude + } + if imepi.InstanceType != "" { + objectMap["instanceType"] = imepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return &imepi, true +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return nil, false +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageEnableProtectionInput. +func (imepi InMageEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imepi, true +} + +// InMageFabricSwitchProviderBlockingErrorDetails inMageFabric switch provider blocking error details. +type InMageFabricSwitchProviderBlockingErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageFabricSwitchProviderBlockingErrorDetails. +func (imfspbed InMageFabricSwitchProviderBlockingErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMagePolicyDetails inMage specific protection profile details. +type InMagePolicyDetails struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMagePolicyDetails. +func (impd InMagePolicyDetails) MarshalJSON() ([]byte, error) { + impd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage + objectMap := make(map[string]interface{}) + if impd.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = impd.RecoveryPointThresholdInMinutes + } + if impd.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = impd.RecoveryPointHistory + } + if impd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = impd.AppConsistentFrequencyInMinutes + } + if impd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = impd.MultiVMSyncStatus + } + if impd.InstanceType != "" { + objectMap["instanceType"] = impd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return &impd, true +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMagePolicyDetails. +func (impd InMagePolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &impd, true +} + +// InMagePolicyInput vMWare Azure specific protection profile Input. +type InMagePolicyInput struct { + // RecoveryPointThresholdInMinutes - The recovery point threshold in minutes. + RecoveryPointThresholdInMinutes *int32 `json:"recoveryPointThresholdInMinutes,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMagePolicyInput. +func (impi InMagePolicyInput) MarshalJSON() ([]byte, error) { + impi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if impi.RecoveryPointThresholdInMinutes != nil { + objectMap["recoveryPointThresholdInMinutes"] = impi.RecoveryPointThresholdInMinutes + } + if impi.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = impi.RecoveryPointHistory + } + if impi.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = impi.AppConsistentFrequencyInMinutes + } + if impi.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = impi.MultiVMSyncStatus + } + if impi.InstanceType != "" { + objectMap["instanceType"] = impi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return &impi, true +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMagePolicyInput. +func (impi InMagePolicyInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &impi, true +} + +// InMageProtectedDiskDetails inMage protected disk details. +type InMageProtectedDiskDetails struct { + // DiskID - The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - The disk name. + DiskName *string `json:"diskName,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // HealthErrorCode - The health error code for the disk. + HealthErrorCode *string `json:"healthErrorCode,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ResyncRequired - A value indicating whether resync is required for this disk. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncProgressPercentage - The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncDurationInSeconds - The resync duration in seconds. + ResyncDurationInSeconds *int64 `json:"resyncDurationInSeconds,omitempty"` + // DiskCapacityInBytes - The disk capacity in bytes. + DiskCapacityInBytes *int64 `json:"diskCapacityInBytes,omitempty"` + // FileSystemCapacityInBytes - The file system capacity in bytes. + FileSystemCapacityInBytes *int64 `json:"fileSystemCapacityInBytes,omitempty"` + // SourceDataInMB - The source data transit in MB. + SourceDataInMB *float64 `json:"sourceDataInMB,omitempty"` + // PsDataInMB - The PS data transit in MB. + PsDataInMB *float64 `json:"psDataInMB,omitempty"` + // TargetDataInMB - The target data transit in MB. + TargetDataInMB *float64 `json:"targetDataInMB,omitempty"` + // DiskResized - A value indicating whether disk is resized. + DiskResized *string `json:"diskResized,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // ResyncProcessedBytes - The resync processed bytes. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTotalTransferredBytes - The resync total transferred bytes. + ResyncTotalTransferredBytes *int64 `json:"resyncTotalTransferredBytes,omitempty"` + // ResyncLast15MinutesTransferredBytes - The resync last 15 minutes transferred bytes. + ResyncLast15MinutesTransferredBytes *int64 `json:"resyncLast15MinutesTransferredBytes,omitempty"` + // ResyncLastDataTransferTimeUTC - The last data transfer time in UTC. + ResyncLastDataTransferTimeUTC *date.Time `json:"resyncLastDataTransferTimeUTC,omitempty"` + // ResyncStartTime - The resync start time. + ResyncStartTime *date.Time `json:"resyncStartTime,omitempty"` + // ProgressHealth - The Progress Health. + ProgressHealth *string `json:"progressHealth,omitempty"` + // ProgressStatus - The Progress Status. + ProgressStatus *string `json:"progressStatus,omitempty"` +} + +// InMageRcmAgentUpgradeBlockingErrorDetails inMageRcm source agent upgrade blocking error details. +type InMageRcmAgentUpgradeBlockingErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageRcmAgentUpgradeBlockingErrorDetails. +func (imraubed InMageRcmAgentUpgradeBlockingErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmApplianceDetails inMageRcm appliance details. +type InMageRcmApplianceDetails struct { + // ID - READ-ONLY; The appliance Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The appliance name. + Name *string `json:"name,omitempty"` + // FabricArmID - READ-ONLY; The fabric ARM Id. + FabricArmID *string `json:"fabricArmId,omitempty"` + // ProcessServer - READ-ONLY; The process server. + ProcessServer *ProcessServerDetails `json:"processServer,omitempty"` + // RcmProxy - READ-ONLY; The of RCM proxy. + RcmProxy *RcmProxyDetails `json:"rcmProxy,omitempty"` + // PushInstaller - READ-ONLY; The push installer. + PushInstaller *PushInstallerDetails `json:"pushInstaller,omitempty"` + // ReplicationAgent - READ-ONLY; The replication agent. + ReplicationAgent *ReplicationAgentDetails `json:"replicationAgent,omitempty"` + // ReprotectAgent - READ-ONLY; The reprotect agent. + ReprotectAgent *ReprotectAgentDetails `json:"reprotectAgent,omitempty"` + // MarsAgent - READ-ONLY; The Mars agent. + MarsAgent *MarsAgentDetails `json:"marsAgent,omitempty"` + // Dra - READ-ONLY; The DRA. + Dra *DraDetails `json:"dra,omitempty"` + // SwitchProviderBlockingErrorDetails - READ-ONLY; The switch provider blocking error information. + SwitchProviderBlockingErrorDetails *[]InMageRcmFabricSwitchProviderBlockingErrorDetails `json:"switchProviderBlockingErrorDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmApplianceDetails. +func (imrad InMageRcmApplianceDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmApplianceSpecificDetails inMageRcm appliance specific details. +type InMageRcmApplianceSpecificDetails struct { + // Appliances - READ-ONLY; The list of appliances. + Appliances *[]InMageRcmApplianceDetails `json:"appliances,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeApplianceSpecificDetails', 'InstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplianceSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmApplianceSpecificDetails. +func (imrasd InMageRcmApplianceSpecificDetails) MarshalJSON() ([]byte, error) { + imrasd.InstanceType = InstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrasd.InstanceType != "" { + objectMap["instanceType"] = imrasd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageRcmApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for InMageRcmApplianceSpecificDetails. +func (imrasd InMageRcmApplianceSpecificDetails) AsInMageRcmApplianceSpecificDetails() (*InMageRcmApplianceSpecificDetails, bool) { + return &imrasd, true +} + +// AsApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for InMageRcmApplianceSpecificDetails. +func (imrasd InMageRcmApplianceSpecificDetails) AsApplianceSpecificDetails() (*ApplianceSpecificDetails, bool) { + return nil, false +} + +// AsBasicApplianceSpecificDetails is the BasicApplianceSpecificDetails implementation for InMageRcmApplianceSpecificDetails. +func (imrasd InMageRcmApplianceSpecificDetails) AsBasicApplianceSpecificDetails() (BasicApplianceSpecificDetails, bool) { + return &imrasd, true +} + +// InMageRcmApplyRecoveryPointInput applyRecoveryPoint input specific to InMageRcm provider. +type InMageRcmApplyRecoveryPointInput struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeApplyRecoveryPointProviderSpecificInput', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicApplyRecoveryPointProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { + imrarpi.InstanceType = InstanceTypeBasicApplyRecoveryPointProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrarpi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrarpi.RecoveryPointID + } + if imrarpi.InstanceType != "" { + objectMap["instanceType"] = imrarpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsA2AApplyRecoveryPointInput() (*A2AApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsA2ACrossClusterMigrationApplyRecoveryPointInput() (*A2ACrossClusterMigrationApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsHyperVReplicaAzureApplyRecoveryPointInput() (*HyperVReplicaAzureApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageAzureV2ApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsInMageAzureV2ApplyRecoveryPointInput() (*InMageAzureV2ApplyRecoveryPointInput, bool) { + return nil, false +} + +// AsInMageRcmApplyRecoveryPointInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsInMageRcmApplyRecoveryPointInput() (*InMageRcmApplyRecoveryPointInput, bool) { + return &imrarpi, true +} + +// AsApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsApplyRecoveryPointProviderSpecificInput() (*ApplyRecoveryPointProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicApplyRecoveryPointProviderSpecificInput is the BasicApplyRecoveryPointProviderSpecificInput implementation for InMageRcmApplyRecoveryPointInput. +func (imrarpi InMageRcmApplyRecoveryPointInput) AsBasicApplyRecoveryPointProviderSpecificInput() (BasicApplyRecoveryPointProviderSpecificInput, bool) { + return &imrarpi, true +} + +// InMageRcmDiscoveredProtectedVMDetails inMageRcm discovered protected VM details. +type InMageRcmDiscoveredProtectedVMDetails struct { + // VCenterID - READ-ONLY; The VCenter Id. + VCenterID *string `json:"vCenterId,omitempty"` + // VCenterFqdn - READ-ONLY; The VCenter fqdn. + VCenterFqdn *string `json:"vCenterFqdn,omitempty"` + // Datastores - READ-ONLY; The list of datastores. + Datastores *[]string `json:"datastores,omitempty"` + // IPAddresses - READ-ONLY; The list of IP addresses. + IPAddresses *[]string `json:"ipAddresses,omitempty"` + // VmwareToolsStatus - READ-ONLY; The VMware tools status. + VmwareToolsStatus *string `json:"vmwareToolsStatus,omitempty"` + // PowerStatus - READ-ONLY; The VM power status. + PowerStatus *string `json:"powerStatus,omitempty"` + // VMFqdn - READ-ONLY; The VM fqdn. + VMFqdn *string `json:"vmFqdn,omitempty"` + // OsName - READ-ONLY; The VM's OS name. + OsName *string `json:"osName,omitempty"` + // CreatedTimestamp - READ-ONLY; The SDS created timestamp. + CreatedTimestamp *date.Time `json:"createdTimestamp,omitempty"` + // UpdatedTimestamp - READ-ONLY; The SDS updated timestamp. + UpdatedTimestamp *date.Time `json:"updatedTimestamp,omitempty"` + // IsDeleted - READ-ONLY; A value indicating whether the VM is deleted. + IsDeleted *bool `json:"isDeleted,omitempty"` + // LastDiscoveryTimeInUtc - READ-ONLY; The last time when SDS information discovered in SRS. + LastDiscoveryTimeInUtc *date.Time `json:"lastDiscoveryTimeInUtc,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmDiscoveredProtectedVMDetails. +func (imrdpvd InMageRcmDiscoveredProtectedVMDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmDiskInput inMageRcm disk input. +type InMageRcmDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageRcmDisksDefaultInput inMageRcm disk input. +type InMageRcmDisksDefaultInput struct { + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// InMageRcmEnableProtectionInput inMageRcm specific enable protection input. +type InMageRcmEnableProtectionInput struct { + // FabricDiscoveryMachineID - The ARM Id of discovered machine. + FabricDiscoveryMachineID *string `json:"fabricDiscoveryMachineId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]InMageRcmDiskInput `json:"disksToInclude,omitempty"` + // DisksDefault - The default disk input. + DisksDefault *InMageRcmDisksDefaultInput `json:"disksDefault,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetNetworkID - The selected target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The selected test network ARM Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // TargetSubnetName - The selected target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TestSubnetName - The selected test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // RunAsAccountID - The run-as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // MultiVMGroupName - The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) MarshalJSON() ([]byte, error) { + imrepi.InstanceType = InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrepi.FabricDiscoveryMachineID != nil { + objectMap["fabricDiscoveryMachineId"] = imrepi.FabricDiscoveryMachineID + } + if imrepi.DisksToInclude != nil { + objectMap["disksToInclude"] = imrepi.DisksToInclude + } + if imrepi.DisksDefault != nil { + objectMap["disksDefault"] = imrepi.DisksDefault + } + if imrepi.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrepi.TargetResourceGroupID + } + if imrepi.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrepi.TargetNetworkID + } + if imrepi.TestNetworkID != nil { + objectMap["testNetworkId"] = imrepi.TestNetworkID + } + if imrepi.TargetSubnetName != nil { + objectMap["targetSubnetName"] = imrepi.TargetSubnetName + } + if imrepi.TestSubnetName != nil { + objectMap["testSubnetName"] = imrepi.TestSubnetName + } + if imrepi.TargetVMName != nil { + objectMap["targetVmName"] = imrepi.TargetVMName + } + if imrepi.TargetVMSize != nil { + objectMap["targetVmSize"] = imrepi.TargetVMSize + } + if imrepi.LicenseType != "" { + objectMap["licenseType"] = imrepi.LicenseType + } + if imrepi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrepi.TargetAvailabilitySetID + } + if imrepi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrepi.TargetAvailabilityZone + } + if imrepi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrepi.TargetProximityPlacementGroupID + } + if imrepi.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrepi.TargetBootDiagnosticsStorageAccountID + } + if imrepi.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imrepi.RunAsAccountID + } + if imrepi.ProcessServerID != nil { + objectMap["processServerId"] = imrepi.ProcessServerID + } + if imrepi.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imrepi.MultiVMGroupName + } + if imrepi.InstanceType != "" { + objectMap["instanceType"] = imrepi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsA2ACrossClusterMigrationEnableProtectionInput() (*A2ACrossClusterMigrationEnableProtectionInput, bool) { + return nil, false +} + +// AsA2AEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsA2AEnableProtectionInput() (*A2AEnableProtectionInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsHyperVReplicaAzureEnableProtectionInput() (*HyperVReplicaAzureEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageAzureV2EnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageAzureV2EnableProtectionInput() (*InMageAzureV2EnableProtectionInput, bool) { + return nil, false +} + +// AsInMageEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageEnableProtectionInput() (*InMageEnableProtectionInput, bool) { + return nil, false +} + +// AsInMageRcmEnableProtectionInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsInMageRcmEnableProtectionInput() (*InMageRcmEnableProtectionInput, bool) { + return &imrepi, true +} + +// AsEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsEnableProtectionProviderSpecificInput() (*EnableProtectionProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableProtectionProviderSpecificInput is the BasicEnableProtectionProviderSpecificInput implementation for InMageRcmEnableProtectionInput. +func (imrepi InMageRcmEnableProtectionInput) AsBasicEnableProtectionProviderSpecificInput() (BasicEnableProtectionProviderSpecificInput, bool) { + return &imrepi, true +} + +// InMageRcmEventDetails event details for InMageRcm provider. +type InMageRcmEventDetails struct { + // ProtectedItemName - READ-ONLY; The protected item name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // VMName - READ-ONLY; The protected item name. + VMName *string `json:"vmName,omitempty"` + // LatestAgentVersion - READ-ONLY; The latest agent version. + LatestAgentVersion *string `json:"latestAgentVersion,omitempty"` + // JobID - READ-ONLY; The job Id. + JobID *string `json:"jobId,omitempty"` + // FabricName - READ-ONLY; The fabric name. + FabricName *string `json:"fabricName,omitempty"` + // ApplianceName - READ-ONLY; The appliance name. + ApplianceName *string `json:"applianceName,omitempty"` + // ServerType - READ-ONLY; The server type. + ServerType *string `json:"serverType,omitempty"` + // ComponentDisplayName - READ-ONLY; The component display name. + ComponentDisplayName *string `json:"componentDisplayName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) MarshalJSON() ([]byte, error) { + imred.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imred.InstanceType != "" { + objectMap["instanceType"] = imred.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return &imred, true +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmEventDetails. +func (imred InMageRcmEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imred, true +} + +// InMageRcmFabricCreationInput inMageRcm fabric provider specific settings. +type InMageRcmFabricCreationInput struct { + // VmwareSiteID - The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // SourceAgentIdentity - The identity provider input for source agent authentication. + SourceAgentIdentity *IdentityProviderInput `json:"sourceAgentIdentity,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) MarshalJSON() ([]byte, error) { + imrfci.InstanceType = InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrfci.VmwareSiteID != nil { + objectMap["vmwareSiteId"] = imrfci.VmwareSiteID + } + if imrfci.PhysicalSiteID != nil { + objectMap["physicalSiteId"] = imrfci.PhysicalSiteID + } + if imrfci.SourceAgentIdentity != nil { + objectMap["sourceAgentIdentity"] = imrfci.SourceAgentIdentity + } + if imrfci.InstanceType != "" { + objectMap["instanceType"] = imrfci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return &imrfci, true +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return nil, false +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for InMageRcmFabricCreationInput. +func (imrfci InMageRcmFabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &imrfci, true +} + +// InMageRcmFabricSpecificDetails inMageRcm fabric specific details. +type InMageRcmFabricSpecificDetails struct { + // VmwareSiteID - READ-ONLY; The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - READ-ONLY; The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // ServiceEndpoint - READ-ONLY; The service endpoint. + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` + // ServiceResourceID - READ-ONLY; The service resource Id. + ServiceResourceID *string `json:"serviceResourceId,omitempty"` + // ServiceContainerID - READ-ONLY; The service container Id. + ServiceContainerID *string `json:"serviceContainerId,omitempty"` + // DataPlaneURI - READ-ONLY; The data plane Uri. + DataPlaneURI *string `json:"dataPlaneUri,omitempty"` + // ControlPlaneURI - READ-ONLY; The control plane Uri. + ControlPlaneURI *string `json:"controlPlaneUri,omitempty"` + // SourceAgentIdentityDetails - The source agent identity details. + SourceAgentIdentityDetails *IdentityProviderDetails `json:"sourceAgentIdentityDetails,omitempty"` + // ProcessServers - READ-ONLY; The list of process servers. + ProcessServers *[]ProcessServerDetails `json:"processServers,omitempty"` + // RcmProxies - READ-ONLY; The list of RCM proxies. + RcmProxies *[]RcmProxyDetails `json:"rcmProxies,omitempty"` + // PushInstallers - READ-ONLY; The list of push installers. + PushInstallers *[]PushInstallerDetails `json:"pushInstallers,omitempty"` + // ReplicationAgents - READ-ONLY; The list of replication agents. + ReplicationAgents *[]ReplicationAgentDetails `json:"replicationAgents,omitempty"` + // ReprotectAgents - READ-ONLY; The list of reprotect agents. + ReprotectAgents *[]ReprotectAgentDetails `json:"reprotectAgents,omitempty"` + // MarsAgents - READ-ONLY; The list of Mars agents. + MarsAgents *[]MarsAgentDetails `json:"marsAgents,omitempty"` + // Dras - READ-ONLY; The list of DRAs. + Dras *[]DraDetails `json:"dras,omitempty"` + // AgentDetails - READ-ONLY; The list of agent details. + AgentDetails *[]AgentDetails `json:"agentDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) MarshalJSON() ([]byte, error) { + imrfsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrfsd.SourceAgentIdentityDetails != nil { + objectMap["sourceAgentIdentityDetails"] = imrfsd.SourceAgentIdentityDetails + } + if imrfsd.InstanceType != "" { + objectMap["instanceType"] = imrfsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return &imrfsd, true +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for InMageRcmFabricSpecificDetails. +func (imrfsd InMageRcmFabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &imrfsd, true +} + +// InMageRcmFabricSwitchProviderBlockingErrorDetails inMageRcmFabric switch provider blocking error +// details. +type InMageRcmFabricSwitchProviderBlockingErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFabricSwitchProviderBlockingErrorDetails. +func (imrfspbed InMageRcmFabricSwitchProviderBlockingErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackDiscoveredProtectedVMDetails inMageRcmFailback discovered VM details. +type InMageRcmFailbackDiscoveredProtectedVMDetails struct { + // VCenterID - READ-ONLY; The VCenter Id. + VCenterID *string `json:"vCenterId,omitempty"` + // VCenterFqdn - READ-ONLY; The VCenter fqdn. + VCenterFqdn *string `json:"vCenterFqdn,omitempty"` + // Datastores - READ-ONLY; The list of datastores. + Datastores *[]string `json:"datastores,omitempty"` + // IPAddresses - READ-ONLY; The list of IP addresses. + IPAddresses *[]string `json:"ipAddresses,omitempty"` + // VmwareToolsStatus - READ-ONLY; The VMware tools status. + VmwareToolsStatus *string `json:"vmwareToolsStatus,omitempty"` + // PowerStatus - READ-ONLY; The VM power status. + PowerStatus *string `json:"powerStatus,omitempty"` + // VMFqdn - READ-ONLY; The VM fqdn. + VMFqdn *string `json:"vmFqdn,omitempty"` + // OsName - READ-ONLY; The VM's OS name. + OsName *string `json:"osName,omitempty"` + // CreatedTimestamp - READ-ONLY; The SDS created timestamp. + CreatedTimestamp *date.Time `json:"createdTimestamp,omitempty"` + // UpdatedTimestamp - READ-ONLY; The SDS updated timestamp. + UpdatedTimestamp *date.Time `json:"updatedTimestamp,omitempty"` + // IsDeleted - READ-ONLY; A value indicating whether the VM is deleted. + IsDeleted *bool `json:"isDeleted,omitempty"` + // LastDiscoveryTimeInUtc - READ-ONLY; The last time when SDS information discovered in SRS. + LastDiscoveryTimeInUtc *date.Time `json:"lastDiscoveryTimeInUtc,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackDiscoveredProtectedVMDetails. +func (imrfdpvd InMageRcmFailbackDiscoveredProtectedVMDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackEventDetails event details for InMageRcmFailback provider. +type InMageRcmFailbackEventDetails struct { + // ProtectedItemName - READ-ONLY; The protected item name. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // VMName - READ-ONLY; The protected item name. + VMName *string `json:"vmName,omitempty"` + // ApplianceName - READ-ONLY; The appliance name. + ApplianceName *string `json:"applianceName,omitempty"` + // ServerType - READ-ONLY; The server type. + ServerType *string `json:"serverType,omitempty"` + // ComponentDisplayName - READ-ONLY; The component display name. + ComponentDisplayName *string `json:"componentDisplayName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) MarshalJSON() ([]byte, error) { + imrfed.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfed.InstanceType != "" { + objectMap["instanceType"] = imrfed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return &imrfed, true +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return nil, false +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for InMageRcmFailbackEventDetails. +func (imrfed InMageRcmFailbackEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &imrfed, true +} + +// InMageRcmFailbackMobilityAgentDetails inMageRcmFailback mobility agent details. +type InMageRcmFailbackMobilityAgentDetails struct { + // Version - READ-ONLY; The agent version. + Version *string `json:"version,omitempty"` + // LatestVersion - READ-ONLY; The latest agent version available. + LatestVersion *string `json:"latestVersion,omitempty"` + // DriverVersion - READ-ONLY; The driver version. + DriverVersion *string `json:"driverVersion,omitempty"` + // LatestUpgradableVersionWithoutReboot - READ-ONLY; The latest upgradeable version available without reboot. + LatestUpgradableVersionWithoutReboot *string `json:"latestUpgradableVersionWithoutReboot,omitempty"` + // AgentVersionExpiryDate - READ-ONLY; The agent version expiry date. + AgentVersionExpiryDate *date.Time `json:"agentVersionExpiryDate,omitempty"` + // DriverVersionExpiryDate - READ-ONLY; The driver version expiry date. + DriverVersionExpiryDate *date.Time `json:"driverVersionExpiryDate,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The time of the last heartbeat received from the agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // ReasonsBlockingUpgrade - READ-ONLY; The whether update is possible or not. + ReasonsBlockingUpgrade *[]AgentUpgradeBlockedReason `json:"reasonsBlockingUpgrade,omitempty"` + // IsUpgradeable - READ-ONLY; A value indicating whether agent is upgradeable or not. + IsUpgradeable *string `json:"isUpgradeable,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackMobilityAgentDetails. +func (imrfmad InMageRcmFailbackMobilityAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackNicDetails inMageRcmFailback NIC details. +type InMageRcmFailbackNicDetails struct { + // MacAddress - READ-ONLY; The mac address. + MacAddress *string `json:"macAddress,omitempty"` + // NetworkName - READ-ONLY; The network name. + NetworkName *string `json:"networkName,omitempty"` + // AdapterType - READ-ONLY; The adapter type. + AdapterType *string `json:"adapterType,omitempty"` + // SourceIPAddress - READ-ONLY; The IP address. + SourceIPAddress *string `json:"sourceIpAddress,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackNicDetails. +func (imrfnd InMageRcmFailbackNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmFailbackPlannedFailoverProviderInput provider specific input for InMageRcmFailback failover. +type InMageRcmFailbackPlannedFailoverProviderInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'ApplicationConsistent', 'CrashConsistent' + RecoveryPointType InMageRcmFailbackRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) MarshalJSON() ([]byte, error) { + imrfpfpi.InstanceType = InstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpfpi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imrfpfpi.RecoveryPointType + } + if imrfpfpi.InstanceType != "" { + objectMap["instanceType"] = imrfpfpi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return &imrfpfpi, true +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for InMageRcmFailbackPlannedFailoverProviderInput. +func (imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &imrfpfpi, true +} + +// InMageRcmFailbackPolicyCreationInput inMageRcmFailback policy creation input. +type InMageRcmFailbackPolicyCreationInput struct { + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) MarshalJSON() ([]byte, error) { + imrfpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrfpci.CrashConsistentFrequencyInMinutes + } + if imrfpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrfpci.AppConsistentFrequencyInMinutes + } + if imrfpci.InstanceType != "" { + objectMap["instanceType"] = imrfpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return &imrfpci, true +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmFailbackPolicyCreationInput. +func (imrfpci InMageRcmFailbackPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imrfpci, true +} + +// InMageRcmFailbackPolicyDetails inMageRcm failback specific policy details. +type InMageRcmFailbackPolicyDetails struct { + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) MarshalJSON() ([]byte, error) { + imrfpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrfpd.AppConsistentFrequencyInMinutes + } + if imrfpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrfpd.CrashConsistentFrequencyInMinutes + } + if imrfpd.InstanceType != "" { + objectMap["instanceType"] = imrfpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return &imrfpd, true +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmFailbackPolicyDetails. +func (imrfpd InMageRcmFailbackPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imrfpd, true +} + +// InMageRcmFailbackProtectedDiskDetails inMageRcmFailback protected disk details. +type InMageRcmFailbackProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk Id (reported by source agent). + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // DiskUUID - READ-ONLY; The disk Uuid (reported by vCenter). + DiskUUID *string `json:"diskUuid,omitempty"` + // DataPendingInLogDataStoreInMB - READ-ONLY; The data pending in log data store in MB. + DataPendingInLogDataStoreInMB *float64 `json:"dataPendingInLogDataStoreInMB,omitempty"` + // DataPendingAtSourceAgentInMB - READ-ONLY; The data pending at source agent in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // IsInitialReplicationComplete - READ-ONLY; A value indicating whether initial replication is complete or not. + IsInitialReplicationComplete *string `json:"isInitialReplicationComplete,omitempty"` + // IrDetails - The initial replication details. + IrDetails *InMageRcmFailbackSyncDetails `json:"irDetails,omitempty"` + // ResyncDetails - The resync details. + ResyncDetails *InMageRcmFailbackSyncDetails `json:"resyncDetails,omitempty"` + // LastSyncTime - READ-ONLY; The last sync time. + LastSyncTime *date.Time `json:"lastSyncTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackProtectedDiskDetails. +func (imrfpdd InMageRcmFailbackProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrfpdd.IrDetails != nil { + objectMap["irDetails"] = imrfpdd.IrDetails + } + if imrfpdd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrfpdd.ResyncDetails + } + return json.Marshal(objectMap) +} + +// InMageRcmFailbackReplicationDetails inMageRcmFailback provider specific details. +type InMageRcmFailbackReplicationDetails struct { + // InternalIdentifier - READ-ONLY; The virtual machine internal identifier. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // AzureVirtualMachineID - READ-ONLY; The ARM Id of the azure VM. + AzureVirtualMachineID *string `json:"azureVirtualMachineId,omitempty"` + // MultiVMGroupName - READ-ONLY; The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // ReprotectAgentID - READ-ONLY; The reprotect agent Id. + ReprotectAgentID *string `json:"reprotectAgentId,omitempty"` + // ReprotectAgentName - READ-ONLY; The reprotect agent name. + ReprotectAgentName *string `json:"reprotectAgentName,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // TargetvCenterID - READ-ONLY; The target vCenter Id. + TargetvCenterID *string `json:"targetvCenterId,omitempty"` + // TargetDataStoreName - READ-ONLY; The target datastore name. + TargetDataStoreName *string `json:"targetDataStoreName,omitempty"` + // TargetVMName - READ-ONLY; The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // InitialReplicationProgressPercentage - READ-ONLY; The initial replication progress percentage. + InitialReplicationProgressPercentage *int32 `json:"initialReplicationProgressPercentage,omitempty"` + // InitialReplicationProcessedBytes - READ-ONLY; The initial replication processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + InitialReplicationProcessedBytes *int64 `json:"initialReplicationProcessedBytes,omitempty"` + // InitialReplicationTransferredBytes - READ-ONLY; The initial replication transferred bytes from source VM to target for all selected disks on source VM. + InitialReplicationTransferredBytes *int64 `json:"initialReplicationTransferredBytes,omitempty"` + // InitialReplicationProgressHealth - READ-ONLY; The initial replication progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + InitialReplicationProgressHealth VMReplicationProgressHealth `json:"initialReplicationProgressHealth,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncProcessedBytes - READ-ONLY; The resync processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTransferredBytes - READ-ONLY; The resync transferred bytes from source VM to target for all selected disks on source VM. + ResyncTransferredBytes *int64 `json:"resyncTransferredBytes,omitempty"` + // ResyncProgressHealth - READ-ONLY; The resync progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + ResyncProgressHealth VMReplicationProgressHealth `json:"resyncProgressHealth,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageRcmFailbackProtectedDiskDetails `json:"protectedDisks,omitempty"` + // MobilityAgentDetails - The mobility agent information. + MobilityAgentDetails *InMageRcmFailbackMobilityAgentDetails `json:"mobilityAgentDetails,omitempty"` + // VMNics - The network details. + VMNics *[]InMageRcmFailbackNicDetails `json:"vmNics,omitempty"` + // LastPlannedFailoverStartTime - READ-ONLY; The last planned failover start time. + LastPlannedFailoverStartTime *date.Time `json:"lastPlannedFailoverStartTime,omitempty"` + // LastPlannedFailoverStatus - READ-ONLY; The last planned failover status. Possible values include: 'PlannedFailoverStatusSucceeded', 'PlannedFailoverStatusFailed', 'PlannedFailoverStatusCancelled', 'PlannedFailoverStatusUnknown' + LastPlannedFailoverStatus PlannedFailoverStatus `json:"lastPlannedFailoverStatus,omitempty"` + // DiscoveredVMDetails - The discovered VM information. + DiscoveredVMDetails *InMageRcmFailbackDiscoveredProtectedVMDetails `json:"discoveredVmDetails,omitempty"` + // LastUsedPolicyID - READ-ONLY; The policy Id used by the forward replication. + LastUsedPolicyID *string `json:"lastUsedPolicyId,omitempty"` + // LastUsedPolicyFriendlyName - READ-ONLY; The policy friendly name used by the forward replication. + LastUsedPolicyFriendlyName *string `json:"lastUsedPolicyFriendlyName,omitempty"` + // IsAgentRegistrationSuccessfulAfterFailover - READ-ONLY; A value indicating whether agent registration was successful after failover. + IsAgentRegistrationSuccessfulAfterFailover *bool `json:"isAgentRegistrationSuccessfulAfterFailover,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) MarshalJSON() ([]byte, error) { + imrfrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrfrd.ProtectedDisks + } + if imrfrd.MobilityAgentDetails != nil { + objectMap["mobilityAgentDetails"] = imrfrd.MobilityAgentDetails + } + if imrfrd.VMNics != nil { + objectMap["vmNics"] = imrfrd.VMNics + } + if imrfrd.DiscoveredVMDetails != nil { + objectMap["discoveredVmDetails"] = imrfrd.DiscoveredVMDetails + } + if imrfrd.InstanceType != "" { + objectMap["instanceType"] = imrfrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return &imrfrd, true +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmFailbackReplicationDetails. +func (imrfrd InMageRcmFailbackReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrfrd, true +} + +// InMageRcmFailbackReprotectInput inMageRcmFailback specific provider input. +type InMageRcmFailbackReprotectInput struct { + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RunAsAccountID - The run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) MarshalJSON() ([]byte, error) { + imrfri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if imrfri.ProcessServerID != nil { + objectMap["processServerId"] = imrfri.ProcessServerID + } + if imrfri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imrfri.RunAsAccountID + } + if imrfri.PolicyID != nil { + objectMap["policyId"] = imrfri.PolicyID + } + if imrfri.InstanceType != "" { + objectMap["instanceType"] = imrfri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return &imrfri, true +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmFailbackReprotectInput. +func (imrfri InMageRcmFailbackReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imrfri, true +} + +// InMageRcmFailbackSyncDetails inMageRcmFailback disk level sync details. +type InMageRcmFailbackSyncDetails struct { + // ProgressHealth - READ-ONLY; The progress health. Possible values include: 'None', 'InProgress', 'SlowProgress', 'NoProgress', 'Queued' + ProgressHealth DiskReplicationProgressHealth `json:"progressHealth,omitempty"` + // TransferredBytes - READ-ONLY; The transferred bytes from source VM to azure for the disk. + TransferredBytes *int64 `json:"transferredBytes,omitempty"` + // Last15MinutesTransferredBytes - READ-ONLY; The bytes transferred in last 15 minutes from source VM to target. + Last15MinutesTransferredBytes *int64 `json:"last15MinutesTransferredBytes,omitempty"` + // LastDataTransferTimeUtc - READ-ONLY; The time of the last data transfer from source VM to target. + LastDataTransferTimeUtc *string `json:"lastDataTransferTimeUtc,omitempty"` + // ProcessedBytes - READ-ONLY; The total processed bytes. This includes bytes that are transferred from source VM to target and matched bytes. + ProcessedBytes *int64 `json:"processedBytes,omitempty"` + // StartTime - READ-ONLY; The start time. + StartTime *string `json:"startTime,omitempty"` + // LastRefreshTime - READ-ONLY; The last refresh time. + LastRefreshTime *string `json:"lastRefreshTime,omitempty"` + // ProgressPercentage - READ-ONLY; Progress in percentage. Progress percentage is calculated based on processed bytes. + ProgressPercentage *int32 `json:"progressPercentage,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmFailbackSyncDetails. +func (imrfsd InMageRcmFailbackSyncDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmLastAgentUpgradeErrorDetails inMageRcm last source agent upgrade error details. +type InMageRcmLastAgentUpgradeErrorDetails struct { + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - READ-ONLY; The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - READ-ONLY; The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ErrorMessageParameters - READ-ONLY; The error message parameters. + ErrorMessageParameters map[string]*string `json:"errorMessageParameters"` + // ErrorTags - READ-ONLY; The error tags. + ErrorTags map[string]*string `json:"errorTags"` +} + +// MarshalJSON is the custom marshaler for InMageRcmLastAgentUpgradeErrorDetails. +func (imrlaued InMageRcmLastAgentUpgradeErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmMobilityAgentDetails inMageRcm mobility agent details. +type InMageRcmMobilityAgentDetails struct { + // Version - READ-ONLY; The agent version. + Version *string `json:"version,omitempty"` + // LatestVersion - READ-ONLY; The latest agent version available. + LatestVersion *string `json:"latestVersion,omitempty"` + // LatestAgentReleaseDate - READ-ONLY; The latest agent version release date. + LatestAgentReleaseDate *string `json:"latestAgentReleaseDate,omitempty"` + // DriverVersion - READ-ONLY; The driver version. + DriverVersion *string `json:"driverVersion,omitempty"` + // LatestUpgradableVersionWithoutReboot - READ-ONLY; The latest upgradeable version available without reboot. + LatestUpgradableVersionWithoutReboot *string `json:"latestUpgradableVersionWithoutReboot,omitempty"` + // AgentVersionExpiryDate - READ-ONLY; The agent version expiry date. + AgentVersionExpiryDate *date.Time `json:"agentVersionExpiryDate,omitempty"` + // DriverVersionExpiryDate - READ-ONLY; The driver version expiry date. + DriverVersionExpiryDate *date.Time `json:"driverVersionExpiryDate,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The time of the last heartbeat received from the agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // ReasonsBlockingUpgrade - READ-ONLY; The whether update is possible or not. + ReasonsBlockingUpgrade *[]AgentUpgradeBlockedReason `json:"reasonsBlockingUpgrade,omitempty"` + // IsUpgradeable - READ-ONLY; A value indicating whether agent is upgradeable or not. + IsUpgradeable *string `json:"isUpgradeable,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmMobilityAgentDetails. +func (imrmad InMageRcmMobilityAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmNicDetails inMageRcm NIC details. +type InMageRcmNicDetails struct { + // NicID - READ-ONLY; The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // IsSelectedForFailover - A value indicating whether this NIC is selected for failover. + IsSelectedForFailover *string `json:"isSelectedForFailover,omitempty"` + // SourceIPAddress - READ-ONLY; The source IP address. + SourceIPAddress *string `json:"sourceIPAddress,omitempty"` + // SourceIPAddressType - READ-ONLY; The source IP address type. Possible values include: 'Dynamic', 'Static' + SourceIPAddressType EthernetAddressType `json:"sourceIPAddressType,omitempty"` + // SourceNetworkID - READ-ONLY; Source network Id. + SourceNetworkID *string `json:"sourceNetworkId,omitempty"` + // SourceSubnetName - READ-ONLY; Source subnet name. + SourceSubnetName *string `json:"sourceSubnetName,omitempty"` + // TargetIPAddress - The target IP address. + TargetIPAddress *string `json:"targetIPAddress,omitempty"` + // TargetIPAddressType - The target IP address type. Possible values include: 'Dynamic', 'Static' + TargetIPAddressType EthernetAddressType `json:"targetIPAddressType,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TestSubnetName - Test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TestIPAddress - The test IP address. + TestIPAddress *string `json:"testIPAddress,omitempty"` + // TestIPAddressType - The test IP address type. Possible values include: 'Dynamic', 'Static' + TestIPAddressType EthernetAddressType `json:"testIPAddressType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmNicDetails. +func (imrnd InMageRcmNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrnd.IsPrimaryNic != nil { + objectMap["isPrimaryNic"] = imrnd.IsPrimaryNic + } + if imrnd.IsSelectedForFailover != nil { + objectMap["isSelectedForFailover"] = imrnd.IsSelectedForFailover + } + if imrnd.TargetIPAddress != nil { + objectMap["targetIPAddress"] = imrnd.TargetIPAddress + } + if imrnd.TargetIPAddressType != "" { + objectMap["targetIPAddressType"] = imrnd.TargetIPAddressType + } + if imrnd.TargetSubnetName != nil { + objectMap["targetSubnetName"] = imrnd.TargetSubnetName + } + if imrnd.TestSubnetName != nil { + objectMap["testSubnetName"] = imrnd.TestSubnetName + } + if imrnd.TestIPAddress != nil { + objectMap["testIPAddress"] = imrnd.TestIPAddress + } + if imrnd.TestIPAddressType != "" { + objectMap["testIPAddressType"] = imrnd.TestIPAddressType + } + return json.Marshal(objectMap) +} + +// InMageRcmNicInput inMageRcm NIC input. +type InMageRcmNicInput struct { + // NicID - The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // IsSelectedForFailover - A value indicating whether this NIC is selected for failover. + IsSelectedForFailover *string `json:"isSelectedForFailover,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetStaticIPAddress - The target static IP address. + TargetStaticIPAddress *string `json:"targetStaticIPAddress,omitempty"` + // TestSubnetName - The test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TestStaticIPAddress - The test static IP address. + TestStaticIPAddress *string `json:"testStaticIPAddress,omitempty"` +} + +// InMageRcmPolicyCreationInput inMageRcm policy creation input. +type InMageRcmPolicyCreationInput struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // EnableMultiVMSync - A value indicating whether multi-VM sync has to be enabled. + EnableMultiVMSync *string `json:"enableMultiVmSync,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) MarshalJSON() ([]byte, error) { + imrpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpci.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = imrpci.RecoveryPointHistoryInMinutes + } + if imrpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrpci.CrashConsistentFrequencyInMinutes + } + if imrpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrpci.AppConsistentFrequencyInMinutes + } + if imrpci.EnableMultiVMSync != nil { + objectMap["enableMultiVmSync"] = imrpci.EnableMultiVMSync + } + if imrpci.InstanceType != "" { + objectMap["instanceType"] = imrpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return &imrpci, true +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for InMageRcmPolicyCreationInput. +func (imrpci InMageRcmPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &imrpci, true +} + +// InMageRcmPolicyDetails inMageRcm specific policy details. +type InMageRcmPolicyDetails struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // EnableMultiVMSync - A value indicating whether multi-VM sync has to be enabled. + EnableMultiVMSync *string `json:"enableMultiVmSync,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) MarshalJSON() ([]byte, error) { + imrpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpd.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = imrpd.RecoveryPointHistoryInMinutes + } + if imrpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = imrpd.AppConsistentFrequencyInMinutes + } + if imrpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = imrpd.CrashConsistentFrequencyInMinutes + } + if imrpd.EnableMultiVMSync != nil { + objectMap["enableMultiVmSync"] = imrpd.EnableMultiVMSync + } + if imrpd.InstanceType != "" { + objectMap["instanceType"] = imrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return &imrpd, true +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for InMageRcmPolicyDetails. +func (imrpd InMageRcmPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &imrpd, true +} + +// InMageRcmProtectedDiskDetails inMageRcm protected disk details. +type InMageRcmProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // DiskEncryptionSetID - READ-ONLY; The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // SeedManagedDiskID - READ-ONLY; The ARM Id of the seed managed disk. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // TargetManagedDiskID - READ-ONLY; The ARM Id of the target managed disk. + TargetManagedDiskID *string `json:"targetManagedDiskId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DataPendingInLogDataStoreInMB - READ-ONLY; The data pending in log data store in MB. + DataPendingInLogDataStoreInMB *float64 `json:"dataPendingInLogDataStoreInMB,omitempty"` + // DataPendingAtSourceAgentInMB - READ-ONLY; The data pending at source agent in MB. + DataPendingAtSourceAgentInMB *float64 `json:"dataPendingAtSourceAgentInMB,omitempty"` + // IsInitialReplicationComplete - READ-ONLY; A value indicating whether initial replication is complete or not. + IsInitialReplicationComplete *string `json:"isInitialReplicationComplete,omitempty"` + // IrDetails - The initial replication details. + IrDetails *InMageRcmSyncDetails `json:"irDetails,omitempty"` + // ResyncDetails - The resync details. + ResyncDetails *InMageRcmSyncDetails `json:"resyncDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmProtectedDiskDetails. +func (imrpdd InMageRcmProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if imrpdd.DiskType != "" { + objectMap["diskType"] = imrpdd.DiskType + } + if imrpdd.IrDetails != nil { + objectMap["irDetails"] = imrpdd.IrDetails + } + if imrpdd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrpdd.ResyncDetails + } + return json.Marshal(objectMap) +} + +// InMageRcmProtectionContainerMappingDetails inMageRcm provider specific container mapping details. +type InMageRcmProtectionContainerMappingDetails struct { + // EnableAgentAutoUpgrade - READ-ONLY; A value indicating whether the flag for enable agent auto upgrade. + EnableAgentAutoUpgrade *string `json:"enableAgentAutoUpgrade,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + imrpcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrpcmd.InstanceType != "" { + objectMap["instanceType"] = imrpcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return &imrpcmd, true +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for InMageRcmProtectionContainerMappingDetails. +func (imrpcmd InMageRcmProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &imrpcmd, true +} + +// InMageRcmRecoveryPointDetails inMageRcm provider specific recovery point details. +type InMageRcmRecoveryPointDetails struct { + // IsMultiVMSyncPoint - READ-ONLY; A value indicating whether the recovery point is multi VM consistent. + IsMultiVMSyncPoint *string `json:"isMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) MarshalJSON() ([]byte, error) { + imrrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrrpd.InstanceType != "" { + objectMap["instanceType"] = imrrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return &imrrpd, true +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return nil, false +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for InMageRcmRecoveryPointDetails. +func (imrrpd InMageRcmRecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &imrrpd, true +} + +// InMageRcmReplicationDetails inMageRcm provider specific details. +type InMageRcmReplicationDetails struct { + // InternalIdentifier - READ-ONLY; The virtual machine internal identifier. + InternalIdentifier *string `json:"internalIdentifier,omitempty"` + // FabricDiscoveryMachineID - READ-ONLY; The ARM Id of the discovered VM. + FabricDiscoveryMachineID *string `json:"fabricDiscoveryMachineId,omitempty"` + // MultiVMGroupName - READ-ONLY; The multi VM group name. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // DiscoveryType - READ-ONLY; The type of the discovered VM. + DiscoveryType *string `json:"discoveryType,omitempty"` + // ProcessServerID - READ-ONLY; The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // ProcessorCoreCount - READ-ONLY; The processor core count. + ProcessorCoreCount *int32 `json:"processorCoreCount,omitempty"` + // AllocatedMemoryInMB - READ-ONLY; The allocated memory in MB. + AllocatedMemoryInMB *float64 `json:"allocatedMemoryInMB,omitempty"` + // ProcessServerName - READ-ONLY; The process server name. + ProcessServerName *string `json:"processServerName,omitempty"` + // RunAsAccountID - READ-ONLY; The run-as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // FirmwareType - READ-ONLY; The firmware type. + FirmwareType *string `json:"firmwareType,omitempty"` + // PrimaryNicIPAddress - READ-ONLY; The IP address of the primary network interface. + PrimaryNicIPAddress *string `json:"primaryNicIpAddress,omitempty"` + // TargetGeneration - READ-ONLY; The target generation. + TargetGeneration *string `json:"targetGeneration,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // TargetVMName - Target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetLocation - The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // TargetAvailabilitySetID - The target availability set Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The test network Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // FailoverRecoveryPointID - READ-ONLY; The recovery point Id to which the VM was failed over. + FailoverRecoveryPointID *string `json:"failoverRecoveryPointId,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // LastRpoInSeconds - READ-ONLY; The last recovery point objective value. + LastRpoInSeconds *int64 `json:"lastRpoInSeconds,omitempty"` + // LastRpoCalculatedTime - READ-ONLY; The last recovery point objective calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastRecoveryPointID - READ-ONLY; The last recovery point Id. + LastRecoveryPointID *string `json:"lastRecoveryPointId,omitempty"` + // InitialReplicationProgressPercentage - READ-ONLY; The initial replication progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + InitialReplicationProgressPercentage *int32 `json:"initialReplicationProgressPercentage,omitempty"` + // InitialReplicationProcessedBytes - READ-ONLY; The initial replication processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + InitialReplicationProcessedBytes *int64 `json:"initialReplicationProcessedBytes,omitempty"` + // InitialReplicationTransferredBytes - READ-ONLY; The initial replication transferred bytes from source VM to azure for all selected disks on source VM. + InitialReplicationTransferredBytes *int64 `json:"initialReplicationTransferredBytes,omitempty"` + // InitialReplicationProgressHealth - READ-ONLY; The initial replication progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + InitialReplicationProgressHealth VMReplicationProgressHealth `json:"initialReplicationProgressHealth,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // ResyncProcessedBytes - READ-ONLY; The resync processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + ResyncProcessedBytes *int64 `json:"resyncProcessedBytes,omitempty"` + // ResyncTransferredBytes - READ-ONLY; The resync transferred bytes from source VM to azure for all selected disks on source VM. + ResyncTransferredBytes *int64 `json:"resyncTransferredBytes,omitempty"` + // ResyncProgressHealth - READ-ONLY; The resync progress health. Possible values include: 'VMReplicationProgressHealthNone', 'VMReplicationProgressHealthInProgress', 'VMReplicationProgressHealthSlowProgress', 'VMReplicationProgressHealthNoProgress' + ResyncProgressHealth VMReplicationProgressHealth `json:"resyncProgressHealth,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // AgentUpgradeState - READ-ONLY; The agent auto upgrade state. Possible values include: 'MobilityAgentUpgradeStateNone', 'MobilityAgentUpgradeStateStarted', 'MobilityAgentUpgradeStateCompleted', 'MobilityAgentUpgradeStateCommit' + AgentUpgradeState MobilityAgentUpgradeState `json:"agentUpgradeState,omitempty"` + // LastAgentUpgradeType - READ-ONLY; The last agent upgrade type. + LastAgentUpgradeType *string `json:"lastAgentUpgradeType,omitempty"` + // AgentUpgradeJobID - READ-ONLY; The agent upgrade job Id. + AgentUpgradeJobID *string `json:"agentUpgradeJobId,omitempty"` + // AgentUpgradeAttemptToVersion - READ-ONLY; The agent version to which last agent upgrade was attempted. + AgentUpgradeAttemptToVersion *string `json:"agentUpgradeAttemptToVersion,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageRcmProtectedDiskDetails `json:"protectedDisks,omitempty"` + // IsLastUpgradeSuccessful - READ-ONLY; A value indicating whether last agent upgrade was successful or not. + IsLastUpgradeSuccessful *string `json:"isLastUpgradeSuccessful,omitempty"` + // IsAgentRegistrationSuccessfulAfterFailover - READ-ONLY; A value indicating whether agent registration was successful after failover. + IsAgentRegistrationSuccessfulAfterFailover *bool `json:"isAgentRegistrationSuccessfulAfterFailover,omitempty"` + // MobilityAgentDetails - The mobility agent information. + MobilityAgentDetails *InMageRcmMobilityAgentDetails `json:"mobilityAgentDetails,omitempty"` + // LastAgentUpgradeErrorDetails - The last agent upgrade error information. + LastAgentUpgradeErrorDetails *[]InMageRcmLastAgentUpgradeErrorDetails `json:"lastAgentUpgradeErrorDetails,omitempty"` + // AgentUpgradeBlockingErrorDetails - The agent upgrade blocking error information. + AgentUpgradeBlockingErrorDetails *[]InMageRcmAgentUpgradeBlockingErrorDetails `json:"agentUpgradeBlockingErrorDetails,omitempty"` + // VMNics - The network details. + VMNics *[]InMageRcmNicDetails `json:"vmNics,omitempty"` + // DiscoveredVMDetails - The discovered VM details. + DiscoveredVMDetails *InMageRcmDiscoveredProtectedVMDetails `json:"discoveredVmDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) MarshalJSON() ([]byte, error) { + imrrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrrd.LicenseType != nil { + objectMap["licenseType"] = imrrd.LicenseType + } + if imrrd.TargetVMName != nil { + objectMap["targetVmName"] = imrrd.TargetVMName + } + if imrrd.TargetVMSize != nil { + objectMap["targetVmSize"] = imrrd.TargetVMSize + } + if imrrd.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrrd.TargetResourceGroupID + } + if imrrd.TargetLocation != nil { + objectMap["targetLocation"] = imrrd.TargetLocation + } + if imrrd.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrrd.TargetAvailabilitySetID + } + if imrrd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrrd.TargetAvailabilityZone + } + if imrrd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrrd.TargetProximityPlacementGroupID + } + if imrrd.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrrd.TargetBootDiagnosticsStorageAccountID + } + if imrrd.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrrd.TargetNetworkID + } + if imrrd.TestNetworkID != nil { + objectMap["testNetworkId"] = imrrd.TestNetworkID + } + if imrrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrrd.ProtectedDisks + } + if imrrd.MobilityAgentDetails != nil { + objectMap["mobilityAgentDetails"] = imrrd.MobilityAgentDetails + } + if imrrd.LastAgentUpgradeErrorDetails != nil { + objectMap["lastAgentUpgradeErrorDetails"] = imrrd.LastAgentUpgradeErrorDetails + } + if imrrd.AgentUpgradeBlockingErrorDetails != nil { + objectMap["agentUpgradeBlockingErrorDetails"] = imrrd.AgentUpgradeBlockingErrorDetails + } + if imrrd.VMNics != nil { + objectMap["vmNics"] = imrrd.VMNics + } + if imrrd.DiscoveredVMDetails != nil { + objectMap["discoveredVmDetails"] = imrrd.DiscoveredVMDetails + } + if imrrd.InstanceType != "" { + objectMap["instanceType"] = imrrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return &imrrd, true +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageRcmReplicationDetails. +func (imrrd InMageRcmReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrrd, true +} + +// InMageRcmReprotectInput inMageRcm specific provider input. +type InMageRcmReprotectInput struct { + // ReprotectAgentID - The reprotect agent Id. + ReprotectAgentID *string `json:"reprotectAgentId,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // PolicyID - The Policy Id. + PolicyID *string `json:"policyId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) MarshalJSON() ([]byte, error) { + imrri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrri.ReprotectAgentID != nil { + objectMap["reprotectAgentId"] = imrri.ReprotectAgentID + } + if imrri.DatastoreName != nil { + objectMap["datastoreName"] = imrri.DatastoreName + } + if imrri.LogStorageAccountID != nil { + objectMap["logStorageAccountId"] = imrri.LogStorageAccountID + } + if imrri.PolicyID != nil { + objectMap["policyId"] = imrri.PolicyID + } + if imrri.InstanceType != "" { + objectMap["instanceType"] = imrri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return &imrri, true +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageRcmReprotectInput. +func (imrri InMageRcmReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imrri, true +} + +// InMageRcmSyncDetails inMageRcm disk level sync details. +type InMageRcmSyncDetails struct { + // ProgressHealth - READ-ONLY; The progress health. Possible values include: 'None', 'InProgress', 'SlowProgress', 'NoProgress', 'Queued' + ProgressHealth DiskReplicationProgressHealth `json:"progressHealth,omitempty"` + // TransferredBytes - READ-ONLY; The transferred bytes from source VM to azure for the disk. + TransferredBytes *int64 `json:"transferredBytes,omitempty"` + // Last15MinutesTransferredBytes - READ-ONLY; The bytes transferred in last 15 minutes from source VM to azure. + Last15MinutesTransferredBytes *int64 `json:"last15MinutesTransferredBytes,omitempty"` + // LastDataTransferTimeUtc - READ-ONLY; The time of the last data transfer from source VM to azure. + LastDataTransferTimeUtc *string `json:"lastDataTransferTimeUtc,omitempty"` + // ProcessedBytes - READ-ONLY; The total processed bytes. This includes bytes that are transferred from source VM to azure and matched bytes. + ProcessedBytes *int64 `json:"processedBytes,omitempty"` + // StartTime - READ-ONLY; The start time. + StartTime *string `json:"startTime,omitempty"` + // LastRefreshTime - READ-ONLY; The last refresh time. + LastRefreshTime *string `json:"lastRefreshTime,omitempty"` + // ProgressPercentage - READ-ONLY; Progress in percentage. Progress percentage is calculated based on processed bytes. + ProgressPercentage *int32 `json:"progressPercentage,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmSyncDetails. +func (imrsd InMageRcmSyncDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InMageRcmTestFailoverInput inMageRcm provider specific input for test failover. +type InMageRcmTestFailoverInput struct { + // NetworkID - The test network Id. + NetworkID *string `json:"networkId,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) MarshalJSON() ([]byte, error) { + imrtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrtfi.NetworkID != nil { + objectMap["networkId"] = imrtfi.NetworkID + } + if imrtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrtfi.RecoveryPointID + } + if imrtfi.InstanceType != "" { + objectMap["instanceType"] = imrtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return &imrtfi, true +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageRcmTestFailoverInput. +func (imrtfi InMageRcmTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imrtfi, true +} + +// InMageRcmUnplannedFailoverInput inMageRcm provider specific input for unplanned failover. +type InMageRcmUnplannedFailoverInput struct { + // PerformShutdown - A value indicating whether VM is to be shutdown. + PerformShutdown *string `json:"performShutdown,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imrufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrufi.PerformShutdown != nil { + objectMap["performShutdown"] = imrufi.PerformShutdown + } + if imrufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imrufi.RecoveryPointID + } + if imrufi.InstanceType != "" { + objectMap["instanceType"] = imrufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return &imrufi, true +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageRcmUnplannedFailoverInput. +func (imrufi InMageRcmUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imrufi, true +} + +// InMageRcmUpdateApplianceForReplicationProtectedItemInput inMageRcm provider specific input to update +// appliance for replication protected item. +type InMageRcmUpdateApplianceForReplicationProtectedItemInput struct { + // RunAsAccountID - The run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput', 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imruafrpii.InstanceType = InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imruafrpii.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imruafrpii.RunAsAccountID + } + if imruafrpii.InstanceType != "" { + objectMap["instanceType"] = imruafrpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageRcmUpdateApplianceForReplicationProtectedItemInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) AsInMageRcmUpdateApplianceForReplicationProtectedItemInput() (*InMageRcmUpdateApplianceForReplicationProtectedItemInput, bool) { + return &imruafrpii, true +} + +// AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (*UpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for InMageRcmUpdateApplianceForReplicationProtectedItemInput. +func (imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput) AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return &imruafrpii, true +} + +// InMageRcmUpdateContainerMappingInput inMageRcm update protection container mapping. +type InMageRcmUpdateContainerMappingInput struct { + // EnableAgentAutoUpgrade - A value indicating whether agent auto upgrade has to be enabled. + EnableAgentAutoUpgrade *string `json:"enableAgentAutoUpgrade,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + imrucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrucmi.EnableAgentAutoUpgrade != nil { + objectMap["enableAgentAutoUpgrade"] = imrucmi.EnableAgentAutoUpgrade + } + if imrucmi.InstanceType != "" { + objectMap["instanceType"] = imrucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return &imrucmi, true +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for InMageRcmUpdateContainerMappingInput. +func (imrucmi InMageRcmUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &imrucmi, true +} + +// InMageRcmUpdateReplicationProtectedItemInput inMageRcm provider specific input to update replication +// protected item. +type InMageRcmUpdateReplicationProtectedItemInput struct { + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The test network ARM Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // VMNics - The list of NIC details. + VMNics *[]InMageRcmNicInput `json:"vmNics,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, error) { + imrurpii.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if imrurpii.TargetVMName != nil { + objectMap["targetVmName"] = imrurpii.TargetVMName + } + if imrurpii.TargetVMSize != nil { + objectMap["targetVmSize"] = imrurpii.TargetVMSize + } + if imrurpii.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = imrurpii.TargetResourceGroupID + } + if imrurpii.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = imrurpii.TargetAvailabilitySetID + } + if imrurpii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = imrurpii.TargetAvailabilityZone + } + if imrurpii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = imrurpii.TargetProximityPlacementGroupID + } + if imrurpii.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = imrurpii.TargetBootDiagnosticsStorageAccountID + } + if imrurpii.TargetNetworkID != nil { + objectMap["targetNetworkId"] = imrurpii.TargetNetworkID + } + if imrurpii.TestNetworkID != nil { + objectMap["testNetworkId"] = imrurpii.TestNetworkID + } + if imrurpii.VMNics != nil { + objectMap["vmNics"] = imrurpii.VMNics + } + if imrurpii.LicenseType != "" { + objectMap["licenseType"] = imrurpii.LicenseType + } + if imrurpii.InstanceType != "" { + objectMap["instanceType"] = imrurpii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return &imrurpii, true +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return nil, false +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for InMageRcmUpdateReplicationProtectedItemInput. +func (imrurpii InMageRcmUpdateReplicationProtectedItemInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &imrurpii, true +} + +// InMageReplicationDetails inMage provider specific settings. +type InMageReplicationDetails struct { + // ActiveSiteType - The active location of the VM. If the VM is being protected from Azure, this field will take values from { Azure, OnPrem }. If the VM is being protected between two data-centers, this field will be OnPrem always. + ActiveSiteType *string `json:"activeSiteType,omitempty"` + // SourceVMCPUCount - The CPU count of the VM on the primary side. + SourceVMCPUCount *int32 `json:"sourceVmCpuCount,omitempty"` + // SourceVMRAMSizeInMB - The RAM size of the VM on the primary side. + SourceVMRAMSizeInMB *int32 `json:"sourceVmRamSizeInMB,omitempty"` + // OsDetails - The OS details. + OsDetails *OSDiskDetails `json:"osDetails,omitempty"` + // ProtectionStage - The protection stage. + ProtectionStage *string `json:"protectionStage,omitempty"` + // VMID - The virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // VMProtectionState - The protection state for the vm. + VMProtectionState *string `json:"vmProtectionState,omitempty"` + // VMProtectionStateDescription - The protection state description for the vm. + VMProtectionStateDescription *string `json:"vmProtectionStateDescription,omitempty"` + // ResyncDetails - The resync details of the machine. + ResyncDetails *InitialReplicationDetails `json:"resyncDetails,omitempty"` + // RetentionWindowStart - The retention window start time. + RetentionWindowStart *date.Time `json:"retentionWindowStart,omitempty"` + // RetentionWindowEnd - The retention window end time. + RetentionWindowEnd *date.Time `json:"retentionWindowEnd,omitempty"` + // CompressedDataRateInMB - The compressed data change rate in MB. + CompressedDataRateInMB *float64 `json:"compressedDataRateInMB,omitempty"` + // UncompressedDataRateInMB - The uncompressed data change rate in MB. + UncompressedDataRateInMB *float64 `json:"uncompressedDataRateInMB,omitempty"` + // RpoInSeconds - The RPO in seconds. + RpoInSeconds *int64 `json:"rpoInSeconds,omitempty"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]InMageProtectedDiskDetails `json:"protectedDisks,omitempty"` + // IPAddress - The source IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // LastHeartbeat - The last heartbeat received from the source server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // MasterTargetID - The master target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ConsistencyPoints - The collection of Consistency points. + ConsistencyPoints map[string]*date.Time `json:"consistencyPoints"` + // DiskResized - A value indicating whether any disk is resized for this VM. + DiskResized *string `json:"diskResized,omitempty"` + // RebootAfterUpdateStatus - A value indicating whether the source server requires a restart after update. + RebootAfterUpdateStatus *string `json:"rebootAfterUpdateStatus,omitempty"` + // MultiVMGroupID - The multi vm group Id, if any. + MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` + // MultiVMGroupName - The multi vm group name, if any. + MultiVMGroupName *string `json:"multiVmGroupName,omitempty"` + // MultiVMSyncStatus - A value indicating whether the multi vm sync is enabled or disabled. + MultiVMSyncStatus *string `json:"multiVmSyncStatus,omitempty"` + // AgentDetails - The agent details. + AgentDetails *InMageAgentDetails `json:"agentDetails,omitempty"` + // VCenterInfrastructureID - The vCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // InfrastructureVMID - The infrastructure VM Id. + InfrastructureVMID *string `json:"infrastructureVmId,omitempty"` + // VMNics - The PE Network details. + VMNics *[]VMNicDetails `json:"vmNics,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. + DiscoveryType *string `json:"discoveryType,omitempty"` + // AzureStorageAccountID - A value indicating the underlying Azure storage account. If the VM is not running in Azure, this value shall be set to null. + AzureStorageAccountID *string `json:"azureStorageAccountId,omitempty"` + // Datastores - The datastores of the on-premise machine Value can be list of strings that contain datastore names. + Datastores *[]string `json:"datastores,omitempty"` + // ValidationErrors - The validation errors of the on-premise machine Value can be list of validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // LastRpoCalculatedTime - The last RPO calculated time. + LastRpoCalculatedTime *date.Time `json:"lastRpoCalculatedTime,omitempty"` + // LastUpdateReceivedTime - The last update time received from on-prem components. + LastUpdateReceivedTime *date.Time `json:"lastUpdateReceivedTime,omitempty"` + // ReplicaID - The replica id of the protected item. + ReplicaID *string `json:"replicaId,omitempty"` + // OsVersion - The OS Version of the protected item. + OsVersion *string `json:"osVersion,omitempty"` + // IsAdditionalStatsAvailable - A value indicating whether additional IR stats are available or not. + IsAdditionalStatsAvailable *bool `json:"isAdditionalStatsAvailable,omitempty"` + // TotalDataTransferred - The total transferred data in bytes. + TotalDataTransferred *int64 `json:"totalDataTransferred,omitempty"` + // TotalProgressHealth - The progress health. + TotalProgressHealth *string `json:"totalProgressHealth,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageReplicationDetails. +func (imrd InMageReplicationDetails) MarshalJSON() ([]byte, error) { + imrd.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imrd.ActiveSiteType != nil { + objectMap["activeSiteType"] = imrd.ActiveSiteType + } + if imrd.SourceVMCPUCount != nil { + objectMap["sourceVmCpuCount"] = imrd.SourceVMCPUCount + } + if imrd.SourceVMRAMSizeInMB != nil { + objectMap["sourceVmRamSizeInMB"] = imrd.SourceVMRAMSizeInMB + } + if imrd.OsDetails != nil { + objectMap["osDetails"] = imrd.OsDetails + } + if imrd.ProtectionStage != nil { + objectMap["protectionStage"] = imrd.ProtectionStage + } + if imrd.VMID != nil { + objectMap["vmId"] = imrd.VMID + } + if imrd.VMProtectionState != nil { + objectMap["vmProtectionState"] = imrd.VMProtectionState + } + if imrd.VMProtectionStateDescription != nil { + objectMap["vmProtectionStateDescription"] = imrd.VMProtectionStateDescription + } + if imrd.ResyncDetails != nil { + objectMap["resyncDetails"] = imrd.ResyncDetails + } + if imrd.RetentionWindowStart != nil { + objectMap["retentionWindowStart"] = imrd.RetentionWindowStart + } + if imrd.RetentionWindowEnd != nil { + objectMap["retentionWindowEnd"] = imrd.RetentionWindowEnd + } + if imrd.CompressedDataRateInMB != nil { + objectMap["compressedDataRateInMB"] = imrd.CompressedDataRateInMB + } + if imrd.UncompressedDataRateInMB != nil { + objectMap["uncompressedDataRateInMB"] = imrd.UncompressedDataRateInMB + } + if imrd.RpoInSeconds != nil { + objectMap["rpoInSeconds"] = imrd.RpoInSeconds + } + if imrd.ProtectedDisks != nil { + objectMap["protectedDisks"] = imrd.ProtectedDisks + } + if imrd.IPAddress != nil { + objectMap["ipAddress"] = imrd.IPAddress + } + if imrd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = imrd.LastHeartbeat + } + if imrd.ProcessServerID != nil { + objectMap["processServerId"] = imrd.ProcessServerID + } + if imrd.MasterTargetID != nil { + objectMap["masterTargetId"] = imrd.MasterTargetID + } + if imrd.ConsistencyPoints != nil { + objectMap["consistencyPoints"] = imrd.ConsistencyPoints + } + if imrd.DiskResized != nil { + objectMap["diskResized"] = imrd.DiskResized + } + if imrd.RebootAfterUpdateStatus != nil { + objectMap["rebootAfterUpdateStatus"] = imrd.RebootAfterUpdateStatus + } + if imrd.MultiVMGroupID != nil { + objectMap["multiVmGroupId"] = imrd.MultiVMGroupID + } + if imrd.MultiVMGroupName != nil { + objectMap["multiVmGroupName"] = imrd.MultiVMGroupName + } + if imrd.MultiVMSyncStatus != nil { + objectMap["multiVmSyncStatus"] = imrd.MultiVMSyncStatus + } + if imrd.AgentDetails != nil { + objectMap["agentDetails"] = imrd.AgentDetails + } + if imrd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = imrd.VCenterInfrastructureID + } + if imrd.InfrastructureVMID != nil { + objectMap["infrastructureVmId"] = imrd.InfrastructureVMID + } + if imrd.VMNics != nil { + objectMap["vmNics"] = imrd.VMNics + } + if imrd.DiscoveryType != nil { + objectMap["discoveryType"] = imrd.DiscoveryType + } + if imrd.AzureStorageAccountID != nil { + objectMap["azureStorageAccountId"] = imrd.AzureStorageAccountID + } + if imrd.Datastores != nil { + objectMap["datastores"] = imrd.Datastores + } + if imrd.ValidationErrors != nil { + objectMap["validationErrors"] = imrd.ValidationErrors + } + if imrd.LastRpoCalculatedTime != nil { + objectMap["lastRpoCalculatedTime"] = imrd.LastRpoCalculatedTime + } + if imrd.LastUpdateReceivedTime != nil { + objectMap["lastUpdateReceivedTime"] = imrd.LastUpdateReceivedTime + } + if imrd.ReplicaID != nil { + objectMap["replicaId"] = imrd.ReplicaID + } + if imrd.OsVersion != nil { + objectMap["osVersion"] = imrd.OsVersion + } + if imrd.IsAdditionalStatsAvailable != nil { + objectMap["isAdditionalStatsAvailable"] = imrd.IsAdditionalStatsAvailable + } + if imrd.TotalDataTransferred != nil { + objectMap["totalDataTransferred"] = imrd.TotalDataTransferred + } + if imrd.TotalProgressHealth != nil { + objectMap["totalProgressHealth"] = imrd.TotalProgressHealth + } + if imrd.InstanceType != "" { + objectMap["instanceType"] = imrd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return &imrd, true +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for InMageReplicationDetails. +func (imrd InMageReplicationDetails) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &imrd, true +} + +// InMageReprotectInput inMageAzureV2 specific provider input. +type InMageReprotectInput struct { + // MasterTargetID - The Master Target Id. + MasterTargetID *string `json:"masterTargetId,omitempty"` + // ProcessServerID - The Process Server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // RetentionDrive - The retention drive to use on the MT. + RetentionDrive *string `json:"retentionDrive,omitempty"` + // RunAsAccountID - The CS account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // DatastoreName - The target datastore name. + DatastoreName *string `json:"datastoreName,omitempty"` + // DiskExclusionInput - The enable disk exclusion input. + DiskExclusionInput *InMageDiskExclusionInput `json:"diskExclusionInput,omitempty"` + // ProfileID - The Policy Id. + ProfileID *string `json:"profileId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]string `json:"disksToInclude,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageReprotectInput. +func (imri InMageReprotectInput) MarshalJSON() ([]byte, error) { + imri.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imri.MasterTargetID != nil { + objectMap["masterTargetId"] = imri.MasterTargetID + } + if imri.ProcessServerID != nil { + objectMap["processServerId"] = imri.ProcessServerID + } + if imri.RetentionDrive != nil { + objectMap["retentionDrive"] = imri.RetentionDrive + } + if imri.RunAsAccountID != nil { + objectMap["runAsAccountId"] = imri.RunAsAccountID + } + if imri.DatastoreName != nil { + objectMap["datastoreName"] = imri.DatastoreName + } + if imri.DiskExclusionInput != nil { + objectMap["diskExclusionInput"] = imri.DiskExclusionInput + } + if imri.ProfileID != nil { + objectMap["profileId"] = imri.ProfileID + } + if imri.DisksToInclude != nil { + objectMap["disksToInclude"] = imri.DisksToInclude + } + if imri.InstanceType != "" { + objectMap["instanceType"] = imri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return &imri, true +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for InMageReprotectInput. +func (imri InMageReprotectInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &imri, true +} + +// InMageTestFailoverInput provider specific input for InMage test failover. +type InMageTestFailoverInput struct { + // RecoveryPointType - The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. Possible values include: 'LatestTime', 'LatestTag', 'Custom' + RecoveryPointType RecoveryPointType `json:"recoveryPointType,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) MarshalJSON() ([]byte, error) { + imtfi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imtfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imtfi.RecoveryPointType + } + if imtfi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imtfi.RecoveryPointID + } + if imtfi.InstanceType != "" { + objectMap["instanceType"] = imtfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return &imtfi, true +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for InMageTestFailoverInput. +func (imtfi InMageTestFailoverInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &imtfi, true +} + +// InMageUnplannedFailoverInput provider specific input for InMage unplanned failover. +type InMageUnplannedFailoverInput struct { + // RecoveryPointType - The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. Possible values include: 'LatestTime', 'LatestTag', 'Custom' + RecoveryPointType RecoveryPointType `json:"recoveryPointType,omitempty"` + // RecoveryPointID - 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 `json:"recoveryPointId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + imufi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if imufi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = imufi.RecoveryPointType + } + if imufi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = imufi.RecoveryPointID + } + if imufi.InstanceType != "" { + objectMap["instanceType"] = imufi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return &imufi, true +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for InMageUnplannedFailoverInput. +func (imufi InMageUnplannedFailoverInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &imufi, true +} + +// InMageVolumeExclusionOptions guest disk signature based disk exclusion option when doing enable +// protection of virtual machine in InMage provider. +type InMageVolumeExclusionOptions struct { + // VolumeLabel - The volume label. The disk having any volume with this label will be excluded from replication. + VolumeLabel *string `json:"volumeLabel,omitempty"` + // OnlyExcludeIfSingleVolume - The value indicating whether to exclude multi volume disk or not. If a disk has multiple volumes and one of the volume has label matching with VolumeLabel this disk will be excluded from replication if OnlyExcludeIfSingleVolume is false. + OnlyExcludeIfSingleVolume *string `json:"onlyExcludeIfSingleVolume,omitempty"` +} + +// InnerHealthError implements InnerHealthError class. HealthError object has a list of InnerHealthErrors +// as child errors. InnerHealthError is used because this will prevent an infinite loop of structures when +// Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health +// errors and all API consumers can utilize this in the same fashion as Exception -> InnerException. +type InnerHealthError struct { + // ErrorSource - Source of error. + ErrorSource *string `json:"errorSource,omitempty"` + // ErrorType - Type of error. + ErrorType *string `json:"errorType,omitempty"` + // ErrorLevel - Level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // ErrorCategory - Category of error. + ErrorCategory *string `json:"errorCategory,omitempty"` + // ErrorCode - Error code. + ErrorCode *string `json:"errorCode,omitempty"` + // SummaryMessage - Summary message of the entity. + SummaryMessage *string `json:"summaryMessage,omitempty"` + // ErrorMessage - Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // CreationTimeUtc - Error creation time (UTC). + CreationTimeUtc *date.Time `json:"creationTimeUtc,omitempty"` + // RecoveryProviderErrorMessage - DRA error message. + RecoveryProviderErrorMessage *string `json:"recoveryProviderErrorMessage,omitempty"` + // EntityID - ID of the entity. + EntityID *string `json:"entityId,omitempty"` + // ErrorID - The health error unique id. + ErrorID *string `json:"errorId,omitempty"` + // CustomerResolvability - Value indicating whether the health error is customer resolvable. Possible values include: 'Allowed', 'NotAllowed' + CustomerResolvability HealthErrorCustomerResolvability `json:"customerResolvability,omitempty"` +} + +// InputEndpoint ... +type InputEndpoint struct { + EndpointName *string `json:"endpointName,omitempty"` + PrivatePort *int32 `json:"privatePort,omitempty"` + PublicPort *int32 `json:"publicPort,omitempty"` + Protocol *string `json:"protocol,omitempty"` +} + +// IPConfigDetails ... +type IPConfigDetails struct { + Name *string `json:"name,omitempty"` + IsPrimary *bool `json:"isPrimary,omitempty"` + SubnetName *string `json:"subnetName,omitempty"` + StaticIPAddress *string `json:"staticIPAddress,omitempty"` + IPAddressType *string `json:"ipAddressType,omitempty"` + IsSeletedForFailover *bool `json:"isSeletedForFailover,omitempty"` + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + RecoveryStaticIPAddress *string `json:"recoveryStaticIPAddress,omitempty"` + RecoveryIPAddressType *string `json:"recoveryIPAddressType,omitempty"` + RecoveryPublicIPAddressID *string `json:"recoveryPublicIPAddressId,omitempty"` + RecoveryLBBackendAddressPoolIds *[]string `json:"recoveryLBBackendAddressPoolIds,omitempty"` + TfoSubnetName *string `json:"tfoSubnetName,omitempty"` + TfoStaticIPAddress *string `json:"tfoStaticIPAddress,omitempty"` + TfoPublicIPAddressID *string `json:"tfoPublicIPAddressId,omitempty"` + TfoLBBackendAddressPoolIds *[]string `json:"tfoLBBackendAddressPoolIds,omitempty"` +} + +// IPConfigInputDetails ... +type IPConfigInputDetails struct { + IPConfigName *string `json:"ipConfigName,omitempty"` + IsPrimary *bool `json:"isPrimary,omitempty"` + IsSeletedForFailover *bool `json:"isSeletedForFailover,omitempty"` + RecoverySubnetName *string `json:"recoverySubnetName,omitempty"` + RecoveryStaticIPAddress *string `json:"recoveryStaticIPAddress,omitempty"` + RecoveryPublicIPAddressID *string `json:"recoveryPublicIPAddressId,omitempty"` + RecoveryLBBackendAddressPoolIds *[]string `json:"recoveryLBBackendAddressPoolIds,omitempty"` + TfoSubnetName *string `json:"tfoSubnetName,omitempty"` + TfoStaticIPAddress *string `json:"tfoStaticIPAddress,omitempty"` + TfoPublicIPAddressID *string `json:"tfoPublicIPAddressId,omitempty"` + TfoLBBackendAddressPoolIds *[]string `json:"tfoLBBackendAddressPoolIds,omitempty"` +} + +// Job job details. +type Job struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *JobProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if j.Properties != nil { + objectMap["properties"] = j.Properties + } + if j.Location != nil { + objectMap["location"] = j.Location + } + return json.Marshal(objectMap) +} + +// JobCollection collection of jobs. +type JobCollection struct { + autorest.Response `json:"-"` + // Value - The list of jobs. + Value *[]Job `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// JobCollectionIterator provides access to a complete listing of Job values. +type JobCollectionIterator struct { + i int + page JobCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *JobCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *JobCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter JobCollectionIterator) Response() JobCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter JobCollectionIterator) Value() Job { + if !iter.page.NotDone() { + return Job{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the JobCollectionIterator type. +func NewJobCollectionIterator(page JobCollectionPage) JobCollectionIterator { + return JobCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (jc JobCollection) IsEmpty() bool { + return jc.Value == nil || len(*jc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (jc JobCollection) hasNextLink() bool { + return jc.NextLink != nil && len(*jc.NextLink) != 0 +} + +// jobCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jc JobCollection) jobCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !jc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jc.NextLink))) +} + +// JobCollectionPage contains a page of Job values. +type JobCollectionPage struct { + fn func(context.Context, JobCollection) (JobCollection, error) + jc JobCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *JobCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.jc) + if err != nil { + return err + } + page.jc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *JobCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobCollectionPage) NotDone() bool { + return !page.jc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobCollectionPage) Response() JobCollection { + return page.jc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobCollectionPage) Values() []Job { + if page.jc.IsEmpty() { + return nil + } + return *page.jc.Value +} + +// Creates a new instance of the JobCollectionPage type. +func NewJobCollectionPage(cur JobCollection, getNextPage func(context.Context, JobCollection) (JobCollection, error)) JobCollectionPage { + return JobCollectionPage{ + fn: getNextPage, + jc: cur, + } +} + +// BasicJobDetails job details based on specific job type. +type BasicJobDetails interface { + AsAsrJobDetails() (*AsrJobDetails, bool) + AsExportJobDetails() (*ExportJobDetails, bool) + AsFailoverJobDetails() (*FailoverJobDetails, bool) + AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) + AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) + AsJobDetails() (*JobDetails, bool) +} + +// JobDetails job details based on specific job type. +type JobDetails struct { + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicJobDetails(body []byte) (BasicJobDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAsrJobDetails): + var ajd AsrJobDetails + err := json.Unmarshal(body, &ajd) + return ajd, err + case string(InstanceTypeExportJobDetails): + var ejd ExportJobDetails + err := json.Unmarshal(body, &ejd) + return ejd, err + case string(InstanceTypeFailoverJobDetails): + var fjd FailoverJobDetails + err := json.Unmarshal(body, &fjd) + return fjd, err + case string(InstanceTypeSwitchProtectionJobDetails): + var spjd SwitchProtectionJobDetails + err := json.Unmarshal(body, &spjd) + return spjd, err + case string(InstanceTypeTestFailoverJobDetails): + var tfjd TestFailoverJobDetails + err := json.Unmarshal(body, &tfjd) + return tfjd, err + default: + var jd JobDetails + err := json.Unmarshal(body, &jd) + return jd, err + } +} +func unmarshalBasicJobDetailsArray(body []byte) ([]BasicJobDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jdArray := make([]BasicJobDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + jd, err := unmarshalBasicJobDetails(*rawMessage) + if err != nil { + return nil, err + } + jdArray[index] = jd + } + return jdArray, nil +} + +// MarshalJSON is the custom marshaler for JobDetails. +func (jd JobDetails) MarshalJSON() ([]byte, error) { + jd.InstanceType = InstanceTypeJobDetails + objectMap := make(map[string]interface{}) + if jd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = jd.AffectedObjectDetails + } + if jd.InstanceType != "" { + objectMap["instanceType"] = jd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsJobDetails() (*JobDetails, bool) { + return &jd, true +} + +// AsBasicJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &jd, true +} + +// JobEntity this class contains the minimal job details required to navigate to the desired drill down. +type JobEntity struct { + // JobID - The job id. + JobID *string `json:"jobId,omitempty"` + // JobFriendlyName - The job display name. + JobFriendlyName *string `json:"jobFriendlyName,omitempty"` + // TargetObjectID - The object id. + TargetObjectID *string `json:"targetObjectId,omitempty"` + // TargetObjectName - The object name. + TargetObjectName *string `json:"targetObjectName,omitempty"` + // TargetInstanceType - The workflow affected object type. + TargetInstanceType *string `json:"targetInstanceType,omitempty"` + // JobScenarioName - The job name. Enum type ScenarioName. + JobScenarioName *string `json:"jobScenarioName,omitempty"` +} + +// JobErrorDetails this class contains the error details per object. +type JobErrorDetails struct { + // ServiceErrorDetails - The Service error details. + ServiceErrorDetails *ServiceError `json:"serviceErrorDetails,omitempty"` + // ProviderErrorDetails - The Provider error details. + ProviderErrorDetails *ProviderError `json:"providerErrorDetails,omitempty"` + // ErrorLevel - Error level of error. + ErrorLevel *string `json:"errorLevel,omitempty"` + // CreationTime - The creation time of job error. + CreationTime *date.Time `json:"creationTime,omitempty"` + // TaskID - The Id of the task. + TaskID *string `json:"taskId,omitempty"` +} + +// JobProperties job custom data details. +type JobProperties struct { + // ActivityID - The activity id. + ActivityID *string `json:"activityId,omitempty"` + // ScenarioName - The ScenarioName. + ScenarioName *string `json:"scenarioName,omitempty"` + // FriendlyName - The DisplayName. + FriendlyName *string `json:"friendlyName,omitempty"` + // State - The status of the Job. It is one of these values - NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or Other. + State *string `json:"state,omitempty"` + // StateDescription - The description of the state of the Job. For e.g. - For Succeeded state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. + StateDescription *string `json:"stateDescription,omitempty"` + // Tasks - The tasks. + Tasks *[]ASRTask `json:"tasks,omitempty"` + // Errors - The errors. + Errors *[]JobErrorDetails `json:"errors,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // AllowedActions - The Allowed action the job. + AllowedActions *[]string `json:"allowedActions,omitempty"` + // TargetObjectID - The affected Object Id. + TargetObjectID *string `json:"targetObjectId,omitempty"` + // TargetObjectName - The name of the affected object. + TargetObjectName *string `json:"targetObjectName,omitempty"` + // TargetInstanceType - The type of the affected object which is of Microsoft.Azure.SiteRecovery.V2015_11_10.AffectedObjectType class. + TargetInstanceType *string `json:"targetInstanceType,omitempty"` + // CustomDetails - The custom job details like test failover job details. + CustomDetails BasicJobDetails `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for JobProperties struct. +func (jp *JobProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "activityId": + if v != nil { + var activityID string + err = json.Unmarshal(*v, &activityID) + if err != nil { + return err + } + jp.ActivityID = &activityID + } + case "scenarioName": + if v != nil { + var scenarioName string + err = json.Unmarshal(*v, &scenarioName) + if err != nil { + return err + } + jp.ScenarioName = &scenarioName + } + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + jp.FriendlyName = &friendlyName + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + jp.State = &state + } + case "stateDescription": + if v != nil { + var stateDescription string + err = json.Unmarshal(*v, &stateDescription) + if err != nil { + return err + } + jp.StateDescription = &stateDescription + } + case "tasks": + if v != nil { + var tasks []ASRTask + err = json.Unmarshal(*v, &tasks) + if err != nil { + return err + } + jp.Tasks = &tasks + } + case "errors": + if v != nil { + var errorsVar []JobErrorDetails + err = json.Unmarshal(*v, &errorsVar) + if err != nil { + return err + } + jp.Errors = &errorsVar + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + jp.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + jp.EndTime = &endTime + } + case "allowedActions": + if v != nil { + var allowedActions []string + err = json.Unmarshal(*v, &allowedActions) + if err != nil { + return err + } + jp.AllowedActions = &allowedActions + } + case "targetObjectId": + if v != nil { + var targetObjectID string + err = json.Unmarshal(*v, &targetObjectID) + if err != nil { + return err + } + jp.TargetObjectID = &targetObjectID + } + case "targetObjectName": + if v != nil { + var targetObjectName string + err = json.Unmarshal(*v, &targetObjectName) + if err != nil { + return err + } + jp.TargetObjectName = &targetObjectName + } + case "targetInstanceType": + if v != nil { + var targetInstanceType string + err = json.Unmarshal(*v, &targetInstanceType) + if err != nil { + return err + } + jp.TargetInstanceType = &targetInstanceType + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicJobDetails(*v) + if err != nil { + return err + } + jp.CustomDetails = customDetails + } + } + } + + return nil +} + +// JobQueryParameter query parameter to enumerate jobs. +type JobQueryParameter struct { + // StartTime - Date time to get jobs from. + StartTime *string `json:"startTime,omitempty"` + // EndTime - Date time to get jobs upto. + EndTime *string `json:"endTime,omitempty"` + // FabricID - The Id of the fabric to search jobs under. + FabricID *string `json:"fabricId,omitempty"` + // AffectedObjectTypes - The type of objects. + AffectedObjectTypes *string `json:"affectedObjectTypes,omitempty"` + // JobStatus - The states of the job to be filtered can be in. + JobStatus *string `json:"jobStatus,omitempty"` + // JobOutputType - The output type of the jobs. Possible values include: 'JSON', 'XML', 'Excel' + JobOutputType ExportJobOutputSerializationType `json:"jobOutputType,omitempty"` + // JobName - The job Name. + JobName *string `json:"jobName,omitempty"` + // TimezoneOffset - The timezone offset for the location of the request (in minutes). + TimezoneOffset *float64 `json:"timezoneOffset,omitempty"` +} + +// JobStatusEventDetails model class for event details of a job status event. +type JobStatusEventDetails struct { + // JobID - Job arm id for the event. + JobID *string `json:"jobId,omitempty"` + // JobFriendlyName - JobName for the Event. + JobFriendlyName *string `json:"jobFriendlyName,omitempty"` + // JobStatus - JobStatus for the Event. + JobStatus *string `json:"jobStatus,omitempty"` + // AffectedObjectType - AffectedObjectType for the event. + AffectedObjectType *string `json:"affectedObjectType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeEventSpecificDetails', 'InstanceTypeJobStatus' + InstanceType InstanceTypeBasicEventSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobStatusEventDetails. +func (jsed JobStatusEventDetails) MarshalJSON() ([]byte, error) { + jsed.InstanceType = InstanceTypeJobStatus + objectMap := make(map[string]interface{}) + if jsed.JobID != nil { + objectMap["jobId"] = jsed.JobID + } + if jsed.JobFriendlyName != nil { + objectMap["jobFriendlyName"] = jsed.JobFriendlyName + } + if jsed.JobStatus != nil { + objectMap["jobStatus"] = jsed.JobStatus + } + if jsed.AffectedObjectType != nil { + objectMap["affectedObjectType"] = jsed.AffectedObjectType + } + if jsed.InstanceType != "" { + objectMap["instanceType"] = jsed.InstanceType + } + return json.Marshal(objectMap) +} + +// AsJobStatusEventDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsJobStatusEventDetails() (*JobStatusEventDetails, bool) { + return &jsed, true +} + +// AsEventSpecificDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsEventSpecificDetails() (*EventSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventSpecificDetails is the BasicEventSpecificDetails implementation for JobStatusEventDetails. +func (jsed JobStatusEventDetails) AsBasicEventSpecificDetails() (BasicEventSpecificDetails, bool) { + return &jsed, true +} + +// BasicJobTaskDetails this class represents a task which is actually a workflow so that one can navigate to its +// individual drill down. +type BasicJobTaskDetails interface { + AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) + AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) + AsJobTaskDetails() (*JobTaskDetails, bool) +} + +// JobTaskDetails this class represents a task which is actually a workflow so that one can navigate to its +// individual drill down. +type JobTaskDetails struct { + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicJobTaskDetails(body []byte) (BasicJobTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeFabricReplicationGroupTaskDetails): + var frgtd FabricReplicationGroupTaskDetails + err := json.Unmarshal(body, &frgtd) + return frgtd, err + case string(InstanceTypeVirtualMachineTaskDetails): + var vmtd VirtualMachineTaskDetails + err := json.Unmarshal(body, &vmtd) + return vmtd, err + default: + var jtd JobTaskDetails + err := json.Unmarshal(body, &jtd) + return jtd, err + } +} +func unmarshalBasicJobTaskDetailsArray(body []byte) ([]BasicJobTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jtdArray := make([]BasicJobTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + jtd, err := unmarshalBasicJobTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + jtdArray[index] = jtd + } + return jtdArray, nil +} + +// MarshalJSON is the custom marshaler for JobTaskDetails. +func (jtd JobTaskDetails) MarshalJSON() ([]byte, error) { + jtd.InstanceType = InstanceTypeJobTaskDetails + objectMap := make(map[string]interface{}) + if jtd.JobTask != nil { + objectMap["jobTask"] = jtd.JobTask + } + if jtd.InstanceType != "" { + objectMap["instanceType"] = jtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return &jtd, true +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &jtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for JobTaskDetails. +func (jtd JobTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &jtd, true +} + +// KeyEncryptionKeyInfo key Encryption Key (KEK) information. +type KeyEncryptionKeyInfo struct { + // KeyIdentifier - The key URL / identifier. + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // KeyVaultResourceArmID - The KeyVault resource ARM Id for key. + KeyVaultResourceArmID *string `json:"keyVaultResourceArmId,omitempty"` +} + +// LogicalNetwork logical network data model. +type LogicalNetwork struct { + autorest.Response `json:"-"` + // Properties - The Logical Network Properties. + Properties *LogicalNetworkProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for LogicalNetwork. +func (ln LogicalNetwork) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ln.Properties != nil { + objectMap["properties"] = ln.Properties + } + if ln.Location != nil { + objectMap["location"] = ln.Location + } + return json.Marshal(objectMap) +} + +// LogicalNetworkCollection list of logical networks. +type LogicalNetworkCollection struct { + autorest.Response `json:"-"` + // Value - The Logical Networks list details. + Value *[]LogicalNetwork `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// LogicalNetworkCollectionIterator provides access to a complete listing of LogicalNetwork values. +type LogicalNetworkCollectionIterator struct { + i int + page LogicalNetworkCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *LogicalNetworkCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LogicalNetworkCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *LogicalNetworkCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter LogicalNetworkCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter LogicalNetworkCollectionIterator) Response() LogicalNetworkCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter LogicalNetworkCollectionIterator) Value() LogicalNetwork { + if !iter.page.NotDone() { + return LogicalNetwork{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the LogicalNetworkCollectionIterator type. +func NewLogicalNetworkCollectionIterator(page LogicalNetworkCollectionPage) LogicalNetworkCollectionIterator { + return LogicalNetworkCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lnc LogicalNetworkCollection) IsEmpty() bool { + return lnc.Value == nil || len(*lnc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (lnc LogicalNetworkCollection) hasNextLink() bool { + return lnc.NextLink != nil && len(*lnc.NextLink) != 0 +} + +// logicalNetworkCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lnc LogicalNetworkCollection) logicalNetworkCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !lnc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lnc.NextLink))) +} + +// LogicalNetworkCollectionPage contains a page of LogicalNetwork values. +type LogicalNetworkCollectionPage struct { + fn func(context.Context, LogicalNetworkCollection) (LogicalNetworkCollection, error) + lnc LogicalNetworkCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *LogicalNetworkCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LogicalNetworkCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.lnc) + if err != nil { + return err + } + page.lnc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *LogicalNetworkCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page LogicalNetworkCollectionPage) NotDone() bool { + return !page.lnc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page LogicalNetworkCollectionPage) Response() LogicalNetworkCollection { + return page.lnc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page LogicalNetworkCollectionPage) Values() []LogicalNetwork { + if page.lnc.IsEmpty() { + return nil + } + return *page.lnc.Value +} + +// Creates a new instance of the LogicalNetworkCollectionPage type. +func NewLogicalNetworkCollectionPage(cur LogicalNetworkCollection, getNextPage func(context.Context, LogicalNetworkCollection) (LogicalNetworkCollection, error)) LogicalNetworkCollectionPage { + return LogicalNetworkCollectionPage{ + fn: getNextPage, + lnc: cur, + } +} + +// LogicalNetworkProperties logical Network Properties. +type LogicalNetworkProperties struct { + // FriendlyName - The Friendly Name. + FriendlyName *string `json:"friendlyName,omitempty"` + // NetworkVirtualizationStatus - A value indicating whether Network Virtualization is enabled for the logical network. + NetworkVirtualizationStatus *string `json:"networkVirtualizationStatus,omitempty"` + // LogicalNetworkUsage - A value indicating whether logical network is used as private test network by test failover. + LogicalNetworkUsage *string `json:"logicalNetworkUsage,omitempty"` + // LogicalNetworkDefinitionsStatus - A value indicating whether logical network definitions are isolated. + LogicalNetworkDefinitionsStatus *string `json:"logicalNetworkDefinitionsStatus,omitempty"` +} + +// ManualActionTaskDetails this class represents the manual action task details. +type ManualActionTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // Instructions - The instructions. + Instructions *string `json:"instructions,omitempty"` + // Observation - The observation. + Observation *string `json:"observation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) MarshalJSON() ([]byte, error) { + matd.InstanceType = InstanceTypeManualActionTaskDetails + objectMap := make(map[string]interface{}) + if matd.Name != nil { + objectMap["name"] = matd.Name + } + if matd.Instructions != nil { + objectMap["instructions"] = matd.Instructions + } + if matd.Observation != nil { + objectMap["observation"] = matd.Observation + } + if matd.InstanceType != "" { + objectMap["instanceType"] = matd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return &matd, true +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ManualActionTaskDetails. +func (matd ManualActionTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &matd, true +} + +// MarsAgentDetails mars agent details. +type MarsAgentDetails struct { + // ID - READ-ONLY; The Mars agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The Mars agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The Mars agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The Mars agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the Mars agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the Mars agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for MarsAgentDetails. +func (mad MarsAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MasterTargetServer details of a Master Target Server. +type MasterTargetServer struct { + // ID - The server Id. + ID *string `json:"id,omitempty"` + // IPAddress - The IP address of the server. + IPAddress *string `json:"ipAddress,omitempty"` + // Name - The server name. + Name *string `json:"name,omitempty"` + // OsType - The OS type of the server. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The version of the scout component on the server. + AgentVersion *string `json:"agentVersion,omitempty"` + // LastHeartbeat - The last heartbeat received from the server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // RetentionVolumes - The retention volumes of Master target Server. + RetentionVolumes *[]RetentionVolume `json:"retentionVolumes,omitempty"` + // DataStores - The list of data stores in the fabric. + DataStores *[]DataStore `json:"dataStores,omitempty"` + // ValidationErrors - Validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // HealthErrors - Health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // DiskCount - Disk count of the master target. + DiskCount *int32 `json:"diskCount,omitempty"` + // OsVersion - OS Version of the master target. + OsVersion *string `json:"osVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // MarsAgentVersion - MARS agent version. + MarsAgentVersion *string `json:"marsAgentVersion,omitempty"` + // MarsAgentExpiryDate - MARS agent expiry date. + MarsAgentExpiryDate *date.Time `json:"marsAgentExpiryDate,omitempty"` + // AgentVersionDetails - Agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // MarsAgentVersionDetails - Mars agent version details. + MarsAgentVersionDetails *VersionDetails `json:"marsAgentVersionDetails,omitempty"` +} + +// MigrateInput input for migrate. +type MigrateInput struct { + // Properties - Migrate input properties. + Properties *MigrateInputProperties `json:"properties,omitempty"` +} + +// MigrateInputProperties migrate input properties. +type MigrateInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicMigrateProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for MigrateInputProperties struct. +func (mip *MigrateInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicMigrateProviderSpecificInput(*v) + if err != nil { + return err + } + mip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicMigrateProviderSpecificInput migrate provider specific input. +type BasicMigrateProviderSpecificInput interface { + AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) + AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) +} + +// MigrateProviderSpecificInput migrate provider specific input. +type MigrateProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput', 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicMigrateProviderSpecificInput(body []byte) (BasicMigrateProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt): + var vmcmi VMwareCbtMigrateInput + err := json.Unmarshal(body, &vmcmi) + return vmcmi, err + default: + var mpsi MigrateProviderSpecificInput + err := json.Unmarshal(body, &mpsi) + return mpsi, err + } +} +func unmarshalBasicMigrateProviderSpecificInputArray(body []byte) ([]BasicMigrateProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + mpsiArray := make([]BasicMigrateProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + mpsi, err := unmarshalBasicMigrateProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + mpsiArray[index] = mpsi + } + return mpsiArray, nil +} + +// MarshalJSON is the custom marshaler for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) MarshalJSON() ([]byte, error) { + mpsi.InstanceType = InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput + objectMap := make(map[string]interface{}) + if mpsi.InstanceType != "" { + objectMap["instanceType"] = mpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrateInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) { + return nil, false +} + +// AsMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) { + return &mpsi, true +} + +// AsBasicMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for MigrateProviderSpecificInput. +func (mpsi MigrateProviderSpecificInput) AsBasicMigrateProviderSpecificInput() (BasicMigrateProviderSpecificInput, bool) { + return &mpsi, true +} + +// MigrationItem migration item. +type MigrationItem struct { + autorest.Response `json:"-"` + // Properties - The migration item properties. + Properties *MigrationItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationItem. +func (mi MigrationItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mi.Properties != nil { + objectMap["properties"] = mi.Properties + } + if mi.Location != nil { + objectMap["location"] = mi.Location + } + return json.Marshal(objectMap) +} + +// MigrationItemCollection migration item collection. +type MigrationItemCollection struct { + autorest.Response `json:"-"` + // Value - The list of migration items. + Value *[]MigrationItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MigrationItemCollectionIterator provides access to a complete listing of MigrationItem values. +type MigrationItemCollectionIterator struct { + i int + page MigrationItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *MigrationItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *MigrationItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MigrationItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter MigrationItemCollectionIterator) Response() MigrationItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter MigrationItemCollectionIterator) Value() MigrationItem { + if !iter.page.NotDone() { + return MigrationItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the MigrationItemCollectionIterator type. +func NewMigrationItemCollectionIterator(page MigrationItemCollectionPage) MigrationItemCollectionIterator { + return MigrationItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mic MigrationItemCollection) IsEmpty() bool { + return mic.Value == nil || len(*mic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mic MigrationItemCollection) hasNextLink() bool { + return mic.NextLink != nil && len(*mic.NextLink) != 0 +} + +// migrationItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mic MigrationItemCollection) migrationItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !mic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mic.NextLink))) +} + +// MigrationItemCollectionPage contains a page of MigrationItem values. +type MigrationItemCollectionPage struct { + fn func(context.Context, MigrationItemCollection) (MigrationItemCollection, error) + mic MigrationItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *MigrationItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.mic) + if err != nil { + return err + } + page.mic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *MigrationItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MigrationItemCollectionPage) NotDone() bool { + return !page.mic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MigrationItemCollectionPage) Response() MigrationItemCollection { + return page.mic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MigrationItemCollectionPage) Values() []MigrationItem { + if page.mic.IsEmpty() { + return nil + } + return *page.mic.Value +} + +// Creates a new instance of the MigrationItemCollectionPage type. +func NewMigrationItemCollectionPage(cur MigrationItemCollection, getNextPage func(context.Context, MigrationItemCollection) (MigrationItemCollection, error)) MigrationItemCollectionPage { + return MigrationItemCollectionPage{ + fn: getNextPage, + mic: cur, + } +} + +// MigrationItemProperties migration item properties. +type MigrationItemProperties struct { + // MachineName - READ-ONLY; The on-premise virtual machine name. + MachineName *string `json:"machineName,omitempty"` + // PolicyID - READ-ONLY; The ARM Id of policy governing this item. + PolicyID *string `json:"policyId,omitempty"` + // PolicyFriendlyName - READ-ONLY; The name of policy governing this item. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` + // MigrationState - READ-ONLY; The migration status. Possible values include: 'MigrationStateNone', 'MigrationStateEnableMigrationInProgress', 'MigrationStateEnableMigrationFailed', 'MigrationStateDisableMigrationInProgress', 'MigrationStateDisableMigrationFailed', 'MigrationStateInitialSeedingInProgress', 'MigrationStateInitialSeedingFailed', 'MigrationStateReplicating', 'MigrationStateMigrationInProgress', 'MigrationStateMigrationSucceeded', 'MigrationStateMigrationFailed' + MigrationState MigrationState `json:"migrationState,omitempty"` + // MigrationStateDescription - READ-ONLY; The migration state description. + MigrationStateDescription *string `json:"migrationStateDescription,omitempty"` + // LastTestMigrationTime - READ-ONLY; The last test migration time. + LastTestMigrationTime *date.Time `json:"lastTestMigrationTime,omitempty"` + // LastTestMigrationStatus - READ-ONLY; The status of the last test migration. + LastTestMigrationStatus *string `json:"lastTestMigrationStatus,omitempty"` + // TestMigrateState - READ-ONLY; The test migrate state. Possible values include: 'TestMigrationStateNone', 'TestMigrationStateTestMigrationInProgress', 'TestMigrationStateTestMigrationSucceeded', 'TestMigrationStateTestMigrationFailed', 'TestMigrationStateTestMigrationCleanupInProgress' + TestMigrateState TestMigrationState `json:"testMigrateState,omitempty"` + // TestMigrateStateDescription - READ-ONLY; The test migrate state description. + TestMigrateStateDescription *string `json:"testMigrateStateDescription,omitempty"` + // Health - READ-ONLY; The consolidated health. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The list of health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // AllowedOperations - READ-ONLY; The allowed operations on the migration item based on the current migration state of the item. + AllowedOperations *[]MigrationItemOperation `json:"allowedOperations,omitempty"` + // CurrentJob - READ-ONLY; The current job details. + CurrentJob *CurrentJobDetails `json:"currentJob,omitempty"` + // EventCorrelationID - READ-ONLY; The correlation Id for events associated with this migration item. + EventCorrelationID *string `json:"eventCorrelationId,omitempty"` + // ProviderSpecificDetails - The migration provider custom settings. + ProviderSpecificDetails BasicMigrationProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationItemProperties. +func (mip MigrationItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["providerSpecificDetails"] = mip.ProviderSpecificDetails + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MigrationItemProperties struct. +func (mip *MigrationItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "machineName": + if v != nil { + var machineName string + err = json.Unmarshal(*v, &machineName) + if err != nil { + return err + } + mip.MachineName = &machineName + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + mip.PolicyID = &policyID + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + mip.PolicyFriendlyName = &policyFriendlyName + } + case "migrationState": + if v != nil { + var migrationState MigrationState + err = json.Unmarshal(*v, &migrationState) + if err != nil { + return err + } + mip.MigrationState = migrationState + } + case "migrationStateDescription": + if v != nil { + var migrationStateDescription string + err = json.Unmarshal(*v, &migrationStateDescription) + if err != nil { + return err + } + mip.MigrationStateDescription = &migrationStateDescription + } + case "lastTestMigrationTime": + if v != nil { + var lastTestMigrationTime date.Time + err = json.Unmarshal(*v, &lastTestMigrationTime) + if err != nil { + return err + } + mip.LastTestMigrationTime = &lastTestMigrationTime + } + case "lastTestMigrationStatus": + if v != nil { + var lastTestMigrationStatus string + err = json.Unmarshal(*v, &lastTestMigrationStatus) + if err != nil { + return err + } + mip.LastTestMigrationStatus = &lastTestMigrationStatus + } + case "testMigrateState": + if v != nil { + var testMigrateState TestMigrationState + err = json.Unmarshal(*v, &testMigrateState) + if err != nil { + return err + } + mip.TestMigrateState = testMigrateState + } + case "testMigrateStateDescription": + if v != nil { + var testMigrateStateDescription string + err = json.Unmarshal(*v, &testMigrateStateDescription) + if err != nil { + return err + } + mip.TestMigrateStateDescription = &testMigrateStateDescription + } + case "health": + if v != nil { + var health ProtectionHealth + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + mip.Health = health + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + mip.HealthErrors = &healthErrors + } + case "allowedOperations": + if v != nil { + var allowedOperations []MigrationItemOperation + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + mip.AllowedOperations = &allowedOperations + } + case "currentJob": + if v != nil { + var currentJob CurrentJobDetails + err = json.Unmarshal(*v, ¤tJob) + if err != nil { + return err + } + mip.CurrentJob = ¤tJob + } + case "eventCorrelationId": + if v != nil { + var eventCorrelationID string + err = json.Unmarshal(*v, &eventCorrelationID) + if err != nil { + return err + } + mip.EventCorrelationID = &eventCorrelationID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicMigrationProviderSpecificSettings(*v) + if err != nil { + return err + } + mip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// MigrationItemsQueryParameter query parameter to enumerate migration items. +type MigrationItemsQueryParameter struct { + // SourceFabricName - The source fabric name filter. + SourceFabricName *string `json:"sourceFabricName,omitempty"` + // SourceContainerName - The source container name filter. + SourceContainerName *string `json:"sourceContainerName,omitempty"` + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` +} + +// BasicMigrationProviderSpecificSettings migration provider specific settings. +type BasicMigrationProviderSpecificSettings interface { + AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) + AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) +} + +// MigrationProviderSpecificSettings migration provider specific settings. +type MigrationProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings', 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicMigrationProviderSpecificSettings(body []byte) (BasicMigrationProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt): + var vmcmd VMwareCbtMigrationDetails + err := json.Unmarshal(body, &vmcmd) + return vmcmd, err + default: + var mpss MigrationProviderSpecificSettings + err := json.Unmarshal(body, &mpss) + return mpss, err + } +} +func unmarshalBasicMigrationProviderSpecificSettingsArray(body []byte) ([]BasicMigrationProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + mpssArray := make([]BasicMigrationProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + mpss, err := unmarshalBasicMigrationProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + mpssArray[index] = mpss + } + return mpssArray, nil +} + +// MarshalJSON is the custom marshaler for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) MarshalJSON() ([]byte, error) { + mpss.InstanceType = InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings + objectMap := make(map[string]interface{}) + if mpss.InstanceType != "" { + objectMap["instanceType"] = mpss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrationDetails is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) { + return nil, false +} + +// AsMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) { + return &mpss, true +} + +// AsBasicMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for MigrationProviderSpecificSettings. +func (mpss MigrationProviderSpecificSettings) AsBasicMigrationProviderSpecificSettings() (BasicMigrationProviderSpecificSettings, bool) { + return &mpss, true +} + +// MigrationRecoveryPoint recovery point for a migration item. +type MigrationRecoveryPoint struct { + autorest.Response `json:"-"` + // Properties - Recovery point properties. + Properties *MigrationRecoveryPointProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationRecoveryPoint. +func (mrp MigrationRecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mrp.Properties != nil { + objectMap["properties"] = mrp.Properties + } + if mrp.Location != nil { + objectMap["location"] = mrp.Location + } + return json.Marshal(objectMap) +} + +// MigrationRecoveryPointCollection collection of migration recovery points. +type MigrationRecoveryPointCollection struct { + autorest.Response `json:"-"` + // Value - The migration recovery point details. + Value *[]MigrationRecoveryPoint `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MigrationRecoveryPointCollectionIterator provides access to a complete listing of MigrationRecoveryPoint +// values. +type MigrationRecoveryPointCollectionIterator struct { + i int + page MigrationRecoveryPointCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *MigrationRecoveryPointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *MigrationRecoveryPointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MigrationRecoveryPointCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter MigrationRecoveryPointCollectionIterator) Response() MigrationRecoveryPointCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter MigrationRecoveryPointCollectionIterator) Value() MigrationRecoveryPoint { + if !iter.page.NotDone() { + return MigrationRecoveryPoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the MigrationRecoveryPointCollectionIterator type. +func NewMigrationRecoveryPointCollectionIterator(page MigrationRecoveryPointCollectionPage) MigrationRecoveryPointCollectionIterator { + return MigrationRecoveryPointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mrpc MigrationRecoveryPointCollection) IsEmpty() bool { + return mrpc.Value == nil || len(*mrpc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mrpc MigrationRecoveryPointCollection) hasNextLink() bool { + return mrpc.NextLink != nil && len(*mrpc.NextLink) != 0 +} + +// migrationRecoveryPointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mrpc MigrationRecoveryPointCollection) migrationRecoveryPointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !mrpc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mrpc.NextLink))) +} + +// MigrationRecoveryPointCollectionPage contains a page of MigrationRecoveryPoint values. +type MigrationRecoveryPointCollectionPage struct { + fn func(context.Context, MigrationRecoveryPointCollection) (MigrationRecoveryPointCollection, error) + mrpc MigrationRecoveryPointCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *MigrationRecoveryPointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MigrationRecoveryPointCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.mrpc) + if err != nil { + return err + } + page.mrpc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *MigrationRecoveryPointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MigrationRecoveryPointCollectionPage) NotDone() bool { + return !page.mrpc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MigrationRecoveryPointCollectionPage) Response() MigrationRecoveryPointCollection { + return page.mrpc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MigrationRecoveryPointCollectionPage) Values() []MigrationRecoveryPoint { + if page.mrpc.IsEmpty() { + return nil + } + return *page.mrpc.Value +} + +// Creates a new instance of the MigrationRecoveryPointCollectionPage type. +func NewMigrationRecoveryPointCollectionPage(cur MigrationRecoveryPointCollection, getNextPage func(context.Context, MigrationRecoveryPointCollection) (MigrationRecoveryPointCollection, error)) MigrationRecoveryPointCollectionPage { + return MigrationRecoveryPointCollectionPage{ + fn: getNextPage, + mrpc: cur, + } +} + +// MigrationRecoveryPointProperties migration item recovery point properties. +type MigrationRecoveryPointProperties struct { + // RecoveryPointTime - READ-ONLY; The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointType - READ-ONLY; The recovery point type. Possible values include: 'MigrationRecoveryPointTypeNotSpecified', 'MigrationRecoveryPointTypeApplicationConsistent', 'MigrationRecoveryPointTypeCrashConsistent' + RecoveryPointType MigrationRecoveryPointType `json:"recoveryPointType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrationRecoveryPointProperties. +func (mrpp MigrationRecoveryPointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MobilityServiceUpdate the Mobility Service update details. +type MobilityServiceUpdate struct { + // Version - The version of the latest update. + Version *string `json:"version,omitempty"` + // RebootStatus - The reboot status of the update - whether it is required or not. + RebootStatus *string `json:"rebootStatus,omitempty"` + // OsType - The OS type. + OsType *string `json:"osType,omitempty"` +} + +// Network network model. +type Network struct { + autorest.Response `json:"-"` + // Properties - The Network Properties. + Properties *NetworkProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Network. +func (n Network) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if n.Properties != nil { + objectMap["properties"] = n.Properties + } + if n.Location != nil { + objectMap["location"] = n.Location + } + return json.Marshal(objectMap) +} + +// NetworkCollection list of networks. +type NetworkCollection struct { + autorest.Response `json:"-"` + // Value - The Networks list details. + Value *[]Network `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// NetworkCollectionIterator provides access to a complete listing of Network values. +type NetworkCollectionIterator struct { + i int + page NetworkCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *NetworkCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *NetworkCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter NetworkCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter NetworkCollectionIterator) Response() NetworkCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter NetworkCollectionIterator) Value() Network { + if !iter.page.NotDone() { + return Network{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the NetworkCollectionIterator type. +func NewNetworkCollectionIterator(page NetworkCollectionPage) NetworkCollectionIterator { + return NetworkCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (nc NetworkCollection) IsEmpty() bool { + return nc.Value == nil || len(*nc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (nc NetworkCollection) hasNextLink() bool { + return nc.NextLink != nil && len(*nc.NextLink) != 0 +} + +// networkCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (nc NetworkCollection) networkCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !nc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(nc.NextLink))) +} + +// NetworkCollectionPage contains a page of Network values. +type NetworkCollectionPage struct { + fn func(context.Context, NetworkCollection) (NetworkCollection, error) + nc NetworkCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *NetworkCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.nc) + if err != nil { + return err + } + page.nc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *NetworkCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page NetworkCollectionPage) NotDone() bool { + return !page.nc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page NetworkCollectionPage) Response() NetworkCollection { + return page.nc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page NetworkCollectionPage) Values() []Network { + if page.nc.IsEmpty() { + return nil + } + return *page.nc.Value +} + +// Creates a new instance of the NetworkCollectionPage type. +func NewNetworkCollectionPage(cur NetworkCollection, getNextPage func(context.Context, NetworkCollection) (NetworkCollection, error)) NetworkCollectionPage { + return NetworkCollectionPage{ + fn: getNextPage, + nc: cur, + } +} + +// NetworkMapping network Mapping model. Ideally it should have been possible to inherit this class from +// prev version in InheritedModels as long as there is no difference in structure or method signature. +// Since there were no base Models for certain fields and methods viz NetworkMappingProperties and Load +// with required return type, the class has been introduced in its entirety with references to base models +// to facilitate extensions in subsequent versions. +type NetworkMapping struct { + autorest.Response `json:"-"` + // Properties - The Network Mapping Properties. + Properties *NetworkMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for NetworkMapping. +func (nm NetworkMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if nm.Properties != nil { + objectMap["properties"] = nm.Properties + } + if nm.Location != nil { + objectMap["location"] = nm.Location + } + return json.Marshal(objectMap) +} + +// NetworkMappingCollection list of network mappings. As with NetworkMapping, it should be possible to +// reuse a prev version of this class. It doesn't seem likely this class could be anything more than a +// slightly bespoke collection of NetworkMapping. Hence it makes sense to override Load with +// Base.NetworkMapping instead of existing CurrentVersion.NetworkMapping. +type NetworkMappingCollection struct { + autorest.Response `json:"-"` + // Value - The Network Mappings list. + Value *[]NetworkMapping `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// NetworkMappingCollectionIterator provides access to a complete listing of NetworkMapping values. +type NetworkMappingCollectionIterator struct { + i int + page NetworkMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *NetworkMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *NetworkMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter NetworkMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter NetworkMappingCollectionIterator) Response() NetworkMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter NetworkMappingCollectionIterator) Value() NetworkMapping { + if !iter.page.NotDone() { + return NetworkMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the NetworkMappingCollectionIterator type. +func NewNetworkMappingCollectionIterator(page NetworkMappingCollectionPage) NetworkMappingCollectionIterator { + return NetworkMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (nmc NetworkMappingCollection) IsEmpty() bool { + return nmc.Value == nil || len(*nmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (nmc NetworkMappingCollection) hasNextLink() bool { + return nmc.NextLink != nil && len(*nmc.NextLink) != 0 +} + +// networkMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (nmc NetworkMappingCollection) networkMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !nmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(nmc.NextLink))) +} + +// NetworkMappingCollectionPage contains a page of NetworkMapping values. +type NetworkMappingCollectionPage struct { + fn func(context.Context, NetworkMappingCollection) (NetworkMappingCollection, error) + nmc NetworkMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *NetworkMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.nmc) + if err != nil { + return err + } + page.nmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *NetworkMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page NetworkMappingCollectionPage) NotDone() bool { + return !page.nmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page NetworkMappingCollectionPage) Response() NetworkMappingCollection { + return page.nmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page NetworkMappingCollectionPage) Values() []NetworkMapping { + if page.nmc.IsEmpty() { + return nil + } + return *page.nmc.Value +} + +// Creates a new instance of the NetworkMappingCollectionPage type. +func NewNetworkMappingCollectionPage(cur NetworkMappingCollection, getNextPage func(context.Context, NetworkMappingCollection) (NetworkMappingCollection, error)) NetworkMappingCollectionPage { + return NetworkMappingCollectionPage{ + fn: getNextPage, + nmc: cur, + } +} + +// BasicNetworkMappingFabricSpecificSettings network Mapping fabric specific settings. +type BasicNetworkMappingFabricSpecificSettings interface { + AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) + AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) + AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) + AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) +} + +// NetworkMappingFabricSpecificSettings network Mapping fabric specific settings. +type NetworkMappingFabricSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicNetworkMappingFabricSpecificSettings(body []byte) (BasicNetworkMappingFabricSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure): + var atanms AzureToAzureNetworkMappingSettings + err := json.Unmarshal(body, &atanms) + return atanms, err + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure): + var vtanms VmmToAzureNetworkMappingSettings + err := json.Unmarshal(body, &vtanms) + return vtanms, err + case string(InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm): + var vtvnms VmmToVmmNetworkMappingSettings + err := json.Unmarshal(body, &vtvnms) + return vtvnms, err + default: + var nmfss NetworkMappingFabricSpecificSettings + err := json.Unmarshal(body, &nmfss) + return nmfss, err + } +} +func unmarshalBasicNetworkMappingFabricSpecificSettingsArray(body []byte) ([]BasicNetworkMappingFabricSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + nmfssArray := make([]BasicNetworkMappingFabricSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + nmfss, err := unmarshalBasicNetworkMappingFabricSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + nmfssArray[index] = nmfss + } + return nmfssArray, nil +} + +// MarshalJSON is the custom marshaler for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) MarshalJSON() ([]byte, error) { + nmfss.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings + objectMap := make(map[string]interface{}) + if nmfss.InstanceType != "" { + objectMap["instanceType"] = nmfss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return &nmfss, true +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for NetworkMappingFabricSpecificSettings. +func (nmfss NetworkMappingFabricSpecificSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &nmfss, true +} + +// NetworkMappingProperties network Mapping Properties. +type NetworkMappingProperties struct { + // State - The pairing state for network mapping. + State *string `json:"state,omitempty"` + // PrimaryNetworkFriendlyName - The primary network friendly name. + PrimaryNetworkFriendlyName *string `json:"primaryNetworkFriendlyName,omitempty"` + // PrimaryNetworkID - The primary network id for network mapping. + PrimaryNetworkID *string `json:"primaryNetworkId,omitempty"` + // PrimaryFabricFriendlyName - The primary fabric friendly name. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // RecoveryNetworkFriendlyName - The recovery network friendly name. + RecoveryNetworkFriendlyName *string `json:"recoveryNetworkFriendlyName,omitempty"` + // RecoveryNetworkID - The recovery network id for network mapping. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // RecoveryFabricArmID - The recovery fabric ARM id. + RecoveryFabricArmID *string `json:"recoveryFabricArmId,omitempty"` + // RecoveryFabricFriendlyName - The recovery fabric friendly name. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // FabricSpecificSettings - The fabric specific settings. + FabricSpecificSettings BasicNetworkMappingFabricSpecificSettings `json:"fabricSpecificSettings,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for NetworkMappingProperties struct. +func (nmp *NetworkMappingProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + nmp.State = &state + } + case "primaryNetworkFriendlyName": + if v != nil { + var primaryNetworkFriendlyName string + err = json.Unmarshal(*v, &primaryNetworkFriendlyName) + if err != nil { + return err + } + nmp.PrimaryNetworkFriendlyName = &primaryNetworkFriendlyName + } + case "primaryNetworkId": + if v != nil { + var primaryNetworkID string + err = json.Unmarshal(*v, &primaryNetworkID) + if err != nil { + return err + } + nmp.PrimaryNetworkID = &primaryNetworkID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + nmp.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "recoveryNetworkFriendlyName": + if v != nil { + var recoveryNetworkFriendlyName string + err = json.Unmarshal(*v, &recoveryNetworkFriendlyName) + if err != nil { + return err + } + nmp.RecoveryNetworkFriendlyName = &recoveryNetworkFriendlyName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + nmp.RecoveryNetworkID = &recoveryNetworkID + } + case "recoveryFabricArmId": + if v != nil { + var recoveryFabricArmID string + err = json.Unmarshal(*v, &recoveryFabricArmID) + if err != nil { + return err + } + nmp.RecoveryFabricArmID = &recoveryFabricArmID + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + nmp.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "fabricSpecificSettings": + if v != nil { + fabricSpecificSettings, err := unmarshalBasicNetworkMappingFabricSpecificSettings(*v) + if err != nil { + return err + } + nmp.FabricSpecificSettings = fabricSpecificSettings + } + } + } + + return nil +} + +// NetworkProperties network Properties. +type NetworkProperties struct { + // FabricType - The Fabric Type. + FabricType *string `json:"fabricType,omitempty"` + // Subnets - The List of subnets. + Subnets *[]Subnet `json:"subnets,omitempty"` + // FriendlyName - The Friendly Name. + FriendlyName *string `json:"friendlyName,omitempty"` + // NetworkType - The Network Type. + NetworkType *string `json:"networkType,omitempty"` +} + +// NewProtectionProfile new Protection profile input. +type NewProtectionProfile struct { + // PolicyName - The protection profile input. + PolicyName *string `json:"policyName,omitempty"` + // RecoveryPointHistory - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistory *int32 `json:"recoveryPointHistory,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // MultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: 'Enable', 'Disable' + MultiVMSyncStatus SetMultiVMSyncStatus `json:"multiVmSyncStatus,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for NewProtectionProfile. +func (npp NewProtectionProfile) MarshalJSON() ([]byte, error) { + npp.ResourceType = ResourceTypeNew + objectMap := make(map[string]interface{}) + if npp.PolicyName != nil { + objectMap["policyName"] = npp.PolicyName + } + if npp.RecoveryPointHistory != nil { + objectMap["recoveryPointHistory"] = npp.RecoveryPointHistory + } + if npp.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = npp.CrashConsistentFrequencyInMinutes + } + if npp.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = npp.AppConsistentFrequencyInMinutes + } + if npp.MultiVMSyncStatus != "" { + objectMap["multiVmSyncStatus"] = npp.MultiVMSyncStatus + } + if npp.ResourceType != "" { + objectMap["resourceType"] = npp.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return nil, false +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return &npp, true +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return nil, false +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for NewProtectionProfile. +func (npp NewProtectionProfile) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &npp, true +} + +// NewRecoveryVirtualNetwork recovery virtual network input to create new virtual network from given source +// network. +type NewRecoveryVirtualNetwork struct { + // RecoveryVirtualNetworkResourceGroupName - The name of the resource group to be used to create the recovery virtual network. If absent, target network would be created in the same resource group as target VM. + RecoveryVirtualNetworkResourceGroupName *string `json:"recoveryVirtualNetworkResourceGroupName,omitempty"` + // RecoveryVirtualNetworkName - The recovery virtual network name. + RecoveryVirtualNetworkName *string `json:"recoveryVirtualNetworkName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) MarshalJSON() ([]byte, error) { + nrvn.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew + objectMap := make(map[string]interface{}) + if nrvn.RecoveryVirtualNetworkResourceGroupName != nil { + objectMap["recoveryVirtualNetworkResourceGroupName"] = nrvn.RecoveryVirtualNetworkResourceGroupName + } + if nrvn.RecoveryVirtualNetworkName != nil { + objectMap["recoveryVirtualNetworkName"] = nrvn.RecoveryVirtualNetworkName + } + if nrvn.ResourceType != "" { + objectMap["resourceType"] = nrvn.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return &nrvn, true +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return nil, false +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for NewRecoveryVirtualNetwork. +func (nrvn NewRecoveryVirtualNetwork) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &nrvn, true +} + +// OperationsDiscovery operations discovery class. +type OperationsDiscovery struct { + // Name - Name of the API. The name of the operation being performed on this particular object. It should match the action name that appears in RBAC / the event service. Examples of operations include: * Microsoft.Compute/virtualMachine/capture/action * Microsoft.Compute/virtualMachine/restart/action * Microsoft.Compute/virtualMachine/write * Microsoft.Compute/virtualMachine/read * Microsoft.Compute/virtualMachine/delete Each action should include, in order: (1) Resource Provider Namespace (2) Type hierarchy for which the action applies (e.g. server/databases for a SQL Azure database) (3) Read, Write, Action or Delete indicating which type applies. If it is a PUT/PATCH on a collection or named value, Write should be used. If it is a GET, Read should be used. If it is a DELETE, Delete should be used. If it is a POST, Action should be used. As a note: all resource providers would need to include the "{Resource Provider Namespace}/register/action" operation in their response. This API is used to register for their service, and should include details about the operation (e.g. a localized name for the resource provider + any special considerations like PII release). + Name *string `json:"name,omitempty"` + // Display - Object type. + Display *Display `json:"display,omitempty"` + // Origin - Origin. The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. Default value is "user,system". + Origin *string `json:"origin,omitempty"` + // Properties - Properties. Reserved for future use. + Properties interface{} `json:"properties,omitempty"` +} + +// OperationsDiscoveryCollection collection of ClientDiscovery details. +type OperationsDiscoveryCollection struct { + autorest.Response `json:"-"` + // Value - The ClientDiscovery details. + Value *[]OperationsDiscovery `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationsDiscoveryCollectionIterator provides access to a complete listing of OperationsDiscovery +// values. +type OperationsDiscoveryCollectionIterator struct { + i int + page OperationsDiscoveryCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationsDiscoveryCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsDiscoveryCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationsDiscoveryCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationsDiscoveryCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationsDiscoveryCollectionIterator) Response() OperationsDiscoveryCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationsDiscoveryCollectionIterator) Value() OperationsDiscovery { + if !iter.page.NotDone() { + return OperationsDiscovery{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationsDiscoveryCollectionIterator type. +func NewOperationsDiscoveryCollectionIterator(page OperationsDiscoveryCollectionPage) OperationsDiscoveryCollectionIterator { + return OperationsDiscoveryCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (odc OperationsDiscoveryCollection) IsEmpty() bool { + return odc.Value == nil || len(*odc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (odc OperationsDiscoveryCollection) hasNextLink() bool { + return odc.NextLink != nil && len(*odc.NextLink) != 0 +} + +// operationsDiscoveryCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (odc OperationsDiscoveryCollection) operationsDiscoveryCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !odc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(odc.NextLink))) +} + +// OperationsDiscoveryCollectionPage contains a page of OperationsDiscovery values. +type OperationsDiscoveryCollectionPage struct { + fn func(context.Context, OperationsDiscoveryCollection) (OperationsDiscoveryCollection, error) + odc OperationsDiscoveryCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationsDiscoveryCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsDiscoveryCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.odc) + if err != nil { + return err + } + page.odc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationsDiscoveryCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationsDiscoveryCollectionPage) NotDone() bool { + return !page.odc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationsDiscoveryCollectionPage) Response() OperationsDiscoveryCollection { + return page.odc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationsDiscoveryCollectionPage) Values() []OperationsDiscovery { + if page.odc.IsEmpty() { + return nil + } + return *page.odc.Value +} + +// Creates a new instance of the OperationsDiscoveryCollectionPage type. +func NewOperationsDiscoveryCollectionPage(cur OperationsDiscoveryCollection, getNextPage func(context.Context, OperationsDiscoveryCollection) (OperationsDiscoveryCollection, error)) OperationsDiscoveryCollectionPage { + return OperationsDiscoveryCollectionPage{ + fn: getNextPage, + odc: cur, + } +} + +// OSDetails disk Details. +type OSDetails struct { + // OsType - VM Disk details. + OsType *string `json:"osType,omitempty"` + // ProductType - Product type. + ProductType *string `json:"productType,omitempty"` + // OsEdition - The OSEdition. + OsEdition *string `json:"osEdition,omitempty"` + // OSVersion - The OS Version. + OSVersion *string `json:"oSVersion,omitempty"` + // OSMajorVersion - The OS Major Version. + OSMajorVersion *string `json:"oSMajorVersion,omitempty"` + // OSMinorVersion - The OS Minor Version. + OSMinorVersion *string `json:"oSMinorVersion,omitempty"` +} + +// OSDiskDetails details of the OS Disk. +type OSDiskDetails struct { + // OsVhdID - The id of the disk containing the OS. + OsVhdID *string `json:"osVhdId,omitempty"` + // OsType - The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // VhdName - The OS disk VHD name. + VhdName *string `json:"vhdName,omitempty"` +} + +// OSVersionWrapper wrapper model for OSVersion to include version and service pack info. +type OSVersionWrapper struct { + // Version - The version. + Version *string `json:"version,omitempty"` + // ServicePack - The service pack. + ServicePack *string `json:"servicePack,omitempty"` +} + +// PlannedFailoverInput input definition for planned failover. +type PlannedFailoverInput struct { + // Properties - Planned failover input properties. + Properties *PlannedFailoverInputProperties `json:"properties,omitempty"` +} + +// PlannedFailoverInputProperties input definition for planned failover input properties. +type PlannedFailoverInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicPlannedFailoverProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for PlannedFailoverInputProperties struct. +func (pfip *PlannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + pfip.FailoverDirection = &failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(*v) + if err != nil { + return err + } + pfip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicPlannedFailoverProviderSpecificFailoverInput provider specific failover input. +type BasicPlannedFailoverProviderSpecificFailoverInput interface { + AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) + AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) + AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) + AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) +} + +// PlannedFailoverProviderSpecificFailoverInput provider specific failover input. +type PlannedFailoverProviderSpecificFailoverInput struct { + // InstanceType - Possible values include: 'InstanceTypePlannedFailoverProviderSpecificFailoverInput', 'InstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeHyperVReplicaAzure', 'InstanceTypeInMageRcmFailback' + InstanceType InstanceTypeBasicPlannedFailoverProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(body []byte) (BasicPlannedFailoverProviderSpecificFailoverInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeHyperVReplicaAzureFailback): + var hvrafpi HyperVReplicaAzureFailbackProviderInput + err := json.Unmarshal(body, &hvrafpi) + return hvrafpi, err + case string(InstanceTypeHyperVReplicaAzure): + var hvrapfpi HyperVReplicaAzurePlannedFailoverProviderInput + err := json.Unmarshal(body, &hvrapfpi) + return hvrapfpi, err + case string(InstanceTypeInMageRcmFailback): + var imrfpfpi InMageRcmFailbackPlannedFailoverProviderInput + err := json.Unmarshal(body, &imrfpfpi) + return imrfpfpi, err + default: + var pfpsfi PlannedFailoverProviderSpecificFailoverInput + err := json.Unmarshal(body, &pfpsfi) + return pfpsfi, err + } +} +func unmarshalBasicPlannedFailoverProviderSpecificFailoverInputArray(body []byte) ([]BasicPlannedFailoverProviderSpecificFailoverInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pfpsfiArray := make([]BasicPlannedFailoverProviderSpecificFailoverInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pfpsfi, err := unmarshalBasicPlannedFailoverProviderSpecificFailoverInput(*rawMessage) + if err != nil { + return nil, err + } + pfpsfiArray[index] = pfpsfi + } + return pfpsfiArray, nil +} + +// MarshalJSON is the custom marshaler for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) MarshalJSON() ([]byte, error) { + pfpsfi.InstanceType = InstanceTypePlannedFailoverProviderSpecificFailoverInput + objectMap := make(map[string]interface{}) + if pfpsfi.InstanceType != "" { + objectMap["instanceType"] = pfpsfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVReplicaAzureFailbackProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsHyperVReplicaAzureFailbackProviderInput() (*HyperVReplicaAzureFailbackProviderInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsHyperVReplicaAzurePlannedFailoverProviderInput() (*HyperVReplicaAzurePlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPlannedFailoverProviderInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsInMageRcmFailbackPlannedFailoverProviderInput() (*InMageRcmFailbackPlannedFailoverProviderInput, bool) { + return nil, false +} + +// AsPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsPlannedFailoverProviderSpecificFailoverInput() (*PlannedFailoverProviderSpecificFailoverInput, bool) { + return &pfpsfi, true +} + +// AsBasicPlannedFailoverProviderSpecificFailoverInput is the BasicPlannedFailoverProviderSpecificFailoverInput implementation for PlannedFailoverProviderSpecificFailoverInput. +func (pfpsfi PlannedFailoverProviderSpecificFailoverInput) AsBasicPlannedFailoverProviderSpecificFailoverInput() (BasicPlannedFailoverProviderSpecificFailoverInput, bool) { + return &pfpsfi, true +} + +// Policy protection profile details. +type Policy struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *PolicyProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Policy. +func (p Policy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.Properties != nil { + objectMap["properties"] = p.Properties + } + if p.Location != nil { + objectMap["location"] = p.Location + } + return json.Marshal(objectMap) +} + +// PolicyCollection protection Profile Collection details. +type PolicyCollection struct { + autorest.Response `json:"-"` + // Value - The policy details. + Value *[]Policy `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// PolicyCollectionIterator provides access to a complete listing of Policy values. +type PolicyCollectionIterator struct { + i int + page PolicyCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PolicyCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PolicyCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PolicyCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PolicyCollectionIterator) Response() PolicyCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PolicyCollectionIterator) Value() Policy { + if !iter.page.NotDone() { + return Policy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PolicyCollectionIterator type. +func NewPolicyCollectionIterator(page PolicyCollectionPage) PolicyCollectionIterator { + return PolicyCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pc PolicyCollection) IsEmpty() bool { + return pc.Value == nil || len(*pc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pc PolicyCollection) hasNextLink() bool { + return pc.NextLink != nil && len(*pc.NextLink) != 0 +} + +// policyCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pc PolicyCollection) policyCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pc.NextLink))) +} + +// PolicyCollectionPage contains a page of Policy values. +type PolicyCollectionPage struct { + fn func(context.Context, PolicyCollection) (PolicyCollection, error) + pc PolicyCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PolicyCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pc) + if err != nil { + return err + } + page.pc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PolicyCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PolicyCollectionPage) NotDone() bool { + return !page.pc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PolicyCollectionPage) Response() PolicyCollection { + return page.pc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PolicyCollectionPage) Values() []Policy { + if page.pc.IsEmpty() { + return nil + } + return *page.pc.Value +} + +// Creates a new instance of the PolicyCollectionPage type. +func NewPolicyCollectionPage(cur PolicyCollection, getNextPage func(context.Context, PolicyCollection) (PolicyCollection, error)) PolicyCollectionPage { + return PolicyCollectionPage{ + fn: getNextPage, + pc: cur, + } +} + +// PolicyProperties protection profile custom data details. +type PolicyProperties struct { + // FriendlyName - The FriendlyName. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProviderSpecificDetails - The ReplicationChannelSetting. + ProviderSpecificDetails BasicPolicyProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for PolicyProperties struct. +func (pp *PolicyProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + pp.FriendlyName = &friendlyName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicPolicyProviderSpecificDetails(*v) + if err != nil { + return err + } + pp.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicPolicyProviderSpecificDetails base class for Provider specific details for policies. +type BasicPolicyProviderSpecificDetails interface { + AsA2APolicyDetails() (*A2APolicyDetails, bool) + AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) + AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) + AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) + AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) + AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) + AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) + AsInMagePolicyDetails() (*InMagePolicyDetails, bool) + AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) + AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) + AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) + AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) +} + +// PolicyProviderSpecificDetails base class for Provider specific details for policies. +type PolicyProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicPolicyProviderSpecificDetails(body []byte) (BasicPolicyProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A): + var apd A2APolicyDetails + err := json.Unmarshal(body, &apd) + return apd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure): + var hvrapd HyperVReplicaAzurePolicyDetails + err := json.Unmarshal(body, &hvrapd) + return hvrapd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails): + var hvrbpd HyperVReplicaBasePolicyDetails + err := json.Unmarshal(body, &hvrbpd) + return hvrbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2): + var hvrbpd HyperVReplicaBluePolicyDetails + err := json.Unmarshal(body, &hvrbpd) + return hvrbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012): + var hvrpd HyperVReplicaPolicyDetails + err := json.Unmarshal(body, &hvrpd) + return hvrpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2): + var imavpd InMageAzureV2PolicyDetails + err := json.Unmarshal(body, &imavpd) + return imavpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails): + var imbpd InMageBasePolicyDetails + err := json.Unmarshal(body, &imbpd) + return imbpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage): + var impd InMagePolicyDetails + err := json.Unmarshal(body, &impd) + return impd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback): + var imrfpd InMageRcmFailbackPolicyDetails + err := json.Unmarshal(body, &imrfpd) + return imrfpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm): + var imrpd InMageRcmPolicyDetails + err := json.Unmarshal(body, &imrpd) + return imrpd, err + case string(InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt): + var vcpd VmwareCbtPolicyDetails + err := json.Unmarshal(body, &vcpd) + return vcpd, err + default: + var ppsd PolicyProviderSpecificDetails + err := json.Unmarshal(body, &ppsd) + return ppsd, err + } +} +func unmarshalBasicPolicyProviderSpecificDetailsArray(body []byte) ([]BasicPolicyProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppsdArray := make([]BasicPolicyProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppsd, err := unmarshalBasicPolicyProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + ppsdArray[index] = ppsd + } + return ppsdArray, nil +} + +// MarshalJSON is the custom marshaler for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) MarshalJSON() ([]byte, error) { + ppsd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails + objectMap := make(map[string]interface{}) + if ppsd.InstanceType != "" { + objectMap["instanceType"] = ppsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return nil, false +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return &ppsd, true +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for PolicyProviderSpecificDetails. +func (ppsd PolicyProviderSpecificDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &ppsd, true +} + +// BasicPolicyProviderSpecificInput base class for provider specific input. +type BasicPolicyProviderSpecificInput interface { + AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) + AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) + AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) + AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) + AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) + AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) + AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) + AsInMagePolicyInput() (*InMagePolicyInput, bool) + AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) + AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) + AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) + AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) +} + +// PolicyProviderSpecificInput base class for provider specific input. +type PolicyProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicPolicyProviderSpecificInput(body []byte) (BasicPolicyProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration): + var accmpci A2ACrossClusterMigrationPolicyCreationInput + err := json.Unmarshal(body, &accmpci) + return accmpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A): + var apci A2APolicyCreationInput + err := json.Unmarshal(body, &apci) + return apci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvrapi HyperVReplicaAzurePolicyInput + err := json.Unmarshal(body, &hvrapi) + return hvrapi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2): + var hvrbpi HyperVReplicaBluePolicyInput + err := json.Unmarshal(body, &hvrbpi) + return hvrbpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012): + var hvrpi HyperVReplicaPolicyInput + err := json.Unmarshal(body, &hvrpi) + return hvrpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2): + var imavpi InMageAzureV2PolicyInput + err := json.Unmarshal(body, &imavpi) + return imavpi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage): + var impi InMagePolicyInput + err := json.Unmarshal(body, &impi) + return impi, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback): + var imrfpci InMageRcmFailbackPolicyCreationInput + err := json.Unmarshal(body, &imrfpci) + return imrfpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm): + var imrpci InMageRcmPolicyCreationInput + err := json.Unmarshal(body, &imrpci) + return imrpci, err + case string(InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt): + var vmcpci VMwareCbtPolicyCreationInput + err := json.Unmarshal(body, &vmcpci) + return vmcpci, err + default: + var ppsi PolicyProviderSpecificInput + err := json.Unmarshal(body, &ppsi) + return ppsi, err + } +} +func unmarshalBasicPolicyProviderSpecificInputArray(body []byte) ([]BasicPolicyProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppsiArray := make([]BasicPolicyProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppsi, err := unmarshalBasicPolicyProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + ppsiArray[index] = ppsi + } + return ppsiArray, nil +} + +// MarshalJSON is the custom marshaler for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) MarshalJSON() ([]byte, error) { + ppsi.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput + objectMap := make(map[string]interface{}) + if ppsi.InstanceType != "" { + objectMap["instanceType"] = ppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return nil, false +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return &ppsi, true +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for PolicyProviderSpecificInput. +func (ppsi PolicyProviderSpecificInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &ppsi, true +} + +// ProcessServer details of the Process Server. +type ProcessServer struct { + // FriendlyName - The Process Server's friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ID - The Process Server Id. + ID *string `json:"id,omitempty"` + // IPAddress - The IP address of the server. + IPAddress *string `json:"ipAddress,omitempty"` + // OsType - The OS type of the server. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The version of the scout component on the server. + AgentVersion *string `json:"agentVersion,omitempty"` + // LastHeartbeat - The last heartbeat received from the server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // MobilityServiceUpdates - The list of the mobility service updates available on the Process Server. + MobilityServiceUpdates *[]MobilityServiceUpdate `json:"mobilityServiceUpdates,omitempty"` + // HostID - The agent generated Id. + HostID *string `json:"hostId,omitempty"` + // MachineCount - The servers configured with this PS. + MachineCount *string `json:"machineCount,omitempty"` + // ReplicationPairCount - The number of replication pairs configured in this PS. + ReplicationPairCount *string `json:"replicationPairCount,omitempty"` + // SystemLoad - The percentage of the system load. + SystemLoad *string `json:"systemLoad,omitempty"` + // SystemLoadStatus - The system load status. + SystemLoadStatus *string `json:"systemLoadStatus,omitempty"` + // CPULoad - The percentage of the CPU load. + CPULoad *string `json:"cpuLoad,omitempty"` + // CPULoadStatus - The CPU load status. + CPULoadStatus *string `json:"cpuLoadStatus,omitempty"` + // TotalMemoryInBytes - The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // MemoryUsageStatus - The memory usage status. + MemoryUsageStatus *string `json:"memoryUsageStatus,omitempty"` + // TotalSpaceInBytes - The total space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - The available space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // SpaceUsageStatus - The space usage status. + SpaceUsageStatus *string `json:"spaceUsageStatus,omitempty"` + // PsServiceStatus - The PS service status. + PsServiceStatus *string `json:"psServiceStatus,omitempty"` + // SslCertExpiryDate - The PS SSL cert expiry date. + SslCertExpiryDate *date.Time `json:"sslCertExpiryDate,omitempty"` + // SslCertExpiryRemainingDays - CS SSL cert expiry date. + SslCertExpiryRemainingDays *int32 `json:"sslCertExpiryRemainingDays,omitempty"` + // OsVersion - OS Version of the process server. Note: This will get populated if user has CS version greater than 9.12.0.0. + OsVersion *string `json:"osVersion,omitempty"` + // HealthErrors - Health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // AgentVersionDetails - The agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // Health - READ-ONLY; The health of Process Server. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // PsStatsRefreshTime - READ-ONLY; The process server stats refresh time. + PsStatsRefreshTime *date.Time `json:"psStatsRefreshTime,omitempty"` + // ThroughputUploadPendingDataInBytes - READ-ONLY; The uploading pending data in bytes. + ThroughputUploadPendingDataInBytes *int64 `json:"throughputUploadPendingDataInBytes,omitempty"` + // ThroughputInMBps - READ-ONLY; The throughput in MBps. + ThroughputInMBps *int64 `json:"throughputInMBps,omitempty"` + // ThroughputInBytes - READ-ONLY; The throughput in bytes. + ThroughputInBytes *int64 `json:"throughputInBytes,omitempty"` + // ThroughputStatus - READ-ONLY; The throughput status. + ThroughputStatus *string `json:"throughputStatus,omitempty"` + // MarsCommunicationStatus - READ-ONLY; The MARS communication status. + MarsCommunicationStatus *string `json:"marsCommunicationStatus,omitempty"` + // MarsRegistrationStatus - READ-ONLY; The MARS registration status. + MarsRegistrationStatus *string `json:"marsRegistrationStatus,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessServer. +func (ps ProcessServer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ps.FriendlyName != nil { + objectMap["friendlyName"] = ps.FriendlyName + } + if ps.ID != nil { + objectMap["id"] = ps.ID + } + if ps.IPAddress != nil { + objectMap["ipAddress"] = ps.IPAddress + } + if ps.OsType != nil { + objectMap["osType"] = ps.OsType + } + if ps.AgentVersion != nil { + objectMap["agentVersion"] = ps.AgentVersion + } + if ps.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = ps.LastHeartbeat + } + if ps.VersionStatus != nil { + objectMap["versionStatus"] = ps.VersionStatus + } + if ps.MobilityServiceUpdates != nil { + objectMap["mobilityServiceUpdates"] = ps.MobilityServiceUpdates + } + if ps.HostID != nil { + objectMap["hostId"] = ps.HostID + } + if ps.MachineCount != nil { + objectMap["machineCount"] = ps.MachineCount + } + if ps.ReplicationPairCount != nil { + objectMap["replicationPairCount"] = ps.ReplicationPairCount + } + if ps.SystemLoad != nil { + objectMap["systemLoad"] = ps.SystemLoad + } + if ps.SystemLoadStatus != nil { + objectMap["systemLoadStatus"] = ps.SystemLoadStatus + } + if ps.CPULoad != nil { + objectMap["cpuLoad"] = ps.CPULoad + } + if ps.CPULoadStatus != nil { + objectMap["cpuLoadStatus"] = ps.CPULoadStatus + } + if ps.TotalMemoryInBytes != nil { + objectMap["totalMemoryInBytes"] = ps.TotalMemoryInBytes + } + if ps.AvailableMemoryInBytes != nil { + objectMap["availableMemoryInBytes"] = ps.AvailableMemoryInBytes + } + if ps.MemoryUsageStatus != nil { + objectMap["memoryUsageStatus"] = ps.MemoryUsageStatus + } + if ps.TotalSpaceInBytes != nil { + objectMap["totalSpaceInBytes"] = ps.TotalSpaceInBytes + } + if ps.AvailableSpaceInBytes != nil { + objectMap["availableSpaceInBytes"] = ps.AvailableSpaceInBytes + } + if ps.SpaceUsageStatus != nil { + objectMap["spaceUsageStatus"] = ps.SpaceUsageStatus + } + if ps.PsServiceStatus != nil { + objectMap["psServiceStatus"] = ps.PsServiceStatus + } + if ps.SslCertExpiryDate != nil { + objectMap["sslCertExpiryDate"] = ps.SslCertExpiryDate + } + if ps.SslCertExpiryRemainingDays != nil { + objectMap["sslCertExpiryRemainingDays"] = ps.SslCertExpiryRemainingDays + } + if ps.OsVersion != nil { + objectMap["osVersion"] = ps.OsVersion + } + if ps.HealthErrors != nil { + objectMap["healthErrors"] = ps.HealthErrors + } + if ps.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = ps.AgentExpiryDate + } + if ps.AgentVersionDetails != nil { + objectMap["agentVersionDetails"] = ps.AgentVersionDetails + } + return json.Marshal(objectMap) +} + +// ProcessServerDetails process server details. +type ProcessServerDetails struct { + // ID - READ-ONLY; The process server Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The process server name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The process server Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The process server Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // IPAddresses - READ-ONLY; The list of IP addresses for communicating with the RCM component. + IPAddresses *[]string `json:"ipAddresses,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the process server. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // TotalMemoryInBytes - READ-ONLY; The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - READ-ONLY; The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // UsedMemoryInBytes - READ-ONLY; The used memory. + UsedMemoryInBytes *int64 `json:"usedMemoryInBytes,omitempty"` + // MemoryUsagePercentage - READ-ONLY; The memory usage percentage. + MemoryUsagePercentage *float64 `json:"memoryUsagePercentage,omitempty"` + // TotalSpaceInBytes - READ-ONLY; The total disk space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - READ-ONLY; The available disk space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // UsedSpaceInBytes - READ-ONLY; The used disk space. + UsedSpaceInBytes *int64 `json:"usedSpaceInBytes,omitempty"` + // FreeSpacePercentage - READ-ONLY; The free disk space percentage. + FreeSpacePercentage *float64 `json:"freeSpacePercentage,omitempty"` + // ThroughputUploadPendingDataInBytes - READ-ONLY; The uploading pending data in bytes. + ThroughputUploadPendingDataInBytes *int64 `json:"throughputUploadPendingDataInBytes,omitempty"` + // ThroughputInBytes - READ-ONLY; The throughput in bytes. + ThroughputInBytes *int64 `json:"throughputInBytes,omitempty"` + // ProcessorUsagePercentage - READ-ONLY; The processor usage percentage. + ProcessorUsagePercentage *float64 `json:"processorUsagePercentage,omitempty"` + // ThroughputStatus - READ-ONLY; The throughput status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + ThroughputStatus RcmComponentStatus `json:"throughputStatus,omitempty"` + // SystemLoad - READ-ONLY; The system load. + SystemLoad *int64 `json:"systemLoad,omitempty"` + // SystemLoadStatus - READ-ONLY; The system load status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + SystemLoadStatus RcmComponentStatus `json:"systemLoadStatus,omitempty"` + // DiskUsageStatus - READ-ONLY; The disk usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + DiskUsageStatus RcmComponentStatus `json:"diskUsageStatus,omitempty"` + // MemoryUsageStatus - READ-ONLY; The memory usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + MemoryUsageStatus RcmComponentStatus `json:"memoryUsageStatus,omitempty"` + // ProcessorUsageStatus - READ-ONLY; The processor usage status. Possible values include: 'RcmComponentStatusHealthy', 'RcmComponentStatusWarning', 'RcmComponentStatusCritical', 'RcmComponentStatusUnknown' + ProcessorUsageStatus RcmComponentStatus `json:"processorUsageStatus,omitempty"` + // Health - READ-ONLY; The health of the process server. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // ProtectedItemCount - READ-ONLY; The protected item count. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // HistoricHealth - READ-ONLY; The historic health of the process server based on the health in last 24 hours. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + HistoricHealth ProtectionHealth `json:"historicHealth,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessServerDetails. +func (psd ProcessServerDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ProtectableItem replication protected item. +type ProtectableItem struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectableItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectableItem. +func (pi ProtectableItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pi.Properties != nil { + objectMap["properties"] = pi.Properties + } + if pi.Location != nil { + objectMap["location"] = pi.Location + } + return json.Marshal(objectMap) +} + +// ProtectableItemCollection protectable item collection. +type ProtectableItemCollection struct { + autorest.Response `json:"-"` + // Value - The Protectable item details. + Value *[]ProtectableItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectableItemCollectionIterator provides access to a complete listing of ProtectableItem values. +type ProtectableItemCollectionIterator struct { + i int + page ProtectableItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectableItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectableItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectableItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectableItemCollectionIterator) Response() ProtectableItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectableItemCollectionIterator) Value() ProtectableItem { + if !iter.page.NotDone() { + return ProtectableItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectableItemCollectionIterator type. +func NewProtectableItemCollectionIterator(page ProtectableItemCollectionPage) ProtectableItemCollectionIterator { + return ProtectableItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pic ProtectableItemCollection) IsEmpty() bool { + return pic.Value == nil || len(*pic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pic ProtectableItemCollection) hasNextLink() bool { + return pic.NextLink != nil && len(*pic.NextLink) != 0 +} + +// protectableItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pic ProtectableItemCollection) protectableItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pic.NextLink))) +} + +// ProtectableItemCollectionPage contains a page of ProtectableItem values. +type ProtectableItemCollectionPage struct { + fn func(context.Context, ProtectableItemCollection) (ProtectableItemCollection, error) + pic ProtectableItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectableItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pic) + if err != nil { + return err + } + page.pic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectableItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectableItemCollectionPage) NotDone() bool { + return !page.pic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectableItemCollectionPage) Response() ProtectableItemCollection { + return page.pic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectableItemCollectionPage) Values() []ProtectableItem { + if page.pic.IsEmpty() { + return nil + } + return *page.pic.Value +} + +// Creates a new instance of the ProtectableItemCollectionPage type. +func NewProtectableItemCollectionPage(cur ProtectableItemCollection, getNextPage func(context.Context, ProtectableItemCollection) (ProtectableItemCollection, error)) ProtectableItemCollectionPage { + return ProtectableItemCollectionPage{ + fn: getNextPage, + pic: cur, + } +} + +// ProtectableItemProperties replication protected item custom data details. +type ProtectableItemProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionStatus - The protection status. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ReplicationProtectedItemID - The ARM resource of protected items. + ReplicationProtectedItemID *string `json:"replicationProtectedItemId,omitempty"` + // RecoveryServicesProviderID - The recovery provider ARM Id. + RecoveryServicesProviderID *string `json:"recoveryServicesProviderId,omitempty"` + // ProtectionReadinessErrors - The Current protection readiness errors. + ProtectionReadinessErrors *[]string `json:"protectionReadinessErrors,omitempty"` + // SupportedReplicationProviders - The list of replication providers supported for the protectable item. + SupportedReplicationProviders *[]string `json:"supportedReplicationProviders,omitempty"` + // CustomDetails - The Replication provider custom settings. + CustomDetails BasicConfigurationSettings `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ProtectableItemProperties struct. +func (pip *ProtectableItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + pip.FriendlyName = &friendlyName + } + case "protectionStatus": + if v != nil { + var protectionStatus string + err = json.Unmarshal(*v, &protectionStatus) + if err != nil { + return err + } + pip.ProtectionStatus = &protectionStatus + } + case "replicationProtectedItemId": + if v != nil { + var replicationProtectedItemID string + err = json.Unmarshal(*v, &replicationProtectedItemID) + if err != nil { + return err + } + pip.ReplicationProtectedItemID = &replicationProtectedItemID + } + case "recoveryServicesProviderId": + if v != nil { + var recoveryServicesProviderID string + err = json.Unmarshal(*v, &recoveryServicesProviderID) + if err != nil { + return err + } + pip.RecoveryServicesProviderID = &recoveryServicesProviderID + } + case "protectionReadinessErrors": + if v != nil { + var protectionReadinessErrors []string + err = json.Unmarshal(*v, &protectionReadinessErrors) + if err != nil { + return err + } + pip.ProtectionReadinessErrors = &protectionReadinessErrors + } + case "supportedReplicationProviders": + if v != nil { + var supportedReplicationProviders []string + err = json.Unmarshal(*v, &supportedReplicationProviders) + if err != nil { + return err + } + pip.SupportedReplicationProviders = &supportedReplicationProviders + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicConfigurationSettings(*v) + if err != nil { + return err + } + pip.CustomDetails = customDetails + } + } + } + + return nil +} + +// ProtectableItemQueryParameter query parameter to enumerate Protectable items. +type ProtectableItemQueryParameter struct { + // State - State of the Protectable item query filter. + State *string `json:"state,omitempty"` +} + +// ProtectedItemsQueryParameter query parameter to enumerate protected items. +type ProtectedItemsQueryParameter struct { + // SourceFabricName - The source fabric name filter. + SourceFabricName *string `json:"sourceFabricName,omitempty"` + // RecoveryPlanName - The recovery plan filter. + RecoveryPlanName *string `json:"recoveryPlanName,omitempty"` + // SourceFabricLocation - The source fabric location filter. + SourceFabricLocation *string `json:"sourceFabricLocation,omitempty"` + // FabricObjectID - The fabric object Id filter. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // VCenterName - The vCenter name filter. + VCenterName *string `json:"vCenterName,omitempty"` + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` + // MultiVMGroupCreateOption - Whether Multi VM group is auto created or specified by user. Possible values include: 'AutoCreated', 'UserSpecified' + MultiVMGroupCreateOption MultiVMGroupCreateOption `json:"multiVmGroupCreateOption,omitempty"` + // ProcessServerID - The process server Id filter. + ProcessServerID *string `json:"processServerId,omitempty"` +} + +// ProtectionContainer protection container details. +type ProtectionContainer struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectionContainerProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainer. +func (pc ProtectionContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pc.Properties != nil { + objectMap["properties"] = pc.Properties + } + if pc.Location != nil { + objectMap["location"] = pc.Location + } + return json.Marshal(objectMap) +} + +// ProtectionContainerCollection protection Container collection. +type ProtectionContainerCollection struct { + autorest.Response `json:"-"` + // Value - The Protection Container details. + Value *[]ProtectionContainer `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectionContainerCollectionIterator provides access to a complete listing of ProtectionContainer +// values. +type ProtectionContainerCollectionIterator struct { + i int + page ProtectionContainerCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectionContainerCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionContainerCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionContainerCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectionContainerCollectionIterator) Response() ProtectionContainerCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectionContainerCollectionIterator) Value() ProtectionContainer { + if !iter.page.NotDone() { + return ProtectionContainer{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectionContainerCollectionIterator type. +func NewProtectionContainerCollectionIterator(page ProtectionContainerCollectionPage) ProtectionContainerCollectionIterator { + return ProtectionContainerCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcc ProtectionContainerCollection) IsEmpty() bool { + return pcc.Value == nil || len(*pcc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pcc ProtectionContainerCollection) hasNextLink() bool { + return pcc.NextLink != nil && len(*pcc.NextLink) != 0 +} + +// protectionContainerCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcc ProtectionContainerCollection) protectionContainerCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pcc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcc.NextLink))) +} + +// ProtectionContainerCollectionPage contains a page of ProtectionContainer values. +type ProtectionContainerCollectionPage struct { + fn func(context.Context, ProtectionContainerCollection) (ProtectionContainerCollection, error) + pcc ProtectionContainerCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectionContainerCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pcc) + if err != nil { + return err + } + page.pcc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionContainerCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionContainerCollectionPage) NotDone() bool { + return !page.pcc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionContainerCollectionPage) Response() ProtectionContainerCollection { + return page.pcc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionContainerCollectionPage) Values() []ProtectionContainer { + if page.pcc.IsEmpty() { + return nil + } + return *page.pcc.Value +} + +// Creates a new instance of the ProtectionContainerCollectionPage type. +func NewProtectionContainerCollectionPage(cur ProtectionContainerCollection, getNextPage func(context.Context, ProtectionContainerCollection) (ProtectionContainerCollection, error)) ProtectionContainerCollectionPage { + return ProtectionContainerCollectionPage{ + fn: getNextPage, + pcc: cur, + } +} + +// ProtectionContainerFabricSpecificDetails base class for fabric specific details of container. +type ProtectionContainerFabricSpecificDetails struct { + // InstanceType - READ-ONLY; Gets the class type. Overridden in derived classes. + InstanceType *string `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainerFabricSpecificDetails. +func (pcfsd ProtectionContainerFabricSpecificDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ProtectionContainerMapping protection container mapping object. +type ProtectionContainerMapping struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ProtectionContainerMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainerMapping. +func (pcm ProtectionContainerMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pcm.Properties != nil { + objectMap["properties"] = pcm.Properties + } + if pcm.Location != nil { + objectMap["location"] = pcm.Location + } + return json.Marshal(objectMap) +} + +// ProtectionContainerMappingCollection protection container mapping collection class. +type ProtectionContainerMappingCollection struct { + autorest.Response `json:"-"` + // Value - List of container mappings. + Value *[]ProtectionContainerMapping `json:"value,omitempty"` + // NextLink - Link to fetch rest of the data. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectionContainerMappingCollectionIterator provides access to a complete listing of +// ProtectionContainerMapping values. +type ProtectionContainerMappingCollectionIterator struct { + i int + page ProtectionContainerMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectionContainerMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionContainerMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionContainerMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectionContainerMappingCollectionIterator) Response() ProtectionContainerMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectionContainerMappingCollectionIterator) Value() ProtectionContainerMapping { + if !iter.page.NotDone() { + return ProtectionContainerMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectionContainerMappingCollectionIterator type. +func NewProtectionContainerMappingCollectionIterator(page ProtectionContainerMappingCollectionPage) ProtectionContainerMappingCollectionIterator { + return ProtectionContainerMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcmc ProtectionContainerMappingCollection) IsEmpty() bool { + return pcmc.Value == nil || len(*pcmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pcmc ProtectionContainerMappingCollection) hasNextLink() bool { + return pcmc.NextLink != nil && len(*pcmc.NextLink) != 0 +} + +// protectionContainerMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcmc ProtectionContainerMappingCollection) protectionContainerMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pcmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcmc.NextLink))) +} + +// ProtectionContainerMappingCollectionPage contains a page of ProtectionContainerMapping values. +type ProtectionContainerMappingCollectionPage struct { + fn func(context.Context, ProtectionContainerMappingCollection) (ProtectionContainerMappingCollection, error) + pcmc ProtectionContainerMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectionContainerMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pcmc) + if err != nil { + return err + } + page.pcmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionContainerMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionContainerMappingCollectionPage) NotDone() bool { + return !page.pcmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionContainerMappingCollectionPage) Response() ProtectionContainerMappingCollection { + return page.pcmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionContainerMappingCollectionPage) Values() []ProtectionContainerMapping { + if page.pcmc.IsEmpty() { + return nil + } + return *page.pcmc.Value +} + +// Creates a new instance of the ProtectionContainerMappingCollectionPage type. +func NewProtectionContainerMappingCollectionPage(cur ProtectionContainerMappingCollection, getNextPage func(context.Context, ProtectionContainerMappingCollection) (ProtectionContainerMappingCollection, error)) ProtectionContainerMappingCollectionPage { + return ProtectionContainerMappingCollectionPage{ + fn: getNextPage, + pcmc: cur, + } +} + +// ProtectionContainerMappingProperties protection container mapping properties. +type ProtectionContainerMappingProperties struct { + // TargetProtectionContainerID - Paired protection container ARM ID. + TargetProtectionContainerID *string `json:"targetProtectionContainerId,omitempty"` + // TargetProtectionContainerFriendlyName - Friendly name of paired container. + TargetProtectionContainerFriendlyName *string `json:"targetProtectionContainerFriendlyName,omitempty"` + // ProviderSpecificDetails - Provider specific provider details. + ProviderSpecificDetails BasicProtectionContainerMappingProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` + // Health - Health of pairing. + Health *string `json:"health,omitempty"` + // HealthErrorDetails - Health error. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // PolicyID - Policy ARM Id. + PolicyID *string `json:"policyId,omitempty"` + // State - Association Status. + State *string `json:"state,omitempty"` + // SourceProtectionContainerFriendlyName - Friendly name of source protection container. + SourceProtectionContainerFriendlyName *string `json:"sourceProtectionContainerFriendlyName,omitempty"` + // SourceFabricFriendlyName - Friendly name of source fabric. + SourceFabricFriendlyName *string `json:"sourceFabricFriendlyName,omitempty"` + // TargetFabricFriendlyName - Friendly name of target fabric. + TargetFabricFriendlyName *string `json:"targetFabricFriendlyName,omitempty"` + // PolicyFriendlyName - Friendly name of replication policy. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ProtectionContainerMappingProperties struct. +func (pcmp *ProtectionContainerMappingProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetProtectionContainerId": + if v != nil { + var targetProtectionContainerID string + err = json.Unmarshal(*v, &targetProtectionContainerID) + if err != nil { + return err + } + pcmp.TargetProtectionContainerID = &targetProtectionContainerID + } + case "targetProtectionContainerFriendlyName": + if v != nil { + var targetProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &targetProtectionContainerFriendlyName) + if err != nil { + return err + } + pcmp.TargetProtectionContainerFriendlyName = &targetProtectionContainerFriendlyName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicProtectionContainerMappingProviderSpecificDetails(*v) + if err != nil { + return err + } + pcmp.ProviderSpecificDetails = providerSpecificDetails + } + case "health": + if v != nil { + var health string + err = json.Unmarshal(*v, &health) + if err != nil { + return err + } + pcmp.Health = &health + } + case "healthErrorDetails": + if v != nil { + var healthErrorDetails []HealthError + err = json.Unmarshal(*v, &healthErrorDetails) + if err != nil { + return err + } + pcmp.HealthErrorDetails = &healthErrorDetails + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + pcmp.PolicyID = &policyID + } + case "state": + if v != nil { + var state string + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + pcmp.State = &state + } + case "sourceProtectionContainerFriendlyName": + if v != nil { + var sourceProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &sourceProtectionContainerFriendlyName) + if err != nil { + return err + } + pcmp.SourceProtectionContainerFriendlyName = &sourceProtectionContainerFriendlyName + } + case "sourceFabricFriendlyName": + if v != nil { + var sourceFabricFriendlyName string + err = json.Unmarshal(*v, &sourceFabricFriendlyName) + if err != nil { + return err + } + pcmp.SourceFabricFriendlyName = &sourceFabricFriendlyName + } + case "targetFabricFriendlyName": + if v != nil { + var targetFabricFriendlyName string + err = json.Unmarshal(*v, &targetFabricFriendlyName) + if err != nil { + return err + } + pcmp.TargetFabricFriendlyName = &targetFabricFriendlyName + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + pcmp.PolicyFriendlyName = &policyFriendlyName + } + } + } + + return nil +} + +// BasicProtectionContainerMappingProviderSpecificDetails container mapping provider specific details. +type BasicProtectionContainerMappingProviderSpecificDetails interface { + AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) + AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) + AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) + AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) +} + +// ProtectionContainerMappingProviderSpecificDetails container mapping provider specific details. +type ProtectionContainerMappingProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicProtectionContainerMappingProviderSpecificDetails(body []byte) (BasicProtectionContainerMappingProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A): + var apcmd A2AProtectionContainerMappingDetails + err := json.Unmarshal(body, &apcmd) + return apcmd, err + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm): + var imrpcmd InMageRcmProtectionContainerMappingDetails + err := json.Unmarshal(body, &imrpcmd) + return imrpcmd, err + case string(InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt): + var vmcpcmd VMwareCbtProtectionContainerMappingDetails + err := json.Unmarshal(body, &vmcpcmd) + return vmcpcmd, err + default: + var pcmpsd ProtectionContainerMappingProviderSpecificDetails + err := json.Unmarshal(body, &pcmpsd) + return pcmpsd, err + } +} +func unmarshalBasicProtectionContainerMappingProviderSpecificDetailsArray(body []byte) ([]BasicProtectionContainerMappingProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pcmpsdArray := make([]BasicProtectionContainerMappingProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pcmpsd, err := unmarshalBasicProtectionContainerMappingProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + pcmpsdArray[index] = pcmpsd + } + return pcmpsdArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) MarshalJSON() ([]byte, error) { + pcmpsd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails + objectMap := make(map[string]interface{}) + if pcmpsd.InstanceType != "" { + objectMap["instanceType"] = pcmpsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return &pcmpsd, true +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for ProtectionContainerMappingProviderSpecificDetails. +func (pcmpsd ProtectionContainerMappingProviderSpecificDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &pcmpsd, true +} + +// ProtectionContainerProperties protection profile custom data details. +type ProtectionContainerProperties struct { + // FabricFriendlyName - Fabric friendly name. + FabricFriendlyName *string `json:"fabricFriendlyName,omitempty"` + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // FabricType - The fabric type. + FabricType *string `json:"fabricType,omitempty"` + // ProtectedItemCount - Number of protected PEs. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // PairingStatus - The pairing status of this cloud. + PairingStatus *string `json:"pairingStatus,omitempty"` + // Role - The role of this cloud. + Role *string `json:"role,omitempty"` + // FabricSpecificDetails - Fabric specific details. + FabricSpecificDetails *ProtectionContainerFabricSpecificDetails `json:"fabricSpecificDetails,omitempty"` +} + +// BasicProtectionProfileCustomDetails protection Profile custom input. +type BasicProtectionProfileCustomDetails interface { + AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) + AsNewProtectionProfile() (*NewProtectionProfile, bool) + AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) +} + +// ProtectionProfileCustomDetails protection Profile custom input. +type ProtectionProfileCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeProtectionProfileCustomDetails', 'ResourceTypeExisting', 'ResourceTypeNew' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +func unmarshalBasicProtectionProfileCustomDetails(body []byte) (BasicProtectionProfileCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeExisting): + var epp ExistingProtectionProfile + err := json.Unmarshal(body, &epp) + return epp, err + case string(ResourceTypeNew): + var npp NewProtectionProfile + err := json.Unmarshal(body, &npp) + return npp, err + default: + var ppcd ProtectionProfileCustomDetails + err := json.Unmarshal(body, &ppcd) + return ppcd, err + } +} +func unmarshalBasicProtectionProfileCustomDetailsArray(body []byte) ([]BasicProtectionProfileCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppcdArray := make([]BasicProtectionProfileCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppcd, err := unmarshalBasicProtectionProfileCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + ppcdArray[index] = ppcd + } + return ppcdArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) MarshalJSON() ([]byte, error) { + ppcd.ResourceType = ResourceTypeProtectionProfileCustomDetails + objectMap := make(map[string]interface{}) + if ppcd.ResourceType != "" { + objectMap["resourceType"] = ppcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsExistingProtectionProfile() (*ExistingProtectionProfile, bool) { + return nil, false +} + +// AsNewProtectionProfile is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsNewProtectionProfile() (*NewProtectionProfile, bool) { + return nil, false +} + +// AsProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsProtectionProfileCustomDetails() (*ProtectionProfileCustomDetails, bool) { + return &ppcd, true +} + +// AsBasicProtectionProfileCustomDetails is the BasicProtectionProfileCustomDetails implementation for ProtectionProfileCustomDetails. +func (ppcd ProtectionProfileCustomDetails) AsBasicProtectionProfileCustomDetails() (BasicProtectionProfileCustomDetails, bool) { + return &ppcd, true +} + +// ProviderError this class contains the error details per object. +type ProviderError struct { + // ErrorCode - The Error code. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorMessage - The Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // ErrorID - The Provider error Id. + ErrorID *string `json:"errorId,omitempty"` + // PossibleCauses - The possible causes for the error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - The recommended action to resolve the error. + RecommendedAction *string `json:"recommendedAction,omitempty"` +} + +// BasicProviderSpecificRecoveryPointDetails replication provider specific recovery point details. +type BasicProviderSpecificRecoveryPointDetails interface { + AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) + AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) + AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) + AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) +} + +// ProviderSpecificRecoveryPointDetails replication provider specific recovery point details. +type ProviderSpecificRecoveryPointDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicProviderSpecificRecoveryPointDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicProviderSpecificRecoveryPointDetails(body []byte) (BasicProviderSpecificRecoveryPointDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeA2A): + var arpd A2ARecoveryPointDetails + err := json.Unmarshal(body, &arpd) + return arpd, err + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageAzureV2): + var imavrpd InMageAzureV2RecoveryPointDetails + err := json.Unmarshal(body, &imavrpd) + return imavrpd, err + case string(InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeInMageRcm): + var imrrpd InMageRcmRecoveryPointDetails + err := json.Unmarshal(body, &imrrpd) + return imrrpd, err + default: + var psrpd ProviderSpecificRecoveryPointDetails + err := json.Unmarshal(body, &psrpd) + return psrpd, err + } +} +func unmarshalBasicProviderSpecificRecoveryPointDetailsArray(body []byte) ([]BasicProviderSpecificRecoveryPointDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + psrpdArray := make([]BasicProviderSpecificRecoveryPointDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + psrpd, err := unmarshalBasicProviderSpecificRecoveryPointDetails(*rawMessage) + if err != nil { + return nil, err + } + psrpdArray[index] = psrpd + } + return psrpdArray, nil +} + +// MarshalJSON is the custom marshaler for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) MarshalJSON() ([]byte, error) { + psrpd.InstanceType = InstanceTypeBasicProviderSpecificRecoveryPointDetailsInstanceTypeProviderSpecificRecoveryPointDetails + objectMap := make(map[string]interface{}) + if psrpd.InstanceType != "" { + objectMap["instanceType"] = psrpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsA2ARecoveryPointDetails() (*A2ARecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageAzureV2RecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsInMageAzureV2RecoveryPointDetails() (*InMageAzureV2RecoveryPointDetails, bool) { + return nil, false +} + +// AsInMageRcmRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsInMageRcmRecoveryPointDetails() (*InMageRcmRecoveryPointDetails, bool) { + return nil, false +} + +// AsProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsProviderSpecificRecoveryPointDetails() (*ProviderSpecificRecoveryPointDetails, bool) { + return &psrpd, true +} + +// AsBasicProviderSpecificRecoveryPointDetails is the BasicProviderSpecificRecoveryPointDetails implementation for ProviderSpecificRecoveryPointDetails. +func (psrpd ProviderSpecificRecoveryPointDetails) AsBasicProviderSpecificRecoveryPointDetails() (BasicProviderSpecificRecoveryPointDetails, bool) { + return &psrpd, true +} + +// PushInstallerDetails push installer details. +type PushInstallerDetails struct { + // ID - READ-ONLY; The push installer Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The push installer name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The push installer Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The push installer Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the push installer. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the push installer. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for PushInstallerDetails. +func (pid PushInstallerDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RcmProxyDetails RCM proxy details. +type RcmProxyDetails struct { + // ID - READ-ONLY; The RCM proxy Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The RCM proxy name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The RCM proxy Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The RCM proxy Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // ClientAuthenticationType - READ-ONLY; The client authentication type. + ClientAuthenticationType *string `json:"clientAuthenticationType,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the RCM proxy. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the RCM proxy. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for RcmProxyDetails. +func (rpd RcmProxyDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// BasicRecoveryAvailabilitySetCustomDetails recovery Availability Set custom input. +type BasicRecoveryAvailabilitySetCustomDetails interface { + AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) + AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) +} + +// RecoveryAvailabilitySetCustomDetails recovery Availability Set custom input. +type RecoveryAvailabilitySetCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails', 'ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryAvailabilitySetCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryAvailabilitySetCustomDetails(body []byte) (BasicRecoveryAvailabilitySetCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeExisting): + var eras ExistingRecoveryAvailabilitySet + err := json.Unmarshal(body, &eras) + return eras, err + default: + var rascd RecoveryAvailabilitySetCustomDetails + err := json.Unmarshal(body, &rascd) + return rascd, err + } +} +func unmarshalBasicRecoveryAvailabilitySetCustomDetailsArray(body []byte) ([]BasicRecoveryAvailabilitySetCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rascdArray := make([]BasicRecoveryAvailabilitySetCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rascd, err := unmarshalBasicRecoveryAvailabilitySetCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rascdArray[index] = rascd + } + return rascdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) MarshalJSON() ([]byte, error) { + rascd.ResourceType = ResourceTypeBasicRecoveryAvailabilitySetCustomDetailsResourceTypeRecoveryAvailabilitySetCustomDetails + objectMap := make(map[string]interface{}) + if rascd.ResourceType != "" { + objectMap["resourceType"] = rascd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryAvailabilitySet is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsExistingRecoveryAvailabilitySet() (*ExistingRecoveryAvailabilitySet, bool) { + return nil, false +} + +// AsRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsRecoveryAvailabilitySetCustomDetails() (*RecoveryAvailabilitySetCustomDetails, bool) { + return &rascd, true +} + +// AsBasicRecoveryAvailabilitySetCustomDetails is the BasicRecoveryAvailabilitySetCustomDetails implementation for RecoveryAvailabilitySetCustomDetails. +func (rascd RecoveryAvailabilitySetCustomDetails) AsBasicRecoveryAvailabilitySetCustomDetails() (BasicRecoveryAvailabilitySetCustomDetails, bool) { + return &rascd, true +} + +// RecoveryPlan recovery plan details. +type RecoveryPlan struct { + autorest.Response `json:"-"` + // Properties - The custom details. + Properties *RecoveryPlanProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlan. +func (rp RecoveryPlan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.Properties != nil { + objectMap["properties"] = rp.Properties + } + if rp.Location != nil { + objectMap["location"] = rp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryPlanA2ADetails recovery plan A2A specific details. +type RecoveryPlanA2ADetails struct { + // PrimaryZone - The primary zone. + PrimaryZone *string `json:"primaryZone,omitempty"` + // RecoveryZone - The recovery zone. + RecoveryZone *string `json:"recoveryZone,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails', 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) MarshalJSON() ([]byte, error) { + rpad.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpad.PrimaryZone != nil { + objectMap["primaryZone"] = rpad.PrimaryZone + } + if rpad.RecoveryZone != nil { + objectMap["recoveryZone"] = rpad.RecoveryZone + } + if rpad.InstanceType != "" { + objectMap["instanceType"] = rpad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2ADetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) { + return &rpad, true +} + +// AsRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanA2ADetails. +func (rpad RecoveryPlanA2ADetails) AsBasicRecoveryPlanProviderSpecificDetails() (BasicRecoveryPlanProviderSpecificDetails, bool) { + return &rpad, true +} + +// RecoveryPlanA2AFailoverInput recovery plan A2A failover input. +type RecoveryPlanA2AFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'Latest', 'LatestApplicationConsistent', 'LatestCrashConsistent', 'LatestProcessed' + RecoveryPointType A2ARpRecoveryPointType `json:"recoveryPointType,omitempty"` + // CloudServiceCreationOption - A value indicating whether to use recovery cloud service for TFO or not. + CloudServiceCreationOption *string `json:"cloudServiceCreationOption,omitempty"` + // MultiVMSyncPointOption - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. Possible values include: 'UseMultiVMSyncRecoveryPoint', 'UsePerVMRecoveryPoint' + MultiVMSyncPointOption MultiVMSyncPointOption `json:"multiVmSyncPointOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) MarshalJSON() ([]byte, error) { + rpafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpafi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpafi.RecoveryPointType + } + if rpafi.CloudServiceCreationOption != nil { + objectMap["cloudServiceCreationOption"] = rpafi.CloudServiceCreationOption + } + if rpafi.MultiVMSyncPointOption != "" { + objectMap["multiVmSyncPointOption"] = rpafi.MultiVMSyncPointOption + } + if rpafi.InstanceType != "" { + objectMap["instanceType"] = rpafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return &rpafi, true +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanA2AFailoverInput. +func (rpafi RecoveryPlanA2AFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpafi, true +} + +// RecoveryPlanA2AInput recovery plan A2A input. +type RecoveryPlanA2AInput struct { + // PrimaryZone - The primary zone. + PrimaryZone *string `json:"primaryZone,omitempty"` + // RecoveryZone - The recovery zone. + RecoveryZone *string `json:"recoveryZone,omitempty"` + // PrimaryExtendedLocation - The primary extended location. + PrimaryExtendedLocation *ExtendedLocation `json:"primaryExtendedLocation,omitempty"` + // RecoveryExtendedLocation - The recovery extended location. + RecoveryExtendedLocation *ExtendedLocation `json:"recoveryExtendedLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) MarshalJSON() ([]byte, error) { + rpai.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A + objectMap := make(map[string]interface{}) + if rpai.PrimaryZone != nil { + objectMap["primaryZone"] = rpai.PrimaryZone + } + if rpai.RecoveryZone != nil { + objectMap["recoveryZone"] = rpai.RecoveryZone + } + if rpai.PrimaryExtendedLocation != nil { + objectMap["primaryExtendedLocation"] = rpai.PrimaryExtendedLocation + } + if rpai.RecoveryExtendedLocation != nil { + objectMap["recoveryExtendedLocation"] = rpai.RecoveryExtendedLocation + } + if rpai.InstanceType != "" { + objectMap["instanceType"] = rpai.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) { + return &rpai, true +} + +// AsRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanA2AInput. +func (rpai RecoveryPlanA2AInput) AsBasicRecoveryPlanProviderSpecificInput() (BasicRecoveryPlanProviderSpecificInput, bool) { + return &rpai, true +} + +// RecoveryPlanAction recovery plan action details. +type RecoveryPlanAction struct { + // ActionName - The action name. + ActionName *string `json:"actionName,omitempty"` + // FailoverTypes - The list of failover types. + FailoverTypes *[]ReplicationProtectedItemOperation `json:"failoverTypes,omitempty"` + // FailoverDirections - The list of failover directions. + FailoverDirections *[]PossibleOperationsDirections `json:"failoverDirections,omitempty"` + // CustomDetails - The custom details. + CustomDetails BasicRecoveryPlanActionDetails `json:"customDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanAction struct. +func (rpa *RecoveryPlanAction) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "actionName": + if v != nil { + var actionName string + err = json.Unmarshal(*v, &actionName) + if err != nil { + return err + } + rpa.ActionName = &actionName + } + case "failoverTypes": + if v != nil { + var failoverTypes []ReplicationProtectedItemOperation + err = json.Unmarshal(*v, &failoverTypes) + if err != nil { + return err + } + rpa.FailoverTypes = &failoverTypes + } + case "failoverDirections": + if v != nil { + var failoverDirections []PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirections) + if err != nil { + return err + } + rpa.FailoverDirections = &failoverDirections + } + case "customDetails": + if v != nil { + customDetails, err := unmarshalBasicRecoveryPlanActionDetails(*v) + if err != nil { + return err + } + rpa.CustomDetails = customDetails + } + } + } + + return nil +} + +// BasicRecoveryPlanActionDetails recovery plan action custom details. +type BasicRecoveryPlanActionDetails interface { + AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) + AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) + AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) + AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) +} + +// RecoveryPlanActionDetails recovery plan action custom details. +type RecoveryPlanActionDetails struct { + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanActionDetails(body []byte) (BasicRecoveryPlanActionDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAutomationRunbookActionDetails): + var rparad RecoveryPlanAutomationRunbookActionDetails + err := json.Unmarshal(body, &rparad) + return rparad, err + case string(InstanceTypeManualActionDetails): + var rpmad RecoveryPlanManualActionDetails + err := json.Unmarshal(body, &rpmad) + return rpmad, err + case string(InstanceTypeScriptActionDetails): + var rpsad RecoveryPlanScriptActionDetails + err := json.Unmarshal(body, &rpsad) + return rpsad, err + default: + var rpad RecoveryPlanActionDetails + err := json.Unmarshal(body, &rpad) + return rpad, err + } +} +func unmarshalBasicRecoveryPlanActionDetailsArray(body []byte) ([]BasicRecoveryPlanActionDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpadArray := make([]BasicRecoveryPlanActionDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpad, err := unmarshalBasicRecoveryPlanActionDetails(*rawMessage) + if err != nil { + return nil, err + } + rpadArray[index] = rpad + } + return rpadArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) MarshalJSON() ([]byte, error) { + rpad.InstanceType = InstanceTypeRecoveryPlanActionDetails + objectMap := make(map[string]interface{}) + if rpad.InstanceType != "" { + objectMap["instanceType"] = rpad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return &rpad, true +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanActionDetails. +func (rpad RecoveryPlanActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpad, true +} + +// RecoveryPlanAutomationRunbookActionDetails recovery plan Automation runbook action details. +type RecoveryPlanAutomationRunbookActionDetails struct { + // RunbookID - The runbook ARM Id. + RunbookID *string `json:"runbookId,omitempty"` + // Timeout - The runbook timeout. + Timeout *string `json:"timeout,omitempty"` + // FabricLocation - The fabric location. Possible values include: 'Primary', 'Recovery' + FabricLocation RecoveryPlanActionLocation `json:"fabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) MarshalJSON() ([]byte, error) { + rparad.InstanceType = InstanceTypeAutomationRunbookActionDetails + objectMap := make(map[string]interface{}) + if rparad.RunbookID != nil { + objectMap["runbookId"] = rparad.RunbookID + } + if rparad.Timeout != nil { + objectMap["timeout"] = rparad.Timeout + } + if rparad.FabricLocation != "" { + objectMap["fabricLocation"] = rparad.FabricLocation + } + if rparad.InstanceType != "" { + objectMap["instanceType"] = rparad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return &rparad, true +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanAutomationRunbookActionDetails. +func (rparad RecoveryPlanAutomationRunbookActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rparad, true +} + +// RecoveryPlanCollection recovery plan collection details. +type RecoveryPlanCollection struct { + autorest.Response `json:"-"` + // Value - The list of recovery plans. + Value *[]RecoveryPlan `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryPlanCollectionIterator provides access to a complete listing of RecoveryPlan values. +type RecoveryPlanCollectionIterator struct { + i int + page RecoveryPlanCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryPlanCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPlanCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryPlanCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryPlanCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryPlanCollectionIterator) Response() RecoveryPlanCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryPlanCollectionIterator) Value() RecoveryPlan { + if !iter.page.NotDone() { + return RecoveryPlan{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryPlanCollectionIterator type. +func NewRecoveryPlanCollectionIterator(page RecoveryPlanCollectionPage) RecoveryPlanCollectionIterator { + return RecoveryPlanCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (RPCVar RecoveryPlanCollection) IsEmpty() bool { + return RPCVar.Value == nil || len(*RPCVar.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (RPCVar RecoveryPlanCollection) hasNextLink() bool { + return RPCVar.NextLink != nil && len(*RPCVar.NextLink) != 0 +} + +// recoveryPlanCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (RPCVar RecoveryPlanCollection) recoveryPlanCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !RPCVar.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(RPCVar.NextLink))) +} + +// RecoveryPlanCollectionPage contains a page of RecoveryPlan values. +type RecoveryPlanCollectionPage struct { + fn func(context.Context, RecoveryPlanCollection) (RecoveryPlanCollection, error) + RPCVar RecoveryPlanCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryPlanCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPlanCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.RPCVar) + if err != nil { + return err + } + page.RPCVar = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryPlanCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryPlanCollectionPage) NotDone() bool { + return !page.RPCVar.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryPlanCollectionPage) Response() RecoveryPlanCollection { + return page.RPCVar +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryPlanCollectionPage) Values() []RecoveryPlan { + if page.RPCVar.IsEmpty() { + return nil + } + return *page.RPCVar.Value +} + +// Creates a new instance of the RecoveryPlanCollectionPage type. +func NewRecoveryPlanCollectionPage(cur RecoveryPlanCollection, getNextPage func(context.Context, RecoveryPlanCollection) (RecoveryPlanCollection, error)) RecoveryPlanCollectionPage { + return RecoveryPlanCollectionPage{ + fn: getNextPage, + RPCVar: cur, + } +} + +// RecoveryPlanGroup recovery plan group details. +type RecoveryPlanGroup struct { + // GroupType - The group type. Possible values include: 'Shutdown', 'Boot', 'Failover' + GroupType RecoveryPlanGroupType `json:"groupType,omitempty"` + // ReplicationProtectedItems - The list of protected items. + ReplicationProtectedItems *[]RecoveryPlanProtectedItem `json:"replicationProtectedItems,omitempty"` + // StartGroupActions - The start group actions. + StartGroupActions *[]RecoveryPlanAction `json:"startGroupActions,omitempty"` + // EndGroupActions - The end group actions. + EndGroupActions *[]RecoveryPlanAction `json:"endGroupActions,omitempty"` +} + +// BasicRecoveryPlanGroupTaskDetails this class represents the recovery plan group task. +type BasicRecoveryPlanGroupTaskDetails interface { + AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) + AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) +} + +// RecoveryPlanGroupTaskDetails this class represents the recovery plan group task. +type RecoveryPlanGroupTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // GroupID - The group identifier. + GroupID *string `json:"groupId,omitempty"` + // RpGroupType - The group type. + RpGroupType *string `json:"rpGroupType,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanGroupTaskDetails(body []byte) (BasicRecoveryPlanGroupTaskDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeRecoveryPlanShutdownGroupTaskDetails): + var rpsgtd RecoveryPlanShutdownGroupTaskDetails + err := json.Unmarshal(body, &rpsgtd) + return rpsgtd, err + default: + var rpgtd RecoveryPlanGroupTaskDetails + err := json.Unmarshal(body, &rpgtd) + return rpgtd, err + } +} +func unmarshalBasicRecoveryPlanGroupTaskDetailsArray(body []byte) ([]BasicRecoveryPlanGroupTaskDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpgtdArray := make([]BasicRecoveryPlanGroupTaskDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpgtd, err := unmarshalBasicRecoveryPlanGroupTaskDetails(*rawMessage) + if err != nil { + return nil, err + } + rpgtdArray[index] = rpgtd + } + return rpgtdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) MarshalJSON() ([]byte, error) { + rpgtd.InstanceType = InstanceTypeRecoveryPlanGroupTaskDetails + objectMap := make(map[string]interface{}) + if rpgtd.Name != nil { + objectMap["name"] = rpgtd.Name + } + if rpgtd.GroupID != nil { + objectMap["groupId"] = rpgtd.GroupID + } + if rpgtd.RpGroupType != nil { + objectMap["rpGroupType"] = rpgtd.RpGroupType + } + if rpgtd.ChildTasks != nil { + objectMap["childTasks"] = rpgtd.ChildTasks + } + if rpgtd.InstanceType != "" { + objectMap["instanceType"] = rpgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return &rpgtd, true +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return &rpgtd, true +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return nil, false +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanGroupTaskDetails. +func (rpgtd RecoveryPlanGroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &rpgtd, true +} + +// RecoveryPlanHyperVReplicaAzureFailbackInput recovery plan HVR Azure failback input. +type RecoveryPlanHyperVReplicaAzureFailbackInput struct { + // DataSyncOption - The data sync option. Possible values include: 'ForDownTime', 'ForSynchronization' + DataSyncOption DataSyncStatus `json:"dataSyncOption,omitempty"` + // RecoveryVMCreationOption - The ALR option. Possible values include: 'CreateVMIfNotFound', 'NoAction' + RecoveryVMCreationOption AlternateLocationRecoveryOption `json:"recoveryVmCreationOption,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) MarshalJSON() ([]byte, error) { + rphvrafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback + objectMap := make(map[string]interface{}) + if rphvrafi.DataSyncOption != "" { + objectMap["dataSyncOption"] = rphvrafi.DataSyncOption + } + if rphvrafi.RecoveryVMCreationOption != "" { + objectMap["recoveryVmCreationOption"] = rphvrafi.RecoveryVMCreationOption + } + if rphvrafi.InstanceType != "" { + objectMap["instanceType"] = rphvrafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return &rphvrafi, true +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailbackInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rphvrafi, true +} + +// RecoveryPlanHyperVReplicaAzureFailoverInput recovery plan HVR Azure failover input. +type RecoveryPlanHyperVReplicaAzureFailoverInput struct { + // PrimaryKekCertificatePfx - The primary KEK certificate PFX. + PrimaryKekCertificatePfx *string `json:"primaryKekCertificatePfx,omitempty"` + // SecondaryKekCertificatePfx - The secondary KEK certificate PFX. + SecondaryKekCertificatePfx *string `json:"secondaryKekCertificatePfx,omitempty"` + // RecoveryPointType - The recovery point type. Possible values include: 'HyperVReplicaAzureRpRecoveryPointTypeLatest', 'HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent', 'HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed' + RecoveryPointType HyperVReplicaAzureRpRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) MarshalJSON() ([]byte, error) { + rphvrafi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure + objectMap := make(map[string]interface{}) + if rphvrafi.PrimaryKekCertificatePfx != nil { + objectMap["primaryKekCertificatePfx"] = rphvrafi.PrimaryKekCertificatePfx + } + if rphvrafi.SecondaryKekCertificatePfx != nil { + objectMap["secondaryKekCertificatePfx"] = rphvrafi.SecondaryKekCertificatePfx + } + if rphvrafi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rphvrafi.RecoveryPointType + } + if rphvrafi.InstanceType != "" { + objectMap["instanceType"] = rphvrafi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return &rphvrafi, true +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanHyperVReplicaAzureFailoverInput. +func (rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rphvrafi, true +} + +// RecoveryPlanInMageAzureV2FailoverInput recovery plan InMageAzureV2 failover input. +type RecoveryPlanInMageAzureV2FailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'InMageV2RpRecoveryPointTypeLatest', 'InMageV2RpRecoveryPointTypeLatestApplicationConsistent', 'InMageV2RpRecoveryPointTypeLatestCrashConsistent', 'InMageV2RpRecoveryPointTypeLatestProcessed' + RecoveryPointType InMageV2RpRecoveryPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) MarshalJSON() ([]byte, error) { + rpimavfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2 + objectMap := make(map[string]interface{}) + if rpimavfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimavfi.RecoveryPointType + } + if rpimavfi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimavfi.UseMultiVMSyncPoint + } + if rpimavfi.InstanceType != "" { + objectMap["instanceType"] = rpimavfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return &rpimavfi, true +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageAzureV2FailoverInput. +func (rpimavfi RecoveryPlanInMageAzureV2FailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimavfi, true +} + +// RecoveryPlanInMageFailoverInput recovery plan InMage failover input. +type RecoveryPlanInMageFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'RpInMageRecoveryPointTypeLatestTime', 'RpInMageRecoveryPointTypeLatestTag', 'RpInMageRecoveryPointTypeCustom' + RecoveryPointType RpInMageRecoveryPointType `json:"recoveryPointType,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) MarshalJSON() ([]byte, error) { + rpimfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage + objectMap := make(map[string]interface{}) + if rpimfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimfi.RecoveryPointType + } + if rpimfi.InstanceType != "" { + objectMap["instanceType"] = rpimfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return &rpimfi, true +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageFailoverInput. +func (rpimfi RecoveryPlanInMageFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimfi, true +} + +// RecoveryPlanInMageRcmFailbackFailoverInput recovery plan InMageRcmFailback failover input. +type RecoveryPlanInMageRcmFailbackFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'ApplicationConsistent', 'CrashConsistent' + RecoveryPointType InMageRcmFailbackRecoveryPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) MarshalJSON() ([]byte, error) { + rpimrffi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback + objectMap := make(map[string]interface{}) + if rpimrffi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimrffi.RecoveryPointType + } + if rpimrffi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimrffi.UseMultiVMSyncPoint + } + if rpimrffi.InstanceType != "" { + objectMap["instanceType"] = rpimrffi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return &rpimrffi, true +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailbackFailoverInput. +func (rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimrffi, true +} + +// RecoveryPlanInMageRcmFailoverInput recovery plan InMageRcm failover input. +type RecoveryPlanInMageRcmFailoverInput struct { + // RecoveryPointType - The recovery point type. Possible values include: 'RecoveryPlanPointTypeLatest', 'RecoveryPlanPointTypeLatestApplicationConsistent', 'RecoveryPlanPointTypeLatestCrashConsistent', 'RecoveryPlanPointTypeLatestProcessed' + RecoveryPointType RecoveryPlanPointType `json:"recoveryPointType,omitempty"` + // UseMultiVMSyncPoint - A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + UseMultiVMSyncPoint *string `json:"useMultiVmSyncPoint,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) MarshalJSON() ([]byte, error) { + rpimrfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm + objectMap := make(map[string]interface{}) + if rpimrfi.RecoveryPointType != "" { + objectMap["recoveryPointType"] = rpimrfi.RecoveryPointType + } + if rpimrfi.UseMultiVMSyncPoint != nil { + objectMap["useMultiVmSyncPoint"] = rpimrfi.UseMultiVMSyncPoint + } + if rpimrfi.InstanceType != "" { + objectMap["instanceType"] = rpimrfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return &rpimrfi, true +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return nil, false +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanInMageRcmFailoverInput. +func (rpimrfi RecoveryPlanInMageRcmFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rpimrfi, true +} + +// RecoveryPlanManualActionDetails recovery plan manual action details. +type RecoveryPlanManualActionDetails struct { + // Description - The manual action description. + Description *string `json:"description,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) MarshalJSON() ([]byte, error) { + rpmad.InstanceType = InstanceTypeManualActionDetails + objectMap := make(map[string]interface{}) + if rpmad.Description != nil { + objectMap["description"] = rpmad.Description + } + if rpmad.InstanceType != "" { + objectMap["instanceType"] = rpmad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return &rpmad, true +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanManualActionDetails. +func (rpmad RecoveryPlanManualActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpmad, true +} + +// RecoveryPlanPlannedFailoverInput recovery plan planned failover input. +type RecoveryPlanPlannedFailoverInput struct { + // Properties - The recovery plan planned failover input properties. + Properties *RecoveryPlanPlannedFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanPlannedFailoverInputProperties recovery plan planned failover input properties. +type RecoveryPlanPlannedFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanPlannedFailoverInputProperties struct. +func (rppfip *RecoveryPlanPlannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rppfip.FailoverDirection = failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rppfip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanProperties recovery plan properties. +type RecoveryPlanProperties struct { + // FriendlyName - The friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // PrimaryFabricID - The primary fabric Id. + PrimaryFabricID *string `json:"primaryFabricId,omitempty"` + // PrimaryFabricFriendlyName - The primary fabric friendly name. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // RecoveryFabricID - The recovery fabric Id. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // RecoveryFabricFriendlyName - The recovery fabric friendly name. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // FailoverDeploymentModel - The failover deployment model. + FailoverDeploymentModel *string `json:"failoverDeploymentModel,omitempty"` + // ReplicationProviders - The list of replication providers. + ReplicationProviders *[]string `json:"replicationProviders,omitempty"` + // AllowedOperations - The list of allowed operations. + AllowedOperations *[]string `json:"allowedOperations,omitempty"` + // LastPlannedFailoverTime - The start time of the last planned failover. + LastPlannedFailoverTime *date.Time `json:"lastPlannedFailoverTime,omitempty"` + // LastUnplannedFailoverTime - The start time of the last unplanned failover. + LastUnplannedFailoverTime *date.Time `json:"lastUnplannedFailoverTime,omitempty"` + // LastTestFailoverTime - The start time of the last test failover. + LastTestFailoverTime *date.Time `json:"lastTestFailoverTime,omitempty"` + // CurrentScenario - The current scenario details. + CurrentScenario *CurrentScenarioDetails `json:"currentScenario,omitempty"` + // CurrentScenarioStatus - The recovery plan status. + CurrentScenarioStatus *string `json:"currentScenarioStatus,omitempty"` + // CurrentScenarioStatusDescription - The recovery plan status description. + CurrentScenarioStatusDescription *string `json:"currentScenarioStatusDescription,omitempty"` + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` + // ProviderSpecificDetails - The provider id and provider specific details. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanProperties struct. +func (rpp *RecoveryPlanProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpp.FriendlyName = &friendlyName + } + case "primaryFabricId": + if v != nil { + var primaryFabricID string + err = json.Unmarshal(*v, &primaryFabricID) + if err != nil { + return err + } + rpp.PrimaryFabricID = &primaryFabricID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + rpp.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + rpp.RecoveryFabricID = &recoveryFabricID + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + rpp.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "failoverDeploymentModel": + if v != nil { + var failoverDeploymentModel string + err = json.Unmarshal(*v, &failoverDeploymentModel) + if err != nil { + return err + } + rpp.FailoverDeploymentModel = &failoverDeploymentModel + } + case "replicationProviders": + if v != nil { + var replicationProviders []string + err = json.Unmarshal(*v, &replicationProviders) + if err != nil { + return err + } + rpp.ReplicationProviders = &replicationProviders + } + case "allowedOperations": + if v != nil { + var allowedOperations []string + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + rpp.AllowedOperations = &allowedOperations + } + case "lastPlannedFailoverTime": + if v != nil { + var lastPlannedFailoverTime date.Time + err = json.Unmarshal(*v, &lastPlannedFailoverTime) + if err != nil { + return err + } + rpp.LastPlannedFailoverTime = &lastPlannedFailoverTime + } + case "lastUnplannedFailoverTime": + if v != nil { + var lastUnplannedFailoverTime date.Time + err = json.Unmarshal(*v, &lastUnplannedFailoverTime) + if err != nil { + return err + } + rpp.LastUnplannedFailoverTime = &lastUnplannedFailoverTime + } + case "lastTestFailoverTime": + if v != nil { + var lastTestFailoverTime date.Time + err = json.Unmarshal(*v, &lastTestFailoverTime) + if err != nil { + return err + } + rpp.LastTestFailoverTime = &lastTestFailoverTime + } + case "currentScenario": + if v != nil { + var currentScenario CurrentScenarioDetails + err = json.Unmarshal(*v, ¤tScenario) + if err != nil { + return err + } + rpp.CurrentScenario = ¤tScenario + } + case "currentScenarioStatus": + if v != nil { + var currentScenarioStatus string + err = json.Unmarshal(*v, ¤tScenarioStatus) + if err != nil { + return err + } + rpp.CurrentScenarioStatus = ¤tScenarioStatus + } + case "currentScenarioStatusDescription": + if v != nil { + var currentScenarioStatusDescription string + err = json.Unmarshal(*v, ¤tScenarioStatusDescription) + if err != nil { + return err + } + rpp.CurrentScenarioStatusDescription = ¤tScenarioStatusDescription + } + case "groups": + if v != nil { + var groups []RecoveryPlanGroup + err = json.Unmarshal(*v, &groups) + if err != nil { + return err + } + rpp.Groups = &groups + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificDetailsArray(*v) + if err != nil { + return err + } + rpp.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanProtectedItem recovery plan protected item. +type RecoveryPlanProtectedItem struct { + // ID - The ARM Id of the recovery plan protected item. + ID *string `json:"id,omitempty"` + // VirtualMachineID - The virtual machine Id. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` +} + +// BasicRecoveryPlanProviderSpecificDetails recovery plan provider specific details. +type BasicRecoveryPlanProviderSpecificDetails interface { + AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) + AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) +} + +// RecoveryPlanProviderSpecificDetails recovery plan provider specific details. +type RecoveryPlanProviderSpecificDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails', 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificDetails(body []byte) (BasicRecoveryPlanProviderSpecificDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A): + var rpad RecoveryPlanA2ADetails + err := json.Unmarshal(body, &rpad) + return rpad, err + default: + var rppsd RecoveryPlanProviderSpecificDetails + err := json.Unmarshal(body, &rppsd) + return rppsd, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificDetailsArray(body []byte) ([]BasicRecoveryPlanProviderSpecificDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsdArray := make([]BasicRecoveryPlanProviderSpecificDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsd, err := unmarshalBasicRecoveryPlanProviderSpecificDetails(*rawMessage) + if err != nil { + return nil, err + } + rppsdArray[index] = rppsd + } + return rppsdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) MarshalJSON() ([]byte, error) { + rppsd.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails + objectMap := make(map[string]interface{}) + if rppsd.InstanceType != "" { + objectMap["instanceType"] = rppsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2ADetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsRecoveryPlanA2ADetails() (*RecoveryPlanA2ADetails, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsRecoveryPlanProviderSpecificDetails() (*RecoveryPlanProviderSpecificDetails, bool) { + return &rppsd, true +} + +// AsBasicRecoveryPlanProviderSpecificDetails is the BasicRecoveryPlanProviderSpecificDetails implementation for RecoveryPlanProviderSpecificDetails. +func (rppsd RecoveryPlanProviderSpecificDetails) AsBasicRecoveryPlanProviderSpecificDetails() (BasicRecoveryPlanProviderSpecificDetails, bool) { + return &rppsd, true +} + +// BasicRecoveryPlanProviderSpecificFailoverInput recovery plan provider specific failover input. +type BasicRecoveryPlanProviderSpecificFailoverInput interface { + AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) + AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) + AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) + AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) + AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) + AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) + AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) + AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) +} + +// RecoveryPlanProviderSpecificFailoverInput recovery plan provider specific failover input. +type RecoveryPlanProviderSpecificFailoverInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificFailoverInput(body []byte) (BasicRecoveryPlanProviderSpecificFailoverInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeA2A): + var rpafi RecoveryPlanA2AFailoverInput + err := json.Unmarshal(body, &rpafi) + return rpafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzureFailback): + var rphvrafi RecoveryPlanHyperVReplicaAzureFailbackInput + err := json.Unmarshal(body, &rphvrafi) + return rphvrafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeHyperVReplicaAzure): + var rphvrafi RecoveryPlanHyperVReplicaAzureFailoverInput + err := json.Unmarshal(body, &rphvrafi) + return rphvrafi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageAzureV2): + var rpimavfi RecoveryPlanInMageAzureV2FailoverInput + err := json.Unmarshal(body, &rpimavfi) + return rpimavfi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMage): + var rpimfi RecoveryPlanInMageFailoverInput + err := json.Unmarshal(body, &rpimfi) + return rpimfi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcmFailback): + var rpimrffi RecoveryPlanInMageRcmFailbackFailoverInput + err := json.Unmarshal(body, &rpimrffi) + return rpimrffi, err + case string(InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeInMageRcm): + var rpimrfi RecoveryPlanInMageRcmFailoverInput + err := json.Unmarshal(body, &rpimrfi) + return rpimrfi, err + default: + var rppsfi RecoveryPlanProviderSpecificFailoverInput + err := json.Unmarshal(body, &rppsfi) + return rppsfi, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(body []byte) ([]BasicRecoveryPlanProviderSpecificFailoverInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsfiArray := make([]BasicRecoveryPlanProviderSpecificFailoverInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsfi, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInput(*rawMessage) + if err != nil { + return nil, err + } + rppsfiArray[index] = rppsfi + } + return rppsfiArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) MarshalJSON() ([]byte, error) { + rppsfi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInputInstanceTypeRecoveryPlanProviderSpecificFailoverInput + objectMap := make(map[string]interface{}) + if rppsfi.InstanceType != "" { + objectMap["instanceType"] = rppsfi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanA2AFailoverInput() (*RecoveryPlanA2AFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailbackInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailbackInput() (*RecoveryPlanHyperVReplicaAzureFailbackInput, bool) { + return nil, false +} + +// AsRecoveryPlanHyperVReplicaAzureFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanHyperVReplicaAzureFailoverInput() (*RecoveryPlanHyperVReplicaAzureFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageAzureV2FailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageAzureV2FailoverInput() (*RecoveryPlanInMageAzureV2FailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageFailoverInput() (*RecoveryPlanInMageFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailbackFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageRcmFailbackFailoverInput() (*RecoveryPlanInMageRcmFailbackFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanInMageRcmFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanInMageRcmFailoverInput() (*RecoveryPlanInMageRcmFailoverInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsRecoveryPlanProviderSpecificFailoverInput() (*RecoveryPlanProviderSpecificFailoverInput, bool) { + return &rppsfi, true +} + +// AsBasicRecoveryPlanProviderSpecificFailoverInput is the BasicRecoveryPlanProviderSpecificFailoverInput implementation for RecoveryPlanProviderSpecificFailoverInput. +func (rppsfi RecoveryPlanProviderSpecificFailoverInput) AsBasicRecoveryPlanProviderSpecificFailoverInput() (BasicRecoveryPlanProviderSpecificFailoverInput, bool) { + return &rppsfi, true +} + +// BasicRecoveryPlanProviderSpecificInput recovery plan provider specific input base class. +type BasicRecoveryPlanProviderSpecificInput interface { + AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) + AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) +} + +// RecoveryPlanProviderSpecificInput recovery plan provider specific input base class. +type RecoveryPlanProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput', 'InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRecoveryPlanProviderSpecificInput(body []byte) (BasicRecoveryPlanProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeA2A): + var rpai RecoveryPlanA2AInput + err := json.Unmarshal(body, &rpai) + return rpai, err + default: + var rppsi RecoveryPlanProviderSpecificInput + err := json.Unmarshal(body, &rppsi) + return rppsi, err + } +} +func unmarshalBasicRecoveryPlanProviderSpecificInputArray(body []byte) ([]BasicRecoveryPlanProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppsiArray := make([]BasicRecoveryPlanProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppsi, err := unmarshalBasicRecoveryPlanProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rppsiArray[index] = rppsi + } + return rppsiArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) MarshalJSON() ([]byte, error) { + rppsi.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificInputInstanceTypeRecoveryPlanProviderSpecificInput + objectMap := make(map[string]interface{}) + if rppsi.InstanceType != "" { + objectMap["instanceType"] = rppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanA2AInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsRecoveryPlanA2AInput() (*RecoveryPlanA2AInput, bool) { + return nil, false +} + +// AsRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsRecoveryPlanProviderSpecificInput() (*RecoveryPlanProviderSpecificInput, bool) { + return &rppsi, true +} + +// AsBasicRecoveryPlanProviderSpecificInput is the BasicRecoveryPlanProviderSpecificInput implementation for RecoveryPlanProviderSpecificInput. +func (rppsi RecoveryPlanProviderSpecificInput) AsBasicRecoveryPlanProviderSpecificInput() (BasicRecoveryPlanProviderSpecificInput, bool) { + return &rppsi, true +} + +// RecoveryPlanScriptActionDetails recovery plan script action details. +type RecoveryPlanScriptActionDetails struct { + // Path - The script path. + Path *string `json:"path,omitempty"` + // Timeout - The script timeout. + Timeout *string `json:"timeout,omitempty"` + // FabricLocation - The fabric location. Possible values include: 'Primary', 'Recovery' + FabricLocation RecoveryPlanActionLocation `json:"fabricLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanActionDetails', 'InstanceTypeAutomationRunbookActionDetails', 'InstanceTypeManualActionDetails', 'InstanceTypeScriptActionDetails' + InstanceType InstanceTypeBasicRecoveryPlanActionDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) MarshalJSON() ([]byte, error) { + rpsad.InstanceType = InstanceTypeScriptActionDetails + objectMap := make(map[string]interface{}) + if rpsad.Path != nil { + objectMap["path"] = rpsad.Path + } + if rpsad.Timeout != nil { + objectMap["timeout"] = rpsad.Timeout + } + if rpsad.FabricLocation != "" { + objectMap["fabricLocation"] = rpsad.FabricLocation + } + if rpsad.InstanceType != "" { + objectMap["instanceType"] = rpsad.InstanceType + } + return json.Marshal(objectMap) +} + +// AsRecoveryPlanAutomationRunbookActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanAutomationRunbookActionDetails() (*RecoveryPlanAutomationRunbookActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanManualActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanManualActionDetails() (*RecoveryPlanManualActionDetails, bool) { + return nil, false +} + +// AsRecoveryPlanScriptActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanScriptActionDetails() (*RecoveryPlanScriptActionDetails, bool) { + return &rpsad, true +} + +// AsRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsRecoveryPlanActionDetails() (*RecoveryPlanActionDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanActionDetails is the BasicRecoveryPlanActionDetails implementation for RecoveryPlanScriptActionDetails. +func (rpsad RecoveryPlanScriptActionDetails) AsBasicRecoveryPlanActionDetails() (BasicRecoveryPlanActionDetails, bool) { + return &rpsad, true +} + +// RecoveryPlanShutdownGroupTaskDetails this class represents the recovery plan shutdown group task +// details. +type RecoveryPlanShutdownGroupTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // GroupID - The group identifier. + GroupID *string `json:"groupId,omitempty"` + // RpGroupType - The group type. + RpGroupType *string `json:"rpGroupType,omitempty"` + // ChildTasks - The child tasks. + ChildTasks *[]ASRTask `json:"childTasks,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeGroupTaskDetails', 'InstanceTypeInlineWorkflowTaskDetails', 'InstanceTypeRecoveryPlanGroupTaskDetails', 'InstanceTypeRecoveryPlanShutdownGroupTaskDetails' + InstanceType InstanceTypeBasicGroupTaskDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) MarshalJSON() ([]byte, error) { + rpsgtd.InstanceType = InstanceTypeRecoveryPlanShutdownGroupTaskDetails + objectMap := make(map[string]interface{}) + if rpsgtd.Name != nil { + objectMap["name"] = rpsgtd.Name + } + if rpsgtd.GroupID != nil { + objectMap["groupId"] = rpsgtd.GroupID + } + if rpsgtd.RpGroupType != nil { + objectMap["rpGroupType"] = rpsgtd.RpGroupType + } + if rpsgtd.ChildTasks != nil { + objectMap["childTasks"] = rpsgtd.ChildTasks + } + if rpsgtd.InstanceType != "" { + objectMap["instanceType"] = rpsgtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInlineWorkflowTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsInlineWorkflowTaskDetails() (*InlineWorkflowTaskDetails, bool) { + return nil, false +} + +// AsRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsRecoveryPlanGroupTaskDetails() (*RecoveryPlanGroupTaskDetails, bool) { + return nil, false +} + +// AsBasicRecoveryPlanGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsBasicRecoveryPlanGroupTaskDetails() (BasicRecoveryPlanGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// AsRecoveryPlanShutdownGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsRecoveryPlanShutdownGroupTaskDetails() (*RecoveryPlanShutdownGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// AsGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsGroupTaskDetails() (*GroupTaskDetails, bool) { + return nil, false +} + +// AsBasicGroupTaskDetails is the BasicGroupTaskDetails implementation for RecoveryPlanShutdownGroupTaskDetails. +func (rpsgtd RecoveryPlanShutdownGroupTaskDetails) AsBasicGroupTaskDetails() (BasicGroupTaskDetails, bool) { + return &rpsgtd, true +} + +// RecoveryPlanTestFailoverCleanupInput recovery plan test failover cleanup input. +type RecoveryPlanTestFailoverCleanupInput struct { + // Properties - The recovery plan test failover cleanup input properties. + Properties *RecoveryPlanTestFailoverCleanupInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanTestFailoverCleanupInputProperties recovery plan test failover cleanup input properties. +type RecoveryPlanTestFailoverCleanupInputProperties struct { + // Comments - The test failover cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// RecoveryPlanTestFailoverInput recovery plan test failover input. +type RecoveryPlanTestFailoverInput struct { + // Properties - The recovery plan test failover input properties. + Properties *RecoveryPlanTestFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanTestFailoverInputProperties recovery plan test failover input properties. +type RecoveryPlanTestFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // NetworkType - The network type to be used for test failover. + NetworkType *string `json:"networkType,omitempty"` + // NetworkID - The Id of the network to be used for test failover. + NetworkID *string `json:"networkId,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanTestFailoverInputProperties struct. +func (rptfip *RecoveryPlanTestFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rptfip.FailoverDirection = failoverDirection + } + case "networkType": + if v != nil { + var networkType string + err = json.Unmarshal(*v, &networkType) + if err != nil { + return err + } + rptfip.NetworkType = &networkType + } + case "networkId": + if v != nil { + var networkID string + err = json.Unmarshal(*v, &networkID) + if err != nil { + return err + } + rptfip.NetworkID = &networkID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rptfip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPlanUnplannedFailoverInput recovery plan unplanned failover input. +type RecoveryPlanUnplannedFailoverInput struct { + // Properties - The recovery plan unplanned failover input properties. + Properties *RecoveryPlanUnplannedFailoverInputProperties `json:"properties,omitempty"` +} + +// RecoveryPlanUnplannedFailoverInputProperties recovery plan unplanned failover input properties. +type RecoveryPlanUnplannedFailoverInputProperties struct { + // FailoverDirection - The failover direction. Possible values include: 'PrimaryToRecovery', 'RecoveryToPrimary' + FailoverDirection PossibleOperationsDirections `json:"failoverDirection,omitempty"` + // SourceSiteOperations - A value indicating whether source site operations are required. Possible values include: 'Required', 'NotRequired' + SourceSiteOperations SourceSiteOperations `json:"sourceSiteOperations,omitempty"` + // ProviderSpecificDetails - The provider specific properties. + ProviderSpecificDetails *[]BasicRecoveryPlanProviderSpecificFailoverInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPlanUnplannedFailoverInputProperties struct. +func (rpufip *RecoveryPlanUnplannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection PossibleOperationsDirections + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rpufip.FailoverDirection = failoverDirection + } + case "sourceSiteOperations": + if v != nil { + var sourceSiteOperations SourceSiteOperations + err = json.Unmarshal(*v, &sourceSiteOperations) + if err != nil { + return err + } + rpufip.SourceSiteOperations = sourceSiteOperations + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRecoveryPlanProviderSpecificFailoverInputArray(*v) + if err != nil { + return err + } + rpufip.ProviderSpecificDetails = &providerSpecificDetails + } + } + } + + return nil +} + +// RecoveryPoint recovery point. +type RecoveryPoint struct { + autorest.Response `json:"-"` + // Properties - The recovery point properties. + Properties *RecoveryPointProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPoint. +func (rp RecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.Properties != nil { + objectMap["properties"] = rp.Properties + } + if rp.Location != nil { + objectMap["location"] = rp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryPointCollection collection of recovery point details. +type RecoveryPointCollection struct { + autorest.Response `json:"-"` + // Value - The recovery point details. + Value *[]RecoveryPoint `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryPointCollectionIterator provides access to a complete listing of RecoveryPoint values. +type RecoveryPointCollectionIterator struct { + i int + page RecoveryPointCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryPointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryPointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryPointCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryPointCollectionIterator) Response() RecoveryPointCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryPointCollectionIterator) Value() RecoveryPoint { + if !iter.page.NotDone() { + return RecoveryPoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryPointCollectionIterator type. +func NewRecoveryPointCollectionIterator(page RecoveryPointCollectionPage) RecoveryPointCollectionIterator { + return RecoveryPointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (RPCVar RecoveryPointCollection) IsEmpty() bool { + return RPCVar.Value == nil || len(*RPCVar.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (RPCVar RecoveryPointCollection) hasNextLink() bool { + return RPCVar.NextLink != nil && len(*RPCVar.NextLink) != 0 +} + +// recoveryPointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (RPCVar RecoveryPointCollection) recoveryPointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !RPCVar.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(RPCVar.NextLink))) +} + +// RecoveryPointCollectionPage contains a page of RecoveryPoint values. +type RecoveryPointCollectionPage struct { + fn func(context.Context, RecoveryPointCollection) (RecoveryPointCollection, error) + RPCVar RecoveryPointCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryPointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.RPCVar) + if err != nil { + return err + } + page.RPCVar = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryPointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryPointCollectionPage) NotDone() bool { + return !page.RPCVar.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryPointCollectionPage) Response() RecoveryPointCollection { + return page.RPCVar +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryPointCollectionPage) Values() []RecoveryPoint { + if page.RPCVar.IsEmpty() { + return nil + } + return *page.RPCVar.Value +} + +// Creates a new instance of the RecoveryPointCollectionPage type. +func NewRecoveryPointCollectionPage(cur RecoveryPointCollection, getNextPage func(context.Context, RecoveryPointCollection) (RecoveryPointCollection, error)) RecoveryPointCollectionPage { + return RecoveryPointCollectionPage{ + fn: getNextPage, + RPCVar: cur, + } +} + +// RecoveryPointProperties recovery point properties. +type RecoveryPointProperties struct { + // RecoveryPointTime - The recovery point time. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointType - The recovery point type: ApplicationConsistent, CrashConsistent. + RecoveryPointType *string `json:"recoveryPointType,omitempty"` + // ProviderSpecificDetails - The provider specific details for the recovery point. + ProviderSpecificDetails BasicProviderSpecificRecoveryPointDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPointProperties struct. +func (rpp *RecoveryPointProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryPointTime": + if v != nil { + var recoveryPointTime date.Time + err = json.Unmarshal(*v, &recoveryPointTime) + if err != nil { + return err + } + rpp.RecoveryPointTime = &recoveryPointTime + } + case "recoveryPointType": + if v != nil { + var recoveryPointType string + err = json.Unmarshal(*v, &recoveryPointType) + if err != nil { + return err + } + rpp.RecoveryPointType = &recoveryPointType + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicProviderSpecificRecoveryPointDetails(*v) + if err != nil { + return err + } + rpp.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicRecoveryProximityPlacementGroupCustomDetails recovery Proximity placement group custom input. +type BasicRecoveryProximityPlacementGroupCustomDetails interface { + AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) + AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) +} + +// RecoveryProximityPlacementGroupCustomDetails recovery Proximity placement group custom input. +type RecoveryProximityPlacementGroupCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails', 'ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(body []byte) (BasicRecoveryProximityPlacementGroupCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeExisting): + var erppg ExistingRecoveryProximityPlacementGroup + err := json.Unmarshal(body, &erppg) + return erppg, err + default: + var rppgcd RecoveryProximityPlacementGroupCustomDetails + err := json.Unmarshal(body, &rppgcd) + return rppgcd, err + } +} +func unmarshalBasicRecoveryProximityPlacementGroupCustomDetailsArray(body []byte) ([]BasicRecoveryProximityPlacementGroupCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rppgcdArray := make([]BasicRecoveryProximityPlacementGroupCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rppgcd, err := unmarshalBasicRecoveryProximityPlacementGroupCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rppgcdArray[index] = rppgcd + } + return rppgcdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) MarshalJSON() ([]byte, error) { + rppgcd.ResourceType = ResourceTypeBasicRecoveryProximityPlacementGroupCustomDetailsResourceTypeRecoveryProximityPlacementGroupCustomDetails + objectMap := make(map[string]interface{}) + if rppgcd.ResourceType != "" { + objectMap["resourceType"] = rppgcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryProximityPlacementGroup is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsExistingRecoveryProximityPlacementGroup() (*ExistingRecoveryProximityPlacementGroup, bool) { + return nil, false +} + +// AsRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsRecoveryProximityPlacementGroupCustomDetails() (*RecoveryProximityPlacementGroupCustomDetails, bool) { + return &rppgcd, true +} + +// AsBasicRecoveryProximityPlacementGroupCustomDetails is the BasicRecoveryProximityPlacementGroupCustomDetails implementation for RecoveryProximityPlacementGroupCustomDetails. +func (rppgcd RecoveryProximityPlacementGroupCustomDetails) AsBasicRecoveryProximityPlacementGroupCustomDetails() (BasicRecoveryProximityPlacementGroupCustomDetails, bool) { + return &rppgcd, true +} + +// BasicRecoveryResourceGroupCustomDetails recovery Resource Group custom input. +type BasicRecoveryResourceGroupCustomDetails interface { + AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) + AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) +} + +// RecoveryResourceGroupCustomDetails recovery Resource Group custom input. +type RecoveryResourceGroupCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails', 'ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicRecoveryResourceGroupCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryResourceGroupCustomDetails(body []byte) (BasicRecoveryResourceGroupCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeExisting): + var errrg ExistingRecoveryRecoveryResourceGroup + err := json.Unmarshal(body, &errrg) + return errrg, err + default: + var rrgcd RecoveryResourceGroupCustomDetails + err := json.Unmarshal(body, &rrgcd) + return rrgcd, err + } +} +func unmarshalBasicRecoveryResourceGroupCustomDetailsArray(body []byte) ([]BasicRecoveryResourceGroupCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rrgcdArray := make([]BasicRecoveryResourceGroupCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rrgcd, err := unmarshalBasicRecoveryResourceGroupCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rrgcdArray[index] = rrgcd + } + return rrgcdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) MarshalJSON() ([]byte, error) { + rrgcd.ResourceType = ResourceTypeBasicRecoveryResourceGroupCustomDetailsResourceTypeRecoveryResourceGroupCustomDetails + objectMap := make(map[string]interface{}) + if rrgcd.ResourceType != "" { + objectMap["resourceType"] = rrgcd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryRecoveryResourceGroup is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsExistingRecoveryRecoveryResourceGroup() (*ExistingRecoveryRecoveryResourceGroup, bool) { + return nil, false +} + +// AsRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsRecoveryResourceGroupCustomDetails() (*RecoveryResourceGroupCustomDetails, bool) { + return &rrgcd, true +} + +// AsBasicRecoveryResourceGroupCustomDetails is the BasicRecoveryResourceGroupCustomDetails implementation for RecoveryResourceGroupCustomDetails. +func (rrgcd RecoveryResourceGroupCustomDetails) AsBasicRecoveryResourceGroupCustomDetails() (BasicRecoveryResourceGroupCustomDetails, bool) { + return &rrgcd, true +} + +// RecoveryServicesProvider provider details. +type RecoveryServicesProvider struct { + autorest.Response `json:"-"` + // Properties - Provider properties. + Properties *RecoveryServicesProviderProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryServicesProvider. +func (rsp RecoveryServicesProvider) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rsp.Properties != nil { + objectMap["properties"] = rsp.Properties + } + if rsp.Location != nil { + objectMap["location"] = rsp.Location + } + return json.Marshal(objectMap) +} + +// RecoveryServicesProviderCollection collection of providers. +type RecoveryServicesProviderCollection struct { + autorest.Response `json:"-"` + // Value - The Servers details. + Value *[]RecoveryServicesProvider `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryServicesProviderCollectionIterator provides access to a complete listing of +// RecoveryServicesProvider values. +type RecoveryServicesProviderCollectionIterator struct { + i int + page RecoveryServicesProviderCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryServicesProviderCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryServicesProviderCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryServicesProviderCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryServicesProviderCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryServicesProviderCollectionIterator) Response() RecoveryServicesProviderCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryServicesProviderCollectionIterator) Value() RecoveryServicesProvider { + if !iter.page.NotDone() { + return RecoveryServicesProvider{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryServicesProviderCollectionIterator type. +func NewRecoveryServicesProviderCollectionIterator(page RecoveryServicesProviderCollectionPage) RecoveryServicesProviderCollectionIterator { + return RecoveryServicesProviderCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rspc RecoveryServicesProviderCollection) IsEmpty() bool { + return rspc.Value == nil || len(*rspc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rspc RecoveryServicesProviderCollection) hasNextLink() bool { + return rspc.NextLink != nil && len(*rspc.NextLink) != 0 +} + +// recoveryServicesProviderCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rspc RecoveryServicesProviderCollection) recoveryServicesProviderCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rspc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rspc.NextLink))) +} + +// RecoveryServicesProviderCollectionPage contains a page of RecoveryServicesProvider values. +type RecoveryServicesProviderCollectionPage struct { + fn func(context.Context, RecoveryServicesProviderCollection) (RecoveryServicesProviderCollection, error) + rspc RecoveryServicesProviderCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryServicesProviderCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryServicesProviderCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rspc) + if err != nil { + return err + } + page.rspc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryServicesProviderCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryServicesProviderCollectionPage) NotDone() bool { + return !page.rspc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryServicesProviderCollectionPage) Response() RecoveryServicesProviderCollection { + return page.rspc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryServicesProviderCollectionPage) Values() []RecoveryServicesProvider { + if page.rspc.IsEmpty() { + return nil + } + return *page.rspc.Value +} + +// Creates a new instance of the RecoveryServicesProviderCollectionPage type. +func NewRecoveryServicesProviderCollectionPage(cur RecoveryServicesProviderCollection, getNextPage func(context.Context, RecoveryServicesProviderCollection) (RecoveryServicesProviderCollection, error)) RecoveryServicesProviderCollectionPage { + return RecoveryServicesProviderCollectionPage{ + fn: getNextPage, + rspc: cur, + } +} + +// RecoveryServicesProviderProperties recovery services provider properties. +type RecoveryServicesProviderProperties struct { + // FabricType - Type of the site. + FabricType *string `json:"fabricType,omitempty"` + // FriendlyName - Friendly name of the DRA. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProviderVersion - The provider version. + ProviderVersion *string `json:"providerVersion,omitempty"` + // ServerVersion - The fabric provider. + ServerVersion *string `json:"serverVersion,omitempty"` + // ProviderVersionState - DRA version status. + ProviderVersionState *string `json:"providerVersionState,omitempty"` + // ProviderVersionExpiryDate - Expiry date of the version. + ProviderVersionExpiryDate *date.Time `json:"providerVersionExpiryDate,omitempty"` + // FabricFriendlyName - The fabric friendly name. + FabricFriendlyName *string `json:"fabricFriendlyName,omitempty"` + // LastHeartBeat - Time when last heartbeat was sent by the DRA. + LastHeartBeat *date.Time `json:"lastHeartBeat,omitempty"` + // ConnectionStatus - A value indicating whether DRA is responsive. + ConnectionStatus *string `json:"connectionStatus,omitempty"` + // ProtectedItemCount - Number of protected VMs currently managed by the DRA. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // AllowedScenarios - The scenarios allowed on this provider. + AllowedScenarios *[]string `json:"allowedScenarios,omitempty"` + // HealthErrorDetails - The recovery services provider health error details. + HealthErrorDetails *[]HealthError `json:"healthErrorDetails,omitempty"` + // DraIdentifier - The DRA Id. + DraIdentifier *string `json:"draIdentifier,omitempty"` + // MachineID - The machine Id. + MachineID *string `json:"machineId,omitempty"` + // MachineName - The machine name. + MachineName *string `json:"machineName,omitempty"` + // BiosID - The Bios Id. + BiosID *string `json:"biosId,omitempty"` + // AuthenticationIdentityDetails - The authentication identity details. + AuthenticationIdentityDetails *IdentityProviderDetails `json:"authenticationIdentityDetails,omitempty"` + // ResourceAccessIdentityDetails - The resource access identity details. + ResourceAccessIdentityDetails *IdentityProviderDetails `json:"resourceAccessIdentityDetails,omitempty"` + // DataPlaneAuthenticationIdentityDetails - The data plane authentication identity details. + DataPlaneAuthenticationIdentityDetails *IdentityProviderDetails `json:"dataPlaneAuthenticationIdentityDetails,omitempty"` + // ProviderVersionDetails - The provider version details. + ProviderVersionDetails *VersionDetails `json:"providerVersionDetails,omitempty"` +} + +// BasicRecoveryVirtualNetworkCustomDetails recovery Virtual network custom input. +type BasicRecoveryVirtualNetworkCustomDetails interface { + AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) + AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) + AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) +} + +// RecoveryVirtualNetworkCustomDetails recovery Virtual network custom input. +type RecoveryVirtualNetworkCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting', 'ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew' + ResourceType ResourceTypeBasicRecoveryVirtualNetworkCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicRecoveryVirtualNetworkCustomDetails(body []byte) (BasicRecoveryVirtualNetworkCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeExisting): + var ervn ExistingRecoveryVirtualNetwork + err := json.Unmarshal(body, &ervn) + return ervn, err + case string(ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeNew): + var nrvn NewRecoveryVirtualNetwork + err := json.Unmarshal(body, &nrvn) + return nrvn, err + default: + var rvncd RecoveryVirtualNetworkCustomDetails + err := json.Unmarshal(body, &rvncd) + return rvncd, err + } +} +func unmarshalBasicRecoveryVirtualNetworkCustomDetailsArray(body []byte) ([]BasicRecoveryVirtualNetworkCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rvncdArray := make([]BasicRecoveryVirtualNetworkCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rvncd, err := unmarshalBasicRecoveryVirtualNetworkCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + rvncdArray[index] = rvncd + } + return rvncdArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) MarshalJSON() ([]byte, error) { + rvncd.ResourceType = ResourceTypeBasicRecoveryVirtualNetworkCustomDetailsResourceTypeRecoveryVirtualNetworkCustomDetails + objectMap := make(map[string]interface{}) + if rvncd.ResourceType != "" { + objectMap["resourceType"] = rvncd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsExistingRecoveryVirtualNetwork() (*ExistingRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsNewRecoveryVirtualNetwork is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsNewRecoveryVirtualNetwork() (*NewRecoveryVirtualNetwork, bool) { + return nil, false +} + +// AsRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsRecoveryVirtualNetworkCustomDetails() (*RecoveryVirtualNetworkCustomDetails, bool) { + return &rvncd, true +} + +// AsBasicRecoveryVirtualNetworkCustomDetails is the BasicRecoveryVirtualNetworkCustomDetails implementation for RecoveryVirtualNetworkCustomDetails. +func (rvncd RecoveryVirtualNetworkCustomDetails) AsBasicRecoveryVirtualNetworkCustomDetails() (BasicRecoveryVirtualNetworkCustomDetails, bool) { + return &rvncd, true +} + +// RemoveDisksInput input for remove disk(s) operation. +type RemoveDisksInput struct { + // Properties - Remove disk input properties. + Properties *RemoveDisksInputProperties `json:"properties,omitempty"` +} + +// RemoveDisksInputProperties remove Disk input properties. +type RemoveDisksInputProperties struct { + // ProviderSpecificDetails - The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + ProviderSpecificDetails BasicRemoveDisksProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RemoveDisksInputProperties struct. +func (rdip *RemoveDisksInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicRemoveDisksProviderSpecificInput(*v) + if err != nil { + return err + } + rdip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicRemoveDisksProviderSpecificInput remove Disk provider specific input. +type BasicRemoveDisksProviderSpecificInput interface { + AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) + AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) +} + +// RemoveDisksProviderSpecificInput remove Disk provider specific input. +type RemoveDisksProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput', 'InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicRemoveDisksProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicRemoveDisksProviderSpecificInput(body []byte) (BasicRemoveDisksProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeA2A): + var ardi A2ARemoveDisksInput + err := json.Unmarshal(body, &ardi) + return ardi, err + default: + var rdpsi RemoveDisksProviderSpecificInput + err := json.Unmarshal(body, &rdpsi) + return rdpsi, err + } +} +func unmarshalBasicRemoveDisksProviderSpecificInputArray(body []byte) ([]BasicRemoveDisksProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rdpsiArray := make([]BasicRemoveDisksProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rdpsi, err := unmarshalBasicRemoveDisksProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rdpsiArray[index] = rdpsi + } + return rdpsiArray, nil +} + +// MarshalJSON is the custom marshaler for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) MarshalJSON() ([]byte, error) { + rdpsi.InstanceType = InstanceTypeBasicRemoveDisksProviderSpecificInputInstanceTypeRemoveDisksProviderSpecificInput + objectMap := make(map[string]interface{}) + if rdpsi.InstanceType != "" { + objectMap["instanceType"] = rdpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ARemoveDisksInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsA2ARemoveDisksInput() (*A2ARemoveDisksInput, bool) { + return nil, false +} + +// AsRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsRemoveDisksProviderSpecificInput() (*RemoveDisksProviderSpecificInput, bool) { + return &rdpsi, true +} + +// AsBasicRemoveDisksProviderSpecificInput is the BasicRemoveDisksProviderSpecificInput implementation for RemoveDisksProviderSpecificInput. +func (rdpsi RemoveDisksProviderSpecificInput) AsBasicRemoveDisksProviderSpecificInput() (BasicRemoveDisksProviderSpecificInput, bool) { + return &rdpsi, true +} + +// RemoveProtectionContainerMappingInput container unpairing input. +type RemoveProtectionContainerMappingInput struct { + // Properties - Configure protection input properties. + Properties *RemoveProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// RemoveProtectionContainerMappingInputProperties unpairing input properties. +type RemoveProtectionContainerMappingInputProperties struct { + // ProviderSpecificInput - Provider specific input for unpairing. + ProviderSpecificInput *ReplicationProviderContainerUnmappingInput `json:"providerSpecificInput,omitempty"` +} + +// RenewCertificateInput certificate renewal input. +type RenewCertificateInput struct { + // Properties - Renew certificate input properties. + Properties *RenewCertificateInputProperties `json:"properties,omitempty"` +} + +// RenewCertificateInputProperties renew Certificate input properties. +type RenewCertificateInputProperties struct { + // RenewCertificateType - Renew certificate type. + RenewCertificateType *string `json:"renewCertificateType,omitempty"` +} + +// ReplicationAgentDetails replication agent details. +type ReplicationAgentDetails struct { + // ID - READ-ONLY; The replication agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The replication agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The replication agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The replication agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the replication agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the replication agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationAgentDetails. +func (rad ReplicationAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ReplicationAppliance replication appliance definition. +type ReplicationAppliance struct { + // Properties - Appliance related data. + Properties *ReplicationApplianceProperties `json:"properties,omitempty"` +} + +// ReplicationApplianceProperties replication appliance properties. +type ReplicationApplianceProperties struct { + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicApplianceSpecificDetails `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ReplicationApplianceProperties struct. +func (rap *ReplicationApplianceProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicApplianceSpecificDetails(*v) + if err != nil { + return err + } + rap.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// ReplicationEligibilityResults replication eligibility results response model. +type ReplicationEligibilityResults struct { + autorest.Response `json:"-"` + // Name - READ-ONLY; Gets the name of this object. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets the object type. + Type *string `json:"type,omitempty"` + // ID - READ-ONLY; Gets Unique ARM identifier for this object. + ID *string `json:"id,omitempty"` + // Properties - READ-ONLY; Gets properties model for replication eligibility results API. + Properties *ReplicationEligibilityResultsProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResults. +func (rer ReplicationEligibilityResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ReplicationEligibilityResultsCollection replication eligibility results collection response model. +type ReplicationEligibilityResultsCollection struct { + autorest.Response `json:"-"` + // Value - The replication eligibility results details. + Value *[]ReplicationEligibilityResults `json:"value,omitempty"` +} + +// ReplicationEligibilityResultsErrorInfo error model that can be exposed to the user. +type ReplicationEligibilityResultsErrorInfo struct { + // Code - The error code. + Code *string `json:"code,omitempty"` + // Message - The error message. + Message *string `json:"message,omitempty"` + // PossibleCauses - The possible causes. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - The recommended action. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // Status - READ-ONLY; The error status. + Status *string `json:"status,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResultsErrorInfo. +func (rerei ReplicationEligibilityResultsErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rerei.Code != nil { + objectMap["code"] = rerei.Code + } + if rerei.Message != nil { + objectMap["message"] = rerei.Message + } + if rerei.PossibleCauses != nil { + objectMap["possibleCauses"] = rerei.PossibleCauses + } + if rerei.RecommendedAction != nil { + objectMap["recommendedAction"] = rerei.RecommendedAction + } + return json.Marshal(objectMap) +} + +// ReplicationEligibilityResultsProperties properties model for replication eligibility results API. +type ReplicationEligibilityResultsProperties struct { + // ClientRequestID - READ-ONLY; The client request Id. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // Errors - The error details. + Errors *[]ReplicationEligibilityResultsErrorInfo `json:"errors,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationEligibilityResultsProperties. +func (rerp ReplicationEligibilityResultsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rerp.Errors != nil { + objectMap["errors"] = rerp.Errors + } + return json.Marshal(objectMap) +} + +// ReplicationFabricsCheckConsistencyFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsCheckConsistencyFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsCheckConsistencyFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsCheckConsistencyFuture.Result. +func (future *ReplicationFabricsCheckConsistencyFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCheckConsistencyFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsCheckConsistencyFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.CheckConsistencyResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCheckConsistencyFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsCreateFuture.Result. +func (future *ReplicationFabricsCreateFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.CreateResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsCreateFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsDeleteFuture.Result. +func (future *ReplicationFabricsDeleteFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsMigrateToAadFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsMigrateToAadFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsMigrateToAadFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsMigrateToAadFuture.Result. +func (future *ReplicationFabricsMigrateToAadFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsMigrateToAadFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsMigrateToAadFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsPurgeFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationFabricsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsPurgeFuture.Result. +func (future *ReplicationFabricsPurgeFuture) result(client ReplicationFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationFabricsReassociateGatewayFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsReassociateGatewayFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsReassociateGatewayFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsReassociateGatewayFuture.Result. +func (future *ReplicationFabricsReassociateGatewayFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsReassociateGatewayFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsReassociateGatewayFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.ReassociateGatewayResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsReassociateGatewayFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationFabricsRenewCertificateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationFabricsRenewCertificateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationFabricsClient) (Fabric, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationFabricsRenewCertificateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationFabricsRenewCertificateFuture.Result. +func (future *ReplicationFabricsRenewCertificateFuture) result(client ReplicationFabricsClient) (f Fabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsRenewCertificateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + f.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationFabricsRenewCertificateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent { + f, err = client.RenewCertificateResponder(f.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsRenewCertificateFuture", "Result", f.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationGroupDetails replication group details. This will be used in case of San. +type ReplicationGroupDetails struct { + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) MarshalJSON() ([]byte, error) { + rgd.InstanceType = InstanceTypeReplicationGroupDetails + objectMap := make(map[string]interface{}) + if rgd.InstanceType != "" { + objectMap["instanceType"] = rgd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return &rgd, true +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for ReplicationGroupDetails. +func (rgd ReplicationGroupDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &rgd, true +} + +// ReplicationJobsCancelFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsCancelFuture.Result. +func (future *ReplicationJobsCancelFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.CancelResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsCancelFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsExportFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsExportFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsExportFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsExportFuture.Result. +func (future *ReplicationJobsExportFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsExportFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsExportFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.ExportResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsExportFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsRestartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsRestartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsRestartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsRestartFuture.Result. +func (future *ReplicationJobsRestartFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsRestartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsRestartFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.RestartResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsRestartFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationJobsResumeFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationJobsResumeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationJobsClient) (Job, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationJobsResumeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationJobsResumeFuture.Result. +func (future *ReplicationJobsResumeFuture) result(client ReplicationJobsClient) (j Job, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsResumeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + j.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationJobsResumeFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if j.Response.Response, err = future.GetResult(sender); err == nil && j.Response.Response.StatusCode != http.StatusNoContent { + j, err = client.ResumeResponder(j.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsResumeFuture", "Result", j.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsCreateFuture.Result. +func (future *ReplicationMigrationItemsCreateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.CreateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsCreateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsDeleteFuture.Result. +func (future *ReplicationMigrationItemsDeleteFuture) result(client ReplicationMigrationItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationMigrationItemsMigrateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsMigrateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsMigrateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsMigrateFuture.Result. +func (future *ReplicationMigrationItemsMigrateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsMigrateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsMigrateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.MigrateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsMigrateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsResyncFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsResyncFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsResyncFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsResyncFuture.Result. +func (future *ReplicationMigrationItemsResyncFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsResyncFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsResyncFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.ResyncResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsResyncFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsTestMigrateCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationMigrationItemsTestMigrateCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsTestMigrateCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsTestMigrateCleanupFuture.Result. +func (future *ReplicationMigrationItemsTestMigrateCleanupFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.TestMigrateCleanupResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsTestMigrateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsTestMigrateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsTestMigrateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsTestMigrateFuture.Result. +func (future *ReplicationMigrationItemsTestMigrateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsTestMigrateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.TestMigrateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsTestMigrateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationMigrationItemsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationMigrationItemsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationMigrationItemsClient) (MigrationItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationMigrationItemsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationMigrationItemsUpdateFuture.Result. +func (future *ReplicationMigrationItemsUpdateFuture) result(client ReplicationMigrationItemsClient) (mi MigrationItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationMigrationItemsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { + mi, err = client.UpdateResponder(mi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsUpdateFuture", "Result", mi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationNetworkMappingsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (NetworkMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsCreateFuture.Result. +func (future *ReplicationNetworkMappingsCreateFuture) result(client ReplicationNetworkMappingsClient) (nm NetworkMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + nm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nm.Response.Response, err = future.GetResult(sender); err == nil && nm.Response.Response.StatusCode != http.StatusNoContent { + nm, err = client.CreateResponder(nm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsCreateFuture", "Result", nm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationNetworkMappingsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsDeleteFuture.Result. +func (future *ReplicationNetworkMappingsDeleteFuture) result(client ReplicationNetworkMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationNetworkMappingsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationNetworkMappingsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationNetworkMappingsClient) (NetworkMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationNetworkMappingsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationNetworkMappingsUpdateFuture.Result. +func (future *ReplicationNetworkMappingsUpdateFuture) result(client ReplicationNetworkMappingsClient) (nm NetworkMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + nm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationNetworkMappingsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nm.Response.Response, err = future.GetResult(sender); err == nil && nm.Response.Response.StatusCode != http.StatusNoContent { + nm, err = client.UpdateResponder(nm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsUpdateFuture", "Result", nm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationPoliciesCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (Policy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesCreateFuture.Result. +func (future *ReplicationPoliciesCreateFuture) result(client ReplicationPoliciesClient) (p Policy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + p.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.CreateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesCreateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesDeleteFuture.Result. +func (future *ReplicationPoliciesDeleteFuture) result(client ReplicationPoliciesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationPoliciesUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationPoliciesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationPoliciesClient) (Policy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationPoliciesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationPoliciesUpdateFuture.Result. +func (future *ReplicationPoliciesUpdateFuture) result(client ReplicationPoliciesClient) (p Policy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + p.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationPoliciesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.UpdateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesUpdateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItem replication protected item. +type ReplicationProtectedItem struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ReplicationProtectedItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectedItem. +func (rpi ReplicationProtectedItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpi.Properties != nil { + objectMap["properties"] = rpi.Properties + } + if rpi.Location != nil { + objectMap["location"] = rpi.Location + } + return json.Marshal(objectMap) +} + +// ReplicationProtectedItemCollection replication protected item collection. +type ReplicationProtectedItemCollection struct { + autorest.Response `json:"-"` + // Value - The Replication protected item details. + Value *[]ReplicationProtectedItem `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ReplicationProtectedItemCollectionIterator provides access to a complete listing of +// ReplicationProtectedItem values. +type ReplicationProtectedItemCollectionIterator struct { + i int + page ReplicationProtectedItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ReplicationProtectedItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ReplicationProtectedItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ReplicationProtectedItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ReplicationProtectedItemCollectionIterator) Response() ReplicationProtectedItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ReplicationProtectedItemCollectionIterator) Value() ReplicationProtectedItem { + if !iter.page.NotDone() { + return ReplicationProtectedItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ReplicationProtectedItemCollectionIterator type. +func NewReplicationProtectedItemCollectionIterator(page ReplicationProtectedItemCollectionPage) ReplicationProtectedItemCollectionIterator { + return ReplicationProtectedItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rpic ReplicationProtectedItemCollection) IsEmpty() bool { + return rpic.Value == nil || len(*rpic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rpic ReplicationProtectedItemCollection) hasNextLink() bool { + return rpic.NextLink != nil && len(*rpic.NextLink) != 0 +} + +// replicationProtectedItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rpic ReplicationProtectedItemCollection) replicationProtectedItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rpic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rpic.NextLink))) +} + +// ReplicationProtectedItemCollectionPage contains a page of ReplicationProtectedItem values. +type ReplicationProtectedItemCollectionPage struct { + fn func(context.Context, ReplicationProtectedItemCollection) (ReplicationProtectedItemCollection, error) + rpic ReplicationProtectedItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ReplicationProtectedItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rpic) + if err != nil { + return err + } + page.rpic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ReplicationProtectedItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ReplicationProtectedItemCollectionPage) NotDone() bool { + return !page.rpic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ReplicationProtectedItemCollectionPage) Response() ReplicationProtectedItemCollection { + return page.rpic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ReplicationProtectedItemCollectionPage) Values() []ReplicationProtectedItem { + if page.rpic.IsEmpty() { + return nil + } + return *page.rpic.Value +} + +// Creates a new instance of the ReplicationProtectedItemCollectionPage type. +func NewReplicationProtectedItemCollectionPage(cur ReplicationProtectedItemCollection, getNextPage func(context.Context, ReplicationProtectedItemCollection) (ReplicationProtectedItemCollection, error)) ReplicationProtectedItemCollectionPage { + return ReplicationProtectedItemCollectionPage{ + fn: getNextPage, + rpic: cur, + } +} + +// ReplicationProtectedItemProperties replication protected item custom data details. +type ReplicationProtectedItemProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectedItemType - The type of protected item type. + ProtectedItemType *string `json:"protectedItemType,omitempty"` + // ProtectableItemID - The protected item ARM Id. + ProtectableItemID *string `json:"protectableItemId,omitempty"` + // RecoveryServicesProviderID - The recovery provider ARM Id. + RecoveryServicesProviderID *string `json:"recoveryServicesProviderId,omitempty"` + // PrimaryFabricFriendlyName - The friendly name of the primary fabric. + PrimaryFabricFriendlyName *string `json:"primaryFabricFriendlyName,omitempty"` + // PrimaryFabricProvider - The fabric provider of the primary fabric. + PrimaryFabricProvider *string `json:"primaryFabricProvider,omitempty"` + // RecoveryFabricFriendlyName - The friendly name of recovery fabric. + RecoveryFabricFriendlyName *string `json:"recoveryFabricFriendlyName,omitempty"` + // RecoveryFabricID - The Arm Id of recovery fabric. + RecoveryFabricID *string `json:"recoveryFabricId,omitempty"` + // PrimaryProtectionContainerFriendlyName - The name of primary protection container friendly name. + PrimaryProtectionContainerFriendlyName *string `json:"primaryProtectionContainerFriendlyName,omitempty"` + // RecoveryProtectionContainerFriendlyName - The name of recovery container friendly name. + RecoveryProtectionContainerFriendlyName *string `json:"recoveryProtectionContainerFriendlyName,omitempty"` + // ProtectionState - The protection status. + ProtectionState *string `json:"protectionState,omitempty"` + // ProtectionStateDescription - The protection state description. + ProtectionStateDescription *string `json:"protectionStateDescription,omitempty"` + // ActiveLocation - The Current active location of the PE. + ActiveLocation *string `json:"activeLocation,omitempty"` + // TestFailoverState - The Test failover state. + TestFailoverState *string `json:"testFailoverState,omitempty"` + // TestFailoverStateDescription - The Test failover state description. + TestFailoverStateDescription *string `json:"testFailoverStateDescription,omitempty"` + // SwitchProviderState - The switch provider state. + SwitchProviderState *string `json:"switchProviderState,omitempty"` + // SwitchProviderStateDescription - The switch provider state description. + SwitchProviderStateDescription *string `json:"switchProviderStateDescription,omitempty"` + // AllowedOperations - The allowed operations on the Replication protected item. + AllowedOperations *[]string `json:"allowedOperations,omitempty"` + // ReplicationHealth - 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 `json:"replicationHealth,omitempty"` + // FailoverHealth - The consolidated failover health for the VM. + FailoverHealth *string `json:"failoverHealth,omitempty"` + // HealthErrors - List of health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // PolicyID - The ID of Policy governing this PE. + PolicyID *string `json:"policyId,omitempty"` + // PolicyFriendlyName - The name of Policy governing this PE. + PolicyFriendlyName *string `json:"policyFriendlyName,omitempty"` + // LastSuccessfulFailoverTime - The Last successful failover time. + LastSuccessfulFailoverTime *date.Time `json:"lastSuccessfulFailoverTime,omitempty"` + // LastSuccessfulTestFailoverTime - The Last successful test failover time. + LastSuccessfulTestFailoverTime *date.Time `json:"lastSuccessfulTestFailoverTime,omitempty"` + // CurrentScenario - The current scenario. + CurrentScenario *CurrentScenarioDetails `json:"currentScenario,omitempty"` + // FailoverRecoveryPointID - The recovery point ARM Id to which the Vm was failed over. + FailoverRecoveryPointID *string `json:"failoverRecoveryPointId,omitempty"` + // ProviderSpecificDetails - The Replication provider custom settings. + ProviderSpecificDetails BasicReplicationProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` + // RecoveryContainerID - The recovery container Id. + RecoveryContainerID *string `json:"recoveryContainerId,omitempty"` + // EventCorrelationID - The correlation Id for events associated with this protected item. + EventCorrelationID *string `json:"eventCorrelationId,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ReplicationProtectedItemProperties struct. +func (rpip *ReplicationProtectedItemProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpip.FriendlyName = &friendlyName + } + case "protectedItemType": + if v != nil { + var protectedItemType string + err = json.Unmarshal(*v, &protectedItemType) + if err != nil { + return err + } + rpip.ProtectedItemType = &protectedItemType + } + case "protectableItemId": + if v != nil { + var protectableItemID string + err = json.Unmarshal(*v, &protectableItemID) + if err != nil { + return err + } + rpip.ProtectableItemID = &protectableItemID + } + case "recoveryServicesProviderId": + if v != nil { + var recoveryServicesProviderID string + err = json.Unmarshal(*v, &recoveryServicesProviderID) + if err != nil { + return err + } + rpip.RecoveryServicesProviderID = &recoveryServicesProviderID + } + case "primaryFabricFriendlyName": + if v != nil { + var primaryFabricFriendlyName string + err = json.Unmarshal(*v, &primaryFabricFriendlyName) + if err != nil { + return err + } + rpip.PrimaryFabricFriendlyName = &primaryFabricFriendlyName + } + case "primaryFabricProvider": + if v != nil { + var primaryFabricProvider string + err = json.Unmarshal(*v, &primaryFabricProvider) + if err != nil { + return err + } + rpip.PrimaryFabricProvider = &primaryFabricProvider + } + case "recoveryFabricFriendlyName": + if v != nil { + var recoveryFabricFriendlyName string + err = json.Unmarshal(*v, &recoveryFabricFriendlyName) + if err != nil { + return err + } + rpip.RecoveryFabricFriendlyName = &recoveryFabricFriendlyName + } + case "recoveryFabricId": + if v != nil { + var recoveryFabricID string + err = json.Unmarshal(*v, &recoveryFabricID) + if err != nil { + return err + } + rpip.RecoveryFabricID = &recoveryFabricID + } + case "primaryProtectionContainerFriendlyName": + if v != nil { + var primaryProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &primaryProtectionContainerFriendlyName) + if err != nil { + return err + } + rpip.PrimaryProtectionContainerFriendlyName = &primaryProtectionContainerFriendlyName + } + case "recoveryProtectionContainerFriendlyName": + if v != nil { + var recoveryProtectionContainerFriendlyName string + err = json.Unmarshal(*v, &recoveryProtectionContainerFriendlyName) + if err != nil { + return err + } + rpip.RecoveryProtectionContainerFriendlyName = &recoveryProtectionContainerFriendlyName + } + case "protectionState": + if v != nil { + var protectionState string + err = json.Unmarshal(*v, &protectionState) + if err != nil { + return err + } + rpip.ProtectionState = &protectionState + } + case "protectionStateDescription": + if v != nil { + var protectionStateDescription string + err = json.Unmarshal(*v, &protectionStateDescription) + if err != nil { + return err + } + rpip.ProtectionStateDescription = &protectionStateDescription + } + case "activeLocation": + if v != nil { + var activeLocation string + err = json.Unmarshal(*v, &activeLocation) + if err != nil { + return err + } + rpip.ActiveLocation = &activeLocation + } + case "testFailoverState": + if v != nil { + var testFailoverState string + err = json.Unmarshal(*v, &testFailoverState) + if err != nil { + return err + } + rpip.TestFailoverState = &testFailoverState + } + case "testFailoverStateDescription": + if v != nil { + var testFailoverStateDescription string + err = json.Unmarshal(*v, &testFailoverStateDescription) + if err != nil { + return err + } + rpip.TestFailoverStateDescription = &testFailoverStateDescription + } + case "switchProviderState": + if v != nil { + var switchProviderState string + err = json.Unmarshal(*v, &switchProviderState) + if err != nil { + return err + } + rpip.SwitchProviderState = &switchProviderState + } + case "switchProviderStateDescription": + if v != nil { + var switchProviderStateDescription string + err = json.Unmarshal(*v, &switchProviderStateDescription) + if err != nil { + return err + } + rpip.SwitchProviderStateDescription = &switchProviderStateDescription + } + case "allowedOperations": + if v != nil { + var allowedOperations []string + err = json.Unmarshal(*v, &allowedOperations) + if err != nil { + return err + } + rpip.AllowedOperations = &allowedOperations + } + case "replicationHealth": + if v != nil { + var replicationHealth string + err = json.Unmarshal(*v, &replicationHealth) + if err != nil { + return err + } + rpip.ReplicationHealth = &replicationHealth + } + case "failoverHealth": + if v != nil { + var failoverHealth string + err = json.Unmarshal(*v, &failoverHealth) + if err != nil { + return err + } + rpip.FailoverHealth = &failoverHealth + } + case "healthErrors": + if v != nil { + var healthErrors []HealthError + err = json.Unmarshal(*v, &healthErrors) + if err != nil { + return err + } + rpip.HealthErrors = &healthErrors + } + case "policyId": + if v != nil { + var policyID string + err = json.Unmarshal(*v, &policyID) + if err != nil { + return err + } + rpip.PolicyID = &policyID + } + case "policyFriendlyName": + if v != nil { + var policyFriendlyName string + err = json.Unmarshal(*v, &policyFriendlyName) + if err != nil { + return err + } + rpip.PolicyFriendlyName = &policyFriendlyName + } + case "lastSuccessfulFailoverTime": + if v != nil { + var lastSuccessfulFailoverTime date.Time + err = json.Unmarshal(*v, &lastSuccessfulFailoverTime) + if err != nil { + return err + } + rpip.LastSuccessfulFailoverTime = &lastSuccessfulFailoverTime + } + case "lastSuccessfulTestFailoverTime": + if v != nil { + var lastSuccessfulTestFailoverTime date.Time + err = json.Unmarshal(*v, &lastSuccessfulTestFailoverTime) + if err != nil { + return err + } + rpip.LastSuccessfulTestFailoverTime = &lastSuccessfulTestFailoverTime + } + case "currentScenario": + if v != nil { + var currentScenario CurrentScenarioDetails + err = json.Unmarshal(*v, ¤tScenario) + if err != nil { + return err + } + rpip.CurrentScenario = ¤tScenario + } + case "failoverRecoveryPointId": + if v != nil { + var failoverRecoveryPointID string + err = json.Unmarshal(*v, &failoverRecoveryPointID) + if err != nil { + return err + } + rpip.FailoverRecoveryPointID = &failoverRecoveryPointID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReplicationProviderSpecificSettings(*v) + if err != nil { + return err + } + rpip.ProviderSpecificDetails = providerSpecificDetails + } + case "recoveryContainerId": + if v != nil { + var recoveryContainerID string + err = json.Unmarshal(*v, &recoveryContainerID) + if err != nil { + return err + } + rpip.RecoveryContainerID = &recoveryContainerID + } + case "eventCorrelationId": + if v != nil { + var eventCorrelationID string + err = json.Unmarshal(*v, &eventCorrelationID) + if err != nil { + return err + } + rpip.EventCorrelationID = &eventCorrelationID + } + } + } + + return nil +} + +// ReplicationProtectedItemsAddDisksFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsAddDisksFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsAddDisksFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsAddDisksFuture.Result. +func (future *ReplicationProtectedItemsAddDisksFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsAddDisksFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsAddDisksFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.AddDisksResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsAddDisksFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsApplyRecoveryPointFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsApplyRecoveryPointFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsApplyRecoveryPointFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsApplyRecoveryPointFuture.Result. +func (future *ReplicationProtectedItemsApplyRecoveryPointFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ApplyRecoveryPointResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsCreateFuture.Result. +func (future *ReplicationProtectedItemsCreateFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.CreateResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsCreateFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsDeleteFuture.Result. +func (future *ReplicationProtectedItemsDeleteFuture) result(client ReplicationProtectedItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectedItemsFailoverCancelFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsFailoverCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsFailoverCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsFailoverCancelFuture.Result. +func (future *ReplicationProtectedItemsFailoverCancelFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsFailoverCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.FailoverCancelResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCancelFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsFailoverCommitFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsFailoverCommitFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsFailoverCommitFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsFailoverCommitFuture.Result. +func (future *ReplicationProtectedItemsFailoverCommitFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCommitFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsFailoverCommitFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.FailoverCommitResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsFailoverCommitFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsPlannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsPlannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsPlannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsPlannedFailoverFuture.Result. +func (future *ReplicationProtectedItemsPlannedFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPlannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsPlannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.PlannedFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPlannedFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsPurgeFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsPurgeFuture.Result. +func (future *ReplicationProtectedItemsPurgeFuture) result(client ReplicationProtectedItemsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectedItemsRemoveDisksFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsRemoveDisksFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsRemoveDisksFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsRemoveDisksFuture.Result. +func (future *ReplicationProtectedItemsRemoveDisksFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRemoveDisksFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsRemoveDisksFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.RemoveDisksResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRemoveDisksFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsRepairReplicationFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsRepairReplicationFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsRepairReplicationFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsRepairReplicationFuture.Result. +func (future *ReplicationProtectedItemsRepairReplicationFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRepairReplicationFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsRepairReplicationFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.RepairReplicationResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsRepairReplicationFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsReprotectFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsReprotectFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsReprotectFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsReprotectFuture.Result. +func (future *ReplicationProtectedItemsReprotectFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsReprotectFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsReprotectFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ReprotectResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsReprotectFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsResolveHealthErrorsFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsResolveHealthErrorsFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsResolveHealthErrorsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsResolveHealthErrorsFuture.Result. +func (future *ReplicationProtectedItemsResolveHealthErrorsFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.ResolveHealthErrorsResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsSwitchProviderFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsSwitchProviderFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsSwitchProviderFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsSwitchProviderFuture.Result. +func (future *ReplicationProtectedItemsSwitchProviderFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsSwitchProviderFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsSwitchProviderFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.SwitchProviderResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsSwitchProviderFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsTestFailoverCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsTestFailoverCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsTestFailoverCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsTestFailoverCleanupFuture.Result. +func (future *ReplicationProtectedItemsTestFailoverCleanupFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.TestFailoverCleanupResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsTestFailoverFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectedItemsTestFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsTestFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsTestFailoverFuture.Result. +func (future *ReplicationProtectedItemsTestFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsTestFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.TestFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsTestFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUnplannedFailoverFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsUnplannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUnplannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUnplannedFailoverFuture.Result. +func (future *ReplicationProtectedItemsUnplannedFailoverFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UnplannedFailoverResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateApplianceFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationProtectedItemsUpdateApplianceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateApplianceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateApplianceFuture.Result. +func (future *ReplicationProtectedItemsUpdateApplianceFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateApplianceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateApplianceFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateApplianceResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateApplianceFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationProtectedItemsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateFuture.Result. +func (future *ReplicationProtectedItemsUpdateFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectedItemsUpdateMobilityServiceFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectedItemsUpdateMobilityServiceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectedItemsClient) (ReplicationProtectedItem, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectedItemsUpdateMobilityServiceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectedItemsUpdateMobilityServiceFuture.Result. +func (future *ReplicationProtectedItemsUpdateMobilityServiceFuture) result(client ReplicationProtectedItemsClient) (rpi ReplicationProtectedItem, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpi.Response.Response, err = future.GetResult(sender); err == nil && rpi.Response.Response.StatusCode != http.StatusNoContent { + rpi, err = client.UpdateMobilityServiceResponder(rpi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture", "Result", rpi.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainerMappingsCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (ProtectionContainerMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsCreateFuture.Result. +func (future *ReplicationProtectionContainerMappingsCreateFuture) result(client ReplicationProtectionContainerMappingsClient) (pcm ProtectionContainerMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pcm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pcm.Response.Response, err = future.GetResult(sender); err == nil && pcm.Response.Response.StatusCode != http.StatusNoContent { + pcm, err = client.CreateResponder(pcm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsCreateFuture", "Result", pcm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainerMappingsDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsDeleteFuture.Result. +func (future *ReplicationProtectionContainerMappingsDeleteFuture) result(client ReplicationProtectionContainerMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainerMappingsPurgeFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsPurgeFuture.Result. +func (future *ReplicationProtectionContainerMappingsPurgeFuture) result(client ReplicationProtectionContainerMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainerMappingsUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainerMappingsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainerMappingsClient) (ProtectionContainerMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainerMappingsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainerMappingsUpdateFuture.Result. +func (future *ReplicationProtectionContainerMappingsUpdateFuture) result(client ReplicationProtectionContainerMappingsClient) (pcm ProtectionContainerMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pcm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainerMappingsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pcm.Response.Response, err = future.GetResult(sender); err == nil && pcm.Response.Response.StatusCode != http.StatusNoContent { + pcm, err = client.UpdateResponder(pcm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsUpdateFuture", "Result", pcm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersCreateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectionContainersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersCreateFuture.Result. +func (future *ReplicationProtectionContainersCreateFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.CreateResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersCreateFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersDeleteFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationProtectionContainersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersDeleteFuture.Result. +func (future *ReplicationProtectionContainersDeleteFuture) result(client ReplicationProtectionContainersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationProtectionContainersDiscoverProtectableItemFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type ReplicationProtectionContainersDiscoverProtectableItemFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersDiscoverProtectableItemFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersDiscoverProtectableItemFuture.Result. +func (future *ReplicationProtectionContainersDiscoverProtectableItemFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.DiscoverProtectableItemResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionContainersSwitchProtectionFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationProtectionContainersSwitchProtectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationProtectionContainersClient) (ProtectionContainer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationProtectionContainersSwitchProtectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationProtectionContainersSwitchProtectionFuture.Result. +func (future *ReplicationProtectionContainersSwitchProtectionFuture) result(client ReplicationProtectionContainersClient) (pc ProtectionContainer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersSwitchProtectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationProtectionContainersSwitchProtectionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pc.Response.Response, err = future.GetResult(sender); err == nil && pc.Response.Response.StatusCode != http.StatusNoContent { + pc, err = client.SwitchProtectionResponder(pc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersSwitchProtectionFuture", "Result", pc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationProtectionIntent replication protection intent. +type ReplicationProtectionIntent struct { + autorest.Response `json:"-"` + // Properties - The custom data. + Properties *ReplicationProtectionIntentProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntent. +func (rpi ReplicationProtectionIntent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpi.Properties != nil { + objectMap["properties"] = rpi.Properties + } + if rpi.Location != nil { + objectMap["location"] = rpi.Location + } + return json.Marshal(objectMap) +} + +// ReplicationProtectionIntentCollection replication protection intent objects collection. +type ReplicationProtectionIntentCollection struct { + autorest.Response `json:"-"` + // Value - The Replication protection intent details. + Value *[]ReplicationProtectionIntent `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ReplicationProtectionIntentCollectionIterator provides access to a complete listing of +// ReplicationProtectionIntent values. +type ReplicationProtectionIntentCollectionIterator struct { + i int + page ReplicationProtectionIntentCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ReplicationProtectionIntentCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ReplicationProtectionIntentCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ReplicationProtectionIntentCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ReplicationProtectionIntentCollectionIterator) Response() ReplicationProtectionIntentCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ReplicationProtectionIntentCollectionIterator) Value() ReplicationProtectionIntent { + if !iter.page.NotDone() { + return ReplicationProtectionIntent{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ReplicationProtectionIntentCollectionIterator type. +func NewReplicationProtectionIntentCollectionIterator(page ReplicationProtectionIntentCollectionPage) ReplicationProtectionIntentCollectionIterator { + return ReplicationProtectionIntentCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rpic ReplicationProtectionIntentCollection) IsEmpty() bool { + return rpic.Value == nil || len(*rpic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rpic ReplicationProtectionIntentCollection) hasNextLink() bool { + return rpic.NextLink != nil && len(*rpic.NextLink) != 0 +} + +// replicationProtectionIntentCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rpic ReplicationProtectionIntentCollection) replicationProtectionIntentCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rpic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rpic.NextLink))) +} + +// ReplicationProtectionIntentCollectionPage contains a page of ReplicationProtectionIntent values. +type ReplicationProtectionIntentCollectionPage struct { + fn func(context.Context, ReplicationProtectionIntentCollection) (ReplicationProtectionIntentCollection, error) + rpic ReplicationProtectionIntentCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ReplicationProtectionIntentCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rpic) + if err != nil { + return err + } + page.rpic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ReplicationProtectionIntentCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ReplicationProtectionIntentCollectionPage) NotDone() bool { + return !page.rpic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ReplicationProtectionIntentCollectionPage) Response() ReplicationProtectionIntentCollection { + return page.rpic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ReplicationProtectionIntentCollectionPage) Values() []ReplicationProtectionIntent { + if page.rpic.IsEmpty() { + return nil + } + return *page.rpic.Value +} + +// Creates a new instance of the ReplicationProtectionIntentCollectionPage type. +func NewReplicationProtectionIntentCollectionPage(cur ReplicationProtectionIntentCollection, getNextPage func(context.Context, ReplicationProtectionIntentCollection) (ReplicationProtectionIntentCollection, error)) ReplicationProtectionIntentCollectionPage { + return ReplicationProtectionIntentCollectionPage{ + fn: getNextPage, + rpic: cur, + } +} + +// ReplicationProtectionIntentProperties replication protection intent custom data details. +type ReplicationProtectionIntentProperties struct { + // FriendlyName - The name. + FriendlyName *string `json:"friendlyName,omitempty"` + // JobID - READ-ONLY; The job Id. + JobID *string `json:"jobId,omitempty"` + // JobState - READ-ONLY; The job state. + JobState *string `json:"jobState,omitempty"` + // IsActive - READ-ONLY; A value indicating whether the intent object is active. + IsActive *bool `json:"isActive,omitempty"` + // CreationTimeUTC - READ-ONLY; The creation time in UTC. + CreationTimeUTC *string `json:"creationTimeUTC,omitempty"` + // ProviderSpecificDetails - The Replication provider custom settings. + ProviderSpecificDetails BasicReplicationProtectionIntentProviderSpecificSettings `json:"providerSpecificDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntentProperties. +func (rpip ReplicationProtectionIntentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpip.FriendlyName != nil { + objectMap["friendlyName"] = rpip.FriendlyName + } + objectMap["providerSpecificDetails"] = rpip.ProviderSpecificDetails + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ReplicationProtectionIntentProperties struct. +func (rpip *ReplicationProtectionIntentProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "friendlyName": + if v != nil { + var friendlyName string + err = json.Unmarshal(*v, &friendlyName) + if err != nil { + return err + } + rpip.FriendlyName = &friendlyName + } + case "jobId": + if v != nil { + var jobID string + err = json.Unmarshal(*v, &jobID) + if err != nil { + return err + } + rpip.JobID = &jobID + } + case "jobState": + if v != nil { + var jobState string + err = json.Unmarshal(*v, &jobState) + if err != nil { + return err + } + rpip.JobState = &jobState + } + case "isActive": + if v != nil { + var isActive bool + err = json.Unmarshal(*v, &isActive) + if err != nil { + return err + } + rpip.IsActive = &isActive + } + case "creationTimeUTC": + if v != nil { + var creationTimeUTC string + err = json.Unmarshal(*v, &creationTimeUTC) + if err != nil { + return err + } + rpip.CreationTimeUTC = &creationTimeUTC + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(*v) + if err != nil { + return err + } + rpip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicReplicationProtectionIntentProviderSpecificSettings replication provider specific settings. +type BasicReplicationProtectionIntentProviderSpecificSettings interface { + AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) + AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) +} + +// ReplicationProtectionIntentProviderSpecificSettings replication provider specific settings. +type ReplicationProtectionIntentProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings', 'InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A' + InstanceType InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(body []byte) (BasicReplicationProtectionIntentProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeA2A): + var arid A2AReplicationIntentDetails + err := json.Unmarshal(body, &arid) + return arid, err + default: + var rpipss ReplicationProtectionIntentProviderSpecificSettings + err := json.Unmarshal(body, &rpipss) + return rpipss, err + } +} +func unmarshalBasicReplicationProtectionIntentProviderSpecificSettingsArray(body []byte) ([]BasicReplicationProtectionIntentProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpipssArray := make([]BasicReplicationProtectionIntentProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpipss, err := unmarshalBasicReplicationProtectionIntentProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + rpipssArray[index] = rpipss + } + return rpipssArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) MarshalJSON() ([]byte, error) { + rpipss.InstanceType = InstanceTypeBasicReplicationProtectionIntentProviderSpecificSettingsInstanceTypeReplicationProtectionIntentProviderSpecificSettings + objectMap := make(map[string]interface{}) + if rpipss.InstanceType != "" { + objectMap["instanceType"] = rpipss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReplicationIntentDetails is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsA2AReplicationIntentDetails() (*A2AReplicationIntentDetails, bool) { + return nil, false +} + +// AsReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsReplicationProtectionIntentProviderSpecificSettings() (*ReplicationProtectionIntentProviderSpecificSettings, bool) { + return &rpipss, true +} + +// AsBasicReplicationProtectionIntentProviderSpecificSettings is the BasicReplicationProtectionIntentProviderSpecificSettings implementation for ReplicationProtectionIntentProviderSpecificSettings. +func (rpipss ReplicationProtectionIntentProviderSpecificSettings) AsBasicReplicationProtectionIntentProviderSpecificSettings() (BasicReplicationProtectionIntentProviderSpecificSettings, bool) { + return &rpipss, true +} + +// ReplicationProviderContainerUnmappingInput provider specific input for unpairing operations. +type ReplicationProviderContainerUnmappingInput struct { + // InstanceType - The class type. + InstanceType *string `json:"instanceType,omitempty"` +} + +// BasicReplicationProviderSpecificContainerCreationInput provider specific input for container creation operation. +type BasicReplicationProviderSpecificContainerCreationInput interface { + AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) + AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) + AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) + AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) +} + +// ReplicationProviderSpecificContainerCreationInput provider specific input for container creation operation. +type ReplicationProviderSpecificContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificContainerCreationInput(body []byte) (BasicReplicationProviderSpecificContainerCreationInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A): + var acci A2AContainerCreationInput + err := json.Unmarshal(body, &acci) + return acci, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration): + var accmcci A2ACrossClusterMigrationContainerCreationInput + err := json.Unmarshal(body, &accmcci) + return accmcci, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt): + var vmccci VMwareCbtContainerCreationInput + err := json.Unmarshal(body, &vmccci) + return vmccci, err + default: + var rpscci ReplicationProviderSpecificContainerCreationInput + err := json.Unmarshal(body, &rpscci) + return rpscci, err + } +} +func unmarshalBasicReplicationProviderSpecificContainerCreationInputArray(body []byte) ([]BasicReplicationProviderSpecificContainerCreationInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpscciArray := make([]BasicReplicationProviderSpecificContainerCreationInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpscci, err := unmarshalBasicReplicationProviderSpecificContainerCreationInput(*rawMessage) + if err != nil { + return nil, err + } + rpscciArray[index] = rpscci + } + return rpscciArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) MarshalJSON() ([]byte, error) { + rpscci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput + objectMap := make(map[string]interface{}) + if rpscci.InstanceType != "" { + objectMap["instanceType"] = rpscci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return &rpscci, true +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for ReplicationProviderSpecificContainerCreationInput. +func (rpscci ReplicationProviderSpecificContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &rpscci, true +} + +// BasicReplicationProviderSpecificContainerMappingInput provider specific input for pairing operations. +type BasicReplicationProviderSpecificContainerMappingInput interface { + AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) + AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) + AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) +} + +// ReplicationProviderSpecificContainerMappingInput provider specific input for pairing operations. +type ReplicationProviderSpecificContainerMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificContainerMappingInput(body []byte) (BasicReplicationProviderSpecificContainerMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A): + var acmi A2AContainerMappingInput + err := json.Unmarshal(body, &acmi) + return acmi, err + case string(InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt): + var vmccmi VMwareCbtContainerMappingInput + err := json.Unmarshal(body, &vmccmi) + return vmccmi, err + default: + var rpscmi ReplicationProviderSpecificContainerMappingInput + err := json.Unmarshal(body, &rpscmi) + return rpscmi, err + } +} +func unmarshalBasicReplicationProviderSpecificContainerMappingInputArray(body []byte) ([]BasicReplicationProviderSpecificContainerMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpscmiArray := make([]BasicReplicationProviderSpecificContainerMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpscmi, err := unmarshalBasicReplicationProviderSpecificContainerMappingInput(*rawMessage) + if err != nil { + return nil, err + } + rpscmiArray[index] = rpscmi + } + return rpscmiArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) MarshalJSON() ([]byte, error) { + rpscmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput + objectMap := make(map[string]interface{}) + if rpscmi.InstanceType != "" { + objectMap["instanceType"] = rpscmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return &rpscmi, true +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for ReplicationProviderSpecificContainerMappingInput. +func (rpscmi ReplicationProviderSpecificContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &rpscmi, true +} + +// BasicReplicationProviderSpecificSettings replication provider specific settings. +type BasicReplicationProviderSpecificSettings interface { + AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) + AsA2AReplicationDetails() (*A2AReplicationDetails, bool) + AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) + AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) + AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) + AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) + AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) + AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) + AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) + AsInMageReplicationDetails() (*InMageReplicationDetails, bool) + AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) +} + +// ReplicationProviderSpecificSettings replication provider specific settings. +type ReplicationProviderSpecificSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm', 'InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage' + InstanceType InstanceTypeBasicReplicationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificSettings(body []byte) (BasicReplicationProviderSpecificSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2ACrossClusterMigration): + var accmrd A2ACrossClusterMigrationReplicationDetails + err := json.Unmarshal(body, &accmrd) + return accmrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeA2A): + var ard A2AReplicationDetails + err := json.Unmarshal(body, &ard) + return ard, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaAzure): + var hvrard HyperVReplicaAzureReplicationDetails + err := json.Unmarshal(body, &hvrard) + return hvrard, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplicaBaseReplicationDetails): + var hvrbrd HyperVReplicaBaseReplicationDetails + err := json.Unmarshal(body, &hvrbrd) + return hvrbrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012R2): + var hvrbrd HyperVReplicaBlueReplicationDetails + err := json.Unmarshal(body, &hvrbrd) + return hvrbrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeHyperVReplica2012): + var hvrrd HyperVReplicaReplicationDetails + err := json.Unmarshal(body, &hvrrd) + return hvrrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageAzureV2): + var imavrd InMageAzureV2ReplicationDetails + err := json.Unmarshal(body, &imavrd) + return imavrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcmFailback): + var imrfrd InMageRcmFailbackReplicationDetails + err := json.Unmarshal(body, &imrfrd) + return imrfrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMageRcm): + var imrrd InMageRcmReplicationDetails + err := json.Unmarshal(body, &imrrd) + return imrrd, err + case string(InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeInMage): + var imrd InMageReplicationDetails + err := json.Unmarshal(body, &imrd) + return imrd, err + default: + var rpss ReplicationProviderSpecificSettings + err := json.Unmarshal(body, &rpss) + return rpss, err + } +} +func unmarshalBasicReplicationProviderSpecificSettingsArray(body []byte) ([]BasicReplicationProviderSpecificSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpssArray := make([]BasicReplicationProviderSpecificSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpss, err := unmarshalBasicReplicationProviderSpecificSettings(*rawMessage) + if err != nil { + return nil, err + } + rpssArray[index] = rpss + } + return rpssArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) MarshalJSON() ([]byte, error) { + rpss.InstanceType = InstanceTypeBasicReplicationProviderSpecificSettingsInstanceTypeReplicationProviderSpecificSettings + objectMap := make(map[string]interface{}) + if rpss.InstanceType != "" { + objectMap["instanceType"] = rpss.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsA2ACrossClusterMigrationReplicationDetails() (*A2ACrossClusterMigrationReplicationDetails, bool) { + return nil, false +} + +// AsA2AReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsA2AReplicationDetails() (*A2AReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaAzureReplicationDetails() (*HyperVReplicaAzureReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaBaseReplicationDetails() (*HyperVReplicaBaseReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBlueReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaBlueReplicationDetails() (*HyperVReplicaBlueReplicationDetails, bool) { + return nil, false +} + +// AsHyperVReplicaReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsHyperVReplicaReplicationDetails() (*HyperVReplicaReplicationDetails, bool) { + return nil, false +} + +// AsInMageAzureV2ReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageAzureV2ReplicationDetails() (*InMageAzureV2ReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageRcmFailbackReplicationDetails() (*InMageRcmFailbackReplicationDetails, bool) { + return nil, false +} + +// AsInMageRcmReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageRcmReplicationDetails() (*InMageRcmReplicationDetails, bool) { + return nil, false +} + +// AsInMageReplicationDetails is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsInMageReplicationDetails() (*InMageReplicationDetails, bool) { + return nil, false +} + +// AsReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsReplicationProviderSpecificSettings() (*ReplicationProviderSpecificSettings, bool) { + return &rpss, true +} + +// AsBasicReplicationProviderSpecificSettings is the BasicReplicationProviderSpecificSettings implementation for ReplicationProviderSpecificSettings. +func (rpss ReplicationProviderSpecificSettings) AsBasicReplicationProviderSpecificSettings() (BasicReplicationProviderSpecificSettings, bool) { + return &rpss, true +} + +// BasicReplicationProviderSpecificUpdateContainerMappingInput provider specific input for update pairing operations. +type BasicReplicationProviderSpecificUpdateContainerMappingInput interface { + AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) + AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) + AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) +} + +// ReplicationProviderSpecificUpdateContainerMappingInput provider specific input for update pairing +// operations. +type ReplicationProviderSpecificUpdateContainerMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(body []byte) (BasicReplicationProviderSpecificUpdateContainerMappingInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeA2A): + var aucmi A2AUpdateContainerMappingInput + err := json.Unmarshal(body, &aucmi) + return aucmi, err + case string(InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeInMageRcm): + var imrucmi InMageRcmUpdateContainerMappingInput + err := json.Unmarshal(body, &imrucmi) + return imrucmi, err + default: + var rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput + err := json.Unmarshal(body, &rpsucmi) + return rpsucmi, err + } +} +func unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInputArray(body []byte) ([]BasicReplicationProviderSpecificUpdateContainerMappingInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpsucmiArray := make([]BasicReplicationProviderSpecificUpdateContainerMappingInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpsucmi, err := unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(*rawMessage) + if err != nil { + return nil, err + } + rpsucmiArray[index] = rpsucmi + } + return rpsucmiArray, nil +} + +// MarshalJSON is the custom marshaler for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) MarshalJSON() ([]byte, error) { + rpsucmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificUpdateContainerMappingInputInstanceTypeReplicationProviderSpecificUpdateContainerMappingInput + objectMap := make(map[string]interface{}) + if rpsucmi.InstanceType != "" { + objectMap["instanceType"] = rpsucmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsA2AUpdateContainerMappingInput() (*A2AUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsInMageRcmUpdateContainerMappingInput() (*InMageRcmUpdateContainerMappingInput, bool) { + return nil, false +} + +// AsReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsReplicationProviderSpecificUpdateContainerMappingInput() (*ReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &rpsucmi, true +} + +// AsBasicReplicationProviderSpecificUpdateContainerMappingInput is the BasicReplicationProviderSpecificUpdateContainerMappingInput implementation for ReplicationProviderSpecificUpdateContainerMappingInput. +func (rpsucmi ReplicationProviderSpecificUpdateContainerMappingInput) AsBasicReplicationProviderSpecificUpdateContainerMappingInput() (BasicReplicationProviderSpecificUpdateContainerMappingInput, bool) { + return &rpsucmi, true +} + +// ReplicationRecoveryPlansCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansCreateFuture.Result. +func (future *ReplicationRecoveryPlansCreateFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.CreateResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansCreateFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansDeleteFuture.Result. +func (future *ReplicationRecoveryPlansDeleteFuture) result(client ReplicationRecoveryPlansClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryPlansFailoverCancelFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationRecoveryPlansFailoverCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansFailoverCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansFailoverCancelFuture.Result. +func (future *ReplicationRecoveryPlansFailoverCancelFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansFailoverCancelFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.FailoverCancelResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCancelFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansFailoverCommitFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationRecoveryPlansFailoverCommitFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansFailoverCommitFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansFailoverCommitFuture.Result. +func (future *ReplicationRecoveryPlansFailoverCommitFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCommitFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansFailoverCommitFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.FailoverCommitResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansFailoverCommitFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansPlannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryPlansPlannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansPlannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansPlannedFailoverFuture.Result. +func (future *ReplicationRecoveryPlansPlannedFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.PlannedFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansReprotectFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansReprotectFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansReprotectFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansReprotectFuture.Result. +func (future *ReplicationRecoveryPlansReprotectFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansReprotectFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansReprotectFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.ReprotectResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansReprotectFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansTestFailoverCleanupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryPlansTestFailoverCleanupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansTestFailoverCleanupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansTestFailoverCleanupFuture.Result. +func (future *ReplicationRecoveryPlansTestFailoverCleanupFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.TestFailoverCleanupResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansTestFailoverFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansTestFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansTestFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansTestFailoverFuture.Result. +func (future *ReplicationRecoveryPlansTestFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansTestFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.TestFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansTestFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansUnplannedFailoverFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryPlansUnplannedFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansUnplannedFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansUnplannedFailoverFuture.Result. +func (future *ReplicationRecoveryPlansUnplannedFailoverFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.UnplannedFailoverResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryPlansUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationRecoveryPlansUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryPlansClient) (RecoveryPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryPlansUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryPlansUpdateFuture.Result. +func (future *ReplicationRecoveryPlansUpdateFuture) result(client ReplicationRecoveryPlansClient) (rp RecoveryPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryPlansUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.UpdateResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansUpdateFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryServicesProvidersCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryServicesProvidersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (RecoveryServicesProvider, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersCreateFuture.Result. +func (future *ReplicationRecoveryServicesProvidersCreateFuture) result(client ReplicationRecoveryServicesProvidersClient) (rsp RecoveryServicesProvider, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rsp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rsp.Response.Response, err = future.GetResult(sender); err == nil && rsp.Response.Response.StatusCode != http.StatusNoContent { + rsp, err = client.CreateResponder(rsp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersCreateFuture", "Result", rsp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationRecoveryServicesProvidersDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationRecoveryServicesProvidersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersDeleteFuture.Result. +func (future *ReplicationRecoveryServicesProvidersDeleteFuture) result(client ReplicationRecoveryServicesProvidersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryServicesProvidersPurgeFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ReplicationRecoveryServicesProvidersPurgeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersPurgeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersPurgeFuture.Result. +func (future *ReplicationRecoveryServicesProvidersPurgeFuture) result(client ReplicationRecoveryServicesProvidersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationRecoveryServicesProvidersRefreshProviderFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type ReplicationRecoveryServicesProvidersRefreshProviderFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationRecoveryServicesProvidersClient) (RecoveryServicesProvider, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationRecoveryServicesProvidersRefreshProviderFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationRecoveryServicesProvidersRefreshProviderFuture.Result. +func (future *ReplicationRecoveryServicesProvidersRefreshProviderFuture) result(client ReplicationRecoveryServicesProvidersClient) (rsp RecoveryServicesProvider, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rsp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rsp.Response.Response, err = future.GetResult(sender); err == nil && rsp.Response.Response.StatusCode != http.StatusNoContent { + rsp, err = client.RefreshProviderResponder(rsp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture", "Result", rsp.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationStorageClassificationMappingsCreateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationStorageClassificationMappingsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationStorageClassificationMappingsClient) (StorageClassificationMapping, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationStorageClassificationMappingsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationStorageClassificationMappingsCreateFuture.Result. +func (future *ReplicationStorageClassificationMappingsCreateFuture) result(client ReplicationStorageClassificationMappingsClient) (scm StorageClassificationMapping, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + scm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationStorageClassificationMappingsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if scm.Response.Response, err = future.GetResult(sender); err == nil && scm.Response.Response.StatusCode != http.StatusNoContent { + scm, err = client.CreateResponder(scm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsCreateFuture", "Result", scm.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationStorageClassificationMappingsDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ReplicationStorageClassificationMappingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationStorageClassificationMappingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationStorageClassificationMappingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationStorageClassificationMappingsDeleteFuture.Result. +func (future *ReplicationStorageClassificationMappingsDeleteFuture) result(client ReplicationStorageClassificationMappingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationStorageClassificationMappingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationVaultHealthRefreshFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationVaultHealthRefreshFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationVaultHealthClient) (VaultHealthDetails, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationVaultHealthRefreshFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationVaultHealthRefreshFuture.Result. +func (future *ReplicationVaultHealthRefreshFuture) result(client ReplicationVaultHealthClient) (vhd VaultHealthDetails, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthRefreshFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vhd.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationVaultHealthRefreshFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vhd.Response.Response, err = future.GetResult(sender); err == nil && vhd.Response.Response.StatusCode != http.StatusNoContent { + vhd, err = client.RefreshResponder(vhd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthRefreshFuture", "Result", vhd.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationVaultSettingCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationVaultSettingCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationVaultSettingClient) (VaultSetting, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationVaultSettingCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationVaultSettingCreateFuture.Result. +func (future *ReplicationVaultSettingCreateFuture) result(client ReplicationVaultSettingClient) (vs VaultSetting, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vs.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationVaultSettingCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vs.Response.Response, err = future.GetResult(sender); err == nil && vs.Response.Response.StatusCode != http.StatusNoContent { + vs, err = client.CreateResponder(vs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingCreateFuture", "Result", vs.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationvCentersCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (VCenter, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersCreateFuture.Result. +func (future *ReplicationvCentersCreateFuture) result(client ReplicationvCentersClient) (vc VCenter, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent { + vc, err = client.CreateResponder(vc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersCreateFuture", "Result", vc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationvCentersDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersDeleteFuture.Result. +func (future *ReplicationvCentersDeleteFuture) result(client ReplicationvCentersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationvCentersUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationvCentersUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationvCentersClient) (VCenter, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationvCentersUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationvCentersUpdateFuture.Result. +func (future *ReplicationvCentersUpdateFuture) result(client ReplicationvCentersClient) (vc VCenter, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("siterecovery.ReplicationvCentersUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent { + vc, err = client.UpdateResponder(vc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersUpdateFuture", "Result", vc.Response.Response, "Failure responding to request") + } + } + return +} + +// ReprotectAgentDetails reprotect agent details. +type ReprotectAgentDetails struct { + // ID - READ-ONLY; The reprotect agent Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The reprotect agent name. + Name *string `json:"name,omitempty"` + // BiosID - READ-ONLY; The reprotect agent Bios Id. + BiosID *string `json:"biosId,omitempty"` + // FabricObjectID - READ-ONLY; The fabric object Id. + FabricObjectID *string `json:"fabricObjectId,omitempty"` + // Fqdn - READ-ONLY; The reprotect agent Fqdn. + Fqdn *string `json:"fqdn,omitempty"` + // Version - READ-ONLY; The version. + Version *string `json:"version,omitempty"` + // LastHeartbeatUtc - READ-ONLY; The last heartbeat received from the reprotect agent. + LastHeartbeatUtc *date.Time `json:"lastHeartbeatUtc,omitempty"` + // Health - READ-ONLY; The health of the reprotect agent. Possible values include: 'ProtectionHealthNone', 'ProtectionHealthNormal', 'ProtectionHealthWarning', 'ProtectionHealthCritical' + Health ProtectionHealth `json:"health,omitempty"` + // HealthErrors - READ-ONLY; The health errors. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` + // ProtectedItemCount - READ-ONLY; The protected item count. + ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"` + // AccessibleDatastores - READ-ONLY; The list of accessible datastores fetched from discovery. + AccessibleDatastores *[]string `json:"accessibleDatastores,omitempty"` + // VcenterID - READ-ONLY; The Vcenter Id. + VcenterID *string `json:"vcenterId,omitempty"` + // LastDiscoveryInUtc - READ-ONLY; The last time when SDS information discovered in SRS. + LastDiscoveryInUtc *date.Time `json:"lastDiscoveryInUtc,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReprotectAgentDetails. +func (rad ReprotectAgentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResolveHealthError resolve health errors input properties. +type ResolveHealthError struct { + // HealthErrorID - Health error id. + HealthErrorID *string `json:"healthErrorId,omitempty"` +} + +// ResolveHealthInput resolve health input. +type ResolveHealthInput struct { + // Properties - Disable resolve health input properties. + Properties *ResolveHealthInputProperties `json:"properties,omitempty"` +} + +// ResolveHealthInputProperties resolve health input properties. +type ResolveHealthInputProperties struct { + // HealthErrors - Health errors. + HealthErrors *[]ResolveHealthError `json:"healthErrors,omitempty"` +} + +// Resource azure resource. +type Resource struct { + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location + } + return json.Marshal(objectMap) +} + +// ResourceHealthSummary base class to define the health summary of the resources contained under an Arm +// resource. +type ResourceHealthSummary struct { + // ResourceCount - The count of total resources under the container. + ResourceCount *int32 `json:"resourceCount,omitempty"` + // Issues - The list of summary of health errors across the resources under the container. + Issues *[]HealthErrorSummary `json:"issues,omitempty"` + // CategorizedResourceCounts - The categorized resource counts. + CategorizedResourceCounts map[string]*int32 `json:"categorizedResourceCounts"` +} + +// MarshalJSON is the custom marshaler for ResourceHealthSummary. +func (RHS ResourceHealthSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if RHS.ResourceCount != nil { + objectMap["resourceCount"] = RHS.ResourceCount + } + if RHS.Issues != nil { + objectMap["issues"] = RHS.Issues + } + if RHS.CategorizedResourceCounts != nil { + objectMap["categorizedResourceCounts"] = RHS.CategorizedResourceCounts + } + return json.Marshal(objectMap) +} + +// ResumeJobParams resume job params. +type ResumeJobParams struct { + // Properties - Resume job properties. + Properties *ResumeJobParamsProperties `json:"properties,omitempty"` +} + +// ResumeJobParamsProperties resume job properties. +type ResumeJobParamsProperties struct { + // Comments - Resume job comments. + Comments *string `json:"comments,omitempty"` +} + +// ResyncInput resync input. +type ResyncInput struct { + // Properties - Resync input properties. + Properties *ResyncInputProperties `json:"properties,omitempty"` +} + +// ResyncInputProperties resync input properties. +type ResyncInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicResyncProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ResyncInputProperties struct. +func (rip *ResyncInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicResyncProviderSpecificInput(*v) + if err != nil { + return err + } + rip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicResyncProviderSpecificInput resync provider specific input. +type BasicResyncProviderSpecificInput interface { + AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) + AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) +} + +// ResyncProviderSpecificInput resync provider specific input. +type ResyncProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput', 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicResyncProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicResyncProviderSpecificInput(body []byte) (BasicResyncProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt): + var vmcri VMwareCbtResyncInput + err := json.Unmarshal(body, &vmcri) + return vmcri, err + default: + var rpsi ResyncProviderSpecificInput + err := json.Unmarshal(body, &rpsi) + return rpsi, err + } +} +func unmarshalBasicResyncProviderSpecificInputArray(body []byte) ([]BasicResyncProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpsiArray := make([]BasicResyncProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rpsi, err := unmarshalBasicResyncProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rpsiArray[index] = rpsi + } + return rpsiArray, nil +} + +// MarshalJSON is the custom marshaler for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) MarshalJSON() ([]byte, error) { + rpsi.InstanceType = InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput + objectMap := make(map[string]interface{}) + if rpsi.InstanceType != "" { + objectMap["instanceType"] = rpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtResyncInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) { + return nil, false +} + +// AsResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) { + return &rpsi, true +} + +// AsBasicResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for ResyncProviderSpecificInput. +func (rpsi ResyncProviderSpecificInput) AsBasicResyncProviderSpecificInput() (BasicResyncProviderSpecificInput, bool) { + return &rpsi, true +} + +// RetentionVolume the retention details of the MT. +type RetentionVolume struct { + // VolumeName - The volume name. + VolumeName *string `json:"volumeName,omitempty"` + // CapacityInBytes - The volume capacity. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // FreeSpaceInBytes - The free space available in this volume. + FreeSpaceInBytes *int64 `json:"freeSpaceInBytes,omitempty"` + // ThresholdPercentage - The threshold percentage. + ThresholdPercentage *int32 `json:"thresholdPercentage,omitempty"` +} + +// ReverseReplicationInput reverse replication input. +type ReverseReplicationInput struct { + // Properties - Reverse replication properties. + Properties *ReverseReplicationInputProperties `json:"properties,omitempty"` +} + +// ReverseReplicationInputProperties reverse replication input properties. +type ReverseReplicationInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // ProviderSpecificDetails - Provider specific reverse replication input. + ProviderSpecificDetails BasicReverseReplicationProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ReverseReplicationInputProperties struct. +func (rrip *ReverseReplicationInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + rrip.FailoverDirection = &failoverDirection + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicReverseReplicationProviderSpecificInput(*v) + if err != nil { + return err + } + rrip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicReverseReplicationProviderSpecificInput provider specific reverse replication input. +type BasicReverseReplicationProviderSpecificInput interface { + AsA2AReprotectInput() (*A2AReprotectInput, bool) + AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) + AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) + AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) + AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) + AsInMageReprotectInput() (*InMageReprotectInput, bool) + AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) +} + +// ReverseReplicationProviderSpecificInput provider specific reverse replication input. +type ReverseReplicationProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicReverseReplicationProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicReverseReplicationProviderSpecificInput(body []byte) (BasicReverseReplicationProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeA2A): + var ari A2AReprotectInput + err := json.Unmarshal(body, &ari) + return ari, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvrari HyperVReplicaAzureReprotectInput + err := json.Unmarshal(body, &hvrari) + return hvrari, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageAzureV2): + var imavri InMageAzureV2ReprotectInput + err := json.Unmarshal(body, &imavri) + return imavri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcmFailback): + var imrfri InMageRcmFailbackReprotectInput + err := json.Unmarshal(body, &imrfri) + return imrfri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMageRcm): + var imrri InMageRcmReprotectInput + err := json.Unmarshal(body, &imrri) + return imrri, err + case string(InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeInMage): + var imri InMageReprotectInput + err := json.Unmarshal(body, &imri) + return imri, err + default: + var rrpsi ReverseReplicationProviderSpecificInput + err := json.Unmarshal(body, &rrpsi) + return rrpsi, err + } +} +func unmarshalBasicReverseReplicationProviderSpecificInputArray(body []byte) ([]BasicReverseReplicationProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rrpsiArray := make([]BasicReverseReplicationProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rrpsi, err := unmarshalBasicReverseReplicationProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + rrpsiArray[index] = rrpsi + } + return rrpsiArray, nil +} + +// MarshalJSON is the custom marshaler for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) MarshalJSON() ([]byte, error) { + rrpsi.InstanceType = InstanceTypeBasicReverseReplicationProviderSpecificInputInstanceTypeReverseReplicationProviderSpecificInput + objectMap := make(map[string]interface{}) + if rrpsi.InstanceType != "" { + objectMap["instanceType"] = rrpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsA2AReprotectInput() (*A2AReprotectInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsHyperVReplicaAzureReprotectInput() (*HyperVReplicaAzureReprotectInput, bool) { + return nil, false +} + +// AsInMageAzureV2ReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageAzureV2ReprotectInput() (*InMageAzureV2ReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageRcmFailbackReprotectInput() (*InMageRcmFailbackReprotectInput, bool) { + return nil, false +} + +// AsInMageRcmReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageRcmReprotectInput() (*InMageRcmReprotectInput, bool) { + return nil, false +} + +// AsInMageReprotectInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsInMageReprotectInput() (*InMageReprotectInput, bool) { + return nil, false +} + +// AsReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsReverseReplicationProviderSpecificInput() (*ReverseReplicationProviderSpecificInput, bool) { + return &rrpsi, true +} + +// AsBasicReverseReplicationProviderSpecificInput is the BasicReverseReplicationProviderSpecificInput implementation for ReverseReplicationProviderSpecificInput. +func (rrpsi ReverseReplicationProviderSpecificInput) AsBasicReverseReplicationProviderSpecificInput() (BasicReverseReplicationProviderSpecificInput, bool) { + return &rrpsi, true +} + +// RoleAssignment azure role assignment details. +type RoleAssignment struct { + // ID - The ARM Id of the role assignment. + ID *string `json:"id,omitempty"` + // Name - The name of the role assignment. + Name *string `json:"name,omitempty"` + // Scope - Role assignment scope. + Scope *string `json:"scope,omitempty"` + // PrincipalID - Principal Id. + PrincipalID *string `json:"principalId,omitempty"` + // RoleDefinitionID - Role definition id. + RoleDefinitionID *string `json:"roleDefinitionId,omitempty"` +} + +// RunAsAccount CS Accounts Details. +type RunAsAccount struct { + // AccountID - The CS RunAs account Id. + AccountID *string `json:"accountId,omitempty"` + // AccountName - The CS RunAs account name. + AccountName *string `json:"accountName,omitempty"` +} + +// ScriptActionTaskDetails this class represents the script action task details. +type ScriptActionTaskDetails struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // Path - The path. + Path *string `json:"path,omitempty"` + // Output - The output. + Output *string `json:"output,omitempty"` + // IsPrimarySideScript - A value indicating whether it is a primary side script or not. + IsPrimarySideScript *bool `json:"isPrimarySideScript,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) MarshalJSON() ([]byte, error) { + satd.InstanceType = InstanceTypeScriptActionTaskDetails + objectMap := make(map[string]interface{}) + if satd.Name != nil { + objectMap["name"] = satd.Name + } + if satd.Path != nil { + objectMap["path"] = satd.Path + } + if satd.Output != nil { + objectMap["output"] = satd.Output + } + if satd.IsPrimarySideScript != nil { + objectMap["isPrimarySideScript"] = satd.IsPrimarySideScript + } + if satd.InstanceType != "" { + objectMap["instanceType"] = satd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return &satd, true +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for ScriptActionTaskDetails. +func (satd ScriptActionTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &satd, true +} + +// ServiceError ASR error model. +type ServiceError struct { + // Code - Error code. + Code *string `json:"code,omitempty"` + // Message - Error message. + Message *string `json:"message,omitempty"` + // PossibleCauses - Possible causes of error. + PossibleCauses *string `json:"possibleCauses,omitempty"` + // RecommendedAction - Recommended action to resolve error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ActivityID - Activity Id. + ActivityID *string `json:"activityId,omitempty"` +} + +// BasicStorageAccountCustomDetails storage account custom input. +type BasicStorageAccountCustomDetails interface { + AsExistingStorageAccount() (*ExistingStorageAccount, bool) + AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) +} + +// StorageAccountCustomDetails storage account custom input. +type StorageAccountCustomDetails struct { + // ResourceType - Possible values include: 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails', 'ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting' + ResourceType ResourceTypeBasicStorageAccountCustomDetails `json:"resourceType,omitempty"` +} + +func unmarshalBasicStorageAccountCustomDetails(body []byte) (BasicStorageAccountCustomDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeBasicStorageAccountCustomDetailsResourceTypeExisting): + var esa ExistingStorageAccount + err := json.Unmarshal(body, &esa) + return esa, err + default: + var sacd StorageAccountCustomDetails + err := json.Unmarshal(body, &sacd) + return sacd, err + } +} +func unmarshalBasicStorageAccountCustomDetailsArray(body []byte) ([]BasicStorageAccountCustomDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sacdArray := make([]BasicStorageAccountCustomDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sacd, err := unmarshalBasicStorageAccountCustomDetails(*rawMessage) + if err != nil { + return nil, err + } + sacdArray[index] = sacd + } + return sacdArray, nil +} + +// MarshalJSON is the custom marshaler for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) MarshalJSON() ([]byte, error) { + sacd.ResourceType = ResourceTypeBasicStorageAccountCustomDetailsResourceTypeStorageAccountCustomDetails + objectMap := make(map[string]interface{}) + if sacd.ResourceType != "" { + objectMap["resourceType"] = sacd.ResourceType + } + return json.Marshal(objectMap) +} + +// AsExistingStorageAccount is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsExistingStorageAccount() (*ExistingStorageAccount, bool) { + return nil, false +} + +// AsStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsStorageAccountCustomDetails() (*StorageAccountCustomDetails, bool) { + return &sacd, true +} + +// AsBasicStorageAccountCustomDetails is the BasicStorageAccountCustomDetails implementation for StorageAccountCustomDetails. +func (sacd StorageAccountCustomDetails) AsBasicStorageAccountCustomDetails() (BasicStorageAccountCustomDetails, bool) { + return &sacd, true +} + +// StorageClassification storage object definition. +type StorageClassification struct { + autorest.Response `json:"-"` + // Properties - Properties of the storage object. + Properties *StorageClassificationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageClassification. +func (sc StorageClassification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sc.Properties != nil { + objectMap["properties"] = sc.Properties + } + if sc.Location != nil { + objectMap["location"] = sc.Location + } + return json.Marshal(objectMap) +} + +// StorageClassificationCollection collection of storage details. +type StorageClassificationCollection struct { + autorest.Response `json:"-"` + // Value - The storage details. + Value *[]StorageClassification `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// StorageClassificationCollectionIterator provides access to a complete listing of StorageClassification +// values. +type StorageClassificationCollectionIterator struct { + i int + page StorageClassificationCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StorageClassificationCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StorageClassificationCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StorageClassificationCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StorageClassificationCollectionIterator) Response() StorageClassificationCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StorageClassificationCollectionIterator) Value() StorageClassification { + if !iter.page.NotDone() { + return StorageClassification{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StorageClassificationCollectionIterator type. +func NewStorageClassificationCollectionIterator(page StorageClassificationCollectionPage) StorageClassificationCollectionIterator { + return StorageClassificationCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scc StorageClassificationCollection) IsEmpty() bool { + return scc.Value == nil || len(*scc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scc StorageClassificationCollection) hasNextLink() bool { + return scc.NextLink != nil && len(*scc.NextLink) != 0 +} + +// storageClassificationCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scc StorageClassificationCollection) storageClassificationCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !scc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scc.NextLink))) +} + +// StorageClassificationCollectionPage contains a page of StorageClassification values. +type StorageClassificationCollectionPage struct { + fn func(context.Context, StorageClassificationCollection) (StorageClassificationCollection, error) + scc StorageClassificationCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StorageClassificationCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.scc) + if err != nil { + return err + } + page.scc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StorageClassificationCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StorageClassificationCollectionPage) NotDone() bool { + return !page.scc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StorageClassificationCollectionPage) Response() StorageClassificationCollection { + return page.scc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StorageClassificationCollectionPage) Values() []StorageClassification { + if page.scc.IsEmpty() { + return nil + } + return *page.scc.Value +} + +// Creates a new instance of the StorageClassificationCollectionPage type. +func NewStorageClassificationCollectionPage(cur StorageClassificationCollection, getNextPage func(context.Context, StorageClassificationCollection) (StorageClassificationCollection, error)) StorageClassificationCollectionPage { + return StorageClassificationCollectionPage{ + fn: getNextPage, + scc: cur, + } +} + +// StorageClassificationMapping storage mapping object. +type StorageClassificationMapping struct { + autorest.Response `json:"-"` + // Properties - Properties of the storage mapping object. + Properties *StorageClassificationMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageClassificationMapping. +func (scm StorageClassificationMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scm.Properties != nil { + objectMap["properties"] = scm.Properties + } + if scm.Location != nil { + objectMap["location"] = scm.Location + } + return json.Marshal(objectMap) +} + +// StorageClassificationMappingCollection collection of storage mapping details. +type StorageClassificationMappingCollection struct { + autorest.Response `json:"-"` + // Value - The storage details. + Value *[]StorageClassificationMapping `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// StorageClassificationMappingCollectionIterator provides access to a complete listing of +// StorageClassificationMapping values. +type StorageClassificationMappingCollectionIterator struct { + i int + page StorageClassificationMappingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StorageClassificationMappingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationMappingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StorageClassificationMappingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StorageClassificationMappingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StorageClassificationMappingCollectionIterator) Response() StorageClassificationMappingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StorageClassificationMappingCollectionIterator) Value() StorageClassificationMapping { + if !iter.page.NotDone() { + return StorageClassificationMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StorageClassificationMappingCollectionIterator type. +func NewStorageClassificationMappingCollectionIterator(page StorageClassificationMappingCollectionPage) StorageClassificationMappingCollectionIterator { + return StorageClassificationMappingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scmc StorageClassificationMappingCollection) IsEmpty() bool { + return scmc.Value == nil || len(*scmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scmc StorageClassificationMappingCollection) hasNextLink() bool { + return scmc.NextLink != nil && len(*scmc.NextLink) != 0 +} + +// storageClassificationMappingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scmc StorageClassificationMappingCollection) storageClassificationMappingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !scmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scmc.NextLink))) +} + +// StorageClassificationMappingCollectionPage contains a page of StorageClassificationMapping values. +type StorageClassificationMappingCollectionPage struct { + fn func(context.Context, StorageClassificationMappingCollection) (StorageClassificationMappingCollection, error) + scmc StorageClassificationMappingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StorageClassificationMappingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageClassificationMappingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.scmc) + if err != nil { + return err + } + page.scmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StorageClassificationMappingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StorageClassificationMappingCollectionPage) NotDone() bool { + return !page.scmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StorageClassificationMappingCollectionPage) Response() StorageClassificationMappingCollection { + return page.scmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StorageClassificationMappingCollectionPage) Values() []StorageClassificationMapping { + if page.scmc.IsEmpty() { + return nil + } + return *page.scmc.Value +} + +// Creates a new instance of the StorageClassificationMappingCollectionPage type. +func NewStorageClassificationMappingCollectionPage(cur StorageClassificationMappingCollection, getNextPage func(context.Context, StorageClassificationMappingCollection) (StorageClassificationMappingCollection, error)) StorageClassificationMappingCollectionPage { + return StorageClassificationMappingCollectionPage{ + fn: getNextPage, + scmc: cur, + } +} + +// StorageClassificationMappingInput storage mapping input. +type StorageClassificationMappingInput struct { + // Properties - Storage mapping input properties. + Properties *StorageMappingInputProperties `json:"properties,omitempty"` +} + +// StorageClassificationMappingProperties storage mapping properties. +type StorageClassificationMappingProperties struct { + // TargetStorageClassificationID - Target storage object Id. + TargetStorageClassificationID *string `json:"targetStorageClassificationId,omitempty"` +} + +// StorageClassificationProperties storage object properties. +type StorageClassificationProperties struct { + // FriendlyName - Friendly name of the Storage classification. + FriendlyName *string `json:"friendlyName,omitempty"` +} + +// StorageMappingInputProperties storage mapping input properties. +type StorageMappingInputProperties struct { + // TargetStorageClassificationID - The ID of the storage object. + TargetStorageClassificationID *string `json:"targetStorageClassificationId,omitempty"` +} + +// Subnet subnets of the network. +type Subnet struct { + // Name - The subnet name. + Name *string `json:"name,omitempty"` + // FriendlyName - The subnet friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` + // AddressList - The list of addresses for the subnet. + AddressList *[]string `json:"addressList,omitempty"` +} + +// SupportedOperatingSystems supported operating systems. +type SupportedOperatingSystems struct { + autorest.Response `json:"-"` + // Properties - The supported operating systems properties. + Properties *SupportedOSProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for SupportedOperatingSystems. +func (sos SupportedOperatingSystems) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sos.Properties != nil { + objectMap["properties"] = sos.Properties + } + if sos.Location != nil { + objectMap["location"] = sos.Location + } + return json.Marshal(objectMap) +} + +// SupportedOSDetails supported operating system details. +type SupportedOSDetails struct { + // OsName - The name. + OsName *string `json:"osName,omitempty"` + // OsType - The type. + OsType *string `json:"osType,omitempty"` + // OsVersions - The list of version for operating system. + OsVersions *[]OSVersionWrapper `json:"osVersions,omitempty"` +} + +// SupportedOSProperties supported operating systems properties. +type SupportedOSProperties struct { + // SupportedOsList - The supported operating systems property list. + SupportedOsList *[]SupportedOSProperty `json:"supportedOsList,omitempty"` +} + +// SupportedOSProperty supported operating systems property. +type SupportedOSProperty struct { + // InstanceType - The replication provider type. + InstanceType *string `json:"instanceType,omitempty"` + // SupportedOs - The list of supported operating systems. + SupportedOs *[]SupportedOSDetails `json:"supportedOs,omitempty"` +} + +// SwitchProtectionInput switch protection input. +type SwitchProtectionInput struct { + // Properties - Switch protection properties. + Properties *SwitchProtectionInputProperties `json:"properties,omitempty"` +} + +// SwitchProtectionInputProperties switch protection input properties. +type SwitchProtectionInputProperties struct { + // ReplicationProtectedItemName - The unique replication protected item name. + ReplicationProtectedItemName *string `json:"replicationProtectedItemName,omitempty"` + // ProviderSpecificDetails - Provider specific switch protection input. + ProviderSpecificDetails BasicSwitchProtectionProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SwitchProtectionInputProperties struct. +func (spip *SwitchProtectionInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "replicationProtectedItemName": + if v != nil { + var replicationProtectedItemName string + err = json.Unmarshal(*v, &replicationProtectedItemName) + if err != nil { + return err + } + spip.ReplicationProtectedItemName = &replicationProtectedItemName + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicSwitchProtectionProviderSpecificInput(*v) + if err != nil { + return err + } + spip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// SwitchProtectionJobDetails this class represents details for switch protection job. +type SwitchProtectionJobDetails struct { + // NewReplicationProtectedItemID - ARM Id of the new replication protected item. + NewReplicationProtectedItemID *string `json:"newReplicationProtectedItemId,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) MarshalJSON() ([]byte, error) { + spjd.InstanceType = InstanceTypeSwitchProtectionJobDetails + objectMap := make(map[string]interface{}) + if spjd.NewReplicationProtectedItemID != nil { + objectMap["newReplicationProtectedItemId"] = spjd.NewReplicationProtectedItemID + } + if spjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = spjd.AffectedObjectDetails + } + if spjd.InstanceType != "" { + objectMap["instanceType"] = spjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return &spjd, true +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for SwitchProtectionJobDetails. +func (spjd SwitchProtectionJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &spjd, true +} + +// BasicSwitchProtectionProviderSpecificInput provider specific switch protection input. +type BasicSwitchProtectionProviderSpecificInput interface { + AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) + AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) +} + +// SwitchProtectionProviderSpecificInput provider specific switch protection input. +type SwitchProtectionProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput', 'InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A' + InstanceType InstanceTypeBasicSwitchProtectionProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicSwitchProtectionProviderSpecificInput(body []byte) (BasicSwitchProtectionProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeA2A): + var aspi A2ASwitchProtectionInput + err := json.Unmarshal(body, &aspi) + return aspi, err + default: + var sppsi SwitchProtectionProviderSpecificInput + err := json.Unmarshal(body, &sppsi) + return sppsi, err + } +} +func unmarshalBasicSwitchProtectionProviderSpecificInputArray(body []byte) ([]BasicSwitchProtectionProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sppsiArray := make([]BasicSwitchProtectionProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sppsi, err := unmarshalBasicSwitchProtectionProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + sppsiArray[index] = sppsi + } + return sppsiArray, nil +} + +// MarshalJSON is the custom marshaler for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + sppsi.InstanceType = InstanceTypeBasicSwitchProtectionProviderSpecificInputInstanceTypeSwitchProtectionProviderSpecificInput + objectMap := make(map[string]interface{}) + if sppsi.InstanceType != "" { + objectMap["instanceType"] = sppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ASwitchProtectionInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsA2ASwitchProtectionInput() (*A2ASwitchProtectionInput, bool) { + return nil, false +} + +// AsSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsSwitchProtectionProviderSpecificInput() (*SwitchProtectionProviderSpecificInput, bool) { + return &sppsi, true +} + +// AsBasicSwitchProtectionProviderSpecificInput is the BasicSwitchProtectionProviderSpecificInput implementation for SwitchProtectionProviderSpecificInput. +func (sppsi SwitchProtectionProviderSpecificInput) AsBasicSwitchProtectionProviderSpecificInput() (BasicSwitchProtectionProviderSpecificInput, bool) { + return &sppsi, true +} + +// SwitchProviderInput input definition for switch provider. +type SwitchProviderInput struct { + // Properties - Switch provider input properties. + Properties *SwitchProviderInputProperties `json:"properties,omitempty"` +} + +// SwitchProviderInputProperties input definition for switch provider input properties. +type SwitchProviderInputProperties struct { + // TargetInstanceType - Target provider type. + TargetInstanceType *string `json:"targetInstanceType,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicSwitchProviderProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SwitchProviderInputProperties struct. +func (spip *SwitchProviderInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetInstanceType": + if v != nil { + var targetInstanceType string + err = json.Unmarshal(*v, &targetInstanceType) + if err != nil { + return err + } + spip.TargetInstanceType = &targetInstanceType + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicSwitchProviderProviderSpecificInput(*v) + if err != nil { + return err + } + spip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicSwitchProviderProviderSpecificInput provider specific switch provider input. +type BasicSwitchProviderProviderSpecificInput interface { + AsInMageAzureV2SwitchProviderProviderInput() (*InMageAzureV2SwitchProviderProviderInput, bool) + AsSwitchProviderProviderSpecificInput() (*SwitchProviderProviderSpecificInput, bool) +} + +// SwitchProviderProviderSpecificInput provider specific switch provider input. +type SwitchProviderProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeSwitchProviderProviderSpecificInput', 'InstanceTypeInMageAzureV2' + InstanceType InstanceTypeBasicSwitchProviderProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicSwitchProviderProviderSpecificInput(body []byte) (BasicSwitchProviderProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeInMageAzureV2): + var imavsppi InMageAzureV2SwitchProviderProviderInput + err := json.Unmarshal(body, &imavsppi) + return imavsppi, err + default: + var sppsi SwitchProviderProviderSpecificInput + err := json.Unmarshal(body, &sppsi) + return sppsi, err + } +} +func unmarshalBasicSwitchProviderProviderSpecificInputArray(body []byte) ([]BasicSwitchProviderProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sppsiArray := make([]BasicSwitchProviderProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sppsi, err := unmarshalBasicSwitchProviderProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + sppsiArray[index] = sppsi + } + return sppsiArray, nil +} + +// MarshalJSON is the custom marshaler for SwitchProviderProviderSpecificInput. +func (sppsi SwitchProviderProviderSpecificInput) MarshalJSON() ([]byte, error) { + sppsi.InstanceType = InstanceTypeSwitchProviderProviderSpecificInput + objectMap := make(map[string]interface{}) + if sppsi.InstanceType != "" { + objectMap["instanceType"] = sppsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageAzureV2SwitchProviderProviderInput is the BasicSwitchProviderProviderSpecificInput implementation for SwitchProviderProviderSpecificInput. +func (sppsi SwitchProviderProviderSpecificInput) AsInMageAzureV2SwitchProviderProviderInput() (*InMageAzureV2SwitchProviderProviderInput, bool) { + return nil, false +} + +// AsSwitchProviderProviderSpecificInput is the BasicSwitchProviderProviderSpecificInput implementation for SwitchProviderProviderSpecificInput. +func (sppsi SwitchProviderProviderSpecificInput) AsSwitchProviderProviderSpecificInput() (*SwitchProviderProviderSpecificInput, bool) { + return &sppsi, true +} + +// AsBasicSwitchProviderProviderSpecificInput is the BasicSwitchProviderProviderSpecificInput implementation for SwitchProviderProviderSpecificInput. +func (sppsi SwitchProviderProviderSpecificInput) AsBasicSwitchProviderProviderSpecificInput() (BasicSwitchProviderProviderSpecificInput, bool) { + return &sppsi, true +} + +// TargetComputeSize represents applicable recovery vm sizes. +type TargetComputeSize struct { + // ID - The Id. + ID *string `json:"id,omitempty"` + // Name - The name. + Name *string `json:"name,omitempty"` + // Type - The Type of the object. + Type *string `json:"type,omitempty"` + // Properties - The custom data. + Properties *TargetComputeSizeProperties `json:"properties,omitempty"` +} + +// TargetComputeSizeCollection target compute size collection. +type TargetComputeSizeCollection struct { + autorest.Response `json:"-"` + // Value - The list of target compute sizes. + Value *[]TargetComputeSize `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// TargetComputeSizeCollectionIterator provides access to a complete listing of TargetComputeSize values. +type TargetComputeSizeCollectionIterator struct { + i int + page TargetComputeSizeCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *TargetComputeSizeCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizeCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *TargetComputeSizeCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TargetComputeSizeCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter TargetComputeSizeCollectionIterator) Response() TargetComputeSizeCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter TargetComputeSizeCollectionIterator) Value() TargetComputeSize { + if !iter.page.NotDone() { + return TargetComputeSize{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the TargetComputeSizeCollectionIterator type. +func NewTargetComputeSizeCollectionIterator(page TargetComputeSizeCollectionPage) TargetComputeSizeCollectionIterator { + return TargetComputeSizeCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (tcsc TargetComputeSizeCollection) IsEmpty() bool { + return tcsc.Value == nil || len(*tcsc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (tcsc TargetComputeSizeCollection) hasNextLink() bool { + return tcsc.NextLink != nil && len(*tcsc.NextLink) != 0 +} + +// targetComputeSizeCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tcsc TargetComputeSizeCollection) targetComputeSizeCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !tcsc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(tcsc.NextLink))) +} + +// TargetComputeSizeCollectionPage contains a page of TargetComputeSize values. +type TargetComputeSizeCollectionPage struct { + fn func(context.Context, TargetComputeSizeCollection) (TargetComputeSizeCollection, error) + tcsc TargetComputeSizeCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *TargetComputeSizeCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizeCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.tcsc) + if err != nil { + return err + } + page.tcsc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *TargetComputeSizeCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TargetComputeSizeCollectionPage) NotDone() bool { + return !page.tcsc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TargetComputeSizeCollectionPage) Response() TargetComputeSizeCollection { + return page.tcsc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TargetComputeSizeCollectionPage) Values() []TargetComputeSize { + if page.tcsc.IsEmpty() { + return nil + } + return *page.tcsc.Value +} + +// Creates a new instance of the TargetComputeSizeCollectionPage type. +func NewTargetComputeSizeCollectionPage(cur TargetComputeSizeCollection, getNextPage func(context.Context, TargetComputeSizeCollection) (TargetComputeSizeCollection, error)) TargetComputeSizeCollectionPage { + return TargetComputeSizeCollectionPage{ + fn: getNextPage, + tcsc: cur, + } +} + +// TargetComputeSizeProperties represents applicable recovery vm sizes properties. +type TargetComputeSizeProperties struct { + // Name - Target compute size name. + Name *string `json:"name,omitempty"` + // FriendlyName - Target compute size display name. + FriendlyName *string `json:"friendlyName,omitempty"` + // CPUCoresCount - The maximum cpu cores count supported by target compute size. + CPUCoresCount *int32 `json:"cpuCoresCount,omitempty"` + // VCPUsAvailable - READ-ONLY; The Available vCPUs supported by target compute size. + VCPUsAvailable *int32 `json:"vCPUsAvailable,omitempty"` + // MemoryInGB - The maximum memory in GB supported by target compute size. + MemoryInGB *float64 `json:"memoryInGB,omitempty"` + // MaxDataDiskCount - The maximum data disks count supported by target compute size. + MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` + // MaxNicsCount - The maximum Nics count supported by target compute size. + MaxNicsCount *int32 `json:"maxNicsCount,omitempty"` + // Errors - The reasons why the target compute size is not applicable for the protected item. + Errors *[]ComputeSizeErrorDetails `json:"errors,omitempty"` + // HighIopsSupported - The value indicating whether the target compute size supports high Iops. + HighIopsSupported *string `json:"highIopsSupported,omitempty"` + // HyperVGenerations - The supported HyperV Generations. + HyperVGenerations *[]string `json:"hyperVGenerations,omitempty"` +} + +// MarshalJSON is the custom marshaler for TargetComputeSizeProperties. +func (tcsp TargetComputeSizeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tcsp.Name != nil { + objectMap["name"] = tcsp.Name + } + if tcsp.FriendlyName != nil { + objectMap["friendlyName"] = tcsp.FriendlyName + } + if tcsp.CPUCoresCount != nil { + objectMap["cpuCoresCount"] = tcsp.CPUCoresCount + } + if tcsp.MemoryInGB != nil { + objectMap["memoryInGB"] = tcsp.MemoryInGB + } + if tcsp.MaxDataDiskCount != nil { + objectMap["maxDataDiskCount"] = tcsp.MaxDataDiskCount + } + if tcsp.MaxNicsCount != nil { + objectMap["maxNicsCount"] = tcsp.MaxNicsCount + } + if tcsp.Errors != nil { + objectMap["errors"] = tcsp.Errors + } + if tcsp.HighIopsSupported != nil { + objectMap["highIopsSupported"] = tcsp.HighIopsSupported + } + if tcsp.HyperVGenerations != nil { + objectMap["hyperVGenerations"] = tcsp.HyperVGenerations + } + return json.Marshal(objectMap) +} + +// BasicTaskTypeDetails task details based on specific task type. +type BasicTaskTypeDetails interface { + AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) + AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) + AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) + AsJobTaskDetails() (*JobTaskDetails, bool) + AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) + AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) + AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) + AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) + AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) + AsTaskTypeDetails() (*TaskTypeDetails, bool) +} + +// TaskTypeDetails task details based on specific task type. +type TaskTypeDetails struct { + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +func unmarshalBasicTaskTypeDetails(body []byte) (BasicTaskTypeDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeAutomationRunbookTaskDetails): + var artd AutomationRunbookTaskDetails + err := json.Unmarshal(body, &artd) + return artd, err + case string(InstanceTypeConsistencyCheckTaskDetails): + var cctd ConsistencyCheckTaskDetails + err := json.Unmarshal(body, &cctd) + return cctd, err + case string(InstanceTypeFabricReplicationGroupTaskDetails): + var frgtd FabricReplicationGroupTaskDetails + err := json.Unmarshal(body, &frgtd) + return frgtd, err + case string(InstanceTypeJobTaskDetails): + var jtd JobTaskDetails + err := json.Unmarshal(body, &jtd) + return jtd, err + case string(InstanceTypeManualActionTaskDetails): + var matd ManualActionTaskDetails + err := json.Unmarshal(body, &matd) + return matd, err + case string(InstanceTypeScriptActionTaskDetails): + var satd ScriptActionTaskDetails + err := json.Unmarshal(body, &satd) + return satd, err + case string(InstanceTypeVirtualMachineTaskDetails): + var vmtd VirtualMachineTaskDetails + err := json.Unmarshal(body, &vmtd) + return vmtd, err + case string(InstanceTypeVMNicUpdatesTaskDetails): + var vnutd VMNicUpdatesTaskDetails + err := json.Unmarshal(body, &vnutd) + return vnutd, err + default: + var ttd TaskTypeDetails + err := json.Unmarshal(body, &ttd) + return ttd, err + } +} +func unmarshalBasicTaskTypeDetailsArray(body []byte) ([]BasicTaskTypeDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ttdArray := make([]BasicTaskTypeDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ttd, err := unmarshalBasicTaskTypeDetails(*rawMessage) + if err != nil { + return nil, err + } + ttdArray[index] = ttd + } + return ttdArray, nil +} + +// MarshalJSON is the custom marshaler for TaskTypeDetails. +func (ttd TaskTypeDetails) MarshalJSON() ([]byte, error) { + ttd.InstanceType = InstanceTypeTaskTypeDetails + objectMap := make(map[string]interface{}) + if ttd.InstanceType != "" { + objectMap["instanceType"] = ttd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return &ttd, true +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for TaskTypeDetails. +func (ttd TaskTypeDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &ttd, true +} + +// TestFailoverCleanupInput input definition for test failover cleanup. +type TestFailoverCleanupInput struct { + // Properties - Test failover cleanup input properties. + Properties *TestFailoverCleanupInputProperties `json:"properties,omitempty"` +} + +// TestFailoverCleanupInputProperties input definition for test failover cleanup input properties. +type TestFailoverCleanupInputProperties struct { + // Comments - Test failover cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// TestFailoverInput input definition for test failover. +type TestFailoverInput struct { + // Properties - Test failover input properties. + Properties *TestFailoverInputProperties `json:"properties,omitempty"` +} + +// TestFailoverInputProperties input definition for test failover input properties. +type TestFailoverInputProperties struct { + // FailoverDirection - Test failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // NetworkType - Network type to be used for test failover. + NetworkType *string `json:"networkType,omitempty"` + // NetworkID - The id of the network to be used for test failover. + NetworkID *string `json:"networkId,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicTestFailoverProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TestFailoverInputProperties struct. +func (tfip *TestFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + tfip.FailoverDirection = &failoverDirection + } + case "networkType": + if v != nil { + var networkType string + err = json.Unmarshal(*v, &networkType) + if err != nil { + return err + } + tfip.NetworkType = &networkType + } + case "networkId": + if v != nil { + var networkID string + err = json.Unmarshal(*v, &networkID) + if err != nil { + return err + } + tfip.NetworkID = &networkID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicTestFailoverProviderSpecificInput(*v) + if err != nil { + return err + } + tfip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// TestFailoverJobDetails this class represents the details for a test failover job. +type TestFailoverJobDetails struct { + // TestFailoverStatus - The test failover status. + TestFailoverStatus *string `json:"testFailoverStatus,omitempty"` + // Comments - The test failover comments. + Comments *string `json:"comments,omitempty"` + // NetworkName - The test network name. + NetworkName *string `json:"networkName,omitempty"` + // NetworkFriendlyName - The test network friendly name. + NetworkFriendlyName *string `json:"networkFriendlyName,omitempty"` + // NetworkType - The test network type (see TestFailoverInput enum for possible values). + NetworkType *string `json:"networkType,omitempty"` + // ProtectedItemDetails - The test VM details. + ProtectedItemDetails *[]FailoverReplicationProtectedItemDetails `json:"protectedItemDetails,omitempty"` + // AffectedObjectDetails - The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + AffectedObjectDetails map[string]*string `json:"affectedObjectDetails"` + // InstanceType - Possible values include: 'InstanceTypeJobDetails', 'InstanceTypeAsrJobDetails', 'InstanceTypeExportJobDetails', 'InstanceTypeFailoverJobDetails', 'InstanceTypeSwitchProtectionJobDetails', 'InstanceTypeTestFailoverJobDetails' + InstanceType InstanceTypeBasicJobDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) MarshalJSON() ([]byte, error) { + tfjd.InstanceType = InstanceTypeTestFailoverJobDetails + objectMap := make(map[string]interface{}) + if tfjd.TestFailoverStatus != nil { + objectMap["testFailoverStatus"] = tfjd.TestFailoverStatus + } + if tfjd.Comments != nil { + objectMap["comments"] = tfjd.Comments + } + if tfjd.NetworkName != nil { + objectMap["networkName"] = tfjd.NetworkName + } + if tfjd.NetworkFriendlyName != nil { + objectMap["networkFriendlyName"] = tfjd.NetworkFriendlyName + } + if tfjd.NetworkType != nil { + objectMap["networkType"] = tfjd.NetworkType + } + if tfjd.ProtectedItemDetails != nil { + objectMap["protectedItemDetails"] = tfjd.ProtectedItemDetails + } + if tfjd.AffectedObjectDetails != nil { + objectMap["affectedObjectDetails"] = tfjd.AffectedObjectDetails + } + if tfjd.InstanceType != "" { + objectMap["instanceType"] = tfjd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAsrJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsAsrJobDetails() (*AsrJobDetails, bool) { + return nil, false +} + +// AsExportJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsExportJobDetails() (*ExportJobDetails, bool) { + return nil, false +} + +// AsFailoverJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsFailoverJobDetails() (*FailoverJobDetails, bool) { + return nil, false +} + +// AsSwitchProtectionJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsSwitchProtectionJobDetails() (*SwitchProtectionJobDetails, bool) { + return nil, false +} + +// AsTestFailoverJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsTestFailoverJobDetails() (*TestFailoverJobDetails, bool) { + return &tfjd, true +} + +// AsJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for TestFailoverJobDetails. +func (tfjd TestFailoverJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &tfjd, true +} + +// BasicTestFailoverProviderSpecificInput provider specific test failover input. +type BasicTestFailoverProviderSpecificInput interface { + AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) + AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) + AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) + AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) + AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) + AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) +} + +// TestFailoverProviderSpecificInput provider specific test failover input. +type TestFailoverProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicTestFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicTestFailoverProviderSpecificInput(body []byte) (BasicTestFailoverProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeA2A): + var atfi A2ATestFailoverInput + err := json.Unmarshal(body, &atfi) + return atfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvratfi HyperVReplicaAzureTestFailoverInput + err := json.Unmarshal(body, &hvratfi) + return hvratfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageAzureV2): + var imavtfi InMageAzureV2TestFailoverInput + err := json.Unmarshal(body, &imavtfi) + return imavtfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMageRcm): + var imrtfi InMageRcmTestFailoverInput + err := json.Unmarshal(body, &imrtfi) + return imrtfi, err + case string(InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeInMage): + var imtfi InMageTestFailoverInput + err := json.Unmarshal(body, &imtfi) + return imtfi, err + default: + var tfpsi TestFailoverProviderSpecificInput + err := json.Unmarshal(body, &tfpsi) + return tfpsi, err + } +} +func unmarshalBasicTestFailoverProviderSpecificInputArray(body []byte) ([]BasicTestFailoverProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tfpsiArray := make([]BasicTestFailoverProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + tfpsi, err := unmarshalBasicTestFailoverProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + tfpsiArray[index] = tfpsi + } + return tfpsiArray, nil +} + +// MarshalJSON is the custom marshaler for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) MarshalJSON() ([]byte, error) { + tfpsi.InstanceType = InstanceTypeBasicTestFailoverProviderSpecificInputInstanceTypeTestFailoverProviderSpecificInput + objectMap := make(map[string]interface{}) + if tfpsi.InstanceType != "" { + objectMap["instanceType"] = tfpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ATestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsA2ATestFailoverInput() (*A2ATestFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsHyperVReplicaAzureTestFailoverInput() (*HyperVReplicaAzureTestFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2TestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageAzureV2TestFailoverInput() (*InMageAzureV2TestFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageRcmTestFailoverInput() (*InMageRcmTestFailoverInput, bool) { + return nil, false +} + +// AsInMageTestFailoverInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsInMageTestFailoverInput() (*InMageTestFailoverInput, bool) { + return nil, false +} + +// AsTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsTestFailoverProviderSpecificInput() (*TestFailoverProviderSpecificInput, bool) { + return &tfpsi, true +} + +// AsBasicTestFailoverProviderSpecificInput is the BasicTestFailoverProviderSpecificInput implementation for TestFailoverProviderSpecificInput. +func (tfpsi TestFailoverProviderSpecificInput) AsBasicTestFailoverProviderSpecificInput() (BasicTestFailoverProviderSpecificInput, bool) { + return &tfpsi, true +} + +// TestMigrateCleanupInput input for test migrate cleanup. +type TestMigrateCleanupInput struct { + // Properties - Test migrate cleanup input properties. + Properties *TestMigrateCleanupInputProperties `json:"properties,omitempty"` +} + +// TestMigrateCleanupInputProperties test migrate cleanup input properties. +type TestMigrateCleanupInputProperties struct { + // Comments - Test migrate cleanup comments. + Comments *string `json:"comments,omitempty"` +} + +// TestMigrateInput input for test migrate. +type TestMigrateInput struct { + // Properties - Test migrate input properties. + Properties *TestMigrateInputProperties `json:"properties,omitempty"` +} + +// TestMigrateInputProperties test migrate input properties. +type TestMigrateInputProperties struct { + // ProviderSpecificDetails - The provider specific details. + ProviderSpecificDetails BasicTestMigrateProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TestMigrateInputProperties struct. +func (tmip *TestMigrateInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicTestMigrateProviderSpecificInput(*v) + if err != nil { + return err + } + tmip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicTestMigrateProviderSpecificInput test migrate provider specific input. +type BasicTestMigrateProviderSpecificInput interface { + AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) + AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) +} + +// TestMigrateProviderSpecificInput test migrate provider specific input. +type TestMigrateProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput', 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicTestMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicTestMigrateProviderSpecificInput(body []byte) (BasicTestMigrateProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt): + var vmctmi VMwareCbtTestMigrateInput + err := json.Unmarshal(body, &vmctmi) + return vmctmi, err + default: + var tmpsi TestMigrateProviderSpecificInput + err := json.Unmarshal(body, &tmpsi) + return tmpsi, err + } +} +func unmarshalBasicTestMigrateProviderSpecificInputArray(body []byte) ([]BasicTestMigrateProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tmpsiArray := make([]BasicTestMigrateProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + tmpsi, err := unmarshalBasicTestMigrateProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + tmpsiArray[index] = tmpsi + } + return tmpsiArray, nil +} + +// MarshalJSON is the custom marshaler for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) MarshalJSON() ([]byte, error) { + tmpsi.InstanceType = InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput + objectMap := make(map[string]interface{}) + if tmpsi.InstanceType != "" { + objectMap["instanceType"] = tmpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtTestMigrateInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) { + return nil, false +} + +// AsTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) { + return &tmpsi, true +} + +// AsBasicTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for TestMigrateProviderSpecificInput. +func (tmpsi TestMigrateProviderSpecificInput) AsBasicTestMigrateProviderSpecificInput() (BasicTestMigrateProviderSpecificInput, bool) { + return &tmpsi, true +} + +// UnplannedFailoverInput input definition for unplanned failover. +type UnplannedFailoverInput struct { + // Properties - Unplanned failover input properties. + Properties *UnplannedFailoverInputProperties `json:"properties,omitempty"` +} + +// UnplannedFailoverInputProperties input definition for unplanned failover input properties. +type UnplannedFailoverInputProperties struct { + // FailoverDirection - Failover direction. + FailoverDirection *string `json:"failoverDirection,omitempty"` + // SourceSiteOperations - Source site operations status. + SourceSiteOperations *string `json:"sourceSiteOperations,omitempty"` + // ProviderSpecificDetails - Provider specific settings. + ProviderSpecificDetails BasicUnplannedFailoverProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UnplannedFailoverInputProperties struct. +func (ufip *UnplannedFailoverInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "failoverDirection": + if v != nil { + var failoverDirection string + err = json.Unmarshal(*v, &failoverDirection) + if err != nil { + return err + } + ufip.FailoverDirection = &failoverDirection + } + case "sourceSiteOperations": + if v != nil { + var sourceSiteOperations string + err = json.Unmarshal(*v, &sourceSiteOperations) + if err != nil { + return err + } + ufip.SourceSiteOperations = &sourceSiteOperations + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUnplannedFailoverProviderSpecificInput(*v) + if err != nil { + return err + } + ufip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUnplannedFailoverProviderSpecificInput provider specific unplanned failover input. +type BasicUnplannedFailoverProviderSpecificInput interface { + AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) + AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) + AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) + AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) + AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) + AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) +} + +// UnplannedFailoverProviderSpecificInput provider specific unplanned failover input. +type UnplannedFailoverProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage' + InstanceType InstanceTypeBasicUnplannedFailoverProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUnplannedFailoverProviderSpecificInput(body []byte) (BasicUnplannedFailoverProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeA2A): + var aufi A2AUnplannedFailoverInput + err := json.Unmarshal(body, &aufi) + return aufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeHyperVReplicaAzure): + var hvraufi HyperVReplicaAzureUnplannedFailoverInput + err := json.Unmarshal(body, &hvraufi) + return hvraufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageAzureV2): + var imavufi InMageAzureV2UnplannedFailoverInput + err := json.Unmarshal(body, &imavufi) + return imavufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMageRcm): + var imrufi InMageRcmUnplannedFailoverInput + err := json.Unmarshal(body, &imrufi) + return imrufi, err + case string(InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeInMage): + var imufi InMageUnplannedFailoverInput + err := json.Unmarshal(body, &imufi) + return imufi, err + default: + var ufpsi UnplannedFailoverProviderSpecificInput + err := json.Unmarshal(body, &ufpsi) + return ufpsi, err + } +} +func unmarshalBasicUnplannedFailoverProviderSpecificInputArray(body []byte) ([]BasicUnplannedFailoverProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ufpsiArray := make([]BasicUnplannedFailoverProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ufpsi, err := unmarshalBasicUnplannedFailoverProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + ufpsiArray[index] = ufpsi + } + return ufpsiArray, nil +} + +// MarshalJSON is the custom marshaler for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) MarshalJSON() ([]byte, error) { + ufpsi.InstanceType = InstanceTypeBasicUnplannedFailoverProviderSpecificInputInstanceTypeUnplannedFailoverProviderSpecificInput + objectMap := make(map[string]interface{}) + if ufpsi.InstanceType != "" { + objectMap["instanceType"] = ufpsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsA2AUnplannedFailoverInput() (*A2AUnplannedFailoverInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsHyperVReplicaAzureUnplannedFailoverInput() (*HyperVReplicaAzureUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageAzureV2UnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageAzureV2UnplannedFailoverInput() (*InMageAzureV2UnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageRcmUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageRcmUnplannedFailoverInput() (*InMageRcmUnplannedFailoverInput, bool) { + return nil, false +} + +// AsInMageUnplannedFailoverInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsInMageUnplannedFailoverInput() (*InMageUnplannedFailoverInput, bool) { + return nil, false +} + +// AsUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsUnplannedFailoverProviderSpecificInput() (*UnplannedFailoverProviderSpecificInput, bool) { + return &ufpsi, true +} + +// AsBasicUnplannedFailoverProviderSpecificInput is the BasicUnplannedFailoverProviderSpecificInput implementation for UnplannedFailoverProviderSpecificInput. +func (ufpsi UnplannedFailoverProviderSpecificInput) AsBasicUnplannedFailoverProviderSpecificInput() (BasicUnplannedFailoverProviderSpecificInput, bool) { + return &ufpsi, true +} + +// UpdateApplianceForReplicationProtectedItemInput update appliance for replication protected item input. +type UpdateApplianceForReplicationProtectedItemInput struct { + // Properties - Update appliance replication protected item properties. + Properties *UpdateApplianceForReplicationProtectedItemInputProperties `json:"properties,omitempty"` +} + +// UpdateApplianceForReplicationProtectedItemInputProperties update appliance for protected item input +// properties. +type UpdateApplianceForReplicationProtectedItemInputProperties struct { + // TargetApplianceID - The target appliance Id. + TargetApplianceID *string `json:"targetApplianceId,omitempty"` + // ProviderSpecificDetails - The provider specific input to update replication protected item. + ProviderSpecificDetails BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateApplianceForReplicationProtectedItemInputProperties struct. +func (uafrpiip *UpdateApplianceForReplicationProtectedItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetApplianceId": + if v != nil { + var targetApplianceID string + err = json.Unmarshal(*v, &targetApplianceID) + if err != nil { + return err + } + uafrpiip.TargetApplianceID = &targetApplianceID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput(*v) + if err != nil { + return err + } + uafrpiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput update replication protected item provider +// specific input. +type BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput interface { + AsInMageRcmUpdateApplianceForReplicationProtectedItemInput() (*InMageRcmUpdateApplianceForReplicationProtectedItemInput, bool) + AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (*UpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) +} + +// UpdateApplianceForReplicationProtectedItemProviderSpecificInput update replication protected item provider +// specific input. +type UpdateApplianceForReplicationProtectedItemProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput', 'InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput(body []byte) (BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeInMageRcm): + var imruafrpii InMageRcmUpdateApplianceForReplicationProtectedItemInput + err := json.Unmarshal(body, &imruafrpii) + return imruafrpii, err + default: + var uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput + err := json.Unmarshal(body, &uafrpipsi) + return uafrpipsi, err + } +} +func unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputArray(body []byte) ([]BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + uafrpipsiArray := make([]BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + uafrpipsi, err := unmarshalBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + uafrpipsiArray[index] = uafrpipsi + } + return uafrpipsiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) MarshalJSON() ([]byte, error) { + uafrpipsi.InstanceType = InstanceTypeBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInputInstanceTypeUpdateApplianceForReplicationProtectedItemProviderSpecificInput + objectMap := make(map[string]interface{}) + if uafrpipsi.InstanceType != "" { + objectMap["instanceType"] = uafrpipsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsInMageRcmUpdateApplianceForReplicationProtectedItemInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) AsInMageRcmUpdateApplianceForReplicationProtectedItemInput() (*InMageRcmUpdateApplianceForReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) AsUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (*UpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return &uafrpipsi, true +} + +// AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput is the BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput implementation for UpdateApplianceForReplicationProtectedItemProviderSpecificInput. +func (uafrpipsi UpdateApplianceForReplicationProtectedItemProviderSpecificInput) AsBasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput() (BasicUpdateApplianceForReplicationProtectedItemProviderSpecificInput, bool) { + return &uafrpipsi, true +} + +// UpdateDiskInput disk input for update. +type UpdateDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // TargetDiskName - The target disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// UpdateMigrationItemInput update migration item input. +type UpdateMigrationItemInput struct { + // Properties - Update migration item input properties. + Properties *UpdateMigrationItemInputProperties `json:"properties,omitempty"` +} + +// UpdateMigrationItemInputProperties update migration item input properties. +type UpdateMigrationItemInputProperties struct { + // ProviderSpecificDetails - The provider specific input to update migration item. + ProviderSpecificDetails BasicUpdateMigrationItemProviderSpecificInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateMigrationItemInputProperties struct. +func (umiip *UpdateMigrationItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateMigrationItemProviderSpecificInput(*v) + if err != nil { + return err + } + umiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateMigrationItemProviderSpecificInput update migration item provider specific input. +type BasicUpdateMigrationItemProviderSpecificInput interface { + AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) + AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) +} + +// UpdateMigrationItemProviderSpecificInput update migration item provider specific input. +type UpdateMigrationItemProviderSpecificInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput', 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicUpdateMigrationItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateMigrationItemProviderSpecificInput(body []byte) (BasicUpdateMigrationItemProviderSpecificInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt): + var vmcumii VMwareCbtUpdateMigrationItemInput + err := json.Unmarshal(body, &vmcumii) + return vmcumii, err + default: + var umipsi UpdateMigrationItemProviderSpecificInput + err := json.Unmarshal(body, &umipsi) + return umipsi, err + } +} +func unmarshalBasicUpdateMigrationItemProviderSpecificInputArray(body []byte) ([]BasicUpdateMigrationItemProviderSpecificInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + umipsiArray := make([]BasicUpdateMigrationItemProviderSpecificInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + umipsi, err := unmarshalBasicUpdateMigrationItemProviderSpecificInput(*rawMessage) + if err != nil { + return nil, err + } + umipsiArray[index] = umipsi + } + return umipsiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) MarshalJSON() ([]byte, error) { + umipsi.InstanceType = InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput + objectMap := make(map[string]interface{}) + if umipsi.InstanceType != "" { + objectMap["instanceType"] = umipsi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtUpdateMigrationItemInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) { + return nil, false +} + +// AsUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) { + return &umipsi, true +} + +// AsBasicUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for UpdateMigrationItemProviderSpecificInput. +func (umipsi UpdateMigrationItemProviderSpecificInput) AsBasicUpdateMigrationItemProviderSpecificInput() (BasicUpdateMigrationItemProviderSpecificInput, bool) { + return &umipsi, true +} + +// UpdateMobilityServiceRequest request to update the mobility service on a protected item. +type UpdateMobilityServiceRequest struct { + // Properties - The properties of the update mobility service request. + Properties *UpdateMobilityServiceRequestProperties `json:"properties,omitempty"` +} + +// UpdateMobilityServiceRequestProperties the properties of an update mobility service request. +type UpdateMobilityServiceRequestProperties struct { + // RunAsAccountID - The CS run as account Id. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// UpdateNetworkMappingInput update network mapping input. +type UpdateNetworkMappingInput struct { + // Properties - The input properties needed to update network mapping. + Properties *UpdateNetworkMappingInputProperties `json:"properties,omitempty"` +} + +// UpdateNetworkMappingInputProperties common input details for network mapping operation. +type UpdateNetworkMappingInputProperties struct { + // RecoveryFabricName - Recovery fabric name. + RecoveryFabricName *string `json:"recoveryFabricName,omitempty"` + // RecoveryNetworkID - Recovery network Id. + RecoveryNetworkID *string `json:"recoveryNetworkId,omitempty"` + // FabricSpecificDetails - Fabrics specific input network Id. + FabricSpecificDetails BasicFabricSpecificUpdateNetworkMappingInput `json:"fabricSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateNetworkMappingInputProperties struct. +func (unmip *UpdateNetworkMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryFabricName": + if v != nil { + var recoveryFabricName string + err = json.Unmarshal(*v, &recoveryFabricName) + if err != nil { + return err + } + unmip.RecoveryFabricName = &recoveryFabricName + } + case "recoveryNetworkId": + if v != nil { + var recoveryNetworkID string + err = json.Unmarshal(*v, &recoveryNetworkID) + if err != nil { + return err + } + unmip.RecoveryNetworkID = &recoveryNetworkID + } + case "fabricSpecificDetails": + if v != nil { + fabricSpecificDetails, err := unmarshalBasicFabricSpecificUpdateNetworkMappingInput(*v) + if err != nil { + return err + } + unmip.FabricSpecificDetails = fabricSpecificDetails + } + } + } + + return nil +} + +// UpdatePolicyInput update policy input. +type UpdatePolicyInput struct { + // Properties - The ReplicationProviderSettings. + Properties *UpdatePolicyInputProperties `json:"properties,omitempty"` +} + +// UpdatePolicyInputProperties policy update properties. +type UpdatePolicyInputProperties struct { + // ReplicationProviderSettings - The ReplicationProviderSettings. + ReplicationProviderSettings BasicPolicyProviderSpecificInput `json:"replicationProviderSettings,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdatePolicyInputProperties struct. +func (upip *UpdatePolicyInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "replicationProviderSettings": + if v != nil { + replicationProviderSettings, err := unmarshalBasicPolicyProviderSpecificInput(*v) + if err != nil { + return err + } + upip.ReplicationProviderSettings = replicationProviderSettings + } + } + } + + return nil +} + +// UpdateProtectionContainerMappingInput container pairing update input. +type UpdateProtectionContainerMappingInput struct { + // Properties - Update protection container mapping input properties. + Properties *UpdateProtectionContainerMappingInputProperties `json:"properties,omitempty"` +} + +// UpdateProtectionContainerMappingInputProperties container pairing update input. +type UpdateProtectionContainerMappingInputProperties struct { + // ProviderSpecificInput - Provider specific input for updating protection container mapping. + ProviderSpecificInput BasicReplicationProviderSpecificUpdateContainerMappingInput `json:"providerSpecificInput,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateProtectionContainerMappingInputProperties struct. +func (upcmip *UpdateProtectionContainerMappingInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "providerSpecificInput": + if v != nil { + providerSpecificInput, err := unmarshalBasicReplicationProviderSpecificUpdateContainerMappingInput(*v) + if err != nil { + return err + } + upcmip.ProviderSpecificInput = providerSpecificInput + } + } + } + + return nil +} + +// UpdateRecoveryPlanInput update recovery plan input class. +type UpdateRecoveryPlanInput struct { + // Properties - Recovery plan update properties. + Properties *UpdateRecoveryPlanInputProperties `json:"properties,omitempty"` +} + +// UpdateRecoveryPlanInputProperties recovery plan update properties. +type UpdateRecoveryPlanInputProperties struct { + // Groups - The recovery plan groups. + Groups *[]RecoveryPlanGroup `json:"groups,omitempty"` +} + +// UpdateReplicationProtectedItemInput update replication protected item input. +type UpdateReplicationProtectedItemInput struct { + // Properties - Update replication protected item properties. + Properties *UpdateReplicationProtectedItemInputProperties `json:"properties,omitempty"` +} + +// UpdateReplicationProtectedItemInputProperties update protected item input properties. +type UpdateReplicationProtectedItemInputProperties struct { + // RecoveryAzureVMName - Target Azure VM name given by the user. + RecoveryAzureVMName *string `json:"recoveryAzureVMName,omitempty"` + // RecoveryAzureVMSize - Target Azure VM size. + RecoveryAzureVMSize *string `json:"recoveryAzureVMSize,omitempty"` + // SelectedRecoveryAzureNetworkID - Target Azure Network Id. + SelectedRecoveryAzureNetworkID *string `json:"selectedRecoveryAzureNetworkId,omitempty"` + // SelectedTfoAzureNetworkID - The Azure Network Id for test failover. + SelectedTfoAzureNetworkID *string `json:"selectedTfoAzureNetworkId,omitempty"` + // SelectedSourceNicID - The selected source nic Id which will be used as the primary nic during failover. + SelectedSourceNicID *string `json:"selectedSourceNicId,omitempty"` + // EnableRdpOnTargetOption - The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + EnableRdpOnTargetOption *string `json:"enableRdpOnTargetOption,omitempty"` + // VMNics - The list of VM nic details. + VMNics *[]VMNicInputDetails `json:"vmNics,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // RecoveryAvailabilitySetID - The target availability set Id. + RecoveryAvailabilitySetID *string `json:"recoveryAvailabilitySetId,omitempty"` + // ProviderSpecificDetails - The provider specific input to update replication protected item. + ProviderSpecificDetails BasicUpdateReplicationProtectedItemProviderInput `json:"providerSpecificDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateReplicationProtectedItemInputProperties struct. +func (urpiip *UpdateReplicationProtectedItemInputProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recoveryAzureVMName": + if v != nil { + var recoveryAzureVMName string + err = json.Unmarshal(*v, &recoveryAzureVMName) + if err != nil { + return err + } + urpiip.RecoveryAzureVMName = &recoveryAzureVMName + } + case "recoveryAzureVMSize": + if v != nil { + var recoveryAzureVMSize string + err = json.Unmarshal(*v, &recoveryAzureVMSize) + if err != nil { + return err + } + urpiip.RecoveryAzureVMSize = &recoveryAzureVMSize + } + case "selectedRecoveryAzureNetworkId": + if v != nil { + var selectedRecoveryAzureNetworkID string + err = json.Unmarshal(*v, &selectedRecoveryAzureNetworkID) + if err != nil { + return err + } + urpiip.SelectedRecoveryAzureNetworkID = &selectedRecoveryAzureNetworkID + } + case "selectedTfoAzureNetworkId": + if v != nil { + var selectedTfoAzureNetworkID string + err = json.Unmarshal(*v, &selectedTfoAzureNetworkID) + if err != nil { + return err + } + urpiip.SelectedTfoAzureNetworkID = &selectedTfoAzureNetworkID + } + case "selectedSourceNicId": + if v != nil { + var selectedSourceNicID string + err = json.Unmarshal(*v, &selectedSourceNicID) + if err != nil { + return err + } + urpiip.SelectedSourceNicID = &selectedSourceNicID + } + case "enableRdpOnTargetOption": + if v != nil { + var enableRdpOnTargetOption string + err = json.Unmarshal(*v, &enableRdpOnTargetOption) + if err != nil { + return err + } + urpiip.EnableRdpOnTargetOption = &enableRdpOnTargetOption + } + case "vmNics": + if v != nil { + var VMNics []VMNicInputDetails + err = json.Unmarshal(*v, &VMNics) + if err != nil { + return err + } + urpiip.VMNics = &VMNics + } + case "licenseType": + if v != nil { + var licenseType LicenseType + err = json.Unmarshal(*v, &licenseType) + if err != nil { + return err + } + urpiip.LicenseType = licenseType + } + case "recoveryAvailabilitySetId": + if v != nil { + var recoveryAvailabilitySetID string + err = json.Unmarshal(*v, &recoveryAvailabilitySetID) + if err != nil { + return err + } + urpiip.RecoveryAvailabilitySetID = &recoveryAvailabilitySetID + } + case "providerSpecificDetails": + if v != nil { + providerSpecificDetails, err := unmarshalBasicUpdateReplicationProtectedItemProviderInput(*v) + if err != nil { + return err + } + urpiip.ProviderSpecificDetails = providerSpecificDetails + } + } + } + + return nil +} + +// BasicUpdateReplicationProtectedItemProviderInput update replication protected item provider specific input. +type BasicUpdateReplicationProtectedItemProviderInput interface { + AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) + AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) + AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) + AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) + AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) +} + +// UpdateReplicationProtectedItemProviderInput update replication protected item provider specific input. +type UpdateReplicationProtectedItemProviderInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm' + InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` +} + +func unmarshalBasicUpdateReplicationProtectedItemProviderInput(body []byte) (BasicUpdateReplicationProtectedItemProviderInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A): + var aurpii A2AUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &aurpii) + return aurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure): + var hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &hvraurpii) + return hvraurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2): + var imavurpii InMageAzureV2UpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &imavurpii) + return imavurpii, err + case string(InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageRcm): + var imrurpii InMageRcmUpdateReplicationProtectedItemInput + err := json.Unmarshal(body, &imrurpii) + return imrurpii, err + default: + var urpipi UpdateReplicationProtectedItemProviderInput + err := json.Unmarshal(body, &urpipi) + return urpipi, err + } +} +func unmarshalBasicUpdateReplicationProtectedItemProviderInputArray(body []byte) ([]BasicUpdateReplicationProtectedItemProviderInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + urpipiArray := make([]BasicUpdateReplicationProtectedItemProviderInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + urpipi, err := unmarshalBasicUpdateReplicationProtectedItemProviderInput(*rawMessage) + if err != nil { + return nil, err + } + urpipiArray[index] = urpipi + } + return urpipiArray, nil +} + +// MarshalJSON is the custom marshaler for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) MarshalJSON() ([]byte, error) { + urpipi.InstanceType = InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput + objectMap := make(map[string]interface{}) + if urpipi.InstanceType != "" { + objectMap["instanceType"] = urpipi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsA2AUpdateReplicationProtectedItemInput() (*A2AUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzureUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsHyperVReplicaAzureUpdateReplicationProtectedItemInput() (*HyperVReplicaAzureUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageAzureV2UpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsInMageAzureV2UpdateReplicationProtectedItemInput() (*InMageAzureV2UpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsInMageRcmUpdateReplicationProtectedItemInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsInMageRcmUpdateReplicationProtectedItemInput() (*InMageRcmUpdateReplicationProtectedItemInput, bool) { + return nil, false +} + +// AsUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsUpdateReplicationProtectedItemProviderInput() (*UpdateReplicationProtectedItemProviderInput, bool) { + return &urpipi, true +} + +// AsBasicUpdateReplicationProtectedItemProviderInput is the BasicUpdateReplicationProtectedItemProviderInput implementation for UpdateReplicationProtectedItemProviderInput. +func (urpipi UpdateReplicationProtectedItemProviderInput) AsBasicUpdateReplicationProtectedItemProviderInput() (BasicUpdateReplicationProtectedItemProviderInput, bool) { + return &urpipi, true +} + +// UpdateVCenterRequest input required to update vCenter. +type UpdateVCenterRequest struct { + // Properties - The update VCenter Request Properties. + Properties *UpdateVCenterRequestProperties `json:"properties,omitempty"` +} + +// UpdateVCenterRequestProperties the properties of an update vCenter request. +type UpdateVCenterRequestProperties struct { + // FriendlyName - The friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddress - The IP address of the vCenter to be discovered. + IPAddress *string `json:"ipAddress,omitempty"` + // ProcessServerID - The process server Id from where the update can be orchestrated. + ProcessServerID *string `json:"processServerId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The CS account Id which has privileges to update the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` +} + +// VaultHealthDetails vault health details definition. +type VaultHealthDetails struct { + autorest.Response `json:"-"` + // Properties - The vault health related data. + Properties *VaultHealthProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VaultHealthDetails. +func (vhd VaultHealthDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vhd.Properties != nil { + objectMap["properties"] = vhd.Properties + } + if vhd.Location != nil { + objectMap["location"] = vhd.Location + } + return json.Marshal(objectMap) +} + +// VaultHealthProperties class to define the health summary of the Vault. +type VaultHealthProperties struct { + // VaultErrors - The list of errors on the vault. + VaultErrors *[]HealthError `json:"vaultErrors,omitempty"` + // ProtectedItemsHealth - The list of the health detail of the protected items in the vault. + ProtectedItemsHealth *ResourceHealthSummary `json:"protectedItemsHealth,omitempty"` + // FabricsHealth - The list of the health detail of the fabrics in the vault. + FabricsHealth *ResourceHealthSummary `json:"fabricsHealth,omitempty"` + // ContainersHealth - The list of the health detail of the containers in the vault. + ContainersHealth *ResourceHealthSummary `json:"containersHealth,omitempty"` +} + +// VaultSetting vault setting. +type VaultSetting struct { + autorest.Response `json:"-"` + // Properties - The vault setting properties. + Properties *VaultSettingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VaultSetting. +func (vs VaultSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vs.Properties != nil { + objectMap["properties"] = vs.Properties + } + if vs.Location != nil { + objectMap["location"] = vs.Location + } + return json.Marshal(objectMap) +} + +// VaultSettingCollection vault setting collection. +type VaultSettingCollection struct { + autorest.Response `json:"-"` + // Value - The list of vault setting. + Value *[]VaultSetting `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// VaultSettingCollectionIterator provides access to a complete listing of VaultSetting values. +type VaultSettingCollectionIterator struct { + i int + page VaultSettingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VaultSettingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VaultSettingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VaultSettingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VaultSettingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VaultSettingCollectionIterator) Response() VaultSettingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VaultSettingCollectionIterator) Value() VaultSetting { + if !iter.page.NotDone() { + return VaultSetting{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VaultSettingCollectionIterator type. +func NewVaultSettingCollectionIterator(page VaultSettingCollectionPage) VaultSettingCollectionIterator { + return VaultSettingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vsc VaultSettingCollection) IsEmpty() bool { + return vsc.Value == nil || len(*vsc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vsc VaultSettingCollection) hasNextLink() bool { + return vsc.NextLink != nil && len(*vsc.NextLink) != 0 +} + +// vaultSettingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vsc VaultSettingCollection) vaultSettingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !vsc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vsc.NextLink))) +} + +// VaultSettingCollectionPage contains a page of VaultSetting values. +type VaultSettingCollectionPage struct { + fn func(context.Context, VaultSettingCollection) (VaultSettingCollection, error) + vsc VaultSettingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VaultSettingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VaultSettingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vsc) + if err != nil { + return err + } + page.vsc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VaultSettingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VaultSettingCollectionPage) NotDone() bool { + return !page.vsc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VaultSettingCollectionPage) Response() VaultSettingCollection { + return page.vsc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VaultSettingCollectionPage) Values() []VaultSetting { + if page.vsc.IsEmpty() { + return nil + } + return *page.vsc.Value +} + +// Creates a new instance of the VaultSettingCollectionPage type. +func NewVaultSettingCollectionPage(cur VaultSettingCollection, getNextPage func(context.Context, VaultSettingCollection) (VaultSettingCollection, error)) VaultSettingCollectionPage { + return VaultSettingCollectionPage{ + fn: getNextPage, + vsc: cur, + } +} + +// VaultSettingCreationInput input to create vault setting. +type VaultSettingCreationInput struct { + // Properties - Vault setting creation input properties. + Properties *VaultSettingCreationInputProperties `json:"properties,omitempty"` +} + +// VaultSettingCreationInputProperties input to create vault setting. +type VaultSettingCreationInputProperties struct { + // MigrationSolutionID - The migration solution Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // VmwareToAzureProviderType - VMware to Azure provider type. + VmwareToAzureProviderType *string `json:"vmwareToAzureProviderType,omitempty"` +} + +// VaultSettingProperties vault setting properties. +type VaultSettingProperties struct { + // MigrationSolutionID - The migration solution ARM Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // VmwareToAzureProviderType - VMware to Azure provider type. + VmwareToAzureProviderType *string `json:"vmwareToAzureProviderType,omitempty"` +} + +// VCenter vCenter definition. +type VCenter struct { + autorest.Response `json:"-"` + // Properties - VCenter related data. + Properties *VCenterProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type + Type *string `json:"type,omitempty"` + // Location - Resource Location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for VCenter. +func (vc VCenter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vc.Properties != nil { + objectMap["properties"] = vc.Properties + } + if vc.Location != nil { + objectMap["location"] = vc.Location + } + return json.Marshal(objectMap) +} + +// VCenterCollection collection of vCenter details. +type VCenterCollection struct { + autorest.Response `json:"-"` + // Value - The vCenter details. + Value *[]VCenter `json:"value,omitempty"` + // NextLink - The value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// VCenterCollectionIterator provides access to a complete listing of VCenter values. +type VCenterCollectionIterator struct { + i int + page VCenterCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VCenterCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VCenterCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VCenterCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VCenterCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VCenterCollectionIterator) Response() VCenterCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VCenterCollectionIterator) Value() VCenter { + if !iter.page.NotDone() { + return VCenter{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VCenterCollectionIterator type. +func NewVCenterCollectionIterator(page VCenterCollectionPage) VCenterCollectionIterator { + return VCenterCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vcc VCenterCollection) IsEmpty() bool { + return vcc.Value == nil || len(*vcc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vcc VCenterCollection) hasNextLink() bool { + return vcc.NextLink != nil && len(*vcc.NextLink) != 0 +} + +// vCenterCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vcc VCenterCollection) vCenterCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !vcc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vcc.NextLink))) +} + +// VCenterCollectionPage contains a page of VCenter values. +type VCenterCollectionPage struct { + fn func(context.Context, VCenterCollection) (VCenterCollection, error) + vcc VCenterCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VCenterCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VCenterCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vcc) + if err != nil { + return err + } + page.vcc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VCenterCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VCenterCollectionPage) NotDone() bool { + return !page.vcc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VCenterCollectionPage) Response() VCenterCollection { + return page.vcc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VCenterCollectionPage) Values() []VCenter { + if page.vcc.IsEmpty() { + return nil + } + return *page.vcc.Value +} + +// Creates a new instance of the VCenterCollectionPage type. +func NewVCenterCollectionPage(cur VCenterCollection, getNextPage func(context.Context, VCenterCollection) (VCenterCollection, error)) VCenterCollectionPage { + return VCenterCollectionPage{ + fn: getNextPage, + vcc: cur, + } +} + +// VCenterProperties vCenter properties. +type VCenterProperties struct { + // FriendlyName - Friendly name of the vCenter. + FriendlyName *string `json:"friendlyName,omitempty"` + // InternalID - VCenter internal ID. + InternalID *string `json:"internalId,omitempty"` + // LastHeartbeat - The time when the last heartbeat was received by vCenter. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // DiscoveryStatus - The VCenter discovery status. + DiscoveryStatus *string `json:"discoveryStatus,omitempty"` + // ProcessServerID - The process server Id. + ProcessServerID *string `json:"processServerId,omitempty"` + // IPAddress - The IP address of the vCenter. + IPAddress *string `json:"ipAddress,omitempty"` + // InfrastructureID - The infrastructure Id of vCenter. + InfrastructureID *string `json:"infrastructureId,omitempty"` + // Port - The port number for discovery. + Port *string `json:"port,omitempty"` + // RunAsAccountID - The account Id which has privileges to discover the vCenter. + RunAsAccountID *string `json:"runAsAccountId,omitempty"` + // FabricArmResourceName - The ARM resource name of the fabric containing this VCenter. + FabricArmResourceName *string `json:"fabricArmResourceName,omitempty"` + // HealthErrors - The health errors for this VCenter. + HealthErrors *[]HealthError `json:"healthErrors,omitempty"` +} + +// VersionDetails version related details. +type VersionDetails struct { + // Version - The agent version. + Version *string `json:"version,omitempty"` + // ExpiryDate - Version expiry date. + ExpiryDate *date.Time `json:"expiryDate,omitempty"` + // Status - A value indicating whether security update required. Possible values include: 'Supported', 'NotSupported', 'Deprecated', 'UpdateRequired', 'SecurityUpdateRequired' + Status AgentVersionStatus `json:"status,omitempty"` +} + +// VirtualMachineTaskDetails this class represents the virtual machine task details. +type VirtualMachineTaskDetails struct { + // SkippedReason - The skipped reason. + SkippedReason *string `json:"skippedReason,omitempty"` + // SkippedReasonString - The skipped reason string. + SkippedReasonString *string `json:"skippedReasonString,omitempty"` + // JobTask - The job entity. + JobTask *JobEntity `json:"jobTask,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) MarshalJSON() ([]byte, error) { + vmtd.InstanceType = InstanceTypeVirtualMachineTaskDetails + objectMap := make(map[string]interface{}) + if vmtd.SkippedReason != nil { + objectMap["skippedReason"] = vmtd.SkippedReason + } + if vmtd.SkippedReasonString != nil { + objectMap["skippedReasonString"] = vmtd.SkippedReasonString + } + if vmtd.JobTask != nil { + objectMap["jobTask"] = vmtd.JobTask + } + if vmtd.InstanceType != "" { + objectMap["instanceType"] = vmtd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return &vmtd, true +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return &vmtd, true +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return nil, false +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for VirtualMachineTaskDetails. +func (vmtd VirtualMachineTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &vmtd, true +} + +// VmmDetails VMM fabric specific details. +type VmmDetails struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmDetails. +func (vd VmmDetails) MarshalJSON() ([]byte, error) { + vd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM + objectMap := make(map[string]interface{}) + if vd.InstanceType != "" { + objectMap["instanceType"] = vd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVmmDetails() (*VmmDetails, bool) { + return &vd, true +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VmmDetails. +func (vd VmmDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vd, true +} + +// VmmToAzureCreateNetworkMappingInput create network mappings input properties/behavior specific to Vmm to +// Azure Network mapping. +type VmmToAzureCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtacnmi.InstanceType = InstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtacnmi.InstanceType != "" { + objectMap["instanceType"] = vtacnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return &vtacnmi, true +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToAzureCreateNetworkMappingInput. +func (vtacnmi VmmToAzureCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &vtacnmi, true +} + +// VmmToAzureNetworkMappingSettings e2A Network Mapping fabric specific settings. +type VmmToAzureNetworkMappingSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) MarshalJSON() ([]byte, error) { + vtanms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtanms.InstanceType != "" { + objectMap["instanceType"] = vtanms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return &vtanms, true +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return nil, false +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToAzureNetworkMappingSettings. +func (vtanms VmmToAzureNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &vtanms, true +} + +// VmmToAzureUpdateNetworkMappingInput update network mappings input properties/behavior specific to vmm to +// azure. +type VmmToAzureUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtaunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure + objectMap := make(map[string]interface{}) + if vtaunmi.InstanceType != "" { + objectMap["instanceType"] = vtaunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return &vtaunmi, true +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToAzureUpdateNetworkMappingInput. +func (vtaunmi VmmToAzureUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &vtaunmi, true +} + +// VmmToVmmCreateNetworkMappingInput create network mappings input properties/behavior specific to vmm to +// vmm Network mapping. +type VmmToVmmCreateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeFabricSpecificCreateNetworkMappingInput', 'InstanceTypeAzureToAzure', 'InstanceTypeVmmToAzure', 'InstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificCreateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtvcnmi.InstanceType = InstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvcnmi.InstanceType != "" { + objectMap["instanceType"] = vtvcnmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsAzureToAzureCreateNetworkMappingInput() (*AzureToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsVmmToAzureCreateNetworkMappingInput() (*VmmToAzureCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsVmmToVmmCreateNetworkMappingInput() (*VmmToVmmCreateNetworkMappingInput, bool) { + return &vtvcnmi, true +} + +// AsFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsFabricSpecificCreateNetworkMappingInput() (*FabricSpecificCreateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreateNetworkMappingInput is the BasicFabricSpecificCreateNetworkMappingInput implementation for VmmToVmmCreateNetworkMappingInput. +func (vtvcnmi VmmToVmmCreateNetworkMappingInput) AsBasicFabricSpecificCreateNetworkMappingInput() (BasicFabricSpecificCreateNetworkMappingInput, bool) { + return &vtvcnmi, true +} + +// VmmToVmmNetworkMappingSettings e2E Network Mapping fabric specific settings. +type VmmToVmmNetworkMappingSettings struct { + // InstanceType - Possible values include: 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeNetworkMappingFabricSpecificSettings', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeAzureToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToAzure', 'InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicNetworkMappingFabricSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) MarshalJSON() ([]byte, error) { + vtvnms.InstanceType = InstanceTypeBasicNetworkMappingFabricSpecificSettingsInstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvnms.InstanceType != "" { + objectMap["instanceType"] = vtvnms.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsAzureToAzureNetworkMappingSettings() (*AzureToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToAzureNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsVmmToAzureNetworkMappingSettings() (*VmmToAzureNetworkMappingSettings, bool) { + return nil, false +} + +// AsVmmToVmmNetworkMappingSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsVmmToVmmNetworkMappingSettings() (*VmmToVmmNetworkMappingSettings, bool) { + return &vtvnms, true +} + +// AsNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsNetworkMappingFabricSpecificSettings() (*NetworkMappingFabricSpecificSettings, bool) { + return nil, false +} + +// AsBasicNetworkMappingFabricSpecificSettings is the BasicNetworkMappingFabricSpecificSettings implementation for VmmToVmmNetworkMappingSettings. +func (vtvnms VmmToVmmNetworkMappingSettings) AsBasicNetworkMappingFabricSpecificSettings() (BasicNetworkMappingFabricSpecificSettings, bool) { + return &vtvnms, true +} + +// VmmToVmmUpdateNetworkMappingInput update network mappings input properties/behavior specific to vmm to +// vmm. +type VmmToVmmUpdateNetworkMappingInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeFabricSpecificUpdateNetworkMappingInput', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeAzureToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToAzure', 'InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm' + InstanceType InstanceTypeBasicFabricSpecificUpdateNetworkMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) MarshalJSON() ([]byte, error) { + vtvunmi.InstanceType = InstanceTypeBasicFabricSpecificUpdateNetworkMappingInputInstanceTypeVmmToVmm + objectMap := make(map[string]interface{}) + if vtvunmi.InstanceType != "" { + objectMap["instanceType"] = vtvunmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsAzureToAzureUpdateNetworkMappingInput() (*AzureToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToAzureUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsVmmToAzureUpdateNetworkMappingInput() (*VmmToAzureUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsVmmToVmmUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsVmmToVmmUpdateNetworkMappingInput() (*VmmToVmmUpdateNetworkMappingInput, bool) { + return &vtvunmi, true +} + +// AsFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsFabricSpecificUpdateNetworkMappingInput() (*FabricSpecificUpdateNetworkMappingInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificUpdateNetworkMappingInput is the BasicFabricSpecificUpdateNetworkMappingInput implementation for VmmToVmmUpdateNetworkMappingInput. +func (vtvunmi VmmToVmmUpdateNetworkMappingInput) AsBasicFabricSpecificUpdateNetworkMappingInput() (BasicFabricSpecificUpdateNetworkMappingInput, bool) { + return &vtvunmi, true +} + +// VmmVirtualMachineDetails VMM fabric provider specific VM settings. +type VmmVirtualMachineDetails struct { + // SourceItemID - The source id of the object. + SourceItemID *string `json:"sourceItemId,omitempty"` + // Generation - The id of the object in fabric. + Generation *string `json:"generation,omitempty"` + // OsDetails - The Last replication time. + OsDetails *OSDetails `json:"osDetails,omitempty"` + // DiskDetails - The Last successful failover time. + DiskDetails *[]DiskDetails `json:"diskDetails,omitempty"` + // HasPhysicalDisk - A value indicating whether the VM has a physical disk attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasPhysicalDisk PresenceStatus `json:"hasPhysicalDisk,omitempty"` + // HasFibreChannelAdapter - A value indicating whether the VM has a fibre channel adapter attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasFibreChannelAdapter PresenceStatus `json:"hasFibreChannelAdapter,omitempty"` + // HasSharedVhd - A value indicating whether the VM has a shared VHD attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: 'PresenceStatusUnknown', 'PresenceStatusPresent', 'PresenceStatusNotPresent' + HasSharedVhd PresenceStatus `json:"hasSharedVhd,omitempty"` + // HyperVHostID - The Id of the hyper-v host in fabric. + HyperVHostID *string `json:"hyperVHostId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) MarshalJSON() ([]byte, error) { + vvmd.InstanceType = InstanceTypeVmmVirtualMachine + objectMap := make(map[string]interface{}) + if vvmd.SourceItemID != nil { + objectMap["sourceItemId"] = vvmd.SourceItemID + } + if vvmd.Generation != nil { + objectMap["generation"] = vvmd.Generation + } + if vvmd.OsDetails != nil { + objectMap["osDetails"] = vvmd.OsDetails + } + if vvmd.DiskDetails != nil { + objectMap["diskDetails"] = vvmd.DiskDetails + } + if vvmd.HasPhysicalDisk != "" { + objectMap["hasPhysicalDisk"] = vvmd.HasPhysicalDisk + } + if vvmd.HasFibreChannelAdapter != "" { + objectMap["hasFibreChannelAdapter"] = vvmd.HasFibreChannelAdapter + } + if vvmd.HasSharedVhd != "" { + objectMap["hasSharedVhd"] = vvmd.HasSharedVhd + } + if vvmd.HyperVHostID != nil { + objectMap["hyperVHostId"] = vvmd.HyperVHostID + } + if vvmd.InstanceType != "" { + objectMap["instanceType"] = vvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return &vvmd, true +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return &vvmd, true +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return nil, false +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for VmmVirtualMachineDetails. +func (vvmd VmmVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &vvmd, true +} + +// VMNicDetails hyper V VM network details. +type VMNicDetails struct { + // NicID - The nic Id. + NicID *string `json:"nicId,omitempty"` + // ReplicaNicID - The replica nic Id. + ReplicaNicID *string `json:"replicaNicId,omitempty"` + // SourceNicArmID - The source nic ARM Id. + SourceNicArmID *string `json:"sourceNicArmId,omitempty"` + // VMNetworkName - VM network name. + VMNetworkName *string `json:"vMNetworkName,omitempty"` + // RecoveryVMNetworkID - Recovery VM network Id. + RecoveryVMNetworkID *string `json:"recoveryVMNetworkId,omitempty"` + // IPConfigs - The IP configurations of the NIC. + IPConfigs *[]IPConfigDetails `json:"ipConfigs,omitempty"` + // SelectionType - Selection type for failover. + SelectionType *string `json:"selectionType,omitempty"` + // RecoveryNetworkSecurityGroupID - The id of the NSG associated with the NIC. + RecoveryNetworkSecurityGroupID *string `json:"recoveryNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnRecovery - A value indicating whether the NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnRecovery *bool `json:"enableAcceleratedNetworkingOnRecovery,omitempty"` + // TfoVMNetworkID - The network to be used by NIC during test failover. + TfoVMNetworkID *string `json:"tfoVMNetworkId,omitempty"` + // TfoNetworkSecurityGroupID - The NSG to be used by NIC during test failover. + TfoNetworkSecurityGroupID *string `json:"tfoNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnTfo - Whether the TFO NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnTfo *bool `json:"enableAcceleratedNetworkingOnTfo,omitempty"` + // RecoveryNicName - The name of the NIC to be used when creating target NICs. + RecoveryNicName *string `json:"recoveryNicName,omitempty"` + // RecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs. + RecoveryNicResourceGroupName *string `json:"recoveryNicResourceGroupName,omitempty"` + // ReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during failover subject to availability. + ReuseExistingNic *bool `json:"reuseExistingNic,omitempty"` + // TfoRecoveryNicName - The name of the NIC to be used when creating target NICs in TFO. + TfoRecoveryNicName *string `json:"tfoRecoveryNicName,omitempty"` + // TfoRecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs in TFO. + TfoRecoveryNicResourceGroupName *string `json:"tfoRecoveryNicResourceGroupName,omitempty"` + // TfoReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during test failover subject to availability. + TfoReuseExistingNic *bool `json:"tfoReuseExistingNic,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` +} + +// VMNicInputDetails hyper V VM network input details. +type VMNicInputDetails struct { + // NicID - The nic Id. + NicID *string `json:"nicId,omitempty"` + // IPConfigs - The IP configurations to be used by NIC during test failover and failover. + IPConfigs *[]IPConfigInputDetails `json:"ipConfigs,omitempty"` + // SelectionType - Selection type for failover. + SelectionType *string `json:"selectionType,omitempty"` + // RecoveryNetworkSecurityGroupID - The id of the NSG associated with the NIC. + RecoveryNetworkSecurityGroupID *string `json:"recoveryNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnRecovery - Whether the NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnRecovery *bool `json:"enableAcceleratedNetworkingOnRecovery,omitempty"` + // TfoNetworkSecurityGroupID - The NSG to be used by NIC during test failover. + TfoNetworkSecurityGroupID *string `json:"tfoNetworkSecurityGroupId,omitempty"` + // EnableAcceleratedNetworkingOnTfo - Whether the test NIC has accelerated networking enabled. + EnableAcceleratedNetworkingOnTfo *bool `json:"enableAcceleratedNetworkingOnTfo,omitempty"` + // RecoveryNicName - The name of the NIC to be used when creating target NICs. + RecoveryNicName *string `json:"recoveryNicName,omitempty"` + // RecoveryNicResourceGroupName - The resource group of the NIC to be used when creating target NICs. + RecoveryNicResourceGroupName *string `json:"recoveryNicResourceGroupName,omitempty"` + // ReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during failover subject to availability. + ReuseExistingNic *bool `json:"reuseExistingNic,omitempty"` + // TfoNicName - The name of the NIC to be used when creating target NICs in TFO. + TfoNicName *string `json:"tfoNicName,omitempty"` + // TfoNicResourceGroupName - The resource group of the NIC to be used when creating target NICs in TFO. + TfoNicResourceGroupName *string `json:"tfoNicResourceGroupName,omitempty"` + // TfoReuseExistingNic - A value indicating whether an existing NIC is allowed to be reused during test failover subject to availability. + TfoReuseExistingNic *bool `json:"tfoReuseExistingNic,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` +} + +// VMNicUpdatesTaskDetails this class represents the vm NicUpdates task details. +type VMNicUpdatesTaskDetails struct { + // VMID - Virtual machine Id. + VMID *string `json:"vmId,omitempty"` + // NicID - Nic Id. + NicID *string `json:"nicId,omitempty"` + // Name - Name of the Nic. + Name *string `json:"name,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeTaskTypeDetails', 'InstanceTypeAutomationRunbookTaskDetails', 'InstanceTypeConsistencyCheckTaskDetails', 'InstanceTypeFabricReplicationGroupTaskDetails', 'InstanceTypeJobTaskDetails', 'InstanceTypeManualActionTaskDetails', 'InstanceTypeScriptActionTaskDetails', 'InstanceTypeVirtualMachineTaskDetails', 'InstanceTypeVMNicUpdatesTaskDetails' + InstanceType InstanceTypeBasicTaskTypeDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) MarshalJSON() ([]byte, error) { + vnutd.InstanceType = InstanceTypeVMNicUpdatesTaskDetails + objectMap := make(map[string]interface{}) + if vnutd.VMID != nil { + objectMap["vmId"] = vnutd.VMID + } + if vnutd.NicID != nil { + objectMap["nicId"] = vnutd.NicID + } + if vnutd.Name != nil { + objectMap["name"] = vnutd.Name + } + if vnutd.InstanceType != "" { + objectMap["instanceType"] = vnutd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAutomationRunbookTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsAutomationRunbookTaskDetails() (*AutomationRunbookTaskDetails, bool) { + return nil, false +} + +// AsConsistencyCheckTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsConsistencyCheckTaskDetails() (*ConsistencyCheckTaskDetails, bool) { + return nil, false +} + +// AsFabricReplicationGroupTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsFabricReplicationGroupTaskDetails() (*FabricReplicationGroupTaskDetails, bool) { + return nil, false +} + +// AsJobTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsJobTaskDetails() (*JobTaskDetails, bool) { + return nil, false +} + +// AsBasicJobTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsBasicJobTaskDetails() (BasicJobTaskDetails, bool) { + return nil, false +} + +// AsManualActionTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsManualActionTaskDetails() (*ManualActionTaskDetails, bool) { + return nil, false +} + +// AsScriptActionTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsScriptActionTaskDetails() (*ScriptActionTaskDetails, bool) { + return nil, false +} + +// AsVirtualMachineTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsVirtualMachineTaskDetails() (*VirtualMachineTaskDetails, bool) { + return nil, false +} + +// AsVMNicUpdatesTaskDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsVMNicUpdatesTaskDetails() (*VMNicUpdatesTaskDetails, bool) { + return &vnutd, true +} + +// AsTaskTypeDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsTaskTypeDetails() (*TaskTypeDetails, bool) { + return nil, false +} + +// AsBasicTaskTypeDetails is the BasicTaskTypeDetails implementation for VMNicUpdatesTaskDetails. +func (vnutd VMNicUpdatesTaskDetails) AsBasicTaskTypeDetails() (BasicTaskTypeDetails, bool) { + return &vnutd, true +} + +// VMwareCbtContainerCreationInput vMwareCbt container creation input. +type VMwareCbtContainerCreationInput struct { + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeReplicationProviderSpecificContainerCreationInput', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) MarshalJSON() ([]byte, error) { + vmccci.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerCreationInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmccci.InstanceType != "" { + objectMap["instanceType"] = vmccci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsA2AContainerCreationInput() (*A2AContainerCreationInput, bool) { + return nil, false +} + +// AsA2ACrossClusterMigrationContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsA2ACrossClusterMigrationContainerCreationInput() (*A2ACrossClusterMigrationContainerCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsVMwareCbtContainerCreationInput() (*VMwareCbtContainerCreationInput, bool) { + return &vmccci, true +} + +// AsReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsReplicationProviderSpecificContainerCreationInput() (*ReplicationProviderSpecificContainerCreationInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerCreationInput is the BasicReplicationProviderSpecificContainerCreationInput implementation for VMwareCbtContainerCreationInput. +func (vmccci VMwareCbtContainerCreationInput) AsBasicReplicationProviderSpecificContainerCreationInput() (BasicReplicationProviderSpecificContainerCreationInput, bool) { + return &vmccci, true +} + +// VMwareCbtContainerMappingInput vMwareCbt container mapping input. +type VMwareCbtContainerMappingInput struct { + // KeyVaultID - The target key vault ARM Id. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyVaultURI - The target key vault URL. + KeyVaultURI *string `json:"keyVaultUri,omitempty"` + // StorageAccountID - The storage account ARM Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // StorageAccountSasSecretName - The secret name of the storage account. + StorageAccountSasSecretName *string `json:"storageAccountSasSecretName,omitempty"` + // ServiceBusConnectionStringSecretName - The secret name of the service bus connection string. + ServiceBusConnectionStringSecretName *string `json:"serviceBusConnectionStringSecretName,omitempty"` + // TargetLocation - The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeReplicationProviderSpecificContainerMappingInput', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A', 'InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicReplicationProviderSpecificContainerMappingInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) MarshalJSON() ([]byte, error) { + vmccmi.InstanceType = InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmccmi.KeyVaultID != nil { + objectMap["keyVaultId"] = vmccmi.KeyVaultID + } + if vmccmi.KeyVaultURI != nil { + objectMap["keyVaultUri"] = vmccmi.KeyVaultURI + } + if vmccmi.StorageAccountID != nil { + objectMap["storageAccountId"] = vmccmi.StorageAccountID + } + if vmccmi.StorageAccountSasSecretName != nil { + objectMap["storageAccountSasSecretName"] = vmccmi.StorageAccountSasSecretName + } + if vmccmi.ServiceBusConnectionStringSecretName != nil { + objectMap["serviceBusConnectionStringSecretName"] = vmccmi.ServiceBusConnectionStringSecretName + } + if vmccmi.TargetLocation != nil { + objectMap["targetLocation"] = vmccmi.TargetLocation + } + if vmccmi.InstanceType != "" { + objectMap["instanceType"] = vmccmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsA2AContainerMappingInput() (*A2AContainerMappingInput, bool) { + return nil, false +} + +// AsVMwareCbtContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsVMwareCbtContainerMappingInput() (*VMwareCbtContainerMappingInput, bool) { + return &vmccmi, true +} + +// AsReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsReplicationProviderSpecificContainerMappingInput() (*ReplicationProviderSpecificContainerMappingInput, bool) { + return nil, false +} + +// AsBasicReplicationProviderSpecificContainerMappingInput is the BasicReplicationProviderSpecificContainerMappingInput implementation for VMwareCbtContainerMappingInput. +func (vmccmi VMwareCbtContainerMappingInput) AsBasicReplicationProviderSpecificContainerMappingInput() (BasicReplicationProviderSpecificContainerMappingInput, bool) { + return &vmccmi, true +} + +// VMwareCbtDiskInput vMwareCbt disk input. +type VMwareCbtDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // IsOSDisk - A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // LogStorageAccountID - The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // LogStorageAccountSasSecretName - The key vault secret name of the log storage account. + LogStorageAccountSasSecretName *string `json:"logStorageAccountSasSecretName,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// VMwareCbtEnableMigrationInput vMwareCbt specific enable migration input. +type VMwareCbtEnableMigrationInput struct { + // VmwareMachineID - The ARM Id of the VM discovered in VMware. + VmwareMachineID *string `json:"vmwareMachineId,omitempty"` + // DisksToInclude - The disks to include list. + DisksToInclude *[]VMwareCbtDiskInput `json:"disksToInclude,omitempty"` + // LicenseType - License type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // DataMoverRunAsAccountID - The data mover run as account Id. + DataMoverRunAsAccountID *string `json:"dataMoverRunAsAccountId,omitempty"` + // SnapshotRunAsAccountID - The snapshot run as account Id. + SnapshotRunAsAccountID *string `json:"snapshotRunAsAccountId,omitempty"` + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The selected test network ARM Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // TargetSubnetName - The target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TestSubnetName - The selected test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // SeedDiskTags - The tags for the seed disks. + SeedDiskTags map[string]*string `json:"seedDiskTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeEnableMigrationProviderSpecificInput', 'InstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEnableMigrationProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) MarshalJSON() ([]byte, error) { + vmcemi.InstanceType = InstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcemi.VmwareMachineID != nil { + objectMap["vmwareMachineId"] = vmcemi.VmwareMachineID + } + if vmcemi.DisksToInclude != nil { + objectMap["disksToInclude"] = vmcemi.DisksToInclude + } + if vmcemi.LicenseType != "" { + objectMap["licenseType"] = vmcemi.LicenseType + } + if vmcemi.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = vmcemi.SQLServerLicenseType + } + if vmcemi.DataMoverRunAsAccountID != nil { + objectMap["dataMoverRunAsAccountId"] = vmcemi.DataMoverRunAsAccountID + } + if vmcemi.SnapshotRunAsAccountID != nil { + objectMap["snapshotRunAsAccountId"] = vmcemi.SnapshotRunAsAccountID + } + if vmcemi.TargetVMName != nil { + objectMap["targetVmName"] = vmcemi.TargetVMName + } + if vmcemi.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcemi.TargetVMSize + } + if vmcemi.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcemi.TargetResourceGroupID + } + if vmcemi.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcemi.TargetNetworkID + } + if vmcemi.TestNetworkID != nil { + objectMap["testNetworkId"] = vmcemi.TestNetworkID + } + if vmcemi.TargetSubnetName != nil { + objectMap["targetSubnetName"] = vmcemi.TargetSubnetName + } + if vmcemi.TestSubnetName != nil { + objectMap["testSubnetName"] = vmcemi.TestSubnetName + } + if vmcemi.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcemi.TargetAvailabilitySetID + } + if vmcemi.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcemi.TargetAvailabilityZone + } + if vmcemi.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcemi.TargetProximityPlacementGroupID + } + if vmcemi.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcemi.TargetBootDiagnosticsStorageAccountID + } + if vmcemi.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcemi.PerformAutoResync + } + if vmcemi.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcemi.TargetVMTags + } + if vmcemi.SeedDiskTags != nil { + objectMap["seedDiskTags"] = vmcemi.SeedDiskTags + } + if vmcemi.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcemi.TargetDiskTags + } + if vmcemi.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcemi.TargetNicTags + } + if vmcemi.InstanceType != "" { + objectMap["instanceType"] = vmcemi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtEnableMigrationInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsVMwareCbtEnableMigrationInput() (*VMwareCbtEnableMigrationInput, bool) { + return &vmcemi, true +} + +// AsEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsEnableMigrationProviderSpecificInput() (*EnableMigrationProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicEnableMigrationProviderSpecificInput is the BasicEnableMigrationProviderSpecificInput implementation for VMwareCbtEnableMigrationInput. +func (vmcemi VMwareCbtEnableMigrationInput) AsBasicEnableMigrationProviderSpecificInput() (BasicEnableMigrationProviderSpecificInput, bool) { + return &vmcemi, true +} + +// VMwareCbtEventDetails event details for VMwareCbt provider. +type VMwareCbtEventDetails struct { + // MigrationItemName - READ-ONLY; The migration item name. + MigrationItemName *string `json:"migrationItemName,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeEventProviderSpecificDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeHyperVReplicaBaseEventDetails', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicEventProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) MarshalJSON() ([]byte, error) { + vmced.InstanceType = InstanceTypeBasicEventProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmced.InstanceType != "" { + objectMap["instanceType"] = vmced.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsA2AEventDetails() (*A2AEventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplica2012EventDetails() (*HyperVReplica2012EventDetails, bool) { + return nil, false +} + +// AsHyperVReplica2012R2EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplica2012R2EventDetails() (*HyperVReplica2012R2EventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzureEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplicaAzureEventDetails() (*HyperVReplicaAzureEventDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBaseEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsHyperVReplicaBaseEventDetails() (*HyperVReplicaBaseEventDetails, bool) { + return nil, false +} + +// AsInMageAzureV2EventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageAzureV2EventDetails() (*InMageAzureV2EventDetails, bool) { + return nil, false +} + +// AsInMageRcmEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageRcmEventDetails() (*InMageRcmEventDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsInMageRcmFailbackEventDetails() (*InMageRcmFailbackEventDetails, bool) { + return nil, false +} + +// AsVMwareCbtEventDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsVMwareCbtEventDetails() (*VMwareCbtEventDetails, bool) { + return &vmced, true +} + +// AsEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsEventProviderSpecificDetails() (*EventProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicEventProviderSpecificDetails is the BasicEventProviderSpecificDetails implementation for VMwareCbtEventDetails. +func (vmced VMwareCbtEventDetails) AsBasicEventProviderSpecificDetails() (BasicEventProviderSpecificDetails, bool) { + return &vmced, true +} + +// VMwareCbtMigrateInput vMwareCbt specific migrate input. +type VMwareCbtMigrateInput struct { + // PerformShutdown - A value indicating whether VM is to be shutdown. + PerformShutdown *string `json:"performShutdown,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeMigrateProviderSpecificInput', 'InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) MarshalJSON() ([]byte, error) { + vmcmi.InstanceType = InstanceTypeBasicMigrateProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcmi.PerformShutdown != nil { + objectMap["performShutdown"] = vmcmi.PerformShutdown + } + if vmcmi.InstanceType != "" { + objectMap["instanceType"] = vmcmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrateInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsVMwareCbtMigrateInput() (*VMwareCbtMigrateInput, bool) { + return &vmcmi, true +} + +// AsMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsMigrateProviderSpecificInput() (*MigrateProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicMigrateProviderSpecificInput is the BasicMigrateProviderSpecificInput implementation for VMwareCbtMigrateInput. +func (vmcmi VMwareCbtMigrateInput) AsBasicMigrateProviderSpecificInput() (BasicMigrateProviderSpecificInput, bool) { + return &vmcmi, true +} + +// VMwareCbtMigrationDetails vMwareCbt provider specific settings. +type VMwareCbtMigrationDetails struct { + // VmwareMachineID - READ-ONLY; The ARM Id of the VM discovered in VMware. + VmwareMachineID *string `json:"vmwareMachineId,omitempty"` + // OsType - READ-ONLY; The type of the OS on the VM. + OsType *string `json:"osType,omitempty"` + // FirmwareType - READ-ONLY; The firmware type. + FirmwareType *string `json:"firmwareType,omitempty"` + // TargetGeneration - READ-ONLY; The target generation. + TargetGeneration *string `json:"targetGeneration,omitempty"` + // LicenseType - License Type of the VM to be used. + LicenseType *string `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. + SQLServerLicenseType *string `json:"sqlServerLicenseType,omitempty"` + // DataMoverRunAsAccountID - READ-ONLY; The data mover run as account Id. + DataMoverRunAsAccountID *string `json:"dataMoverRunAsAccountId,omitempty"` + // SnapshotRunAsAccountID - READ-ONLY; The snapshot run as account Id. + SnapshotRunAsAccountID *string `json:"snapshotRunAsAccountId,omitempty"` + // TargetVMName - Target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetLocation - READ-ONLY; The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // TargetResourceGroupID - The target resource group Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // ProtectedDisks - The list of protected disks. + ProtectedDisks *[]VMwareCbtProtectedDiskDetails `json:"protectedDisks,omitempty"` + // TargetNetworkID - The target network Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // VMNics - The network details. + VMNics *[]VMwareCbtNicDetails `json:"vmNics,omitempty"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // MigrationRecoveryPointID - READ-ONLY; The recovery point Id to which the VM was migrated. + MigrationRecoveryPointID *string `json:"migrationRecoveryPointId,omitempty"` + // LastRecoveryPointReceived - READ-ONLY; The last recovery point received time. + LastRecoveryPointReceived *date.Time `json:"lastRecoveryPointReceived,omitempty"` + // LastRecoveryPointID - READ-ONLY; The last recovery point Id. + LastRecoveryPointID *string `json:"lastRecoveryPointId,omitempty"` + // InitialSeedingProgressPercentage - READ-ONLY; The initial seeding progress percentage. + InitialSeedingProgressPercentage *int32 `json:"initialSeedingProgressPercentage,omitempty"` + // MigrationProgressPercentage - READ-ONLY; The migration progress percentage. + MigrationProgressPercentage *int32 `json:"migrationProgressPercentage,omitempty"` + // ResyncProgressPercentage - READ-ONLY; The resync progress percentage. + ResyncProgressPercentage *int32 `json:"resyncProgressPercentage,omitempty"` + // InitialSeedingRetryCount - READ-ONLY; The initial seeding retry count. + InitialSeedingRetryCount *int64 `json:"initialSeedingRetryCount,omitempty"` + // ResyncRetryCount - READ-ONLY; The resync retry count. + ResyncRetryCount *int64 `json:"resyncRetryCount,omitempty"` + // ResyncRequired - READ-ONLY; A value indicating whether resync is required. + ResyncRequired *string `json:"resyncRequired,omitempty"` + // ResyncState - READ-ONLY; The resync state. Possible values include: 'ResyncStateNone', 'ResyncStatePreparedForResynchronization', 'ResyncStateStartedResynchronization' + ResyncState ResyncState `json:"resyncState,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // SeedDiskTags - The tags for the seed disks. + SeedDiskTags map[string]*string `json:"seedDiskTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeMigrationProviderSpecificSettings', 'InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicMigrationProviderSpecificSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) MarshalJSON() ([]byte, error) { + vmcmd.InstanceType = InstanceTypeBasicMigrationProviderSpecificSettingsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcmd.LicenseType != nil { + objectMap["licenseType"] = vmcmd.LicenseType + } + if vmcmd.SQLServerLicenseType != nil { + objectMap["sqlServerLicenseType"] = vmcmd.SQLServerLicenseType + } + if vmcmd.TargetVMName != nil { + objectMap["targetVmName"] = vmcmd.TargetVMName + } + if vmcmd.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcmd.TargetVMSize + } + if vmcmd.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcmd.TargetResourceGroupID + } + if vmcmd.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcmd.TargetAvailabilitySetID + } + if vmcmd.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcmd.TargetAvailabilityZone + } + if vmcmd.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcmd.TargetProximityPlacementGroupID + } + if vmcmd.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcmd.TargetBootDiagnosticsStorageAccountID + } + if vmcmd.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcmd.TargetVMTags + } + if vmcmd.ProtectedDisks != nil { + objectMap["protectedDisks"] = vmcmd.ProtectedDisks + } + if vmcmd.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcmd.TargetNetworkID + } + if vmcmd.VMNics != nil { + objectMap["vmNics"] = vmcmd.VMNics + } + if vmcmd.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcmd.TargetNicTags + } + if vmcmd.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcmd.PerformAutoResync + } + if vmcmd.SeedDiskTags != nil { + objectMap["seedDiskTags"] = vmcmd.SeedDiskTags + } + if vmcmd.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcmd.TargetDiskTags + } + if vmcmd.InstanceType != "" { + objectMap["instanceType"] = vmcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtMigrationDetails is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsVMwareCbtMigrationDetails() (*VMwareCbtMigrationDetails, bool) { + return &vmcmd, true +} + +// AsMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsMigrationProviderSpecificSettings() (*MigrationProviderSpecificSettings, bool) { + return nil, false +} + +// AsBasicMigrationProviderSpecificSettings is the BasicMigrationProviderSpecificSettings implementation for VMwareCbtMigrationDetails. +func (vmcmd VMwareCbtMigrationDetails) AsBasicMigrationProviderSpecificSettings() (BasicMigrationProviderSpecificSettings, bool) { + return &vmcmd, true +} + +// VMwareCbtNicDetails vMwareCbt NIC details. +type VMwareCbtNicDetails struct { + // NicID - READ-ONLY; The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // SourceIPAddress - READ-ONLY; The source IP address. + SourceIPAddress *string `json:"sourceIPAddress,omitempty"` + // SourceIPAddressType - READ-ONLY; The source IP address type. Possible values include: 'Dynamic', 'Static' + SourceIPAddressType EthernetAddressType `json:"sourceIPAddressType,omitempty"` + // SourceNetworkID - READ-ONLY; Source network Id. + SourceNetworkID *string `json:"sourceNetworkId,omitempty"` + // TargetIPAddress - The target IP address. + TargetIPAddress *string `json:"targetIPAddress,omitempty"` + // TargetIPAddressType - The target IP address type. Possible values include: 'Dynamic', 'Static' + TargetIPAddressType EthernetAddressType `json:"targetIPAddressType,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TestNetworkID - Source network Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // TestSubnetName - Test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TestIPAddress - The test IP address. + TestIPAddress *string `json:"testIPAddress,omitempty"` + // TestIPAddressType - The test IP address type. Possible values include: 'Dynamic', 'Static' + TestIPAddressType EthernetAddressType `json:"testIPAddressType,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` + // IsSelectedForMigration - A value indicating whether this NIC is selected for migration. + IsSelectedForMigration *string `json:"isSelectedForMigration,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtNicDetails. +func (vmcnd VMwareCbtNicDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmcnd.IsPrimaryNic != nil { + objectMap["isPrimaryNic"] = vmcnd.IsPrimaryNic + } + if vmcnd.TargetIPAddress != nil { + objectMap["targetIPAddress"] = vmcnd.TargetIPAddress + } + if vmcnd.TargetIPAddressType != "" { + objectMap["targetIPAddressType"] = vmcnd.TargetIPAddressType + } + if vmcnd.TargetSubnetName != nil { + objectMap["targetSubnetName"] = vmcnd.TargetSubnetName + } + if vmcnd.TestNetworkID != nil { + objectMap["testNetworkId"] = vmcnd.TestNetworkID + } + if vmcnd.TestSubnetName != nil { + objectMap["testSubnetName"] = vmcnd.TestSubnetName + } + if vmcnd.TestIPAddress != nil { + objectMap["testIPAddress"] = vmcnd.TestIPAddress + } + if vmcnd.TestIPAddressType != "" { + objectMap["testIPAddressType"] = vmcnd.TestIPAddressType + } + if vmcnd.TargetNicName != nil { + objectMap["targetNicName"] = vmcnd.TargetNicName + } + if vmcnd.IsSelectedForMigration != nil { + objectMap["isSelectedForMigration"] = vmcnd.IsSelectedForMigration + } + return json.Marshal(objectMap) +} + +// VMwareCbtNicInput vMwareCbt NIC input. +type VMwareCbtNicInput struct { + // NicID - The NIC Id. + NicID *string `json:"nicId,omitempty"` + // IsPrimaryNic - A value indicating whether this is the primary NIC. + IsPrimaryNic *string `json:"isPrimaryNic,omitempty"` + // TargetSubnetName - Target subnet name. + TargetSubnetName *string `json:"targetSubnetName,omitempty"` + // TargetStaticIPAddress - The static IP address. + TargetStaticIPAddress *string `json:"targetStaticIPAddress,omitempty"` + // IsSelectedForMigration - A value indicating whether this NIC is selected for migration. + IsSelectedForMigration *string `json:"isSelectedForMigration,omitempty"` + // TargetNicName - Target NIC name. + TargetNicName *string `json:"targetNicName,omitempty"` + // TestSubnetName - The test subnet name. + TestSubnetName *string `json:"testSubnetName,omitempty"` + // TestStaticIPAddress - The test static IP address. + TestStaticIPAddress *string `json:"testStaticIPAddress,omitempty"` +} + +// VMwareCbtPolicyCreationInput vMware Cbt policy creation input. +type VMwareCbtPolicyCreationInput struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency (in minutes). + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency (in minutes). + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypePolicyProviderSpecificInput', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2ACrossClusterMigration', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) MarshalJSON() ([]byte, error) { + vmcpci.InstanceType = InstanceTypeBasicPolicyProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcpci.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = vmcpci.RecoveryPointHistoryInMinutes + } + if vmcpci.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = vmcpci.CrashConsistentFrequencyInMinutes + } + if vmcpci.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = vmcpci.AppConsistentFrequencyInMinutes + } + if vmcpci.InstanceType != "" { + objectMap["instanceType"] = vmcpci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2ACrossClusterMigrationPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsA2ACrossClusterMigrationPolicyCreationInput() (*A2ACrossClusterMigrationPolicyCreationInput, bool) { + return nil, false +} + +// AsA2APolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsA2APolicyCreationInput() (*A2APolicyCreationInput, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaAzurePolicyInput() (*HyperVReplicaAzurePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaBluePolicyInput() (*HyperVReplicaBluePolicyInput, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsHyperVReplicaPolicyInput() (*HyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsBasicHyperVReplicaPolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsBasicHyperVReplicaPolicyInput() (BasicHyperVReplicaPolicyInput, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageAzureV2PolicyInput() (*InMageAzureV2PolicyInput, bool) { + return nil, false +} + +// AsInMagePolicyInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMagePolicyInput() (*InMagePolicyInput, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageRcmFailbackPolicyCreationInput() (*InMageRcmFailbackPolicyCreationInput, bool) { + return nil, false +} + +// AsInMageRcmPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsInMageRcmPolicyCreationInput() (*InMageRcmPolicyCreationInput, bool) { + return nil, false +} + +// AsVMwareCbtPolicyCreationInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsVMwareCbtPolicyCreationInput() (*VMwareCbtPolicyCreationInput, bool) { + return &vmcpci, true +} + +// AsPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsPolicyProviderSpecificInput() (*PolicyProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificInput is the BasicPolicyProviderSpecificInput implementation for VMwareCbtPolicyCreationInput. +func (vmcpci VMwareCbtPolicyCreationInput) AsBasicPolicyProviderSpecificInput() (BasicPolicyProviderSpecificInput, bool) { + return &vmcpci, true +} + +// VmwareCbtPolicyDetails vMware Cbt specific policy details. +type VmwareCbtPolicyDetails struct { + // RecoveryPointHistoryInMinutes - The duration in minutes until which the recovery points need to be stored. + RecoveryPointHistoryInMinutes *int32 `json:"recoveryPointHistoryInMinutes,omitempty"` + // AppConsistentFrequencyInMinutes - The app consistent snapshot frequency in minutes. + AppConsistentFrequencyInMinutes *int32 `json:"appConsistentFrequencyInMinutes,omitempty"` + // CrashConsistentFrequencyInMinutes - The crash consistent snapshot frequency in minutes. + CrashConsistentFrequencyInMinutes *int32 `json:"crashConsistentFrequencyInMinutes,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypePolicyProviderSpecificDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplicaBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012R2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeHyperVReplica2012', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageAzureV2', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageBasePolicyDetails', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMage', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcmFailback', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicPolicyProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) MarshalJSON() ([]byte, error) { + vcpd.InstanceType = InstanceTypeBasicPolicyProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vcpd.RecoveryPointHistoryInMinutes != nil { + objectMap["recoveryPointHistoryInMinutes"] = vcpd.RecoveryPointHistoryInMinutes + } + if vcpd.AppConsistentFrequencyInMinutes != nil { + objectMap["appConsistentFrequencyInMinutes"] = vcpd.AppConsistentFrequencyInMinutes + } + if vcpd.CrashConsistentFrequencyInMinutes != nil { + objectMap["crashConsistentFrequencyInMinutes"] = vcpd.CrashConsistentFrequencyInMinutes + } + if vcpd.InstanceType != "" { + objectMap["instanceType"] = vcpd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2APolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsA2APolicyDetails() (*A2APolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaAzurePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaAzurePolicyDetails() (*HyperVReplicaAzurePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaBasePolicyDetails() (*HyperVReplicaBasePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaBluePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaBluePolicyDetails() (*HyperVReplicaBluePolicyDetails, bool) { + return nil, false +} + +// AsHyperVReplicaPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsHyperVReplicaPolicyDetails() (*HyperVReplicaPolicyDetails, bool) { + return nil, false +} + +// AsInMageAzureV2PolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageAzureV2PolicyDetails() (*InMageAzureV2PolicyDetails, bool) { + return nil, false +} + +// AsInMageBasePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageBasePolicyDetails() (*InMageBasePolicyDetails, bool) { + return nil, false +} + +// AsInMagePolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMagePolicyDetails() (*InMagePolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmFailbackPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageRcmFailbackPolicyDetails() (*InMageRcmFailbackPolicyDetails, bool) { + return nil, false +} + +// AsInMageRcmPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsInMageRcmPolicyDetails() (*InMageRcmPolicyDetails, bool) { + return nil, false +} + +// AsVmwareCbtPolicyDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsVmwareCbtPolicyDetails() (*VmwareCbtPolicyDetails, bool) { + return &vcpd, true +} + +// AsPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsPolicyProviderSpecificDetails() (*PolicyProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicPolicyProviderSpecificDetails is the BasicPolicyProviderSpecificDetails implementation for VmwareCbtPolicyDetails. +func (vcpd VmwareCbtPolicyDetails) AsBasicPolicyProviderSpecificDetails() (BasicPolicyProviderSpecificDetails, bool) { + return &vcpd, true +} + +// VMwareCbtProtectedDiskDetails vMwareCbt protected disk details. +type VMwareCbtProtectedDiskDetails struct { + // DiskID - READ-ONLY; The disk id. + DiskID *string `json:"diskId,omitempty"` + // DiskName - READ-ONLY; The disk name. + DiskName *string `json:"diskName,omitempty"` + // DiskType - The disk type. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' + DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskPath - READ-ONLY; The disk path. + DiskPath *string `json:"diskPath,omitempty"` + // IsOSDisk - READ-ONLY; A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` + // CapacityInBytes - READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 `json:"capacityInBytes,omitempty"` + // LogStorageAccountID - READ-ONLY; The log storage account ARM Id. + LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` + // LogStorageAccountSasSecretName - READ-ONLY; The key vault secret name of the log storage account. + LogStorageAccountSasSecretName *string `json:"logStorageAccountSasSecretName,omitempty"` + // DiskEncryptionSetID - READ-ONLY; The DiskEncryptionSet ARM Id. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // SeedManagedDiskID - READ-ONLY; The ARM Id of the seed managed disk. + SeedManagedDiskID *string `json:"seedManagedDiskId,omitempty"` + // TargetManagedDiskID - READ-ONLY; The ARM Id of the target managed disk. + TargetManagedDiskID *string `json:"targetManagedDiskId,omitempty"` + // TargetDiskName - The name for the target managed disk. + TargetDiskName *string `json:"targetDiskName,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtProtectedDiskDetails. +func (vmcpdd VMwareCbtProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmcpdd.DiskType != "" { + objectMap["diskType"] = vmcpdd.DiskType + } + if vmcpdd.TargetDiskName != nil { + objectMap["targetDiskName"] = vmcpdd.TargetDiskName + } + return json.Marshal(objectMap) +} + +// VMwareCbtProtectionContainerMappingDetails vMwareCbt provider specific container mapping details. +type VMwareCbtProtectionContainerMappingDetails struct { + // KeyVaultID - READ-ONLY; The target key vault ARM Id. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyVaultURI - READ-ONLY; The target key vault URI. + KeyVaultURI *string `json:"keyVaultUri,omitempty"` + // StorageAccountID - READ-ONLY; The storage account ARM Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // StorageAccountSasSecretName - READ-ONLY; The secret name of the storage account. + StorageAccountSasSecretName *string `json:"storageAccountSasSecretName,omitempty"` + // ServiceBusConnectionStringSecretName - READ-ONLY; The secret name of the service bus connection string. + ServiceBusConnectionStringSecretName *string `json:"serviceBusConnectionStringSecretName,omitempty"` + // TargetLocation - READ-ONLY; The target location. + TargetLocation *string `json:"targetLocation,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeProtectionContainerMappingProviderSpecificDetails', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeA2A', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicProtectionContainerMappingProviderSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { + vmcpcmd.InstanceType = InstanceTypeBasicProtectionContainerMappingProviderSpecificDetailsInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcpcmd.InstanceType != "" { + objectMap["instanceType"] = vmcpcmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsA2AProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsA2AProtectionContainerMappingDetails() (*A2AProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsInMageRcmProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsInMageRcmProtectionContainerMappingDetails() (*InMageRcmProtectionContainerMappingDetails, bool) { + return nil, false +} + +// AsVMwareCbtProtectionContainerMappingDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsVMwareCbtProtectionContainerMappingDetails() (*VMwareCbtProtectionContainerMappingDetails, bool) { + return &vmcpcmd, true +} + +// AsProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsProtectionContainerMappingProviderSpecificDetails() (*ProtectionContainerMappingProviderSpecificDetails, bool) { + return nil, false +} + +// AsBasicProtectionContainerMappingProviderSpecificDetails is the BasicProtectionContainerMappingProviderSpecificDetails implementation for VMwareCbtProtectionContainerMappingDetails. +func (vmcpcmd VMwareCbtProtectionContainerMappingDetails) AsBasicProtectionContainerMappingProviderSpecificDetails() (BasicProtectionContainerMappingProviderSpecificDetails, bool) { + return &vmcpcmd, true +} + +// VMwareCbtResyncInput vMwareCbt specific resync input. +type VMwareCbtResyncInput struct { + // SkipCbtReset - A value indicating whether CBT is to be reset. + SkipCbtReset *string `json:"skipCbtReset,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeResyncProviderSpecificInput', 'InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicResyncProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) MarshalJSON() ([]byte, error) { + vmcri.InstanceType = InstanceTypeBasicResyncProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcri.SkipCbtReset != nil { + objectMap["skipCbtReset"] = vmcri.SkipCbtReset + } + if vmcri.InstanceType != "" { + objectMap["instanceType"] = vmcri.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtResyncInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsVMwareCbtResyncInput() (*VMwareCbtResyncInput, bool) { + return &vmcri, true +} + +// AsResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsResyncProviderSpecificInput() (*ResyncProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicResyncProviderSpecificInput is the BasicResyncProviderSpecificInput implementation for VMwareCbtResyncInput. +func (vmcri VMwareCbtResyncInput) AsBasicResyncProviderSpecificInput() (BasicResyncProviderSpecificInput, bool) { + return &vmcri, true +} + +// VMwareCbtTestMigrateInput vMwareCbt specific test migrate input. +type VMwareCbtTestMigrateInput struct { + // RecoveryPointID - The recovery point Id. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // NetworkID - The test network Id. + NetworkID *string `json:"networkId,omitempty"` + // VMNics - The list of NIC details. + VMNics *[]VMwareCbtNicInput `json:"vmNics,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeTestMigrateProviderSpecificInput', 'InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicTestMigrateProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) MarshalJSON() ([]byte, error) { + vmctmi.InstanceType = InstanceTypeBasicTestMigrateProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmctmi.RecoveryPointID != nil { + objectMap["recoveryPointId"] = vmctmi.RecoveryPointID + } + if vmctmi.NetworkID != nil { + objectMap["networkId"] = vmctmi.NetworkID + } + if vmctmi.VMNics != nil { + objectMap["vmNics"] = vmctmi.VMNics + } + if vmctmi.InstanceType != "" { + objectMap["instanceType"] = vmctmi.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtTestMigrateInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsVMwareCbtTestMigrateInput() (*VMwareCbtTestMigrateInput, bool) { + return &vmctmi, true +} + +// AsTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsTestMigrateProviderSpecificInput() (*TestMigrateProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicTestMigrateProviderSpecificInput is the BasicTestMigrateProviderSpecificInput implementation for VMwareCbtTestMigrateInput. +func (vmctmi VMwareCbtTestMigrateInput) AsBasicTestMigrateProviderSpecificInput() (BasicTestMigrateProviderSpecificInput, bool) { + return &vmctmi, true +} + +// VMwareCbtUpdateDiskInput vMwareCbt disk input for update. +type VMwareCbtUpdateDiskInput struct { + // DiskID - The disk Id. + DiskID *string `json:"diskId,omitempty"` + // TargetDiskName - The target disk name. + TargetDiskName *string `json:"targetDiskName,omitempty"` + // IsOSDisk - A value indicating whether the disk is the OS disk. + IsOSDisk *string `json:"isOSDisk,omitempty"` +} + +// VMwareCbtUpdateMigrationItemInput vMwareCbt specific update migration item input. +type VMwareCbtUpdateMigrationItemInput struct { + // TargetVMName - The target VM name. + TargetVMName *string `json:"targetVmName,omitempty"` + // TargetVMSize - The target VM size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetResourceGroupID - The target resource group ARM Id. + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // TargetAvailabilitySetID - The target availability set ARM Id. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetAvailabilityZone - The target availability zone. + TargetAvailabilityZone *string `json:"targetAvailabilityZone,omitempty"` + // TargetProximityPlacementGroupID - The target proximity placement group ARM Id. + TargetProximityPlacementGroupID *string `json:"targetProximityPlacementGroupId,omitempty"` + // TargetBootDiagnosticsStorageAccountID - The target boot diagnostics storage account ARM Id. + TargetBootDiagnosticsStorageAccountID *string `json:"targetBootDiagnosticsStorageAccountId,omitempty"` + // TargetNetworkID - The target network ARM Id. + TargetNetworkID *string `json:"targetNetworkId,omitempty"` + // TestNetworkID - The test network ARM Id. + TestNetworkID *string `json:"testNetworkId,omitempty"` + // VMNics - The list of NIC details. + VMNics *[]VMwareCbtNicInput `json:"vmNics,omitempty"` + // VMDisks - The list of disk update properties. + VMDisks *[]VMwareCbtUpdateDiskInput `json:"vmDisks,omitempty"` + // LicenseType - The license type. Possible values include: 'LicenseTypeNotSpecified', 'LicenseTypeNoLicenseType', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // SQLServerLicenseType - The SQL Server license type. Possible values include: 'SQLServerLicenseTypeNotSpecified', 'SQLServerLicenseTypeNoLicenseType', 'SQLServerLicenseTypePAYG', 'SQLServerLicenseTypeAHUB' + SQLServerLicenseType SQLServerLicenseType `json:"sqlServerLicenseType,omitempty"` + // PerformAutoResync - A value indicating whether auto resync is to be done. + PerformAutoResync *string `json:"performAutoResync,omitempty"` + // TargetVMTags - The target VM tags. + TargetVMTags map[string]*string `json:"targetVmTags"` + // TargetDiskTags - The tags for the target disks. + TargetDiskTags map[string]*string `json:"targetDiskTags"` + // TargetNicTags - The tags for the target NICs. + TargetNicTags map[string]*string `json:"targetNicTags"` + // InstanceType - Possible values include: 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeUpdateMigrationItemProviderSpecificInput', 'InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt' + InstanceType InstanceTypeBasicUpdateMigrationItemProviderSpecificInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) MarshalJSON() ([]byte, error) { + vmcumii.InstanceType = InstanceTypeBasicUpdateMigrationItemProviderSpecificInputInstanceTypeVMwareCbt + objectMap := make(map[string]interface{}) + if vmcumii.TargetVMName != nil { + objectMap["targetVmName"] = vmcumii.TargetVMName + } + if vmcumii.TargetVMSize != nil { + objectMap["targetVmSize"] = vmcumii.TargetVMSize + } + if vmcumii.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = vmcumii.TargetResourceGroupID + } + if vmcumii.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmcumii.TargetAvailabilitySetID + } + if vmcumii.TargetAvailabilityZone != nil { + objectMap["targetAvailabilityZone"] = vmcumii.TargetAvailabilityZone + } + if vmcumii.TargetProximityPlacementGroupID != nil { + objectMap["targetProximityPlacementGroupId"] = vmcumii.TargetProximityPlacementGroupID + } + if vmcumii.TargetBootDiagnosticsStorageAccountID != nil { + objectMap["targetBootDiagnosticsStorageAccountId"] = vmcumii.TargetBootDiagnosticsStorageAccountID + } + if vmcumii.TargetNetworkID != nil { + objectMap["targetNetworkId"] = vmcumii.TargetNetworkID + } + if vmcumii.TestNetworkID != nil { + objectMap["testNetworkId"] = vmcumii.TestNetworkID + } + if vmcumii.VMNics != nil { + objectMap["vmNics"] = vmcumii.VMNics + } + if vmcumii.VMDisks != nil { + objectMap["vmDisks"] = vmcumii.VMDisks + } + if vmcumii.LicenseType != "" { + objectMap["licenseType"] = vmcumii.LicenseType + } + if vmcumii.SQLServerLicenseType != "" { + objectMap["sqlServerLicenseType"] = vmcumii.SQLServerLicenseType + } + if vmcumii.PerformAutoResync != nil { + objectMap["performAutoResync"] = vmcumii.PerformAutoResync + } + if vmcumii.TargetVMTags != nil { + objectMap["targetVmTags"] = vmcumii.TargetVMTags + } + if vmcumii.TargetDiskTags != nil { + objectMap["targetDiskTags"] = vmcumii.TargetDiskTags + } + if vmcumii.TargetNicTags != nil { + objectMap["targetNicTags"] = vmcumii.TargetNicTags + } + if vmcumii.InstanceType != "" { + objectMap["instanceType"] = vmcumii.InstanceType + } + return json.Marshal(objectMap) +} + +// AsVMwareCbtUpdateMigrationItemInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsVMwareCbtUpdateMigrationItemInput() (*VMwareCbtUpdateMigrationItemInput, bool) { + return &vmcumii, true +} + +// AsUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsUpdateMigrationItemProviderSpecificInput() (*UpdateMigrationItemProviderSpecificInput, bool) { + return nil, false +} + +// AsBasicUpdateMigrationItemProviderSpecificInput is the BasicUpdateMigrationItemProviderSpecificInput implementation for VMwareCbtUpdateMigrationItemInput. +func (vmcumii VMwareCbtUpdateMigrationItemInput) AsBasicUpdateMigrationItemProviderSpecificInput() (BasicUpdateMigrationItemProviderSpecificInput, bool) { + return &vmcumii, true +} + +// VMwareDetails store the fabric details specific to the VMware fabric. +type VMwareDetails struct { + // ProcessServers - The list of Process Servers associated with the fabric. + ProcessServers *[]ProcessServer `json:"processServers,omitempty"` + // MasterTargetServers - The list of Master Target servers associated with the fabric. + MasterTargetServers *[]MasterTargetServer `json:"masterTargetServers,omitempty"` + // RunAsAccounts - The list of run as accounts created on the server. + RunAsAccounts *[]RunAsAccount `json:"runAsAccounts,omitempty"` + // ReplicationPairCount - The number of replication pairs configured in this CS. + ReplicationPairCount *string `json:"replicationPairCount,omitempty"` + // ProcessServerCount - The number of process servers. + ProcessServerCount *string `json:"processServerCount,omitempty"` + // AgentCount - The number of source and target servers configured to talk to this CS. + AgentCount *string `json:"agentCount,omitempty"` + // ProtectedServers - The number of protected servers. + ProtectedServers *string `json:"protectedServers,omitempty"` + // SystemLoad - The percentage of the system load. + SystemLoad *string `json:"systemLoad,omitempty"` + // SystemLoadStatus - The system load status. + SystemLoadStatus *string `json:"systemLoadStatus,omitempty"` + // CPULoad - The percentage of the CPU load. + CPULoad *string `json:"cpuLoad,omitempty"` + // CPULoadStatus - The CPU load status. + CPULoadStatus *string `json:"cpuLoadStatus,omitempty"` + // TotalMemoryInBytes - The total memory. + TotalMemoryInBytes *int64 `json:"totalMemoryInBytes,omitempty"` + // AvailableMemoryInBytes - The available memory. + AvailableMemoryInBytes *int64 `json:"availableMemoryInBytes,omitempty"` + // MemoryUsageStatus - The memory usage status. + MemoryUsageStatus *string `json:"memoryUsageStatus,omitempty"` + // TotalSpaceInBytes - The total space. + TotalSpaceInBytes *int64 `json:"totalSpaceInBytes,omitempty"` + // AvailableSpaceInBytes - The available space. + AvailableSpaceInBytes *int64 `json:"availableSpaceInBytes,omitempty"` + // SpaceUsageStatus - The space usage status. + SpaceUsageStatus *string `json:"spaceUsageStatus,omitempty"` + // WebLoad - The web load. + WebLoad *string `json:"webLoad,omitempty"` + // WebLoadStatus - The web load status. + WebLoadStatus *string `json:"webLoadStatus,omitempty"` + // DatabaseServerLoad - The database server load. + DatabaseServerLoad *string `json:"databaseServerLoad,omitempty"` + // DatabaseServerLoadStatus - The database server load status. + DatabaseServerLoadStatus *string `json:"databaseServerLoadStatus,omitempty"` + // CsServiceStatus - The CS service status. + CsServiceStatus *string `json:"csServiceStatus,omitempty"` + // IPAddress - The IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // AgentVersion - The agent Version. + AgentVersion *string `json:"agentVersion,omitempty"` + // HostName - The host name. + HostName *string `json:"hostName,omitempty"` + // LastHeartbeat - The last heartbeat received from CS server. + LastHeartbeat *date.Time `json:"lastHeartbeat,omitempty"` + // VersionStatus - Version status. + VersionStatus *string `json:"versionStatus,omitempty"` + // SslCertExpiryDate - CS SSL cert expiry date. + SslCertExpiryDate *date.Time `json:"sslCertExpiryDate,omitempty"` + // SslCertExpiryRemainingDays - CS SSL cert expiry date. + SslCertExpiryRemainingDays *int32 `json:"sslCertExpiryRemainingDays,omitempty"` + // PsTemplateVersion - PS template version. + PsTemplateVersion *string `json:"psTemplateVersion,omitempty"` + // AgentExpiryDate - Agent expiry date. + AgentExpiryDate *date.Time `json:"agentExpiryDate,omitempty"` + // AgentVersionDetails - The agent version details. + AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"` + // SwitchProviderBlockingErrorDetails - The switch provider blocking error information. + SwitchProviderBlockingErrorDetails *[]InMageFabricSwitchProviderBlockingErrorDetails `json:"switchProviderBlockingErrorDetails,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareDetails. +func (vmd VMwareDetails) MarshalJSON() ([]byte, error) { + vmd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware + objectMap := make(map[string]interface{}) + if vmd.ProcessServers != nil { + objectMap["processServers"] = vmd.ProcessServers + } + if vmd.MasterTargetServers != nil { + objectMap["masterTargetServers"] = vmd.MasterTargetServers + } + if vmd.RunAsAccounts != nil { + objectMap["runAsAccounts"] = vmd.RunAsAccounts + } + if vmd.ReplicationPairCount != nil { + objectMap["replicationPairCount"] = vmd.ReplicationPairCount + } + if vmd.ProcessServerCount != nil { + objectMap["processServerCount"] = vmd.ProcessServerCount + } + if vmd.AgentCount != nil { + objectMap["agentCount"] = vmd.AgentCount + } + if vmd.ProtectedServers != nil { + objectMap["protectedServers"] = vmd.ProtectedServers + } + if vmd.SystemLoad != nil { + objectMap["systemLoad"] = vmd.SystemLoad + } + if vmd.SystemLoadStatus != nil { + objectMap["systemLoadStatus"] = vmd.SystemLoadStatus + } + if vmd.CPULoad != nil { + objectMap["cpuLoad"] = vmd.CPULoad + } + if vmd.CPULoadStatus != nil { + objectMap["cpuLoadStatus"] = vmd.CPULoadStatus + } + if vmd.TotalMemoryInBytes != nil { + objectMap["totalMemoryInBytes"] = vmd.TotalMemoryInBytes + } + if vmd.AvailableMemoryInBytes != nil { + objectMap["availableMemoryInBytes"] = vmd.AvailableMemoryInBytes + } + if vmd.MemoryUsageStatus != nil { + objectMap["memoryUsageStatus"] = vmd.MemoryUsageStatus + } + if vmd.TotalSpaceInBytes != nil { + objectMap["totalSpaceInBytes"] = vmd.TotalSpaceInBytes + } + if vmd.AvailableSpaceInBytes != nil { + objectMap["availableSpaceInBytes"] = vmd.AvailableSpaceInBytes + } + if vmd.SpaceUsageStatus != nil { + objectMap["spaceUsageStatus"] = vmd.SpaceUsageStatus + } + if vmd.WebLoad != nil { + objectMap["webLoad"] = vmd.WebLoad + } + if vmd.WebLoadStatus != nil { + objectMap["webLoadStatus"] = vmd.WebLoadStatus + } + if vmd.DatabaseServerLoad != nil { + objectMap["databaseServerLoad"] = vmd.DatabaseServerLoad + } + if vmd.DatabaseServerLoadStatus != nil { + objectMap["databaseServerLoadStatus"] = vmd.DatabaseServerLoadStatus + } + if vmd.CsServiceStatus != nil { + objectMap["csServiceStatus"] = vmd.CsServiceStatus + } + if vmd.IPAddress != nil { + objectMap["ipAddress"] = vmd.IPAddress + } + if vmd.AgentVersion != nil { + objectMap["agentVersion"] = vmd.AgentVersion + } + if vmd.HostName != nil { + objectMap["hostName"] = vmd.HostName + } + if vmd.LastHeartbeat != nil { + objectMap["lastHeartbeat"] = vmd.LastHeartbeat + } + if vmd.VersionStatus != nil { + objectMap["versionStatus"] = vmd.VersionStatus + } + if vmd.SslCertExpiryDate != nil { + objectMap["sslCertExpiryDate"] = vmd.SslCertExpiryDate + } + if vmd.SslCertExpiryRemainingDays != nil { + objectMap["sslCertExpiryRemainingDays"] = vmd.SslCertExpiryRemainingDays + } + if vmd.PsTemplateVersion != nil { + objectMap["psTemplateVersion"] = vmd.PsTemplateVersion + } + if vmd.AgentExpiryDate != nil { + objectMap["agentExpiryDate"] = vmd.AgentExpiryDate + } + if vmd.AgentVersionDetails != nil { + objectMap["agentVersionDetails"] = vmd.AgentVersionDetails + } + if vmd.SwitchProviderBlockingErrorDetails != nil { + objectMap["switchProviderBlockingErrorDetails"] = vmd.SwitchProviderBlockingErrorDetails + } + if vmd.InstanceType != "" { + objectMap["instanceType"] = vmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return &vmd, true +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return nil, false +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareDetails. +func (vmd VMwareDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vmd, true +} + +// VMwareV2FabricCreationInput vMwareV2 fabric provider specific settings. +type VMwareV2FabricCreationInput struct { + // VmwareSiteID - The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // MigrationSolutionID - The ARM Id of the migration solution. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeFabricSpecificCreationInput', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificCreationInput `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) MarshalJSON() ([]byte, error) { + vmvfci.InstanceType = InstanceTypeBasicFabricSpecificCreationInputInstanceTypeVMwareV2 + objectMap := make(map[string]interface{}) + if vmvfci.VmwareSiteID != nil { + objectMap["vmwareSiteId"] = vmvfci.VmwareSiteID + } + if vmvfci.PhysicalSiteID != nil { + objectMap["physicalSiteId"] = vmvfci.PhysicalSiteID + } + if vmvfci.MigrationSolutionID != nil { + objectMap["migrationSolutionId"] = vmvfci.MigrationSolutionID + } + if vmvfci.InstanceType != "" { + objectMap["instanceType"] = vmvfci.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsAzureFabricCreationInput() (*AzureFabricCreationInput, bool) { + return nil, false +} + +// AsInMageRcmFabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsInMageRcmFabricCreationInput() (*InMageRcmFabricCreationInput, bool) { + return nil, false +} + +// AsVMwareV2FabricCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsVMwareV2FabricCreationInput() (*VMwareV2FabricCreationInput, bool) { + return &vmvfci, true +} + +// AsFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsFabricSpecificCreationInput() (*FabricSpecificCreationInput, bool) { + return nil, false +} + +// AsBasicFabricSpecificCreationInput is the BasicFabricSpecificCreationInput implementation for VMwareV2FabricCreationInput. +func (vmvfci VMwareV2FabricCreationInput) AsBasicFabricSpecificCreationInput() (BasicFabricSpecificCreationInput, bool) { + return &vmvfci, true +} + +// VMwareV2FabricSpecificDetails vMwareV2 fabric specific details. +type VMwareV2FabricSpecificDetails struct { + // VmwareSiteID - READ-ONLY; The ARM Id of the VMware site. + VmwareSiteID *string `json:"vmwareSiteId,omitempty"` + // PhysicalSiteID - READ-ONLY; The ARM Id of the physical site. + PhysicalSiteID *string `json:"physicalSiteId,omitempty"` + // MigrationSolutionID - READ-ONLY; The Migration solution ARM Id. + MigrationSolutionID *string `json:"migrationSolutionId,omitempty"` + // ServiceEndpoint - READ-ONLY; The service endpoint. + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` + // ServiceResourceID - READ-ONLY; The service resource Id. + ServiceResourceID *string `json:"serviceResourceId,omitempty"` + // ServiceContainerID - READ-ONLY; The service container Id. + ServiceContainerID *string `json:"serviceContainerId,omitempty"` + // ProcessServers - READ-ONLY; The list of process servers. + ProcessServers *[]ProcessServerDetails `json:"processServers,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeFabricSpecificDetails', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeAzure', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeHyperVSite', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeInMageRcm', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMM', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMware', 'InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2' + InstanceType InstanceTypeBasicFabricSpecificDetails `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) MarshalJSON() ([]byte, error) { + vmvfsd.InstanceType = InstanceTypeBasicFabricSpecificDetailsInstanceTypeVMwareV2 + objectMap := make(map[string]interface{}) + if vmvfsd.InstanceType != "" { + objectMap["instanceType"] = vmvfsd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsAzureFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsAzureFabricSpecificDetails() (*AzureFabricSpecificDetails, bool) { + return nil, false +} + +// AsHyperVSiteDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsHyperVSiteDetails() (*HyperVSiteDetails, bool) { + return nil, false +} + +// AsInMageRcmFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsInMageRcmFabricSpecificDetails() (*InMageRcmFabricSpecificDetails, bool) { + return nil, false +} + +// AsVmmDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVmmDetails() (*VmmDetails, bool) { + return nil, false +} + +// AsVMwareDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVMwareDetails() (*VMwareDetails, bool) { + return nil, false +} + +// AsVMwareV2FabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsVMwareV2FabricSpecificDetails() (*VMwareV2FabricSpecificDetails, bool) { + return &vmvfsd, true +} + +// AsFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsFabricSpecificDetails() (*FabricSpecificDetails, bool) { + return nil, false +} + +// AsBasicFabricSpecificDetails is the BasicFabricSpecificDetails implementation for VMwareV2FabricSpecificDetails. +func (vmvfsd VMwareV2FabricSpecificDetails) AsBasicFabricSpecificDetails() (BasicFabricSpecificDetails, bool) { + return &vmvfsd, true +} + +// VMwareVirtualMachineDetails vMware provider specific settings. +type VMwareVirtualMachineDetails struct { + // AgentGeneratedID - The ID generated by the InMage agent after it gets installed on guest. This is the ID to be used during InMage CreateProtection. + AgentGeneratedID *string `json:"agentGeneratedId,omitempty"` + // AgentInstalled - The value indicating if InMage scout agent is installed on guest. + AgentInstalled *string `json:"agentInstalled,omitempty"` + // OsType - The OsType installed on VM. + OsType *string `json:"osType,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // IPAddress - The IP address. + IPAddress *string `json:"ipAddress,omitempty"` + // PoweredOn - The value indicating whether VM is powered on. + PoweredOn *string `json:"poweredOn,omitempty"` + // VCenterInfrastructureID - The VCenter infrastructure Id. + VCenterInfrastructureID *string `json:"vCenterInfrastructureId,omitempty"` + // DiscoveryType - A value indicating the discovery type of the machine. Value can be vCenter or physical. + DiscoveryType *string `json:"discoveryType,omitempty"` + // DiskDetails - The disk details. + DiskDetails *[]InMageDiskDetails `json:"diskDetails,omitempty"` + // ValidationErrors - The validation errors. + ValidationErrors *[]HealthError `json:"validationErrors,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeConfigurationSettings', 'InstanceTypeHyperVVirtualMachine', 'InstanceTypeReplicationGroupDetails', 'InstanceTypeVmmVirtualMachine', 'InstanceTypeVMwareVirtualMachine' + InstanceType InstanceTypeBasicConfigurationSettings `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) MarshalJSON() ([]byte, error) { + vmvmd.InstanceType = InstanceTypeVMwareVirtualMachine + objectMap := make(map[string]interface{}) + if vmvmd.AgentGeneratedID != nil { + objectMap["agentGeneratedId"] = vmvmd.AgentGeneratedID + } + if vmvmd.AgentInstalled != nil { + objectMap["agentInstalled"] = vmvmd.AgentInstalled + } + if vmvmd.OsType != nil { + objectMap["osType"] = vmvmd.OsType + } + if vmvmd.AgentVersion != nil { + objectMap["agentVersion"] = vmvmd.AgentVersion + } + if vmvmd.IPAddress != nil { + objectMap["ipAddress"] = vmvmd.IPAddress + } + if vmvmd.PoweredOn != nil { + objectMap["poweredOn"] = vmvmd.PoweredOn + } + if vmvmd.VCenterInfrastructureID != nil { + objectMap["vCenterInfrastructureId"] = vmvmd.VCenterInfrastructureID + } + if vmvmd.DiscoveryType != nil { + objectMap["discoveryType"] = vmvmd.DiscoveryType + } + if vmvmd.DiskDetails != nil { + objectMap["diskDetails"] = vmvmd.DiskDetails + } + if vmvmd.ValidationErrors != nil { + objectMap["validationErrors"] = vmvmd.ValidationErrors + } + if vmvmd.InstanceType != "" { + objectMap["instanceType"] = vmvmd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsHyperVVirtualMachineDetails() (*HyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsBasicHyperVVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsBasicHyperVVirtualMachineDetails() (BasicHyperVVirtualMachineDetails, bool) { + return nil, false +} + +// AsReplicationGroupDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsReplicationGroupDetails() (*ReplicationGroupDetails, bool) { + return nil, false +} + +// AsVmmVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsVmmVirtualMachineDetails() (*VmmVirtualMachineDetails, bool) { + return nil, false +} + +// AsVMwareVirtualMachineDetails is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsVMwareVirtualMachineDetails() (*VMwareVirtualMachineDetails, bool) { + return &vmvmd, true +} + +// AsConfigurationSettings is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsConfigurationSettings() (*ConfigurationSettings, bool) { + return nil, false +} + +// AsBasicConfigurationSettings is the BasicConfigurationSettings implementation for VMwareVirtualMachineDetails. +func (vmvmd VMwareVirtualMachineDetails) AsBasicConfigurationSettings() (BasicConfigurationSettings, bool) { + return &vmvmd, true +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/operations.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/operations.go new file mode 100644 index 000000000000..32602f403413 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/operations.go @@ -0,0 +1,145 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the client for the Operations methods of the Siterecovery service. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string, resourceGroupName string, resourceName string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// List operation to return the list of available operations. +func (client OperationsClient) List(ctx context.Context) (result OperationsDiscoveryCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.odc.Response.Response != nil { + sc = result.odc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.odc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.odc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "List", resp, "Failure responding to request") + return + } + if result.odc.hasNextLink() && result.odc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/operations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationsDiscoveryCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationsDiscoveryCollection) (result OperationsDiscoveryCollection, err error) { + req, err := lastResults.operationsDiscoveryCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationsDiscoveryCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/recoverypoints.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/recoverypoints.go new file mode 100644 index 000000000000..63d7e7cb9e57 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/recoverypoints.go @@ -0,0 +1,235 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RecoveryPointsClient is the client for the RecoveryPoints methods of the Siterecovery service. +type RecoveryPointsClient struct { + BaseClient +} + +// NewRecoveryPointsClient creates an instance of the RecoveryPointsClient client. +func NewRecoveryPointsClient(subscriptionID string, resourceGroupName string, resourceName string) RecoveryPointsClient { + return NewRecoveryPointsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewRecoveryPointsClientWithBaseURI creates an instance of the RecoveryPointsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewRecoveryPointsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) RecoveryPointsClient { + return RecoveryPointsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get get the details of specified recovery point. +// Parameters: +// fabricName - the fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replication protected item name. +// recoveryPointName - the recovery point name. +func (client RecoveryPointsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (result RecoveryPoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, recoveryPointName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client RecoveryPointsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "recoveryPointName": autorest.Encode("path", recoveryPointName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints/{recoveryPointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RecoveryPointsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RecoveryPointsClient) GetResponder(resp *http.Response) (result RecoveryPoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationProtectedItems lists the available recovery points for a replication protected item. +// Parameters: +// fabricName - the fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replication protected item name. +func (client RecoveryPointsClient) ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result RecoveryPointCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.RPCVar.Response.Response != nil { + sc = result.RPCVar.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectedItemsNextResults + req, err := client.ListByReplicationProtectedItemsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.RPCVar.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", resp, "Failure sending request") + return + } + + result.RPCVar, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "ListByReplicationProtectedItems", resp, "Failure responding to request") + return + } + if result.RPCVar.hasNextLink() && result.RPCVar.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectedItemsPreparer prepares the ListByReplicationProtectedItems request. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectedItemsSender sends the ListByReplicationProtectedItems request. The method will close the +// http.Response Body if it receives an error. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectedItemsResponder handles the response to the ListByReplicationProtectedItems request. The method always +// closes the http.Response Body. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsResponder(resp *http.Response) (result RecoveryPointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectedItemsNextResults retrieves the next set of results, if any. +func (client RecoveryPointsClient) listByReplicationProtectedItemsNextResults(ctx context.Context, lastResults RecoveryPointCollection) (result RecoveryPointCollection, err error) { + req, err := lastResults.recoveryPointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.RecoveryPointsClient", "listByReplicationProtectedItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectedItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client RecoveryPointsClient) ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result RecoveryPointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectedItems(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationalertsettings.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationalertsettings.go new file mode 100644 index 000000000000..caaa0f49ee4d --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationalertsettings.go @@ -0,0 +1,302 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationAlertSettingsClient is the client for the ReplicationAlertSettings methods of the Siterecovery service. +type ReplicationAlertSettingsClient struct { + BaseClient +} + +// NewReplicationAlertSettingsClient creates an instance of the ReplicationAlertSettingsClient client. +func NewReplicationAlertSettingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationAlertSettingsClient { + return NewReplicationAlertSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationAlertSettingsClientWithBaseURI creates an instance of the ReplicationAlertSettingsClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationAlertSettingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationAlertSettingsClient { + return ReplicationAlertSettingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create create or update an email notification(alert) configuration. +// Parameters: +// alertSettingName - the name of the email notification(alert) configuration. +// request - the input to configure the email notification(alert). +func (client ReplicationAlertSettingsClient) Create(ctx context.Context, alertSettingName string, request ConfigureAlertRequest) (result Alert, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, alertSettingName, request) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationAlertSettingsClient) CreatePreparer(ctx context.Context, alertSettingName string, request ConfigureAlertRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertSettingName": autorest.Encode("path", alertSettingName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) CreateResponder(resp *http.Response) (result Alert, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of the specified email notification(alert) configuration. +// Parameters: +// alertSettingName - the name of the email notification configuration. +func (client ReplicationAlertSettingsClient) Get(ctx context.Context, alertSettingName string) (result Alert, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, alertSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationAlertSettingsClient) GetPreparer(ctx context.Context, alertSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertSettingName": autorest.Encode("path", alertSettingName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) GetResponder(resp *http.Response) (result Alert, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of email notification(alert) configurations for the vault. +func (client ReplicationAlertSettingsClient) List(ctx context.Context) (result AlertCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.List") + defer func() { + sc := -1 + if result.ac.Response.Response != nil { + sc = result.ac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", resp, "Failure sending request") + return + } + + result.ac, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "List", resp, "Failure responding to request") + return + } + if result.ac.hasNextLink() && result.ac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationAlertSettingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAlertSettingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationAlertSettingsClient) ListResponder(resp *http.Response) (result AlertCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationAlertSettingsClient) listNextResults(ctx context.Context, lastResults AlertCollection) (result AlertCollection, err error) { + req, err := lastResults.alertCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAlertSettingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationAlertSettingsClient) ListComplete(ctx context.Context) (result AlertCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAlertSettingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationappliances.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationappliances.go new file mode 100644 index 000000000000..002627a5fce5 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationappliances.go @@ -0,0 +1,152 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationAppliancesClient is the client for the ReplicationAppliances methods of the Siterecovery service. +type ReplicationAppliancesClient struct { + BaseClient +} + +// NewReplicationAppliancesClient creates an instance of the ReplicationAppliancesClient client. +func NewReplicationAppliancesClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationAppliancesClient { + return NewReplicationAppliancesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationAppliancesClientWithBaseURI creates an instance of the ReplicationAppliancesClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewReplicationAppliancesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationAppliancesClient { + return ReplicationAppliancesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// List gets the list of Azure Site Recovery appliances for the vault. +// Parameters: +// filter - oData filter options. +func (client ReplicationAppliancesClient) List(ctx context.Context, filter string) (result ApplianceCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAppliancesClient.List") + defer func() { + sc := -1 + if result.ac.Response.Response != nil { + sc = result.ac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "List", resp, "Failure sending request") + return + } + + result.ac, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "List", resp, "Failure responding to request") + return + } + if result.ac.hasNextLink() && result.ac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationAppliancesClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAppliances", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationAppliancesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationAppliancesClient) ListResponder(resp *http.Response) (result ApplianceCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationAppliancesClient) listNextResults(ctx context.Context, lastResults ApplianceCollection) (result ApplianceCollection, err error) { + req, err := lastResults.applianceCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationAppliancesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationAppliancesClient) ListComplete(ctx context.Context, filter string) (result ApplianceCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationAppliancesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationeligibilityresults.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationeligibilityresults.go new file mode 100644 index 000000000000..bfb470f7fde5 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationeligibilityresults.go @@ -0,0 +1,183 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationEligibilityResultsClient is the client for the ReplicationEligibilityResults methods of the Siterecovery +// service. +type ReplicationEligibilityResultsClient struct { + BaseClient +} + +// NewReplicationEligibilityResultsClient creates an instance of the ReplicationEligibilityResultsClient client. +func NewReplicationEligibilityResultsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationEligibilityResultsClient { + return NewReplicationEligibilityResultsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationEligibilityResultsClientWithBaseURI creates an instance of the ReplicationEligibilityResultsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationEligibilityResultsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationEligibilityResultsClient { + return ReplicationEligibilityResultsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get validates whether a given VM can be protected or not in which case returns list of errors. +// Parameters: +// virtualMachineName - virtual Machine name. +func (client ReplicationEligibilityResultsClient) Get(ctx context.Context, virtualMachineName string) (result ReplicationEligibilityResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEligibilityResultsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, virtualMachineName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationEligibilityResultsClient) GetPreparer(ctx context.Context, virtualMachineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineName": autorest.Encode("path", virtualMachineName), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEligibilityResultsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationEligibilityResultsClient) GetResponder(resp *http.Response) (result ReplicationEligibilityResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List validates whether a given VM can be protected or not in which case returns list of errors. +// Parameters: +// virtualMachineName - virtual Machine name. +func (client ReplicationEligibilityResultsClient) List(ctx context.Context, virtualMachineName string) (result ReplicationEligibilityResultsCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEligibilityResultsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, virtualMachineName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEligibilityResultsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationEligibilityResultsClient) ListPreparer(ctx context.Context, virtualMachineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineName": autorest.Encode("path", virtualMachineName), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEligibilityResultsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationEligibilityResultsClient) ListResponder(resp *http.Response) (result ReplicationEligibilityResultsCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationevents.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationevents.go new file mode 100644 index 000000000000..fc9910af6100 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationevents.go @@ -0,0 +1,228 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationEventsClient is the client for the ReplicationEvents methods of the Siterecovery service. +type ReplicationEventsClient struct { + BaseClient +} + +// NewReplicationEventsClient creates an instance of the ReplicationEventsClient client. +func NewReplicationEventsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationEventsClient { + return NewReplicationEventsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationEventsClientWithBaseURI creates an instance of the ReplicationEventsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationEventsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationEventsClient { + return ReplicationEventsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get the operation to get the details of an Azure Site recovery event. +// Parameters: +// eventName - the name of the Azure Site Recovery event. +func (client ReplicationEventsClient) Get(ctx context.Context, eventName string) (result Event, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, eventName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationEventsClient) GetPreparer(ctx context.Context, eventName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "eventName": autorest.Encode("path", eventName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents/{eventName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEventsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationEventsClient) GetResponder(resp *http.Response) (result Event, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of Azure Site Recovery events for the vault. +// Parameters: +// filter - oData filter options. +func (client ReplicationEventsClient) List(ctx context.Context, filter string) (result EventCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.List") + defer func() { + sc := -1 + if result.ec.Response.Response != nil { + sc = result.ec.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ec.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", resp, "Failure sending request") + return + } + + result.ec, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "List", resp, "Failure responding to request") + return + } + if result.ec.hasNextLink() && result.ec.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationEventsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationEventsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationEventsClient) ListResponder(resp *http.Response) (result EventCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationEventsClient) listNextResults(ctx context.Context, lastResults EventCollection) (result EventCollection, err error) { + req, err := lastResults.eventCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationEventsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationEventsClient) ListComplete(ctx context.Context, filter string) (result EventCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationEventsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationfabrics.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationfabrics.go new file mode 100644 index 000000000000..679633f844b9 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationfabrics.go @@ -0,0 +1,786 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationFabricsClient is the client for the ReplicationFabrics methods of the Siterecovery service. +type ReplicationFabricsClient struct { + BaseClient +} + +// NewReplicationFabricsClient creates an instance of the ReplicationFabricsClient client. +func NewReplicationFabricsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationFabricsClient { + return NewReplicationFabricsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationFabricsClientWithBaseURI creates an instance of the ReplicationFabricsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationFabricsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationFabricsClient { + return ReplicationFabricsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// CheckConsistency the operation to perform a consistency check on the fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationFabricsClient) CheckConsistency(ctx context.Context, fabricName string) (result ReplicationFabricsCheckConsistencyFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.CheckConsistency") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CheckConsistencyPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "CheckConsistency", nil, "Failure preparing request") + return + } + + result, err = client.CheckConsistencySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "CheckConsistency", result.Response(), "Failure sending request") + return + } + + return +} + +// CheckConsistencyPreparer prepares the CheckConsistency request. +func (client ReplicationFabricsClient) CheckConsistencyPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/checkConsistency", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckConsistencySender sends the CheckConsistency request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) CheckConsistencySender(req *http.Request) (future ReplicationFabricsCheckConsistencyFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CheckConsistencyResponder handles the response to the CheckConsistency request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) CheckConsistencyResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Create the operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). +// Parameters: +// fabricName - name of the ASR fabric. +// input - fabric creation input. +func (client ReplicationFabricsClient) Create(ctx context.Context, fabricName string, input FabricCreationInput) (result ReplicationFabricsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationFabricsClient) CreatePreparer(ctx context.Context, fabricName string, input FabricCreationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) CreateSender(req *http.Request) (future ReplicationFabricsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) CreateResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete or remove an Azure Site Recovery fabric. +// Parameters: +// fabricName - ASR fabric to delete. +func (client ReplicationFabricsClient) Delete(ctx context.Context, fabricName string) (result ReplicationFabricsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationFabricsClient) DeletePreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) DeleteSender(req *http.Request) (future ReplicationFabricsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of an Azure Site Recovery fabric. +// Parameters: +// fabricName - fabric name. +// filter - oData filter options. +func (client ReplicationFabricsClient) Get(ctx context.Context, fabricName string, filter string) (result Fabric, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationFabricsClient) GetPreparer(ctx context.Context, fabricName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) GetResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of the Azure Site Recovery fabrics in the vault. +func (client ReplicationFabricsClient) List(ctx context.Context) (result FabricCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.List") + defer func() { + sc := -1 + if result.fc.Response.Response != nil { + sc = result.fc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.fc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", resp, "Failure sending request") + return + } + + result.fc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "List", resp, "Failure responding to request") + return + } + if result.fc.hasNextLink() && result.fc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationFabricsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) ListResponder(resp *http.Response) (result FabricCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationFabricsClient) listNextResults(ctx context.Context, lastResults FabricCollection) (result FabricCollection, err error) { + req, err := lastResults.fabricCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationFabricsClient) ListComplete(ctx context.Context) (result FabricCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// MigrateToAad the operation to migrate an Azure Site Recovery fabric to AAD. +// Parameters: +// fabricName - ASR fabric to migrate. +func (client ReplicationFabricsClient) MigrateToAad(ctx context.Context, fabricName string) (result ReplicationFabricsMigrateToAadFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.MigrateToAad") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.MigrateToAadPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "MigrateToAad", nil, "Failure preparing request") + return + } + + result, err = client.MigrateToAadSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "MigrateToAad", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateToAadPreparer prepares the MigrateToAad request. +func (client ReplicationFabricsClient) MigrateToAadPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/migratetoaad", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateToAadSender sends the MigrateToAad request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) MigrateToAadSender(req *http.Request) (future ReplicationFabricsMigrateToAadFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateToAadResponder handles the response to the MigrateToAad request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) MigrateToAadResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Purge the operation to purge(force delete) an Azure Site Recovery fabric. +// Parameters: +// fabricName - ASR fabric to purge. +func (client ReplicationFabricsClient) Purge(ctx context.Context, fabricName string) (result ReplicationFabricsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationFabricsClient) PurgePreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) PurgeSender(req *http.Request) (future ReplicationFabricsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// ReassociateGateway the operation to move replications from a process server to another process server. +// Parameters: +// fabricName - the name of the fabric containing the process server. +// failoverProcessServerRequest - the input to the failover process server operation. +func (client ReplicationFabricsClient) ReassociateGateway(ctx context.Context, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest) (result ReplicationFabricsReassociateGatewayFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.ReassociateGateway") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReassociateGatewayPreparer(ctx, fabricName, failoverProcessServerRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "ReassociateGateway", nil, "Failure preparing request") + return + } + + result, err = client.ReassociateGatewaySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "ReassociateGateway", result.Response(), "Failure sending request") + return + } + + return +} + +// ReassociateGatewayPreparer prepares the ReassociateGateway request. +func (client ReplicationFabricsClient) ReassociateGatewayPreparer(ctx context.Context, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/reassociateGateway", pathParameters), + autorest.WithJSON(failoverProcessServerRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReassociateGatewaySender sends the ReassociateGateway request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) ReassociateGatewaySender(req *http.Request) (future ReplicationFabricsReassociateGatewayFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReassociateGatewayResponder handles the response to the ReassociateGateway request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) ReassociateGatewayResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RenewCertificate renews the connection certificate for the ASR replication fabric. +// Parameters: +// fabricName - fabric name to renew certs for. +// renewCertificate - renew certificate input. +func (client ReplicationFabricsClient) RenewCertificate(ctx context.Context, fabricName string, renewCertificate RenewCertificateInput) (result ReplicationFabricsRenewCertificateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationFabricsClient.RenewCertificate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RenewCertificatePreparer(ctx, fabricName, renewCertificate) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "RenewCertificate", nil, "Failure preparing request") + return + } + + result, err = client.RenewCertificateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationFabricsClient", "RenewCertificate", result.Response(), "Failure sending request") + return + } + + return +} + +// RenewCertificatePreparer prepares the RenewCertificate request. +func (client ReplicationFabricsClient) RenewCertificatePreparer(ctx context.Context, fabricName string, renewCertificate RenewCertificateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/renewCertificate", pathParameters), + autorest.WithJSON(renewCertificate), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RenewCertificateSender sends the RenewCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationFabricsClient) RenewCertificateSender(req *http.Request) (future ReplicationFabricsRenewCertificateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RenewCertificateResponder handles the response to the RenewCertificate request. The method always +// closes the http.Response Body. +func (client ReplicationFabricsClient) RenewCertificateResponder(resp *http.Response) (result Fabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationjobs.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationjobs.go new file mode 100644 index 000000000000..7cfaf14d5138 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationjobs.go @@ -0,0 +1,547 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationJobsClient is the client for the ReplicationJobs methods of the Siterecovery service. +type ReplicationJobsClient struct { + BaseClient +} + +// NewReplicationJobsClient creates an instance of the ReplicationJobsClient client. +func NewReplicationJobsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationJobsClient { + return NewReplicationJobsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationJobsClientWithBaseURI creates an instance of the ReplicationJobsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationJobsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationJobsClient { + return ReplicationJobsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Cancel the operation to cancel an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Cancel(ctx context.Context, jobName string) (result ReplicationJobsCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Cancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CancelPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Cancel", nil, "Failure preparing request") + return + } + + result, err = client.CancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Cancel", result.Response(), "Failure sending request") + return + } + + return +} + +// CancelPreparer prepares the Cancel request. +func (client ReplicationJobsClient) CancelPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/cancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CancelSender sends the Cancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) CancelSender(req *http.Request) (future ReplicationJobsCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CancelResponder handles the response to the Cancel request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) CancelResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Export the operation to export the details of the Azure Site Recovery jobs of the vault. +// Parameters: +// jobQueryParameter - job query filter. +func (client ReplicationJobsClient) Export(ctx context.Context, jobQueryParameter JobQueryParameter) (result ReplicationJobsExportFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Export") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ExportPreparer(ctx, jobQueryParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Export", nil, "Failure preparing request") + return + } + + result, err = client.ExportSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Export", result.Response(), "Failure sending request") + return + } + + return +} + +// ExportPreparer prepares the Export request. +func (client ReplicationJobsClient) ExportPreparer(ctx context.Context, jobQueryParameter JobQueryParameter) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/export", pathParameters), + autorest.WithJSON(jobQueryParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExportSender sends the Export request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ExportSender(req *http.Request) (future ReplicationJobsExportFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ExportResponder handles the response to the Export request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ExportResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get the details of an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Get(ctx context.Context, jobName string) (result Job, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationJobsClient) GetPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) GetResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of Azure Site Recovery Jobs for the vault. +// Parameters: +// filter - oData filter options. +func (client ReplicationJobsClient) List(ctx context.Context, filter string) (result JobCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.List") + defer func() { + sc := -1 + if result.jc.Response.Response != nil { + sc = result.jc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.jc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", resp, "Failure sending request") + return + } + + result.jc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "List", resp, "Failure responding to request") + return + } + if result.jc.hasNextLink() && result.jc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationJobsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ListResponder(resp *http.Response) (result JobCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationJobsClient) listNextResults(ctx context.Context, lastResults JobCollection) (result JobCollection, err error) { + req, err := lastResults.jobCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationJobsClient) ListComplete(ctx context.Context, filter string) (result JobCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} + +// Restart the operation to restart an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +func (client ReplicationJobsClient) Restart(ctx context.Context, jobName string) (result ReplicationJobsRestartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Restart") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RestartPreparer(ctx, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Restart", nil, "Failure preparing request") + return + } + + result, err = client.RestartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Restart", result.Response(), "Failure sending request") + return + } + + return +} + +// RestartPreparer prepares the Restart request. +func (client ReplicationJobsClient) RestartPreparer(ctx context.Context, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartSender sends the Restart request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) RestartSender(req *http.Request) (future ReplicationJobsRestartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestartResponder handles the response to the Restart request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) RestartResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Resume the operation to resume an Azure Site Recovery job. +// Parameters: +// jobName - job identifier. +// resumeJobParams - resume rob comments. +func (client ReplicationJobsClient) Resume(ctx context.Context, jobName string, resumeJobParams ResumeJobParams) (result ReplicationJobsResumeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationJobsClient.Resume") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResumePreparer(ctx, jobName, resumeJobParams) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Resume", nil, "Failure preparing request") + return + } + + result, err = client.ResumeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationJobsClient", "Resume", result.Response(), "Failure sending request") + return + } + + return +} + +// ResumePreparer prepares the Resume request. +func (client ReplicationJobsClient) ResumePreparer(ctx context.Context, jobName string, resumeJobParams ResumeJobParams) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/resume", pathParameters), + autorest.WithJSON(resumeJobParams), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResumeSender sends the Resume request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationJobsClient) ResumeSender(req *http.Request) (future ReplicationJobsResumeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResumeResponder handles the response to the Resume request. The method always +// closes the http.Response Body. +func (client ReplicationJobsClient) ResumeResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationlogicalnetworks.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationlogicalnetworks.go new file mode 100644 index 000000000000..efd2466eef20 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationlogicalnetworks.go @@ -0,0 +1,229 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationLogicalNetworksClient is the client for the ReplicationLogicalNetworks methods of the Siterecovery +// service. +type ReplicationLogicalNetworksClient struct { + BaseClient +} + +// NewReplicationLogicalNetworksClient creates an instance of the ReplicationLogicalNetworksClient client. +func NewReplicationLogicalNetworksClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationLogicalNetworksClient { + return NewReplicationLogicalNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationLogicalNetworksClientWithBaseURI creates an instance of the ReplicationLogicalNetworksClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationLogicalNetworksClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationLogicalNetworksClient { + return ReplicationLogicalNetworksClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of a logical network. +// Parameters: +// fabricName - server Id. +// logicalNetworkName - logical network name. +func (client ReplicationLogicalNetworksClient) Get(ctx context.Context, fabricName string, logicalNetworkName string) (result LogicalNetwork, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, logicalNetworkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationLogicalNetworksClient) GetPreparer(ctx context.Context, fabricName string, logicalNetworkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "logicalNetworkName": autorest.Encode("path", logicalNetworkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks/{logicalNetworkName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationLogicalNetworksClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationLogicalNetworksClient) GetResponder(resp *http.Response) (result LogicalNetwork, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationFabrics lists all the logical networks of the Azure Site Recovery fabric. +// Parameters: +// fabricName - server Id. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result LogicalNetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.lnc.Response.Response != nil { + sc = result.lnc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.lnc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.lnc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.lnc.hasNextLink() && result.lnc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsResponder(resp *http.Response) (result LogicalNetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationLogicalNetworksClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults LogicalNetworkCollection) (result LogicalNetworkCollection, err error) { + req, err := lastResults.logicalNetworkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationLogicalNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationLogicalNetworksClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result LogicalNetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLogicalNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationmigrationitems.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationmigrationitems.go new file mode 100644 index 000000000000..16d9159c438e --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationmigrationitems.go @@ -0,0 +1,1009 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationMigrationItemsClient is the client for the ReplicationMigrationItems methods of the Siterecovery service. +type ReplicationMigrationItemsClient struct { + BaseClient +} + +// NewReplicationMigrationItemsClient creates an instance of the ReplicationMigrationItemsClient client. +func NewReplicationMigrationItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationMigrationItemsClient { + return NewReplicationMigrationItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationMigrationItemsClientWithBaseURI creates an instance of the ReplicationMigrationItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationMigrationItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationMigrationItemsClient { + return ReplicationMigrationItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR migration item (enable migration). +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - enable migration input. +func (client ReplicationMigrationItemsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input EnableMigrationInput) (result ReplicationMigrationItemsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.PolicyID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationMigrationItemsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input EnableMigrationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) CreateSender(req *http.Request) (future ReplicationMigrationItemsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) CreateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// deleteOption - the delete option. +func (client ReplicationMigrationItemsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (result ReplicationMigrationItemsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, migrationItemName, deleteOption) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationMigrationItemsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(deleteOption) > 0 { + queryParameters["deleteOption"] = autorest.Encode("query", deleteOption) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) DeleteSender(req *http.Request) (future ReplicationMigrationItemsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get sends the get request. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +func (client ReplicationMigrationItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result MigrationItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, migrationItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationMigrationItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) GetResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List sends the list request. +// Parameters: +// skipToken - the pagination token. +// takeToken - the page size. +// filter - oData filter options. +func (client ReplicationMigrationItemsClient) List(ctx context.Context, skipToken string, takeToken string, filter string) (result MigrationItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.List") + defer func() { + sc := -1 + if result.mic.Response.Response != nil { + sc = result.mic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, takeToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.mic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", resp, "Failure sending request") + return + } + + result.mic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "List", resp, "Failure responding to request") + return + } + if result.mic.hasNextLink() && result.mic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationMigrationItemsClient) ListPreparer(ctx context.Context, skipToken string, takeToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationMigrationItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ListResponder(resp *http.Response) (result MigrationItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationMigrationItemsClient) listNextResults(ctx context.Context, lastResults MigrationItemCollection) (result MigrationItemCollection, err error) { + req, err := lastResults.migrationItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationMigrationItemsClient) ListComplete(ctx context.Context, skipToken string, takeToken string, filter string) (result MigrationItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, takeToken, filter) + return +} + +// ListByReplicationProtectionContainers gets the list of ASR migration items in the protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// skipToken - the pagination token. +// takeToken - the page size. +// filter - oData filter options. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result MigrationItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.mic.Response.Response != nil { + sc = result.mic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName, skipToken, takeToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.mic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.mic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.mic.hasNextLink() && result.mic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result MigrationItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationMigrationItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults MigrationItemCollection) (result MigrationItemCollection, err error) { + req, err := lastResults.migrationItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationMigrationItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result MigrationItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName, skipToken, takeToken, filter) + return +} + +// Migrate the operation to initiate migration of the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// migrateInput - migrate input. +func (client ReplicationMigrationItemsClient) Migrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput MigrateInput) (result ReplicationMigrationItemsMigrateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Migrate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: migrateInput, + Constraints: []validation.Constraint{{Target: "migrateInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Migrate", err.Error()) + } + + req, err := client.MigratePreparer(ctx, fabricName, protectionContainerName, migrationItemName, migrateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Migrate", nil, "Failure preparing request") + return + } + + result, err = client.MigrateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Migrate", result.Response(), "Failure sending request") + return + } + + return +} + +// MigratePreparer prepares the Migrate request. +func (client ReplicationMigrationItemsClient) MigratePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput MigrateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrate", pathParameters), + autorest.WithJSON(migrateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateSender sends the Migrate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) MigrateSender(req *http.Request) (future ReplicationMigrationItemsMigrateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateResponder handles the response to the Migrate request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) MigrateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Resync the operation to resynchronize replication of an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - resync input. +func (client ReplicationMigrationItemsClient) Resync(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input ResyncInput) (result ReplicationMigrationItemsResyncFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Resync") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "Resync", err.Error()) + } + + req, err := client.ResyncPreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Resync", nil, "Failure preparing request") + return + } + + result, err = client.ResyncSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Resync", result.Response(), "Failure sending request") + return + } + + return +} + +// ResyncPreparer prepares the Resync request. +func (client ReplicationMigrationItemsClient) ResyncPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input ResyncInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/resync", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResyncSender sends the Resync request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) ResyncSender(req *http.Request) (future ReplicationMigrationItemsResyncFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResyncResponder handles the response to the Resync request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) ResyncResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestMigrate the operation to initiate test migration of the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// testMigrateInput - test migrate input. +func (client ReplicationMigrationItemsClient) TestMigrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput TestMigrateInput) (result ReplicationMigrationItemsTestMigrateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.TestMigrate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testMigrateInput, + Constraints: []validation.Constraint{{Target: "testMigrateInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "TestMigrate", err.Error()) + } + + req, err := client.TestMigratePreparer(ctx, fabricName, protectionContainerName, migrationItemName, testMigrateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrate", nil, "Failure preparing request") + return + } + + result, err = client.TestMigrateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrate", result.Response(), "Failure sending request") + return + } + + return +} + +// TestMigratePreparer prepares the TestMigrate request. +func (client ReplicationMigrationItemsClient) TestMigratePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput TestMigrateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrate", pathParameters), + autorest.WithJSON(testMigrateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestMigrateSender sends the TestMigrate request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) TestMigrateSender(req *http.Request) (future ReplicationMigrationItemsTestMigrateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestMigrateResponder handles the response to the TestMigrate request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) TestMigrateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestMigrateCleanup the operation to initiate test migrate cleanup. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// testMigrateCleanupInput - test migrate cleanup input. +func (client ReplicationMigrationItemsClient) TestMigrateCleanup(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput TestMigrateCleanupInput) (result ReplicationMigrationItemsTestMigrateCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.TestMigrateCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testMigrateCleanupInput, + Constraints: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "testMigrateCleanupInput.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", err.Error()) + } + + req, err := client.TestMigrateCleanupPreparer(ctx, fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestMigrateCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "TestMigrateCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestMigrateCleanupPreparer prepares the TestMigrateCleanup request. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupPreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput TestMigrateCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrateCleanup", pathParameters), + autorest.WithJSON(testMigrateCleanupInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestMigrateCleanupSender sends the TestMigrateCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupSender(req *http.Request) (future ReplicationMigrationItemsTestMigrateCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestMigrateCleanupResponder handles the response to the TestMigrateCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) TestMigrateCleanupResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update the recovery settings of an ASR migration item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// migrationItemName - migration item name. +// input - update migration item input. +func (client ReplicationMigrationItemsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input UpdateMigrationItemInput) (result ReplicationMigrationItemsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationMigrationItemsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, migrationItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationMigrationItemsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationMigrationItemsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input UpdateMigrationItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "migrationItemName": autorest.Encode("path", migrationItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationMigrationItemsClient) UpdateSender(req *http.Request) (future ReplicationMigrationItemsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationMigrationItemsClient) UpdateResponder(resp *http.Response) (result MigrationItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationnetworkmappings.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationnetworkmappings.go new file mode 100644 index 000000000000..3f6d8b1320bc --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationnetworkmappings.go @@ -0,0 +1,610 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationNetworkMappingsClient is the client for the ReplicationNetworkMappings methods of the Siterecovery +// service. +type ReplicationNetworkMappingsClient struct { + BaseClient +} + +// NewReplicationNetworkMappingsClient creates an instance of the ReplicationNetworkMappingsClient client. +func NewReplicationNetworkMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworkMappingsClient { + return NewReplicationNetworkMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationNetworkMappingsClientWithBaseURI creates an instance of the ReplicationNetworkMappingsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationNetworkMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworkMappingsClient { + return ReplicationNetworkMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +// input - create network mapping input. +func (client ReplicationNetworkMappingsClient) Create(ctx context.Context, fabricName string, networkName string, networkMappingName string, input CreateNetworkMappingInput) (result ReplicationNetworkMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.RecoveryNetworkID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationNetworkMappingsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, networkName, networkMappingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationNetworkMappingsClient) CreatePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string, input CreateNetworkMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) CreateSender(req *http.Request) (future ReplicationNetworkMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) CreateResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - ARM Resource Name for network mapping. +func (client ReplicationNetworkMappingsClient) Delete(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result ReplicationNetworkMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, networkName, networkMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationNetworkMappingsClient) DeletePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) DeleteSender(req *http.Request) (future ReplicationNetworkMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +func (client ReplicationNetworkMappingsClient) Get(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result NetworkMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, networkName, networkMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationNetworkMappingsClient) GetPreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) GetResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all ASR network mappings in the vault. +func (client ReplicationNetworkMappingsClient) List(ctx context.Context) (result NetworkMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.List") + defer func() { + sc := -1 + if result.nmc.Response.Response != nil { + sc = result.nmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.nmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", resp, "Failure sending request") + return + } + + result.nmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.nmc.hasNextLink() && result.nmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationNetworkMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationNetworkMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) ListResponder(resp *http.Response) (result NetworkMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationNetworkMappingsClient) listNextResults(ctx context.Context, lastResults NetworkMappingCollection) (result NetworkMappingCollection, err error) { + req, err := lastResults.networkMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworkMappingsClient) ListComplete(ctx context.Context) (result NetworkMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationNetworks lists all ASR network mappings for the specified network. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworks(ctx context.Context, fabricName string, networkName string) (result NetworkMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.ListByReplicationNetworks") + defer func() { + sc := -1 + if result.nmc.Response.Response != nil { + sc = result.nmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationNetworksNextResults + req, err := client.ListByReplicationNetworksPreparer(ctx, fabricName, networkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationNetworksSender(req) + if err != nil { + result.nmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", resp, "Failure sending request") + return + } + + result.nmc, err = client.ListByReplicationNetworksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "ListByReplicationNetworks", resp, "Failure responding to request") + return + } + if result.nmc.hasNextLink() && result.nmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationNetworksPreparer prepares the ListByReplicationNetworks request. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksPreparer(ctx context.Context, fabricName string, networkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationNetworksSender sends the ListByReplicationNetworks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationNetworksResponder handles the response to the ListByReplicationNetworks request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksResponder(resp *http.Response) (result NetworkMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationNetworksNextResults retrieves the next set of results, if any. +func (client ReplicationNetworkMappingsClient) listByReplicationNetworksNextResults(ctx context.Context, lastResults NetworkMappingCollection) (result NetworkMappingCollection, err error) { + req, err := lastResults.networkMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationNetworksSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationNetworksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "listByReplicationNetworksNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationNetworksComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworkMappingsClient) ListByReplicationNetworksComplete(ctx context.Context, fabricName string, networkName string) (result NetworkMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.ListByReplicationNetworks") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationNetworks(ctx, fabricName, networkName) + return +} + +// Update the operation to update an ASR network mapping. +// Parameters: +// fabricName - primary fabric name. +// networkName - primary network name. +// networkMappingName - network mapping name. +// input - update network mapping input. +func (client ReplicationNetworkMappingsClient) Update(ctx context.Context, fabricName string, networkName string, networkMappingName string, input UpdateNetworkMappingInput) (result ReplicationNetworkMappingsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworkMappingsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, networkName, networkMappingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworkMappingsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationNetworkMappingsClient) UpdatePreparer(ctx context.Context, fabricName string, networkName string, networkMappingName string, input UpdateNetworkMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkMappingName": autorest.Encode("path", networkMappingName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworkMappingsClient) UpdateSender(req *http.Request) (future ReplicationNetworkMappingsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationNetworkMappingsClient) UpdateResponder(resp *http.Response) (result NetworkMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationnetworks.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationnetworks.go new file mode 100644 index 000000000000..bdac27aca1e4 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationnetworks.go @@ -0,0 +1,343 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationNetworksClient is the client for the ReplicationNetworks methods of the Siterecovery service. +type ReplicationNetworksClient struct { + BaseClient +} + +// NewReplicationNetworksClient creates an instance of the ReplicationNetworksClient client. +func NewReplicationNetworksClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworksClient { + return NewReplicationNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationNetworksClientWithBaseURI creates an instance of the ReplicationNetworksClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationNetworksClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationNetworksClient { + return ReplicationNetworksClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of a network. +// Parameters: +// fabricName - server Id. +// networkName - primary network name. +func (client ReplicationNetworksClient) Get(ctx context.Context, fabricName string, networkName string) (result Network, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, networkName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationNetworksClient) GetPreparer(ctx context.Context, fabricName string, networkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "networkName": autorest.Encode("path", networkName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) GetResponder(resp *http.Response) (result Network, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the networks available in a vault. +func (client ReplicationNetworksClient) List(ctx context.Context) (result NetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.List") + defer func() { + sc := -1 + if result.nc.Response.Response != nil { + sc = result.nc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.nc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", resp, "Failure sending request") + return + } + + result.nc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "List", resp, "Failure responding to request") + return + } + if result.nc.hasNextLink() && result.nc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationNetworksClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) ListResponder(resp *http.Response) (result NetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationNetworksClient) listNextResults(ctx context.Context, lastResults NetworkCollection) (result NetworkCollection, err error) { + req, err := lastResults.networkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworksClient) ListComplete(ctx context.Context) (result NetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the networks available for a fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationNetworksClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result NetworkCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.nc.Response.Response != nil { + sc = result.nc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.nc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.nc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.nc.hasNextLink() && result.nc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationNetworksClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationNetworksClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationNetworksClient) ListByReplicationFabricsResponder(resp *http.Response) (result NetworkCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationNetworksClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults NetworkCollection) (result NetworkCollection, err error) { + req, err := lastResults.networkCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationNetworksClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationNetworksClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result NetworkCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationNetworksClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationpolicies.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationpolicies.go new file mode 100644 index 000000000000..fbddce9819a2 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationpolicies.go @@ -0,0 +1,465 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationPoliciesClient is the client for the ReplicationPolicies methods of the Siterecovery service. +type ReplicationPoliciesClient struct { + BaseClient +} + +// NewReplicationPoliciesClient creates an instance of the ReplicationPoliciesClient client. +func NewReplicationPoliciesClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationPoliciesClient { + return NewReplicationPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationPoliciesClientWithBaseURI creates an instance of the ReplicationPoliciesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationPoliciesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationPoliciesClient { + return ReplicationPoliciesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a replication policy. +// Parameters: +// policyName - replication policy name. +// input - create policy input. +func (client ReplicationPoliciesClient) Create(ctx context.Context, policyName string, input CreatePolicyInput) (result ReplicationPoliciesCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, policyName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationPoliciesClient) CreatePreparer(ctx context.Context, policyName string, input CreatePolicyInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) CreateSender(req *http.Request) (future ReplicationPoliciesCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) CreateResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a replication policy. +// Parameters: +// policyName - replication policy name. +func (client ReplicationPoliciesClient) Delete(ctx context.Context, policyName string) (result ReplicationPoliciesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationPoliciesClient) DeletePreparer(ctx context.Context, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) DeleteSender(req *http.Request) (future ReplicationPoliciesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a replication policy. +// Parameters: +// policyName - replication policy name. +func (client ReplicationPoliciesClient) Get(ctx context.Context, policyName string) (result Policy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationPoliciesClient) GetPreparer(ctx context.Context, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) GetResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the replication policies for a vault. +func (client ReplicationPoliciesClient) List(ctx context.Context) (result PolicyCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.List") + defer func() { + sc := -1 + if result.pc.Response.Response != nil { + sc = result.pc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", resp, "Failure sending request") + return + } + + result.pc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "List", resp, "Failure responding to request") + return + } + if result.pc.hasNextLink() && result.pc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationPoliciesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) ListResponder(resp *http.Response) (result PolicyCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationPoliciesClient) listNextResults(ctx context.Context, lastResults PolicyCollection) (result PolicyCollection, err error) { + req, err := lastResults.policyCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationPoliciesClient) ListComplete(ctx context.Context) (result PolicyCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// Update the operation to update a replication policy. +// Parameters: +// policyName - policy Id. +// input - update Policy Input. +func (client ReplicationPoliciesClient) Update(ctx context.Context, policyName string, input UpdatePolicyInput) (result ReplicationPoliciesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationPoliciesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, policyName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationPoliciesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationPoliciesClient) UpdatePreparer(ctx context.Context, policyName string, input UpdatePolicyInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationPoliciesClient) UpdateSender(req *http.Request) (future ReplicationPoliciesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationPoliciesClient) UpdateResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationprotectableitems.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationprotectableitems.go new file mode 100644 index 000000000000..e79f98b2a45e --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationprotectableitems.go @@ -0,0 +1,245 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectableItemsClient is the client for the ReplicationProtectableItems methods of the Siterecovery +// service. +type ReplicationProtectableItemsClient struct { + BaseClient +} + +// NewReplicationProtectableItemsClient creates an instance of the ReplicationProtectableItemsClient client. +func NewReplicationProtectableItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectableItemsClient { + return NewReplicationProtectableItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectableItemsClientWithBaseURI creates an instance of the ReplicationProtectableItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationProtectableItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectableItemsClient { + return ReplicationProtectableItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get the operation to get the details of a protectable item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// protectableItemName - protectable item name. +func (client ReplicationProtectableItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (result ProtectableItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, protectableItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectableItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectableItemName": autorest.Encode("path", protectableItemName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems/{protectableItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectableItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectableItemsClient) GetResponder(resp *http.Response) (result ProtectableItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByReplicationProtectionContainers lists the protectable items in a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// filter - oData filter options. +// take - take OData query parameter. +// skipToken - skipToken OData query parameter. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result ProtectableItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.pic.Response.Response != nil { + sc = result.pic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName, filter, take, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.pic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.pic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.pic.hasNextLink() && result.pic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(take) > 0 { + queryParameters["$take"] = autorest.Encode("query", take) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ProtectableItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectableItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ProtectableItemCollection) (result ProtectableItemCollection, err error) { + req, err := lastResults.protectableItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectableItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectableItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result ProtectableItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectableItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName, filter, take, skipToken) + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationprotecteditems.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationprotecteditems.go new file mode 100644 index 000000000000..5c90e10ec4fc --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationprotecteditems.go @@ -0,0 +1,2021 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectedItemsClient is the client for the ReplicationProtectedItems methods of the Siterecovery service. +type ReplicationProtectedItemsClient struct { + BaseClient +} + +// NewReplicationProtectedItemsClient creates an instance of the ReplicationProtectedItemsClient client. +func NewReplicationProtectedItemsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectedItemsClient { + return NewReplicationProtectedItemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectedItemsClientWithBaseURI creates an instance of the ReplicationProtectedItemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationProtectedItemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectedItemsClient { + return ReplicationProtectedItemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// AddDisks operation to add disks(s) to the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// addDisksInput - add disks input. +func (client ReplicationProtectedItemsClient) AddDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput AddDisksInput) (result ReplicationProtectedItemsAddDisksFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.AddDisks") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddDisksPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, addDisksInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "AddDisks", nil, "Failure preparing request") + return + } + + result, err = client.AddDisksSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "AddDisks", result.Response(), "Failure sending request") + return + } + + return +} + +// AddDisksPreparer prepares the AddDisks request. +func (client ReplicationProtectedItemsClient) AddDisksPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput AddDisksInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/addDisks", pathParameters), + autorest.WithJSON(addDisksInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddDisksSender sends the AddDisks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) AddDisksSender(req *http.Request) (future ReplicationProtectedItemsAddDisksFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// AddDisksResponder handles the response to the AddDisks request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) AddDisksResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ApplyRecoveryPoint the operation to change the recovery point of a failed over replication protected item. +// Parameters: +// fabricName - the ARM fabric name. +// protectionContainerName - the protection container name. +// replicatedProtectedItemName - the replicated protected item name. +// applyRecoveryPointInput - the ApplyRecoveryPointInput. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPoint(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput ApplyRecoveryPointInput) (result ReplicationProtectedItemsApplyRecoveryPointFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ApplyRecoveryPoint") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: applyRecoveryPointInput, + Constraints: []validation.Constraint{{Target: "applyRecoveryPointInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", err.Error()) + } + + req, err := client.ApplyRecoveryPointPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, applyRecoveryPointInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", nil, "Failure preparing request") + return + } + + result, err = client.ApplyRecoveryPointSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ApplyRecoveryPoint", result.Response(), "Failure sending request") + return + } + + return +} + +// ApplyRecoveryPointPreparer prepares the ApplyRecoveryPoint request. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput ApplyRecoveryPointInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/applyRecoveryPoint", pathParameters), + autorest.WithJSON(applyRecoveryPointInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ApplyRecoveryPointSender sends the ApplyRecoveryPoint request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointSender(req *http.Request) (future ReplicationProtectedItemsApplyRecoveryPointFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ApplyRecoveryPointResponder handles the response to the ApplyRecoveryPoint request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ApplyRecoveryPointResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Create the operation to create an ASR replication protected item (Enable replication). +// Parameters: +// fabricName - name of the fabric. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - a name for the replication protected item. +// input - enable Protection Input. +func (client ReplicationProtectedItemsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input EnableProtectionInput) (result ReplicationProtectedItemsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectedItemsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input EnableProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) CreateSender(req *http.Request) (future ReplicationProtectedItemsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) CreateResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to disable replication on a replication protected item. This will also remove the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// disableProtectionInput - disable protection input. +func (client ReplicationProtectedItemsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput DisableProtectionInput) (result ReplicationProtectedItemsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: disableProtectionInput, + Constraints: []validation.Constraint{{Target: "disableProtectionInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, disableProtectionInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectedItemsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput DisableProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/remove", pathParameters), + autorest.WithJSON(disableProtectionInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) DeleteSender(req *http.Request) (future ReplicationProtectedItemsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// FailoverCancel operation to cancel the failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) FailoverCancel(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsFailoverCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.FailoverCancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCancelPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCancel", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCancel", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCancelPreparer prepares the FailoverCancel request. +func (client ReplicationProtectedItemsClient) FailoverCancelPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCancelSender sends the FailoverCancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) FailoverCancelSender(req *http.Request) (future ReplicationProtectedItemsFailoverCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCancelResponder handles the response to the FailoverCancel request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) FailoverCancelResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// FailoverCommit operation to commit the failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) FailoverCommit(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsFailoverCommitFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.FailoverCommit") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCommitPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCommit", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCommitSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "FailoverCommit", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCommitPreparer prepares the FailoverCommit request. +func (client ReplicationProtectedItemsClient) FailoverCommitPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCommit", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCommitSender sends the FailoverCommit request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) FailoverCommitSender(req *http.Request) (future ReplicationProtectedItemsFailoverCommitFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCommitResponder handles the response to the FailoverCommit request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) FailoverCommitResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of an ASR replication protected item. +// Parameters: +// fabricName - fabric unique name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectedItemsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) GetResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of ASR replication protected items in the vault. +// Parameters: +// skipToken - the pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. +// filter - oData filter options. +func (client ReplicationProtectedItemsClient) List(ctx context.Context, skipToken string, filter string) (result ReplicationProtectedItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.List") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "List", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectedItemsClient) ListPreparer(ctx context.Context, skipToken string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectedItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ListResponder(resp *http.Response) (result ReplicationProtectedItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectedItemsClient) listNextResults(ctx context.Context, lastResults ReplicationProtectedItemCollection) (result ReplicationProtectedItemCollection, err error) { + req, err := lastResults.replicationProtectedItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectedItemsClient) ListComplete(ctx context.Context, skipToken string, filter string) (result ReplicationProtectedItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, filter) + return +} + +// ListByReplicationProtectionContainers gets the list of ASR replication protected items in the protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectedItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ReplicationProtectedItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectedItemsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ReplicationProtectedItemCollection) (result ReplicationProtectedItemCollection, err error) { + req, err := lastResults.replicationProtectedItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectedItemsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectedItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName) + return +} + +// PlannedFailover operation to initiate a planned failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// failoverInput - planned failover input. +func (client ReplicationProtectedItemsClient) PlannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput PlannedFailoverInput) (result ReplicationProtectedItemsPlannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.PlannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PlannedFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "PlannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.PlannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "PlannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// PlannedFailoverPreparer prepares the PlannedFailover request. +func (client ReplicationProtectedItemsClient) PlannedFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput PlannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/plannedFailover", pathParameters), + autorest.WithJSON(failoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PlannedFailoverSender sends the PlannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) PlannedFailoverSender(req *http.Request) (future ReplicationProtectedItemsPlannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PlannedFailoverResponder handles the response to the PlannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) PlannedFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Purge the operation to delete or purge a replication protected item. This operation will force delete the +// replication protected item. Use the remove operation on replication protected item to perform a clean disable +// replication for the item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client ReplicationProtectedItemsClient) Purge(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationProtectedItemsClient) PurgePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) PurgeSender(req *http.Request) (future ReplicationProtectedItemsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RemoveDisks operation to remove disk(s) from the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// removeDisksInput - remove disks input. +func (client ReplicationProtectedItemsClient) RemoveDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput RemoveDisksInput) (result ReplicationProtectedItemsRemoveDisksFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.RemoveDisks") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RemoveDisksPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, removeDisksInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RemoveDisks", nil, "Failure preparing request") + return + } + + result, err = client.RemoveDisksSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RemoveDisks", result.Response(), "Failure sending request") + return + } + + return +} + +// RemoveDisksPreparer prepares the RemoveDisks request. +func (client ReplicationProtectedItemsClient) RemoveDisksPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput RemoveDisksInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/removeDisks", pathParameters), + autorest.WithJSON(removeDisksInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RemoveDisksSender sends the RemoveDisks request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) RemoveDisksSender(req *http.Request) (future ReplicationProtectedItemsRemoveDisksFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RemoveDisksResponder handles the response to the RemoveDisks request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) RemoveDisksResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RepairReplication the operation to start resynchronize/repair replication for a replication protected item requiring +// resynchronization. +// Parameters: +// fabricName - the name of the fabric. +// protectionContainerName - the name of the container. +// replicatedProtectedItemName - the name of the replication protected item. +func (client ReplicationProtectedItemsClient) RepairReplication(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result ReplicationProtectedItemsRepairReplicationFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.RepairReplication") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RepairReplicationPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RepairReplication", nil, "Failure preparing request") + return + } + + result, err = client.RepairReplicationSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "RepairReplication", result.Response(), "Failure sending request") + return + } + + return +} + +// RepairReplicationPreparer prepares the RepairReplication request. +func (client ReplicationProtectedItemsClient) RepairReplicationPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/repairReplication", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RepairReplicationSender sends the RepairReplication request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) RepairReplicationSender(req *http.Request) (future ReplicationProtectedItemsRepairReplicationFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RepairReplicationResponder handles the response to the RepairReplication request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) RepairReplicationResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Reprotect operation to reprotect or reverse replicate a failed over replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// reprotectInput - reverse replication input. +func (client ReplicationProtectedItemsClient) Reprotect(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput ReverseReplicationInput) (result ReplicationProtectedItemsReprotectFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Reprotect") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReprotectPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, reprotectInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Reprotect", nil, "Failure preparing request") + return + } + + result, err = client.ReprotectSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Reprotect", result.Response(), "Failure sending request") + return + } + + return +} + +// ReprotectPreparer prepares the Reprotect request. +func (client ReplicationProtectedItemsClient) ReprotectPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput ReverseReplicationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/reProtect", pathParameters), + autorest.WithJSON(reprotectInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReprotectSender sends the Reprotect request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ReprotectSender(req *http.Request) (future ReplicationProtectedItemsReprotectFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReprotectResponder handles the response to the Reprotect request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ReprotectResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ResolveHealthErrors operation to resolve health issues of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// resolveHealthInput - health issue input object. +func (client ReplicationProtectedItemsClient) ResolveHealthErrors(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput ResolveHealthInput) (result ReplicationProtectedItemsResolveHealthErrorsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.ResolveHealthErrors") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResolveHealthErrorsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, resolveHealthInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ResolveHealthErrors", nil, "Failure preparing request") + return + } + + result, err = client.ResolveHealthErrorsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "ResolveHealthErrors", result.Response(), "Failure sending request") + return + } + + return +} + +// ResolveHealthErrorsPreparer prepares the ResolveHealthErrors request. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput ResolveHealthInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/resolveHealthErrors", pathParameters), + autorest.WithJSON(resolveHealthInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResolveHealthErrorsSender sends the ResolveHealthErrors request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsSender(req *http.Request) (future ReplicationProtectedItemsResolveHealthErrorsFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResolveHealthErrorsResponder handles the response to the ResolveHealthErrors request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) ResolveHealthErrorsResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SwitchProvider operation to initiate a switch provider of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// switchProviderInput - switch provider input. +func (client ReplicationProtectedItemsClient) SwitchProvider(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, switchProviderInput SwitchProviderInput) (result ReplicationProtectedItemsSwitchProviderFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.SwitchProvider") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.SwitchProviderPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, switchProviderInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "SwitchProvider", nil, "Failure preparing request") + return + } + + result, err = client.SwitchProviderSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "SwitchProvider", result.Response(), "Failure sending request") + return + } + + return +} + +// SwitchProviderPreparer prepares the SwitchProvider request. +func (client ReplicationProtectedItemsClient) SwitchProviderPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, switchProviderInput SwitchProviderInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/switchProvider", pathParameters), + autorest.WithJSON(switchProviderInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SwitchProviderSender sends the SwitchProvider request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) SwitchProviderSender(req *http.Request) (future ReplicationProtectedItemsSwitchProviderFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// SwitchProviderResponder handles the response to the SwitchProvider request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) SwitchProviderResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailover operation to perform a test failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// testfailoverInput - test failover input. +func (client ReplicationProtectedItemsClient) TestFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput TestFailoverInput) (result ReplicationProtectedItemsTestFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.TestFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testfailoverInput, + Constraints: []validation.Constraint{{Target: "testfailoverInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "TestFailover", err.Error()) + } + + req, err := client.TestFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, testfailoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailover", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverPreparer prepares the TestFailover request. +func (client ReplicationProtectedItemsClient) TestFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput TestFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailover", pathParameters), + autorest.WithJSON(testfailoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverSender sends the TestFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) TestFailoverSender(req *http.Request) (future ReplicationProtectedItemsTestFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverResponder handles the response to the TestFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) TestFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailoverCleanup operation to clean up the test failover of a replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// cleanupInput - test failover cleanup input. +func (client ReplicationProtectedItemsClient) TestFailoverCleanup(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput TestFailoverCleanupInput) (result ReplicationProtectedItemsTestFailoverCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.TestFailoverCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: cleanupInput, + Constraints: []validation.Constraint{{Target: "cleanupInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "cleanupInput.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "cleanupInput.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", err.Error()) + } + + req, err := client.TestFailoverCleanupPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, cleanupInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "TestFailoverCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverCleanupPreparer prepares the TestFailoverCleanup request. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput TestFailoverCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailoverCleanup", pathParameters), + autorest.WithJSON(cleanupInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverCleanupSender sends the TestFailoverCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupSender(req *http.Request) (future ReplicationProtectedItemsTestFailoverCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverCleanupResponder handles the response to the TestFailoverCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) TestFailoverCleanupResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UnplannedFailover operation to initiate a failover of the replication protected item. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// failoverInput - failover input. +func (client ReplicationProtectedItemsClient) UnplannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput UnplannedFailoverInput) (result ReplicationProtectedItemsUnplannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UnplannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: failoverInput, + Constraints: []validation.Constraint{{Target: "failoverInput.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", err.Error()) + } + + req, err := client.UnplannedFailoverPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.UnplannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UnplannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// UnplannedFailoverPreparer prepares the UnplannedFailover request. +func (client ReplicationProtectedItemsClient) UnplannedFailoverPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput UnplannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/unplannedFailover", pathParameters), + autorest.WithJSON(failoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UnplannedFailoverSender sends the UnplannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UnplannedFailoverSender(req *http.Request) (future ReplicationProtectedItemsUnplannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UnplannedFailoverResponder handles the response to the UnplannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UnplannedFailoverResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update the recovery settings of an ASR replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// updateProtectionInput - update protection input. +func (client ReplicationProtectedItemsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput UpdateReplicationProtectedItemInput) (result ReplicationProtectedItemsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, updateProtectionInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationProtectedItemsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput UpdateReplicationProtectedItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}", pathParameters), + autorest.WithJSON(updateProtectionInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateSender(req *http.Request) (future ReplicationProtectedItemsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateAppliance the operation to update appliance of an ASR replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +// applianceUpdateInput - appliance update protection input. +func (client ReplicationProtectedItemsClient) UpdateAppliance(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput UpdateApplianceForReplicationProtectedItemInput) (result ReplicationProtectedItemsUpdateApplianceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UpdateAppliance") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: applianceUpdateInput, + Constraints: []validation.Constraint{{Target: "applianceUpdateInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "applianceUpdateInput.Properties.TargetApplianceID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationProtectedItemsClient", "UpdateAppliance", err.Error()) + } + + req, err := client.UpdateAppliancePreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName, applianceUpdateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateAppliance", nil, "Failure preparing request") + return + } + + result, err = client.UpdateApplianceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateAppliance", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateAppliancePreparer prepares the UpdateAppliance request. +func (client ReplicationProtectedItemsClient) UpdateAppliancePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput UpdateApplianceForReplicationProtectedItemInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/updateAppliance", pathParameters), + autorest.WithJSON(applianceUpdateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateApplianceSender sends the UpdateAppliance request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateApplianceSender(req *http.Request) (future ReplicationProtectedItemsUpdateApplianceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateApplianceResponder handles the response to the UpdateAppliance request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateApplianceResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateMobilityService the operation to update(push update) the installed mobility service software on a replication +// protected item to the latest available version. +// Parameters: +// fabricName - the name of the fabric containing the protected item. +// protectionContainerName - the name of the container containing the protected item. +// replicationProtectedItemName - 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. +func (client ReplicationProtectedItemsClient) UpdateMobilityService(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest UpdateMobilityServiceRequest) (result ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectedItemsClient.UpdateMobilityService") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateMobilityServicePreparer(ctx, fabricName, protectionContainerName, replicationProtectedItemName, updateMobilityServiceRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateMobilityService", nil, "Failure preparing request") + return + } + + result, err = client.UpdateMobilityServiceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectedItemsClient", "UpdateMobilityService", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateMobilityServicePreparer prepares the UpdateMobilityService request. +func (client ReplicationProtectedItemsClient) UpdateMobilityServicePreparer(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest UpdateMobilityServiceRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicationProtectedItemName": autorest.Encode("path", replicationProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicationProtectedItemName}/updateMobilityService", pathParameters), + autorest.WithJSON(updateMobilityServiceRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateMobilityServiceSender sends the UpdateMobilityService request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectedItemsClient) UpdateMobilityServiceSender(req *http.Request) (future ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateMobilityServiceResponder handles the response to the UpdateMobilityService request. The method always +// closes the http.Response Body. +func (client ReplicationProtectedItemsClient) UpdateMobilityServiceResponder(resp *http.Response) (result ReplicationProtectedItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationprotectioncontainermappings.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationprotectioncontainermappings.go new file mode 100644 index 000000000000..18f6397cd32a --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationprotectioncontainermappings.go @@ -0,0 +1,688 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionContainerMappingsClient is the client for the ReplicationProtectionContainerMappings methods of +// the Siterecovery service. +type ReplicationProtectionContainerMappingsClient struct { + BaseClient +} + +// NewReplicationProtectionContainerMappingsClient creates an instance of the +// ReplicationProtectionContainerMappingsClient client. +func NewReplicationProtectionContainerMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainerMappingsClient { + return NewReplicationProtectionContainerMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionContainerMappingsClientWithBaseURI creates an instance of the +// ReplicationProtectionContainerMappingsClient client using a custom endpoint. Use this when interacting with an +// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationProtectionContainerMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainerMappingsClient { + return ReplicationProtectionContainerMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// creationInput - mapping creation input. +func (client ReplicationProtectionContainerMappingsClient) Create(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput CreateProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, mappingName, creationInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionContainerMappingsClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput CreateProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithJSON(creationInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) CreateSender(req *http.Request) (future ReplicationProtectionContainerMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) CreateResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete or remove a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// removalInput - removal input. +func (client ReplicationProtectionContainerMappingsClient) Delete(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput RemoveProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName, mappingName, removalInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectionContainerMappingsClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput RemoveProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}/remove", pathParameters), + autorest.WithJSON(removalInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) DeleteSender(req *http.Request) (future ReplicationProtectionContainerMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection Container mapping name. +func (client ReplicationProtectionContainerMappingsClient) Get(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result ProtectionContainerMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName, mappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionContainerMappingsClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) GetResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the protection container mappings in the vault. +func (client ReplicationProtectionContainerMappingsClient) List(ctx context.Context) (result ProtectionContainerMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.List") + defer func() { + sc := -1 + if result.pcmc.Response.Response != nil { + sc = result.pcmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pcmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", resp, "Failure sending request") + return + } + + result.pcmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.pcmc.hasNextLink() && result.pcmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionContainerMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionContainerMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) ListResponder(resp *http.Response) (result ProtectionContainerMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainerMappingsClient) listNextResults(ctx context.Context, lastResults ProtectionContainerMappingCollection) (result ProtectionContainerMappingCollection, err error) { + req, err := lastResults.protectionContainerMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainerMappingsClient) ListComplete(ctx context.Context) (result ProtectionContainerMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationProtectionContainers lists the protection container mappings for a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainerMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.pcmc.Response.Response != nil { + sc = result.pcmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectionContainersNextResults + req, err := client.ListByReplicationProtectionContainersPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.pcmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", resp, "Failure sending request") + return + } + + result.pcmc, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "ListByReplicationProtectionContainers", resp, "Failure responding to request") + return + } + if result.pcmc.hasNextLink() && result.pcmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectionContainersPreparer prepares the ListByReplicationProtectionContainers request. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectionContainersSender sends the ListByReplicationProtectionContainers request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectionContainersResponder handles the response to the ListByReplicationProtectionContainers request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersResponder(resp *http.Response) (result ProtectionContainerMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectionContainersNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainerMappingsClient) listByReplicationProtectionContainersNextResults(ctx context.Context, lastResults ProtectionContainerMappingCollection) (result ProtectionContainerMappingCollection, err error) { + req, err := lastResults.protectionContainerMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectionContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectionContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "listByReplicationProtectionContainersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectionContainersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainerMappingsClient) ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainerMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.ListByReplicationProtectionContainers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectionContainers(ctx, fabricName, protectionContainerName) + return +} + +// Purge the operation to purge(force delete) a protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +func (client ReplicationProtectionContainerMappingsClient) Purge(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result ReplicationProtectionContainerMappingsPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, protectionContainerName, mappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationProtectionContainerMappingsClient) PurgePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) PurgeSender(req *http.Request) (future ReplicationProtectionContainerMappingsPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update the operation to update protection container mapping. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// mappingName - protection container mapping name. +// updateInput - mapping update input. +func (client ReplicationProtectionContainerMappingsClient) Update(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput UpdateProtectionContainerMappingInput) (result ReplicationProtectionContainerMappingsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainerMappingsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, protectionContainerName, mappingName, updateInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainerMappingsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationProtectionContainerMappingsClient) UpdatePreparer(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput UpdateProtectionContainerMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "mappingName": autorest.Encode("path", mappingName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}", pathParameters), + autorest.WithJSON(updateInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainerMappingsClient) UpdateSender(req *http.Request) (future ReplicationProtectionContainerMappingsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainerMappingsClient) UpdateResponder(resp *http.Response) (result ProtectionContainerMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationprotectioncontainers.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationprotectioncontainers.go new file mode 100644 index 000000000000..be49ff1fe396 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationprotectioncontainers.go @@ -0,0 +1,677 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionContainersClient is the client for the ReplicationProtectionContainers methods of the +// Siterecovery service. +type ReplicationProtectionContainersClient struct { + BaseClient +} + +// NewReplicationProtectionContainersClient creates an instance of the ReplicationProtectionContainersClient client. +func NewReplicationProtectionContainersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainersClient { + return NewReplicationProtectionContainersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionContainersClientWithBaseURI creates an instance of the ReplicationProtectionContainersClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationProtectionContainersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionContainersClient { + return ReplicationProtectionContainersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create operation to create a protection container. +// Parameters: +// fabricName - unique fabric ARM name. +// protectionContainerName - unique protection container ARM name. +// creationInput - creation input. +func (client ReplicationProtectionContainersClient) Create(ctx context.Context, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput) (result ReplicationProtectionContainersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, protectionContainerName, creationInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionContainersClient) CreatePreparer(ctx context.Context, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}", pathParameters), + autorest.WithJSON(creationInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) CreateSender(req *http.Request) (future ReplicationProtectionContainersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) CreateResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete operation to remove a protection container. +// Parameters: +// fabricName - unique fabric ARM name. +// protectionContainerName - unique protection container ARM name. +func (client ReplicationProtectionContainersClient) Delete(ctx context.Context, fabricName string, protectionContainerName string) (result ReplicationProtectionContainersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationProtectionContainersClient) DeletePreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) DeleteSender(req *http.Request) (future ReplicationProtectionContainersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DiscoverProtectableItem the operation to a add a protectable item to a protection container(Add physical server). +// Parameters: +// fabricName - the name of the fabric. +// protectionContainerName - the name of the protection container. +// discoverProtectableItemRequest - the request object to add a protectable item. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItem(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest) (result ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.DiscoverProtectableItem") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DiscoverProtectableItemPreparer(ctx, fabricName, protectionContainerName, discoverProtectableItemRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "DiscoverProtectableItem", nil, "Failure preparing request") + return + } + + result, err = client.DiscoverProtectableItemSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "DiscoverProtectableItem", result.Response(), "Failure sending request") + return + } + + return +} + +// DiscoverProtectableItemPreparer prepares the DiscoverProtectableItem request. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemPreparer(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/discoverProtectableItem", pathParameters), + autorest.WithJSON(discoverProtectableItemRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DiscoverProtectableItemSender sends the DiscoverProtectableItem request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemSender(req *http.Request) (future ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DiscoverProtectableItemResponder handles the response to the DiscoverProtectableItem request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) DiscoverProtectableItemResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of a protection container. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +func (client ReplicationProtectionContainersClient) Get(ctx context.Context, fabricName string, protectionContainerName string) (result ProtectionContainer, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, protectionContainerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionContainersClient) GetPreparer(ctx context.Context, fabricName string, protectionContainerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) GetResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the protection containers in a vault. +func (client ReplicationProtectionContainersClient) List(ctx context.Context) (result ProtectionContainerCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.List") + defer func() { + sc := -1 + if result.pcc.Response.Response != nil { + sc = result.pcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", resp, "Failure sending request") + return + } + + result.pcc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "List", resp, "Failure responding to request") + return + } + if result.pcc.hasNextLink() && result.pcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionContainersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionContainers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) ListResponder(resp *http.Response) (result ProtectionContainerCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainersClient) listNextResults(ctx context.Context, lastResults ProtectionContainerCollection) (result ProtectionContainerCollection, err error) { + req, err := lastResults.protectionContainerCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainersClient) ListComplete(ctx context.Context) (result ProtectionContainerCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the protection containers in the specified fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationProtectionContainersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result ProtectionContainerCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.pcc.Response.Response != nil { + sc = result.pcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.pcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.pcc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.pcc.hasNextLink() && result.pcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsResponder(resp *http.Response) (result ProtectionContainerCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionContainersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults ProtectionContainerCollection) (result ProtectionContainerCollection, err error) { + req, err := lastResults.protectionContainerCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionContainersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result ProtectionContainerCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// SwitchProtection operation to switch protection from one container to another or one replication provider to +// another. +// Parameters: +// fabricName - unique fabric name. +// protectionContainerName - protection container name. +// switchInput - switch protection input. +func (client ReplicationProtectionContainersClient) SwitchProtection(ctx context.Context, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput) (result ReplicationProtectionContainersSwitchProtectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionContainersClient.SwitchProtection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.SwitchProtectionPreparer(ctx, fabricName, protectionContainerName, switchInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "SwitchProtection", nil, "Failure preparing request") + return + } + + result, err = client.SwitchProtectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionContainersClient", "SwitchProtection", result.Response(), "Failure sending request") + return + } + + return +} + +// SwitchProtectionPreparer prepares the SwitchProtection request. +func (client ReplicationProtectionContainersClient) SwitchProtectionPreparer(ctx context.Context, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/switchprotection", pathParameters), + autorest.WithJSON(switchInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SwitchProtectionSender sends the SwitchProtection request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionContainersClient) SwitchProtectionSender(req *http.Request) (future ReplicationProtectionContainersSwitchProtectionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// SwitchProtectionResponder handles the response to the SwitchProtection request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionContainersClient) SwitchProtectionResponder(resp *http.Response) (result ProtectionContainer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationprotectionintents.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationprotectionintents.go new file mode 100644 index 000000000000..33e061fce9f1 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationprotectionintents.go @@ -0,0 +1,312 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationProtectionIntentsClient is the client for the ReplicationProtectionIntents methods of the Siterecovery +// service. +type ReplicationProtectionIntentsClient struct { + BaseClient +} + +// NewReplicationProtectionIntentsClient creates an instance of the ReplicationProtectionIntentsClient client. +func NewReplicationProtectionIntentsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionIntentsClient { + return NewReplicationProtectionIntentsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationProtectionIntentsClientWithBaseURI creates an instance of the ReplicationProtectionIntentsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewReplicationProtectionIntentsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationProtectionIntentsClient { + return ReplicationProtectionIntentsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create an ASR replication protection intent item. +// Parameters: +// intentObjectName - a name for the replication protection item. +// input - create Protection Intent Input. +func (client ReplicationProtectionIntentsClient) Create(ctx context.Context, intentObjectName string, input CreateProtectionIntentInput) (result ReplicationProtectionIntent, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, intentObjectName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationProtectionIntentsClient) CreatePreparer(ctx context.Context, intentObjectName string, input CreateProtectionIntentInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "intentObjectName": autorest.Encode("path", intentObjectName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) CreateResponder(resp *http.Response) (result ReplicationProtectionIntent, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of an ASR replication protection intent. +// Parameters: +// intentObjectName - replication protection intent name. +func (client ReplicationProtectionIntentsClient) Get(ctx context.Context, intentObjectName string) (result ReplicationProtectionIntent, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, intentObjectName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationProtectionIntentsClient) GetPreparer(ctx context.Context, intentObjectName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "intentObjectName": autorest.Encode("path", intentObjectName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) GetResponder(resp *http.Response) (result ReplicationProtectionIntent, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of ASR replication protection intent objects in the vault. +// Parameters: +// skipToken - the pagination token. +// takeToken - the page size. +func (client ReplicationProtectionIntentsClient) List(ctx context.Context, skipToken string, takeToken string) (result ReplicationProtectionIntentCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.List") + defer func() { + sc := -1 + if result.rpic.Response.Response != nil { + sc = result.rpic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken, takeToken) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rpic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", resp, "Failure sending request") + return + } + + result.rpic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "List", resp, "Failure responding to request") + return + } + if result.rpic.hasNextLink() && result.rpic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationProtectionIntentsClient) ListPreparer(ctx context.Context, skipToken string, takeToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + if len(takeToken) > 0 { + queryParameters["takeToken"] = autorest.Encode("query", takeToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationProtectionIntentsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationProtectionIntentsClient) ListResponder(resp *http.Response) (result ReplicationProtectionIntentCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationProtectionIntentsClient) listNextResults(ctx context.Context, lastResults ReplicationProtectionIntentCollection) (result ReplicationProtectionIntentCollection, err error) { + req, err := lastResults.replicationProtectionIntentCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationProtectionIntentsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationProtectionIntentsClient) ListComplete(ctx context.Context, skipToken string, takeToken string) (result ReplicationProtectionIntentCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationProtectionIntentsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skipToken, takeToken) + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationrecoveryplans.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationrecoveryplans.go new file mode 100644 index 000000000000..477ad3730d5a --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationrecoveryplans.go @@ -0,0 +1,1069 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationRecoveryPlansClient is the client for the ReplicationRecoveryPlans methods of the Siterecovery service. +type ReplicationRecoveryPlansClient struct { + BaseClient +} + +// NewReplicationRecoveryPlansClient creates an instance of the ReplicationRecoveryPlansClient client. +func NewReplicationRecoveryPlansClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryPlansClient { + return NewReplicationRecoveryPlansClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationRecoveryPlansClientWithBaseURI creates an instance of the ReplicationRecoveryPlansClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewReplicationRecoveryPlansClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryPlansClient { + return ReplicationRecoveryPlansClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery Plan creation input. +func (client ReplicationRecoveryPlansClient) Create(ctx context.Context, recoveryPlanName string, input CreateRecoveryPlanInput) (result ReplicationRecoveryPlansCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.PrimaryFabricID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "input.Properties.RecoveryFabricID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "input.Properties.Groups", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationRecoveryPlansClient) CreatePreparer(ctx context.Context, recoveryPlanName string, input CreateRecoveryPlanInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) CreateSender(req *http.Request) (future ReplicationRecoveryPlansCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) CreateResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) Delete(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationRecoveryPlansClient) DeletePreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) DeleteSender(req *http.Request) (future ReplicationRecoveryPlansDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// FailoverCancel the operation to cancel the failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) FailoverCancel(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansFailoverCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.FailoverCancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCancelPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCancel", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCancel", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCancelPreparer prepares the FailoverCancel request. +func (client ReplicationRecoveryPlansClient) FailoverCancelPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCancelSender sends the FailoverCancel request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) FailoverCancelSender(req *http.Request) (future ReplicationRecoveryPlansFailoverCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCancelResponder handles the response to the FailoverCancel request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) FailoverCancelResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// FailoverCommit the operation to commit the failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) FailoverCommit(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansFailoverCommitFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.FailoverCommit") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverCommitPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCommit", nil, "Failure preparing request") + return + } + + result, err = client.FailoverCommitSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "FailoverCommit", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverCommitPreparer prepares the FailoverCommit request. +func (client ReplicationRecoveryPlansClient) FailoverCommitPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCommit", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverCommitSender sends the FailoverCommit request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) FailoverCommitSender(req *http.Request) (future ReplicationRecoveryPlansFailoverCommitFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverCommitResponder handles the response to the FailoverCommit request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) FailoverCommitResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of the recovery plan. +// Parameters: +// recoveryPlanName - name of the recovery plan. +func (client ReplicationRecoveryPlansClient) Get(ctx context.Context, recoveryPlanName string) (result RecoveryPlan, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationRecoveryPlansClient) GetPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) GetResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the recovery plans in the vault. +func (client ReplicationRecoveryPlansClient) List(ctx context.Context) (result RecoveryPlanCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.List") + defer func() { + sc := -1 + if result.RPCVar.Response.Response != nil { + sc = result.RPCVar.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.RPCVar.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", resp, "Failure sending request") + return + } + + result.RPCVar, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "List", resp, "Failure responding to request") + return + } + if result.RPCVar.hasNextLink() && result.RPCVar.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationRecoveryPlansClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) ListResponder(resp *http.Response) (result RecoveryPlanCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryPlansClient) listNextResults(ctx context.Context, lastResults RecoveryPlanCollection) (result RecoveryPlanCollection, err error) { + req, err := lastResults.recoveryPlanCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryPlansClient) ListComplete(ctx context.Context) (result RecoveryPlanCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// PlannedFailover the operation to start the planned failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - failover input. +func (client ReplicationRecoveryPlansClient) PlannedFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput) (result ReplicationRecoveryPlansPlannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.PlannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", err.Error()) + } + + req, err := client.PlannedFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.PlannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "PlannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// PlannedFailoverPreparer prepares the PlannedFailover request. +func (client ReplicationRecoveryPlansClient) PlannedFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/plannedFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PlannedFailoverSender sends the PlannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) PlannedFailoverSender(req *http.Request) (future ReplicationRecoveryPlansPlannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PlannedFailoverResponder handles the response to the PlannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) PlannedFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Reprotect the operation to reprotect(reverse replicate) a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +func (client ReplicationRecoveryPlansClient) Reprotect(ctx context.Context, recoveryPlanName string) (result ReplicationRecoveryPlansReprotectFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Reprotect") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReprotectPreparer(ctx, recoveryPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Reprotect", nil, "Failure preparing request") + return + } + + result, err = client.ReprotectSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Reprotect", result.Response(), "Failure sending request") + return + } + + return +} + +// ReprotectPreparer prepares the Reprotect request. +func (client ReplicationRecoveryPlansClient) ReprotectPreparer(ctx context.Context, recoveryPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/reProtect", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReprotectSender sends the Reprotect request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) ReprotectSender(req *http.Request) (future ReplicationRecoveryPlansReprotectFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReprotectResponder handles the response to the Reprotect request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) ReprotectResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailover the operation to start the test failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan test failover input. +func (client ReplicationRecoveryPlansClient) TestFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverInput) (result ReplicationRecoveryPlansTestFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.TestFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.NetworkType", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "TestFailover", err.Error()) + } + + req, err := client.TestFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailover", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverPreparer prepares the TestFailover request. +func (client ReplicationRecoveryPlansClient) TestFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverSender sends the TestFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) TestFailoverSender(req *http.Request) (future ReplicationRecoveryPlansTestFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverResponder handles the response to the TestFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) TestFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestFailoverCleanup the operation to cleanup test failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan test failover cleanup input. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanup(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput) (result ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.TestFailoverCleanup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Properties.Comments", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "input.Properties.Comments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", err.Error()) + } + + req, err := client.TestFailoverCleanupPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", nil, "Failure preparing request") + return + } + + result, err = client.TestFailoverCleanupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "TestFailoverCleanup", result.Response(), "Failure sending request") + return + } + + return +} + +// TestFailoverCleanupPreparer prepares the TestFailoverCleanup request. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailoverCleanup", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestFailoverCleanupSender sends the TestFailoverCleanup request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupSender(req *http.Request) (future ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestFailoverCleanupResponder handles the response to the TestFailoverCleanup request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) TestFailoverCleanupResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UnplannedFailover the operation to start the unplanned failover of a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - recovery plan unplanned failover input. +func (client ReplicationRecoveryPlansClient) UnplannedFailover(ctx context.Context, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput) (result ReplicationRecoveryPlansUnplannedFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.UnplannedFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", err.Error()) + } + + req, err := client.UnplannedFailoverPreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", nil, "Failure preparing request") + return + } + + result, err = client.UnplannedFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "UnplannedFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// UnplannedFailoverPreparer prepares the UnplannedFailover request. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverPreparer(ctx context.Context, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/unplannedFailover", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UnplannedFailoverSender sends the UnplannedFailover request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverSender(req *http.Request) (future ReplicationRecoveryPlansUnplannedFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UnplannedFailoverResponder handles the response to the UnplannedFailover request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) UnplannedFailoverResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update a recovery plan. +// Parameters: +// recoveryPlanName - recovery plan name. +// input - update recovery plan input. +func (client ReplicationRecoveryPlansClient) Update(ctx context.Context, recoveryPlanName string, input UpdateRecoveryPlanInput) (result ReplicationRecoveryPlansUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryPlansClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, recoveryPlanName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryPlansClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationRecoveryPlansClient) UpdatePreparer(ctx context.Context, recoveryPlanName string, input UpdateRecoveryPlanInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "recoveryPlanName": autorest.Encode("path", recoveryPlanName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryPlansClient) UpdateSender(req *http.Request) (future ReplicationRecoveryPlansUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryPlansClient) UpdateResponder(resp *http.Response) (result RecoveryPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationrecoveryservicesproviders.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationrecoveryservicesproviders.go new file mode 100644 index 000000000000..c339c89e158c --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationrecoveryservicesproviders.go @@ -0,0 +1,700 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationRecoveryServicesProvidersClient is the client for the ReplicationRecoveryServicesProviders methods of the +// Siterecovery service. +type ReplicationRecoveryServicesProvidersClient struct { + BaseClient +} + +// NewReplicationRecoveryServicesProvidersClient creates an instance of the ReplicationRecoveryServicesProvidersClient +// client. +func NewReplicationRecoveryServicesProvidersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryServicesProvidersClient { + return NewReplicationRecoveryServicesProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationRecoveryServicesProvidersClientWithBaseURI creates an instance of the +// ReplicationRecoveryServicesProvidersClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationRecoveryServicesProvidersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationRecoveryServicesProvidersClient { + return ReplicationRecoveryServicesProvidersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to add a recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +// addProviderInput - add provider input. +func (client ReplicationRecoveryServicesProvidersClient) Create(ctx context.Context, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput) (result ReplicationRecoveryServicesProvidersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: addProviderInput, + Constraints: []validation.Constraint{{Target: "addProviderInput.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.MachineName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.AuthenticationIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.AuthenticationIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.ResourceAccessIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.ResourceAccessIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.ObjectID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.Audience", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "addProviderInput.Properties.DataPlaneAuthenticationIdentityInput.AadAuthority", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, fabricName, providerName, addProviderInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationRecoveryServicesProvidersClient) CreatePreparer(ctx context.Context, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithJSON(addProviderInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) CreateSender(req *http.Request) (future ReplicationRecoveryServicesProvidersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) CreateResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to removes/delete(unregister) a recovery services provider from the vault. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Delete(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationRecoveryServicesProvidersClient) DeletePreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/remove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) DeleteSender(req *http.Request) (future ReplicationRecoveryServicesProvidersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of registered recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Get(ctx context.Context, fabricName string, providerName string) (result RecoveryServicesProvider, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationRecoveryServicesProvidersClient) GetPreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) GetResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the registered recovery services providers in the vault. +func (client ReplicationRecoveryServicesProvidersClient) List(ctx context.Context) (result RecoveryServicesProviderCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.List") + defer func() { + sc := -1 + if result.rspc.Response.Response != nil { + sc = result.rspc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rspc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", resp, "Failure sending request") + return + } + + result.rspc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "List", resp, "Failure responding to request") + return + } + if result.rspc.hasNextLink() && result.rspc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationRecoveryServicesProvidersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryServicesProviders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) ListResponder(resp *http.Response) (result RecoveryServicesProviderCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryServicesProvidersClient) listNextResults(ctx context.Context, lastResults RecoveryServicesProviderCollection) (result RecoveryServicesProviderCollection, err error) { + req, err := lastResults.recoveryServicesProviderCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryServicesProvidersClient) ListComplete(ctx context.Context) (result RecoveryServicesProviderCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the registered recovery services providers for the specified fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result RecoveryServicesProviderCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.rspc.Response.Response != nil { + sc = result.rspc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.rspc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.rspc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.rspc.hasNextLink() && result.rspc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsResponder(resp *http.Response) (result RecoveryServicesProviderCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationRecoveryServicesProvidersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults RecoveryServicesProviderCollection) (result RecoveryServicesProviderCollection, err error) { + req, err := lastResults.recoveryServicesProviderCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationRecoveryServicesProvidersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result RecoveryServicesProviderCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// Purge the operation to purge(force delete) a recovery services provider from the vault. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) Purge(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersPurgeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.Purge") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PurgePreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Purge", nil, "Failure preparing request") + return + } + + result, err = client.PurgeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "Purge", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ReplicationRecoveryServicesProvidersClient) PurgePreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) PurgeSender(req *http.Request) (future ReplicationRecoveryServicesProvidersPurgeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) PurgeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RefreshProvider the operation to refresh the information from the recovery services provider. +// Parameters: +// fabricName - fabric name. +// providerName - recovery services provider name. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProvider(ctx context.Context, fabricName string, providerName string) (result ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationRecoveryServicesProvidersClient.RefreshProvider") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RefreshProviderPreparer(ctx, fabricName, providerName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "RefreshProvider", nil, "Failure preparing request") + return + } + + result, err = client.RefreshProviderSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationRecoveryServicesProvidersClient", "RefreshProvider", result.Response(), "Failure sending request") + return + } + + return +} + +// RefreshProviderPreparer prepares the RefreshProvider request. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderPreparer(ctx context.Context, fabricName string, providerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/refreshProvider", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RefreshProviderSender sends the RefreshProvider request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderSender(req *http.Request) (future ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RefreshProviderResponder handles the response to the RefreshProvider request. The method always +// closes the http.Response Body. +func (client ReplicationRecoveryServicesProvidersClient) RefreshProviderResponder(resp *http.Response) (result RecoveryServicesProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationstorageclassificationmappings.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationstorageclassificationmappings.go new file mode 100644 index 000000000000..5c764eb6a1b5 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationstorageclassificationmappings.go @@ -0,0 +1,517 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationStorageClassificationMappingsClient is the client for the ReplicationStorageClassificationMappings +// methods of the Siterecovery service. +type ReplicationStorageClassificationMappingsClient struct { + BaseClient +} + +// NewReplicationStorageClassificationMappingsClient creates an instance of the +// ReplicationStorageClassificationMappingsClient client. +func NewReplicationStorageClassificationMappingsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationMappingsClient { + return NewReplicationStorageClassificationMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationStorageClassificationMappingsClientWithBaseURI creates an instance of the +// ReplicationStorageClassificationMappingsClient client using a custom endpoint. Use this when interacting with an +// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationStorageClassificationMappingsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationMappingsClient { + return ReplicationStorageClassificationMappingsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +// pairingInput - pairing input. +func (client ReplicationStorageClassificationMappingsClient) Create(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput StorageClassificationMappingInput) (result ReplicationStorageClassificationMappingsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName, pairingInput) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationStorageClassificationMappingsClient) CreatePreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput StorageClassificationMappingInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithJSON(pairingInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) CreateSender(req *http.Request) (future ReplicationStorageClassificationMappingsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) CreateResponder(resp *http.Response) (result StorageClassificationMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +func (client ReplicationStorageClassificationMappingsClient) Delete(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result ReplicationStorageClassificationMappingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationStorageClassificationMappingsClient) DeletePreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) DeleteSender(req *http.Request) (future ReplicationStorageClassificationMappingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the specified storage classification mapping. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +// storageClassificationMappingName - storage classification mapping name. +func (client ReplicationStorageClassificationMappingsClient) Get(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result StorageClassificationMapping, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, storageClassificationName, storageClassificationMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationStorageClassificationMappingsClient) GetPreparer(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationMappingName": autorest.Encode("path", storageClassificationMappingName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) GetResponder(resp *http.Response) (result StorageClassificationMapping, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the storage classification mappings in the vault. +func (client ReplicationStorageClassificationMappingsClient) List(ctx context.Context) (result StorageClassificationMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.List") + defer func() { + sc := -1 + if result.scmc.Response.Response != nil { + sc = result.scmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.scmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", resp, "Failure sending request") + return + } + + result.scmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "List", resp, "Failure responding to request") + return + } + if result.scmc.hasNextLink() && result.scmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationStorageClassificationMappingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationStorageClassificationMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) ListResponder(resp *http.Response) (result StorageClassificationMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationMappingsClient) listNextResults(ctx context.Context, lastResults StorageClassificationMappingCollection) (result StorageClassificationMappingCollection, err error) { + req, err := lastResults.storageClassificationMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationMappingsClient) ListComplete(ctx context.Context) (result StorageClassificationMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationStorageClassifications lists the storage classification mappings for the fabric. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassifications(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassificationMappingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.ListByReplicationStorageClassifications") + defer func() { + sc := -1 + if result.scmc.Response.Response != nil { + sc = result.scmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationStorageClassificationsNextResults + req, err := client.ListByReplicationStorageClassificationsPreparer(ctx, fabricName, storageClassificationName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationStorageClassificationsSender(req) + if err != nil { + result.scmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", resp, "Failure sending request") + return + } + + result.scmc, err = client.ListByReplicationStorageClassificationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "ListByReplicationStorageClassifications", resp, "Failure responding to request") + return + } + if result.scmc.hasNextLink() && result.scmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationStorageClassificationsPreparer prepares the ListByReplicationStorageClassifications request. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsPreparer(ctx context.Context, fabricName string, storageClassificationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationStorageClassificationsSender sends the ListByReplicationStorageClassifications request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationStorageClassificationsResponder handles the response to the ListByReplicationStorageClassifications request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsResponder(resp *http.Response) (result StorageClassificationMappingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationStorageClassificationsNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationMappingsClient) listByReplicationStorageClassificationsNextResults(ctx context.Context, lastResults StorageClassificationMappingCollection) (result StorageClassificationMappingCollection, err error) { + req, err := lastResults.storageClassificationMappingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationStorageClassificationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationStorageClassificationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationMappingsClient", "listByReplicationStorageClassificationsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationStorageClassificationsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationMappingsClient) ListByReplicationStorageClassificationsComplete(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassificationMappingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationMappingsClient.ListByReplicationStorageClassifications") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationStorageClassifications(ctx, fabricName, storageClassificationName) + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationstorageclassifications.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationstorageclassifications.go new file mode 100644 index 000000000000..48d09e935d88 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationstorageclassifications.go @@ -0,0 +1,345 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationStorageClassificationsClient is the client for the ReplicationStorageClassifications methods of the +// Siterecovery service. +type ReplicationStorageClassificationsClient struct { + BaseClient +} + +// NewReplicationStorageClassificationsClient creates an instance of the ReplicationStorageClassificationsClient +// client. +func NewReplicationStorageClassificationsClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationsClient { + return NewReplicationStorageClassificationsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationStorageClassificationsClientWithBaseURI creates an instance of the +// ReplicationStorageClassificationsClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationStorageClassificationsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationStorageClassificationsClient { + return ReplicationStorageClassificationsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the details of the specified storage classification. +// Parameters: +// fabricName - fabric name. +// storageClassificationName - storage classification name. +func (client ReplicationStorageClassificationsClient) Get(ctx context.Context, fabricName string, storageClassificationName string) (result StorageClassification, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, storageClassificationName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationStorageClassificationsClient) GetPreparer(ctx context.Context, fabricName string, storageClassificationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "storageClassificationName": autorest.Encode("path", storageClassificationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) GetResponder(resp *http.Response) (result StorageClassification, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the storage classifications in the vault. +func (client ReplicationStorageClassificationsClient) List(ctx context.Context) (result StorageClassificationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.List") + defer func() { + sc := -1 + if result.scc.Response.Response != nil { + sc = result.scc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.scc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", resp, "Failure sending request") + return + } + + result.scc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "List", resp, "Failure responding to request") + return + } + if result.scc.hasNextLink() && result.scc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationStorageClassificationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationStorageClassifications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) ListResponder(resp *http.Response) (result StorageClassificationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationsClient) listNextResults(ctx context.Context, lastResults StorageClassificationCollection) (result StorageClassificationCollection, err error) { + req, err := lastResults.storageClassificationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationsClient) ListComplete(ctx context.Context) (result StorageClassificationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the storage classifications available in the specified fabric. +// Parameters: +// fabricName - site name of interest. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result StorageClassificationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.scc.Response.Response != nil { + sc = result.scc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.scc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.scc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.scc.hasNextLink() && result.scc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsResponder(resp *http.Response) (result StorageClassificationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationStorageClassificationsClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults StorageClassificationCollection) (result StorageClassificationCollection, err error) { + req, err := lastResults.storageClassificationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationStorageClassificationsClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationStorageClassificationsClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result StorageClassificationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationStorageClassificationsClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationvaulthealth.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationvaulthealth.go new file mode 100644 index 000000000000..cab2a6765603 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationvaulthealth.go @@ -0,0 +1,181 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationVaultHealthClient is the client for the ReplicationVaultHealth methods of the Siterecovery service. +type ReplicationVaultHealthClient struct { + BaseClient +} + +// NewReplicationVaultHealthClient creates an instance of the ReplicationVaultHealthClient client. +func NewReplicationVaultHealthClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultHealthClient { + return NewReplicationVaultHealthClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationVaultHealthClientWithBaseURI creates an instance of the ReplicationVaultHealthClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewReplicationVaultHealthClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultHealthClient { + return ReplicationVaultHealthClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get gets the health details of the vault. +func (client ReplicationVaultHealthClient) Get(ctx context.Context) (result VaultHealthDetails, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultHealthClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationVaultHealthClient) GetPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultHealthClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationVaultHealthClient) GetResponder(resp *http.Response) (result VaultHealthDetails, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Refresh sends the refresh request. +func (client ReplicationVaultHealthClient) Refresh(ctx context.Context) (result ReplicationVaultHealthRefreshFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultHealthClient.Refresh") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RefreshPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Refresh", nil, "Failure preparing request") + return + } + + result, err = client.RefreshSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultHealthClient", "Refresh", result.Response(), "Failure sending request") + return + } + + return +} + +// RefreshPreparer prepares the Refresh request. +func (client ReplicationVaultHealthClient) RefreshPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth/default/refresh", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RefreshSender sends the Refresh request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultHealthClient) RefreshSender(req *http.Request) (future ReplicationVaultHealthRefreshFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RefreshResponder handles the response to the Refresh request. The method always +// closes the http.Response Body. +func (client ReplicationVaultHealthClient) RefreshResponder(resp *http.Response) (result VaultHealthDetails, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationvaultsetting.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationvaultsetting.go new file mode 100644 index 000000000000..2f71e5621538 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationvaultsetting.go @@ -0,0 +1,312 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationVaultSettingClient is the client for the ReplicationVaultSetting methods of the Siterecovery service. +type ReplicationVaultSettingClient struct { + BaseClient +} + +// NewReplicationVaultSettingClient creates an instance of the ReplicationVaultSettingClient client. +func NewReplicationVaultSettingClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultSettingClient { + return NewReplicationVaultSettingClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationVaultSettingClientWithBaseURI creates an instance of the ReplicationVaultSettingClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewReplicationVaultSettingClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationVaultSettingClient { + return ReplicationVaultSettingClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to configure vault setting. +// Parameters: +// vaultSettingName - vault setting name. +// input - vault setting creation input. +func (client ReplicationVaultSettingClient) Create(ctx context.Context, vaultSettingName string, input VaultSettingCreationInput) (result ReplicationVaultSettingCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("siterecovery.ReplicationVaultSettingClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, vaultSettingName, input) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationVaultSettingClient) CreatePreparer(ctx context.Context, vaultSettingName string, input VaultSettingCreationInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultSettingName": autorest.Encode("path", vaultSettingName), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) CreateSender(req *http.Request) (future ReplicationVaultSettingCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) CreateResponder(resp *http.Response) (result VaultSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the vault setting. This includes the Migration Hub connection settings. +// Parameters: +// vaultSettingName - vault setting name. +func (client ReplicationVaultSettingClient) Get(ctx context.Context, vaultSettingName string) (result VaultSetting, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, vaultSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationVaultSettingClient) GetPreparer(ctx context.Context, vaultSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultSettingName": autorest.Encode("path", vaultSettingName), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) GetResponder(resp *http.Response) (result VaultSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of vault setting. This includes the Migration Hub connection settings. +func (client ReplicationVaultSettingClient) List(ctx context.Context) (result VaultSettingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.List") + defer func() { + sc := -1 + if result.vsc.Response.Response != nil { + sc = result.vsc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vsc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", resp, "Failure sending request") + return + } + + result.vsc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "List", resp, "Failure responding to request") + return + } + if result.vsc.hasNextLink() && result.vsc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationVaultSettingClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationVaultSettingClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationVaultSettingClient) ListResponder(resp *http.Response) (result VaultSettingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationVaultSettingClient) listNextResults(ctx context.Context, lastResults VaultSettingCollection) (result VaultSettingCollection, err error) { + req, err := lastResults.vaultSettingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationVaultSettingClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationVaultSettingClient) ListComplete(ctx context.Context) (result VaultSettingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationVaultSettingClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationvcenters.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationvcenters.go new file mode 100644 index 000000000000..a64419f70de6 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/replicationvcenters.go @@ -0,0 +1,591 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationvCentersClient is the client for the ReplicationvCenters methods of the Siterecovery service. +type ReplicationvCentersClient struct { + BaseClient +} + +// NewReplicationvCentersClient creates an instance of the ReplicationvCentersClient client. +func NewReplicationvCentersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationvCentersClient { + return NewReplicationvCentersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewReplicationvCentersClientWithBaseURI creates an instance of the ReplicationvCentersClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewReplicationvCentersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationvCentersClient { + return ReplicationvCentersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Create the operation to create a vCenter object.. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +// addVCenterRequest - the input to the add vCenter operation. +func (client ReplicationvCentersClient) Create(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest) (result ReplicationvCentersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, fabricName, vcenterName, addVCenterRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationvCentersClient) CreatePreparer(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithJSON(addVCenterRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) CreateSender(req *http.Request) (future ReplicationvCentersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) CreateResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to remove(unregister) a registered vCenter server from the vault. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +func (client ReplicationvCentersClient) Delete(ctx context.Context, fabricName string, vcenterName string) (result ReplicationvCentersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, fabricName, vcenterName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationvCentersClient) DeletePreparer(ctx context.Context, fabricName string, vcenterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) DeleteSender(req *http.Request) (future ReplicationvCentersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a registered vCenter server(Add vCenter server). +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +func (client ReplicationvCentersClient) Get(ctx context.Context, fabricName string, vcenterName string) (result VCenter, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, fabricName, vcenterName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationvCentersClient) GetPreparer(ctx context.Context, fabricName string, vcenterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) GetResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the vCenter servers registered in the vault. +func (client ReplicationvCentersClient) List(ctx context.Context) (result VCenterCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.List") + defer func() { + sc := -1 + if result.vcc.Response.Response != nil { + sc = result.vcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", resp, "Failure sending request") + return + } + + result.vcc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", resp, "Failure responding to request") + return + } + if result.vcc.hasNextLink() && result.vcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationvCentersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationvCenters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) ListResponder(resp *http.Response) (result VCenterCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationvCentersClient) listNextResults(ctx context.Context, lastResults VCenterCollection) (result VCenterCollection, err error) { + req, err := lastResults.vCenterCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationvCentersClient) ListComplete(ctx context.Context) (result VCenterCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByReplicationFabrics lists the vCenter servers registered in a fabric. +// Parameters: +// fabricName - fabric name. +func (client ReplicationvCentersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result VCenterCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.vcc.Response.Response != nil { + sc = result.vcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationFabricsNextResults + req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.vcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", resp, "Failure sending request") + return + } + + result.vcc, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", resp, "Failure responding to request") + return + } + if result.vcc.hasNextLink() && result.vcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request. +func (client ReplicationvCentersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) ListByReplicationFabricsResponder(resp *http.Response) (result VCenterCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationFabricsNextResults retrieves the next set of results, if any. +func (client ReplicationvCentersClient) listByReplicationFabricsNextResults(ctx context.Context, lastResults VCenterCollection) (result VCenterCollection, err error) { + req, err := lastResults.vCenterCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationFabricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationFabricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationvCentersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result VCenterCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.ListByReplicationFabrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationFabrics(ctx, fabricName) + return +} + +// Update the operation to update a registered vCenter. +// Parameters: +// fabricName - fabric name. +// vcenterName - vcenter name. +// updateVCenterRequest - the input to the update vCenter operation. +func (client ReplicationvCentersClient) Update(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest) (result ReplicationvCentersUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationvCentersClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, fabricName, vcenterName, updateVCenterRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationvCentersClient) UpdatePreparer(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcenterName": autorest.Encode("path", vcenterName), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}", pathParameters), + autorest.WithJSON(updateVCenterRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationvCentersClient) UpdateSender(req *http.Request) (future ReplicationvCentersUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationvCentersClient) UpdateResponder(resp *http.Response) (result VCenter, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/siterecoveryapi/interfaces.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/siterecoveryapi/interfaces.go new file mode 100644 index 000000000000..a008005184a6 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/siterecoveryapi/interfaces.go @@ -0,0 +1,350 @@ +package siterecoveryapi + +// 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. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2022-02-01/siterecovery" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result siterecovery.OperationsDiscoveryCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.OperationsDiscoveryCollectionIterator, err error) +} + +var _ OperationsClientAPI = (*siterecovery.OperationsClient)(nil) + +// ReplicationAlertSettingsClientAPI contains the set of methods on the ReplicationAlertSettingsClient type. +type ReplicationAlertSettingsClientAPI interface { + Create(ctx context.Context, alertSettingName string, request siterecovery.ConfigureAlertRequest) (result siterecovery.Alert, err error) + Get(ctx context.Context, alertSettingName string) (result siterecovery.Alert, err error) + List(ctx context.Context) (result siterecovery.AlertCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.AlertCollectionIterator, err error) +} + +var _ ReplicationAlertSettingsClientAPI = (*siterecovery.ReplicationAlertSettingsClient)(nil) + +// ReplicationAppliancesClientAPI contains the set of methods on the ReplicationAppliancesClient type. +type ReplicationAppliancesClientAPI interface { + List(ctx context.Context, filter string) (result siterecovery.ApplianceCollectionPage, err error) + ListComplete(ctx context.Context, filter string) (result siterecovery.ApplianceCollectionIterator, err error) +} + +var _ ReplicationAppliancesClientAPI = (*siterecovery.ReplicationAppliancesClient)(nil) + +// ReplicationEligibilityResultsClientAPI contains the set of methods on the ReplicationEligibilityResultsClient type. +type ReplicationEligibilityResultsClientAPI interface { + Get(ctx context.Context, virtualMachineName string) (result siterecovery.ReplicationEligibilityResults, err error) + List(ctx context.Context, virtualMachineName string) (result siterecovery.ReplicationEligibilityResultsCollection, err error) +} + +var _ ReplicationEligibilityResultsClientAPI = (*siterecovery.ReplicationEligibilityResultsClient)(nil) + +// ReplicationEventsClientAPI contains the set of methods on the ReplicationEventsClient type. +type ReplicationEventsClientAPI interface { + Get(ctx context.Context, eventName string) (result siterecovery.Event, err error) + List(ctx context.Context, filter string) (result siterecovery.EventCollectionPage, err error) + ListComplete(ctx context.Context, filter string) (result siterecovery.EventCollectionIterator, err error) +} + +var _ ReplicationEventsClientAPI = (*siterecovery.ReplicationEventsClient)(nil) + +// ReplicationFabricsClientAPI contains the set of methods on the ReplicationFabricsClient type. +type ReplicationFabricsClientAPI interface { + CheckConsistency(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsCheckConsistencyFuture, err error) + Create(ctx context.Context, fabricName string, input siterecovery.FabricCreationInput) (result siterecovery.ReplicationFabricsCreateFuture, err error) + Delete(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, filter string) (result siterecovery.Fabric, err error) + List(ctx context.Context) (result siterecovery.FabricCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.FabricCollectionIterator, err error) + MigrateToAad(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsMigrateToAadFuture, err error) + Purge(ctx context.Context, fabricName string) (result siterecovery.ReplicationFabricsPurgeFuture, err error) + ReassociateGateway(ctx context.Context, fabricName string, failoverProcessServerRequest siterecovery.FailoverProcessServerRequest) (result siterecovery.ReplicationFabricsReassociateGatewayFuture, err error) + RenewCertificate(ctx context.Context, fabricName string, renewCertificate siterecovery.RenewCertificateInput) (result siterecovery.ReplicationFabricsRenewCertificateFuture, err error) +} + +var _ ReplicationFabricsClientAPI = (*siterecovery.ReplicationFabricsClient)(nil) + +// ReplicationLogicalNetworksClientAPI contains the set of methods on the ReplicationLogicalNetworksClient type. +type ReplicationLogicalNetworksClientAPI interface { + Get(ctx context.Context, fabricName string, logicalNetworkName string) (result siterecovery.LogicalNetwork, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.LogicalNetworkCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.LogicalNetworkCollectionIterator, err error) +} + +var _ ReplicationLogicalNetworksClientAPI = (*siterecovery.ReplicationLogicalNetworksClient)(nil) + +// ReplicationNetworksClientAPI contains the set of methods on the ReplicationNetworksClient type. +type ReplicationNetworksClientAPI interface { + Get(ctx context.Context, fabricName string, networkName string) (result siterecovery.Network, err error) + List(ctx context.Context) (result siterecovery.NetworkCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.NetworkCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.NetworkCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.NetworkCollectionIterator, err error) +} + +var _ ReplicationNetworksClientAPI = (*siterecovery.ReplicationNetworksClient)(nil) + +// ReplicationNetworkMappingsClientAPI contains the set of methods on the ReplicationNetworkMappingsClient type. +type ReplicationNetworkMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, networkName string, networkMappingName string, input siterecovery.CreateNetworkMappingInput) (result siterecovery.ReplicationNetworkMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result siterecovery.ReplicationNetworkMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, networkName string, networkMappingName string) (result siterecovery.NetworkMapping, err error) + List(ctx context.Context) (result siterecovery.NetworkMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.NetworkMappingCollectionIterator, err error) + ListByReplicationNetworks(ctx context.Context, fabricName string, networkName string) (result siterecovery.NetworkMappingCollectionPage, err error) + ListByReplicationNetworksComplete(ctx context.Context, fabricName string, networkName string) (result siterecovery.NetworkMappingCollectionIterator, err error) + Update(ctx context.Context, fabricName string, networkName string, networkMappingName string, input siterecovery.UpdateNetworkMappingInput) (result siterecovery.ReplicationNetworkMappingsUpdateFuture, err error) +} + +var _ ReplicationNetworkMappingsClientAPI = (*siterecovery.ReplicationNetworkMappingsClient)(nil) + +// ReplicationProtectionContainersClientAPI contains the set of methods on the ReplicationProtectionContainersClient type. +type ReplicationProtectionContainersClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, creationInput siterecovery.CreateProtectionContainerInput) (result siterecovery.ReplicationProtectionContainersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectionContainersDeleteFuture, err error) + DiscoverProtectableItem(ctx context.Context, fabricName string, protectionContainerName string, discoverProtectableItemRequest siterecovery.DiscoverProtectableItemRequest) (result siterecovery.ReplicationProtectionContainersDiscoverProtectableItemFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainer, err error) + List(ctx context.Context) (result siterecovery.ProtectionContainerCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.ProtectionContainerCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.ProtectionContainerCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.ProtectionContainerCollectionIterator, err error) + SwitchProtection(ctx context.Context, fabricName string, protectionContainerName string, switchInput siterecovery.SwitchProtectionInput) (result siterecovery.ReplicationProtectionContainersSwitchProtectionFuture, err error) +} + +var _ ReplicationProtectionContainersClientAPI = (*siterecovery.ReplicationProtectionContainersClient)(nil) + +// ReplicationMigrationItemsClientAPI contains the set of methods on the ReplicationMigrationItemsClient type. +type ReplicationMigrationItemsClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.EnableMigrationInput) (result siterecovery.ReplicationMigrationItemsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, deleteOption string) (result siterecovery.ReplicationMigrationItemsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationItem, err error) + List(ctx context.Context, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, skipToken string, takeToken string, filter string) (result siterecovery.MigrationItemCollectionIterator, err error) + Migrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrateInput siterecovery.MigrateInput) (result siterecovery.ReplicationMigrationItemsMigrateFuture, err error) + Resync(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.ResyncInput) (result siterecovery.ReplicationMigrationItemsResyncFuture, err error) + TestMigrate(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput siterecovery.TestMigrateInput) (result siterecovery.ReplicationMigrationItemsTestMigrateFuture, err error) + TestMigrateCleanup(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput siterecovery.TestMigrateCleanupInput) (result siterecovery.ReplicationMigrationItemsTestMigrateCleanupFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, input siterecovery.UpdateMigrationItemInput) (result siterecovery.ReplicationMigrationItemsUpdateFuture, err error) +} + +var _ ReplicationMigrationItemsClientAPI = (*siterecovery.ReplicationMigrationItemsClient)(nil) + +// MigrationRecoveryPointsClientAPI contains the set of methods on the MigrationRecoveryPointsClient type. +type MigrationRecoveryPointsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string) (result siterecovery.MigrationRecoveryPoint, err error) + ListByReplicationMigrationItems(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationRecoveryPointCollectionPage, err error) + ListByReplicationMigrationItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, migrationItemName string) (result siterecovery.MigrationRecoveryPointCollectionIterator, err error) +} + +var _ MigrationRecoveryPointsClientAPI = (*siterecovery.MigrationRecoveryPointsClient)(nil) + +// ReplicationProtectableItemsClientAPI contains the set of methods on the ReplicationProtectableItemsClient type. +type ReplicationProtectableItemsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, protectableItemName string) (result siterecovery.ProtectableItem, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result siterecovery.ProtectableItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string, filter string, take string, skipToken string) (result siterecovery.ProtectableItemCollectionIterator, err error) +} + +var _ ReplicationProtectableItemsClientAPI = (*siterecovery.ReplicationProtectableItemsClient)(nil) + +// ReplicationProtectedItemsClientAPI contains the set of methods on the ReplicationProtectedItemsClient type. +type ReplicationProtectedItemsClientAPI interface { + AddDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput siterecovery.AddDisksInput) (result siterecovery.ReplicationProtectedItemsAddDisksFuture, err error) + ApplyRecoveryPoint(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput siterecovery.ApplyRecoveryPointInput) (result siterecovery.ReplicationProtectedItemsApplyRecoveryPointFuture, err error) + Create(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input siterecovery.EnableProtectionInput) (result siterecovery.ReplicationProtectedItemsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput siterecovery.DisableProtectionInput) (result siterecovery.ReplicationProtectedItemsDeleteFuture, err error) + FailoverCancel(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsFailoverCancelFuture, err error) + FailoverCommit(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsFailoverCommitFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItem, err error) + List(ctx context.Context, skipToken string, filter string) (result siterecovery.ReplicationProtectedItemCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, filter string) (result siterecovery.ReplicationProtectedItemCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectedItemCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ReplicationProtectedItemCollectionIterator, err error) + PlannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput siterecovery.PlannedFailoverInput) (result siterecovery.ReplicationProtectedItemsPlannedFailoverFuture, err error) + Purge(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsPurgeFuture, err error) + RemoveDisks(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput siterecovery.RemoveDisksInput) (result siterecovery.ReplicationProtectedItemsRemoveDisksFuture, err error) + RepairReplication(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.ReplicationProtectedItemsRepairReplicationFuture, err error) + Reprotect(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput siterecovery.ReverseReplicationInput) (result siterecovery.ReplicationProtectedItemsReprotectFuture, err error) + ResolveHealthErrors(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput siterecovery.ResolveHealthInput) (result siterecovery.ReplicationProtectedItemsResolveHealthErrorsFuture, err error) + SwitchProvider(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, switchProviderInput siterecovery.SwitchProviderInput) (result siterecovery.ReplicationProtectedItemsSwitchProviderFuture, err error) + TestFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput siterecovery.TestFailoverInput) (result siterecovery.ReplicationProtectedItemsTestFailoverFuture, err error) + TestFailoverCleanup(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput siterecovery.TestFailoverCleanupInput) (result siterecovery.ReplicationProtectedItemsTestFailoverCleanupFuture, err error) + UnplannedFailover(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput siterecovery.UnplannedFailoverInput) (result siterecovery.ReplicationProtectedItemsUnplannedFailoverFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput siterecovery.UpdateReplicationProtectedItemInput) (result siterecovery.ReplicationProtectedItemsUpdateFuture, err error) + UpdateAppliance(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput siterecovery.UpdateApplianceForReplicationProtectedItemInput) (result siterecovery.ReplicationProtectedItemsUpdateApplianceFuture, err error) + UpdateMobilityService(ctx context.Context, fabricName string, protectionContainerName string, replicationProtectedItemName string, updateMobilityServiceRequest siterecovery.UpdateMobilityServiceRequest) (result siterecovery.ReplicationProtectedItemsUpdateMobilityServiceFuture, err error) +} + +var _ ReplicationProtectedItemsClientAPI = (*siterecovery.ReplicationProtectedItemsClient)(nil) + +// RecoveryPointsClientAPI contains the set of methods on the RecoveryPointsClient type. +type RecoveryPointsClientAPI interface { + Get(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string) (result siterecovery.RecoveryPoint, err error) + ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.RecoveryPointCollectionPage, err error) + ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.RecoveryPointCollectionIterator, err error) +} + +var _ RecoveryPointsClientAPI = (*siterecovery.RecoveryPointsClient)(nil) + +// TargetComputeSizesClientAPI contains the set of methods on the TargetComputeSizesClient type. +type TargetComputeSizesClientAPI interface { + ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.TargetComputeSizeCollectionPage, err error) + ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result siterecovery.TargetComputeSizeCollectionIterator, err error) +} + +var _ TargetComputeSizesClientAPI = (*siterecovery.TargetComputeSizesClient)(nil) + +// ReplicationProtectionContainerMappingsClientAPI contains the set of methods on the ReplicationProtectionContainerMappingsClient type. +type ReplicationProtectionContainerMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, creationInput siterecovery.CreateProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, removalInput siterecovery.RemoveProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result siterecovery.ProtectionContainerMapping, err error) + List(ctx context.Context) (result siterecovery.ProtectionContainerMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.ProtectionContainerMappingCollectionIterator, err error) + ListByReplicationProtectionContainers(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainerMappingCollectionPage, err error) + ListByReplicationProtectionContainersComplete(ctx context.Context, fabricName string, protectionContainerName string) (result siterecovery.ProtectionContainerMappingCollectionIterator, err error) + Purge(ctx context.Context, fabricName string, protectionContainerName string, mappingName string) (result siterecovery.ReplicationProtectionContainerMappingsPurgeFuture, err error) + Update(ctx context.Context, fabricName string, protectionContainerName string, mappingName string, updateInput siterecovery.UpdateProtectionContainerMappingInput) (result siterecovery.ReplicationProtectionContainerMappingsUpdateFuture, err error) +} + +var _ ReplicationProtectionContainerMappingsClientAPI = (*siterecovery.ReplicationProtectionContainerMappingsClient)(nil) + +// ReplicationRecoveryServicesProvidersClientAPI contains the set of methods on the ReplicationRecoveryServicesProvidersClient type. +type ReplicationRecoveryServicesProvidersClientAPI interface { + Create(ctx context.Context, fabricName string, providerName string, addProviderInput siterecovery.AddRecoveryServicesProviderInput) (result siterecovery.ReplicationRecoveryServicesProvidersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersDeleteFuture, err error) + Get(ctx context.Context, fabricName string, providerName string) (result siterecovery.RecoveryServicesProvider, err error) + List(ctx context.Context) (result siterecovery.RecoveryServicesProviderCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.RecoveryServicesProviderCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.RecoveryServicesProviderCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.RecoveryServicesProviderCollectionIterator, err error) + Purge(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersPurgeFuture, err error) + RefreshProvider(ctx context.Context, fabricName string, providerName string) (result siterecovery.ReplicationRecoveryServicesProvidersRefreshProviderFuture, err error) +} + +var _ ReplicationRecoveryServicesProvidersClientAPI = (*siterecovery.ReplicationRecoveryServicesProvidersClient)(nil) + +// ReplicationStorageClassificationsClientAPI contains the set of methods on the ReplicationStorageClassificationsClient type. +type ReplicationStorageClassificationsClientAPI interface { + Get(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassification, err error) + List(ctx context.Context) (result siterecovery.StorageClassificationCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.StorageClassificationCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.StorageClassificationCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.StorageClassificationCollectionIterator, err error) +} + +var _ ReplicationStorageClassificationsClientAPI = (*siterecovery.ReplicationStorageClassificationsClient)(nil) + +// ReplicationStorageClassificationMappingsClientAPI contains the set of methods on the ReplicationStorageClassificationMappingsClient type. +type ReplicationStorageClassificationMappingsClientAPI interface { + Create(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput siterecovery.StorageClassificationMappingInput) (result siterecovery.ReplicationStorageClassificationMappingsCreateFuture, err error) + Delete(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result siterecovery.ReplicationStorageClassificationMappingsDeleteFuture, err error) + Get(ctx context.Context, fabricName string, storageClassificationName string, storageClassificationMappingName string) (result siterecovery.StorageClassificationMapping, err error) + List(ctx context.Context) (result siterecovery.StorageClassificationMappingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.StorageClassificationMappingCollectionIterator, err error) + ListByReplicationStorageClassifications(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassificationMappingCollectionPage, err error) + ListByReplicationStorageClassificationsComplete(ctx context.Context, fabricName string, storageClassificationName string) (result siterecovery.StorageClassificationMappingCollectionIterator, err error) +} + +var _ ReplicationStorageClassificationMappingsClientAPI = (*siterecovery.ReplicationStorageClassificationMappingsClient)(nil) + +// ReplicationvCentersClientAPI contains the set of methods on the ReplicationvCentersClient type. +type ReplicationvCentersClientAPI interface { + Create(ctx context.Context, fabricName string, vcenterName string, addVCenterRequest siterecovery.AddVCenterRequest) (result siterecovery.ReplicationvCentersCreateFuture, err error) + Delete(ctx context.Context, fabricName string, vcenterName string) (result siterecovery.ReplicationvCentersDeleteFuture, err error) + Get(ctx context.Context, fabricName string, vcenterName string) (result siterecovery.VCenter, err error) + List(ctx context.Context) (result siterecovery.VCenterCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.VCenterCollectionIterator, err error) + ListByReplicationFabrics(ctx context.Context, fabricName string) (result siterecovery.VCenterCollectionPage, err error) + ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result siterecovery.VCenterCollectionIterator, err error) + Update(ctx context.Context, fabricName string, vcenterName string, updateVCenterRequest siterecovery.UpdateVCenterRequest) (result siterecovery.ReplicationvCentersUpdateFuture, err error) +} + +var _ ReplicationvCentersClientAPI = (*siterecovery.ReplicationvCentersClient)(nil) + +// ReplicationJobsClientAPI contains the set of methods on the ReplicationJobsClient type. +type ReplicationJobsClientAPI interface { + Cancel(ctx context.Context, jobName string) (result siterecovery.ReplicationJobsCancelFuture, err error) + Export(ctx context.Context, jobQueryParameter siterecovery.JobQueryParameter) (result siterecovery.ReplicationJobsExportFuture, err error) + Get(ctx context.Context, jobName string) (result siterecovery.Job, err error) + List(ctx context.Context, filter string) (result siterecovery.JobCollectionPage, err error) + ListComplete(ctx context.Context, filter string) (result siterecovery.JobCollectionIterator, err error) + Restart(ctx context.Context, jobName string) (result siterecovery.ReplicationJobsRestartFuture, err error) + Resume(ctx context.Context, jobName string, resumeJobParams siterecovery.ResumeJobParams) (result siterecovery.ReplicationJobsResumeFuture, err error) +} + +var _ ReplicationJobsClientAPI = (*siterecovery.ReplicationJobsClient)(nil) + +// ReplicationPoliciesClientAPI contains the set of methods on the ReplicationPoliciesClient type. +type ReplicationPoliciesClientAPI interface { + Create(ctx context.Context, policyName string, input siterecovery.CreatePolicyInput) (result siterecovery.ReplicationPoliciesCreateFuture, err error) + Delete(ctx context.Context, policyName string) (result siterecovery.ReplicationPoliciesDeleteFuture, err error) + Get(ctx context.Context, policyName string) (result siterecovery.Policy, err error) + List(ctx context.Context) (result siterecovery.PolicyCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.PolicyCollectionIterator, err error) + Update(ctx context.Context, policyName string, input siterecovery.UpdatePolicyInput) (result siterecovery.ReplicationPoliciesUpdateFuture, err error) +} + +var _ ReplicationPoliciesClientAPI = (*siterecovery.ReplicationPoliciesClient)(nil) + +// ReplicationProtectionIntentsClientAPI contains the set of methods on the ReplicationProtectionIntentsClient type. +type ReplicationProtectionIntentsClientAPI interface { + Create(ctx context.Context, intentObjectName string, input siterecovery.CreateProtectionIntentInput) (result siterecovery.ReplicationProtectionIntent, err error) + Get(ctx context.Context, intentObjectName string) (result siterecovery.ReplicationProtectionIntent, err error) + List(ctx context.Context, skipToken string, takeToken string) (result siterecovery.ReplicationProtectionIntentCollectionPage, err error) + ListComplete(ctx context.Context, skipToken string, takeToken string) (result siterecovery.ReplicationProtectionIntentCollectionIterator, err error) +} + +var _ ReplicationProtectionIntentsClientAPI = (*siterecovery.ReplicationProtectionIntentsClient)(nil) + +// ReplicationRecoveryPlansClientAPI contains the set of methods on the ReplicationRecoveryPlansClient type. +type ReplicationRecoveryPlansClientAPI interface { + Create(ctx context.Context, recoveryPlanName string, input siterecovery.CreateRecoveryPlanInput) (result siterecovery.ReplicationRecoveryPlansCreateFuture, err error) + Delete(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansDeleteFuture, err error) + FailoverCancel(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansFailoverCancelFuture, err error) + FailoverCommit(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansFailoverCommitFuture, err error) + Get(ctx context.Context, recoveryPlanName string) (result siterecovery.RecoveryPlan, err error) + List(ctx context.Context) (result siterecovery.RecoveryPlanCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.RecoveryPlanCollectionIterator, err error) + PlannedFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanPlannedFailoverInput) (result siterecovery.ReplicationRecoveryPlansPlannedFailoverFuture, err error) + Reprotect(ctx context.Context, recoveryPlanName string) (result siterecovery.ReplicationRecoveryPlansReprotectFuture, err error) + TestFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanTestFailoverInput) (result siterecovery.ReplicationRecoveryPlansTestFailoverFuture, err error) + TestFailoverCleanup(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanTestFailoverCleanupInput) (result siterecovery.ReplicationRecoveryPlansTestFailoverCleanupFuture, err error) + UnplannedFailover(ctx context.Context, recoveryPlanName string, input siterecovery.RecoveryPlanUnplannedFailoverInput) (result siterecovery.ReplicationRecoveryPlansUnplannedFailoverFuture, err error) + Update(ctx context.Context, recoveryPlanName string, input siterecovery.UpdateRecoveryPlanInput) (result siterecovery.ReplicationRecoveryPlansUpdateFuture, err error) +} + +var _ ReplicationRecoveryPlansClientAPI = (*siterecovery.ReplicationRecoveryPlansClient)(nil) + +// SupportedOperatingSystemsClientAPI contains the set of methods on the SupportedOperatingSystemsClient type. +type SupportedOperatingSystemsClientAPI interface { + Get(ctx context.Context, instanceType string) (result siterecovery.SupportedOperatingSystems, err error) +} + +var _ SupportedOperatingSystemsClientAPI = (*siterecovery.SupportedOperatingSystemsClient)(nil) + +// ReplicationVaultHealthClientAPI contains the set of methods on the ReplicationVaultHealthClient type. +type ReplicationVaultHealthClientAPI interface { + Get(ctx context.Context) (result siterecovery.VaultHealthDetails, err error) + Refresh(ctx context.Context) (result siterecovery.ReplicationVaultHealthRefreshFuture, err error) +} + +var _ ReplicationVaultHealthClientAPI = (*siterecovery.ReplicationVaultHealthClient)(nil) + +// ReplicationVaultSettingClientAPI contains the set of methods on the ReplicationVaultSettingClient type. +type ReplicationVaultSettingClientAPI interface { + Create(ctx context.Context, vaultSettingName string, input siterecovery.VaultSettingCreationInput) (result siterecovery.ReplicationVaultSettingCreateFuture, err error) + Get(ctx context.Context, vaultSettingName string) (result siterecovery.VaultSetting, err error) + List(ctx context.Context) (result siterecovery.VaultSettingCollectionPage, err error) + ListComplete(ctx context.Context) (result siterecovery.VaultSettingCollectionIterator, err error) +} + +var _ ReplicationVaultSettingClientAPI = (*siterecovery.ReplicationVaultSettingClient)(nil) diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/supportedoperatingsystems.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/supportedoperatingsystems.go new file mode 100644 index 000000000000..aec4a79f2830 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/supportedoperatingsystems.go @@ -0,0 +1,110 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SupportedOperatingSystemsClient is the client for the SupportedOperatingSystems methods of the Siterecovery service. +type SupportedOperatingSystemsClient struct { + BaseClient +} + +// NewSupportedOperatingSystemsClient creates an instance of the SupportedOperatingSystemsClient client. +func NewSupportedOperatingSystemsClient(subscriptionID string, resourceGroupName string, resourceName string) SupportedOperatingSystemsClient { + return NewSupportedOperatingSystemsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewSupportedOperatingSystemsClientWithBaseURI creates an instance of the SupportedOperatingSystemsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewSupportedOperatingSystemsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) SupportedOperatingSystemsClient { + return SupportedOperatingSystemsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// Get sends the get request. +// Parameters: +// instanceType - the instance type. +func (client SupportedOperatingSystemsClient) Get(ctx context.Context, instanceType string) (result SupportedOperatingSystems, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SupportedOperatingSystemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, instanceType) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.SupportedOperatingSystemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SupportedOperatingSystemsClient) GetPreparer(ctx context.Context, instanceType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(instanceType) > 0 { + queryParameters["instanceType"] = autorest.Encode("query", instanceType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationSupportedOperatingSystems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SupportedOperatingSystemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SupportedOperatingSystemsClient) GetResponder(resp *http.Response) (result SupportedOperatingSystems, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/targetcomputesizes.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/targetcomputesizes.go new file mode 100644 index 000000000000..b889dc0448d5 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/targetcomputesizes.go @@ -0,0 +1,154 @@ +package siterecovery + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// TargetComputeSizesClient is the client for the TargetComputeSizes methods of the Siterecovery service. +type TargetComputeSizesClient struct { + BaseClient +} + +// NewTargetComputeSizesClient creates an instance of the TargetComputeSizesClient client. +func NewTargetComputeSizesClient(subscriptionID string, resourceGroupName string, resourceName string) TargetComputeSizesClient { + return NewTargetComputeSizesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName) +} + +// NewTargetComputeSizesClientWithBaseURI creates an instance of the TargetComputeSizesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewTargetComputeSizesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) TargetComputeSizesClient { + return TargetComputeSizesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)} +} + +// ListByReplicationProtectedItems lists the available target compute sizes for a replication protected item. +// Parameters: +// fabricName - fabric name. +// protectionContainerName - protection container name. +// replicatedProtectedItemName - replication protected item name. +func (client TargetComputeSizesClient) ListByReplicationProtectedItems(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result TargetComputeSizeCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizesClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.tcsc.Response.Response != nil { + sc = result.tcsc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByReplicationProtectedItemsNextResults + req, err := client.ListByReplicationProtectedItemsPreparer(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", nil, "Failure preparing request") + return + } + + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.tcsc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", resp, "Failure sending request") + return + } + + result.tcsc, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "ListByReplicationProtectedItems", resp, "Failure responding to request") + return + } + if result.tcsc.hasNextLink() && result.tcsc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByReplicationProtectedItemsPreparer prepares the ListByReplicationProtectedItems request. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsPreparer(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "protectionContainerName": autorest.Encode("path", protectionContainerName), + "replicatedProtectedItemName": autorest.Encode("path", replicatedProtectedItemName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceName": autorest.Encode("path", client.ResourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/targetComputeSizes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByReplicationProtectedItemsSender sends the ListByReplicationProtectedItems request. The method will close the +// http.Response Body if it receives an error. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByReplicationProtectedItemsResponder handles the response to the ListByReplicationProtectedItems request. The method always +// closes the http.Response Body. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsResponder(resp *http.Response) (result TargetComputeSizeCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByReplicationProtectedItemsNextResults retrieves the next set of results, if any. +func (client TargetComputeSizesClient) listByReplicationProtectedItemsNextResults(ctx context.Context, lastResults TargetComputeSizeCollection) (result TargetComputeSizeCollection, err error) { + req, err := lastResults.targetComputeSizeCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByReplicationProtectedItemsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByReplicationProtectedItemsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "siterecovery.TargetComputeSizesClient", "listByReplicationProtectedItemsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByReplicationProtectedItemsComplete enumerates all values, automatically crossing page boundaries as required. +func (client TargetComputeSizesClient) ListByReplicationProtectedItemsComplete(ctx context.Context, fabricName string, protectionContainerName string, replicatedProtectedItemName string) (result TargetComputeSizeCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TargetComputeSizesClient.ListByReplicationProtectedItems") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByReplicationProtectedItems(ctx, fabricName, protectionContainerName, replicatedProtectedItemName) + return +} diff --git a/services/recoveryservices/mgmt/2022-02-01/siterecovery/version.go b/services/recoveryservices/mgmt/2022-02-01/siterecovery/version.go new file mode 100644 index 000000000000..8b741286e483 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-02-01/siterecovery/version.go @@ -0,0 +1,19 @@ +package siterecovery + +import "github.com/Azure/azure-sdk-for-go/version" + +// 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. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " siterecovery/2022-02-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +}